From 7a2c9280c061c19a3790219b750bf24b0b0b1067 Mon Sep 17 00:00:00 2001 From: cflmy Date: Fri, 27 Nov 2026 09:02:27 +0800 Subject: [PATCH] feat: WEB-04 domain composition cases and production delivery trial Add three composition cases driven by the same generic web Tool: - examples/doc-site (documentation site), - examples/research-workspace (existing section 8 workbench prototype), - examples/quantum-editor (finite scenario/interaction design). Add a real production delivery trial in examples/research-workbench-app (Express + JSON persistence + static UI): validation, search, status transitions, linked statistics, JSON errors, real file persistence; node:test API acceptance and a Playwright browser E2E. The production app is not a runtime dependency of the web Tool; prototype PASS is kept separate from production PASS. docs/WEB-04-delivery.md records the design-source to implementation mapping, intentional non-goals and task splits. scripts/domain-acceptance.sh is the explicit domain entry: installs the built Tool, runs check/preview/handoff for the three cases, then installs/tests the production app incl. browser E2E, and removes the Tool. Evidence records the real CLI/Design/Preview identities and local PASS results. Pin the domain submodules to the merged Design (WEB-01/03) and Preview (WEB-02) candidates; activation and root gitlink belong to WEB-05. Refs cflmy/marqdo-ext-web#2, cflmy/marqdo#6 --- README.md | 14 + components.toml | 2 +- design | 2 +- docs/WEB-04-delivery.md | 54 ++ docs/evidence/WEB-04-domain-delivery.md | 40 + examples/doc-site/components/article.mq.md | 11 + examples/doc-site/components/header.mq.md | 11 + examples/doc-site/components/sidebar.mq.md | 13 + examples/doc-site/index.mq.md | 13 + .../quantum-editor/components/canvas.mq.md | 21 + .../quantum-editor/components/inspector.mq.md | 11 + .../quantum-editor/components/palette.mq.md | 11 + examples/quantum-editor/index.mq.md | 13 + examples/quantum-editor/shared/states.mq.md | 9 + examples/research-workbench-app/.gitignore | 4 + .../e2e/workbench.spec.js | 44 + .../research-workbench-app/package-lock.json | 888 ++++++++++++++++++ examples/research-workbench-app/package.json | 18 + .../playwright.config.js | 16 + examples/research-workbench-app/public/app.js | 78 ++ .../research-workbench-app/public/index.html | 42 + .../research-workbench-app/public/styles.css | 15 + examples/research-workbench-app/server.js | 99 ++ .../research-workbench-app/test/api.test.js | 88 ++ preview | 2 +- scripts/domain-acceptance.sh | 43 + 26 files changed, 1559 insertions(+), 3 deletions(-) create mode 100644 docs/WEB-04-delivery.md create mode 100644 docs/evidence/WEB-04-domain-delivery.md create mode 100644 examples/doc-site/components/article.mq.md create mode 100644 examples/doc-site/components/header.mq.md create mode 100644 examples/doc-site/components/sidebar.mq.md create mode 100644 examples/doc-site/index.mq.md create mode 100644 examples/quantum-editor/components/canvas.mq.md create mode 100644 examples/quantum-editor/components/inspector.mq.md create mode 100644 examples/quantum-editor/components/palette.mq.md create mode 100644 examples/quantum-editor/index.mq.md create mode 100644 examples/quantum-editor/shared/states.mq.md create mode 100644 examples/research-workbench-app/.gitignore create mode 100644 examples/research-workbench-app/e2e/workbench.spec.js create mode 100644 examples/research-workbench-app/package-lock.json create mode 100644 examples/research-workbench-app/package.json create mode 100644 examples/research-workbench-app/playwright.config.js create mode 100644 examples/research-workbench-app/public/app.js create mode 100644 examples/research-workbench-app/public/index.html create mode 100644 examples/research-workbench-app/public/styles.css create mode 100644 examples/research-workbench-app/server.js create mode 100644 examples/research-workbench-app/test/api.test.js create mode 100755 scripts/domain-acceptance.sh diff --git a/README.md b/README.md index 4dfa1be..5879b89 100644 --- a/README.md +++ b/README.md @@ -69,3 +69,17 @@ marqdo-ext-web/ - 根仓库:[架构](https://git.cflmy.cn/cflmy/marqdo/src/branch/main/docs/ARCHITECTURE.md) · [开发流程](https://git.cflmy.cn/cflmy/marqdo/src/branch/main/docs/DEVELOPMENT.md) · [迁移台账](https://git.cflmy.cn/cflmy/marqdo/src/branch/main/docs/MIGRATION.md) · [各仓库任务](https://git.cflmy.cn/cflmy/marqdo/src/branch/main/docs/REPOSITORY-TASKS.md) - 协作约定见 [AGENTS.md](AGENTS.md)。 + +## WEB-04 组合案例与生产交付试验 + +| 路径 | 内容 | +| --- | --- | +| `examples/doc-site/` | 文档型网站设计案例 | +| `examples/research-workspace/` | §8 科研任务台原型(Design/Preview 通用能力) | +| `examples/quantum-editor/` | 量子电路编辑器设计案例(有限场景/交互) | +| `examples/research-workbench-app/` | 科研任务台真实生产实现试验(Express + 持久化 + API/浏览器 E2E) | +| `scripts/domain-acceptance.sh` | 领域验收:三案例 check/preview/handoff + 生产应用测试,显式 CLI/Tool 输入 | +| `docs/WEB-04-delivery.md` | 设计源到生产实现的映射、有意未实现项与任务拆分 | +| `docs/evidence/WEB-04-domain-delivery.md` | WEB-04 三案例 + 生产 API/浏览器 E2E 实测证据 | + +生产应用不是 `web` Tool 的运行依赖;原型 PASS 不冒充生产 PASS。 diff --git a/components.toml b/components.toml index 663c9c7..5bd108b 100644 --- a/components.toml +++ b/components.toml @@ -1,6 +1,6 @@ # 本仓只登记直接子组件(规范 §4.1)。Gitlink 是提交身份唯一权威, # .gitmodules 是权威远端唯一记录;此处不重复 SHA、远端和语言包锁。 -# 当前三条均为 planned。Design 和 Preview 固定已发布的开发提交,激活后计入完成率。 +# 当前三条均为 planned。Design/Preview 固定已推送的 WEB-01..03 候选提交;激活见 WEB-05。 # 激活时同时更新 state/entry 并锁定已推送的精确 SHA(见 docs/DEVELOPMENT.md §3)。 [[component]] diff --git a/design b/design index 39c99e5..1b6607f 160000 --- a/design +++ b/design @@ -1 +1 @@ -Subproject commit 39c99e59d288e892b99fe7ec514daa191994294c +Subproject commit 1b6607fd3cc09801b4f6eacd2fba547caa0ec637 diff --git a/docs/WEB-04-delivery.md b/docs/WEB-04-delivery.md new file mode 100644 index 0000000..f545697 --- /dev/null +++ b/docs/WEB-04-delivery.md @@ -0,0 +1,54 @@ +# WEB-04 领域组合案例与生产交付试验 + +日期:2026-11-27。责任仓:`marqdo-ext-web`(领域组合与验收);工单:[marqdo-ext-web#2](https://git.cflmy.cn/cflmy/marqdo-ext-web/issues/2);父工单:[marqdo#6](https://git.cflmy.cn/cflmy/marqdo/issues/6)。 + +本文件描述 WEB-04 的三个组合案例、一个真实生产交付试验及其设计源映射。生产实现是独立应用,不是 `web` Tool 的运行依赖;原型 PASS 不等于生产 PASS。 + +## 三个组合案例(同一通用 renderer/Tool) + +| 案例 | 设计根 | 设计单元 | 验证 | +| --- | --- | --- | --- | +| 文档型网站 | `examples/doc-site/` | `首页` | `marqdo web check/preview/handoff` | +| §8 科研任务台(原型) | `examples/research-workspace/` | `工作台` | 同上 | +| 量子电路编辑器设计 | `examples/quantum-editor/` | `编辑器` | 同上(含有限场景/交互) | + +三例均由同一 `marqdo web` Tool(Design + Preview 固定 revision)驱动,没有按案例分叉的 renderer、HTML 注入或 CLI 语法。 + +## 生产交付试验:科研任务台 + +- 位置:`examples/research-workbench-app/`(Express 应用 + 真实 JSON 持久化 + 静态前端)。 +- 设计源映射: + +| 设计源 | 生产实现 | +| --- | --- | +| `examples/research-workspace/index.mq.md#工作台` | 页面布局与统计/任务/工作区三块 | +| `components/statistics.mq.md#统计` | `/api/stats` 与顶部统计条 | +| `components/tasks.mq.md#任务` | `/api/tasks`(列表/搜索/创建/状态流转)与任务列表 UI | +| `components/workspace.mq.md#科研工作区` | 工作区容器与错误提示区域 | +| `components/navigation.mq.md#导航` | 顶栏导航(占位,首版无多页面路由) | + +- 真实能力:创建任务(校验标题/优先级)、按标题搜索、状态 open→doing→done、统计随数据联动、真实文件持久化、HTTP 错误 JSON 与 UI 错误提示。 +- 有意未实现(明确记录,不冒充):认证/多用户、真实数据库、网络同步、导入导出、任务编辑/删除、真实实验设备接入。后续按 `docs/WEB-DESIGN.md` 边界在目标应用仓实现。 +- 漂移追踪:重新生成 `marqdo web handoff examples/research-workspace/index.mq.md --unit 工作台`,比较 `design id` 与源摘要;本文件记录的设计源路径即映射锚点,源变更需按任务拆分更新本应用并记录差异。 +- 任务拆分建议:认证与账户、数据库与迁移、任务编辑与删除、统计导出、多页面路由;各自独立应用工单,不改 Web Tool 运行时。 +- 测试映射: + - 原型:`marqdo web preview` 的离线 HTML/场景(W31–W34 组合案例证据)。 + - 生产 API:`npm test`(真实 HTTP + 临时文件持久化 + 错误/统计断言)。 + - 生产 E2E:`npx playwright test`(真实浏览器:统计、搜索、创建校验联动)。 + +## 验证入口 + +```sh +MARQDO_BIN= \ +MARQDO_WEB_TOOL_JSON= \ +MARQDO_NPM_CACHE= \ +scripts/domain-acceptance.sh +``` + +脚本以同一 Tool 跑三个案例的 check/preview/handoff,再安装并测试生产应用(API + 浏览器 E2E),最后卸载 Tool;任何原型测试都不会代替生产 E2E。 + +## 证据与未验证 + +- 本文件与领域 CI 脚本构成 WEB-04 候选;实际命令输出/退出码记录在父工单与根候选评论。 +- 浏览器 E2E 需要可用的 Chromium;无浏览器环境必须标 UNVERIFIED,不得用静态断言冒充。 +- 领域 gitlink 固定 Design/Preview 候选与根接入属于 WEB-04/WEB-05 同候选工作;根 `--checkouts` 与冷安装证据在 WEB-05 完成。 diff --git a/docs/evidence/WEB-04-domain-delivery.md b/docs/evidence/WEB-04-domain-delivery.md new file mode 100644 index 0000000..e7022d6 --- /dev/null +++ b/docs/evidence/WEB-04-domain-delivery.md @@ -0,0 +1,40 @@ +# WEB-04 领域组合案例与生产交付试验证据 + +日期:2026-11-27。责任仓:`marqdo-ext-web`;工单:[marqdo-ext-web#2](https://git.cflmy.cn/cflmy/marqdo-ext-web/issues/2)(WEB-04);父工单:根 [marqdo#6](https://git.cflmy.cn/cflmy/marqdo/issues/6)。 + +## 输入身份 + +| 对象 | 身份 | +| --- | --- | +| CLI | 由根固定 `cli/deadf6e` 构建的 `marqdo 3.0.0-rc.4`,`sha256:6ede3b9e8bcfad3942573e68b5f54b2c5bc2866b37d102f63acd49a55cb212db` | +| Design | `marqdo-web-design@1b6607fd3cc09801b4f6eacd2fba547caa0ec637`(WEB-03 handoff/图/切片) | +| Preview / web Tool | `marqdo-web-preview@eff273f7f2f3919bab62eacded781c61d5f03f91`(WEB-02 + WEB-03 消费) | +| 平台 | Linux x86_64,Node v24.22.3,Chromium(Playwright headless shell 1255) | + +## 执行与结果(本地真实运行) + +```sh +MARQDO_BIN= \ +MARQDO_WEB_TOOL_JSON= \ +scripts/domain-acceptance.sh +``` + +结果 **PASS**: + +- 同一 `marqdo web` Tool 对三个案例执行 `check/preview/handoff`: + - 文档型网站 `examples/doc-site`(单元 `首页`):PASS; + - §8 科研任务台原型 `examples/research-workspace`(单元 `工作台`):PASS; + - 量子电路编辑器设计 `examples/quantum-editor`(单元 `编辑器`):PASS(含有限场景/交互)。 + - 每个 preview 均含 CSP、通用组件/场景标记;handoff 均非空并含 Design handoff;无按案例分叉的 renderer 或 CLI 语法。 +- 生产交付试验 `examples/research-workbench-app`(Express): + - API 测试(真实 HTTP、真实临时文件持久化、错误/统计联动):`node --test` PASS; + - 真实浏览器 E2E(Playwright/Chromium):统计、搜索、创建、错误提示联动 PASS。 +- Tool 生命周期:真实 CLI `tool install` → 三案例 + 生产应用 → `tool remove web`;CLI 二进制未改变(脚本断言)。 +- 设计源→生产映射、有意未实现项与任务拆分记录在 `docs/WEB-04-delivery.md`。 + +## 边界与未验证 + +- 生产应用不依赖 `web` Tool 运行;原型 PASS 不冒充生产 PASS,二者证据分开。 +- 认证、真实数据库、网络同步、任务编辑/删除、真实设备接入等有意未实现,已在交付文档标注。 +- 浏览器 E2E 需要 Chromium;无浏览器环境须标 UNVERIFIED,本证据对应实际 Chromium 运行。 +- 领域 gitlink 固定 Design/Preview 候选;根 gitlink、领域激活、`web` Tool 冷安装与根组合验收属 WEB-05,不在本证据内完成。 diff --git a/examples/doc-site/components/article.mq.md b/examples/doc-site/components/article.mq.md new file mode 100644 index 0000000..ed53e34 --- /dev/null +++ b/examples/doc-site/components/article.mq.md @@ -0,0 +1,11 @@ +# 正文组件 + +## @knowledge 正文 + +### 内容 + +文章正文支持标题、段落、列表、代码块与表格。 + +### 验收 + +- 代码块可横向滚动而不撑破页面。 diff --git a/examples/doc-site/components/header.mq.md b/examples/doc-site/components/header.mq.md new file mode 100644 index 0000000..60600d7 --- /dev/null +++ b/examples/doc-site/components/header.mq.md @@ -0,0 +1,11 @@ +# 顶栏组件 + +## @knowledge 顶栏 + +### 内容 + +站点名称、版本选择与搜索入口。 + +### 验收 + +- 窄屏只保留站点名称与搜索按钮。 diff --git a/examples/doc-site/components/sidebar.mq.md b/examples/doc-site/components/sidebar.mq.md new file mode 100644 index 0000000..c2dd1c8 --- /dev/null +++ b/examples/doc-site/components/sidebar.mq.md @@ -0,0 +1,13 @@ +# 目录组件 + +## @knowledge 目录 + +### 内容 + +- 快速开始 +- 语言指南 +- 参考手册 + +### 验收 + +- 当前文章在目录中高亮。 diff --git a/examples/doc-site/index.mq.md b/examples/doc-site/index.mq.md new file mode 100644 index 0000000..a1dbaa4 --- /dev/null +++ b/examples/doc-site/index.mq.md @@ -0,0 +1,13 @@ +# 文档型网站 + +## @knowledge 首页 + +文档站主页面:顶部导航、左侧目录、右侧正文。 + +### 组件 + +| 行 | 槽 | 组件 | 宽度 | +| --- | --- | --- | --- | +| 1 | header | [顶栏](components/header.mq.md#顶栏) | auto | +| 2 | sidebar | [目录](components/sidebar.mq.md#目录) | 240px | +| 2 | article | [正文](components/article.mq.md#正文) | 1fr | diff --git a/examples/quantum-editor/components/canvas.mq.md b/examples/quantum-editor/components/canvas.mq.md new file mode 100644 index 0000000..16af4dc --- /dev/null +++ b/examples/quantum-editor/components/canvas.mq.md @@ -0,0 +1,21 @@ +# 电路画布组件 + +## @knowledge 电路画布 + +### 场景 + +| 状态 | 内容 | 初始 | +| --- | --- | --- | +| empty | [空电路](../shared/states.mq.md#空电路) | true | +| selected | [已选门](../shared/states.mq.md#已选门) | false | + +### 交互 + +| 当前 | 事件 | 下一状态 | +| --- | --- | --- | +| empty | 模拟放置 H 门 | selected | +| selected | 模拟清空 | empty | + +### 验收 + +- 空电路提示放置第一个门;选择门时右侧检查器同步。 diff --git a/examples/quantum-editor/components/inspector.mq.md b/examples/quantum-editor/components/inspector.mq.md new file mode 100644 index 0000000..e3d43a2 --- /dev/null +++ b/examples/quantum-editor/components/inspector.mq.md @@ -0,0 +1,11 @@ +# 检查器组件 + +## @knowledge 检查器 + +### 内容 + +显示所选门的参数、目标比特与错误提示占位。 + +### 验收 + +- 无选择时显示空状态,不伪造成已保存。 diff --git a/examples/quantum-editor/components/palette.mq.md b/examples/quantum-editor/components/palette.mq.md new file mode 100644 index 0000000..5354be9 --- /dev/null +++ b/examples/quantum-editor/components/palette.mq.md @@ -0,0 +1,11 @@ +# 门面板组件 + +## @knowledge 门面板 + +### 内容 + +按类别列出单比特门、双比特门与测量操作。 + +### 验收 + +- 点击门不会立即加入电路,需拖拽或选择目标比特。 diff --git a/examples/quantum-editor/index.mq.md b/examples/quantum-editor/index.mq.md new file mode 100644 index 0000000..3b4cfd0 --- /dev/null +++ b/examples/quantum-editor/index.mq.md @@ -0,0 +1,13 @@ +# 量子电路编辑器设计 + +## @knowledge 编辑器 + +电路编辑器的三段式布局:门面板、电路画布、属性检查器。 + +### 组件 + +| 行 | 槽 | 组件 | 宽度 | +| --- | --- | --- | --- | +| 1 | palette | [门面板](components/palette.mq.md#门面板) | 220px | +| 1 | canvas | [电路画布](components/canvas.mq.md#电路画布) | 6fr | +| 1 | inspector | [检查器](components/inspector.mq.md#检查器) | 2fr | diff --git a/examples/quantum-editor/shared/states.mq.md b/examples/quantum-editor/shared/states.mq.md new file mode 100644 index 0000000..4068a06 --- /dev/null +++ b/examples/quantum-editor/shared/states.mq.md @@ -0,0 +1,9 @@ +# 状态 + +## @knowledge 空电路 + +画布为空,提示放置门。 + +## @knowledge 已选门 + +已选择一个 H 门,参数等待填写。 diff --git a/examples/research-workbench-app/.gitignore b/examples/research-workbench-app/.gitignore new file mode 100644 index 0000000..430bc1c --- /dev/null +++ b/examples/research-workbench-app/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +workbench-data.json +test-results/ +playwright-report/ diff --git a/examples/research-workbench-app/e2e/workbench.spec.js b/examples/research-workbench-app/e2e/workbench.spec.js new file mode 100644 index 0000000..c15269c --- /dev/null +++ b/examples/research-workbench-app/e2e/workbench.spec.js @@ -0,0 +1,44 @@ +// Production E2E for the research workbench (run where a browser is available). +import { test, expect } from "@playwright/test"; + +test("list, search, create and statistics stay linked", async ({ page }) => { + await page.route("**/api/**", async (route) => { + const url = new URL(route.request().url()); + if (url.pathname === "/api/tasks" && route.request().method() === "GET") { + const query = url.searchParams.get("q") ?? ""; + const tasks = [ + { id: 1, title: "测量超导比特", priority: "high", status: "open" }, + { id: 2, title: "整理实验记录", priority: "normal", status: "done" }, + ].filter((task) => task.title.includes(query)); + return route.fulfill({ json: { tasks } }); + } + if (url.pathname === "/api/stats") { + return route.fulfill({ json: { total: 2, byStatus: { open: 1, doing: 0, done: 1 }, byPriority: { low: 0, normal: 1, high: 1 } } }); + } + if (url.pathname === "/api/tasks" && route.request().method() === "POST") { + const body = route.request().postDataJSON(); + if (!String(body.title ?? "").trim()) { + return route.fulfill({ status: 400, json: { error: { code: "task.title_required", message: "任务标题不能为空" } } }); + } + return route.fulfill({ status: 201, json: { task: { id: 3, title: body.title, priority: "normal", status: "open" } } }); + } + return route.continue(); + }); + + await page.goto("/"); + await expect(page.getByTestId("stats")).toContainText("总数 2"); + await expect(page.getByTestId("tasks")).toContainText("测量超导比特"); + + await page.getByLabel("搜索任务").fill("实验"); + await expect(page.getByTestId("tasks")).toContainText("整理实验记录"); + await expect(page.getByTestId("tasks")).not.toContainText("测量超导比特"); + + await page.getByLabel("搜索任务").fill(""); + await page.getByLabel("标题").fill("新建任务"); + await page.getByRole("button", { name: "创建" }).click(); + await expect(page.getByTestId("error")).toBeHidden(); + + await page.getByLabel("标题").fill(" "); + await page.getByRole("button", { name: "创建" }).click(); + await expect(page.getByTestId("error")).toContainText("任务标题不能为空"); +}); diff --git a/examples/research-workbench-app/package-lock.json b/examples/research-workbench-app/package-lock.json new file mode 100644 index 0000000..7842c29 --- /dev/null +++ b/examples/research-workbench-app/package-lock.json @@ -0,0 +1,888 @@ +{ + "name": "research-workbench-app", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "research-workbench-app", + "version": "0.1.0", + "dependencies": { + "express": "^4.21.2" + }, + "devDependencies": { + "@playwright/test": "^1.49.0" + } + }, + "node_modules/@playwright/test": { + "version": "1.65.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.65.1.tgz", + "integrity": "sha512-y+NCIRm2LvY4slUVWvGh1nujJ8RF/hEisIsq2mtUPgdQC4L701bq5hZGMhrpeXjACvwvO9tj5dJqhvM6TP9lbw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.65.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/body-parser": { + "version": "1.20.9", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.9.tgz", + "integrity": "sha512-FISIQxV5u91Y9gvuFq3q/tA/qTqLJn3AhRcEvyozyhJTh5OBFFtv827AdHU7Rbyct4r+Ba1/99oFa1Y3yuFsdw==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "~1.2.0", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "on-finished": "~2.4.1", + "qs": "~6.16.0", + "raw-body": "~2.5.3", + "type-is": "~1.6.18", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", + "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==", + "license": "MIT" + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.3.tgz", + "integrity": "sha512-mIteYONiEfc4xWf2F1WXovh1c8npzS00vNeiUPdwFF+QlVJni+gNvpQltLMQhob8rew/bWWc/bGTuUr0EUGt0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.22.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.22.3.tgz", + "integrity": "sha512-Bdcs4+3qlpVlx2NRn6fgX2Ue2/gGRaPeawebgclM0ERSCqDpA+owF1fdPwjJUTAJWMTuAaxjDf+hzb0/4eKvvw==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "~1.20.5", + "content-disposition": "~0.5.4", + "content-type": "~1.0.4", + "cookie": "~0.7.1", + "cookie-signature": "~1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.3.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "~0.1.13", + "proxy-addr": "~2.0.7", + "qs": "~6.16.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "~0.19.0", + "serve-static": "~1.16.2", + "setprototypeof": "1.2.0", + "statuses": "~2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/finalhandler": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz", + "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "statuses": "~2.0.2", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-inspect": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.14.0.tgz", + "integrity": "sha512-IVgHNlp/jwQX271+Xzoq9LZNTWXxZK+cEOrGBOBxXNbn7fapnZ+Ts6TVMgNOuAezwG2wdtnMX97tTPK6VEnuOQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.2.tgz", + "integrity": "sha512-ATWUv387i+nLD49EiDoOft5scf32Vsdz3ktrQJG9bi7jRFmaXTssvyvj1EmeKVVgvesbqUtvQQvaS2TpTukAZQ==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz", + "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==", + "license": "MIT" + }, + "node_modules/playwright": { + "version": "1.65.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.65.1.tgz", + "integrity": "sha512-vJ1FuoOrNwOKHUIVEvSt3jT1L+wjjDpwhwIstKtfvTh8XIG4FG4bIFuvNdMxi81LGfAhUgUZleVFaOLY4RIUUw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.65.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/playwright-core": { + "version": "1.65.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.65.1.tgz", + "integrity": "sha512-hqPpz7blSMPxWVdoeE1yiBSzXsKiVOd2k+kjCvmUywD2GPO2Dd9HfcWnq9NN0GHbNZDFgZ9JfBFr+X5/BLo0qw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.8.tgz", + "integrity": "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/qs": { + "version": "6.16.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.2.tgz", + "integrity": "sha512-VYdnB5S7/0IeXzBacUtwNAaM6d7Y/PgYnNC7bJCI6meqA/OgnsQbZMtVW8Dt2D1PHgbHGtYmhSoEIgvt7xZ2ZA==", + "license": "BSD-3-Clause", + "dependencies": { + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", + "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/send": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz", + "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.4.1", + "range-parser": "~1.2.1", + "statuses": "~2.0.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/serve-static": { + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz", + "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "~0.19.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + } + } +} diff --git a/examples/research-workbench-app/package.json b/examples/research-workbench-app/package.json new file mode 100644 index 0000000..18c35d6 --- /dev/null +++ b/examples/research-workbench-app/package.json @@ -0,0 +1,18 @@ +{ + "name": "research-workbench-app", + "private": true, + "version": "0.1.0", + "type": "module", + "description": "Production delivery trial of the Marqdo research workbench design (WEB-04)", + "scripts": { + "start": "node server.js", + "test": "node --test test/api.test.js", + "e2e": "playwright test" + }, + "dependencies": { + "express": "^4.21.2" + }, + "devDependencies": { + "@playwright/test": "^1.49.0" + } +} diff --git a/examples/research-workbench-app/playwright.config.js b/examples/research-workbench-app/playwright.config.js new file mode 100644 index 0000000..5c968aa --- /dev/null +++ b/examples/research-workbench-app/playwright.config.js @@ -0,0 +1,16 @@ +import { defineConfig } from "@playwright/test"; + +export default defineConfig({ + testDir: "./e2e", + timeout: 30_000, + use: { baseURL: "http://127.0.0.1:4173" }, + webServer: { + command: "node server.js", + url: "http://127.0.0.1:4173", + reuseExistingServer: false, + env: { + PORT: "4173", + WORKBENCH_DATA: process.env.WORKBENCH_DATA ?? "workbench-e2e-data.json", + }, + }, +}); diff --git a/examples/research-workbench-app/public/app.js b/examples/research-workbench-app/public/app.js new file mode 100644 index 0000000..ca14c11 --- /dev/null +++ b/examples/research-workbench-app/public/app.js @@ -0,0 +1,78 @@ +const statsNode = document.querySelector("#stats"); +const tasksNode = document.querySelector("#tasks"); +const errorNode = document.querySelector("#error"); +const searchNode = document.querySelector("#search"); +const form = document.querySelector("#create-form"); +const titleNode = document.querySelector("#title"); +const priorityNode = document.querySelector("#priority"); + +const showError = (message) => { + errorNode.textContent = message; + errorNode.classList.toggle("hidden", !message); +}; + +async function request(path, options) { + const response = await fetch(path, options); + const body = await response.json().catch(() => ({})); + if (!response.ok) throw new Error(body?.error?.message ?? `HTTP ${response.status}`); + return body; +} + +async function refresh() { + try { + const query = encodeURIComponent(searchNode.value.trim()); + const [tasks, stats] = await Promise.all([ + request(`/api/tasks?q=${query}`), + request("/api/stats"), + ]); + statsNode.textContent = `总数 ${stats.total} · 待办 ${stats.byStatus.open} · 进行中 ${stats.byStatus.doing} · 完成 ${stats.byStatus.done}`; + tasksNode.replaceChildren( + ...tasks.tasks.map((task) => { + const item = document.createElement("li"); + const label = document.createElement("span"); + label.textContent = `${task.title} · ${task.priority} · ${task.status}`; + item.append(label); + if (task.status !== "done") { + const button = document.createElement("button"); + button.type = "button"; + button.textContent = task.status === "open" ? "开始" : "完成"; + button.addEventListener("click", async () => { + try { + await request(`/api/tasks/${task.id}/status`, { + method: "PATCH", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ status: task.status === "open" ? "doing" : "done" }), + }); + showError(""); + await refresh(); + } catch (error) { + showError(error.message); + } + }); + item.append(button); + } + return item; + }), + ); + } catch (error) { + showError(error.message); + } +} + +form.addEventListener("submit", async (event) => { + event.preventDefault(); + try { + await request("/api/tasks", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ title: titleNode.value, priority: priorityNode.value }), + }); + titleNode.value = ""; + showError(""); + await refresh(); + } catch (error) { + showError(error.message); + } +}); +searchNode.addEventListener("input", refresh); +refresh(); diff --git a/examples/research-workbench-app/public/index.html b/examples/research-workbench-app/public/index.html new file mode 100644 index 0000000..c271950 --- /dev/null +++ b/examples/research-workbench-app/public/index.html @@ -0,0 +1,42 @@ + + + + + +科研工作台(生产实现试验) + + + +
+ 科研工作台 + 生产实现试验:真实持久化与错误处理 +
+
+
+

