Initial team BPM workspace with managed connections, scanning and mail templates
This commit is contained in:
commit
34770ed338
101 files changed
+6499
No files matched your search
@@ -0,0 +1,62 @@
|
||||
# Application Framework Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development. Steps use checkbox syntax for tracking.
|
||||
|
||||
**Goal:** 搭建可运行、可演示的多人订单工作台框架,暂不执行订单处理规则。
|
||||
|
||||
**Architecture:** 既有 dashboard 账号认证保护新增 workspace API。SQLite 保存业务日历、异常和连接元数据;独立浏览器模块渲染新增页面;隔离演示服务提供可查看的样例。
|
||||
|
||||
**Tech Stack:** Node.js >=22.13、CJS、node:sqlite、Tabler 1.6.1、原生浏览器 JS。
|
||||
|
||||
**Spec:** docs/superpowers/specs/2026-10-16-application-framework-design.md
|
||||
|
||||
## Global Constraints
|
||||
|
||||
- 知会不自动处理,业务规则后续确定;自动发送永远关闭。
|
||||
- 新 BPM 主站 bpmn.skyworthdigital.com,详情 bpm.skyworthdigital.com。
|
||||
- 没有 Git 仓库,直接在已指定工作目录开发;不虚构提交或分支。
|
||||
- 真实登录画面、凭据存储、ZCode 和通知本次只保留接入边界,不能显示已成功连接。
|
||||
- 不写入或提取用户当前 BPM 会话。
|
||||
|
||||
## 接口合同
|
||||
|
||||
`GET /api/workspace` 返回 `{calendar:{version,overrides},exceptions,connections,supervisor:{version,defaultOwner,notifyChannel,maxAttempts},audit,members,capabilities:{remoteLogin:false,zcode:false,automaticProcessing:false},stats}`。
|
||||
|
||||
`POST /api/calendar` 管理员保存 `{version,overrides:[{date,kind,scan,send,note}]}`,kind 为 workday/restday/pause,返回 calendar。
|
||||
|
||||
`POST /api/exceptions` 操作员/管理员提交 `{title,component,priority,description,owner}`,返回 exception。component 为 bpm/pdf/archive/mail/system/rules;priority 为 normal/high/critical。
|
||||
|
||||
`POST /api/exceptions/:id/action` 提交 `{version,action,owner?,note?}`,action 为 claim/transfer/verify/resolve/reopen,返回 exception。owner 使用 username。
|
||||
|
||||
`POST /api/connections` 管理员创建 `{name,owner}`,返回 connection,status 固定 disconnected;`POST /api/connections/:id/disable` 停用;不提供伪造登录态接口。
|
||||
|
||||
`POST /api/supervisor` 管理员保存 `{version,defaultOwner,notifyChannel,maxAttempts}`,渠道 none/manual,次数 0–3,均为策略草稿;返回 supervisor。GET 中 members 为 `{username,role}` 列表。
|
||||
|
||||
### Task 1: Backend workspace ledger and protected APIs
|
||||
|
||||
Files: src/workspace-store.cjs, src/workspace-api.cjs, src/dashboard.cjs, src/schedule.cjs, tests/workspace.test.cjs, tests/workspace-http.test.cjs.
|
||||
|
||||
- [x] 先写并运行持久化、日期覆盖、并发认领、权限和同源测试,确认缺失行为失败。
|
||||
- [x] 实现 SQLite 事务、有效值校验、版本冲突、独立审计。构造 `new WorkspaceStore(dir)`,提供 `snapshot(members)`、`saveCalendar(input,actor)`、`createException(input,actor,members)`、`actOnException(id,input,actor,members)`、`createConnection(input,actor,members)`、`disableConnection(id,actor)`、`saveSupervisor(input,actor,members)`、`close()`。
|
||||
- [x] dashboard 允许 `{workspace,previewUserId}` 选项;`GET /api/bootstrap/status` 额外返回 preview 布尔值;预览登录仅在配置 previewUserId 且 loopback 时由同源 `POST /api/preview-login` 签入该用户。正式实例没有此捷径。
|
||||
- [x] `nextSlots(schedule,from,count,overrides=[])` 使用 send 覆盖,另导出 dayPolicy(date,schedule,overrides) 返回 `{scan,send,kind,note}`。
|
||||
- [x] 运行新增与原测试,交付更改清单和测试证据。
|
||||
|
||||
### Task 2: Functional workspace UI
|
||||
|
||||
Files: web/workspace.js, web/app.js, web/index.html, web/app.css.
|
||||
|
||||
- [x] 复用当前认证与视图路由,独立 `window.WorkspaceViews` 提供 overview/calendar/exceptions/bpm/supervisor 渲染器,调用 `configure({api,esc,formatDate,notify,user})`,每个渲染器接受 `(container,isActive)`,防止过期响应覆盖。
|
||||
- [x] 新总览展示能力状态、日历、异常、连接及最近活动,示例数据显式标识;保留 PDF 列表入口。calendar 月历可翻月、选日期、编辑公司覆盖、恢复默认并保存。
|
||||
- [x] 异常建立/搜索筛选/认领/转交/提交验证/填写核验依据关闭,显示历史和负责人。连接创建/停用可用,远程登录按钮禁用并解释接入状态。监管可保存草稿,无真实 AI/通知开关。
|
||||
- [x] 首页保留普通账号登录;仅 preview=true 时提供“进入演示空间”按钮调用 preview-login。
|
||||
- [x] 原导航测试与浏览器表单回归。
|
||||
|
||||
### Task 3: Runtime, isolated preview and verification
|
||||
|
||||
Files: src/server.cjs, scripts/preview.cjs, package.json, README.md, 启动看板预览.cmd.
|
||||
|
||||
- [x] 正式服务本地数据目录初始化 WorkspaceStore 并注入,退出时释放;新增 npm run preview。
|
||||
- [x] 演示数据独立目录,生成随机预览账号密码,不输出凭据;只在演示进程注入 previewUserId,绑定 loopback,预置虚构异常和连接,显式示例。
|
||||
- [x] 运行全套 node tests 和 JS 语法检查,启动正式和演示服务,浏览器验证日历保存及异常流转,截图并打开成品。
|
||||
- [x] 更新 README 的能力范围、端口、运行方法和未接入边界。
|
||||
Reference in new issue
Block a user