Commit Graph

350 Commits

Author SHA1 Message Date
john 804f13bc04 fix(page-data): harden structural delivery and Portal base URL
Reject /api/page-data/ legacy passthrough, verify live API before send,
and resolve delivery links to Portal (8081) instead of Vite (5173).
Add local repair/verify scripts for daily-register Page Data flow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 09:35:40 +08:00
john 249b0697cb fix(page-data): scope finish guard to current delivery 2026-07-13 06:56:27 +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 da422a82e6 fix(wechat): restore session routing exports after merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 22:44:18 +08:00
john 7005b501af Merge branch 'hotfix/page-data-wechat-complete' 2026-07-12 22:43:46 +08:00
john 502334777e fix(page-data): trust live API smoke and WeChat survey submit compat
Stop blocking WeChat delivery when Page Data insert works but publish
quota blocks h5_publish_records; fix smoke URL missing /api; patch survey
radios for WeChat X5 and detect dataset constants in admin pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 22:43:42 +08:00
john 16fd99e8ba fix(page-data): trust live API smoke and WeChat survey submit compat
Stop blocking WeChat delivery when Page Data insert works but publish
quota blocks h5_publish_records; fix smoke URL missing /api; patch survey
radios for WeChat X5 and detect dataset constants in admin pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 22:42:47 +08:00
john 2f7bc3b6e4 fix(csp): allow page-data-client.js in WeChat WebView
WeChat UA uses a relaxed inline CSP without 'self', which blocked
/assets/page-data-client.js and broke public survey submissions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 22:21:57 +08:00
john ca4805533b fix(wechat): isolate page data sessions 2026-07-12 21:13:45 +08:00
john cef3750ac6 fix(page-data): require registered datasets before binding 2026-07-12 18:39:13 +08:00
john 67d529c81e fix(mindspace): keep standalone service data paths under MindSpace root
Prevent Portal .env from overriding MindSpace storage/users roots, and
set launchd env plus runtime docs to use /Users/john/MindSpace paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 18:06:16 +08:00
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