Commit Graph
125 Commits
Author SHA1 Message Date
weichenandCursor d79fdf6ffa feat(web): persist freeform block edits and apply overlay modes
Stop skipping freeform PATCH saves and decorate BlockRenderer for pure/manual/all revision views with clear empty states.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 08:48:32 +00:00
weichen 5e1a7e6584 fix(web): pass bearer auth in document revision api and fix ts unused imports 2026-09-13 08:12:19 +00:00
weichenandCursor 9aafe7bd37 feat(web): persist block edits via revision API and compare UI
Remove hardcoded editor actor, add revision toolbar/history/compare
panels, conflict banner, and notification status actions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 06:15:20 +00:00
weichen 6ab8b52113 fix(taskrun): reject busy documents before run creation 2026-09-13 04:43:50 +00:00
weichen 95ab2badf6 fix(chat): preserve intent and task runtime state 2026-09-13 03:51:18 +00:00
weichenandCursor 995e099026 fix(web): use fatal error class for auth-related chat errors
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:33:34 +00:00
weichenandCursor 38e2e32807 fix(web): satisfy chatRetry task auto-retry type check in docker build
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:32:57 +00:00
weichenandCursor 0c5256c60c fix(web): bind task API to resolved intake key when URS-only pool
When deliverables only expose user_requirements templates, requirement phrases still must POST intake on V0.1. Re-resolve task_key on retry and skip auto-retry for stage gate errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:30:13 +00:00
weichenandCursor d08cbdc2de fix(web): route 初始需求 to intake and map stage 403 errors
Debug logs showed task runs used user_requirements on V0.1 while the active stage only allows intake. Prefer intake for 初始需求/摸底 phrasing and surface DOC_TASK_NOT_IN_ACTIVE_STAGE instead of SESSION_FORBIDDEN.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:28:36 +00:00
weichenandCursor 3afd606635 fix(web): resolve project id from session id for task runs
Task template messages were posting to project_id=1 when local session cache lacked projectId, causing 403 on POST /api/v1/tasks/runs. Parse sess-p{id}-u{user} encoding as fallback and surface HTTP status on task failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:23:53 +00:00
weichenandCursor 8032dce435 fix(chat): rebuild path and clarify stream auth errors
Rebuild dev backend so message visibility uses scope-aware filtering instead of dropping messages without stage_key. Map HTTP 401/403 on chat stream to actionable auth errors instead of generic NETWORK_ERROR.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:20:38 +00:00
weichenandCursor 2636542418 fix(web): repair duplicate else in useChatWindow loadInitialWindow
Remove a stray else branch left from the refresh-state refactor that
broke Vite/esbuild parsing on page reload.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:07:51 +00:00
weichenandCursor b6aebc8176 fix(web): improve chat window refresh state and user-scoped cache
Distinguish authorized-empty and forbidden phases; skip caching day
buckets with zero messages; bind window cache keys to user id.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:06:11 +00:00
weichen 77b8d07cd7 fix(governance): 统一文档访问判定与上下文快照排除计数
补齐 DocumentAccessDecider HTTP 409、projectcontext 私有对话排除统计,并更新整改 gap matrix 与测试报告。
2026-09-13 02:50:23 +00:00
weichenandCursor 574dd16546 fix(frontend): skip hash anchor navigation until session is validated
Avoid chat day fetches with empty session_id on the login page when a stale URL hash is present.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 47984f4863 fix(frontend): gate data fetches until session validated and improve workflow UX
Prevent login-page 401 noise by deferring project/chat API calls until auth is confirmed, use public-config for registration policy, and add client-side duty assignment checks before saving workflow plans.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 90f77eac93 feat(authz): implement six-phase permissions, settings and workflow v2
Close P0 auth gaps for lineage/runs, stage ABAC fail-closed, and
project:create; add IAM migrations 00021-23, me settings APIs, schema v2
manifests, orchestrator skeleton, and gate A regression coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor d7a144de26 feat(taskrun): resume interrupted runs and harden P1 security gaps
Add confirm-gated resume API with resumable flag, Phase 5 finalize fault
and rolling-restart replay tests, Mermaid strict mode, request body limits,
and optional Runner Bearer auth between app and pi-agent.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor b6035991d4 feat(notification): add 24h stage advance reminder and confirm on advance.
Poll pending requests every 15 minutes, emit deduplicated escalation notifications, and close requests when creator confirms stage advance.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 69a3be5463 feat(web): poll stage ready notifications to refresh advance banner.
Poll project notifications every 15s and reload readiness when stage_ready_to_advance arrives.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor e0c39aa38c feat(service): add stage gate readiness and creator-confirmed advance.
Evaluate required document approvals before stage transition, expose readiness/advance APIs, show StageAdvanceBanner in the UI, and keep legacy workflow switch for explicit initial_workflow_key projects.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 1fa6e9aa77 feat(web): add project workflow settings wizard and replace free switcher.
Topbar shows configure/view workflow actions under governance mode with a multi-step ProjectSettingsModal for plan, duty assignment, and confirmed activation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor ebbfc2db18 feat(web): add admin workflows and template library tab
Admin console can list workflow definitions, validate/publish draft versions,
and view bootstrap template assets from the server API.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
weichenandCursor a56d033d3c feat(web): fail-closed capabilities and admin roles from server API
Stop persisting roles to localStorage as authority; AdminSettingsModal reads
and writes role matrices via /api/v1/admin/roles; hasPermission denies when
capabilities are not loaded from /auth/me.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
weichen 47b8179824 feat(web): wire project members CRUD to REST API
Add projectMembers client and role adapter; sync members from server on login and modal open; persist add/update/remove via /api/v1/projects/{id}/members.
2026-09-13 02:50:22 +00:00
weichen 844bfd2803 feat(web): consume server capabilities for RBAC decisions
Fetch and cache capabilities from /auth/me on login and session restore; hasPermission prefers server capabilities over local role definitions.
2026-09-13 02:50:22 +00:00
weichen d612c1193e fix(web): remove identity simulation and stop sending X-User-ID
Product UI no longer switches sessions locally; API clients attach Bearer
tokens only and LocalAuthClient stays test-only outside the prod bundle.
2026-09-13 02:50:22 +00:00
weichen 3145550a59 feat(security): complete P0 release blocking remediation
Unify auth middleware and remove X-User-ID trust, add project_members
authorization, sandbox workspaces via resolver, and admin-only reconcile
by run_id. Introduce goose migrations with startup schema gate, fail closed
when DB unavailable outside explicit ALLOW_IN_MEMORY, bundle web/dist in
app Dockerfile, and remove frontend pseudo-login fallback.
2026-09-13 02:50:22 +00:00
WeiCHENandCursor f4e4357ddb fix(agent): Chat Agent 全链路 P0-P5 整改
封堵鉴权旁路与导出 IDOR,DocGov 改服务端身份;对话层 PendingAction 接真实 docgov/taskrun;修复流式租约假死与会话级任务流;加固配置/doc_id/NULL;补齐 slog 与测试;前端 ErrorBoundary 与受控文档重试。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor 9d40a91f9d feat(web): sync workflow docs from server and persist task artifact in chat
Pass doc_id on task runs, merge server deliverable state by task_key,
fetch controlled document content when opening non-template docs, and
map metadata.artifact after refresh.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor bbd1218922 feat(web): asset upload, task run observer, and session lineage on tasks
Upload binary attachments as project assets, subscribe by run_id after refresh,
and pass session_id/project_id through long-task requests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor 70493a3ed5 feat(web): wire project list and create to server API
Login syncs projects from GET /api/v1/projects; create project uses POST with server-assigned id while preserving local sessions and templates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor 636eb0ccf1 fix(web): align workbench user ids with auth seed
Unify MOCK_USERS with backend auth (admin id=1), merge session identity on login, and migrate demo seeds/tests to id 2/3/4 for 张工/李/王.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor a8c8cba447 fix(web): keep draft when send preflight fails
Return accepted/error from handleSendMessage, clear InputArea only on success, and surface thinking/streaming feedback.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor f9c4f9b01b fix(web): add secure-context-safe clientTurnId helper
Provide RFC 4122 v4 fallback via getRandomValues for LAN HTTP pages where randomUUID is unavailable.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHEN eea28f0be4 feat(task): inject uploaded documents into task materials and enable LAN host access
- backend: add Materials field to TaskRunRequestDTO and forward to ExecuteTask
- backend: add TestTaskStream_MaterialsInjection test case in taskstream_test.go
- web: serialize materials in buildTaskRequest and add unit test
- web: improve isSameMessage identity comparison in messageIdentity.ts
- web: configure host: '0.0.0.0' in vite.config.ts for LAN collaboration access
2026-09-13 02:50:22 +00:00
WeiCHENandCursor 7ab5041c59 refactor(web): stop persisting full message list to localStorage
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor d17fae0a5d feat(web): isolate stream runtime by session and turn
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor f5ead1dcd5 feat(web): send stable client_turn_id and resume turns after disconnect
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor 62ab734021 fix(web): guard chat window fetch races on session switch
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:21 +00:00
WeiCHENandCursor 7c830146f5 test(web): cover real temp vs server message identity
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:21 +00:00
WeiCHENandCursor e1a9b302ba fix(web): merge live and history by serverId and clientTurnId
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:21 +00:00
WeiCHENandCursor 9f7500bb72 fix(web): disable chat stream auto-retry without idempotency
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:21 +00:00
WeiCHENandCursor cda534a75d feat(web): improve chat attachments, unread marks, and session UX
Support richer attachment payloads in input area, local read-id cache for
unread badges, and expand private-shared and chronology test coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:21 +00:00
WeiCHENandCursor 6f4e8c0933 feat(web): align project templates with official reference skeletons
Replace ad-hoc markdown stubs with reference-system template baselines,
free-text device type input, and add template quality regression tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:21 +00:00
WeiCHENandCursor a9fe69ac16 fix(workflow): reconcile version conflicts in review mode and UI retry
Auto-adopt current workflow selection version in review/demo backend
paths, and retry frontend workflow switch after refreshing project version.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:21 +00:00
WeiCHEN 222b0c2dd6 feat(doc-preview): 上传文档多格式在线预览 + IndexedDB 持久化恢复
## 新增功能
- 支持用户上传的 Word(.docx)、PDF、Excel(.xlsx/.csv)、PPT(.pptx)、
  图像(png/jpg/svg/webp等)、纯文本/代码文件的在线高保真预览
