Commit Graph

338 Commits

Author SHA1 Message Date
john f9561cd91d fix(mindspace): use UUIDs for repair replies 2026-07-12 15:53:11 +08:00
john 73b308af0a fix(page-data): enforce full workspace bind delivery and repair tooling
Prevent false-positive Finish Guard passes and sync-created fake bindings by assessing publication, policy, dataset, injection, and insert smoke before H5 delivery.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 15:30:52 +08:00
john f437a37660 fix: import consumeSessionEventsUntilFinish for H5 agent runs
H5 chat via POST /api/agent/runs failed with ReferenceError after the
session Finish alignment change; restore the missing import from
session-reply-wait.mjs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 14:47:36 +08:00
tkmind 5704cb11b0 Merge pull request 'fix(page-data): deliver MindSpace workspace URLs for questionnaires' (#9) from release/0712-portal-prep into main
Merge pull request #9: fix(page-data) deliver MindSpace workspace URLs for questionnaires
2026-07-12 06:03:42 +00:00
john b86ce98d6f merge: sync origin/main before portal release 2026-07-12 13:54:27 +08:00
john 294e331a03 fix(page-data): deliver MindSpace workspace URLs instead of /u/.../pages/ routes.
Page Data questionnaires were returning publication slugs to users; password-mode
pages always fell back to /u/ routes. Prefer MindSpace paths at publish time and
rewrite mistaken delivery links in WeChat and Portal chat.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 13:54:24 +08:00
john ee3e405fc7 Merge branch 'codex/portal-resvg-linux-arm64' 2026-07-12 12:19:11 +08:00
john 048f25f580 feat(miniapp): add privacy consent and legal pages
Show privacy popup on launch, gate login on legal consent, and link
user agreement and privacy policy pages in the mini program.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 12:18:54 +08:00
john 8928827291 Merge branch 'codex/0708-dev' 2026-07-12 12:18:51 +08:00
john 4e36b77237 Merge branch 'codex/asset-gateway-foundation' 2026-07-12 12:18:51 +08:00
john dc7b440bfb Merge branch 'hotfix/mindspace-url-canonical-0710' 2026-07-12 12:18:51 +08:00
john fdc2712084 fix: bundle Linux ARM64 resvg runtime dependency 2026-07-12 12:04:02 +08:00
john 680d28ac4b fix: reject missing local mindspace cover files 2026-07-12 10:15:26 +08:00
john f4d9897072 feat: add optional asset gateway control plane 2026-07-12 09:51:13 +08:00
john 7dd6b060f7 merge: stabilize MindSpace local workflows 2026-07-12 08:14:13 +08:00
john a3f669d4e7 fix: stabilize MindSpace local workflows
Signed-off-by: john <cynell@139.com>
2026-07-12 08:12:15 +08:00
john 03a79322e4 Merge origin/main into feature/0711-dev before landing schedule reminder fix. 2026-07-12 08:11:50 +08:00
john 97d0e8d970 fix(schedule): auto-create reminders when agent only writes schedule items
When schedule_create_item includes a start time and reminder intent, create the
matching h5_schedule_reminders row in the same tool call so 10:00 pushes are not
lost. Also reconcile Goose SSE request ids with the portal agent-run gate to keep
MindSpace chat streaming reliable.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 08:11:43 +08:00
john 57a60d41d7 fix(miniapp): persist session token for WeChat login
Return sessionToken from login endpoints and store it client-side because
wx.request cannot rely on Set-Cookie. Also fix multi-cookie parsing,
start on login page, and guard chat rendering fields.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-11 13:05:44 +08:00
john 3163445a9d fix(miniapp): inline createUuid in config to fix DevTools require
WeChat DevTools failed to resolve utils/uuid.js at runtime; move UUID
generation into config.js which is already loaded by app.js.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-11 13:02:34 +08:00
john c842119929 fix(miniapp): add missing uuid and message-display utils
Commit the utility modules required by api.js, messages.js, and chat page
so WeChat DevTools can resolve require('./uuid') at runtime.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-11 13:01:05 +08:00
john 04ef1c9105 feat(auth): add WeChat mini program login endpoint
Add jscode2session exchange, CSRF bypass for servicewechat.com,
and openid-based auto register/login for the mini program client.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-11 12:41:37 +08:00
john fe6d631ba1 fix(miniapp): declare miniprogram root 2026-07-11 09:50:29 +08:00
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 880cd59ca5 fix(mindspace): link inline public html paths 2026-07-10 11:53:03 +08:00
john adc13a167e fix(mindspace): canonicalize public page links without MindSpace segment 2026-07-10 11:39:21 +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 31742f914e Add 103 H5 rich page rollout runbook 2026-07-08 10:33:23 +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