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,40 @@
|
||||
# PDF Export Tool Implementation Plan
|
||||
|
||||
> **For agentic workers:** Execute inline using executing-plans. No delegation required.
|
||||
|
||||
**Goal:** Reuse a logged-in Chrome order tab to export a named PDF without a print dialog.
|
||||
|
||||
**Architecture:** MV3 extension captures a static visible form and permitted assets, then POSTs it to a paired loopback Node service. An isolated offline Chromium process renders the PDF, with exclusive filename reservation preventing overwrite.
|
||||
|
||||
**Tech Stack:** Node.js 22+, playwright-core, Chrome MV3, node:test.
|
||||
|
||||
**Spec:** docs/tool-design.md
|
||||
|
||||
## Global Constraints
|
||||
|
||||
- No remote debugging port or account credential persistence.
|
||||
- Only user-triggered captures of https://bpm.skyworthdigital.com/.
|
||||
- Local helper listens on 127.0.0.1:18765; requests need extension Origin and random pairing token.
|
||||
- Four naming fields required; existing files preserved.
|
||||
- Browser renderer has scripts and network disabled.
|
||||
|
||||
## Task 1: Export core
|
||||
|
||||
- [x] Write tests for missing fields, Windows-safe names, collision preservation and real PDF bytes.
|
||||
- [x] Run `node --test tests/core.test.cjs` and confirm missing functionality fails.
|
||||
- [x] Implement `src/exporter.cjs`: `buildFilename(metadata)`, `renderSnapshot(snapshot, options)` and offline browser lifecycle.
|
||||
- [x] Run tests using installed Chrome and local fixture markup.
|
||||
|
||||
## Task 2: Browser capture and bridge
|
||||
|
||||
- [x] Write DOM fixture tests for `captureOrder()` bindings, live values and hidden secrets removal; write HTTP tests for origin, token and size checks.
|
||||
- [x] Confirm tests fail before implementation.
|
||||
- [x] Implement extension capture, asset bundling and popup; implement `src/server.cjs` with authenticated POST `/export` and GET `/health`.
|
||||
- [x] Run tests; malformed submissions must never start a renderer or write a file.
|
||||
|
||||
## Task 3: Packaging and acceptance
|
||||
|
||||
- [x] Add direct Node Windows command launcher, configuration example, dependency setup and Chinese README.
|
||||
- [x] Run full tests and real captured-page regression, render the resulting PDF and inspect pages.
|
||||
- [x] Check extension manifest and scripts; document that live extension loading requires user action and is not yet verified.
|
||||
- [x] Deliver startup and extension-loading paths, output naming and exact verification limits.
|
||||
@@ -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 的能力范围、端口、运行方法和未接入边界。
|
||||
@@ -0,0 +1,22 @@
|
||||
# SDD ledger — plan: docs/superpowers/plans/2026-10-16-bpm-credentials.md
|
||||
|
||||
Authorization: user explicitly said '可以的,账号也需要托管。' after first real login deployment.
|
||||
Ruling: extend encrypted vault to host BPM account/password; previous no-password-persistence stance is superseded by this explicit request. Password never returned/logged or captured implicitly from remote typing.
|
||||
Ruling (superseded): initial fill-only restriction replaced by explicit user requirement for automatic custody and no repeated login. Cookie-first ensure, verified SSO auto-submit, challenge-only manual intervention; business processing remains later scope.
|
||||
Ruling: current designated non-Git workspace is implementation destination; no worktree/commits.
|
||||
|
||||
| Interface/task | Check | Outcome |
|
||||
|---|---|---|
|
||||
| 1 ↔ 2 | account GET/POST, clear and fill verbs/shapes | exact shared contract above |
|
||||
| 1 ↔ 3 | no secret metadata/audit, restart/disable lifecycle | explicit tests and review |
|
||||
| Task 1 | reuse vault no plaintext credential storage | consistent |
|
||||
| Task 2 | write-only password form, stale-page guards | consistent |
|
||||
| Task 3 | production user enters credentials | no need agent account access |
|
||||
|
||||
Existing deployed first-step baseline: 54/54 tests, actual service PID42884 ports18765/18766, no preview listener, one real admin and BPM主连接 preserved; pending actual user login.
|
||||
|
||||
Parent implementation: dashboard-sessions.cjs persists hashed workbench tokens for 30 sliding days and revocation across restarts; RED missing module/restart401 -> GREEN2/2. bpm-custodian.cjs startup and 5-minute sequential ensure, no overlap, interactive/disabled skip, stop waits; RED absent -> GREEN2/2. Runtime lifecycle integrated. Backend/UI independent tasks implement credential encryption, safe metadata, exact forms, automatic reuse/cooldown, interface password clearing and navigation lifecycle. Full regression/review/deployment pending.
|
||||
|
||||
Final: all three implementation tasks and independent review complete. Full final suite 76/76 PASS; syntax38/38 PASS; backend focused27/27 PASS. Review P2 partial portal state loss reproduced and fixed; repeated ensure/restart now retains portal without repeated password submission. Whole UI+server+real local browser integration covers account save after manual login, positive cookie reuse, no secret metadata/password DOM return. Actual production restarted once after all checks: PID23632 ports18765/18766, required=false/preview=false, stderr empty. Original user and connection kept; no real managed credential entered by agent, actual BPM authenticated renewal/30 elapsed days not claimed. User only needs initial account entry in product; no repeated permission/login prompts introduced.
|
||||
|
||||
Latest user ruling: only new BPM, no legacy maintenance. Removed legacy auth origin/form/probe/navigation/UI/check and partial results. Portal positive identity alone is connected. Added transactional connection metadata migration preserving owner/identity/lastConnectedAt and stripping old fields. RED portal-only/detail rejection/old-origin regressions -> GREEN; final complete suite79/79, syntax39/39, independent delta review29/29 approved. Production PID18800 ports18765/18766 healthy, stderr empty, one existing user and one connection retained, no legacy fields. Cookie custody/automatic checks/30-day workbench sessions retained. No real credentials or business mutations.
|
||||
@@ -0,0 +1,58 @@
|
||||
# BPM Account Custody Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development to implement this plan task-by-task.
|
||||
|
||||
**Goal:** 为实际 BPM 连接增加加密账号托管、Cookie 复用、自动保活/续登及持久 30 天工作台登录。
|
||||
**Architecture:** 复用 AES-GCM/DPAPI vault 的独立 account:id 条目,API 只返回账号元数据,远程浏览器只在已验证登录控件填入。
|
||||
**Tech Stack:** Existing Node CJS/Playwright/Tabler/vault.
|
||||
**Spec:** docs/superpowers/specs/2026-10-16-bpm-login-design.md 已授权的账号托管补充。
|
||||
|
||||
**最新范围(取代下文旧版/双入口描述)**:用户明确只维护新版 BPM。仅 bpmn.skyworthdigital.com 与其 sso 登录跳转;移除旧版域名白名单、表单、导航、检查与 UI,portal 正向验证即 connected,checks 仅 portal,不再 partial。现有连接迁移去除旧字段,保留负责人、会话和业务数据。新版托管、30 天工作台会话、5 分钟保活与验证码人工介入继续适用。
|
||||
|
||||
## Global Constraints
|
||||
|
||||
- 用户已明确要求账号托管;不创建、重置或显示真实密码;用户在产品页面自行输入。
|
||||
- 不记录密码或截图;按用户后续明确要求自动托管,仅在正向确认需登录的已验证 SSO 表单提交凭据;不代解验证码,不修改 BPM 业务。
|
||||
- 继续保留正式管理员/主连接;不得动现有用户浏览器 Cookie。
|
||||
- 在当前非 Git 工作区工作,先有失败测试再实现;产品页面不出现设计思考文案。
|
||||
|
||||
## Task 1: Managed account backend and fill
|
||||
|
||||
Files: src/bpm-session-manager.cjs, src/bpm-api.cjs, tests/bpm-account.test.cjs, tests/bpm-http.test.cjs (add tests, preserve existing).
|
||||
|
||||
Interfaces: manager.account(connection,principal) -> {configured,username,updatedAt}; manager.saveAccount(connection,principal,{username,password}) -> metadata; manager.clearAccount(connection,principal) -> {configured:false,username:'',updatedAt:null}; manager.fillAccount(connection,principal) -> {filled:boolean,message:string}. Same owner/admin authorization and perconnection serialization; save validates strict keys username nonempty<=150 chars/password nonempty<=256 chars, no trim of password. account:id vault entry stores username/password/updatedAt; return no password. manager.disable also removes account entry. save/clear don't require active browser; fill requires current session lease and drains queue. Production fill selectors only exact https://sso.skyworthdigital.com #username/#password and https://bpm.skyworthdigital.com #_txtUserId/#_txtPassword (allow injected fixture selectors through known-host constructor testing configuration only, never API). Fill only visible text/password input expected types, bounded wait, NEVER click submit. create/navigate internally attempt saved fill, unknown form no-op. When no account fill returns concise actionable error. Do not write back browser-field edits into account vault implicitly.
|
||||
|
||||
API: /api/connections/:id/account GET metadata, POST username/password save; /account/clear POST empty; /login/fill-account POST empty. Same role, same-origin POST and secureBpmTransport guards. GET metadata only authorized owner/admin. Only username metadata returned; no raw vault errors. Record audit save/clear using connection name (no password). Existing routes must remain unchanged.
|
||||
|
||||
- [ ] Write failing persistence/auth/unknown-host/DOM-type/submit-never-called tests.
|
||||
- [ ] Implement methods and API routes.
|
||||
- [ ] Verify ciphertext contains neither username nor password, restart metadata/fill works, disable removes both, no secret response/audit.
|
||||
- [ ] Run focused tests and self-review.
|
||||
|
||||
## Task 2: Account UI
|
||||
|
||||
Files: web/bpm.js, web/app.css, tests/bpm-ui.test.cjs.
|
||||
|
||||
Add 管理账号 to authorized connection cards. GET /connections/:id/account to show configured username or 未托管; an inline editor asks BPM账号 and 托管密码 (password type, autocomplete new-password, never prefilled stored value). 保存账号 POST same route; clear fields after success. Existing configured account updating requires entering a new password; placeholder 输入新密码以更新. 清除托管 POST account/clear; no account controls for viewers/unrelated operator/disabled connections. Remote toolbar offers 填入托管账号 when metadata says configured; serialize after input queue, track operation for disposal, standard busy/error controls. UI copy concise user actions only; no technical/internal disclaimers. Preserve all current input/lifecycle/CSP behavior.
|
||||
|
||||
- [ ] Add meaningful failing UI tests for permissions, password handling and API body.
|
||||
- [ ] Implement form, metadata and fill action.
|
||||
- [ ] Verify no saved-password DOM value, no password in cards/localStorage, stale forms do not mount after navigation; run existing UI tests.
|
||||
|
||||
## Task 3: Review, regression and deployment
|
||||
|
||||
Files: README.md, docs/verification.md, this plan ledger.
|
||||
|
||||
- [ ] Independent read-only security/correctness review of account backend + UI.
|
||||
- [ ] Full suite and syntax pass; restart only verified project process and preserve existing data.
|
||||
- [ ] Show actual account management page. User enters actual account/password once; automatic checks and renewal operate thereafter, challenge handling remains in remote window. No test users in production.
|
||||
|
||||
## Subsequent authorized scope: automatic custody and thirty days
|
||||
|
||||
用户明确要求“不要每一次都登入”“至少要30天有效”。以下规则取代前述任务中仅填入而不提交的限制:
|
||||
|
||||
- manager.ensure 先验证已有 Cookie,健康时持久保存刷新状态,不提交凭据。只有正向确认登录页才尝试受限自动提交。网络失败、身份冲突、未知表单、验证码均不盲目重登;提交前持久化 15 分钟冷却。
|
||||
- 首次托管/同一托管账号更新密码保留有效会话;更换已托管用户名清除旧身份与会话。清除账号只删除托管凭据;停用删除会话与凭据。
|
||||
- 新增 BpmCustodian:启动即检查,每 5 分钟顺序检查,跳过人工操作租约和停用连接,关闭服务等待检查结束。没有业务动作或外部通知。
|
||||
- 新增 SessionStore:SQLite 仅持久 token 哈希,30 天滑动有效期,每日活动续期,重启可恢复,退出撤销。隔离演示/正式空间。
|
||||
- 外部 BPM 服务端有权撤销/强制过期,不伪造 Cookie 期限;使用保活和自动续登达到持续托管。实际 30 天运行尚需时间验证。
|
||||
@@ -0,0 +1,35 @@
|
||||
# SDD ledger — plan: docs/superpowers/plans/2026-10-16-bpm-login.md
|
||||
|
||||
User authorization: first real BPM login step approved; admin creation confirmed by user.
|
||||
|
||||
Ruling: use designated non-Git workspace and document progress here — no repository exists, so commits/worktree helper do not apply.
|
||||
Ruling: keep dev-only preview fixture for existing regression tests, stop its service and remove product/demo entry plus root preview launcher — preserve all user data.
|
||||
Ruling: verify old portal login separately but do not open old orders automatically — individual detail permission belongs to the later collection task.
|
||||
|
||||
| Pair/task | Interface/content check | Outcome |
|
||||
|---|---|---|
|
||||
| 1 ↔ 2 | manager signatures + principal session identity | exact shared contract above |
|
||||
| 2 ↔ 3 | route verbs, JSON and JPEG | exact shared contract above |
|
||||
| 1 ↔ 4 | constructor stateDir + shutdown | local protected storage and graceful close |
|
||||
| 3 ↔ 4 | static asset /bpm.js | integrator verifies route registration |
|
||||
| Task 1 | browser auth fixtures test isolation and restart | consistent |
|
||||
| Task 2 | metadata not trusted from request; role + transport tests | consistent |
|
||||
| Task 3 | frame stream disposal and ordered input | consistent |
|
||||
| Task 4 | deployment preserves administrator/data | consistent |
|
||||
|
||||
Preview service PID 3284 verified project scripts/preview.cjs and stopped; demo tab closed. Existing formal tab confirms admin signed in.
|
||||
|
||||
Ruling: include exact HTTPS sso.skyworthdigital.com — dedicated new browser observed bpmn redirect to company SSO with username/password controls; required for already-authorized primary portal login. No wildcard hosts.
|
||||
Ruling: private in-process CDP request guard may enforce all redirect hops; no CDP endpoint exposed — Playwright routes alone miss redirected browser requests.
|
||||
|
||||
Task 2: complete — HTTP/store/role/transport/restart focused checks 16/16 passed. Cross-layer review dispatched.
|
||||
Task 4 integration: real formal-dashboard-to-isolated-BPM-fixture test passed under production CSP; exercised typed login, JPEG display, save, close, reload, restored check. Runtime restart/admin preservation test passed in Task 2 focused run.
|
||||
TDD runtime red: main export absent; implemented isolated startup/stop and manager wiring.
|
||||
|
||||
Task 1: complete initial implementation — 9/9 focused checks; actual new dedicated browser reached SSO username/password and legacy username/password/captcha fields with JPEG output, no credentials entered. Review fixes under execution.
|
||||
Task 3: complete initial implementation — 9/9 UI/navigation checks. Final review found pending-open unload cleanup skipped close; implementer reproduced real unload and is fixing synchronous keepalive cleanup.
|
||||
Task 2 review: API approved after partial task fix — initial partial creates none, previously connected partial creates a check task, repeated partial/login_required dedup, wording does not assert network failure means expired. Focused re-review10/10 passed.
|
||||
Ruling: partial after previous connected warrants owner attention, title 'BPM 连接需要检查' rather than an expiry claim — correct prior brief to match plan's attention requirement and avoid false statuses.
|
||||
Task 1 review: parent whole UI integration exposed immediate save racing login reload; reviewer reproduced both read-only verification navigations interrupted by login navigation. Implementer added CDP lifecycle settling and bounded interrupted-navigation retry, no replay of login submissions.
|
||||
|
||||
Final first-step regression: 54/54 passed, 0 skipped/failures; all changed JS syntax checks passed. Independent API/UI and browser/vault/runtime reviewers approved after fixes. Formal service restarted as verified PID42884, 18765 localhost + 18766 shared dashboard, no18776 listener. Production bootstrap required=false; existing one admin and BPM主连接 preserved. Formal browser tab reloaded to normal login screen; user asked to self-login/check/save. User instead added account托管 requirement, continued under docs/superpowers/plans/2026-10-16-bpm-credentials.md.
|
||||
@@ -0,0 +1,55 @@
|
||||
# BPM Login Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development to implement this plan task-by-task.
|
||||
|
||||
**Goal:** 在正式工作台完成独立 BPM 登录、加密保存、恢复及续登。
|
||||
**Architecture:** 独立浏览器会话管理器 + 鉴权路由 + JPEG 远程登录界面。
|
||||
**Tech Stack:** Node CJS、node:sqlite、Playwright、Windows DPAPI、原生 Web。
|
||||
**Spec:** docs/superpowers/specs/2026-10-16-bpm-login-design.md
|
||||
|
||||
## Global Constraints
|
||||
|
||||
- 保留已有管理员及业务数据;不发送通知或修改 BPM 流程。
|
||||
- 产品页面不出现设计思考、内部免责声明。
|
||||
- 无 Git 仓库,在当前指定工作区修改,不提交。
|
||||
- 所有新行为先写测试,观察缺失行为失败,再实现;最后完整测试与审查。
|
||||
|
||||
## Task 1: Browser manager and encrypted vault
|
||||
|
||||
Files: src/bpm-session-manager.cjs, src/bpm-vault.cjs, tests/bpm-session.test.cjs, tests/bpm-vault.test.cjs.
|
||||
|
||||
Interface: BpmSessionManager({stateDir, browserFactory?, urls?, allowedOrigins?, probe?}) supports async open(connection,principal), frame(id,principal), input(id,principal,action), navigate(id,principal,{target}), save(connection,principal), check(connection,principal), close(id,principal), releaseSession(sessionId), disable(id), shutdown(). principal={user:{id,username,role},sessionId}. open/frame/input require exclusive session, TTL 10min, 3 slots max. open returns {active:true,viewport:{width:1280,height:800},expiresAt,host}. frame returns JPEG Buffer. input types click{x,y}, text{text}, key{key}, scroll{deltaX,deltaY}. key allowlist supports Tab/Enter/Backspace/Delete/arrows/Home/End/Escape/Control+A; text max 2000. navigate target main/detail/reload/back, no arbitrary URL. save/check return {status,identity,checkedAt,checks:{portal:{ok,message},detail:{ok,message}}}. statuses connected/partial/login_required/error. Failed verification must not replace previously saved auth state. Errors safe status-coded without secrets. Only exact BPM HTTPS origins by default; injected localhost origins for tests only. vault authenticated encryption atomic writes and Windows DPAPI-protected key. Browser tests use local fixture, demonstrate save, manager shutdown/restart/recheck, isolated connections, expired lease, malicious navigation/input, encryption corruption.
|
||||
|
||||
- [ ] Write failing tests and record red result.
|
||||
- [ ] Implement manager/vault against interfaces.
|
||||
- [ ] Run focused tests; report API deviations and pass evidence.
|
||||
|
||||
## Task 2: Authenticated API and persisted metadata
|
||||
|
||||
Files: src/bpm-api.cjs, src/dashboard.cjs, src/workspace-api.cjs, src/workspace-store.cjs, tests/bpm-http.test.cjs, tests/workspace.test.cjs.
|
||||
|
||||
Consumes manager Task1 interface. createDashboard receives optional bpmSessions and trustedProxy boolean; async bpmApi runs after auth before workspaceApi. Routes /api/connections/:id/login/{open,frame,input,navigate,save,close} and /api/connections/:id/check; GET frame JPEG, others POST. /disable closes manager before Store metadata. Authorize admin or exact owner operator; block viewer and unrelated operator. principal.sessionId is dashboard token, never response. Check/save persist manager result via internal WorkspaceStore updateConnectionSession(id,result,actor), not user-supplied status. Internal getConnection and startup markSessionChecksPending reset connected/partial to unchecked while preserving safe last-check metadata. snapshot capability remoteLogin true only with active manager wiring. Deduplicated expiry exception for connection from partial/login_required check when previous saved connected; check failure doesn't auto-close task. Release manager on logout. Remote credentials endpoints only encrypted socket, loopback Host+remoteAddress, or configured local proxy with X-Forwarded-Proto:https. Do not trust arbitrary proxy headers.
|
||||
|
||||
- [ ] Write failing HTTP tests for owner/session/origin/transport and persistence.
|
||||
- [ ] Implement authenticated routes and metadata, preserve original tests.
|
||||
- [ ] Run focused tests and provide review notes.
|
||||
|
||||
## Task 3: Actual BPM remote login UI
|
||||
|
||||
Files: web/bpm.js, web/workspace.js, web/app.js, web/index.html, web/app.css, tests/bpm-ui.test.cjs.
|
||||
|
||||
Expose window.BpmLogin.mount(container,{api,esc,formatDate,notify,user,isActive}) and .dispose(). WorkspaceViews.bpm delegates mount. API routes Task2; API helper supports JSON POST/GET; GET frame fetched separately as blob. Connection cards show statuses disconnected/unchecked/login_required/partial/connected/disabled/error; only admin or owner operator has login/check actions; create admin only. Remote login image frame with click scaling, ordered keyboard/text/paste/IME input, scroll. Preserve password secrecy (no localStorage/logging), no persistent screenshot. Navigation buttons 新版门户/旧版入口/刷新; 检查并保存/关闭. Poll with no overlap; dispose releases remote lease and objectURLs, stops timers and stale navigation. Disable refresh/navigation while save in progress as needed. Proper concise statuses and errors; no claims unverified. Remove demo UI entry and branding from formal app; legacy dev preview fixture may remain test-only. Adapt overview login summary. Product must stay usable at narrow viewport.
|
||||
|
||||
- [ ] Write focused meaningful lifecycle/coordinate/input tests before implementation.
|
||||
- [ ] Implement page and remote login controls.
|
||||
- [ ] Run syntax/UI tests and report completion.
|
||||
|
||||
## Task 4: Integration, real deployment, review
|
||||
|
||||
Files: src/server.cjs, README.md, docs/verification.md, config.example.json and plan ledger.
|
||||
|
||||
- [ ] Instantiate manager in local stateDir/bpm-sessions, reset stale metadata; close it on shutdown/error.
|
||||
- [ ] Stop existing preview process only; remove user-facing preview launch emphasis.
|
||||
- [ ] Full test suite, syntax checks, independent read-only code review and fixes.
|
||||
- [ ] Restart verified formal project process, preserve data, inspect actual Web and BPM login screen.
|
||||
- [ ] Report running URL, completed behavior and any real login still requiring user interaction.
|
||||
@@ -0,0 +1,7 @@
|
||||
# 实施计划
|
||||
|
||||
1. 测试先行:本地 HTTP 列表模拟、日期解析与 SQLite 去重/持久化/原子性。
|
||||
2. 新门户只读 API 适配器与 BpmSessionManager 互斥接入,会话失效使用既有续登。
|
||||
3. 扫描数据库、生命周期、日历调度、手动扫描与权限路由。
|
||||
4. 每日分区视图与真实接入状态,保留 PDF 记录。
|
||||
5. 专项和全量测试、代码审查、重启正式服务、真实扫描和浏览器验证。
|
||||
@@ -0,0 +1,21 @@
|
||||
# SDD ledger — plan: docs/superpowers/plans/2026-10-16-application-framework.md
|
||||
|
||||
Ruling: 用户已明确要求先实现并运行框架,继续本会话执行 — 不重复询问设计批准 — 规则变动仍可后续调整。
|
||||
Ruling: 非 Git 工作目录直接开发,不创建仓库或 worktree — 保持用户指定启动目录 — 需依赖文件和测试审查。
|
||||
Ruling: Web 远程登录本轮提供诚实接入边界,先交付可运行管理框架 — 用户明确先框架 — 实际远程登录另需联调。
|
||||
|
||||
| 任务/接口 | 检查结论 |
|
||||
|---|---|
|
||||
| Task1/Task2 workspace API | 共享接口如计划合同,前端不依赖数据库细节 |
|
||||
| Task1/Task3 dashboard 参数 | workspace、previewUserId 注入,正式启动不配置预览用户 |
|
||||
| Task2/Task3 示例标识 | bootstrap/status.preview 驱动,示例数据与正式独立 |
|
||||
| Task1 内部 | 事务/版本、权限、日历测试分别覆盖 |
|
||||
| Task2 内部 | 独立模块、当前页面检查、功能与禁用边界一致 |
|
||||
| Task3 内部 | loopback 预览与正式 LAN 服务分开,文档如实说明 |
|
||||
|
||||
Task 1: complete — SQLite/API、权限/同源、日期与版本冲突已测试;后端独立审查通过。
|
||||
Task 2: complete — 五个实际工作页面与表单、角色限制、审计、示例标识;前端独立审查通过。
|
||||
Task 3: complete — 正式服务及 loopback 演示已启动;27/27 回归与语法检查通过;浏览器保存/转交/关闭/重启保留验证通过;README 与验证记录更新。
|
||||
|
||||
Ruling: 演示与正式空间 Cookie 使用不同名字 — 浏览器 Cookie 不按端口隔离,原同名会互相覆盖 — 回归已覆盖。
|
||||
Ruling: 目录不是 Git 仓库,finishing 分支/合并菜单不适用 — 交付运行文件和可访问页面,不创建虚构提交。
|
||||
@@ -0,0 +1,10 @@
|
||||
# 邮件接入实施计划
|
||||
|
||||
1. 测试驱动 MIME 解析:中文、HTML/CID、附件、指令主题、来源授权、大小限制。
|
||||
2. 测试驱动 SQLite 邮箱/游标/模板版本/发送记录:密文、唯一邮箱、配置版本、幂等、人工确认冲突、历史。
|
||||
3. 实现 SMTP 验证、IMAP 只读收信、每分钟轮询、停止释放,以及明确操作的测试发信。
|
||||
4. 接入登录/同源/角色约束的 API;服务生命周期与总览读取真实状态。
|
||||
5. 新增邮箱管理与模板审核 UI,保留收件群组,迁移旧草稿;浏览器操作验证。
|
||||
6. 执行全部测试、依赖审计、更新说明,重启并核验正式服务。
|
||||
|
||||
工作区无 Git;直接在现有目录实施,凭据仅由用户在 Web 配置。
|
||||
@@ -0,0 +1,18 @@
|
||||
# Web Dashboard Implementation Plan
|
||||
|
||||
> Execute inline. Reuse Tabler UI; preserve the existing extension bridge.
|
||||
|
||||
**Goal:** Deploy a shared authenticated LAN dashboard with persistent settings and export records.
|
||||
|
||||
**Spec:** docs/web-dashboard-design.md
|
||||
|
||||
**Architecture:** Separate dashboard HTTP server, local persistent store, existing loopback exporter with record callback; locally hosted Tabler assets.
|
||||
|
||||
- [x] Write and run failing store tests: defaults, two times validation, optimistic concurrency, user roles and password hashing, persistent job records.
|
||||
- [x] Implement `src/dashboard-store.cjs` and `src/schedule.cjs`; run store tests.
|
||||
- [x] Write and run failing HTTP tests: loopback-only bootstrap, sessions, authorization, same-origin mutation, configuration restart persistence and PDF download containment.
|
||||
- [x] Implement `src/dashboard.cjs`, connect export status callbacks in `src/server.cjs`.
|
||||
- [x] Install pinned `@tabler/core`; adapt existing Tabler sidebar/cards/tables/forms in `web/`, preserve license.
|
||||
- [x] Add login/bootstrap, overview, export records, sending plan, templates/groups, users and audit pages with real API bindings.
|
||||
- [x] Verify full test suite, launch local dashboard, inspect desktop layout and actual save/reload via browser. Narrow viewport override did not change the IAB dimensions; mobile acceptance remains pending.
|
||||
- [x] Document LAN host/port, deployment-machine setup and pending table/template integration. Do not enable mail sending.
|
||||
Reference in new issue
Block a user