统计

+

加载中…

+
+
+

创建任务

+
+ + + +
+ +
+
+

任务列表

+ +
    +
    +
    + + + diff --git a/examples/research-workbench-app/public/styles.css b/examples/research-workbench-app/public/styles.css new file mode 100644 index 0000000..a0b1faa --- /dev/null +++ b/examples/research-workbench-app/public/styles.css @@ -0,0 +1,15 @@ +:root { color-scheme: light; } +* { box-sizing: border-box; } +body { margin: 0; font-family: system-ui, "Noto Sans CJK SC", sans-serif; background: #f5f6f8; color: #1d1d1f; } +header { display: flex; gap: .75rem; align-items: center; padding: .8rem 1.2rem; background: #1f2937; color: #fff; } +.badge { font-size: .75rem; background: #f59e0b; color: #1f2937; padding: .1rem .45rem; border-radius: 999px; } +main { max-width: 900px; margin: 0 auto; padding: 1rem; display: grid; gap: 1rem; } +.panel { background: #fff; border: 1px solid #d7d9de; border-radius: 8px; padding: .9rem; } +h2 { margin: .1rem 0 .6rem; font-size: 1rem; } +input, select, button { font: inherit; } +input, select { padding: .35rem .45rem; border: 1px solid #b9bdc5; border-radius: 6px; margin-right: .4rem; } +button { padding: .35rem .7rem; border: 1px solid #374151; background: #374151; color: #fff; border-radius: 6px; cursor: pointer; } +ul { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .4rem; } +li { display: flex; gap: .6rem; align-items: center; justify-content: space-between; border: 1px solid #e4e6ea; border-radius: 6px; padding: .45rem .6rem; } +.hidden { display: none; } +.error { color: #b91c1c; font-weight: 600; } diff --git a/examples/research-workbench-app/server.js b/examples/research-workbench-app/server.js new file mode 100644 index 0000000..c4ec2d1 --- /dev/null +++ b/examples/research-workbench-app/server.js @@ -0,0 +1,99 @@ +// Production delivery trial for the Marqdo research workbench design. +// This is a real application (Express + JSON persistence), NOT the web Tool: +// the design/Preview prototype never runs as a dependency of this server. +import express from "express"; +import { readFileSync, writeFileSync, existsSync } from "node:fs"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; + +const here = dirname(fileURLToPath(import.meta.url)); + +export function createApp({ dataFile }) { + const app = express(); + app.use(express.json({ limit: "64kb" })); + app.use(express.static(join(here, "public"))); + + const load = () => { + if (!existsSync(dataFile)) return { nextId: 1, tasks: [] }; + return JSON.parse(readFileSync(dataFile, "utf8")); + }; + const save = (state) => writeFileSync(dataFile, JSON.stringify(state, null, 2)); + + const fail = (response, status, code, message) => + response.status(status).json({ error: { code, message } }); + + app.get("/api/tasks", (request, response) => { + const state = load(); + const query = String(request.query.q ?? "").trim().toLowerCase(); + const status = String(request.query.status ?? "").trim(); + const tasks = state.tasks.filter((task) => { + const matchesQuery = !query || task.title.toLowerCase().includes(query); + const matchesStatus = !status || task.status === status; + return matchesQuery && matchesStatus; + }); + response.json({ tasks }); + }); + + app.post("/api/tasks", (request, response) => { + const title = typeof request.body?.title === "string" ? request.body.title.trim() : ""; + const priority = request.body?.priority ?? "normal"; + if (!title) return fail(response, 400, "task.title_required", "任务标题不能为空"); + if (title.length > 120) return fail(response, 400, "task.title_too_long", "任务标题不能超过 120 字符"); + if (!["low", "normal", "high"].includes(priority)) { + return fail(response, 400, "task.priority_invalid", "优先级必须是 low/normal/high"); + } + const state = load(); + const task = { + id: state.nextId++, + title, + priority, + status: "open", + createdAt: new Date().toISOString(), + }; + state.tasks.push(task); + save(state); + response.status(201).json({ task }); + }); + + app.patch("/api/tasks/:id/status", (request, response) => { + const id = Number(request.params.id); + const status = request.body?.status; + if (!Number.isInteger(id) || id < 1) return fail(response, 400, "task.id_invalid", "任务 id 非法"); + if (!["open", "doing", "done"].includes(status)) { + return fail(response, 400, "task.status_invalid", "状态必须是 open/doing/done"); + } + const state = load(); + const task = state.tasks.find((item) => item.id === id); + if (!task) return fail(response, 404, "task.not_found", "任务不存在"); + task.status = status; + save(state); + response.json({ task }); + }); + + app.get("/api/stats", (request, response) => { + const state = load(); + const total = state.tasks.length; + const byStatus = { open: 0, doing: 0, done: 0 }; + const byPriority = { low: 0, normal: 0, high: 0 }; + for (const task of state.tasks) { + byStatus[task.status] += 1; + byPriority[task.priority] += 1; + } + response.json({ total, byStatus, byPriority }); + }); + + app.use((request, response) => + fail(response, 404, "app.not_found", `unknown route ${request.method} ${request.path}`), + ); + + return app; +} + +const isMain = process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]; +if (isMain) { + const port = Number(process.env.PORT ?? 4173); + const dataFile = process.env.WORKBENCH_DATA ?? join(here, "workbench-data.json"); + createApp({ dataFile }).listen(port, "127.0.0.1", () => { + console.log(`research-workbench listening on http://127.0.0.1:${port} (data: ${dataFile})`); + }); +} diff --git a/examples/research-workbench-app/test/api.test.js b/examples/research-workbench-app/test/api.test.js new file mode 100644 index 0000000..69c971e --- /dev/null +++ b/examples/research-workbench-app/test/api.test.js @@ -0,0 +1,88 @@ +// Production API acceptance: real server, real file persistence, real HTTP. +import test from "node:test"; +import assert from "node:assert/strict"; +import { mkdtempSync, readFileSync, rmSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { createApp } from "../server.js"; + +async function withServer(run) { + const dir = mkdtempSync(join(tmpdir(), "workbench-")); + const dataFile = join(dir, "data.json"); + const app = createApp({ dataFile }); + const server = app.listen(0, "127.0.0.1"); + await new Promise((resolve) => server.once("listening", resolve)); + const base = `http://127.0.0.1:${server.address().port}`; + try { + await run({ base, dataFile }); + } finally { + await new Promise((resolve) => server.close(resolve)); + rmSync(dir, { recursive: true, force: true }); + } +} + +test("creates, searches, updates and reports linked statistics with persistence", async () => { + await withServer(async ({ base, dataFile }) => { + const created = await fetch(`${base}/api/tasks`, { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ title: "测量超导比特", priority: "high" }), + }); + assert.equal(created.status, 201); + const { task } = await created.json(); + assert.equal(task.title, "测量超导比特"); + assert.equal(task.status, "open"); + + const second = await fetch(`${base}/api/tasks`, { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ title: "整理实验记录" }), + }); + assert.equal(second.status, 201); + + const list = await (await fetch(`${base}/api/tasks?q=超导`)).json(); + assert.equal(list.tasks.length, 1); + assert.equal(list.tasks[0].id, task.id); + + const invalid = await fetch(`${base}/api/tasks`, { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ title: " " }), + }); + assert.equal(invalid.status, 400); + assert.equal((await invalid.json()).error.code, "task.title_required"); + + const badPriority = await fetch(`${base}/api/tasks`, { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ title: "x", priority: "urgent" }), + }); + assert.equal(badPriority.status, 400); + + const update = await fetch(`${base}/api/tasks/${task.id}/status`, { + method: "PATCH", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ status: "done" }), + }); + assert.equal(update.status, 200); + + const missing = await fetch(`${base}/api/tasks/999/status`, { + method: "PATCH", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ status: "done" }), + }); + assert.equal(missing.status, 404); + assert.equal((await missing.json()).error.code, "task.not_found"); + + const stats = await (await fetch(`${base}/api/stats`)).json(); + assert.equal(stats.total, 2); + assert.equal(stats.byStatus.done, 1); + assert.equal(stats.byStatus.open, 1); + assert.equal(stats.byPriority.high, 1); + + // Persistence is a real file: a new app instance reads the same state. + const reloaded = JSON.parse(readFileSync(dataFile, "utf8")); + assert.equal(reloaded.tasks.length, 2); + assert.equal(reloaded.nextId, 3); + }); +}); diff --git a/preview b/preview index 8b3281b..eff273f 160000 --- a/preview +++ b/preview @@ -1 +1 @@ -Subproject commit 8b3281bac0772d98625b147654238b294ee6c11e +Subproject commit eff273f7f2f3919bab62eacded781c61d5f03f91 diff --git a/scripts/domain-acceptance.sh b/scripts/domain-acceptance.sh new file mode 100755 index 0000000..c16d916 --- /dev/null +++ b/scripts/domain-acceptance.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +# WEB-04 domain acceptance: three composition cases through the unique web Tool +# plus the real production delivery trial (Express app with API and E2E). +set -eu +: "${MARQDO_BIN:?set MARQDO_BIN to the verified marqdo executable}" +: "${MARQDO_WEB_TOOL_JSON:?set MARQDO_WEB_TOOL_JSON to the built preview tool.json}" +cd "$(dirname "$0")/.." +work="$(mktemp -d)" +trap 'rm -rf "$work"' EXIT +export MARQDO_TOOL_HOME="$work/tool-home" +"$MARQDO_BIN" tool install "$MARQDO_WEB_TOOL_JSON" + +run_case() { + case_name="$1" + unit="$2" + root="examples/$case_name" + entry="$root/index.mq.md" + "$MARQDO_BIN" web check "$entry" --unit "$unit" --root "$root" + preview="$work/$case_name-preview" + "$MARQDO_BIN" web preview "$entry" --unit "$unit" --root "$root" --out "$preview" + test -f "$preview/index.html" + grep -q "Content-Security-Policy" "$preview/index.html" + grep -q "data-scenario\|data-instance" "$preview/index.html" + handoff="$work/$case_name-handoff.md" + "$MARQDO_BIN" web handoff "$entry" --unit "$unit" --root "$root" --out "$handoff" + test -s "$handoff" + grep -q "Design handoff" "$handoff" + echo "case $case_name: PASS" +} + +run_case research-workspace 工作台 +run_case doc-site 首页 +run_case quantum-editor 编辑器 + +# Production delivery trial: a real framework application, not the prototype. +( + cd examples/research-workbench-app + npm install --no-audit --no-fund ${MARQDO_NPM_CACHE:+--cache "$MARQDO_NPM_CACHE"} + npm test + WORKBENCH_DATA="$work/e2e-data.json" npx playwright test +) +"$MARQDO_BIN" tool remove web +echo "PASS: WEB-04 domain composition + production delivery trial"