- 预览与受控工作流文档严格隔离:上传文档走 FilePreviewPanel,
  工作流/对话入库文档继续走 BlockRenderer,互不干扰

## 核心 Bug 修复
- 修复页面刷新后上传文件无法预览/下载的根本问题
  - 根因:File 对象无法 JSON 序列化,刷新后内存引用丢失
  - 方案:新增 fileStore.ts,使用 IndexedDB 持久化文件二进制内容
  - App 启动时自动 restoreFileRawToDeliverables() 从 IndexedDB 恢复 fileRaw
  - 上传时 saveFile() 同步写入 IndexedDB(fire-and-forget)

## 下载按钮修复
- 优先从内存 File 对象动态创建 blob URL,避免依赖已 revoke 的旧 URL
- 文件内容不可用时按钮禁用并显示 tooltip 说明

## 存储层改进
- saveDeliverables() 序列化前剔除 fileRaw(不可持久化)和 blob: URL
  避免 localStorage 保存损坏的空对象

## 新增文件
- web/src/data/fileStore.ts — IndexedDB 封装(saveFile/getFile/restore)
- web/src/components/doc/preview/FilePreviewPanel.tsx — 预览面板主组件
- web/src/components/doc/preview/renderers/DocxViewer.tsx — Word 预览
- web/src/components/doc/preview/renderers/PdfViewer.tsx  — PDF 预览
- web/src/components/doc/preview/renderers/ExcelViewer.tsx — Excel 预览
- web/src/components/doc/preview/renderers/PptViewer.tsx  — PPT 预览
- web/src/components/doc/preview/renderers/ImageViewer.tsx — 图像预览
- web/src/components/doc/preview/renderers/TextViewer.tsx  — 文本预览
- web/src/tests/file-preview.test.ts — 预览功能单元测试
2026-09-13 02:50:21 +00:00
WeiCHEN 60d4df4319 fix(chat): resolve intent recognition, workflow auth, and message ordering 2026-09-13 02:50:21 +00:00
WeiCHEN 917740f26d feat(project): implement modal-based project creation, creator-led member assignment, and exited-member read-only retention 2026-09-13 02:50:21 +00:00
WeiCHEN eda2a2b32b refactor(dialogue): implement task dispatch notifications and consecutive assistant messages with confirmation cards 2026-09-13 02:50:21 +00:00