@sema-agent/settings-schema 26.0.0 → 26.1.0
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/CHANGELOG.md +76 -0
- package/README.md +25 -1
- package/conformance/VERSION +1 -1
- package/dist/hooks.d.ts +34 -1
- package/dist/hooks.js +62 -1
- package/docs/API-SURFACE.md +9 -3
- package/llms-full.txt +3 -1
- package/llms.txt +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,82 @@
|
|
|
8
8
|
|
|
9
9
|
## Unreleased
|
|
10
10
|
|
|
11
|
+
## 26.1.0 — 2026-11-11 — minor:引擎属主钩子事件的**逐员起始契约版本**成了导出的数据(`ENGINE_OWNED_HOOK_EVENT_SINCE`)· 一只读者 `engineOwnsHookEventAt(event, contractVersion)`
|
|
12
|
+
|
|
13
|
+
> 档位(按发版纪律):**minor** —— 只加导出(包根与 `./hooks` 子路径各三名:两个值、一个型);无导出删除、无闭集缩小、无校验变化、无读数变化:`ENGINE_OWNED_HOOK_EVENTS` 的元组型与成员顺序(已发的型面)、`HOOK_EVENT_OWNER` 的读数、`HooksConfig` / `classifyHooksConfig` 对任何设置文档的读数都逐字不变。
|
|
14
|
+
> 属主集没有新成员,所以持「按属主集穷举」的 `Record` / `switch` 的消费方提货不会编译红。
|
|
15
|
+
|
|
16
|
+
### 病
|
|
17
|
+
|
|
18
|
+
26.0.0 把 `PermissionDenied` 由壳属主改判引擎属主。按属主表分流的消费方提了 26.0.0、而对端服务端还没提时,会把这只钩子装进请求体交给一台**不认它归引擎**的服务端,服务端静默不注册 —— 本端以为交出去了,两边都不跑,wire 上看不出来。
|
|
19
|
+
「某一员从哪一版契约起归引擎」此前只写在属主表的型注释里,没有导出成数据:消费方只能各自手写 `{ PermissionDenied: "26.0.0" }` 一类的特例表 —— 同一件事多个来源。
|
|
20
|
+
|
|
21
|
+
### 律(一条)
|
|
22
|
+
|
|
23
|
+
**一个事实一处**:「某员从哪一版起归引擎」只住在 `ENGINE_OWNED_HOOK_EVENT_SINCE` 这一张表里,读它的比较只住在 `engineOwnsHookEventAt` 这一只函数里。表的键集与 `ENGINE_OWNED_HOOK_EVENTS` 同源:加员而没给起始版本、或表里有不在属主集里的键,**编译红**(表不会与属主集漂开)。
|
|
24
|
+
消费规则一句话(成文在 README「钩子事件按属主分流」一节):**交引擎 ⟺ 属主表说 `engine` ∧ 对端契约版本 ≥ 该员的起始版本**;对端版本读自服务端 `GET /v1/capabilities` 的 `settingsContract.version`,缺席 ⇒ 传你方支持底线(你方支持的最老一代服务端所内嵌的契约版本)。
|
|
25
|
+
|
|
26
|
+
### 导出面
|
|
27
|
+
|
|
28
|
+
- **新增**(包根与 `./hooks` 子路径各一份,共三名):
|
|
29
|
+
- `ENGINE_OWNED_HOOK_EVENT_SINCE: Readonly<Record<EngineOwnedHookEvent, string>>` —— 引擎属主十员各自的**起始契约版本**(第一次出现在属主集里的本包版本,按包现名的版本线记,完整 `x.y.z`),冻结。`PermissionDenied` = `"26.0.0"`,其余九员 = `"1.0.0"`(包现名的第一个版本 —— 下限,不是这九员的引入日期,见下节)。
|
|
30
|
+
- `engineOwnsHookEventAt(event: string, contractVersion: string): boolean` —— 唯一的读者:`event` 在 `ENGINE_OWNED_HOOK_EVENTS` 里 **且** `contractVersion` ≥ 该员的起始版本 ⇒ `true`;其余(壳属主事件、不是钩子事件的名字、版本更低)⇒ `false`。
|
|
31
|
+
- 型 `EngineOwnedHookEvent` = `(typeof ENGINE_OWNED_HOOK_EVENTS)[number]`。
|
|
32
|
+
- **删除 / 类型缩窄 / 读法变**:无。`ENGINE_OWNED_HOOK_EVENTS` 仍是十员、同序(`PermissionDenied` 在尾),`HOOK_EVENT_OWNER` 仍由它派生;本版只改了它头注的文字(起始版本不再夹在注释里,指向那张表)。
|
|
33
|
+
|
|
34
|
+
### 值是从 tag 史读的(不凭记忆、不凭注释)
|
|
35
|
+
|
|
36
|
+
逐个 tag(`v0.11.0` … `v26.0.0`,共 82 个)读 `git show <tag>:src/hooks.ts` 里 `ENGINE_OWNED_HOOK_EVENTS` 的成员:
|
|
37
|
+
- `PermissionDenied`:`v25.1.0`(九员)没有它,`v26.0.0`(十员,它在尾)有 ⇒ `26.0.0`。
|
|
38
|
+
- 其余九员:从最早的 tag `v0.11.0` 到 `v25.1.0` 的每一个 tag 上都是这九员、同序,没有进出过;仓库的第一个提交(旧包名 `@sema-agent/registry-core` 的 0.10.9)里已经是这九员 —— 它们比改名还早。起始版本按**本包现名的版本线**记:`1.0.0` 是包改名后的第一个版本(见本档头注的包名分水岭),`v1.0.0` 的属主集已是这九员 ⇒ `1.0.0`。
|
|
39
|
+
因此 `1.0.0` 是「本包现名能报出的最低版本」,不是这九员的引入日期;凡报得出契约版本的对端都不低于它,规则对这九员恒 `true`。
|
|
40
|
+
|
|
41
|
+
### 读者的律
|
|
42
|
+
|
|
43
|
+
- **只收完整的 `x.y.z`**:十进制、无前导零、无预发布 / 构建段、无 `v` 前缀、无空白。其余 —— 含 `"26"` · `"26.0"` · `"v26.0.0"` · `""` · `"26.0.0-rc.1"` · `"26.0.0+build.5"`,以及非字符串(含 `undefined`)—— **抛 `TypeError`**,稳定句以 `engineOwnsHookEventAt: contractVersion must be a complete x.y.z version` 起头,**不回显入参**(对端给的串是外来输入)。不猜、不当 0。
|
|
44
|
+
- **预发布段的律**:`26.0.0-rc.1` 排在 `26.0.0` 之前,「它是不是已含某一员」是个猜,读者不猜 —— 消费方先去掉后缀,或按自己的律定了再问。
|
|
45
|
+
- **版本先于事件判**:坏版本对任何事件都抛(壳属主事件、不在集里的名字也一样),不会被读成「不归引擎」。事件名按**属主元组的成员**判(不是对象键读),`"constructor"` / `"__proto__"` 一类原型链上的名字 ⇒ `false`。
|
|
46
|
+
- 比较是**数值、逐段**(不是字符串序:`9.0.0` < `26.0.0` < `100.0.0`;`26.2.0` < `26.10.0`),段长不设上限(超过 2^53 的段也按数值精确比)。
|
|
47
|
+
- **对端版本位缺席**是消费方的事(底线各家不同):函数不收 `undefined`,缺席时传你方支持底线。
|
|
48
|
+
|
|
49
|
+
### 三问
|
|
50
|
+
|
|
51
|
+
- **谁需要**:按属主表分流的消费方 —— client-core(重生成的属主表 · 请求体只投引擎属主事件)· cli(本地座位表)· web-client / desktop(随 client-core 的镜像)· web-admin(凡读属主表决定「交引擎还是本端跑」的地方)—— 对着一台可能还没提 26.0.0 的服务端,要判「这只钩子交过去,对端会不会跑」。没有这张表,每个消费方各写一份特例表,一个事实多个来源。
|
|
52
|
+
- **谁受伤**:无。纯加性:校验、读数、属主元组的型与顺序一字不变;属主集没有新成员,穷举 `Record<EngineOwnedHookEvent, …>` / `switch` 的消费方提货不会编译红;不读新导出的消费方零动作。
|
|
53
|
+
- **补偿**:不适用(无人受伤)。
|
|
54
|
+
|
|
55
|
+
### 各消费方
|
|
56
|
+
|
|
57
|
+
| 消费方 | 读点 | 动作 |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| client-core | 重生成的属主表 · 请求体只投引擎属主事件的那一步 | 请托的读法:对端契约版本读自 `settingsContract.version`(缺席传支持底线)后,**交引擎 ⟺ 属主表说 `engine` ∧ `engineOwnsHookEventAt(event, 对端契约版本)`**;自己手写的 `PermissionDenied` 特例表(若有)在提货本版后退役,不留第二个来源 |
|
|
60
|
+
| cli | SDK 入口面转出的属主集 · 本地座位表 | 同上;座位表里「引擎点亮、本地另有触发点」那一组按读者的答案分流,不再按特例 |
|
|
61
|
+
| web-client / desktop | 随 client-core 镜像 | 零代码改动(读法随 client-core) |
|
|
62
|
+
| web-admin | 凡读属主表决定「交引擎还是本端跑」的地方(若有) | 同上;没有这样的读点则零改动 |
|
|
63
|
+
| server | 内嵌本包、在 `/v1/capabilities` 报 `settingsContract.version` 的一方 | 零代码改动(它是被判的一端) |
|
|
64
|
+
| sdk | 契约套件 | 零代码改动;语料不变 |
|
|
65
|
+
| test | 黑盒判据 | 见下「黑盒判据」 |
|
|
66
|
+
|
|
67
|
+
### 黑盒判据(从包的导出面可执行,不引用内部实现)
|
|
68
|
+
|
|
69
|
+
- **G1 表**:`Object.keys(ENGINE_OWNED_HOOK_EVENT_SINCE)` 恰是 `ENGINE_OWNED_HOOK_EVENTS` 的十员;`PermissionDenied` = `"26.0.0"`,其余九员 = `"1.0.0"`;表是冻结的。
|
|
70
|
+
- **G2 读者边界**:`engineOwnsHookEventAt("PermissionDenied", "25.1.0")` = `false`;`"26.0.0"` = `true`;`("Stop", "1.0.0")` = `true`;`("SessionStart", "999.0.0")` = `false`(壳属主恒假)。
|
|
71
|
+
- **G3 坏版本抛**:`("Stop", "26")` · `("Stop", "")` · `("Stop", "v26.0.0")` · `("Stop", "26.0.0-rc.1")` · `("Stop", undefined)` 都抛 `TypeError`;`("SessionStart", "26")` 同样抛(先判版本)。
|
|
72
|
+
- **G4 数值序**:`("PermissionDenied", "9.0.0")` = `false`,`("PermissionDenied", "100.0.0")` = `true`,`("PermissionDenied", "25.10.0")` = `false`。
|
|
73
|
+
|
|
74
|
+
### 钉
|
|
75
|
+
|
|
76
|
+
`test/hooks-engine-owned-since-26.1.0.test.ts`:表的键集恰 = 属主集(运行期)· 表的键型 / 事件型的类型等式(类型检查期)· **编译期红**:把真源 `src/hooks.ts` 变异两刀过 tsc —— 属主元组多一员而表里没有它 ⇒ 红,表里多一个不在属主集里的键 ⇒ 红(外加未变异对照零诊断,红归因于变异本身)·
|
|
77
|
+
`PermissionDenied` = `26.0.0`、其余九员 = `1.0.0` 逐员硬钉 · 值的出处对 tag 史的核对(`v1.0.0` / `v25.1.0` / `v26.0.0` 的属主集;没有 tag 的浅克隆里这一组跳)· 冻结 · 每个值是读者认的完整 `x.y.z` 且 ≤ 当前包版本 ·
|
|
78
|
+
读者:每员 × {起始版本前一版 ⇒ `false`,起始版本 ⇒ `true`,补丁 / 次 / 主三档更高 ⇒ `true`} · 壳属主事件与不在集里的名字(含原型链名)恒 `false` · 数值序而非字符串序 · 读者与 `HOOK_EVENT_OWNER` 在当前版本上逐事件同答 · 一组坏串与一组非字符串入参(含 `undefined`)都抛、句子稳定、不回显 · 版本先于事件判 · 文书四处(README 规则、头注、llms 两档)。
|
|
79
|
+
变异(本车跑过,每刀都红):比较方向反了、PermissionDenied 起始版本改小、Stop 起始版本改小、比较改字符串序、相等边判 `false`、先判事件再判版本、表不冻结、预发布段被接受、事件名改用 `in` 读(原型链名漏进)。
|
|
80
|
+
|
|
81
|
+
**自 v26.0.0 起运行期代码有改动的公开导出(机器重算;上界 —— 可达 ≠ 一定变,不可达 ⇒ 一定不变;本版新增的导出不入表)**
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
(无)
|
|
85
|
+
```
|
|
86
|
+
|
|
11
87
|
## 26.0.0 — 2026-11-10 — major:`PermissionDenied` 的属主改判 engine(`ENGINE_OWNED_HOOK_EVENTS` 十员)· `models[].headers` 的容器必须是对象(与 `extraBody` 同一只判官,`PARSE_TRANSPARENT_KEYS` 少一行)· 一致性门账本加 `kind: "posture"`(消费方姿态,只盖「给得少」)· 语料里的 artifact 摘要按内容铸 · 墓碑表加 `STREAM_APPROVAL_ENABLED`(`removed`:设了即拒启)· 到期删码九条(窗已关的八步一次性迁移 + fleet 平铺引擎状态方言)
|
|
12
88
|
|
|
13
89
|
> 档位(按发版纪律):**major** —— 属主表读数变(`HOOK_EVENT_OWNER.PermissionDenied` 由 `shell` 变 `engine`:按属主分流的消费方同一份配置跑出不同结果)· 校验收紧(`models[].headers` 的非对象容器由受理变拒;部署 env 里留着 `STREAM_APPROVAL_ENABLED` 由起服变拒启)· 类型改形(`KnownDivergence` / `PathDivergence` / `OutcomeDivergence` / `LedgerRow` 按类收窄,读 `LedgerRow.window` 要先判类)· 到期删码(导出删六名、`migrateStoredDocuments` 去掉第二参、迁移 id / 收据词 / 收据文档三只闭集收窄、`SchedulerParseWarning` 少一臂、fleet 两只形少八个平铺字段;窗内没迁的存量旧形由「迁移改写」变为既有的响亮拒 —— 调度店一步例外:旧形逐字读出,见 BREAKING ⑤)。语料两件(c48 金样翻面、artifact 摘要真算)随版。
|
package/README.md
CHANGED
|
@@ -47,6 +47,12 @@ therefore shows only `zod`. Node built-ins only (`node:crypto`, `node:fs`).
|
|
|
47
47
|
> zod 3, nested inside every zod-4 host). The move to zod 4 did not change what any schema accepts or produces —
|
|
48
48
|
> the conformance corpus reads byte-identically on both — only the wording of validation errors (see CHANGELOG 11.0.0).
|
|
49
49
|
|
|
50
|
+
## 升级指引:26.0.x → 26.1.0(minor,加性:引擎属主钩子事件的逐员起始契约版本 `ENGINE_OWNED_HOOK_EVENT_SINCE` + 一只读者 `engineOwnsHookEventAt`)
|
|
51
|
+
|
|
52
|
+
只加导出(包根与 `./hooks` 子路径各三名:值 `ENGINE_OWNED_HOOK_EVENT_SINCE` / `engineOwnsHookEventAt`,型 `EngineOwnedHookEvent`),零校验变化、零读数变化 —— 零动作可升。
|
|
53
|
+
按属主表(`HOOK_EVENT_OWNER` / `ENGINE_OWNED_HOOK_EVENTS`)决定「这只钩子交引擎还是本端跑」的消费方,请把「对端那一半从哪一版契约起也这么认」改读这两个导出(规则一句话与细则见下文「钩子事件按属主分流」一节);
|
|
54
|
+
此前这件事只写在属主表的型注释里,消费方只能各自手写特例表。
|
|
55
|
+
|
|
50
56
|
## 升级指引:25.1.x → 26.0.0(BREAKING:`PermissionDenied` 的属主改判 engine · `models[].headers` 的容器必须是对象 · 一致性门账本加 `kind: "posture"` · 墓碑表加 `STREAM_APPROVAL_ENABLED`)
|
|
51
57
|
|
|
52
58
|
四处**不加性**的边(律、读数逐条、三问、锁步次序与各消费方改法见 CHANGELOG 26.0.0 与 `docs/CONSUMER-INTEGRATION.md` §25):
|
|
@@ -811,7 +817,8 @@ settings 单元读不进的成员**不是缺席**(`loosen` 可丢且要响,`tigh
|
|
|
811
817
|
- **Hooks contract** (`hooks.ts`, subpath `./hooks`): the CC-parity hook surface — `HOOK_EVENTS` (33 events:
|
|
812
818
|
the CC 2.1.198 set of 27 plus `CwdChanged` / `FileChanged` / `MessageDisplay` / `DirectoryAdded` and, from
|
|
813
819
|
2.0.0, the model-switch pair `PreModelSwitch` / `PostModelSwitch`), the single-owner map
|
|
814
|
-
`HOOK_EVENT_OWNER` (engine | shell),
|
|
820
|
+
`HOOK_EVENT_OWNER` (engine | shell) with, from 26.1.0, each engine-owned member's first contract version `ENGINE_OWNED_HOOK_EVENT_SINCE` and its one reader
|
|
821
|
+
`engineOwnsHookEventAt(event, contractVersion)` (the consumption rule is the section 「钩子事件按属主分流」), the matcher-field table, a per-event input schema (`HookInput`),
|
|
815
822
|
the output/decision shapes (`SyncHookOutput` / `HookSpecificOutput` / `HookPermissionRequestDecision`),
|
|
816
823
|
the config surface (defined in `hooks-config.ts`, re-exported by `./hooks`): `HOOK_ENTRY_TYPES` (CC 2.1.296's five: command / prompt / agent / http /
|
|
817
824
|
`mcp_tool`; the field table carries `args` — the exec-form argument list — on `command` entries and `onFailure` — `HOOK_ON_FAILURE_WORDS` = `continue` | `block`, type `HookOnFailure` —
|
|
@@ -987,6 +994,23 @@ user: a client that runs under a different user should create the root itself be
|
|
|
987
994
|
Fleet-only domains (`workers`, `hosts`, `systems`) are omitted on a single machine — they resolve to schema
|
|
988
995
|
defaults. Each `config.d/<domain>.json` is exactly that domain's zod object.
|
|
989
996
|
|
|
997
|
+
## 钩子事件按属主分流:什么时候交引擎(消费规则,26.1.0 起)
|
|
998
|
+
|
|
999
|
+
属主表(`HOOK_EVENT_OWNER` / `ENGINE_OWNED_HOOK_EVENTS`)说「这只事件归哪一半」,不说「对端那一半从哪一版契约起也这么认」。属主表会变(26.0.0 把 `PermissionDenied` 由 `shell` 改判 `engine`),
|
|
1000
|
+
而对端(服务端)提货本包的节奏不归你方定:对着一台还没提那一版的服务端,把这只钩子装进请求体交给它,它不认这只事件归引擎、不注册它 —— 本端以为交出去了 ⇒ **两边都不跑**,wire 上看不出来。
|
|
1001
|
+
|
|
1002
|
+
**规则(一句)**:把一只钩子事件交给引擎 ⟺ 属主表说它是 `engine` ∧ 对端契约版本 ≥ 该员的起始版本,即 `engineOwnsHookEventAt(event, 对端契约版本) === true`;不满足 ⇒ 不交(不进给对端的请求体),按本端的读法处理。
|
|
1003
|
+
|
|
1004
|
+
- **起始版本**住在 `ENGINE_OWNED_HOOK_EVENT_SINCE`:引擎属主十员各一行,完整 `x.y.z`,冻结;键集恰 = `ENGINE_OWNED_HOOK_EVENTS`(加员而没给起始版本、或表里有不在属主集里的键,都是编译红)。
|
|
1005
|
+
`PermissionDenied` = `26.0.0`;其余九员 = `1.0.0`(本包现名的第一个版本,它的属主集里已是这九员 —— 这九员比改名还早,所以 `1.0.0` 是下限、不是引入日期,凡报得出契约版本的对端都不低于它)。
|
|
1006
|
+
值是从各 tag 的 `src/hooks.ts` 读出来的,不是凭注释写的。以后再有成员加进属主集,表里多一行、规则自动适用;消费方**不要**自己维护「哪一员从哪一版起」的特例表。
|
|
1007
|
+
- **对端契约版本**读自服务端 `GET /v1/capabilities` 的 `settingsContract.version`(服务端内嵌的本包版本;自 7.147.0 起的服务端才带这一位,更老的没有)。**缺席或读不出 ⇒ 传你方支持底线**:你方支持的最老一代服务端所内嵌的契约版本 —— 对那一代判,不当 0、也不当最新。
|
|
1008
|
+
底线各家不同,所以缺省由消费方给,读者不收 `undefined`。
|
|
1009
|
+
- **`contractVersion` 只收完整的 `x.y.z`**(十进制、无前导零、无预发布 / 构建段、无 `v` 前缀);其余一律**抛 `TypeError`**(稳定句,以 `engineOwnsHookEventAt: contractVersion must be a complete x.y.z version` 起头,不回显入参),不猜、不当 0。
|
|
1010
|
+
**预发布段的律**:`26.0.0-rc.1` 这类排在它的正式版之前,「是不是已含某员」是个猜,读者不猜 —— 消费方先去掉后缀、或自己定律后再问。版本先于事件判:坏版本不会被读成「不归引擎」。
|
|
1011
|
+
- 事件不在属主集里(壳属主事件,或根本不是钩子事件的名字)⇒ `false`,任何版本都是。
|
|
1012
|
+
- 对当前包版本,`engineOwnsHookEventAt(e, 当前版本)` 恰 = `HOOK_EVENT_OWNER[e] === "engine"`(两处同源,不会各说各的)。
|
|
1013
|
+
|
|
990
1014
|
## 发版纪律(semver,1.x 起)
|
|
991
1015
|
|
|
992
1016
|
自 `1.0.0`(改名)起本包按**标准 semver** 发版;`0.x` 时代的「破坏性变更必 bump minor」规矩**已撤**
|
package/conformance/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
26.
|
|
1
|
+
26.1.0
|
package/dist/hooks.d.ts
CHANGED
|
@@ -85,16 +85,49 @@ export type HookOwner = z.infer<typeof HookOwner>;
|
|
|
85
85
|
/**
|
|
86
86
|
* Events whose TRIGGER lives in the engine half of sema's two-process wire — the owner of an event is the half where the
|
|
87
87
|
* occurrence it names happens:
|
|
88
|
-
* - tool-execution chain: PreToolUse / PostToolUse / PostToolUseFailure / PostToolBatch, and PermissionDenied
|
|
88
|
+
* - tool-execution chain: PreToolUse / PostToolUse / PostToolUseFailure / PostToolBatch, and PermissionDenied — a
|
|
89
89
|
* tool call refused by the engine's tool gate; the refusal is decided in the tool-execution chain, not in a dialog
|
|
90
90
|
* - compaction (runs engine-side): PreCompact / PostCompact
|
|
91
91
|
* - model-turn boundary (run-end is only known to the engine): Stop / StopFailure / UserPromptSubmit
|
|
92
92
|
* Everything else is shell-owned (UI / lifecycle: the permission dialog — PermissionRequest —, sessions, teams, worktrees,
|
|
93
93
|
* files live in the shell). A shell that routes hooks by owner derives its table from this one (no second copy).
|
|
94
|
+
*
|
|
95
|
+
* FROM WHICH CONTRACT VERSION a member counts as engine-owned is data, not prose: {@link ENGINE_OWNED_HOOK_EVENT_SINCE} (one row
|
|
96
|
+
* per member, a compile error when a member has no row), read through {@link engineOwnsHookEventAt} — a peer that embeds an older
|
|
97
|
+
* contract than a member's row does not know the member is engine-owned. A consumer that routes by this set must not keep its own
|
|
98
|
+
* table of "which member joined at which version".
|
|
94
99
|
*/
|
|
95
100
|
export declare const ENGINE_OWNED_HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "PostToolUseFailure", "PostToolBatch", "PreCompact", "PostCompact", "Stop", "StopFailure", "UserPromptSubmit", "PermissionDenied"];
|
|
96
101
|
/** owner per event — single owner; the non-owner side never fires it (dedup rule). */
|
|
97
102
|
export declare const HOOK_EVENT_OWNER: Readonly<Record<HookEventName, HookOwner>>;
|
|
103
|
+
/** One member of {@link ENGINE_OWNED_HOOK_EVENTS} (the events whose trigger lives in the engine half). */
|
|
104
|
+
export type EngineOwnedHookEvent = (typeof ENGINE_OWNED_HOOK_EVENTS)[number];
|
|
105
|
+
/**
|
|
106
|
+
* The first version of THIS package whose {@link ENGINE_OWNED_HOOK_EVENTS} carried each member — the contract version from which a peer that
|
|
107
|
+
* embeds this package treats the event as engine-owned (the server reports its embedded version as `settingsContract.version` on
|
|
108
|
+
* `GET /v1/capabilities`). A complete `x.y.z`.
|
|
109
|
+
*
|
|
110
|
+
* One row per member of {@link ENGINE_OWNED_HOOK_EVENTS}, no more, no fewer: a member added to that set without a row here, or a row for an event
|
|
111
|
+
* that is not in the set, does not compile. Values were read from the release history (each tag's `src/hooks.ts`), not from memory:
|
|
112
|
+
* - `PermissionDenied` — the tool gate's refusal — became engine-owned in 26.0.0 (the release before it owned nine events and listed it as shell-owned);
|
|
113
|
+
* - the other nine are `1.0.0`: the first version under this package's current name already listed them, in this order. They are older than
|
|
114
|
+
* that (the set predates the rename), so `1.0.0` is the floor of what this package's name can report, not an introduction date — every peer that
|
|
115
|
+
* reports a contract version of this package has it.
|
|
116
|
+
*
|
|
117
|
+
* Frozen: every reader in a process shares it. Read it through {@link engineOwnsHookEventAt}; do not compare against it by hand.
|
|
118
|
+
*/
|
|
119
|
+
export declare const ENGINE_OWNED_HOOK_EVENT_SINCE: Readonly<Record<EngineOwnedHookEvent, string>>;
|
|
120
|
+
/**
|
|
121
|
+
* Is `event` engine-owned for a peer whose embedded contract is `contractVersion`? `true` ⟺ `event` is a member of {@link ENGINE_OWNED_HOOK_EVENTS}
|
|
122
|
+
* AND `contractVersion` ≥ its row in {@link ENGINE_OWNED_HOOK_EVENT_SINCE} (numeric, segment by segment). Anything else — a shell-owned event, a
|
|
123
|
+
* name that is not a hook event at all — is `false` at every version.
|
|
124
|
+
*
|
|
125
|
+
* `contractVersion` is a complete `x.y.z` and nothing else; a malformed one THROWS a `TypeError` (checked before the event, so a bad version never reads
|
|
126
|
+
* as "not engine-owned"): a pre-release (`26.0.0-rc.1`) sorts before its release and whether it already carried a member is a guess this function does
|
|
127
|
+
* not make, so the caller strips the suffix (or applies its own rule) before asking. `undefined` is not accepted either: when the peer reports no
|
|
128
|
+
* version, the consumer passes the contract version embedded by the oldest peer generation it supports — that is the generation it must be right about.
|
|
129
|
+
*/
|
|
130
|
+
export declare function engineOwnsHookEventAt(event: string, contractVersion: string): boolean;
|
|
98
131
|
/**
|
|
99
132
|
* Which INPUT FIELD an entry's `matcher` string is matched against, per event (`null` = matchers are
|
|
100
133
|
* ignored for the event; every entry matches). Ported from the shell's getMatchingHooks switch. HOW the matcher is read
|
package/dist/hooks.js
CHANGED
|
@@ -51,12 +51,17 @@ export const HookOwner = z.enum(["engine", "shell"]);
|
|
|
51
51
|
/**
|
|
52
52
|
* Events whose TRIGGER lives in the engine half of sema's two-process wire — the owner of an event is the half where the
|
|
53
53
|
* occurrence it names happens:
|
|
54
|
-
* - tool-execution chain: PreToolUse / PostToolUse / PostToolUseFailure / PostToolBatch, and PermissionDenied
|
|
54
|
+
* - tool-execution chain: PreToolUse / PostToolUse / PostToolUseFailure / PostToolBatch, and PermissionDenied — a
|
|
55
55
|
* tool call refused by the engine's tool gate; the refusal is decided in the tool-execution chain, not in a dialog
|
|
56
56
|
* - compaction (runs engine-side): PreCompact / PostCompact
|
|
57
57
|
* - model-turn boundary (run-end is only known to the engine): Stop / StopFailure / UserPromptSubmit
|
|
58
58
|
* Everything else is shell-owned (UI / lifecycle: the permission dialog — PermissionRequest —, sessions, teams, worktrees,
|
|
59
59
|
* files live in the shell). A shell that routes hooks by owner derives its table from this one (no second copy).
|
|
60
|
+
*
|
|
61
|
+
* FROM WHICH CONTRACT VERSION a member counts as engine-owned is data, not prose: {@link ENGINE_OWNED_HOOK_EVENT_SINCE} (one row
|
|
62
|
+
* per member, a compile error when a member has no row), read through {@link engineOwnsHookEventAt} — a peer that embeds an older
|
|
63
|
+
* contract than a member's row does not know the member is engine-owned. A consumer that routes by this set must not keep its own
|
|
64
|
+
* table of "which member joined at which version".
|
|
60
65
|
*/
|
|
61
66
|
export const ENGINE_OWNED_HOOK_EVENTS = [
|
|
62
67
|
"PreToolUse",
|
|
@@ -72,6 +77,62 @@ export const ENGINE_OWNED_HOOK_EVENTS = [
|
|
|
72
77
|
];
|
|
73
78
|
/** owner per event — single owner; the non-owner side never fires it (dedup rule). */
|
|
74
79
|
export const HOOK_EVENT_OWNER = Object.fromEntries(HOOK_EVENTS.map((e) => [e, ENGINE_OWNED_HOOK_EVENTS.includes(e) ? "engine" : "shell"]));
|
|
80
|
+
/**
|
|
81
|
+
* The first version of THIS package whose {@link ENGINE_OWNED_HOOK_EVENTS} carried each member — the contract version from which a peer that
|
|
82
|
+
* embeds this package treats the event as engine-owned (the server reports its embedded version as `settingsContract.version` on
|
|
83
|
+
* `GET /v1/capabilities`). A complete `x.y.z`.
|
|
84
|
+
*
|
|
85
|
+
* One row per member of {@link ENGINE_OWNED_HOOK_EVENTS}, no more, no fewer: a member added to that set without a row here, or a row for an event
|
|
86
|
+
* that is not in the set, does not compile. Values were read from the release history (each tag's `src/hooks.ts`), not from memory:
|
|
87
|
+
* - `PermissionDenied` — the tool gate's refusal — became engine-owned in 26.0.0 (the release before it owned nine events and listed it as shell-owned);
|
|
88
|
+
* - the other nine are `1.0.0`: the first version under this package's current name already listed them, in this order. They are older than
|
|
89
|
+
* that (the set predates the rename), so `1.0.0` is the floor of what this package's name can report, not an introduction date — every peer that
|
|
90
|
+
* reports a contract version of this package has it.
|
|
91
|
+
*
|
|
92
|
+
* Frozen: every reader in a process shares it. Read it through {@link engineOwnsHookEventAt}; do not compare against it by hand.
|
|
93
|
+
*/
|
|
94
|
+
export const ENGINE_OWNED_HOOK_EVENT_SINCE = Object.freeze({
|
|
95
|
+
PreToolUse: "1.0.0",
|
|
96
|
+
PostToolUse: "1.0.0",
|
|
97
|
+
PostToolUseFailure: "1.0.0",
|
|
98
|
+
PostToolBatch: "1.0.0",
|
|
99
|
+
PreCompact: "1.0.0",
|
|
100
|
+
PostCompact: "1.0.0",
|
|
101
|
+
Stop: "1.0.0",
|
|
102
|
+
StopFailure: "1.0.0",
|
|
103
|
+
UserPromptSubmit: "1.0.0",
|
|
104
|
+
PermissionDenied: "26.0.0",
|
|
105
|
+
});
|
|
106
|
+
/** A complete `x.y.z`: three decimal numbers, no leading zeros (so numeric order is digit-count order, then digits), no pre-release / build part, no prefix. */
|
|
107
|
+
const CONTRACT_VERSION = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
|
|
108
|
+
function readContractVersion(value) {
|
|
109
|
+
const m = typeof value === "string" ? CONTRACT_VERSION.exec(value) : null;
|
|
110
|
+
if (m === null) {
|
|
111
|
+
throw new TypeError("engineOwnsHookEventAt: contractVersion must be a complete x.y.z version string (decimal digits, no leading zeros, no pre-release or build part, no `v` prefix) — " +
|
|
112
|
+
"the peer's reported contract version, or the one embedded by the oldest peer generation the consumer supports when the peer reports none");
|
|
113
|
+
}
|
|
114
|
+
return [BigInt(m[1]), BigInt(m[2]), BigInt(m[3])];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Is `event` engine-owned for a peer whose embedded contract is `contractVersion`? `true` ⟺ `event` is a member of {@link ENGINE_OWNED_HOOK_EVENTS}
|
|
118
|
+
* AND `contractVersion` ≥ its row in {@link ENGINE_OWNED_HOOK_EVENT_SINCE} (numeric, segment by segment). Anything else — a shell-owned event, a
|
|
119
|
+
* name that is not a hook event at all — is `false` at every version.
|
|
120
|
+
*
|
|
121
|
+
* `contractVersion` is a complete `x.y.z` and nothing else; a malformed one THROWS a `TypeError` (checked before the event, so a bad version never reads
|
|
122
|
+
* as "not engine-owned"): a pre-release (`26.0.0-rc.1`) sorts before its release and whether it already carried a member is a guess this function does
|
|
123
|
+
* not make, so the caller strips the suffix (or applies its own rule) before asking. `undefined` is not accepted either: when the peer reports no
|
|
124
|
+
* version, the consumer passes the contract version embedded by the oldest peer generation it supports — that is the generation it must be right about.
|
|
125
|
+
*/
|
|
126
|
+
export function engineOwnsHookEventAt(event, contractVersion) {
|
|
127
|
+
const peer = readContractVersion(contractVersion);
|
|
128
|
+
if (!ENGINE_OWNED_HOOK_EVENTS.includes(event))
|
|
129
|
+
return false;
|
|
130
|
+
const since = readContractVersion(ENGINE_OWNED_HOOK_EVENT_SINCE[event]);
|
|
131
|
+
for (let i = 0; i < 3; i++)
|
|
132
|
+
if (peer[i] !== since[i])
|
|
133
|
+
return peer[i] > since[i];
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
75
136
|
/**
|
|
76
137
|
* Which INPUT FIELD an entry's `matcher` string is matched against, per event (`null` = matchers are
|
|
77
138
|
* ignored for the event; every entry matches). Ported from the shell's getMatchingHooks switch. HOW the matcher is read
|
package/docs/API-SURFACE.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
> 每次全量重算并逐名比对 —— 加 / 删 / 改形一个导出而不重生成本档 ⇒ 红。导出面的每次变动因此以本档的 diff 出现在评审里。
|
|
5
5
|
> 形:`value` = 运行期拿得到的值;`type` = 只在类型层;`value+type` = 同名的值与类型(zod schema 与它推出的类型)。
|
|
6
6
|
|
|
7
|
-
子路径 24 条(资产出口 `./package.json` / `./fleet-paths.json` 不是模块,不列),导出名合计
|
|
7
|
+
子路径 24 条(资产出口 `./package.json` / `./fleet-paths.json` 不是模块,不列),导出名合计 1522 个(同名在多条子路径上各计一次)。
|
|
8
8
|
|
|
9
|
-
## `.`(
|
|
9
|
+
## `.`(798)
|
|
10
10
|
|
|
11
11
|
- `A2aConfig` — value+type
|
|
12
12
|
- `A2aPeerSpec` — value+type
|
|
@@ -143,6 +143,7 @@
|
|
|
143
143
|
- `DroppedEntryIdentity` — type
|
|
144
144
|
- `DroppedEntryReasonCode` — type
|
|
145
145
|
- `ENGINE_OWNED_HOOK_EVENTS` — value
|
|
146
|
+
- `ENGINE_OWNED_HOOK_EVENT_SINCE` — value
|
|
146
147
|
- `ENGINE_SIGNAL_KEY` — value
|
|
147
148
|
- `ENV_MODELS_DECISIONS` — value
|
|
148
149
|
- `ENV_MODELS_DOCUMENT` — value
|
|
@@ -159,6 +160,7 @@
|
|
|
159
160
|
- `ElicitationHookInput` — value
|
|
160
161
|
- `ElicitationResultHookInput` — value
|
|
161
162
|
- `EngineDraining` — value+type
|
|
163
|
+
- `EngineOwnedHookEvent` — type
|
|
162
164
|
- `EngineSignal` — value+type
|
|
163
165
|
- `EntitlementBudget` — value+type
|
|
164
166
|
- `EntitlementConfig` — value+type
|
|
@@ -653,6 +655,7 @@
|
|
|
653
655
|
- `effectiveScopeRole` — value
|
|
654
656
|
- `emptyEffective` — value
|
|
655
657
|
- `enabledEntryCount` — value
|
|
658
|
+
- `engineOwnsHookEventAt` — value
|
|
656
659
|
- `envModelTableDeclared` — value
|
|
657
660
|
- `envModelTableWriteRefusal` — value
|
|
658
661
|
- `envModelsDecisionTag` — value
|
|
@@ -1300,7 +1303,7 @@
|
|
|
1300
1303
|
- `parseSchedulerStore` — value
|
|
1301
1304
|
- `serializeSchedulerStore` — value
|
|
1302
1305
|
|
|
1303
|
-
## `./hooks`(
|
|
1306
|
+
## `./hooks`(103)
|
|
1304
1307
|
|
|
1305
1308
|
- `AgentHookEntry` — value+type
|
|
1306
1309
|
- `AssistantTurnError` — value+type
|
|
@@ -1316,8 +1319,10 @@
|
|
|
1316
1319
|
- `DIRECTORY_ADDED_SOURCES` — value
|
|
1317
1320
|
- `DirectoryAddedHookInput` — value+type
|
|
1318
1321
|
- `ENGINE_OWNED_HOOK_EVENTS` — value
|
|
1322
|
+
- `ENGINE_OWNED_HOOK_EVENT_SINCE` — value
|
|
1319
1323
|
- `ElicitationHookInput` — value
|
|
1320
1324
|
- `ElicitationResultHookInput` — value
|
|
1325
|
+
- `EngineOwnedHookEvent` — type
|
|
1321
1326
|
- `FileChangedHookInput` — value
|
|
1322
1327
|
- `HOOKS_CLASSIFICATION_OUTCOMES` — value
|
|
1323
1328
|
- `HOOKS_DROPPED_PIECE_CODES` — value
|
|
@@ -1398,6 +1403,7 @@
|
|
|
1398
1403
|
- `WorktreeCreateHookInput` — value
|
|
1399
1404
|
- `WorktreeRemoveHookInput` — value
|
|
1400
1405
|
- `classifyHooksConfig` — value
|
|
1406
|
+
- `engineOwnsHookEventAt` — value
|
|
1401
1407
|
- `hookMatcherForm` — value
|
|
1402
1408
|
- `hookMatcherSelects` — value
|
|
1403
1409
|
- `interpolateHookEnvVars` — value
|
package/llms-full.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
llms-full.txt — 自包含全文 · 消费方(使用者)视角 · @sema-agent/settings-schema
|
|
3
|
-
重写日期: 2026-11-
|
|
3
|
+
重写日期: 2026-11-11 | 包版本: 26.1.0
|
|
4
4
|
生成方式: 无生成脚本——按当前树 src/*.ts 导出面 + package.json + README/CHANGELOG 手写事实版。
|
|
5
5
|
证据约定: 每条"它怎么工作"的断言附 (文件: 符号) 坐标,刻意不用行号(行号逐版腐烂;符号名由
|
|
6
6
|
typecheck 与 test/package-surface.test.ts、test/docs-hygiene.test.ts 等常驻门钉住)。无证据推断显式标【推断】。
|
|
@@ -349,6 +349,8 @@ entitlement/execution/limits = `none`;`projects` = `salvage`,整域档位仍 `"t
|
|
|
349
349
|
- 事件全集 `HOOK_EVENTS`(33 个 hook 事件 = CC 2.1.198 的 27 + post-198 的 CwdChanged/FileChanged/
|
|
350
350
|
MessageDisplay/DirectoryAdded/PreModelSwitch/PostModelSwitch);owner 表 `HOOK_EVENT_OWNER`(engine|shell,单属主;26.0.0 起 `ENGINE_OWNED_HOOK_EVENTS` 十员 = 工具执行链五员〔含 `PermissionDenied`:引擎工具门的拒〕+ 压缩两员 + 轮界三员)、`ENGINE_OWNED_HOOK_EVENTS`、
|
|
351
351
|
matcher 语义表 `HOOK_EVENT_MATCHER_FIELD`(null = 无 matcher 轴)。
|
|
352
|
+
- 按属主分流的消费规则(26.1.0 起):`ENGINE_OWNED_HOOK_EVENT_SINCE`(`Readonly<Record<EngineOwnedHookEvent, string>>`,冻结;引擎属主十员各自的起始契约版本 = 那一员第一次出现在属主集里的包版本(按包现名的版本线记),`PermissionDenied` = `26.0.0`,其余九员 = `1.0.0`(九员比改名还早:`1.0.0` 是包现名的第一个版本,下限而非引入日期);键集恰 = `ENGINE_OWNED_HOOK_EVENTS`,加员漏填 / 表里多键 ⇒ 编译红)+ 唯一读者 `engineOwnsHookEventAt(event, contractVersion): boolean`:
|
|
353
|
+
交引擎 ⟺ 事件在属主集里 ∧ 对端契约版本 ≥ 该员起始版本(数值逐段比;对端版本读自服务端 `GET /v1/capabilities` 的 `settingsContract.version`,缺席 ⇒ 传你方支持底线);`contractVersion` 只收完整 `x.y.z`(无前导零 / 预发布 / 构建段 / `v` 前缀),其余含 `undefined` 抛 `TypeError`(预发布段读者不猜);壳属主事件与非钩子事件名恒 `false`。(src/hooks.ts: `ENGINE_OWNED_HOOK_EVENT_SINCE` / `engineOwnsHookEventAt` / 型 `EngineOwnedHookEvent`)
|
|
352
354
|
- 逐事件输入形 `*HookInput`(union `HookInput`);输出:`SyncHookOutput`(exit 0 JSON;exit 2 = 阻断,stderr
|
|
353
355
|
作为理由/附加上下文喂回模型;其余 exit/超时/spawn 失败/坏 JSON = 非阻断故障〔缺省 `onFailure: "continue"`;command / http 条目写 `onFailure: "block"`(19.0.0 起的契约字段)则这些失败按 exit 2 算,执行是消费方的事〕,消费方 hook-runner 铸
|
|
354
356
|
`hook_non_blocking_failure` 通知帧上任务/fleet 流,stderr 先脱敏后截断 512 字)、`AsyncHookOutput`、
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
3
|
-
重写日期: 2026-11-
|
|
3
|
+
重写日期: 2026-11-11 | 包版本: 26.1.0
|
|
4
4
|
生成方式: 无生成脚本——按当前树的 src/*.ts 导出面 + package.json + README/CHANGELOG 手写事实版;
|
|
5
5
|
每条断言附证据坐标(文件:符号),刻意不用行号(行号随每版腐烂,符号名由 typecheck/test 钉住)。
|
|
6
6
|
刷新触发: package.json 版号变更(test/docs-hygiene.test.ts D 组钉「包版本:」与 package.json 相等、
|
|
@@ -103,7 +103,7 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
103
103
|
- **hooks 契约**:33 个 hook 事件的全集 + owner 表 + 逐事件输入/输出形 + 配置面:hook 条目五种 type(`HOOK_ENTRY_TYPES`,含 `mcp_tool`;19.0.0 起 command 条目承运 `args`〔exec 形参数表〕、command / http 条目承运 `onFailure`〔`HOOK_ON_FAILURE_WORDS` = continue|block,型 `HookOnFailure`;承运不是执行〕;20.0.0 起另承运 `rewakeMessage` / `rewakeSummary`〔command,非空串〕、`cloud`〔command / http,任意值照带:CC 把词表外的任何值读作 skip,折在读者;`HOOK_CLOUD_WORDS` = device|skip,型 `HookCloud` 是折法参考〕、`continueOnBlock`〔prompt,布尔〕——CC 条目 schema 上的每个键都在字段表里,其余三个键的坏值是坏块)与**一只**
|
|
104
104
|
坏形分类器 `classifyHooksConfig(settingsDoc)`(非守卫事件坏块逐个剔、守卫事件 PreToolUse / PermissionRequest 任何坏处或守卫迹象 ⇒ 整份拒;码 + 坐标 + 坏字段名 `field`(坏块是匹配器 / 条目 ⇒ 它上面出问题的键,块不是对象才缺席;一块多个迹象时先该块自身的迹象(自有守卫事件键;条目自己是匹配器形取 `hooks`),再按文档序找嵌套迹象;匹配器下合形条目列表里的迹象归各条目)、零句子、零 zod 自含;
|
|
105
105
|
闭包里 JS 内建之外只有一个自由名 `HOOK_EVENTS` —— 整函数抄走的生成器(client-core)须把本包运行期导出 `HOOK_EVENTS`(上游常量)注入抄本作用域,不许贴字面事件表),
|
|
106
|
-
`HooksConfig` / `HookEntry` 等 zod 面是它的投影;事件与 type 两张闭集与上游的漂移由常驻门看住(上游有而本包没有的词 ⇒ 门红并点名)。http 钩子 header 里 `$VAR` / `${VAR}` 的展开也只有一只读法(名单内展开、名单外与凭据名置空并回报)。(src/hooks.ts: `HOOK_EVENTS` / `interpolateHookEnvVars`)
|
|
106
|
+
`HooksConfig` / `HookEntry` 等 zod 面是它的投影;事件与 type 两张闭集与上游的漂移由常驻门看住(上游有而本包没有的词 ⇒ 门红并点名)。http 钩子 header 里 `$VAR` / `${VAR}` 的展开也只有一只读法(名单内展开、名单外与凭据名置空并回报)。按属主分流的消费方(26.1.0 起):逐员起始契约版本 `ENGINE_OWNED_HOOK_EVENT_SINCE`(引擎属主十员各一行,键集恰 = `ENGINE_OWNED_HOOK_EVENTS`;`PermissionDenied` = 26.0.0,其余九员 = 1.0.0)+ 唯一读者 `engineOwnsHookEventAt(event, contractVersion)`(交引擎 ⟺ 事件在属主集里 ∧ 对端契约版本〔服务端 `/v1/capabilities` 的 `settingsContract.version`;缺席 ⇒ 传你方支持底线〕≥ 该员起始版本;只收完整 `x.y.z`,坏串含预发布段抛 `TypeError`)。(src/hooks.ts: `HOOK_EVENTS` / `interpolateHookEnvVars` / `ENGINE_OWNED_HOOK_EVENT_SINCE` / `engineOwnsHookEventAt`)
|
|
107
107
|
- **hook 条目字段表**(20.0.0 起运行期导出):`HOOK_ENTRY_FIELDS`(每型 → 字段名 → 取值类,`?` 结尾 = 选填;深冻结,包根与 `./hooks` 同一只)与型 `HookEntryFields`;分类器读的是闭包私有的投影,与导出表以型标注咬合、判法随字段表。(src/hooks-config.ts: `HOOK_ENTRY_FIELDS`)
|
|
108
108
|
- **跨会话两键**(1.6.0 新增,`settings.json` 面;6.0.0 词表随 core 7.30.0 改):`crossSessionInbound`(wake/next-turn/hold/refuse + `default`=未设;`accept` 已退役,文件层响亮拒)
|
|
109
109
|
与 `dialogExpiry`(60s/5m/10m/never,缺省 5m);另出两只层读取器,坏值 `ok:false` 不静默折缺省。
|
|
@@ -159,6 +159,7 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
159
159
|
`isReadyForTraffic` / `isRoutable` 是它们的布尔形;没有信号(旧引擎)= `no-engine-signal`,不可路由;平铺方言(`/health` 的布尔对 + 心跳上与信号同名的平铺键)26.0.0 删,还带它们的体照收、判官不读;
|
|
160
160
|
8.3.0 additive:env 名常量 `FLEET_SCOPE_ENV`(`"FLEET_SCOPE"`,成员所属租户 scope,渲染器写、引擎读;缺席 = 默认 scope `GLOBAL_SCOPE`;进保留 env 名表);
|
|
161
161
|
14.7.0 additive:公告地址 env 名常量 `FLEET_ADVERTISE_ADDRESS_ENV`(`"FLEET_ADVERTISE_ADDRESS"`)+「后面要拼路径的基址」座位的禁用成分集 `PATH_BASE_URL_FORBIDDEN_PARTS`(`userinfo` / `query` / `fragment`)+ 判官 `pathBaseUrlFlaws(url)`(= `httpUrlFlaws` 配这一集;判展开之后的值;`webAdminSessionUrl` 也读它);
|
|
162
|
+
26.1.0 additive:引擎属主钩子事件的逐员起始契约版本 `ENGINE_OWNED_HOOK_EVENT_SINCE`(`Readonly<Record<EngineOwnedHookEvent, string>>`,冻结;`PermissionDenied` = 26.0.0,其余九员 = 1.0.0;键集恰 = `ENGINE_OWNED_HOOK_EVENTS`,加员漏填 ⇒ 编译红)+ 唯一读者 `engineOwnsHookEventAt(event, contractVersion): boolean`(交引擎 ⟺ 属主表说 engine ∧ 对端契约版本 ≥ 该员起始版本;坏版本串抛 `TypeError`)+ 型 `EngineOwnedHookEvent`;包根与 `./hooks` 各三名,零校验变化;
|
|
162
163
|
26.0.0 BREAKING:`ENGINE_OWNED_HOOK_EVENTS` 十员(尾插 `PermissionDenied`,`HOOK_EVENT_OWNER.PermissionDenied` = engine:一次工具调用被引擎的工具门拒,发生在工具执行链里;
|
|
163
164
|
按属主分流的消费方锁步改 —— 服务端补站对位,客户端核心重生成属主表与终端客户端座位改组同一个客户端发版;本包的配置校验不读属主表)·
|
|
164
165
|
`models[].headers` 容器必须是对象(同上)· 一致性门账本一行 = 坐标 × 类:`debt`(票号 + 窗 + 翻转条件)/ `posture`(消费方姿态:票号,不挂窗;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/settings-schema",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.1.0",
|
|
4
4
|
"description": "Sema settings schema — pure config contract (zod domains + effective-config + roster resolution + ref-integrity + remoteExec) shared by sema-web-admin, sema-server, and the TOC desktop/CLI. One source of truth. (Renamed at 1.0.0 from @sema-agent/registry-core — name and docs only, no behavior change; note the range moves 0.19.0 -> 1.0.0, so a dependency must become ^1.0.0. The old names @sema-agent/registry-core <=0.19.0 and @sema-ai/registry-core remain published, frozen, for migration.)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BUSL-1.1",
|