Commit Graph

87 Commits

Author SHA1 Message Date
john 320945a485 feat(mindspace): add opt-in local analytics 2026-07-16 21:07:17 +08:00
john 6e460336f7 feat(memory): add gated agent recall and lifecycle controls 2026-07-16 21:07:17 +08:00
john 5f1c4dcaca feat: add optional MindSearch skill orchestration 2026-07-15 13:46:17 +08:00
john a07cf07861 fix(page-data): isolate owner API from public pages 2026-07-15 10:56:22 +08:00
john 72fd88219c fix(mindspace): fail closed on invalid page data delivery 2026-07-14 19:40:47 +08:00
john 27b11894f2 feat(mindspace): gate published page delivery 2026-07-14 19:13:01 +08:00
john a6620fb719 feat(mindspace): enforce PostgreSQL user data delivery 2026-07-13 15:29:29 +08:00
john 7f7aced751 feat(runtime): wire personal memory observation and skill runtime config
Hook shadow pipeline observation into session finish and agent runs, and
expose skill runtime settings through auth and runtime status endpoints.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 14:00:11 +08:00
john cdeb24ba92 fix(page-data): import ensurePageDataHtmlPagesBound in server bootstrap
The bundled portal runtime crashed on boot because workspace deliver referenced
ensurePageDataHtmlPagesBound without importing it from page-data-workspace-ensure.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 00:25:02 +08:00
john fb055c6721 fix(page-data): bind Page Data pages structurally on deliver, not by intent
Finish/sync now auto-registers datasets and binds any HTML using page-data-client.js
before publication, so user confirmation cannot publish unbound collect pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 00:18:49 +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 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 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 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 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 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 81967eaf8c Add wechat reminder LLM toggle 2026-07-07 12:10:21 +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 0ae7a6a677 fix(mindspace): 公开页上传图片物化到 static 路径供转发访问
Finish 同步与首次访问时将私有资产 API 图片复制到 public/.tmp-images,
避免其他用户转发链接后因无登录态无法加载页面内图片。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 17:03:47 +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
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 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 a29158d589 fix: unblock agent events after portal direct chat escalation
When a session starts with LLM direct chat then escalates to goosed,
invalidate the portal-direct-chat snapshot and stop replaying stale SSE
so page-generation turns stream and finish correctly.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 23:15:44 +08:00
john e45c9300bf feat: LLM intent router, direct chat execution, and Memory V2 light intervention
Wire chat intent routing with direct_chat on regular sessions, skill-selected
short-circuit to Agent, memory light/heavy intervention tiers, and fix direct
chat UI stuck streaming after completion.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 22:32:57 +08:00
john 03c46b37c3 fix(og): fall back to thumbnail when declared cover file is missing
WeChat link cards were pointing og:image at mindspace-cover paths that
never landed on disk; serve-time injection now uses thumbnail.png instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 14:07:49 +08:00
john 29d9a87d4f feat: split h5 direct chat from goosed tasks 2026-07-04 14:02:18 +08:00
john 6bc5d128d2 fix(wechat): deliver failure notices and hot-swappable wechat-mp bundle
Notify users when HTML publish guards reject stub pages instead of silently
failing, send real page links when non-stub files exist, and split wechat-mp
into wechat-mp.bundle.mjs for fast production updates without full portal rebuilds.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 12:52:59 +08:00
john 1ac9ad0277 fix: clarify upload errors and raise upload limits 2026-07-04 00:17:58 +08:00
john c3c487a8fb fix: serve MindSpace public assets as same-origin relative URLs
Rewrite absolute tkmind asset download links to /api/... at delivery time
and strip base tags that violate public page CSP, so images load on any host.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-03 23:02:47 +08:00
john 20116b161f Merge Memory V2 runtime facade 2026-07-03 09:46:03 +08:00
john ec5b1a6e3f feat: finalize mindspace service extraction phase a 2026-07-03 08:40:28 +08:00
john b258004dad feat: complete mindspace conversation packages 2026-07-02 23:46:05 +08:00
john 49127d8675 Add conversation package manifest download 2026-07-02 21:58:14 +08:00
john b4ae4a870c Record synced workspace artifacts in packages 2026-07-02 21:55:07 +08:00
john b38dd5961f Record chat docx artifacts in packages 2026-07-02 21:43:38 +08:00
john 0e00ed52cd Test conversation package route boundary 2026-07-02 21:39:28 +08:00
john 32296cb422 Expose conversation package manifests 2026-07-02 21:32:34 +08:00
john 0f48792133 Record uploaded assets in conversation packages 2026-07-02 21:28:51 +08:00
john c2308a6ead Record published pages in conversation packages 2026-07-02 21:24:40 +08:00
john 39e4fffe91 Record page drafts in conversation packages 2026-07-02 21:22:43 +08:00
john f0acaec535 Route quick-share URLs through facade 2026-07-02 21:12:22 +08:00
john ddfa60607a feat: add chat page export actions 2026-07-02 19:52:26 +08:00