Commit Graph

312 Commits

Author SHA1 Message Date
john b17b2f18cb fix(miniapp): point API client at portal domain 2026-07-11 09:32:33 +08:00
john 0fd34a5644 feat(miniapp): improve session navigation and auth guard 2026-07-11 08:51:30 +08:00
john 9e5a59b7d9 feat(miniapp): scaffold WeChat mini program MVP 2026-07-11 08:46:08 +08:00
john 32fb2cdeaf feat: chat uploads, vision turn isolation, and MindSpace agent improvements
Add chat file/image upload UX, attachment proxying, vision thumbnails, and per-turn image scoping so agents only use the current upload. Extend MindSpace asset context, billing token state, OA/scenario verify scripts, and related runtime config.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-11 00:23:01 +08:00
john e3063ea806 fix(mindspace): refresh published HTML after workspace sync
Keep online publication snapshots aligned when public/*.html changes, default static page binds to public access with MindSpace delivery URLs, and split browser-safe workspace helpers out of the Vite import chain.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 20:44:04 +08:00
john 7f8d692d16 fix(agent): recover stale runs and improve new-user OA delivery
Fix DEV logout cookie clearing, materialize selected MindSpace OA assets before agent runs, and recover zombie runs from synced workspace pages. Add client run wait timeout, harness retry limits, page-edit asset forwarding, and logout/john2 scenario tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 20:05:52 +08:00
john aede1e6fcb fix(mindspace): guard published pages against blocked CDN scripts
Pre-bundle Chart.js, auto-rewrite common CDN references at publish and serve time, and block unknown external script src during publication scans so interactive dashboards keep working under CSP.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 10:27:42 +08:00
john eea14c1855 Add page data delivery and publication guards 2026-07-08 21:10:47 +08:00
john 8d629e7a4e feat(page-data): owner CRUD, public read, and role policy UI
Expose owner PATCH/soft-delete routes, allow anonymous read/stats on
public pages when policy enables read, and add login_required role
editor to the ops panel with tests and doc updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 14:54:14 +08:00
john 6b0c633a75 feat(page-data): complete Phase 4-5, ops UI, and publish integration
Add visitor roles, row-level scope, owner ops APIs, MySQL policy index,
Turnstile captcha, browser client SDK, publish-panel dataset binding,
acceptance tests, and usage documentation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 14:52:49 +08:00
john 8d01553469 feat(page-data): add private and public dataset API (phase 1-3)
Extract UserDataSpaceService for shared SQLite access, wire logged-in Page
Data routes, and add public insert plus password-token read/update/delete with
policy storage, rate limits, and regression tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 12:44:23 +08:00
john 1c8e0db256 docs: clarify development release gates 2026-07-08 12:25:27 +08:00
john ea25058db8 docs: add page data api access plan 2026-07-08 12:25:02 +08:00
john fd364dbbeb fix(plaza): correct similar recall query params 2026-07-07 16:55:38 +08:00
john ea4c6b707c fix(chat-intent): prefer pages for rich publishable content 2026-07-07 15:40:03 +08:00
john 5da4dac16a Merge branch 'codex/reminder-llm-toggle' 2026-07-07 12:10:37 +08:00
john 81967eaf8c Add wechat reminder LLM toggle 2026-07-07 12:10:21 +08:00
john 1e4f432754 fix(chat): 阻止同会话并发 Agent Run 导致消息错乱
前端 submit 改用 chatStateRef 同步拦截连发;后端 createRun 检测同 session 活跃任务并返回 409,避免多条回复交错落库。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 11:48:59 +08:00
john ac520d8ae5 fix(mindspace-public): 公开页区分作者与访客视图 + 图片加载自动重试
工作区直链 /MindSpace/<userId>/public/*.html 此前对所有人(含匿名访客、
转发链接收到的其他登录用户)展示完全相同的悬浮操作按钮,导致非作者也能
看到"发布 Plaza"入口——而 Plaza 发布会把内容归属到操作者自己的账号下,
必须只对作者开放。

- server.mjs: serveUserPublishFile 用现有 session/cookie 鉴权判断访问者是
  否等于 URL 中的 ownerKey,结果透传给 sendPublishFile;该响应内容因人
  而异,显式加 Cache-Control: private, no-store(原来未设置任何缓存头)
- mindspace-public-share-widget.mjs: injectPublicFileShareButton 新增
  isOwner 参数(默认 true 保持兼容),非作者时隐藏"发布 Plaza"按钮与确认
  弹窗,"保存长图"/"公开分享"对所有访客保留
- mindspace-public-delivery.mjs: 透传 isOwner,并注入图片重试脚本
- mindspace-public-image-retry.mjs(新增): 页面级 onerror 之前用捕获阶段
  监听拦截 mindspace 资产图片的加载失败,带退避自动重试 3 次,避免刚生成
  页面时的资产物化竞态被"永久占位符"放大成显示故障

本地起服务用 owner / 非 owner 已登录用户 / 匿名访客三种身份实测验证。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 10:56:26 +08:00
john b4171ca268 chore(test): 新增统一测试入口与端到端场景模拟脚本
- scripts/run-memind-tests.mjs:按改动文件自动匹配 test + verify 范围
  (quick/changed/guards/release/full 模式),配套 memind-test skill
- scripts/run-scenario-test.mjs + scenario-test-lib.mjs:真实登录 + 多轮
  聊天 + 页面生成 + 公网可访问性的端到端模拟,配套 memind-scenario-test
  skill 与首个场景 scenarios/suzhou-page.json
- package.json 新增 test:memind / test:scenario 脚本别名

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 10:56:26 +08:00
john ec8d0464a3 fix(chat-intent): 隐式攻略/页面生成请求直接路由到 static-page-publish
短句如"苏州攻略页面"此前会被规则/LLM 误判为 product-campaign-page(先追问
促销信息),导致用户体验成"卡住不动"。规则层扩大页面生成意图识别,并新增
coercePageGenerationSkill 在 LLM 判为 product-campaign-page 但明显是内容页
时强制纠正为 static-page-publish,避免不必要的追问。同步更新两个技能文档
的适用边界说明。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 10:56:26 +08:00
john 7edafefc56 fix(mindspace): 生成页面统一使用中文友好无衬线字体
页脚品牌行、纯文字页面模板与技能提示词此前用 Georgia/Times 衬线体,中文渲染
效果差;统一改为系统无衬线字体栈(PingFang SC / Microsoft YaHei 等)。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 10:56:26 +08:00
john 0d6258d00a chore: remove mm.tkmind.cn references 2026-07-07 10:01:32 +08:00
john cf04e73f51 docs(ops): 同步 103 生产 goosed 扩容为 9 实例
确认 goosed-prod-1..9 映射 18006-18014,更新 topology、发包必看、
发布 skill 与 release 脚本的动态 pool 校验。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 09:22:40 +08:00
john 5485cc563b merge origin/main: 合并 runtime bundle 修复与本地图片物化/build 修复 2026-07-07 09:09:32 +08:00
tkmind 0edd531ed9 Merge pull request 'fix(ops): 将 goose session postgres ensure 脚本打入 runtime 包' (#8) from fix/goose-session-postgres-runtime-bundle into main 2026-07-06 09:11:59 +00:00
john 84bc03c9ba fix(ops): 将 goose session postgres ensure 脚本打入 runtime 包
发版后 Portal live 目录为无源码 runtime,ensure 脚本需随包发布;文档与发布检查改为引用 goosed-prod 稳定路径作为 103 兜底。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 17:11:40 +08:00
john 3befb0e257 fix(build): runtime 清理失败时回退 shell rm -rf
避免 macOS 上 pnpm node_modules 树导致 ENOTEMPTY 阻断发布构建。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 17:06:06 +08:00
john 0ae7a6a677 fix(mindspace): 公开页上传图片物化到 static 路径供转发访问
Finish 同步与首次访问时将私有资产 API 图片复制到 public/.tmp-images,
避免其他用户转发链接后因无登录态无法加载页面内图片。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 17:03:47 +08:00
tkmind 1077dd9b97 Merge pull request 'fix(ops): 自愈 goosed 会话 PostgreSQL,防止 H5 卡在创建新对话' (#7) from fix/goose-session-postgres-ensure into main 2026-07-06 09:01:25 +00:00
john b6def0f25b fix(ops): 自愈 goosed 会话 PostgreSQL,防止 H5 卡在创建新对话
103 Colima goosed 依赖宿主机 postgresql@17;库停止时 /agent/start 会 pool timeout 约 60s。新增 ensure 脚本、接入监控与发布前检查,并补充拓扑文档。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 16:57:38 +08:00
john ecf553754c docs: 记录 103 发布 0706007 备份路径与回退步骤
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 16:14:07 +08:00
john 14a00774d9 feat(h5): web 联网能力、实时查询路由与 session Finish 对齐
- 新增 web 能力并挂载 platform/web(web_search/fetch_url)
- 实时查询强制 web skill,router fallback 与 await session Finish
- Session Broker 覆盖率/指标、stream replay 与相关单测/E2E 脚本

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 16:06:26 +08:00
john 08feae8bef feat(h5-session): Session Broker、run SSE replay 与 Finish 竞态修复
落地 H5 Session 架构 Patch 1–5(Broker 收口、Router decision、SSE taxonomy、goosed 边界检查),
并新增可选 MEMIND_RUN_STREAM_REPLAY run 事件回放与 H5 假交付 guard;修复 Finish 先于 agent-run
gate 导致 UI 永久 loading 的竞态,接入 verify:h5-session-patches 回归脚本。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 14:19:48 +08:00
john e2ad3bf62b feat(mindspace): 公开页分享组件、workspace 路径与 Plaza 发布增强
- 新增 public share widget 与 workspace relative path 解析
- 增强 publications/chat-plaza 发布链路与缩略图 demo
- 补充 schema、cover 检查脚本与回归测试

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 23:14:41 +08:00
tkmind 69be1e5293 Merge pull request 'feat(plaza-ops): 运营后台帖子管理 API' (#6) from feature/plaza-ops-admin into main
Merge pull request #6: Plaza 运营后台帖子管理 API
2026-07-05 12:18:22 +00:00
john 0c2cb9e283 feat(plaza-ops): add post management API for admin console
Expose categories listing, category filter on review queue, and invalidate
feed caches when ops hides a published post.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 20:18:02 +08:00
tkmind dd091e6e2c Merge pull request 'feat(chat): Plaza 一键发布 + publication RPC 错误映射' (#5) from feature/rpc-publication-errors into main
Merge pull request #5: Plaza 一键发布 + publication RPC 错误映射
2026-07-05 12:01:42 +00:00
john 8755928405 fix(mindspace): expose findPageBySourceMessage on remote pageService adapter.
Quick Plaza publish resolves existing chat pages by session/message id; production remote adapter rejected the RPC because the binding contract omitted this method.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 19:58:42 +08:00
john 3318c04490 feat(chat): add one-click Plaza publish for HTML page messages.
Speed up the quick-plaza path with session snapshot reads, publish timeouts, and a modal fix so parent re-renders no longer abort in-flight requests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 19:58:39 +08:00
john 53eb0014ba fix(mindspace): map publication RPC errors to HTTP status codes
Return 404/401/403 from MindSpace RPC for known publication errors and
preserve error codes through the Portal remote adapter.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 19:44:58 +08:00
john 85061dfa9f fix: stream Goosed page replies into chat without waiting for agent run
Subscribe session SSE as soon as the Goosed session is known, keep request
context during waiting, and poll session snapshots so page results appear
in the conversation while generation is still running.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 12:25:52 +08:00
john 1165ebf684 fix: normalize Goosed reply payload and restart agent-run worker on release
Add id/created defaults for user_message, ensure metadata in agent-run
gateway before submit, and kickstart the agent-run worker after portal deploy
so queued page-generation runs use the latest runtime bundle.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 12:04:31 +08:00
john cb7a446d3e fix: ensure userVisible metadata on Goosed session replies
Goosed rejects /sessions/:id/reply when user_message.metadata lacks
userVisible. Normalize metadata before submit and during agent orchestration
so page-generation runs no longer fail before streaming starts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 11:58:17 +08:00
john 5f8ef9ddb0 fix: make MindSpace docx repair script runtime-safe
Avoid importing mindspace-public-finish-sync in production runtime so release
link repair can copy oa docx files or strip broken anchors without extra deps.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 11:29:17 +08:00
john 00a00a1f69 fix: portal stability, session list DB fallback, and UX polish
- Free stale Memind listeners on 8081 before startup and exit cleanly on EADDRINUSE
- Backfill owned sessions missing from Goose via h5_conversation_messages summaries
- Strip Memind task orchestration prefixes from user-facing chat text
- Repair missing public docx links before release MindSpace link checks

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 11:26:34 +08:00
john bdeab23b83 fix: persist direct chat transcript before Goosed escalation
Prevent portal direct-chat history from being lost when snapshot cache
is invalidated on Goosed submit by writing non-empty messages to DB first,
and stop caching empty Goose placeholder messages in snapshots.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 11:16:55 +08:00
john 614837e199 fix: repair chat history from DB when Goose session has empty placeholders
Portal direct chat → goosed escalation can leave hollow Goose messages while
h5_conversation_messages retains the full dialogue. Backfill session detail
from DB, extend snapshot list fallback, and keep stored session id on transient
boot failures so refresh no longer looks like a blank new chat.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 11:04:25 +08:00
john d3239ff292 fix: MindSpace remote sync, thumbnail fallback, and Plaza URL guards
Ensure page sync runs via pageSyncService in remote mode, fall back to
workspace HTML when storage assets are missing, and prevent production
Portal from linking to loopback Plaza URLs baked in at build time.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 07:57:04 +08:00
john 4781bbc156 fix: stop chat hang after misrouted themed article requests
Route themed page/article prompts to agent orchestration, reject them
from portal direct chat, and finalize regular sessions to idle when a
direct chat turn already completed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 07:30:37 +08:00