@sema-agent/settings-schema 17.2.0 → 19.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 +216 -0
- package/README.md +53 -6
- package/conformance/VERSION +1 -1
- package/conformance/baseline.json +3 -0
- package/conformance/cases/c01-entry-salvage-then-typo/expected.json +4 -1
- package/conformance/cases/c02-hosts-clamp-stacked/expected.json +4 -1
- package/conformance/cases/c03-literal-dotted-top-key/expected.json +4 -1
- package/conformance/cases/c04-all-bad-collection-not-salvaged/expected.json +4 -1
- package/conformance/cases/c07-hooks-is-not-a-config-domain/expected.json +4 -1
- package/conformance/cases/c08-limits-unknown-carried-64/expected.json +4 -1
- package/conformance/cases/c09-limits-unknown-carried-65/expected.json +4 -1
- package/conformance/cases/c10-record-key-secret-redacted-twice/expected.json +4 -1
- package/conformance/cases/c11-unicode-unknown-keys/expected.json +4 -1
- package/conformance/cases/c12-prototype-name-top-keys/expected.json +4 -1
- package/conformance/cases/c13-models-field-null/expected.json +4 -1
- package/conformance/cases/c14-models-field-empty-array/expected.json +4 -1
- package/conformance/cases/c15-models-field-number/expected.json +4 -1
- package/conformance/cases/c16-deep-nesting-205/expected.json +3 -0
- package/conformance/cases/c17-empty-domain-file/expected.json +3 -0
- package/conformance/cases/c18-wire-envelope-not-an-object/expected.json +4 -1
- package/conformance/cases/c19-wire-envelope-no-version/expected.json +4 -1
- package/conformance/cases/c21-governance-empty-object-wins/expected.json +4 -1
- package/conformance/cases/c23-mixed-validity-models/expected.json +4 -1
- package/conformance/cases/c24-valid-entries-with-unknown-keys/expected.json +4 -1
- package/conformance/cases/c25-published-roundtrip-zero-warnings/expected.json +4 -1
- package/conformance/cases/c26-hosts-array-1024/expected.json +4 -1
- package/conformance/cases/c27-hosts-array-1025/expected.json +4 -1
- package/conformance/cases/c28-large-document-over-1mb/expected.json +4 -1
- package/conformance/cases/c29-salvage-then-domain-refine-fails/expected.json +4 -1
- package/conformance/cases/c30-version-triple-a-first/expected.json +4 -1
- package/conformance/cases/c31-version-triple-b-changed/expected.json +4 -1
- package/conformance/cases/c32-version-triple-a-restored/expected.json +4 -1
- package/conformance/cases/c33-limits-nested-carried-key/expected.json +4 -1
- package/conformance/cases/c34-skills-content-vs-manifest/expected.json +7 -1
- package/conformance/cases/c35-portable-domain-file-is-null/expected.json +3 -0
- package/conformance/cases/c36-skills-entry-without-content/expected.json +7 -1
- package/conformance/cases/c37-skills-field-null/expected.json +6 -0
- package/conformance/cases/c38-remote-exec-is-a-non-domain-file/expected.json +4 -1
- package/conformance/cases/c39-hidden-file-in-config-d/expected.json +4 -1
- package/conformance/cases/c40-s712-identity-only-what-reads-out/expected.json +4 -1
- package/conformance/cases/c41-s792-encoded-pem-identity/expected.json +4 -1
- package/conformance/cases/c42-s792-unknown-key-secret-redacted/expected.json +4 -1
- package/conformance/cases/c43-s792-form-and-deep-encoded-pem/expected.json +4 -1
- package/conformance/cases/c44-s792-utf8-escape-glued-token/expected.json +4 -1
- package/conformance/cases/c45-s792-identity-bounds-and-decode-depth/expected.json +4 -1
- package/conformance/cases/c46-s811-host-name-url-userinfo-withheld/expected.json +4 -1
- package/conformance/cases/c47-s811-roles-key-url-userinfo-withheld/expected.json +4 -1
- package/conformance/cases/c48-s935-model-headers-transported/expected.json +4 -1
- package/conformance/cases/c49-s935-model-headers-secret-entry-dropped/expected.json +4 -1
- package/conformance/cases/c50-s784-lane-host-legal/expected.json +4 -1
- package/conformance/cases/c51-s784-lane-e2b-legal/expected.json +4 -1
- package/conformance/cases/c52-s784-lane-k8s-legal/expected.json +4 -1
- package/conformance/cases/c53-s784-lane-ssh-legal/expected.json +4 -1
- package/conformance/cases/c54-s784-lane-adb-legal/expected.json +4 -1
- package/conformance/cases/c55-s784-lane-local-docker-legal/expected.json +4 -1
- package/conformance/cases/c56-s784-lane-device-legal/expected.json +4 -1
- package/conformance/cases/c57-s784-g1-enabled-no-lane/expected.json +4 -1
- package/conformance/cases/c58-s784-g2-multitenant-host/expected.json +4 -1
- package/conformance/cases/c59-s784-g3-k8s-missing-image/expected.json +4 -1
- package/conformance/cases/c60-s784-g3-e2b-missing-key/expected.json +4 -1
- package/conformance/cases/c61-s784-g3-other-lane-key/expected.json +4 -1
- package/conformance/cases/c62-s784-g7a-session-tidb/expected.json +4 -1
- package/conformance/cases/c63-s784-host-two-replicas/expected.json +4 -1
- package/conformance/cases/c64-s784-multitenant-local-store/expected.json +4 -1
- package/conformance/cases/c65-s784-pg-without-db/expected.json +4 -1
- package/conformance/cases/c66-s784-memory-backend-mismatch/expected.json +4 -1
- package/conformance/cases/c67-s784-retired-field-loud/expected.json +4 -1
- package/conformance/cases/c68-s784-device-local-store/expected.json +4 -1
- package/conformance/cases/c69-deep-encoded-token-past-every-reading/expected.json +4 -1
- package/conformance/cases/c70-rewritten-token-in-front-of-encoded-pem-header/expected.json +4 -1
- package/conformance/cases/c71-one-scanner-write-reads-display-forms/expected.json +4 -1
- package/conformance/cases/c72-dangling-reference-write-seat-refuses/expected.json +4 -1
- package/conformance/cases/c73-projects-extended-registration-reads/expected.json +4 -1
- package/conformance/cases/c74-projects-over-bound-refused/expected.json +4 -1
- package/conformance/cases/c75-projects-patch-remote-uniqueness/expected.json +4 -1
- package/conformance/cases/c76-projects-entry-salvage-nested/expected.json +4 -1
- package/conformance/cases/c77-prompts-center-artifact-carried/expected.json +4 -1
- package/conformance/cases/c78-prompts-empty-bindings-refused/expected.json +4 -1
- package/conformance/cases/c79-prompts-bad-worker-artifact-not-salvaged/expected.json +4 -1
- package/conformance/cases/c80-prompts-wire-v2-verbatim/expected.json +7 -1
- package/conformance/cases/c81-prompts-declaration-bindings-refused/expected.json +4 -1
- package/conformance/cases/c82-prompts-v1-catalog-refused/expected.json +4 -1
- package/conformance/cases/c83-prompts-bad-overlay-not-salvaged/expected.json +4 -1
- package/conformance/cases/c84-sandbox-git-block-carried-verbatim/expected.json +7 -1
- package/conformance/cases/c85-sandbox-git-refused-block-still-carried/expected.json +7 -1
- package/conformance/cases/c86-a2a-peers-legal/expected.json +135 -0
- package/conformance/cases/c86-a2a-peers-legal/input.json +32 -0
- package/conformance/cases/c86-a2a-peers-legal/meta.json +5 -0
- package/conformance/cases/c87-a2a-credential-refs-not-partially-salvaged/expected.json +123 -0
- package/conformance/cases/c87-a2a-credential-refs-not-partially-salvaged/input.json +39 -0
- package/conformance/cases/c87-a2a-credential-refs-not-partially-salvaged/meta.json +5 -0
- package/conformance/cases/cc01-mcp-toolfaces-non-object/expected.json +4 -1
- package/conformance/cases/cc02-mcp-source-key-is-transported/expected.json +4 -1
- package/conformance/cases/cc03-model-compat-unknown-subkey/expected.json +4 -1
- package/conformance/cases/cli01-model-name-nfc-vs-nfd/expected.json +4 -1
- package/conformance/cases/cli02-control-and-zero-width-chars/expected.json +4 -1
- package/conformance/cases/cli03-credential-pasted-into-unknown-key/expected.json +4 -1
- package/conformance/cases/cli04-env-value-with-newline/expected.json +4 -1
- package/conformance/cases/cli05-long-and-prefix-colliding-names/expected.json +4 -1
- package/conformance/cases/t01-absent-domain-key-not-null/expected.json +4 -1
- package/conformance/cases/t03-prototype-name-key-not-swallowed/expected.json +4 -1
- package/conformance/cases/t04-secret-literal-never-in-warning-value/expected.json +4 -1
- package/conformance/cases/z01-every-domain-empty-object/expected.json +4 -1
- package/conformance/cases/z02-every-domain-unknown-key/expected.json +4 -1
- package/dist/center-refs.d.ts +4 -3
- package/dist/center-refs.js +8 -6
- package/dist/cli.d.ts +1 -1
- package/dist/config-fns.d.ts +6 -1
- package/dist/config-fns.js +16 -2
- package/dist/execution-lanes.d.ts +158 -11
- package/dist/execution-lanes.js +76 -11
- package/dist/file-edit.d.ts +1 -1
- package/dist/file-edit.js +2 -1
- package/dist/hooks-config.d.ts +23 -5
- package/dist/hooks-config.js +33 -5
- package/dist/hooks.d.ts +6 -4
- package/dist/hooks.js +3 -1
- package/dist/mcp-request-entry.d.ts +11 -21
- package/dist/mcp-request-entry.js +21 -38
- package/dist/one-time-migrations.js +1 -1
- package/dist/portable-domains.d.ts +1 -1
- package/dist/portable-domains.js +1 -1
- package/dist/remote-exec.d.ts +5 -0
- package/dist/remote-exec.js +5 -0
- package/dist/reserved-member-name.d.ts +13 -0
- package/dist/reserved-member-name.js +14 -0
- package/dist/retired-envs.js +2 -0
- package/dist/secret-refs.d.ts +1 -1
- package/dist/secret-refs.js +5 -1
- package/dist/types.d.ts +70 -41
- package/dist/types.js +179 -32
- package/dist/url-credential.d.ts +12 -2
- package/dist/url-credential.js +164 -9
- package/dist/wire-name.d.ts +19 -0
- package/dist/wire-name.js +21 -0
- package/docs/API-SURFACE.md +27 -6
- package/docs/CC-DIVERGENCE.md +2 -2
- package/docs/CONSUMER-INTEGRATION.md +72 -7
- package/llms-full.txt +38 -18
- package/llms.txt +10 -10
- package/package.json +1 -1
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-03 | 包版本: 19.0.0
|
|
4
4
|
生成方式: 无生成脚本——按当前树 src/*.ts 导出面 + package.json + README/CHANGELOG 手写事实版。
|
|
5
5
|
证据约定: 每条"它怎么工作"的断言附 (文件: 符号) 坐标,刻意不用行号(行号逐版腐烂;符号名由
|
|
6
6
|
typecheck 与 test/package-surface.test.ts、test/docs-hygiene.test.ts 等常驻门钉住)。无证据推断显式标【推断】。
|
|
@@ -89,8 +89,8 @@ registry:公网 npmjs,无需私有 registry 配置。
|
|
|
89
89
|
以下均为真实导出(主 barrel `.`、`./node` 或细分 subpath;见 §6)。签名/字段名核实自源码导出面。
|
|
90
90
|
|
|
91
91
|
--- 4.1 域 schema 与类型(src/types.ts,主 barrel / `./types`) ---
|
|
92
|
-
- `DOMAIN_SCHEMAS`:
|
|
93
|
-
collab, workers, hosts, governance, entitlement, execution, projects, prompts, limits }`。`runtime` 域 11.0.0 起 retired:
|
|
92
|
+
- `DOMAIN_SCHEMAS`:17 个配置域 → zod 对象:`{ models, rosters, skills, mcp, plugins, scenarios, systems,
|
|
93
|
+
collab, workers, hosts, governance, entitlement, execution, projects, prompts, limits, a2a }`。`runtime` 域 11.0.0 起 retired:
|
|
94
94
|
墓碑 `RETIRED_DOMAINS` —— `parseDomain` / `buildEffective` / `readEffectiveWire` / `FileConfigStore` 遇带事实的 runtime 文档一律抛
|
|
95
95
|
`RetiredDomainError`(拒句点名一次性迁移 SS-M1),缺席或 `{}` 不理会。
|
|
96
96
|
`DOMAINS`(声明顺序)、`isDomainName(x)`;`"remote-exec"` **不是**域(独立契约,§4.6)。
|
|
@@ -147,6 +147,9 @@ registry:公网 npmjs,无需私有 registry 配置。
|
|
|
147
147
|
引擎词表不镜像(语义只有引擎 verify);逐条抢救 none(digest 约束)。
|
|
148
148
|
· limits:cost/限流族 14 键的热更新发布位;**open-world `.passthrough()`**(未知键原样承运 +
|
|
149
149
|
`"unknown-keys-carried"` 点名;1.x 论证见源头注,行为钉在 test/limits-domain-0.19.test.ts)。
|
|
150
|
+
· a2a(18.0.0):常驻出站 A2A 对端名册 `A2aConfig = { peers: A2aPeerSpec[] }`(对端名唯一);`A2aPeerSpec = { name, url, cardUrl?, headerRefs?,
|
|
151
|
+
principalHeader?, allowSkills?, scenarios(缺省 []), enabled(缺省 true) }`。判官全复用:`name` = `isUsableWireName`,`url` / `cardUrl` = `NON_SECRET_URL`,
|
|
152
|
+
`headerRefs` = mcp 的头名 → env-NAME 引用集合,`principalHeader` = 头名判官。便携(本地 `config.d/a2a.json`);读不进 ⇒ 空名册;逐条抢救;写权限 publisher。
|
|
150
153
|
- 边界 schema(可直接复用):`ENV_NAME`(/^[A-Z_][A-Z0-9_]*$/ 且拒 AKIA 形)、`NON_SECRET_URL`(存量文档里的 URL 座位 —— 域文档与 `config.d/remote-exec.json`
|
|
151
154
|
的两个端点;fragment 拒句带迁移指路)、`NON_SECRET_URL_NO_MIGRATION`(不是存量的座位 —— 凭据信封 `issuer`:同一判官、同样的规则句,fragment 拒句不带指路)、
|
|
152
155
|
`K8S_QUANTITY`、`TCP_PORT`、`HOST_NAME_MAX`/`HOSTS_ARRAY_MAX`。
|
|
@@ -165,7 +168,7 @@ registry:公网 npmjs,无需私有 registry 配置。
|
|
|
165
168
|
- `buildEffective(version, getRaw, updatedAt, onWarning?)`;`parseDomain(domain, raw)`(**`undefined` 才填默认,
|
|
166
169
|
`null` = 损坏 → 抛 sanitized ZodError**);`parseDomainLoud`(**文档面**:同 + 剥键/承运告警,永不抢救 —— 写入席、导出、`getDomain` 读它);
|
|
167
170
|
`parseDomainSalvaged`(12.3.0,**视图面**:与 `parseDomainLoud` 同一只内部体,整域读不进时按 `DOMAIN_ENTRY_SALVAGE` 逐条抢救、递归到嵌套集合,
|
|
168
|
-
救不活抛整域 parse 的原错;`buildEffective`
|
|
171
|
+
救不活抛整域 parse 的原错;`buildEffective` 十七域一处调它;好文档上两函数逐字同值同告警);`emptyEffective()`;
|
|
169
172
|
`readEffectiveWire(raw, onWarning?)`。
|
|
170
173
|
- 告警类型 `EffectiveReadWarning`(union,消费方 switch 需穷举):`hosts-grandfathered`(`droppedNames` 6.3.0 起有界 64,超界带
|
|
171
174
|
`droppedTotal`)| `domain-defaulted` |
|
|
@@ -207,6 +210,11 @@ registry:公网 npmjs,无需私有 registry 配置。
|
|
|
207
210
|
各回写一次。位移表的键 = 被压缩数组的原文档全路径(`formatConfigPath` 出门形,`"projects.<id>.contextItems"`;顶层数组就是字段名,旧表形与义不变)。
|
|
208
211
|
- 读降级表 `DOMAIN_READ_FALLBACK`(整域读不进时 default 或 throw,逐域档位)与逐条抢救表 `DOMAIN_ENTRY_SALVAGE`(12.3.0:读时能否逐条丢,
|
|
209
212
|
`salvage` / `none`,逐域档位)—— 两张表各答一个问题,谁也不读谁;`grandfatherHostsRead`。
|
|
213
|
+
- `ATOMIC_SALVAGE`(18.0.0,`ReadonlySet<ZodType>`,按 schema 身份):凭据引用集合(mcp 的 `envRefs` / `headerRefs`、a2a 的 `headerRefs`、车道块的 `secretRefs`、worker 的 `secretEnv`)
|
|
214
|
+
不部分抢救 —— 抢救走到成员不下钻,集合里任一键 / 值坏形 ⇒ 它所属的条目整条 `entry-dropped`、兄弟保留;别的集合字段照旧逐条丢(只会更窄)。
|
|
215
|
+
对已记录语料零变化;例外:引用名为 `__proto__` / `constructor` / `prototype` 的条目整条丢(旧版剥键告警或照收、条目留着),直接对 `WorkersConfig` 调 `salvageEntries` 时 `secretEnv` 带坏引用的 worker 整条丢。
|
|
216
|
+
保留成员名一张表 `RESERVED_MEMBER_NAMES` / `isReservedMemberName`:域 schema、`readPlainStringRecord` / `isStringRecord`、`resolveCenterRefs` 同答(`PLAIN_STRING_RECORD_RESERVED_MEMBER` 删除,读数 `reservedMember` 改名 `reservedMembers`)。
|
|
217
|
+
成员读键按自有属性名判:`__proto__` / `constructor` / `prototype` 作引用名 ⇒ 集合坏 ⇒ 整条丢(zod 的 record 读键前跳过 `__proto__`、不判它的值)。
|
|
210
218
|
--- 2.0.0 行为面 BREAKING:**逐条容错**。此前一条坏条目让**整域**退回 schema 默认(13 个模型坏一条 ⇒ 一条
|
|
211
219
|
都不剩);现在 `buildEffective` 在整域降级之前先经 `salvageEntries(schema, raw)` 只丢掉真正坏掉的那几条条目
|
|
212
220
|
(条目集合从域 schema 自身派生:数组字段与 Record 字段),同域其余条目照常生效,并逐条发 `entry-dropped`。
|
|
@@ -221,7 +229,7 @@ entitlement/execution/limits = `none`;`projects` = `salvage`,整域档位仍 `"t
|
|
|
221
229
|
整域读不进一臂);文档面(`parseDomain` / `parseDomainLoud`:写入席、导出、`getDomain`)永不抢救,视图面(`parseDomainSalvaged` / `buildEffective`)
|
|
222
230
|
按表抢救;抢救按 schema 递归到幸存条目体内的集合,子级坐标以父路径为前缀,零幸存者律每层成立 ---
|
|
223
231
|
- 角色助手:`UserRole`(viewer<editor<publisher<admin)、`ROLE_RANK`/`USER_ROLES`、`roleAtLeast`、`isRole`、
|
|
224
|
-
`domainWriteRole(domain)`(默认 editor;skills/mcp/plugins/scenarios/systems/entitlement = publisher,
|
|
232
|
+
`domainWriteRole(domain)`(默认 editor;skills/mcp/plugins/scenarios/systems/entitlement/prompts/a2a = publisher,
|
|
225
233
|
表在 `DOMAIN_WRITE_ROLE`)。
|
|
226
234
|
- 纯数据类型:`User`、`UserAuth`、`PublishedSnapshot`、`PendingPublish`、`ApprovePublishResult`、
|
|
227
235
|
`CasWriteResult`、`WorkerLifecycleRecord`;错误脱敏 `redactSecrets` / `sanitizeZodError`;
|
|
@@ -246,7 +254,7 @@ entitlement/execution/limits = `none`;`projects` = `salvage`,整域档位仍 `"t
|
|
|
246
254
|
- `ConfigReader` 接口(3 方法:getDomain/getEffective/getVersion)——本地源/测试桩实现它即可。(src/reader.ts)
|
|
247
255
|
|
|
248
256
|
--- 4.5 remoteExec 契约(src/remote-exec.ts,主 barrel / `./remote-exec`) ---
|
|
249
|
-
- `RemoteExecSpec`(discriminatedUnion on `provider`),
|
|
257
|
+
- `RemoteExecSpec`(discriminatedUnion on `provider`),7 个 provider(每个 ⊆ `EXECUTION_LANE_WORDS`;7.0.0 删
|
|
250
258
|
`remote-docker` —— 引擎零读点,远端 docker 守护进程 = `local-docker` + `DOCKER_HOST`):
|
|
251
259
|
- `host`:{ workdir?, allowedPaths?, shell?, commandTimeoutMs? } —— 无 secret。
|
|
252
260
|
- `local-docker`:{ image!, memory?, cpus?, network?("none"|"bridge"|"host"), workdir?, mountPath? }。
|
|
@@ -255,17 +263,21 @@ entitlement/execution/limits = `none`;`projects` = `salvage`,整域档位仍 `"t
|
|
|
255
263
|
timeoutMs?, memory?, cpu?, s3Snapshot?{ endpoint, bucket?, accessKeyEnv, secretKeyEnv, … } }。
|
|
256
264
|
- `ssh`:{ host!, port?, username!, privateKeyEnv!, mountPath? }。
|
|
257
265
|
- `adb`:{ serial!, adbPath?, mountPath? }。
|
|
266
|
+
- `none`(18.0.0):{}(零字段)—— 不给智能体的工具提供执行环境,`REMOTE_EXEC=none` 的文件形;无可配、无 secret。
|
|
258
267
|
(secret 全 env-NAME ref;exec-bound 串拒 NUL 与纯空白〔16.0.0:空串同拒,判官 = 车道坐标的 `isBlankCoordinate`,接受的值不 trim〕。通过校验 ≠ 目标服务版本已从文件驱动该 provider。)
|
|
259
268
|
|
|
260
269
|
--- 4.5b 执行车道 + 存储词表正本(src/execution-lanes.ts,主 barrel + `./execution-lanes`,7.0.0,纯数据) ---
|
|
261
|
-
- `EXECUTION_LANE_WORDS` / `ExecutionLane`:host · e2b · k8s · ssh · adb · local-docker · device(= 引擎 `REMOTE_EXEC` 收的词,
|
|
262
|
-
逐字同序;无 `in-process`、无 `remote-docker`)
|
|
270
|
+
- `EXECUTION_LANE_WORDS` / `ExecutionLane`:host · e2b · k8s · ssh · adb · local-docker · device · none(= 引擎 `REMOTE_EXEC` 收的词,
|
|
271
|
+
逐字同序;无 `in-process`、无 `remote-docker`)。`none`(18.0.0)= 不给智能体的工具提供执行环境:分租户(依据 `no-execution-target`)、不挂副本、四栏 env 全空,
|
|
272
|
+
只能独成一集(依据列为 `no-execution-target` 的车道 = 型 `StandaloneLane`;判官按列判,不点名车道词)。
|
|
273
|
+
- `laneSetFlaws(lanes: readonly unknown[]): readonly LaneSetFlaw[]` + `LANE_SET_RULE`(18.0.0):车道集合法性的唯一判官(空表 `empty_set` / 空白项 `blank_entry` /
|
|
274
|
+
不认识 `unknown`〔含不是字符串的项,`word` = 原值〕/ 墓碑词 `retired` / 重复 `duplicate` / 独占车道不独 `not_alone`;闭集,交回全部拒因,写闸穷举 switch 每条一 issue)。读车道集的消费方调同一只。
|
|
263
275
|
- `RETIRED_LANE_WORDS`(11.0.0):退役车道**值**的墓碑(`[旧词, 去向车道, 怎么配]`;永久、一跳;今一行 remote-docker → local-docker + DOCKER_HOST);
|
|
264
276
|
worker 规格 `runtime.execution.lanes` 的一格与车道文件 `provider` 读到退役词即拒,拒句 = `retiredLaneWordRefusal(word)`
|
|
265
277
|
(带出路;issue 码不变)。
|
|
266
278
|
- `EXECUTION_LANES: readonly ExecutionLaneRow[]`:每行 `{ lane, tenantSeparation: "supported"|"single-user-only", singleReplica, requiredEnv,
|
|
267
279
|
requiredSecretEnv, optionalEnv, optionalSecretEnv }`(深冻结;四栏 env 名两两不交、跨车道不交;行内容逐格抄自引擎,
|
|
268
|
-
坐标在每行 JSDoc)。`TENANT_SEPARATION_WORDS
|
|
280
|
+
坐标在每行 JSDoc)。`TENANT_SEPARATION_WORDS`;依据词 `TENANT_SEPARATION_BASES`(isolation / principal-binding / no-execution-target〔18.0.0〕)。`singleReplica`(16.0.0):执行目标挂在一个副本上(host:副本自己的文件系统;device:设备连上的那一个副本)——
|
|
269
281
|
声明了这种车道的 worker 只能一个副本。device 行的非密必需栏 = `DEVICE_RELAY_URL`(16.0.0;设备拨哪里:ws(s) 绝对 URL 或字面 `none`,值判官 `deviceRelayFlaws`,包根);非密可选栏含 `DEVICE_TRUSTED_PROXY_CIDRS`(17.1.0;设备 WS 未鉴权握手 per-remote 帽键的可信代理名单,CIDR 逗号分隔,缺省空 = 引擎不读任何代理头;值文法由引擎起服判,写闸只判归属)。
|
|
270
282
|
k8s 行的非密必需栏 = `K8S_SANDBOX_IMAGE` + `K8S_NAMESPACE`(沙箱 pod 所在的命名空间,部署自己声明;服务端的必需 env 门按本行 `requiredEnv ∪ requiredSecretEnv` 拒启)——
|
|
271
283
|
写 worker 的 k8s 行时 `runtime.execution.coords` 两键都要给,缺一键 ⇒ 写闸 issue、存下来的 workers 文档整域读不出。
|
|
@@ -273,7 +285,7 @@ entitlement/execution/limits = `none`;`projects` = `salvage`,整域档位仍 `"t
|
|
|
273
285
|
不 trim 值、不管值的格式(`" sandboxes "` 不是空白)。写闸对所有车道、所有必需坐标读的就是这一只,消费方在自己一侧问同一个问题调它、不抄第二份。
|
|
274
286
|
它只看已经有的字符串值:「这一键根本没设」由调用方先判(写闸对没设的键另有一句 `requires coords.<键>`),据它拒不拒由调用方按键是必需还是可选决定:写闸只对必需坐标据它拒,可选坐标的空串照收(`K8S_RUNTIME_CLASS` 的空串 = 不用 Kata)。(src/execution-lanes.ts)
|
|
275
287
|
- `STORE_BACKENDS`(mysql/pg/local/memory)、`SESSION_BACKENDS`(memory/mysql/auto)、`MEMORY_ENGINE_BACKENDS`(file/pg/mysql;16.0.0 起 `tidb` → `mysql`,旧词拒并指路 SS-M12)。
|
|
276
|
-
- 判据(都在 `WorkerSpec` schema 里,zod issue 的 `path` 指字段、message 带出路):enabled ⇒ 两块必填;`runtime.execution.lanes`(16.0.0)
|
|
288
|
+
- 判据(都在 `WorkerSpec` schema 里,zod issue 的 `path` 指字段、message 带出路):enabled ⇒ 两块必填;`runtime.execution.lanes`(16.0.0)有序、去重、非空,首项缺省,合法性只问 `laneSetFlaws`(18.0.0:`["none"]` 独成一集);
|
|
277
289
|
coords / secretRefs 的每个键归表里某条声明的车道、每条声明车道的必需键在场且非空白(空串或只含空白按缺),有文法的键(`DEVICE_RELAY_URL`)值合文法;归表外车道的键点名车道;
|
|
278
290
|
`requirePrincipal` ∧ 每条 single-user-only 车道各拒一条(出路按表现算);表里有 `singleReplica` 车道 ∧ 副本 > 1 拒(一条,点名这些车道);旧单值 `runtime.execution.lane` 是墓碑(指路 SS-M12);
|
|
279
291
|
device ∈ lanes ⇒ SQL 店且 session ≠ memory;memory 店 ∧ session mysql 拒;记忆引擎 pg/mysql ∧ session memory 拒;SQL 坐标 ⇔ SQL 店;
|
|
@@ -325,10 +337,11 @@ entitlement/execution/limits = `none`;`projects` = `salvage`,整域档位仍 `"t
|
|
|
325
337
|
MessageDisplay/DirectoryAdded/PreModelSwitch/PostModelSwitch);owner 表 `HOOK_EVENT_OWNER`(engine|shell,单属主)、`ENGINE_OWNED_HOOK_EVENTS`、
|
|
326
338
|
matcher 语义表 `HOOK_EVENT_MATCHER_FIELD`(null = 无 matcher 轴)。
|
|
327
339
|
- 逐事件输入形 `*HookInput`(union `HookInput`);输出:`SyncHookOutput`(exit 0 JSON;exit 2 = 阻断,stderr
|
|
328
|
-
作为理由/附加上下文喂回模型;其余 exit/超时/spawn 失败/坏 JSON =
|
|
340
|
+
作为理由/附加上下文喂回模型;其余 exit/超时/spawn 失败/坏 JSON = 非阻断故障〔缺省 `onFailure: "continue"`;command / http 条目写 `onFailure: "block"`(19.0.0 起的契约字段)则这些失败按 exit 2 算,执行是消费方的事〕,消费方 hook-runner 铸
|
|
329
341
|
`hook_non_blocking_failure` 通知帧上任务/fleet 流,stderr 先脱敏后截断 512 字)、`AsyncHookOutput`、
|
|
330
342
|
决策形 `HookDecision` / `HookPermissionRequestDecision` / `HookSpecificOutput`。
|
|
331
343
|
- 配置形(src/hooks-config.ts,经 `./hooks` 整体转出):`HookEntry`(`HOOK_ENTRY_TYPES` 五型 command|prompt|agent|http|mcp_tool)→ `HookMatcherEntry` → `HooksConfig`
|
|
344
|
+
(条目字段只有一张表,分类器、zod 面、条目类型同读它;19.0.0 起 command 条目承运 `args` —— exec 形参数表,串数组、元素零 NUL,`[]` 与空串元素合法;command / http 条目承运 `onFailure` —— 词闭集 `HOOK_ON_FAILURE_WORDS` = continue|block,型 `HookOnFailure`,缺席不补缺省;承运 ≠ 执行;这两个键的坏值是坏块;`rewakeMessage` / `rewakeSummary` / `cloud` / `continueOnBlock` 仍不承运)
|
|
332
345
|
(`Partial<Record<HookEventName, HookMatcherEntry[]>>`,事件名闭集);三者与逐型五只 zod 面都是 `classifyHooksConfig` 的投影(受理 ⇔ loaded,
|
|
333
346
|
issue = 码 + 坐标 + 坏字段名)。`classifyHooksConfig(settingsDoc)` = hooks 坏形的唯一读者:结局 `loaded`/`loaded-partial`/`rejected`;剔点五码
|
|
334
347
|
`HOOKS_DROPPED_PIECE_CODES`(非守卫事件的坏块逐个剔);拒点六码 `HOOKS_REJECTION_CODES`(守卫事件 PreToolUse / PermissionRequest 任何坏处、
|
|
@@ -524,8 +537,8 @@ entitlement/execution/limits = `none`;`projects` = `salvage`,整域档位仍 `"t
|
|
|
524
537
|
- `loadRemoteExec(root)`(三态,§8 T3)、`writeRemoteExec`(校验+原子写)、`remoteExecPath`、`loadEnvFile`
|
|
525
538
|
(`.env` merge over process.env,file 赢,支持 `KEY=file:<path>`)。
|
|
526
539
|
- `FileConfigStore`(实现 `ConfigReader`;`getEffective({tolerant:true})` → `TolerantEffective
|
|
527
|
-
{ effective, domainErrors }`:catalog 域坏文件单列降级,gate 域 fail-loud);`PORTABLE_DOMAINS`(
|
|
528
|
-
models/rosters/skills/mcp/plugins/scenarios/collab/governance/execution/prompts/limits;`config.d/runtime.json` 只为墓碑读,带事实即拒)、
|
|
540
|
+
{ effective, domainErrors }`:catalog 域坏文件单列降级,gate 域 fail-loud);`PORTABLE_DOMAINS`(12 域:
|
|
541
|
+
models/rosters/skills/mcp/plugins/scenarios/collab/governance/execution/prompts/limits/a2a;`config.d/runtime.json` 只为墓碑读,带事实即拒)、
|
|
529
542
|
`NON_PORTABLE_DOMAIN_REASONS`(workers/hosts/systems/projects/entitlement 的排除理由,编译期双向咬死)。
|
|
530
543
|
- `validateDomain`/`validateRemoteExec` → `ValidateResult`(不 throw 用户数据)、`writeDomainFile`/
|
|
531
544
|
`domainFilePath`、`listRequiredEnvNames` → `RequiredEnvName[]`。
|
|
@@ -550,10 +563,16 @@ entitlement/execution/limits = `none`;`projects` = `salvage`,整域档位仍 `"t
|
|
|
550
563
|
与目录形同一个内核(读目录之后的「迁 → 整域终判」只此一处),`documents` 的律(覆盖面外不读不判不进结果、拼错的名字抛 `TypeError`、`runtime` 要把 `governance` / `limits` 放进覆盖面)逐字同;入参不被改,重跑 `docs` ⇒ `noop`;一层一次调用(层序 / 覆盖 / 托管锁的合并读法不在这里)。
|
|
551
564
|
|
|
552
565
|
--- 4.11b URL 内嵌凭据判官(主 barrel,14.5.0;src/url-credential.ts) ---
|
|
553
|
-
- `findUrlCredential(raw)`:URL 里的凭据 = 日志脱敏器已经在用的定义 —— userinfo(只有用户名也算;判由 `httpUrlFlaws(raw, ["userinfo"])`),或 query / fragment
|
|
554
|
-
(名字按收方的读法读:`URLSearchParams` 解一次码,ASCII 大小写不敏感,不做 Unicode
|
|
566
|
+
- `findUrlCredential(raw)`:URL 里的凭据 = 日志脱敏器已经在用的定义 —— userinfo(只有用户名也算;判由 `httpUrlFlaws(raw, ["userinfo"])`),或 query / fragment 里名字是凭据名的参数
|
|
567
|
+
(名字按收方的读法读:`URLSearchParams` 解一次码,ASCII 大小写不敏感,不做 Unicode 折叠;是不是凭据名只问 `credentialParamWordOf`,见下)。答首个命中(userinfo → query → fragment):`{ reason: "url_userinfo" }` 或
|
|
555
568
|
`{ reason: "url_credential_param", at: "query" | "fragment", name }`(`name` = 表里的词,小写);值从不进答案;不透明形 / 解析不了 / 非层级式 ⇒ `undefined`(这一形收不收是座位自己的律)。`findUrlUserinfo` = 判官的第一问;
|
|
556
|
-
`isCredentialParamName(decodedName)` =
|
|
569
|
+
`isCredentialParamName(decodedName)` = `credentialParamWordOf` 有词;`urlCredentialRule(hit)` = 规则句(userinfo 与 `httpUrlRule("userinfo")` 同一句;参数句点名段与表词);`URL_CREDENTIAL_REASONS` = 拒因词闭集 `url_userinfo` / `url_credential_param`。
|
|
570
|
+
- `credentialParamWordOf(decodedName): CredentialParamName | undefined`(18.0.0,包根):「这个已解码的参数名是不是凭据名」的**唯一答者**(`isCredentialParamName` 与 `findUrlCredential` 的 query / fragment 臂读的都是它)。
|
|
571
|
+
① 整名(ASCII 大小写不敏感)在 `CREDENTIAL_PARAM_NAMES` 上 ⇒ 那个词(照旧,整名优先:`client_secret` 答 `client_secret`);② 否则按 `_` / `-` / `.` 与驼峰边界切段(空段不存在),**末段**的尾部是强档词
|
|
572
|
+
(`password` / `passwd` / `pwd` / `secret` / `apikey`)⇒ 那个词 —— `db_password` · `DB_PASSWORD` · `dbPassword` · `x-db-secret` · `user_pwd` 与前缀粘连的 `PGPASSWORD` 都算,词不跨分隔符(`app_wd` 不是 `pwd`);
|
|
573
|
+
③ 尾串闭集(逐词对齐,分隔符与大小写不论):`secret key` / `secret access key` ⇒ `secret`(`SECRET_KEY` · `AWS_SECRET_ACCESS_KEY`),`api key` ⇒ `api_key`(`x-api-key` · `X_API_KEY` · `xApiKey`),`access token` ⇒ `access_token`(`github_access_token` · `oauth-access-token`);答词的律只有一条:尾串用 `_` 连起来本身在整名表里 ⇒ 答整名词,否则答强段词。只看末尾:`password_hash` · `password_policy` · `password_hint` · `secretName` · `secret_name` ·
|
|
574
|
+
`pwd_dir` · `passwordless` 不是凭据名,数字尾巴不剥(`password2` 不是),裸 `access_key` 与名表里别的词(`token` / `key` / `refresh_token` …)作末尾时只认整名(`api_key_count` · `token_count` 不命中)。返回的是**表词**(复合名回显它收尾的那个词,调用方的名字字节不进答案):
|
|
575
|
+
消费方拿它去查自己挂在名表上的那一列(例:日志脱敏器的自由文本锚强度),不再对整名查表。误报面:以强档词收尾但值不是凭据的名字(`show_password=1` · `is_secret=true`)也被判成凭据名 —— 多拒多遮。
|
|
557
576
|
- 与 `NON_SECRET_URL` 是两个问题、互补(不是一个包含另一个):本判官按参数**名**判,`NON_SECRET_URL` 按**值形**判密钥(`?key=abc` 它放行、本判官命中;`?x=sk-live-…` 反之);存量域文档位读后者。
|
|
558
577
|
- 判官只判有没有,载体律留在座位:同一个键在新提交门拒、在续跑重放存量体的腿不拒、部署 env 只因 userinfo 拒 —— 所以它没有接进任何读已落盘 / 重放字节的 schema 或读器;拒体的形(HTTP 码、字段坐标、出路句)是座位自己的铸点。
|
|
559
578
|
凭据名表另有一份在服务端日志脱敏器里(带自由文本锚强度一列):消费方把它的表键钉在 `CREDENTIAL_PARAM_NAMES` 上(`Record<CredentialParamName, …>` 穷尽映射),加 / 删词不同步即编译红。
|
|
@@ -653,8 +672,9 @@ T7. **`.optional()` 无默认是有意的**:governance/limits 多数键 ABSENT =
|
|
|
653
672
|
T8. **roster 解析容错**(dangling → global fallback),PUT 时才用 `refIntegrityIssues` 严判。
|
|
654
673
|
T9. **`atMention` 的义由 `mode` 说**(11.0.0 取代 `atModelAllowlist`):`only` 收窄到一个都不剩 ⇒ `{mode:"none"}`(`narrowAtMention`,一只读法)。
|
|
655
674
|
T10. **worker.env 保留键**:`RESERVED_WORKER_ENV` 在 env/secretEnv 里被拒(用结构化字段)。7.0.0 起执行车道键
|
|
656
|
-
(REMOTE_EXEC /
|
|
657
|
-
`runtime.execution` / `runtime.store`;别的域也读的名(MINIO_* / LOG_LEVEL)
|
|
675
|
+
(REMOTE_EXEC / 车道表全部名)与店键(DB_BACKEND / MEMORY_ENGINE*)也在保留集 —— 写到
|
|
676
|
+
`runtime.execution` / `runtime.store`;别的域也读的名(MINIO_* / LOG_LEVEL)仍可透传。`REQUIRE_EXECUTION_LANE`(18.0.0)不再是保留名:
|
|
677
|
+
它进了墓碑表 `RETIRED_ENVS`(`replaced` → `REMOTE_EXEC`),逃生口里写它 ⇒ 墓碑句;渲染器不再产出它。
|
|
658
678
|
T11. **`remote-exec` 不是域**:用 `writeRemoteExec`/`loadRemoteExec`,喂给 `writeDomainFile` 会 fail-loud。
|
|
659
679
|
T12. **provider↔api 配对强制**(ModelEntry)。
|
|
660
680
|
T13. **三态 cap(entitlement.runtimeCaps 全族)**:ABSENT ≠ false;缺席**不下发键**(引擎是唯一默认源,
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
3
|
-
重写日期: 2026-11-
|
|
3
|
+
重写日期: 2026-11-03 | 包版本: 19.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 相等、
|
|
@@ -10,7 +10,7 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
10
10
|
# @sema-agent/settings-schema
|
|
11
11
|
|
|
12
12
|
> 一个**纯配置契约 + resolver + 本地 loader** 的 npm 包(公网 npmjs,ESM only,Node >=20.3.0,唯一运行时
|
|
13
|
-
> 依赖 zod ^4.4.0)。它是 sema 栈配置域的**单一真值**:
|
|
13
|
+
> 依赖 zod ^4.4.0)。它是 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 是一次性迁移族的目录形
|
|
@@ -22,9 +22,9 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
22
22
|
|
|
23
23
|
## 核心能力(它能为我做什么)
|
|
24
24
|
|
|
25
|
-
- **
|
|
25
|
+
- **17 个配置域**的 zod schema 与类型(`DOMAIN_SCHEMAS` / `DOMAINS` / `isDomainName`):models · rosters · skills ·
|
|
26
26
|
mcp · plugins · scenarios · systems · collab · workers · hosts · governance · entitlement · execution ·
|
|
27
|
-
projects · prompts · limits。`runtime` 域 11.0.0 起 retired(墓碑 `RETIRED_DOMAINS`:读写遇带事实的 runtime 文档响亮拒,
|
|
27
|
+
projects · prompts · limits · a2a(18.0.0:常驻出站 A2A 对端名册,便携;`A2aConfig` / `A2aPeerSpec`)。`runtime` 域 11.0.0 起 retired(墓碑 `RETIRED_DOMAINS`:读写遇带事实的 runtime 文档响亮拒,
|
|
28
28
|
存量由一次性迁移 SS-M1 搬进 governance / limits —— `./one-time-migrations`)。(src/types.ts: `DOMAIN_SCHEMAS`)
|
|
29
29
|
- **域内坏条目逐条丢**(2.0.0):一条写坏的目录条目只丢它自己,同域其余条目照常生效,并逐条发
|
|
30
30
|
`entry-dropped` 点名(坐标形见下条;S-712 起可带 `identity?: { name?, id?, enabled? }` = 被丢条目原文里
|
|
@@ -84,16 +84,16 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
84
84
|
worker env / 车道坐标 / 覆盖值)经同一只 `containsSecretToken` 拒 secret 形状;10.0.0 起私钥 PEM 头在串中**任意位置**都拒(此前只认串首;读原文 + 前三层百分号解码),
|
|
85
85
|
头的位置与展示侧 `redactSecrets` 同判,读法宽度仍窄于展示侧(四层及更深的编码、`+` 代空格的头写侧仍放行)。(src/types.ts: `ENV_NAME` / `containsSecretToken` / `PRIVATE_KEY_PEM_HEADER` /
|
|
86
86
|
`SealedApiKey`;src/secret-refs.ts)
|
|
87
|
-
- `remoteExec` 执行层契约:
|
|
87
|
+
- `remoteExec` 执行层契约:7 个 provider(host / local-docker / e2b / k8s / ssh / adb / none〔18.0.0,零字段:不给智能体的工具提供执行环境〕),判别字段 `provider`;
|
|
88
88
|
每个 provider 词 ⊆ 车道词表(7.0.0 删 `remote-docker`:引擎零读点)。(src/remote-exec.ts: `RemoteExecSpec`)
|
|
89
|
-
- **执行车道 + 存储的词表正本**(7.0.0,纯数据):`EXECUTION_LANE_WORDS`(host / e2b / k8s / ssh / adb / local-docker / device)、
|
|
90
|
-
`EXECUTION_LANES`(每车道 `tenantSeparation`〔supported 行另带依据 `tenantSeparationBasis`:isolation / principal-binding
|
|
91
|
-
worker 声明有序车道集 `runtime.execution.lanes`(16.0.0,首项缺省;旧单值 `lane` 是墓碑)。
|
|
89
|
+
- **执行车道 + 存储的词表正本**(7.0.0,纯数据):`EXECUTION_LANE_WORDS`(host / e2b / k8s / ssh / adb / local-docker / device / none〔18.0.0:不给智能体的工具提供执行环境,只能独成一集〕)、
|
|
90
|
+
`EXECUTION_LANES`(每车道 `tenantSeparation`〔supported 行另带依据 `tenantSeparationBasis`:isolation / principal-binding / no-execution-target〔18.0.0〕,11.0.0 判别联合〕+ `singleReplica`〔16.0.0〕+ 它读的 env 名四栏;device 行必需 `DEVICE_RELAY_URL`〔16.0.0,值判官 `deviceRelayFlaws`〕、可选栏含 `DEVICE_TRUSTED_PROXY_CIDRS`〔17.1.0,设备握手帽键的可信代理名单,值文法由引擎判〕)、退役车道值墓碑 `RETIRED_LANE_WORDS` + 拒句 `retiredLaneWordRefusal(word)`(11.0.0)、`STORE_BACKENDS` / `SESSION_BACKENDS` / `MEMORY_ENGINE_BACKENDS`(file / pg / mysql)。
|
|
91
|
+
worker 声明有序车道集 `runtime.execution.lanes`(16.0.0,首项缺省;旧单值 `lane` 是墓碑);车道集合不合法只问一只判官 `laneSetFlaws(lanes)` + 规则句 `LANE_SET_RULE`(18.0.0,包根与 `./execution-lanes`:非空 / 认词〔不是字符串的项也是不认识〕/ 墓碑词 / 去重 / 独占车道独成一集,拒因闭集 `LaneSetFlaw`)。
|
|
92
92
|
必需坐标的值算不算「缺」的唯一判官 `isBlankCoordinate(value)`(包根与 `./execution-lanes` 子路径同一个函数对象〔包根 15.1.0、子路径 15.2.0〕:空串或只含空白 ⇒ true;写闸读的同一只,消费方在自己一侧问同一个问题调它;「键没设」由调用方先判,据它拒不拒由调用方按键的必需 / 可选决定〔写闸只对必需坐标据它拒〕;src/execution-lanes.ts)。
|
|
93
93
|
WorkerSpec 的 `runtime.execution` / `runtime.store` 两块按这张表判(写闸 = `WorkerSpec.safeParse`,拒因在 zod issue 里);
|
|
94
94
|
存量 workers 行由一次性迁移改写(6.x 行 SS-M4、15.x 行 SS-M12;`migrateStoredDocuments` / bin `npx @sema-agent/settings-schema migrate <config.d directory>`),逐行终判是读侧的 `readWorkersRows`。
|
|
95
95
|
(src/execution-lanes.ts;src/types.ts: `WorkerSpec`;src/one-time-migrations.ts)
|
|
96
|
-
- **hooks 契约**:33 个 hook 事件的全集 + owner 表 + 逐事件输入/输出形 + 配置面:hook 条目五种 type(`HOOK_ENTRY_TYPES`,含 `mcp_tool`)与**一只**
|
|
96
|
+
- **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`;承运不是执行〕)与**一只**
|
|
97
97
|
坏形分类器 `classifyHooksConfig(settingsDoc)`(非守卫事件坏块逐个剔、守卫事件 PreToolUse / PermissionRequest 任何坏处或守卫迹象 ⇒ 整份拒;码 + 坐标 + 坏字段名 `field`(坏块是匹配器 / 条目 ⇒ 它上面出问题的键,块不是对象才缺席;一块多个迹象时先该块自身的迹象(自有守卫事件键;条目自己是匹配器形取 `hooks`),再按文档序找嵌套迹象;匹配器下合形条目列表里的迹象归各条目)、零句子、零 zod 自含;
|
|
98
98
|
闭包里 JS 内建之外只有一个自由名 `HOOK_EVENTS` —— 整函数抄走的生成器(client-core)须把本包运行期导出 `HOOK_EVENTS`(上游常量)注入抄本作用域,不许贴字面事件表),
|
|
99
99
|
`HooksConfig` / `HookEntry` 等 zod 面是它的投影;事件与 type 两张闭集与上游的漂移由常驻门看住(上游有而本包没有的词 ⇒ 门红并点名)。http 钩子 header 里 `$VAR` / `${VAR}` 的展开也只有一只读法(名单内展开、名单外与凭据名置空并回报)。(src/hooks.ts: `HOOK_EVENTS` / `interpolateHookEnvVars`)
|
|
@@ -163,7 +163,7 @@ llms.txt — 消费方(使用者)视角索引 · @sema-agent/settings-schema
|
|
|
163
163
|
- **目录形一次性迁移**(`./node`):`migrateConfigDirectory(dir, { documents, io, check? })` —— 命令行 `migrate` 背后的唯一实现(读目录 → 迁 → 整域终判 → 原子写 → 删退役域文件);`documents` = 调用方读的域名集(覆盖面外的文件不读不判不写不删),
|
|
164
164
|
`io` 注入四个口,真绑定 `nodeConfigDirectoryIo`(node:fs + 唯一的原子写器);返回闭集 `unreadable` / `no-documents` / `refused` / `noop` / `pending` / `applied`。(src/config-dir-migration.ts · src/config-dir-io.ts)
|
|
165
165
|
- **同步单口**(`./node`,14.5.0):`migrateConfigDocuments(docs, { documents })` —— 手里已有存量文档原文(文档名 → 文档)时,「迁 → 整域终判」一次调用、无 io,与目录形同一个内核同一个闭集的无 io 形:`unreadable`(覆盖面内某份不是 JSON 对象 ⇒ 不抛,点名 `document`)/ `no-documents` / `refused`(`docs` 仍交回迁移后的那一份)/ `noop`(同一引用)/ `migrated`(`docs` + `applied` + `changed` + `removed`)。一层一次调用,层的合并不在这里。(src/config-dir-migration.ts)
|
|
166
|
-
- **URL 内嵌凭据判官**(包根,14.5.0):`findUrlCredential(raw)` —— userinfo,或 query / fragment
|
|
166
|
+
- **URL 内嵌凭据判官**(包根,14.5.0):`findUrlCredential(raw)` —— userinfo,或 query / fragment 里名字是凭据名的参数(整名在凭据名表 `CREDENTIAL_PARAM_NAMES`〔23 词〕上,或 18.0.0 起末段 / 尾串收在强档词上:`db_password` · `PGPASSWORD` · `SECRET_KEY`;答者只有 `credentialParamWordOf`)⇒ `{ reason: "url_userinfo" }` / `{ reason: "url_credential_param", at, name }`,首个命中、值不进答案,不透明 / 解析不了 ⇒ `undefined`;`findUrlUserinfo`(第一问)· `credentialParamWordOf(decodedName)`(18.0.0:凭据名判定的唯一答者,返回表词或 `undefined`)· `isCredentialParamName`(= 它有词)· `urlCredentialRule`(规则句)· `URL_CREDENTIAL_REASONS`(`url_userinfo` / `url_credential_param`)。判官只判有没有,载体律(新提交门拒 / 重放腿不拒 / 部署 env 只因 userinfo 拒)留在座位。(src/url-credential.ts)
|
|
167
167
|
- **会话网页链接**:`webAdminSessionUrl(webBaseUrl, { worker, sessionId })` 铸 `<webBaseUrl>/chat?agent=<worker>&session=<sessionId>`(两位必填、逐位 `encodeURIComponent`、基址须是干净的绝对 http(s) URL 且尾斜杠折掉,
|
|
168
168
|
坏输入抛、不铸半截链接)+ 配对解析 `parseWebAdminSessionUrl(link)`(绝对 / 相对串、`URL`、`URLSearchParams`;缺的那一位缺席)—— 路由与参数名只此一处,谁都别手拼。(src/web-admin-session-url.ts)
|
|
169
169
|
- **按 scope 绑定的令牌**(`./api/pull-token`):形与铸法一条规则、令牌族是数据(`WORKER_PULL_TOKEN` = `wpt_` / `wpt2_` / `worker-pull`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/settings-schema",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.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",
|