@sema-agent/settings-schema 28.0.0 → 30.0.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 +431 -0
- package/README.md +94 -14
- package/conformance/VERSION +1 -1
- package/conformance/cases/c01-entry-salvage-then-typo/expected.json +2 -2
- package/conformance/cases/c02-hosts-clamp-stacked/expected.json +1 -1
- package/conformance/cases/c03-literal-dotted-top-key/expected.json +1 -1
- package/conformance/cases/c04-all-bad-collection-not-salvaged/expected.json +1 -1
- package/conformance/cases/c07-hooks-is-not-a-config-domain/expected.json +1 -1
- package/conformance/cases/c08-limits-unknown-carried-64/expected.json +1 -1
- package/conformance/cases/c09-limits-unknown-carried-65/expected.json +1 -1
- package/conformance/cases/c10-record-key-secret-redacted-twice/expected.json +1 -1
- package/conformance/cases/c11-unicode-unknown-keys/expected.json +1 -1
- package/conformance/cases/c12-prototype-name-top-keys/expected.json +1 -1
- package/conformance/cases/c13-models-field-null/expected.json +1 -1
- package/conformance/cases/c14-models-field-empty-array/expected.json +1 -1
- package/conformance/cases/c15-models-field-number/expected.json +1 -1
- package/conformance/cases/c18-wire-envelope-not-an-object/expected.json +1 -1
- package/conformance/cases/c19-wire-envelope-no-version/expected.json +1 -1
- package/conformance/cases/c21-governance-empty-object-wins/expected.json +1 -1
- package/conformance/cases/c23-mixed-validity-models/expected.json +1 -1
- package/conformance/cases/c24-valid-entries-with-unknown-keys/expected.json +1 -1
- package/conformance/cases/c25-published-roundtrip-zero-warnings/expected.json +1 -1
- package/conformance/cases/c26-hosts-array-1024/expected.json +1 -1
- package/conformance/cases/c27-hosts-array-1025/expected.json +1 -1
- package/conformance/cases/c28-large-document-over-1mb/expected.json +1 -1
- package/conformance/cases/c29-salvage-then-domain-refine-fails/expected.json +1 -1
- package/conformance/cases/c30-version-triple-a-first/expected.json +1 -1
- package/conformance/cases/c31-version-triple-b-changed/expected.json +1 -1
- package/conformance/cases/c32-version-triple-a-restored/expected.json +1 -1
- package/conformance/cases/c33-limits-nested-carried-key/expected.json +1 -1
- package/conformance/cases/c34-skills-content-vs-manifest/expected.json +1 -1
- package/conformance/cases/c36-skills-entry-without-content/expected.json +1 -1
- package/conformance/cases/c38-remote-exec-is-a-non-domain-file/expected.json +1 -1
- package/conformance/cases/c39-hidden-file-in-config-d/expected.json +1 -1
- package/conformance/cases/c40-s712-identity-only-what-reads-out/expected.json +1 -1
- package/conformance/cases/c41-s792-encoded-pem-identity/expected.json +1 -1
- package/conformance/cases/c42-s792-unknown-key-secret-redacted/expected.json +1 -1
- package/conformance/cases/c43-s792-form-and-deep-encoded-pem/expected.json +1 -1
- package/conformance/cases/c44-s792-utf8-escape-glued-token/expected.json +1 -1
- package/conformance/cases/c45-s792-identity-bounds-and-decode-depth/expected.json +1 -1
- package/conformance/cases/c46-s811-host-name-url-userinfo-withheld/expected.json +1 -1
- package/conformance/cases/c47-s811-roles-key-url-userinfo-withheld/expected.json +1 -1
- package/conformance/cases/c48-s935-model-headers-transported/expected.json +1 -1
- package/conformance/cases/c49-s935-model-headers-secret-entry-dropped/expected.json +1 -1
- package/conformance/cases/c50-s784-lane-host-legal/expected.json +1 -1
- package/conformance/cases/c51-s784-lane-e2b-legal/expected.json +1 -1
- package/conformance/cases/c52-s784-lane-k8s-legal/expected.json +1 -1
- package/conformance/cases/c53-s784-lane-ssh-legal/expected.json +1 -1
- package/conformance/cases/c54-s784-lane-adb-legal/expected.json +1 -1
- package/conformance/cases/c55-s784-lane-local-docker-legal/expected.json +1 -1
- package/conformance/cases/c56-s784-lane-device-legal/expected.json +1 -1
- package/conformance/cases/c57-s784-g1-enabled-no-lane/expected.json +3 -3
- package/conformance/cases/c58-s784-g2-multitenant-host/expected.json +3 -3
- package/conformance/cases/c59-s784-g3-k8s-missing-image/expected.json +3 -3
- package/conformance/cases/c60-s784-g3-e2b-missing-key/expected.json +3 -3
- package/conformance/cases/c61-s784-g3-other-lane-key/expected.json +3 -3
- package/conformance/cases/c62-s784-g7a-session-tidb/expected.json +3 -3
- package/conformance/cases/c63-s784-host-two-replicas/expected.json +3 -3
- package/conformance/cases/c64-s784-multitenant-local-store/expected.json +3 -3
- package/conformance/cases/c65-s784-pg-without-db/expected.json +3 -3
- package/conformance/cases/c66-s784-memory-backend-mismatch/expected.json +3 -3
- package/conformance/cases/c67-s784-retired-field-loud/expected.json +3 -3
- package/conformance/cases/c68-s784-device-local-store/expected.json +3 -3
- package/conformance/cases/c69-deep-encoded-token-past-every-reading/expected.json +1 -1
- package/conformance/cases/c70-rewritten-token-in-front-of-encoded-pem-header/expected.json +1 -1
- package/conformance/cases/c71-one-scanner-write-reads-display-forms/expected.json +1 -1
- package/conformance/cases/c72-dangling-reference-write-seat-refuses/expected.json +1 -1
- package/conformance/cases/c73-projects-extended-registration-reads/expected.json +1 -1
- package/conformance/cases/c74-projects-over-bound-refused/expected.json +3 -72
- package/conformance/cases/c75-projects-patch-remote-uniqueness/expected.json +3 -72
- package/conformance/cases/c76-projects-entry-salvage-nested/expected.json +2 -2
- package/conformance/cases/c77-prompts-center-artifact-carried/expected.json +1 -1
- package/conformance/cases/c78-prompts-empty-bindings-refused/expected.json +2 -2
- package/conformance/cases/c78-prompts-empty-bindings-refused/meta.json +1 -1
- package/conformance/cases/c79-prompts-bad-worker-artifact-not-salvaged/expected.json +1 -1
- package/conformance/cases/c80-prompts-wire-v2-verbatim/expected.json +1 -1
- package/conformance/cases/c81-prompts-declaration-bindings-refused/expected.json +2 -2
- package/conformance/cases/c82-prompts-v1-catalog-refused/expected.json +2 -2
- package/conformance/cases/c83-prompts-bad-overlay-not-salvaged/expected.json +1 -1
- package/conformance/cases/c84-sandbox-git-block-carried-verbatim/expected.json +1 -1
- package/conformance/cases/c85-sandbox-git-refused-block-still-carried/expected.json +1 -1
- package/conformance/cases/c86-a2a-peers-legal/expected.json +1 -1
- package/conformance/cases/c87-a2a-credential-refs-not-partially-salvaged/expected.json +1 -1
- package/conformance/cases/c88-projects-content-attestation-carried/expected.json +1 -1
- package/conformance/cases/c89-projects-content-attestation-malformed/expected.json +1 -1
- package/conformance/cases/c90-mcp-assertion-credential-carried/expected.json +143 -0
- package/conformance/cases/c90-mcp-assertion-credential-carried/input.json +30 -0
- package/conformance/cases/c90-mcp-assertion-credential-carried/meta.json +6 -0
- package/conformance/cases/c91-mcp-assertion-header-retired-entry-dropped/expected.json +105 -0
- package/conformance/cases/c91-mcp-assertion-header-retired-entry-dropped/input.json +27 -0
- package/conformance/cases/c91-mcp-assertion-header-retired-entry-dropped/meta.json +6 -0
- package/conformance/cases/c92-mcp-principal-header-with-assertion-dropped/expected.json +105 -0
- package/conformance/cases/c92-mcp-principal-header-with-assertion-dropped/input.json +31 -0
- package/conformance/cases/c92-mcp-principal-header-with-assertion-dropped/meta.json +6 -0
- package/conformance/cases/c93-mcp-header-refs-with-credentials-dropped/expected.json +105 -0
- package/conformance/cases/c93-mcp-header-refs-with-credentials-dropped/input.json +33 -0
- package/conformance/cases/c93-mcp-header-refs-with-credentials-dropped/meta.json +6 -0
- package/conformance/cases/c94-mcp-credentials-env-kind-dropped/expected.json +105 -0
- package/conformance/cases/c94-mcp-credentials-env-kind-dropped/input.json +32 -0
- package/conformance/cases/c94-mcp-credentials-env-kind-dropped/meta.json +6 -0
- package/conformance/cases/c95-mcp-credentials-audience-not-connector-id-dropped/expected.json +105 -0
- package/conformance/cases/c95-mcp-credentials-audience-not-connector-id-dropped/input.json +30 -0
- package/conformance/cases/c95-mcp-credentials-audience-not-connector-id-dropped/meta.json +6 -0
- package/conformance/cases/c96-mcp-credentials-extra-member-dropped/expected.json +105 -0
- package/conformance/cases/c96-mcp-credentials-extra-member-dropped/input.json +31 -0
- package/conformance/cases/c96-mcp-credentials-extra-member-dropped/meta.json +6 -0
- package/conformance/cases/cc01-mcp-toolfaces-non-object/expected.json +1 -1
- package/conformance/cases/cc02-mcp-source-key-is-transported/expected.json +1 -1
- package/conformance/cases/cc03-model-compat-unknown-subkey/expected.json +1 -1
- package/conformance/cases/cli01-model-name-nfc-vs-nfd/expected.json +1 -1
- package/conformance/cases/cli02-control-and-zero-width-chars/expected.json +1 -1
- package/conformance/cases/cli03-credential-pasted-into-unknown-key/expected.json +1 -1
- package/conformance/cases/cli04-env-value-with-newline/expected.json +1 -1
- package/conformance/cases/cli04-env-value-with-newline/meta.json +1 -1
- package/conformance/cases/cli05-long-and-prefix-colliding-names/expected.json +1 -1
- package/conformance/cases/t01-absent-domain-key-not-null/expected.json +1 -1
- package/conformance/cases/t01-absent-domain-key-not-null/meta.json +1 -1
- package/conformance/cases/t03-prototype-name-key-not-swallowed/expected.json +1 -1
- package/conformance/cases/t04-secret-literal-never-in-warning-value/expected.json +1 -1
- package/conformance/cases/t04-secret-literal-never-in-warning-value/meta.json +1 -1
- package/conformance/cases/z01-every-domain-empty-object/expected.json +1 -1
- package/conformance/cases/z01-every-domain-empty-object/meta.json +1 -1
- package/conformance/cases/z02-every-domain-unknown-key/expected.json +1 -1
- package/dist/api/credentials.js +5 -7
- package/dist/api/lifecycle-events.d.ts +266 -0
- package/dist/api/lifecycle-events.js +169 -0
- package/dist/api/wire-scalars.d.ts +13 -0
- package/dist/api/wire-scalars.js +15 -0
- package/dist/atomic-write.d.ts +4 -0
- package/dist/atomic-write.js +26 -3
- package/dist/config-d-file.d.ts +1 -1
- package/dist/config-document-refusal.d.ts +4 -4
- package/dist/config-fns.d.ts +4 -2
- package/dist/config-fns.js +1 -1
- package/dist/config-root-documents.d.ts +1 -1
- package/dist/config-root-node.js +2 -1
- package/dist/conformance/corpus.d.ts +1 -1
- package/dist/conformance/derive.d.ts +13 -5
- package/dist/conformance/derive.js +37 -21
- package/dist/conformance/index.d.ts +1 -1
- package/dist/conformance/index.js +1 -1
- package/dist/conformance/run.js +8 -9
- package/dist/connector-authorize-url.d.ts +23 -0
- package/dist/connector-authorize-url.js +129 -0
- package/dist/connector-id.d.ts +23 -0
- package/dist/connector-id.js +27 -0
- package/dist/file-edit.d.ts +44 -0
- package/dist/file-edit.js +70 -1
- package/dist/file-store.d.ts +12 -7
- package/dist/file-store.js +72 -59
- package/dist/hooks.d.ts +15 -5
- package/dist/hooks.js +13 -3
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -1
- package/dist/mcp-entry-credential.d.ts +47 -0
- package/dist/mcp-entry-credential.js +73 -0
- package/dist/mcp-request-entry.d.ts +32 -13
- package/dist/mcp-request-entry.js +104 -58
- package/dist/migration-receipt.d.ts +2 -2
- package/dist/migration-receipt.js +2 -2
- package/dist/one-time-migrations.d.ts +1 -1
- package/dist/one-time-migrations.js +68 -91
- package/dist/portable-domains.d.ts +18 -12
- package/dist/portable-domains.js +17 -12
- package/dist/retired-role-words.d.ts +1 -1
- package/dist/retired-role-words.js +4 -6
- package/dist/scheduler-store-node.d.ts +5 -2
- package/dist/scheduler-store-node.js +8 -5
- package/dist/sha256.d.ts +5 -0
- package/dist/sha256.js +7 -0
- package/dist/skills-manifest.js +2 -2
- package/dist/types.d.ts +80 -10
- package/dist/types.js +37 -44
- package/docs/API-SURFACE.md +47 -7
- package/docs/CONFORMANCE.md +6 -4
- package/docs/CONSUMER-INTEGRATION.md +147 -4
- package/llms-full.txt +45 -24
- package/llms.txt +27 -14
- package/package.json +3 -2
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
3
|
-
重写日期: 2026-11-
|
|
3
|
+
重写日期: 2026-11-17 | 包版本: 30.0.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 相等、
|
|
@@ -9,8 +9,8 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
9
9
|
|
|
10
10
|
# @sema-agent/settings-schema
|
|
11
11
|
|
|
12
|
-
> 一个**纯配置契约 + resolver + 本地 loader** 的 npm 包(公网 npmjs,ESM only,Node >=20.
|
|
13
|
-
>
|
|
12
|
+
> 一个**纯配置契约 + resolver + 本地 loader** 的 npm 包(公网 npmjs,ESM only,Node >=20.18.1,运行时
|
|
13
|
+
> 依赖恰两只:zod ^4.4.0 与引擎的零依赖原语包 `@sema-agent/primitives`)。它是 sema 栈配置域的**单一真值**:17 个配置域的 zod schema、`EffectiveConfig` 确定性合并、
|
|
14
14
|
> per-worker roster 解析、跨域引用完整性、`remoteExec` 执行层契约、本地 `config.d/*.json` 读写,外加 hooks /
|
|
15
15
|
> fleet / scheduler-store / safety-merge-spec / auth·scopes wire 五族纯契约。被 web-admin 产品(舰队管理台)、
|
|
16
16
|
> worker 服务、TOC 桌面/CLI 共同消费。**纯被消费**——无服务、永不携带 secret 值;唯一的 bin 是一次性迁移族的目录形
|
|
@@ -65,14 +65,19 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
65
65
|
`supportsReasoningEffort`;真需求 = vLLM/Qwen 类缺省开思考的网关要 `chat_template_kwargs.enable_thinking=false`,
|
|
66
66
|
而 `extraBody` 穿不过引擎保留键表)、`mcp.servers[].source`(1.7.0,声明方自述的分组标签,开集,只做显示
|
|
67
67
|
分组不进信任轴)、`mcp.servers[].toolFaces`(1.9.0,按远端工具名 key 的 face 覆盖层,形归引擎摄入侧)、
|
|
68
|
-
`mcp.servers[].toolAxes`
|
|
68
|
+
`mcp.servers[].toolAxes`(12.2.0,连接器条目的声明键,本包只承载;形判官 = 引擎 `readMcpToolAxes` 一只;同批的 `authForm` / `entryKind` 在 29.0.0 删除)、`mcp.servers[].sessionMetaKey`(14.8.0,引擎往这台服务器请求 `_meta` 里放会话 id 的那把键;唯一判官 = 引擎根导出 `judgeSessionMetaKey`,本包只承载)、`mcp.servers[].startupTimeoutMs`(14.8.0,这一台服务器自己的启动界;唯一判官 = 引擎根导出 `mcpStartupTimeoutMs`,本包只承载)、
|
|
69
69
|
`entitlement.subjects[].overrides[].value`。`compat`/`headers`/`extraBody` 仍走同一只自由形安全判据(secret 形/
|
|
70
70
|
访问器/循环/非 JSON/过深 ⇒ 拒 —— 那是安全边界,不是形校验)。`models.models[].headers`(6.4.0 起的 per-model 附加请求头,
|
|
71
71
|
例 `{"anthropic-beta":"context-1m-2025-08-07"}`):26.0.0 起容器必须是纯 JSON 对象(与 `extraBody` 同一只判官;串 / 数组 / null ⇒ 条目拒,
|
|
72
72
|
读腿上那一条目 `entry-dropped`);头名闭集白名单 × 读它的线路 × 值形的判据仍归 server,本包不复述那张表。(src/types.ts: `PARSE_TRANSPARENT_KEYS` / `ModelEntry`)
|
|
73
|
-
- **`mcp.servers[].transport.
|
|
74
|
-
`
|
|
75
|
-
`
|
|
73
|
+
- **`mcp.servers[].transport.credentials`**(29.0.0 新增,http 形可选):托管连接器条目的凭据引用 `{ kind: "assertion", audience: <连接器 id> }`(`McpEntryCredential`);
|
|
74
|
+
读法只经引擎原语包 `readCredentialRef` 一次(交回冻结副本),准入种类闭集 `MCP_ENTRY_CREDENTIAL_KINDS` 只有 `assertion`,`audience` 必须是连接器 id
|
|
75
|
+
(`ConnectorId` / `isConnectorId`:DNS label、≤ 63、按字节比)。**`audience` 就是连接器 id,原样作断言的受众;托管连接器以同一个 id 启动。**
|
|
76
|
+
**消费方硬义务(铸断言的一方)**:条目的 `url` 与断言的 `audience` 在本包里**不绑定**(本包只判两者各自的形,不提供带登记绑定的判官);铸之前必须核 `url` 属于部署登记册里这台连接器的端点,
|
|
77
|
+
核不上 ⇒ 不铸、响亮拒。不核 ⇒ 能写这份配置的一方可以让任一连接器的断言发往任意地址。
|
|
78
|
+
两条互斥:`principalHeader` ⊥ 断言引用,`headerRefs` ⊥ `credentials`。断言的头名归引擎(`MCP_ASSERTION_HEADER`)。
|
|
79
|
+
12.2.0 的 `transport.assertionHeader` 在 29.0.0 退役:墓碑(任何值拒,拒句点名新位与一次性迁移 SS-M13);视图面带它的条目整条丢,零幸存者 ⇒ `mcp` 退缺省。
|
|
80
|
+
授权地址:`connectorAuthorizeUrlOf` / `connectorAuthorizeUrlFlaws`(九个瑕疵词)。(src/mcp-entry-credential.ts、src/connector-id.ts、src/connector-authorize-url.ts)
|
|
76
81
|
- **`mcp.servers[].contentOrigin`**(1.4.0 新增):MCP 工具产出的信任出处声明,闭词表
|
|
77
82
|
`MCP_CONTENT_ORIGINS = ["local","execution","external"]`(表外值 parse 拒,不做大小写折叠);缺席 = 引擎
|
|
78
83
|
预声明行为。与 `source` 分轴:信任走它,显示分组走 `source`。(src/types.ts: `MCP_CONTENT_ORIGINS`)
|
|
@@ -85,8 +90,8 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
85
90
|
- 把全局 config + worker 名**解析成该 worker 的 wire 载荷**(`resolveEffectiveForWorker`:models 按 roster
|
|
86
91
|
收窄、skills 转 manifest、rosters/entitlement 剥离)。(src/resolve-roster.ts)
|
|
87
92
|
- 从本地 `config.d/*.json` + `.env` **一把加载**(`loadLocalConfig(root)`,worker 服务与 CLI 共用零漂移);
|
|
88
|
-
单域坏文件可**容错**(`FileConfigStore.getEffective({tolerant:true})`)。(src/local-load.ts;src/file-store.ts)
|
|
89
|
-
**单读口**(16.0.0):`FileConfigStore.read()`(`./node`)一次读完整个目录,交 effective + 告警,或文件层的类型化拒单 + 版本;每条拒 `{ document, reason, error }`,`reason` ∈ 包根的闭集词 `CONFIG_DOCUMENT_REFUSAL_REASONS`(empty / invalid_json / not_object / io / too_deep / retired_domain;26.0.0 起墓碑拒不再另带 `migration`);次序确定(retired
|
|
93
|
+
单域坏文件可**容错**(`FileConfigStore.getEffective({tolerant:true})`)。读的域集是 `LOCAL_READ_DOMAINS`(29.0.0:便携域集 + `projects`;`workers` / `hosts` / `systems` / `entitlement` 不读、文件被 `unread-config-file` 点名)。(src/local-load.ts;src/file-store.ts;src/portable-domains.ts)
|
|
94
|
+
**单读口**(16.0.0):`FileConfigStore.read()`(`./node`)一次读完整个目录,交 effective + 告警,或文件层的类型化拒单 + 版本;每条拒 `{ document, reason, error }`,`reason` ∈ 包根的闭集词 `CONFIG_DOCUMENT_REFUSAL_REASONS`(empty / invalid_json / not_object / io / too_deep / retired_domain;26.0.0 起墓碑拒不再另带 `migration`);次序确定(retired 域在前,本地读取域按 `LOCAL_READ_DOMAINS`),严读(`readBundle` / `getEffective`)照旧抛同一句。29.0.0 起一棵根一个内容版本:`getVersion()` 与 `read()` 读同一份文件层快照(文件层被拒的树也答同一个数,此前抛;判形不进版本);同一 major 同内容同数,读取集或算法变 = major;版本输入不含 `.env`;`contentDigest` 是写方令牌,不是在服身份。(src/file-store.ts;src/config-d-file.ts;src/config-document-refusal.ts)
|
|
90
95
|
- **secret 边界**:密钥字段一律 env-NAME(`ENV_NAME` 正则强制,拒 secret 形状字面量),浏览器端封箱的
|
|
91
96
|
sealed-box 形(`SealedApiKey`);`collectEnvRefs` 列出全部引用。自由文本写口(`extraBody` / `compat` / `headers` / URL / mcp 参数 / 插件源 / ssh 登录 /
|
|
92
97
|
worker env / 车道坐标 / 覆盖值)经同一只 `containsSecretToken` 拒 secret 形状;10.0.0 起私钥 PEM 头在串中**任意位置**都拒(此前只认串首;读原文 + 前三层百分号解码),
|
|
@@ -104,7 +109,7 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
104
109
|
- **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 上的每个键都在字段表里,其余三个键的坏值是坏块)与**一只**
|
|
105
110
|
坏形分类器 `classifyHooksConfig(settingsDoc)`(非守卫事件坏块逐个剔、守卫事件 PreToolUse / PermissionRequest 任何坏处或守卫迹象 ⇒ 整份拒;码 + 坐标 + 坏字段名 `field`(坏块是匹配器 / 条目 ⇒ 它上面出问题的键,块不是对象才缺席;一块多个迹象时先该块自身的迹象(自有守卫事件键;条目自己是匹配器形取 `hooks`),再按文档序找嵌套迹象;匹配器下合形条目列表里的迹象归各条目)、零句子、零 zod 自含;
|
|
106
111
|
闭包里 JS 内建之外只有一个自由名 `HOOK_EVENTS` —— 整函数抄走的生成器(client-core)须把本包运行期导出 `HOOK_EVENTS`(上游常量)注入抄本作用域,不许贴字面事件表),
|
|
107
|
-
`HooksConfig` / `HookEntry` 等 zod 面是它的投影;事件与 type 两张闭集与上游的漂移由常驻门看住(上游有而本包没有的词 ⇒ 门红并点名)。http 钩子 header 里 `$VAR` / `${VAR}` 的展开也只有一只读法(
|
|
112
|
+
`HooksConfig` / `HookEntry` 等 zod 面是它的投影;事件与 type 两张闭集与上游的漂移由常驻门看住(上游有而本包没有的词 ⇒ 门红并点名)。http 钩子 header 里 `$VAR` / `${VAR}` 的展开也只有一只读法(名单内展开、名单外与凭据名置空;每一处因为没有放行的值而成空串的引用都回报,原因闭集 `HOOK_ENV_BLANK_REASONS` = not-allowed / credential / unset)。按属主分流的消费方(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`)
|
|
108
113
|
- **hook 条目字段表**(20.0.0 起运行期导出):`HOOK_ENTRY_FIELDS`(每型 → 字段名 → 取值类,`?` 结尾 = 选填;深冻结,包根与 `./hooks` 同一只)与型 `HookEntryFields`;分类器读的是闭包私有的投影,与导出表以型标注咬合、判法随字段表。(src/hooks-config.ts: `HOOK_ENTRY_FIELDS`)
|
|
109
114
|
- **跨会话两键**(1.6.0 新增,`settings.json` 面;6.0.0 词表随 core 7.30.0 改):`crossSessionInbound`(wake/next-turn/hold/refuse + `default`=未设;`accept` 已退役,文件层响亮拒)
|
|
110
115
|
与 `dialogExpiry`(60s/5m/10m/never,缺省 5m);另出两只层读取器,坏值 `ok:false` 不静默折缺省。
|
|
@@ -131,8 +136,9 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
131
136
|
判按展开后目标、回显只按展开前写法(stdio 只给可执行名 + 参数个数);托管层 = 源表档 `managed` 的源(层只带源名);只收紧的源只贡献拒绝名单(允许名单是拼接 = 放宽,不读)。(src/mcp-server-policy.ts)
|
|
132
137
|
- **请求面 MCP 条目判官**(14.0.0,`src/mcp-request-entry.ts`):`isUsableWireName` / `describeBadWireName`(引擎线上名长界 `TOOL_WIRE_NAME_MAX_CHARS` 的镜像;首尾空白 = 坏名,不 trim 不规范化,内部空白合法)·
|
|
133
138
|
`isUsableMcpServerName` / `describeBadMcpServerName`(MCP 服务器名 = 线上名判官再加一臂:`remote-` 前缀 `REMOTE_MCP_SERVER_NAME_PREFIX` 保留给设备执行端提供的远程 MCP 服务器,配置面 `McpServerSpec.name` 不拒(拒是校验收紧,归 major);A2A 对端名仍用 `isUsableWireName`)·
|
|
134
|
-
`isContentOriginWord` / `describeBadContentOrigin`(回显剥控制与双向字符、截 64 字、引号形)· `
|
|
135
|
-
`env` / `headers` 只收纯数据的「名 → 串」记录,`Map` / 类实例 / 自有 `__proto__` 成员不收、交副本,`lost` 条目带 `member` / `fault`
|
|
139
|
+
`isContentOriginWord` / `describeBadContentOrigin`(回显剥控制与双向字符、截 64 字、引号形)· `readRequestMcpTransport`(硬坏形 `ok:false` 点名键路径;29.0.0 起点名拒的 `assertionHeader` / `credentials` 带 `issue.refusal`(`MCP_REQUEST_KEY_REFUSALS`:`key_retired` / `credentials_not_carried`),与表外未知键分得开;软坏形读器丢键并记进 `lost`;
|
|
140
|
+
`env` / `headers` 只收纯数据的「名 → 串」记录,`Map` / 类实例 / 自有 `__proto__` 成员不收、交副本,`lost` 条目带 `member` / `fault` 机读位;
|
|
141
|
+
这两键的读法 = 公开的带坐标读口 `readRequestStringRecord(path, raw)` → `{ record, issues }`,29.0.0 起导出,消费方读自己的「名 → 串」记录同调它)
|
|
136
142
|
+ 值种类描述件 —— 服务端请求腿与壳的发送前预检同读一份(判据与原因句逐字同)。`toolFaces` 声明在本包解析透明,形归引擎摄入侧判,本包不镜像工具面词表。
|
|
137
143
|
- **中心引用解析口**(`src/center-refs.ts`):`resolveCenterRefs(refs, lookup)` —— `refs` = 名册里 `envRefs` / `headerRefs`(目标键 → 变量名;`undefined` = 没声明),`lookup(name) => string | undefined` 由调用方给(必给;没给 ⇒ `TypeError`,本包不读 `process.env`)。
|
|
138
144
|
每成员一句判定 `resolved` / `missing_name` / `not_a_string` / `read_threw`(`CENTER_REF_FAULTS`),整台 `resolved` / `unresolved` / `refs_unreadable`(`CENTER_REFS_VERDICTS`);值只在 `resolved` 臂的 `values`,`unresolved` 臂的行只有词;只判不决定挂不挂。
|
|
@@ -141,7 +147,7 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
141
147
|
`stripControlAndBidi(text)` · `hasControlOrBidi(text)`;外来串落成一行(拒句 / 告警 / 日志 / 屏上)前剥的唯一一份,C1 与 U+2028 / U+2029 不在集里;
|
|
142
148
|
是本包的回显策略(不是引擎双向码点表的镜像),请求面描述器与消费方都读它,禁自存字符类。
|
|
143
149
|
- **prompts 域单轴**(14.0.0):只装中心 artifact(存储 `PromptsConfig = { artifact?, workers? }` / 下发 `EffectivePromptsWire = { schemaVersion: 2, artifact }` /
|
|
144
|
-
唯一选择读法 `promptArtifactFor`);本包镜像 artifact v3 的结构与上界,语义交引擎 verify;13.x
|
|
150
|
+
唯一选择读法 `promptArtifactFor`);本包镜像 artifact v3 的结构与上界,语义交引擎 verify;13.x 两轴是墓碑,存量旧键写面拒、读面整域缺省并点名、没有迁移替它改写(SS-M10 窗关删码;出路:删键,或从中心编辑器重新发布)。
|
|
145
151
|
- **界面语言设置片段**(13.0.0):`UI_LANGUAGE_SETTING`(`semaUiLanguage`,`en` / `zh`,类 `ui`,用户设置)+ `readUiLanguage`(词表外 `ok:false`,不猜)。
|
|
146
152
|
(src/ui-language.ts)
|
|
147
153
|
- **fleet 契约**(drain / 实例发现 / 派发策略 / 配额租约 / 用量上报;6.1.0 起重启信号 `RestartSignal` 定义一次,
|
|
@@ -160,6 +166,7 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
160
166
|
`isReadyForTraffic` / `isRoutable` 是它们的布尔形;没有信号(旧引擎)= `no-engine-signal`,不可路由;平铺方言(`/health` 的布尔对 + 心跳上与信号同名的平铺键)26.0.0 删,还带它们的体照收、判官不读;
|
|
161
167
|
8.3.0 additive:env 名常量 `FLEET_SCOPE_ENV`(`"FLEET_SCOPE"`,成员所属租户 scope,渲染器写、引擎读;缺席 = 默认 scope `GLOBAL_SCOPE`;进保留 env 名表);
|
|
162
168
|
14.7.0 additive:公告地址 env 名常量 `FLEET_ADVERTISE_ADDRESS_ENV`(`"FLEET_ADVERTISE_ADDRESS"`)+「后面要拼路径的基址」座位的禁用成分集 `PATH_BASE_URL_FORBIDDEN_PARTS`(`userinfo` / `query` / `fragment`)+ 判官 `pathBaseUrlFlaws(url)`(= `httpUrlFlaws` 配这一集;判展开之后的值;`webAdminSessionUrl` 也读它);
|
|
169
|
+
29.0.0 BREAKING:本地读取域集 `LOCAL_READ_DOMAINS`(`./node`,深冻结;= 便携域集原序 + `projects`;答「`FileConfigStore` / `loadLocalConfig` 读 `config.d/` 里哪些域」,便携域集 `PORTABLE_DOMAINS` 只答「哪些域随 bundle 搬运」,两个问题两只常量)+ 型 `LocalReadDomain` + 带条件的域文件写器 `writeDomainFileIf(root, domain, value, expected)`(`./node`:`expected` = 读到时文件原文的摘要或 `null`,锁文件之下重读、相符才写;结果 `ConditionalWriteResult` 三态 `written` / `stale` / `locked`)+ 内容摘要唯一铸点 `contentDigest(文本 | 字节)`(包根与 `./sha256`;文本按 UTF-8 编码后取摘要)+ `./conformance` 的 `NON_LOCAL_READ_DOMAINS`(T3 改名 `T3-non-local-read-domains`;删 `NON_PORTABLE_DOMAINS`,包内没有读者了)—— 到期删码:一次性迁移 SS-M8(退役角色词,窗 2026-11-11 已关;`ONE_TIME_MIGRATION_IDS` 删 SS-M8,连同本版尾插的 SS-M13 是 SS-M10 / SS-M11 / SS-M12 / SS-M13,存量里还带 `roles.team` / `roles.synthesize` 的文档:写面整域拒、读面丢弃 / 缺省并点名〔告警经 `onWarning` / `read().warnings` 出声〕,迁移与 `migrate` 不再改写)—— 读数变化四处:盘上已有的 `config.d/projects.json` 自此被读(读不进的自此拒)· 内容版本对同一组文件换一次数 · 拒单文档名联合 `ConfigDocumentName` 多 `"projects"`(穷举的读者编译红一次)· 语料本地腿金样随改;便携域集与 bundle 一字不动;同批两件:钩子环境置空原因闭集 `HOOK_ENV_BLANK_REASONS` 加 `unset`(闭集增长,头字节不变)· `FileConfigStore.getVersion()` 与 `read()` 同一个版本(文件层被拒的树由抛变答数);
|
|
163
170
|
28.0.0 BREAKING:包的每个闭集导出(词表数组 / 行表 / 常量表 / Set)在定义处深冻结 —— 对它们的原地写(`push` / `sort` / `length = 0` / 下标或属性赋值 / `delete` / `Set.add` / `Set.delete` / `Set.clear`)由静默成功变抛 `TypeError`(数组方法与集合方法任何模式、赋值与删键在严格模式),读法的答案逐位不变;十五个导出 / 类型的声明收窄成只读(`DOMAINS` → `readonly DomainName[]`,`DELIVER_DENYLIST` / `RESERVED_WORKER_ENV` → `ReadonlySet<string>`,`ROLE_RANK` 等五张表与两只 node IO 对象 → `Readonly<…>`,`ParseTransparentKey` / `DerivationTransform` 的字段、`SAFETY_MERGE_SPEC` 的两张 `order` 元组、`TightenRule` / `MergeCategorySpec` 的字段与数组 → 只读;逐名见 CHANGELOG 28.0.0)—— 不加不删导出名;冻结助手包内私有、不在任何出口;`Set` 的守卫拦的是经它自己的方法发生的写(有意调原型方法仍能绕过);要改闭集的代码先拷贝再改;
|
|
164
171
|
27.2.0 additive:条目拒因码闭集 `MODEL_ENTRY_REFUSAL_CODES` 尾插一只泛词 `config.model_route_refused`(服务端把一条目录条目算作可服务之前交引擎的线路判官做了静态判决〔条目的端点 × 它带不带凭据〕、引擎拒了:这一条不服务,其余照常;判的是引擎,本包与服务端都不判,拒的细节是引擎自己的码;与 `config.model_no_brain`〔没有能服务它的腿〕/ `config.model_entry_invalid`〔条目自己的形不对〕有分界,与组拒码里同词干的 `config.model_route_endpoint_missing` 不同集)—— 不加不删导出名,零校验变化;`readModelRefusals` 对 `entries` 值是新词的那一条由「丢掉」变读出;持穷举表的消费方提货编译红一次;
|
|
165
172
|
27.1.0 additive:模型面组拒码闭集 `MODEL_PLANE_REFUSAL_CODES` 尾插一只泛词 `config.model_catalog_refused`(服务端采纳候选目录之前交引擎的目录门过了一遍、引擎拒了:目录级;判的是引擎,本包与服务端都不判,拒的细节是引擎自己的码与句;与座位级的 `config.default_model_missing` 有分界)—— 不加不删导出名,零校验变化;`readModelRefusals` 对 `plane` 是新词的体由「没说」变读出;持穷举表的消费方提货编译红一次;
|
|
@@ -190,7 +197,13 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
190
197
|
- **按 scope 绑定的令牌**(`./api/pull-token`):形与铸法一条规则、令牌族是数据(`WORKER_PULL_TOKEN` = `wpt_` / `wpt2_` / `worker-pull`);
|
|
191
198
|
`mintScopedToken` / `readScopedTokenBinding` / `verifyScopedToken`(重铸 + 常量时间比对;纯 JS HMAC-SHA256)。
|
|
192
199
|
- **`PRINCIPAL_MAX_LENGTH`**(= 190,`./api/auth-bridge`)· **/bug 报告**(`./api/feedback`:`FeedbackSubmitRequest` / `FeedbackWire` / 两个上限)·
|
|
193
|
-
**`Sha256Digest`**(`sha256:<64 位小写 hex>`
|
|
200
|
+
**`Sha256Digest`**(`sha256:<64 位小写 hex>` 一处定义;29.0.0 起铸点 `contentDigest(content)` 一处)。
|
|
201
|
+
- **用户生命周期事件 wire**(包根,不开子路径;29.0.0,加性;src/api/lifecycle-events.ts):管理面把「主体被删 / 被降级 / 被移出空间」发成带序号的事件,执行面按页拉取、按 `seq` 去重、启动与游标失效时对账。
|
|
202
|
+
`PRINCIPAL_LIFECYCLE_EVENT_KINDS` / 型 `PrincipalLifecycleEventKind`(五词闭集:`principal.deleted` / `principal.pending` / `principal.role_lowered` / `membership.removed` / `membership.role_lowered`)·
|
|
203
|
+
`PrincipalLifecycleEvent`(按 `kind` 判别:三只 `principal.*` 臂不带 `scope`,两只 `membership.*` 臂**必带** `scope`;共有 `eventId` / `seq ≥ 1` / `principal` / `principalInc?` / `at`;未知**键**剥掉,未知 `kind` **值**整页拒并点名下标与该词)·
|
|
204
|
+
`PrincipalLifecycleEventPage` = `{ events, head, next }` ·
|
|
205
|
+
`LIFECYCLE_PAGE_REFUSALS`(四词 → 状态码与永久性一张表:`cursor_invalid` / `limit_invalid` 400,`cursor_expired` / `cursor_unknown` 410,四个都是 `terminal`)+ `LIFECYCLE_PAGE_REFUSAL_ERRORS` / 型 `LifecyclePageRefusalError` + `LifecyclePageRefusal`(`{ error, permanence, message }`,410 的体再带 `head`)·
|
|
206
|
+
`PrincipalReconcileRequest`(`{ principals: [{ principal, principalInc? }] }`,1 – `PRINCIPAL_RECONCILE_MAX_ITEMS` = 500 项)/ `PrincipalReconcileAnswer`(每项 `PrincipalStanding`,按 `standing` 判别 `live` / `gone`,`since` 只在 `live` 臂、可缺席)· `PrincipalReconcileItem`。
|
|
194
207
|
- **退役 env 名墓碑表**:`RETIRED_ENVS`(renamed / replaced / removed 三族闭集,永久,一跳)+ 拒启句唯一铸点 `retiredEnvRefusal(env)`
|
|
195
208
|
+ 目录投影 `buildRetiredEnvWire()`。(src/retired-envs.ts)
|
|
196
209
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/settings-schema",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "30.0.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",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"CHANGELOG.md"
|
|
133
133
|
],
|
|
134
134
|
"engines": {
|
|
135
|
-
"node": ">=20.
|
|
135
|
+
"node": ">=20.18.1"
|
|
136
136
|
},
|
|
137
137
|
"scripts": {
|
|
138
138
|
"build": "rm -rf dist && tsc -p tsconfig.build.json && node scripts/gen-fleet-paths.mjs",
|
|
@@ -155,6 +155,7 @@
|
|
|
155
155
|
"vitest": "^2.1.0"
|
|
156
156
|
},
|
|
157
157
|
"dependencies": {
|
|
158
|
+
"@sema-agent/primitives": "^7.67.3",
|
|
158
159
|
"zod": "^4.4.0"
|
|
159
160
|
},
|
|
160
161
|
"peerDependencies": {
|