agentworkshop 0.15.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/6b699164-8ee5-4c6d-8213-ff13ae17443f.json +1 -0
- package/.output/server/chunks/_/nitro.mjs +1119 -1112
- package/.output/server/package.json +1 -1
- package/README-zh.md +11 -7
- package/README.md +11 -7
- package/config.yml +1 -1
- package/docs/cli.en.md +1 -1
- package/docs/cli.md +1 -1
- package/docs/plugins.en.md +1 -1
- package/docs/plugins.md +1 -1
- package/docs/sdk.en.md +1 -1
- package/docs/sdk.md +1 -1
- package/package.json +1 -1
- package/server/services/workshop/db/database/migrations.ts +10 -0
- package/server/services/workshop/db/database/open.ts +6 -3
- package/server/services/workshop/db/database/schema.ts +4 -1
- package/.output/public/_nuxt/builds/meta/c1f41981-1e18-4ae0-be61-9db5f5bc284e.json +0 -1
package/README-zh.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
[](https://www.npmjs.com/package/agentworkshop)
|
|
12
12
|
[](https://www.npmjs.com/package/agentworkshop)
|
|
13
|
-
[](https://github.com/kingdol666/AgentWorkShop/releases/tag/v0.15.
|
|
13
|
+
[](https://github.com/kingdol666/AgentWorkShop/releases/tag/v0.15.1)
|
|
14
14
|
[](https://github.com/kingdol666/AgentWorkShop/stargazers)
|
|
15
15
|
[](https://github.com/kingdol666/AgentWorkShop/commits)
|
|
16
16
|
[](https://github.com/kingdol666/AgentWorkShop/issues)
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
**[English](./README.md)** · **[在线文档](https://kingdol666.github.io/AgentWorkShop)** · **[版本发布](https://github.com/kingdol666/AgentWorkShop/releases)** · **[更新日志](./changelog.md)** · **[插件 API](./docs/plugins.md)** · **[SDK](./docs/sdk.md)**
|
|
30
30
|
|
|
31
|
-
<sub><b>源码 v0.15.
|
|
31
|
+
<sub><b>源码 v0.15.1(2026-11-21 发布)</b> · 14 个执行引擎 · 6 种现场协议(5 内置 + 串口插件)+ MES REST(镜像与直连双路径)· **项目中心** · **RSI 经验演化** · **受治理产品经验** · **IDD/RAG 插件集成** · **AgentPrefab / Skill / MCP 能力供应链** · 双语文档(简体中文 / English)</sub>
|
|
32
32
|
|
|
33
33
|
<br />
|
|
34
34
|
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
</div>
|
|
38
38
|
|
|
39
|
-
[快速开始](#快速开始) · [当前源码](#当前源码-v0-15-
|
|
39
|
+
[快速开始](#快速开始) · [当前源码](#当前源码-v0-15-1) · [0.15.1 发布说明](#whats-new-in-0151) · [Agent 团队模型](#agent-团队模型) · [核心能力](#核心能力) · [设计架构](#设计架构) · [验证与验收](#验证与验收) · [文档站](https://kingdol666.github.io/AgentWorkShop)
|
|
40
40
|
|
|
41
41
|
---
|
|
42
42
|
|
|
@@ -49,13 +49,17 @@
|
|
|
49
49
|
- **交付是一等概念**:**Project 模式**把蓝图变成计划、带依赖的 WBS、L1 技术复核、L2 Owner 验收与真实交付物——交付物不通过,项目不算完成;
|
|
50
50
|
- **作业链按治理阶段实现**:读取 → 分析 → 提案 → 按有效策略审批(如适用)→ 下发 → 回读/审计;每份验收证据应注明实际覆盖范围及使用模拟器还是物理设备。
|
|
51
51
|
|
|
52
|
-
## 当前源码 v0.15.
|
|
52
|
+
## 当前源码 v0.15.1
|
|
53
53
|
|
|
54
|
-
当前源码版本为 **0.15.
|
|
54
|
+
当前源码版本为 **0.15.1**(npm + GitHub Release,2026-11-21)。本版包含 **0.15.0 的全部内容**——「AgentPrefab 能力装配」计划(七个合并 PR,#252–#258)端到端落地:系统设置新增三条能力供应链页——**技能管理**(标准 `SKILL.md` 发现 → 不可变受管导入 → 显式启用;发现范围覆盖内置 `skills/`、受管 `<configRoot>/skills`、`~/.agent/skills`(npm/Agent Skills 标准)、`~/.agents/skills`、XDG 与 `AW_SKILL_ROOTS`;发现/导入/激活全程不执行 Skill 脚本)、**外部 MCP**(仅 HTTPS Streamable HTTP 清单 + `AW_MCP_*` 凭据引用 + 管理员评审的 shared-safe 只读工具 + 私网/环回/保留地址出口封锁)、**Agent 预制件**(角色/场景提示词 + 多维自定义插槽 + 逐能力开关封装为不可变 revision,发布即冻结)。Channel 成员固定绑定 `(prefabId, revision, slots, contentHash)`,Session 克隆与 Project 任务实例冻结同一快照,运行时按「预制体选择 ∩ 系统启用/评审 ∩ 频道/项目策略 ∩ 角色工业门 ∩ harness 受管面」在每次 dispatch 重新授权,撤销无法被缓存目录绕过。数据库契约 v7→v9(v8:AgentPrefab 表与快照列;v9:修复 0.7 时代存量家目录启动即崩——`chat_deliveries` 重试索引移出契约 SQL、在补列之后幂等创建,已用真实旧库副本验证升级路径)。
|
|
55
55
|
|
|
56
56
|
合并主干门禁(`87805eaf`):typecheck、lint、build、docs **101/0**、readme、i18n **3439/3439**、cssvars、frontend-lifecycle、skills **197/0**、MCP **14/14**、unit **2185/2186**(1 条件跳过)全绿。隔离全新实例实机验收 **21/21**:`~/.agent/skills` 全局发现 → 不可变导入 → 启用 → 预制体发布/成员绑定 → 工具目录收窄 → `activate_skill` 低信任正文注入 → 越权调用拒绝 → Session 克隆绑定与快照哈希 → 发布新 revision 不自动升级 → Skill 撤销即时拒绝 → MCP 非 HTTPS/无密钥/失败有界;另在存量实例上完成两次重启持久性核验(写尝试台账 3277 行分布一致、绝不重发)与治理评测门实机触发(伪报 400、无宿主来源拒晋升 active、客户端 run 拒 active、shadow 晋级成功)。边界:外部 MCP 正向实网联通、Prefab 指导下的真实 OMP 模型作业、浏览器 UI 点击验收为 NOT_RUN;Mimosa 深扫有封印但 inconclusive,不作安全通过声明。见[全流程验收报告](docs/audit/evidence/2026-11-21-fullflow-round/REPORT.md)与[Prefab/Skills/MCP 实机报告](docs/audit/evidence/2026-11-21-agent-prefab-acceptance/REPORT.md)。
|
|
57
57
|
|
|
58
|
-
## What's new in 0.15.
|
|
58
|
+
## What's new in 0.15.1
|
|
59
|
+
|
|
60
|
+
- **存量家目录启动修复(v9)**:0.7 时代的旧家目录(无迁移台账、`chat_deliveries` 缺 `next_retry_at` 列)在 0.15.0 及更早版本上启动即崩(`no such column: next_retry_at`)——契约 SQL 内的 `idx_chat_deliveries_retry` 在补列迁移之前执行。v9 把该索引移出契约 SQL,改为补列后幂等创建;发布验证在真实旧库副本上实证:boot OK、三列补齐、索引重建、契约 v9 落账、Prefab 列就位。
|
|
61
|
+
|
|
62
|
+
## What's new in 0.15.0 — 历史发布说明
|
|
59
63
|
|
|
60
64
|
- **技能管理(#253)**:Agent Skills 标准发现目录与不可变受管副本(`<configRoot>/skills/<name>/<hash>/`,导入默认未启用);设置页支持发现/导入/启用/停用/删除与 SKILL.md 读取;同名多来源保留冲突提示;`allowed-tools` 仅为实验性 metadata,不授予工具权限。
|
|
61
65
|
- **外部 MCP 管理(#254)**:HTTPS-only Streamable HTTP 清单(`<configRoot>/mcp/servers/<id>.json`)、`AW_MCP_*` 环境凭据引用(不落文件/界面/日志)、发现 → pending → 管理员评审(`dataSharing=shared-safe` 且 `classification=read` 才可批准,首版不开放写工具)、endpoint/凭据代际/协议/工具名/schema 变化或超过 `maxDiscoveryAgeMs` 自动回到 pending、出口防护(私网/环回/保留地址拒绝 + 固定 DNS 解析 + 同源重定向 + 超时不自动重试)。
|
|
@@ -462,7 +466,7 @@ curl -X POST http://localhost:3001/api/workshop/projects/instantiate \
|
|
|
462
466
|
|
|
463
467
|
**如果这个项目对你有用,点一个 ⭐ 能让更多人找到它。**
|
|
464
468
|
|
|
465
|
-
当前源码版本:**v0.15.
|
|
469
|
+
当前源码版本:**v0.15.1(已发布 2026-11-21)** —— [最新版本 v0.15.1](https://github.com/kingdol666/AgentWorkShop/releases/tag/v0.15.1) · [更新日志](./changelog.md) · [在线文档](https://kingdol666.github.io/AgentWorkShop)
|
|
466
470
|
|
|
467
471
|
<a href="https://star-history.com/#kingdol666/AgentWorkShop&Date">
|
|
468
472
|
<img src="https://api.star-history.com/svg?repos=kingdol666/AgentWorkShop&type=Date" alt="Star history" width="70%" />
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
[](https://www.npmjs.com/package/agentworkshop)
|
|
12
12
|
[](https://www.npmjs.com/package/agentworkshop)
|
|
13
|
-
[](https://github.com/kingdol666/AgentWorkShop/releases/tag/v0.15.
|
|
13
|
+
[](https://github.com/kingdol666/AgentWorkShop/releases/tag/v0.15.1)
|
|
14
14
|
[](https://github.com/kingdol666/AgentWorkShop/stargazers)
|
|
15
15
|
[](https://github.com/kingdol666/AgentWorkShop/commits)
|
|
16
16
|
[](https://github.com/kingdol666/AgentWorkShop/issues)
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
**[简体中文](./README-zh.md)** · **[Documentation](https://kingdol666.github.io/AgentWorkShop)** · **[Releases](https://github.com/kingdol666/AgentWorkShop/releases)** · **[Changelog](./changelog.md)** · **[Plugin API](./docs/plugins.md)** · **[SDK](./docs/sdk.md)**
|
|
30
30
|
|
|
31
|
-
<sub><b>source v0.15.
|
|
31
|
+
<sub><b>source v0.15.1 (released 2026-11-21)</b> · 14 engines · 6 field protocols (5 built-in + serial plugin) + MES REST (mirror & live) · **Project center** · **RSI experience evolution** · **governed product experience** · **IDD/RAG plugin integration** · **AgentPrefab / Skills / MCP capability supply chain** · bilingual docs (简体中文 / English)</sub>
|
|
32
32
|
|
|
33
33
|
<br />
|
|
34
34
|
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
</div>
|
|
38
38
|
|
|
39
|
-
[Quick start](#quick-start) · [Current source](#current-source-v0-15-
|
|
39
|
+
[Quick start](#quick-start) · [Current source](#current-source-v0-15-1) · [0.15.1 release notes](#whats-new-in-0151) · [Agent team model](#the-agent-team-model) · [Capabilities](#capabilities) · [Architecture](#architecture) · [Verification](#verification) · [Docs site](https://kingdol666.github.io/AgentWorkShop)
|
|
40
40
|
|
|
41
41
|
---
|
|
42
42
|
|
|
@@ -49,13 +49,17 @@ A configuration-driven platform where **AI agent teams** and industrial systems
|
|
|
49
49
|
- **Delivery is a first-class concept**: **Project mode** turns a blueprint into a plan, a WBS with dependencies, L1 technical review, L2 owner acceptance and real deliverables — the project closes only when the deliverables pass;
|
|
50
50
|
- **The loop is implemented in governed stages**: read → analyze → propose → policy-controlled approval where required → write → readback/audit; the scope of each test and whether it used a simulator or physical equipment are stated with its evidence.
|
|
51
51
|
|
|
52
|
-
## Current source: v0.15.
|
|
52
|
+
## Current source: v0.15.1
|
|
53
53
|
|
|
54
|
-
The source version is **0.15.
|
|
54
|
+
The source version is **0.15.1** (npm + GitHub Release, 2026-11-21). It contains everything in 0.15.0 — the AgentPrefab capability-assembly plan implemented end to end (seven merged PRs, #252–#258). System Settings gains three capability supply-chain panes: **Skills** (standard `SKILL.md` discovery → immutable managed import → explicit enable; discovery covers built-in `skills/`, managed `<configRoot>/skills`, `~/.agent/skills` (the npm/Agent Skills standard), `~/.agents/skills`, XDG and `AW_SKILL_ROOTS`; no Skill script is ever executed during discovery, import or activation), **External MCP** (HTTPS-only Streamable HTTP manifests + `AW_MCP_*` credential references + admin-reviewed shared-safe read tools + egress guard blocking private/loopback/reserved addresses), and **Agent Prefabs** (role/scenario prompts + multi-dimensional custom slots + per-capability switches packaged as immutable revisions frozen at publish). A Channel member pins `(prefabId, revision, slots, contentHash)`; Session clones and Project task instances freeze the same snapshot; the runtime re-authorizes every dispatch against the intersection of prefab selection × system enablement/review × Channel/Project policy × role/industrial gating × harness-managed surface, so revocation cannot be bypassed by a cached catalog. Database schema contract moves v7→v9 (v8: AgentPrefab tables and snapshot columns; v9: fixes a boot crash on 0.7-era homes by moving the `chat_deliveries` retry index out of the contract SQL and creating it idempotently after column backfill — verified against a copy of a real legacy home).
|
|
55
55
|
|
|
56
56
|
Merged-main gates at `87805eaf`: typecheck, lint, build, docs **101/0**, readme, i18n **3439/3439**, cssvars, frontend-lifecycle, skills **197/0**, MCP **14/14**, unit **2185/2186** (1 conditional skip) all green. Isolated fresh-instance live acceptance **21/21**: `~/.agent/skills` global discovery → immutable import → enable → prefab publish/member binding → tool-catalog narrowing → `activate_skill` low-trust body injection → unauthorized-invocation denial → session clone binding and snapshot hash → new revision does not auto-upgrade → skill revocation denied immediately → MCP non-HTTPS/secret-less/bounded failure. A provisioned instance additionally passed two restart persistence cycles (write-attempt ledger 3277 rows, identical outcome distribution, never resent) and live governed-evaluation gate triggers (falsified summary 400, promotion to active without host provenance rejected, client-submitted run rejected, shadow promotion succeeds). Boundaries: external MCP positive live trace, real-OMP-model work under a prefab, and browser UI click-through remain NOT_RUN; the Mimosa deep scan is sealed but inconclusive — no security-pass claim. See the [full-flow acceptance report](docs/audit/evidence/2026-11-21-fullflow-round/REPORT.md) and the [Prefab/Skills/MCP live report](docs/audit/evidence/2026-11-21-agent-prefab-acceptance/REPORT.md).
|
|
57
57
|
|
|
58
|
-
## What's new in 0.15.
|
|
58
|
+
## What's new in 0.15.1
|
|
59
|
+
|
|
60
|
+
- **Legacy-home boot fix (schema v9)**: a 0.7-era home (no migration ledger, `chat_deliveries` missing `next_retry_at`) crashed on boot with `no such column: next_retry_at` on 0.15.0 and earlier — the contract SQL built `idx_chat_deliveries_retry` before the column-backfill migrations ran. v9 moves the index out of the contract SQL and creates it idempotently after backfill; release verification ran against a copy of a real legacy home: boot OK, columns backfilled, index rebuilt, contract v9 recorded, prefab columns in place.
|
|
61
|
+
|
|
62
|
+
## What's new in 0.15.0 (historical release notes)
|
|
59
63
|
|
|
60
64
|
- **Skills management (#253)**: Agent Skills-standard discovery catalog and immutable managed copies (`<configRoot>/skills/<name>/<hash>/`, imports disabled by default); the Settings pane supports discover/import/enable/disable/delete and SKILL.md reading; same-name multi-source conflicts keep every source visible; `allowed-tools` stays experimental metadata and never grants tool permissions.
|
|
61
65
|
- **External MCP management (#254)**: HTTPS-only Streamable HTTP manifests (`<configRoot>/mcp/servers/<id>.json`), `AW_MCP_*` environment credential references (never persisted to files/UI/logs), discovery → pending → admin review (`dataSharing=shared-safe` and `classification=read` required; no write tools in the first rollout), automatic re-pending on endpoint/credential-generation/protocol/tool-name/schema changes or `maxDiscoveryAgeMs` expiry, and egress guarding (private/loopback/reserved addresses rejected, pinned DNS resolution, same-origin redirects only, no automatic retry after timeout).
|
|
@@ -458,7 +462,7 @@ Please **do not** open public issues for vulnerabilities — report privately vi
|
|
|
458
462
|
|
|
459
463
|
**If this project is useful to you, a ⭐ helps others find it.**
|
|
460
464
|
|
|
461
|
-
Current source version: **v0.15.
|
|
465
|
+
Current source version: **v0.15.1 (released 2026-11-21)** — [Latest release v0.15.1](https://github.com/kingdol666/AgentWorkShop/releases/tag/v0.15.1) · [Changelog](./changelog.md) · [Documentation](https://kingdol666.github.io/AgentWorkShop)
|
|
462
466
|
|
|
463
467
|
<a href="https://star-history.com/#kingdol666/AgentWorkShop&Date">
|
|
464
468
|
<img src="https://api.star-history.com/svg?repos=kingdol666/AgentWorkShop&type=Date" alt="Star history" width="70%" />
|
package/config.yml
CHANGED
package/docs/cli.en.md
CHANGED
|
@@ -79,7 +79,7 @@ npx -p agentworkshop aw doctor # use -p when you want the name aw
|
|
|
79
79
|
| Package manager | `pnpm@11.9.0` (`packageManager`, needed only for source development) |
|
|
80
80
|
| Module format | ESM (`type: module`) |
|
|
81
81
|
| License | `Apache-2.0` |
|
|
82
|
-
| Current version | `0.15.
|
|
82
|
+
| Current version | `0.15.1` (`package.json`) |
|
|
83
83
|
|
|
84
84
|
## 2. First start (the Claude Code experience)
|
|
85
85
|
|
package/docs/cli.md
CHANGED
|
@@ -76,7 +76,7 @@ npx -p agentworkshop aw doctor # 需要 aw 这个名字时用 -p 指定包
|
|
|
76
76
|
| 包管理器 | `pnpm@11.9.0`(`packageManager`,仅源码开发需要) |
|
|
77
77
|
| 模块形态 | ESM(`type: module`) |
|
|
78
78
|
| 许可证 | `Apache-2.0` |
|
|
79
|
-
| 当前版本 | `0.15.
|
|
79
|
+
| 当前版本 | `0.15.1`(`package.json`) |
|
|
80
80
|
|
|
81
81
|
## 二、首次启动(Claude Code 式)
|
|
82
82
|
|
package/docs/plugins.en.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
>
|
|
10
10
|
> Applies to: plugin system v2 has been available since **v0.7.29** (frontend component
|
|
11
11
|
> injection / plugin settings / plugin i18n / runtime services surface); this document
|
|
12
|
-
> describes **v0.15.
|
|
12
|
+
> describes **v0.15.1**. `ctx.sdkVersion` is currently `0.3.0`.
|
|
13
13
|
|
|
14
14
|
## 1. Folder layout & quick start
|
|
15
15
|
|
package/docs/plugins.md
CHANGED
package/docs/sdk.en.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
**SDK version constants**: server-side `SDK_VERSION = '0.3.0'`, browser-side `CLIENT_SDK_VERSION = '0.3.0'`.
|
|
9
9
|
These two constants are the **interface version of the SDK itself** and evolve **independently**
|
|
10
|
-
from the npm package version (the `version` field in `package.json`, currently 0.15.
|
|
10
|
+
from the npm package version (the `version` field in `package.json`, currently 0.15.1) —
|
|
11
11
|
them being out of sync is expected. Never use `SDK_VERSION` to infer the package version, or the reverse.
|
|
12
12
|
**Module format**: ESM only (only `import` / `export`; there is no CJS entry).
|
|
13
13
|
**Types**: `sdk/index.d.mts` and `sdk/client.d.mts` ship with the package, so TypeScript projects
|
package/docs/sdk.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
> 零第三方运行时依赖,Node ≥ 23.4 与现代浏览器双端可用。
|
|
6
6
|
|
|
7
7
|
**SDK 版本常量**:服务端 `SDK_VERSION = '0.3.0'`,浏览器端 `CLIENT_SDK_VERSION = '0.3.0'`。
|
|
8
|
-
这两个常量是 **SDK 自身接口的版本号**,与 npm 包版本(`package.json` 的 `version`,当前 0.15.
|
|
8
|
+
这两个常量是 **SDK 自身接口的版本号**,与 npm 包版本(`package.json` 的 `version`,当前 0.15.1)
|
|
9
9
|
**各自独立演进** —— 常数不同步是预期行为,不要拿 `SDK_VERSION` 去推断包版本,反之亦然。
|
|
10
10
|
**模块形态**:ESM only(只有 `import` / `export`,没有 CJS 入口)。
|
|
11
11
|
**类型**:`sdk/index.d.mts`、`sdk/client.d.mts` 随包发布,TS 项目零配置获得提示(覆盖范围见 §7)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentworkshop",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AgentWorkShop — a configuration-driven industrial agent runtime: agent teams, Channel sessions, Project delivery and governed plant writes",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -614,3 +614,13 @@ export function migrateDualDriveColumns(db: DatabaseSync): void {
|
|
|
614
614
|
migrateAddColumn(db, 'process_model_eligibility', 'dataset_id', 'TEXT NOT NULL DEFAULT \'\'')
|
|
615
615
|
migrateAddColumn(db, 'process_model_eligibility', 'dataset_hash', 'TEXT NOT NULL DEFAULT \'\'')
|
|
616
616
|
}
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* 补齐 chat_deliveries 的重试面:idx_chat_deliveries_retry(status, next_retry_at)
|
|
620
|
+
* 不在契约 SCHEMA_SQL 里创建(0.7 时代存量库缺 next_retry_at 列,建契约 schema
|
|
621
|
+
* 时建索引会中断启动),改为在 attempts/next_retry_at/claimed_at 补列之后
|
|
622
|
+
* 幂等创建(全新库与存量库都走这里)。
|
|
623
|
+
*/
|
|
624
|
+
export function ensureChatDeliveryRetryIndex(db: DatabaseSync): void {
|
|
625
|
+
db.prepare('CREATE INDEX IF NOT EXISTS idx_chat_deliveries_retry ON chat_deliveries(status, next_retry_at)').run()
|
|
626
|
+
}
|
|
@@ -6,7 +6,7 @@ import type * as sqliteVec from 'sqlite-vec'
|
|
|
6
6
|
import { DatabaseSync } from 'node:sqlite'
|
|
7
7
|
import { CHANNEL_PRODUCT_BINDINGS_SQL, SCHEMA_SQL } from './schema'
|
|
8
8
|
import { createRequire } from 'node:module'
|
|
9
|
-
import { migrateAddColumn, migrateAgentTeamExecutionLeaseColumns, migrateAgentTeamTaskGuardrailColumns, migrateAgentTeamTaskGuardrails, migrateAgentTeamTaskQueueColumns, migrateAmlChannelOptimizationColumns, migrateAmlModelIdentityColumns, migrateAnalysisEditColumns, migrateApprovalPayloadColumns, migrateAuditQueryIndexes, migrateAuditScopeColumn, migrateChannelExecutionModeColumn, migrateChannelModeColumn, migrateDropOwnerFks, migrateDualDriveColumns, migrateGroupChatV17, migrateLegacySchema, migrateMissingForeignKeys, migrateAmlTwinProviderColumns, migrateOptimizerFoundationColumns, migrateAgentTokenGraceColumns } from './migrations'
|
|
9
|
+
import { migrateAddColumn, ensureChatDeliveryRetryIndex, migrateAgentTeamExecutionLeaseColumns, migrateAgentTeamTaskGuardrailColumns, migrateAgentTeamTaskGuardrails, migrateAgentTeamTaskQueueColumns, migrateAmlChannelOptimizationColumns, migrateAmlModelIdentityColumns, migrateAnalysisEditColumns, migrateApprovalPayloadColumns, migrateAuditQueryIndexes, migrateAuditScopeColumn, migrateChannelExecutionModeColumn, migrateChannelModeColumn, migrateDropOwnerFks, migrateDualDriveColumns, migrateGroupChatV17, migrateLegacySchema, migrateMissingForeignKeys, migrateAmlTwinProviderColumns, migrateOptimizerFoundationColumns, migrateAgentTokenGraceColumns } from './migrations'
|
|
10
10
|
import { migrateProjectColumns, ensureProjectIndexes, migrateApprovedSlotScope } from './migrations-project'
|
|
11
11
|
import { migrateSessionContextColumns, migrateSessionChannelModeColumn, ensureSessionIndexes } from './migrations-session'
|
|
12
12
|
import { migrateExperienceColumns, ensureExperienceIndexes } from './migrations-experience'
|
|
@@ -47,9 +47,10 @@ export function openWorkshopDb(path: string): DatabaseSync {
|
|
|
47
47
|
* assertMigrationFingerprint 查不到新版本行即放行并补录;同版本内的 SQL
|
|
48
48
|
* 漂移(手改/回滚 schema)仍会被哈希比对抓住。
|
|
49
49
|
* 历史:v1 初始契约;v2 2026-11-15 channels.channel_mode;v3 messages.claim_token;v4 受治理经验版本;
|
|
50
|
-
* v5 发布请求+审计 outbox;v6 反射 outbox;v7 设备写尝试账本;v8 AgentPrefab 草稿/不可变 revision
|
|
50
|
+
* v5 发布请求+审计 outbox;v6 反射 outbox;v7 设备写尝试账本;v8 AgentPrefab 草稿/不可变 revision;
|
|
51
|
+
* v9 chat_deliveries 重试索引移出契约 SQL(0.7 时代存量库缺 next_retry_at 列,契约内建索引会中断启动)。
|
|
51
52
|
*/
|
|
52
|
-
export const SCHEMA_CONTRACT_VERSION =
|
|
53
|
+
export const SCHEMA_CONTRACT_VERSION = 9
|
|
53
54
|
|
|
54
55
|
/** 对已打开的库执行初始化:WAL + 外键约束 + 建表 + 增量迁移 */
|
|
55
56
|
export function initWorkshopDb(db: DatabaseSync): void {
|
|
@@ -92,6 +93,8 @@ export function initWorkshopDb(db: DatabaseSync): void {
|
|
|
92
93
|
// 2026-10-30 chat 投递崩溃恢复:pending 且 mailbox 未落库的投递由补偿器退避重投(阶段2)
|
|
93
94
|
migrateAddColumn(db, 'chat_deliveries', 'attempts', 'INTEGER NOT NULL DEFAULT 0')
|
|
94
95
|
migrateAddColumn(db, 'chat_deliveries', 'next_retry_at', 'TEXT')
|
|
96
|
+
// 重试索引在补列之后幂等创建(契约 SQL 不建它;0.7 时代存量库缺列会中断启动)
|
|
97
|
+
ensureChatDeliveryRetryIndex(db)
|
|
95
98
|
migrateAddColumn(db, 'chat_deliveries', 'claimed_at', 'TEXT')
|
|
96
99
|
// v10:模板可见性列(既有库补列;默认 private,仅属主可见)
|
|
97
100
|
migrateAddColumn(db, 'agents', 'visibility', 'TEXT NOT NULL DEFAULT \'private\'')
|
|
@@ -528,7 +528,10 @@ CREATE TABLE IF NOT EXISTS chat_deliveries (
|
|
|
528
528
|
updated_at TEXT NOT NULL,
|
|
529
529
|
UNIQUE(chat_message_id, target_agent_id)
|
|
530
530
|
);
|
|
531
|
-
|
|
531
|
+
-- idx_chat_deliveries_retry(status, next_retry_at) 不在契约 SQL 里创建:
|
|
532
|
+
-- 0.7 时代存量库的 chat_deliveries 缺 next_retry_at 列,建契约 schema 时建索引会以
|
|
533
|
+
-- "no such column" 中断启动;改为在 migrateAddColumn 补列之后由
|
|
534
|
+
-- ensureChatDeliveryRetryIndex 幂等创建(migrations.ts)。
|
|
532
535
|
CREATE INDEX IF NOT EXISTS idx_chat_deliveries_message ON chat_deliveries(chat_message_id);
|
|
533
536
|
CREATE INDEX IF NOT EXISTS idx_chat_deliveries_agent ON chat_deliveries(target_agent_id, status);
|
|
534
537
|
-- Agent 回复关联链热路径:agentReplyToChat 按 mailboxMessageId 反查群聊来源
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"c1f41981-1e18-4ae0-be61-9db5f5bc284e","timestamp":1795251202516,"prerendered":[]}
|