@sema-agent/settings-schema 19.0.1 → 20.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.
@@ -6,8 +6,8 @@
6
6
  * ONE READER. "Can this document's hooks be loaded, and which pieces must go?" has one answer: {@link classifyHooksConfig}. The zod faces
7
7
  * below ({@link HooksConfig}, {@link HookMatcherEntry}, {@link HookEntry} and the per-type five) are its PROJECTIONS — accepted ⇔ the
8
8
  * classifier says `"loaded"`, the parsed value is what it loaded, each issue is one of its pieces (code + coordinate). There is no second
9
- * statement of what a valid hook entry is: the per-type field table {@link HOOK_ENTRY_FIELDS} is read by the classifier at run time and by
10
- * the entry TYPES at compile time (they are derived from it).
9
+ * statement of what a valid hook entry is: the per-type field table {@link HOOK_ENTRY_FIELDS} (exported) is what the entry TYPES are derived from at
10
+ * compile time, and the classifier reads its closure-private projection of it ({@link HOOK_ENTRY_FIELDS_READ}, tied to the table's type — see there).
11
11
  *
12
12
  * GRANULARITY = CC 2.1.296 (`cli296.js:237470`, `Yy` → `on`): four levels of piece — the `hooks` key, an event, a matcher, an entry.
13
13
  * · Outside the guard events, a bad piece is DROPPED alone (the rest of the document — its `permissions.deny`, its `env` — still applies).
@@ -31,8 +31,11 @@
31
31
  * with a sign>] }` reports the matcher's wrong `matcher` field. A sign of the piece decides before a wrong contract field of the same piece does
32
32
  * (it is why the piece is rejected rather than dropped).
33
33
  *
34
- * CC 2.1.296 DIVERGENCES (each in the stricter direction — a document CC would load may be rejected here, never the reverse): listed once,
35
- * in `docs/CC-DIVERGENCE.md` (section "hooks classifier", H1–H7) — the whole-subtree guard-sign scan is the first of them.
34
+ * CC 2.1.296 DIVERGENCES (the ones LISTED there are each in the stricter direction — a document CC would load may be rejected here, never the reverse): listed once,
35
+ * in `docs/CC-DIVERGENCE.md` (section "hooks classifier", H1–H7) — the whole-subtree guard-sign scan is the first of them. The entry field table
36
+ * ({@link HOOK_ENTRY_FIELDS}) carries EVERY key CC's five hook-entry schemas carry (`cli309.js:252382`), so no key CC judges is stripped here unjudged. That is a statement about
37
+ * which KEYS are read; the VALUE forms are the field kinds' (H7 lists where they judge more than CC does), with one known place where a kind judges LESS than CC: an `http` entry's `url`
38
+ * is read as a non-empty string where CC checks URL syntax (not closed yet — see CHANGELOG 20.0.0, "已知限制").
36
39
  *
37
40
  * COORDINATES are raw {@link ConfigPath} segments (the keys as written). An unknown event name or a key outside `hooks` is user text and may be
38
41
  * anything, a pasted credential included: pass a coordinate through `outgoingPath` before it leaves the process (log, UI, wire). The classifier
@@ -113,6 +116,15 @@ export const HOOK_ENTRY_TYPES = ["command", "prompt", "agent", "http", "mcp_tool
113
116
  * The classifier reads this set through a closure-private projection that the compiler ties to it in both directions.
114
117
  */
115
118
  export const HOOK_ON_FAILURE_WORDS = ["continue", "block"];
119
+ /**
120
+ * The words CC gives `cloud` (CC `cli309.js:252382`, `cloud:B(["device","skip"]).optional().catch("skip")`, marked `@internal` there): where this hook may run when a cloud session is driven from the
121
+ * machine that holds the settings. `device`: offer it to the cloud session and run it on the device even when its script sits where the cloud session can write; `skip`: never offer it to cloud
122
+ * sessions. The key absent is a third reading (CC's default: a command hook whose script can be pinned and lies outside everything the cloud session can write is offered, an http hook is offered).
123
+ * REFERENCE FOR READERS, not a check: CC's `.catch("skip")` takes ANY value that is not one of these words (a non-string, `null`, an object included) as `skip` and still loads the file, so `cloud` has no bad
124
+ * value — {@link classifyHooksConfig} carries whatever is written, as written (it neither judges it, nor folds it to `skip`, nor strips it), and folding to `skip` is the reader's. Carried by `command` and
125
+ * `http` entries. CARRIED, not executed here.
126
+ */
127
+ export const HOOK_CLOUD_WORDS = ["device", "skip"];
116
128
  /** `shell` values: 'bash' = the user's $SHELL family; 'powershell' = pwsh. Default bash. */
117
129
  const HOOK_SHELLS = ["bash", "powershell"];
118
130
  /** The classifier's reading of {@link HOOK_ON_FAILURE_WORDS}. The classifier is copied as source by consumers' generators, so its closure cannot read an exported name (its one free name
@@ -121,29 +133,74 @@ const HOOK_SHELLS = ["bash", "powershell"];
121
133
  const HOOK_ON_FAILURE_ACCEPTED = { continue: true, block: true };
122
134
  /** Fields every entry type takes: `if` = permission-rule syntax (e.g. "Bash(git *)") evaluated against tool_name/tool_input before the hook
123
135
  * runs (tool events only; shell superset field, CC-compatible); `timeout` = seconds for this entry (default `DEFAULT_HOOK_TIMEOUT_SECONDS`);
124
- * `statusMessage` = spinner status message; `once` = run once, then remove. */
136
+ * `statusMessage` = spinner status message; `once` = run once, then remove. Read by the exported table below only — the classifier's own
137
+ * projection spells these four out per row (it is a closure, see {@link HOOK_ENTRY_FIELDS_READ}). */
125
138
  const HOOK_ENTRY_COMMON_FIELDS = { if: "string?", timeout: "seconds?", statusMessage: "string?", once: "boolean?" };
126
139
  /**
127
- * THE field table of a hook entry, per type — read by {@link classifyHooksConfig} (which field is bad, what is carried) and by the entry
128
- * types below (derived from it). Field order = the order a loaded entry's keys come out in.
140
+ * THE field table of a hook entry, per type — exported, deeply frozen (a consumer that projects "which fields does an entry carry" reads this one object and
141
+ * cannot change what the others read), and what the entry types below are derived from. Field order = the order a loaded entry's keys come out in.
142
+ * The classifier does not read THIS object: it is copied as source by consumers' generators, and a closure that read an exported declaration — or a private one
143
+ * that an export expression reaches — would not be copyable. It reads {@link HOOK_ENTRY_FIELDS_READ}, annotated with this table's type.
129
144
  * · command: `args` = exec form (CC `cli309.js:252382`: when present — `[]` included — `command` is an executable spawned directly with these arguments, no shell; the mere
130
145
  * presence of `args` is the switch), `shell` (see above), `async` = run in background without blocking, `asyncRewake` = background + wake the model on exit 2,
131
- * `onFailure` (see {@link HOOK_ON_FAILURE_WORDS});
132
- * · prompt / agent: `prompt` ($ARGUMENTS = the hook input JSON), `model`;
146
+ * `onFailure` (see {@link HOOK_ON_FAILURE_WORDS}), and — CC marks them `@internal` — `rewakeMessage` (the prefix of the system-reminder the model gets when an `asyncRewake` hook exits
147
+ * 2) and `rewakeSummary` (the one-line summary the user sees then): both a string of at least one character (`nonEmpty`), `cloud` (`any`: CC reads every value outside {@link HOOK_CLOUD_WORDS} as `skip`
148
+ * and loads the file, so there is nothing to judge — the value is carried as written and the reader folds);
149
+ * · prompt / agent: `prompt` ($ARGUMENTS = the hook input JSON), `model`; prompt only: `continueOnBlock` = the `continue` value of the `decision: "block"` the entry produces when its
150
+ * verdict is not ok (CC default false: the turn ends);
133
151
  * · http: `url`, `headers` (values may reference $NAMEs listed in `allowedEnvVars` — env-NAME interpolation only, the config never carries a
134
- * secret value; `interpolateHookEnvVars` is the one reading), `allowedEnvVars`, `onFailure` (the other schema CC gives it to);
152
+ * secret value; `interpolateHookEnvVars` is the one reading), `allowedEnvVars`, `onFailure` (the other schema CC gives it to), `cloud` (the other schema CC gives it to);
135
153
  * · mcp_tool: `server` (an already-configured MCP server's name), `tool`, `input` (the tool's arguments; string values may interpolate
136
154
  * `${path}` from the hook input JSON — CC 2.1.296 semantics, the runner's business).
137
- * NOT in the table, on purpose: CC's `@internal` command / http keys `rewakeMessage` / `rewakeSummary` / `cloud` (not public settings keys; `cloud` even reads a bad value
138
- * as 'skip' and loads the file) and the prompt entry's `continueOnBlock`. A key outside a type's row is not carried and not a bad piece (`docs/CC-DIVERGENCE.md` H7) —
139
- * which is also why `args` on a non-command entry and `onFailure` on a prompt / agent / mcp_tool entry are such keys.
155
+ * Every key of CC's five entry schemas (`cli309.js:252382`) is in its row — nothing CC judges is stripped here. A key outside a type's row is not carried and not a bad piece
156
+ * (`docs/CC-DIVERGENCE.md` H7): `args` on a non-command entry, `onFailure` on a prompt / agent / mcp_tool entry, `cloud` and `rewakeMessage` / `rewakeSummary` and `continueOnBlock` on a type CC's
157
+ * schema does not give them to, and any key CC does not know. CARRIED, not executed: `rewakeMessage` / `rewakeSummary` / `cloud` / `continueOnBlock` are read by the consumer that runs the hook
158
+ * (a consumer that does not run them carries them as written).
159
+ * The row order also decides which field an already-bad entry names (the first wrong one), so a column added later goes at the TAIL of its row (after the shared fields): adding one never
160
+ * moves an answer the table already gave.
140
161
  */
141
- const HOOK_ENTRY_FIELDS = {
142
- command: { command: "text", args: "argv?", shell: "shell?", async: "boolean?", asyncRewake: "boolean?", onFailure: "onFailure?", ...HOOK_ENTRY_COMMON_FIELDS },
143
- prompt: { prompt: "text", model: "string?", ...HOOK_ENTRY_COMMON_FIELDS },
144
- agent: { prompt: "text", model: "string?", ...HOOK_ENTRY_COMMON_FIELDS },
145
- http: { url: "text", headers: "stringRecord?", allowedEnvVars: "stringList?", onFailure: "onFailure?", ...HOOK_ENTRY_COMMON_FIELDS },
146
- mcp_tool: { server: "string", tool: "string", input: "record?", ...HOOK_ENTRY_COMMON_FIELDS },
162
+ export const HOOK_ENTRY_FIELDS = Object.freeze({
163
+ command: Object.freeze({
164
+ command: "text",
165
+ args: "argv?",
166
+ shell: "shell?",
167
+ async: "boolean?",
168
+ asyncRewake: "boolean?",
169
+ onFailure: "onFailure?",
170
+ ...HOOK_ENTRY_COMMON_FIELDS,
171
+ rewakeMessage: "nonEmpty?",
172
+ rewakeSummary: "nonEmpty?",
173
+ cloud: "any?",
174
+ }),
175
+ prompt: Object.freeze({ prompt: "text", model: "string?", ...HOOK_ENTRY_COMMON_FIELDS, continueOnBlock: "boolean?" }),
176
+ agent: Object.freeze({ prompt: "text", model: "string?", ...HOOK_ENTRY_COMMON_FIELDS }),
177
+ http: Object.freeze({ url: "text", headers: "stringRecord?", allowedEnvVars: "stringList?", onFailure: "onFailure?", ...HOOK_ENTRY_COMMON_FIELDS, cloud: "any?" }),
178
+ mcp_tool: Object.freeze({ server: "string", tool: "string", input: "record?", ...HOOK_ENTRY_COMMON_FIELDS }),
179
+ });
180
+ /** The classifier's reading of {@link HOOK_ENTRY_FIELDS}. Same reason and same form as {@link HOOK_ON_FAILURE_ACCEPTED}: the classifier closure cannot read the exported table, so this
181
+ * is its closure-private projection, spelled out in full (no shared piece with the exported table) and annotated with the exported table's type — a row, a field or a field kind that
182
+ * the two do not agree on is a compile error in one direction (a missing one) or the other (an extra one). the hook-entry-fields pin under `test/` holds the run-time half: what the
183
+ * classifier accepts, requires and orders per type is what the exported table says. */
184
+ const HOOK_ENTRY_FIELDS_READ = {
185
+ command: {
186
+ command: "text",
187
+ args: "argv?",
188
+ shell: "shell?",
189
+ async: "boolean?",
190
+ asyncRewake: "boolean?",
191
+ onFailure: "onFailure?",
192
+ if: "string?",
193
+ timeout: "seconds?",
194
+ statusMessage: "string?",
195
+ once: "boolean?",
196
+ rewakeMessage: "nonEmpty?",
197
+ rewakeSummary: "nonEmpty?",
198
+ cloud: "any?",
199
+ },
200
+ prompt: { prompt: "text", model: "string?", if: "string?", timeout: "seconds?", statusMessage: "string?", once: "boolean?", continueOnBlock: "boolean?" },
201
+ agent: { prompt: "text", model: "string?", if: "string?", timeout: "seconds?", statusMessage: "string?", once: "boolean?" },
202
+ http: { url: "text", headers: "stringRecord?", allowedEnvVars: "stringList?", onFailure: "onFailure?", if: "string?", timeout: "seconds?", statusMessage: "string?", once: "boolean?", cloud: "any?" },
203
+ mcp_tool: { server: "string", tool: "string", input: "record?", if: "string?", timeout: "seconds?", statusMessage: "string?", once: "boolean?" },
147
204
  };
148
205
  // ── classification vocabulary ──────────────────────────────────────────────────────────────────────────────
149
206
  /** What happened to a document's hooks: all loaded / loaded with pieces dropped / the document rejected (nothing in it applies). */
@@ -338,6 +395,8 @@ function hookFieldFits(base, value) {
338
395
  switch (base) {
339
396
  case "text":
340
397
  return typeof value === "string" && value.length > 0 && !value.includes("\0");
398
+ case "nonEmpty":
399
+ return typeof value === "string" && value.length > 0;
341
400
  case "string":
342
401
  return typeof value === "string";
343
402
  case "shell":
@@ -366,6 +425,8 @@ function hookFieldFits(base, value) {
366
425
  return true;
367
426
  case "onFailure":
368
427
  return typeof value === "string" && Object.hasOwn(HOOK_ON_FAILURE_ACCEPTED, value);
428
+ case "any":
429
+ return true;
369
430
  case "record":
370
431
  return hookIsRecord(value);
371
432
  default: {
@@ -379,9 +440,9 @@ function hookEntryRead(entry) {
379
440
  if (!hookIsRecord(entry))
380
441
  return {};
381
442
  const type = Object.hasOwn(entry, "type") ? entry.type : undefined;
382
- if (typeof type !== "string" || !Object.hasOwn(HOOK_ENTRY_FIELDS, type))
443
+ if (typeof type !== "string" || !Object.hasOwn(HOOK_ENTRY_FIELDS_READ, type))
383
444
  return { field: "type" };
384
- const fields = HOOK_ENTRY_FIELDS[type];
445
+ const fields = HOOK_ENTRY_FIELDS_READ[type];
385
446
  const out = { type };
386
447
  for (const field of Object.keys(fields)) {
387
448
  const kind = fields[field];
package/dist/types.d.ts CHANGED
@@ -162,6 +162,27 @@ export declare const ModelTier: z.ZodEnum<{
162
162
  premium: "premium";
163
163
  }>;
164
164
  export type ModelTier = z.infer<typeof ModelTier>;
165
+ /** The reasoning-level words a catalog entry's {@link ModelEntry}`.thinkingLevelMap` is keyed by: `off` plus the six effort tiers. A mirror of the
166
+ * engine's `ModelThinkingLevel`, which exists only as a type — so the mirror is held at compile time by the upstream-drift gate (both directions: the
167
+ * engine adds or drops a word ⇒ `tsc` is red), not copied a second time anywhere else. The schema of the map ({@link ModelThinkingLevelMap}) mints its
168
+ * keys from this table. */
169
+ export declare const MODEL_THINKING_LEVEL_WORDS: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
170
+ /** One word of {@link MODEL_THINKING_LEVEL_WORDS}. */
171
+ export type ModelThinkingLevel = (typeof MODEL_THINKING_LEVEL_WORDS)[number];
172
+ /** A catalog entry's per-level wire values — the engine's `Model.thinkingLevelMap`. Every key is optional, the key set is CLOSED
173
+ * ({@link MODEL_THINKING_LEVEL_WORDS}), and an unknown key refuses the whole map (`.strict()`): a misspelt level name is not stripped, because
174
+ * stripping "this level cannot be turned off" reads as "this level behaves as usual". The refusal lands on the entry that carries the map (the schema
175
+ * face: a bad form is a bad entry), not on this object alone. */
176
+ export declare const ModelThinkingLevelMap: z.ZodObject<{
177
+ off: z.ZodOptional<z.ZodNullable<z.ZodString>>;
178
+ minimal: z.ZodOptional<z.ZodNullable<z.ZodString>>;
179
+ low: z.ZodOptional<z.ZodNullable<z.ZodString>>;
180
+ medium: z.ZodOptional<z.ZodNullable<z.ZodString>>;
181
+ high: z.ZodOptional<z.ZodNullable<z.ZodString>>;
182
+ xhigh: z.ZodOptional<z.ZodNullable<z.ZodString>>;
183
+ max: z.ZodOptional<z.ZodNullable<z.ZodString>>;
184
+ }, z.core.$strict>;
185
+ export type ModelThinkingLevelMap = z.infer<typeof ModelThinkingLevelMap>;
165
186
  export declare const ModelEntry: z.ZodObject<{
166
187
  name: z.ZodString;
167
188
  id: z.ZodString;
@@ -185,6 +206,15 @@ export declare const ModelEntry: z.ZodObject<{
185
206
  }>>;
186
207
  reasoning: z.ZodOptional<z.ZodBoolean>;
187
208
  vision: z.ZodOptional<z.ZodBoolean>;
209
+ thinkingLevelMap: z.ZodOptional<z.ZodObject<{
210
+ off: z.ZodOptional<z.ZodNullable<z.ZodString>>;
211
+ minimal: z.ZodOptional<z.ZodNullable<z.ZodString>>;
212
+ low: z.ZodOptional<z.ZodNullable<z.ZodString>>;
213
+ medium: z.ZodOptional<z.ZodNullable<z.ZodString>>;
214
+ high: z.ZodOptional<z.ZodNullable<z.ZodString>>;
215
+ xhigh: z.ZodOptional<z.ZodNullable<z.ZodString>>;
216
+ max: z.ZodOptional<z.ZodNullable<z.ZodString>>;
217
+ }, z.core.$strict>>;
188
218
  contextWindow: z.ZodOptional<z.ZodNumber>;
189
219
  maxTokens: z.ZodOptional<z.ZodNumber>;
190
220
  autoCompactTokens: z.ZodOptional<z.ZodNumber>;
@@ -298,6 +328,15 @@ export declare const ModelsConfig: z.ZodObject<{
298
328
  }>>;
299
329
  reasoning: z.ZodOptional<z.ZodBoolean>;
300
330
  vision: z.ZodOptional<z.ZodBoolean>;
331
+ thinkingLevelMap: z.ZodOptional<z.ZodObject<{
332
+ off: z.ZodOptional<z.ZodNullable<z.ZodString>>;
333
+ minimal: z.ZodOptional<z.ZodNullable<z.ZodString>>;
334
+ low: z.ZodOptional<z.ZodNullable<z.ZodString>>;
335
+ medium: z.ZodOptional<z.ZodNullable<z.ZodString>>;
336
+ high: z.ZodOptional<z.ZodNullable<z.ZodString>>;
337
+ xhigh: z.ZodOptional<z.ZodNullable<z.ZodString>>;
338
+ max: z.ZodOptional<z.ZodNullable<z.ZodString>>;
339
+ }, z.core.$strict>>;
301
340
  contextWindow: z.ZodOptional<z.ZodNumber>;
302
341
  maxTokens: z.ZodOptional<z.ZodNumber>;
303
342
  autoCompactTokens: z.ZodOptional<z.ZodNumber>;
@@ -1446,8 +1485,8 @@ export declare const WorkerSpec: z.ZodObject<{
1446
1485
  }>>;
1447
1486
  memory: z.ZodPrefault<z.ZodObject<{
1448
1487
  engine: z.ZodDefault<z.ZodEnum<{
1449
- on: "on";
1450
1488
  off: "off";
1489
+ on: "on";
1451
1490
  }>>;
1452
1491
  backend: z.ZodDefault<z.ZodEnum<{
1453
1492
  file: "file";
@@ -1607,8 +1646,8 @@ export declare const WorkersConfig: z.ZodObject<{
1607
1646
  }>>;
1608
1647
  memory: z.ZodPrefault<z.ZodObject<{
1609
1648
  engine: z.ZodDefault<z.ZodEnum<{
1610
- on: "on";
1611
1649
  off: "off";
1650
+ on: "on";
1612
1651
  }>>;
1613
1652
  backend: z.ZodDefault<z.ZodEnum<{
1614
1653
  file: "file";
@@ -1943,7 +1982,8 @@ export declare const A2aPeerSpec: z.ZodObject<{
1943
1982
  enabled: z.ZodDefault<z.ZodBoolean>;
1944
1983
  }, z.core.$strip>;
1945
1984
  export type A2aPeerSpec = z.infer<typeof A2aPeerSpec>;
1946
- /** `a2a` 域:常驻出站 A2A 对端名册。空 / 缺席 = 不拨任何对端。对端名唯一(重名拒,同 mcp)。 */
1985
+ /** `a2a` 域:常驻出站 A2A 对端名册。空名册 = 不拨任何对端;文档缺席(店 / `config.d`)读作空名册。对端名唯一(重名拒,同 mcp)。
1986
+ * 线上(`GET /effective`)缺席不是空名册:读口不补,{@link EffectiveWire} 上 `a2a` 缺席 = 生产方没发这个域(它的契约早于本域),见 {@link WIRE_CARRIED_DOMAINS}。 */
1947
1987
  export declare const A2aConfig: z.ZodObject<{
1948
1988
  peers: z.ZodPrefault<z.ZodArray<z.ZodObject<{
1949
1989
  name: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
@@ -2401,6 +2441,15 @@ export declare const DOMAIN_SCHEMAS: {
2401
2441
  }>>;
2402
2442
  reasoning: z.ZodOptional<z.ZodBoolean>;
2403
2443
  vision: z.ZodOptional<z.ZodBoolean>;
2444
+ thinkingLevelMap: z.ZodOptional<z.ZodObject<{
2445
+ off: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2446
+ minimal: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2447
+ low: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2448
+ medium: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2449
+ high: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2450
+ xhigh: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2451
+ max: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2452
+ }, z.core.$strict>>;
2404
2453
  contextWindow: z.ZodOptional<z.ZodNumber>;
2405
2454
  maxTokens: z.ZodOptional<z.ZodNumber>;
2406
2455
  autoCompactTokens: z.ZodOptional<z.ZodNumber>;
@@ -2718,8 +2767,8 @@ export declare const DOMAIN_SCHEMAS: {
2718
2767
  }>>;
2719
2768
  memory: z.ZodPrefault<z.ZodObject<{
2720
2769
  engine: z.ZodDefault<z.ZodEnum<{
2721
- on: "on";
2722
2770
  off: "off";
2771
+ on: "on";
2723
2772
  }>>;
2724
2773
  backend: z.ZodDefault<z.ZodEnum<{
2725
2774
  file: "file";
@@ -3157,7 +3206,8 @@ export interface EffectiveConfig {
3157
3206
  /** cost/限流族的热更新发布位(0.19.0,消费方 #322 批1)。域缺席 ⇒ `{}`(每一键都 ABSENT =
3158
3207
  * web-admin 不管 ⇒ 消费方回 env 底);11.0.0 起五个限额键的唯一位。 */
3159
3208
  limits: LimitsConfig;
3160
- /** 常驻出站 A2A 对端名册(18.0.0)。域缺席 ⇒ `{ peers: [] }`(缺席 ≡ 空表:不拨任何对端);header 值只以 env-NAME 引用出现,读方从自己的环境取值。 */
3209
+ /** 常驻出站 A2A 对端名册(18.0.0)。读店 / `config.d` 时文档缺席 ⇒ `{ peers: [] }`(读者即本包,恒懂此域:没写 = 不拨任何对端);header 值只以 env-NAME 引用出现,
3210
+ * 读方从自己的环境取值。线上读形不在此列:{@link EffectiveWire} 上的 `a2a` 是可选的(缺席 = 生产方没发,20.0.0 起不补空名册)。 */
3161
3211
  a2a: A2aConfig;
3162
3212
  }
3163
3213
  /** One provenance source in a key's resolution trail. Two orthogonal axes: the TOC file LAYER, or the TOB
@@ -3261,12 +3311,30 @@ export type EffectiveKey = z.infer<typeof EffectiveKey>;
3261
3311
  * gate is closed), never the storage shape.
3262
3312
  * `sandboxGit` (14.7.0) is the third wire-only key and the third carried verbatim: the sandbox git plane's origin block — web-admin projects it from the
3263
3313
  * deployment's registry, it is NOT a stored domain, so `buildEffective` never produces it and `readEffectiveWire` neither validates nor drops it. Optional with
3264
- * no default (absent = the deployment projects no such block); the ONE seat that judges it is `SandboxGitConfig` (`./sandbox-git`), run by the consumer before use. */
3265
- export type EffectiveWire = Omit<EffectiveConfig, "skills" | "prompts"> & {
3314
+ * no default (absent = the deployment projects no such block); the ONE seat that judges it is `SandboxGitConfig` (`./sandbox-git`), run by the consumer before use.
3315
+ * `a2a` (20.0.0) is optional here too: the wire reader never fabricates a domain the producer did not send — {@link WIRE_CARRIED_DOMAINS} is the one table of
3316
+ * domains carried by presence (absent on the wire ⇒ absent here; a producer whose contract predates the domain does not send it), every other domain is
3317
+ * sent by every supported producer and reads as the contract default when absent. */
3318
+ export type EffectiveWire = Omit<EffectiveConfig, "skills" | WireCarriedDomain> & {
3266
3319
  skills: SkillsManifest;
3267
3320
  prompts?: unknown;
3268
3321
  sandboxGit?: unknown;
3322
+ } & {
3323
+ [K in Exclude<WireCarriedDomain, "prompts">]?: EffectiveConfig[K];
3269
3324
  };
3325
+ /**
3326
+ * **线上读口不编造生产方没发的域**(20.0.0)—— 按在场性承运的域的唯一一张表。表里的域在 `GET /effective` 载荷上缺席 ⇒ `readEffectiveWire` 的读出形里
3327
+ * 同样缺席({@link EffectiveWire} 上可选:缺席 = 生产方没发这个域,它的契约早于本域,或它刻意不发);在场 ⇒ 照该域既有读法。在场判据只有一个:
3328
+ * 载荷的**自有键,且值不是 `undefined`**(与 `parseDomain`「只有 undefined 是缺席」同律 —— JSON 载荷里没有 undefined,嵌入方传的 `undefined` 与没写同读)。
3329
+ * · `prompts`:线上形是发布形 {@link EffectivePromptsWire},读口原样承运、由消费方判(发布闸关 / 没有发布 = 不发,缺席是常态形);
3330
+ * · `a2a`:在场 ⇒ 照域读法(解析、逐条抢救、整域读不进 ⇒ `{ peers: [] }` + `domain-defaulted`)。缺席 ≠ 空名册 —— 18.0.0 之前的生产方不懂此域,不发它;
3331
+ * 18.0.0 起 `buildEffective` 恒物化 a2a,所以 ≥ 18.0.0 的中心恒发(没存文档也发 `{ peers: [] }`):线上缺席 ⇔ 生产方不懂此域。
3332
+ * 不在表里的域在 1.0.0 起就在域表上,支持面内的每个生产方都恒发;线上缺席读作契约缺省(与读店同一份缺省)。**之后加进域表的域进这张表**:
3333
+ * 比它旧的生产方必不发它,物化它就是替生产方编造一份「说了空」。读店 / 读 `config.d`(`EffectiveConfig`)不在本律内:那两腿的读者就是本包,恒懂每个域。
3334
+ */
3335
+ export declare const WIRE_CARRIED_DOMAINS: readonly ["prompts", "a2a"];
3336
+ /** {@link WIRE_CARRIED_DOMAINS} 的成员。 */
3337
+ export type WireCarriedDomain = (typeof WIRE_CARRIED_DOMAINS)[number];
3270
3338
  /** Reserved audit "domain" for RBAC/user-management events (not a config domain → no snapshot, not
3271
3339
  * rollback-able). Lets user changes share the one audit stream the Audit page already renders. */
3272
3340
  export declare const RBAC_AUDIT = "rbac";
package/dist/types.js CHANGED
@@ -479,6 +479,21 @@ export const PARSE_TRANSPARENT_KEYS = [
479
479
  * places that name it (`ModelEntry.tier`, `RoleTarget.select.tier`). Not the tier-group ladder of {@link TierBindings}
480
480
  * (`ultra` … `lite`), which binds model NAMES to rungs. */
481
481
  export const ModelTier = z.enum(["cheap", "standard", "premium"]);
482
+ /** The reasoning-level words a catalog entry's {@link ModelEntry}`.thinkingLevelMap` is keyed by: `off` plus the six effort tiers. A mirror of the
483
+ * engine's `ModelThinkingLevel`, which exists only as a type — so the mirror is held at compile time by the upstream-drift gate (both directions: the
484
+ * engine adds or drops a word ⇒ `tsc` is red), not copied a second time anywhere else. The schema of the map ({@link ModelThinkingLevelMap}) mints its
485
+ * keys from this table. */
486
+ export const MODEL_THINKING_LEVEL_WORDS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
487
+ /** What a deployment says one level is called on the wire: a non-empty string = the provider's own value for that level; `null` = this level is not
488
+ * supported on this model. (A level with no key at all = the provider's default. The empty string is not a value — it would put an empty effort on the wire.) */
489
+ const ThinkingLevelSpelling = z.string().min(1).nullable();
490
+ /** A catalog entry's per-level wire values — the engine's `Model.thinkingLevelMap`. Every key is optional, the key set is CLOSED
491
+ * ({@link MODEL_THINKING_LEVEL_WORDS}), and an unknown key refuses the whole map (`.strict()`): a misspelt level name is not stripped, because
492
+ * stripping "this level cannot be turned off" reads as "this level behaves as usual". The refusal lands on the entry that carries the map (the schema
493
+ * face: a bad form is a bad entry), not on this object alone. */
494
+ export const ModelThinkingLevelMap = z
495
+ .object(Object.fromEntries(MODEL_THINKING_LEVEL_WORDS.map((word) => [word, ThinkingLevelSpelling.optional()])))
496
+ .strict();
482
497
  export const ModelEntry = z.object({
483
498
  /** Catalog key + `@name` mention handle (stable, url/word-safe), e.g. "model-a". */
484
499
  name: z.string().min(1).regex(/^[a-z0-9][a-z0-9._-]*$/i, "letters/digits/._- , no spaces"),
@@ -507,6 +522,16 @@ export const ModelEntry = z.object({
507
522
  * absent bit in: reading "not written" as "not capable" is a default only a reader may choose. */
508
523
  reasoning: z.boolean().optional(),
509
524
  vision: z.boolean().optional(),
525
+ /** Per-level wire values for the reasoning knob — the engine's `Model.thinkingLevelMap` (keys {@link MODEL_THINKING_LEVEL_WORDS}; a string is the
526
+ * provider's own value for that level, `null` marks the level unsupported on this model, a missing key = the provider's default). Real need: a
527
+ * deployment on an `anthropic-messages` wire where some level cannot be turned off, or goes by another name — the catalog entry is the seat
528
+ * that declares it; without this key the declaration is stripped at parse on every read leg and never reaches the consumer.
529
+ * THREE-STATE like the capability bits above: ABSENT = not declared (this package never mints `{}`), `{}` = declared with no overrides.
530
+ * **A bad form refuses the WHOLE entry** — an unknown key, a non-object, an empty-string value, a value that is neither a string nor `null`:
531
+ * nothing is stripped and nothing is defaulted (the read legs drop the entry with `entry-dropped` and the rest of the catalog stands as long as the entry is not referenced; an entry that is REFERENCED — named by `roles`, by `atMention.models` in mode `only`, or by `tierGroups[].tiers` — leaves that reference dangling once dropped, and the existing dangling-reference law defaults the WHOLE `models` domain: `domain-defaulted` only, the catalog reads empty, siblings go with it, no `entry-dropped` (any bad referenced entry gets this answer; 19.0.x loaded such an entry and only stripped the key). When no entry of the catalog survives, the existing zero-survivor law gives the same outcome; the document-face read throws; the write gate refuses it). This is the schema
532
+ * face's rule for a closed vocabulary, unlike `compat`'s parse-transparent carry. What each value means on the wire is the reading
533
+ * consumer's call; this package only carries the declaration. */
534
+ thinkingLevelMap: ModelThinkingLevelMap.optional(),
510
535
  contextWindow: INTEGER.positive().optional(),
511
536
  maxTokens: INTEGER.positive().optional(),
512
537
  /** Auto-compaction trigger threshold (tokens) for this model — web-admin 显式下发时本地 FileConfigStore
@@ -2744,7 +2769,8 @@ export const A2aPeerSpec = z.object({
2744
2769
  scenarios: z.array(z.string().min(1)).prefault([]),
2745
2770
  enabled: z.boolean().default(true),
2746
2771
  });
2747
- /** `a2a` 域:常驻出站 A2A 对端名册。空 / 缺席 = 不拨任何对端。对端名唯一(重名拒,同 mcp)。 */
2772
+ /** `a2a` 域:常驻出站 A2A 对端名册。空名册 = 不拨任何对端;文档缺席(店 / `config.d`)读作空名册。对端名唯一(重名拒,同 mcp)。
2773
+ * 线上(`GET /effective`)缺席不是空名册:读口不补,{@link EffectiveWire} 上 `a2a` 缺席 = 生产方没发这个域(它的契约早于本域),见 {@link WIRE_CARRIED_DOMAINS}。 */
2748
2774
  export const A2aConfig = z
2749
2775
  .object({ peers: z.array(A2aPeerSpec).prefault([]) })
2750
2776
  .superRefine((cfg, ctx) => {
@@ -3009,7 +3035,7 @@ export const DOMAIN_SCHEMAS = {
3009
3035
  projects: ProjectsConfig, // 0.10.0: 142-S3 project identity ledger + 无仓铸造权威 (scope=tenant 轴; NOT portable — 租户身份数据)
3010
3036
  prompts: PromptsConfig, // 0.10.18 起;14.0.0 单轴:中心 artifact 的身份(`{ artifact?, workers? }`);13.x 两轴的键是墓碑(SS-M10)
3011
3037
  limits: LimitsConfig, // 0.19.0: cost/限流族热更新发布位(消费方 #322 批1;本地腿闭集缺口的源头修复)
3012
- a2a: A2aConfig, // 18.0.0: 常驻出站 A2A 对端名册(便携;本地腿 config.d/a2a.json 与中心腿 /effective.a2a 同一个声明座)
3038
+ a2a: A2aConfig, // 18.0.0: 常驻出站 A2A 对端名册(便携;本地腿 config.d/a2a.json 与中心腿 /effective.a2a 同一个声明座;线上按在场性承运,见 WIRE_CARRIED_DOMAINS)
3013
3039
  // integrations + access: DELETED in 0.6.0 (EXPERT-REDESIGN §9) — parseDomain/effective/路由随之 404。
3014
3040
  };
3015
3041
  // ── Effective-config PROVENANCE (the unified shape TOC `sema config --effective` and TOB `/effective?principal=`
@@ -3040,6 +3066,17 @@ export const EffectiveKey = z.object({
3040
3066
  lockBehavior: z.enum(["locked", "advisory", "forced-off", "tighten-only"]).optional(),
3041
3067
  sources: z.array(SettingSource).optional(),
3042
3068
  });
3069
+ /**
3070
+ * **线上读口不编造生产方没发的域**(20.0.0)—— 按在场性承运的域的唯一一张表。表里的域在 `GET /effective` 载荷上缺席 ⇒ `readEffectiveWire` 的读出形里
3071
+ * 同样缺席({@link EffectiveWire} 上可选:缺席 = 生产方没发这个域,它的契约早于本域,或它刻意不发);在场 ⇒ 照该域既有读法。在场判据只有一个:
3072
+ * 载荷的**自有键,且值不是 `undefined`**(与 `parseDomain`「只有 undefined 是缺席」同律 —— JSON 载荷里没有 undefined,嵌入方传的 `undefined` 与没写同读)。
3073
+ * · `prompts`:线上形是发布形 {@link EffectivePromptsWire},读口原样承运、由消费方判(发布闸关 / 没有发布 = 不发,缺席是常态形);
3074
+ * · `a2a`:在场 ⇒ 照域读法(解析、逐条抢救、整域读不进 ⇒ `{ peers: [] }` + `domain-defaulted`)。缺席 ≠ 空名册 —— 18.0.0 之前的生产方不懂此域,不发它;
3075
+ * 18.0.0 起 `buildEffective` 恒物化 a2a,所以 ≥ 18.0.0 的中心恒发(没存文档也发 `{ peers: [] }`):线上缺席 ⇔ 生产方不懂此域。
3076
+ * 不在表里的域在 1.0.0 起就在域表上,支持面内的每个生产方都恒发;线上缺席读作契约缺省(与读店同一份缺省)。**之后加进域表的域进这张表**:
3077
+ * 比它旧的生产方必不发它,物化它就是替生产方编造一份「说了空」。读店 / 读 `config.d`(`EffectiveConfig`)不在本律内:那两腿的读者就是本包,恒懂每个域。
3078
+ */
3079
+ export const WIRE_CARRIED_DOMAINS = ["prompts", "a2a"];
3043
3080
  /** Reserved audit "domain" for RBAC/user-management events (not a config domain → no snapshot, not
3044
3081
  * rollback-able). Lets user changes share the one audit stream the Audit page already renders. */
3045
3082
  export const RBAC_AUDIT = "rbac";
@@ -4,9 +4,9 @@
4
4
  > 每次全量重算并逐名比对 —— 加 / 删 / 改形一个导出而不重生成本档 ⇒ 红。导出面的每次变动因此以本档的 diff 出现在评审里。
5
5
  > 形:`value` = 运行期拿得到的值;`type` = 只在类型层;`value+type` = 同名的值与类型(zod schema 与它推出的类型)。
6
6
 
7
- 子路径 24 条(资产出口 `./package.json` / `./fleet-paths.json` 不是模块,不列),导出名合计 1501 个(同名在多条子路径上各计一次)。
7
+ 子路径 24 条(资产出口 `./package.json` / `./fleet-paths.json` 不是模块,不列),导出名合计 1519 个(同名在多条子路径上各计一次)。
8
8
 
9
- ## `.`(785)
9
+ ## `.`(794)
10
10
 
11
11
  - `A2aConfig` — value+type
12
12
  - `A2aPeerSpec` — value+type
@@ -210,6 +210,8 @@
210
210
  - `HOOKS_CLASSIFICATION_OUTCOMES` — value
211
211
  - `HOOKS_DROPPED_PIECE_CODES` — value
212
212
  - `HOOKS_REJECTION_CODES` — value
213
+ - `HOOK_CLOUD_WORDS` — value
214
+ - `HOOK_ENTRY_FIELDS` — value
213
215
  - `HOOK_ENTRY_TYPES` — value
214
216
  - `HOOK_EVENTS` — value
215
217
  - `HOOK_EVENT_MATCHER_FIELD` — value
@@ -222,8 +224,10 @@
222
224
  - `HTTP_URL_PARTS` — value
223
225
  - `HTTP_URL_SHAPE_RULE` — value
224
226
  - `HeldWorkerRow` — type
227
+ - `HookCloud` — type
225
228
  - `HookDecision` — value+type
226
229
  - `HookEntry` — value+type
230
+ - `HookEntryFields` — type
227
231
  - `HookEntryType` — type
228
232
  - `HookEnvBlank` — type
229
233
  - `HookEnvInterpolation` — type
@@ -289,6 +293,7 @@
289
293
  - `MODEL_ENTRY_REFUSAL_CODES` — value
290
294
  - `MODEL_PLANE_REFUSAL_CODES` — value
291
295
  - `MODEL_SWITCH_SOURCES` — value
296
+ - `MODEL_THINKING_LEVEL_WORDS` — value
292
297
  - `MarkedMigrationId` — type
293
298
  - `McpConfig` — value+type
294
299
  - `McpContentOrigin` — type
@@ -318,6 +323,8 @@
318
323
  - `ModelRefusalsSignal` — type
319
324
  - `ModelRefusalsWire` — value+type
320
325
  - `ModelRole` — value+type
326
+ - `ModelThinkingLevel` — type
327
+ - `ModelThinkingLevelMap` — value+type
321
328
  - `ModelTier` — value+type
322
329
  - `ModelsConfig` — value+type
323
330
  - `NON_SECRET_URL` — value
@@ -588,6 +595,7 @@
588
595
  - `WEB_ADMIN_CREDENTIAL_ENVELOPE_KIND` — value
589
596
  - `WEB_ADMIN_ENV` — value
590
597
  - `WEB_ADMIN_JWKS_PATH` — value
598
+ - `WIRE_CARRIED_DOMAINS` — value
591
599
  - `WORKER_NAME` — value
592
600
  - `WORKER_PULL_TOKEN` — value
593
601
  - `WORKER_RESOURCE_PRESETS` — value
@@ -603,6 +611,7 @@
603
611
  - `WebAdminJwk` — value+type
604
612
  - `WebAdminJwks` — value+type
605
613
  - `WebAdminSessionTarget` — type
614
+ - `WireCarriedDomain` — type
606
615
  - `WorkerCondition` — value+type
607
616
  - `WorkerLifecycle` — value+type
608
617
  - `WorkerLifecycleRecord` — type
@@ -794,7 +803,7 @@
794
803
  - `workersReferencingSecret` — value
795
804
  - `wsUrlFlaws` — value
796
805
 
797
- ## `./types`(150)
806
+ ## `./types`(155)
798
807
 
799
808
  - `A2aConfig` — value+type
800
809
  - `A2aPeerSpec` — value+type
@@ -850,6 +859,7 @@
850
859
  - `K8S_QUANTITY` — value
851
860
  - `LimitsConfig` — value+type
852
861
  - `MCP_CONTENT_ORIGINS` — value
862
+ - `MODEL_THINKING_LEVEL_WORDS` — value
853
863
  - `McpConfig` — value+type
854
864
  - `McpContentOrigin` — type
855
865
  - `McpServerSpec` — value+type
@@ -857,6 +867,8 @@
857
867
  - `ModelCost` — value
858
868
  - `ModelEntry` — value+type
859
869
  - `ModelRole` — value+type
870
+ - `ModelThinkingLevel` — type
871
+ - `ModelThinkingLevelMap` — value+type
860
872
  - `ModelTier` — value+type
861
873
  - `ModelsConfig` — value+type
862
874
  - `NON_SECRET_URL` — value
@@ -926,8 +938,10 @@
926
938
  - `TierBindings` — value+type
927
939
  - `TierGroup` — value+type
928
940
  - `TokenQuota` — value+type
941
+ - `WIRE_CARRIED_DOMAINS` — value
929
942
  - `WORKER_NAME` — value
930
943
  - `WORKER_RESOURCE_PRESETS` — value
944
+ - `WireCarriedDomain` — type
931
945
  - `WorkerCondition` — value+type
932
946
  - `WorkerLifecycle` — value+type
933
947
  - `WorkerResourcePreset` — type
@@ -1289,7 +1303,7 @@
1289
1303
  - `parseSchedulerStore` — value
1290
1304
  - `serializeSchedulerStore` — value
1291
1305
 
1292
- ## `./hooks`(96)
1306
+ ## `./hooks`(100)
1293
1307
 
1294
1308
  - `AgentHookEntry` — value+type
1295
1309
  - `AssistantTurnError` — value+type
@@ -1311,14 +1325,18 @@
1311
1325
  - `HOOKS_CLASSIFICATION_OUTCOMES` — value
1312
1326
  - `HOOKS_DROPPED_PIECE_CODES` — value
1313
1327
  - `HOOKS_REJECTION_CODES` — value
1328
+ - `HOOK_CLOUD_WORDS` — value
1329
+ - `HOOK_ENTRY_FIELDS` — value
1314
1330
  - `HOOK_ENTRY_TYPES` — value
1315
1331
  - `HOOK_EVENTS` — value
1316
1332
  - `HOOK_EVENT_MATCHER_FIELD` — value
1317
1333
  - `HOOK_EVENT_OWNER` — value
1318
1334
  - `HOOK_INJECTED_ENV` — value
1319
1335
  - `HOOK_ON_FAILURE_WORDS` — value
1336
+ - `HookCloud` — type
1320
1337
  - `HookDecision` — value+type
1321
1338
  - `HookEntry` — value+type
1339
+ - `HookEntryFields` — type
1322
1340
  - `HookEntryType` — type
1323
1341
  - `HookEnvBlank` — type
1324
1342
  - `HookEnvInterpolation` — type
@@ -1,14 +1,14 @@
1
1
  # CC 偏离登记(本包)
2
2
 
3
3
  本包镜像或对齐 Claude Code(CC)上游的设置语义时,**有意**不照抄的地方逐条登在这里:差在哪(CC 原形与语料坐标 / 本包的形)、哪个方向、为什么、谁读它。
4
- 锚 = CC 2.1.296 语料 `cli296.js`(只 grep,不解包;坐标写行号,行号属于那一份语料,只引不抄);H7 的两个新进字段另引 `cli309.js` 的坐标。
4
+ 锚 = CC 2.1.296 语料 `cli296.js`(只 grep,不解包;坐标写行号,行号属于那一份语料,只引不抄);H7 的条目字段另引 `cli309.js` 的坐标。
5
5
 
6
6
  方向只有两种写法:**更严**(本包拦下 / 不放行 / 不装 CC 会放行或会装的)与**更宽**(本包拦下 CC 不拦的 —— 只出现在拒绝方向)。
7
7
  本包不登「比 CC 更松」的偏离;出现了即是缺陷。
8
8
 
9
9
  ## hooks classifier(`classifyHooksConfig`,`src/hooks-config.ts`)
10
10
 
11
- 七处都只在**更严**的方向上:CC 会装上的文档,这里可能整份不装;反过来的情形不存在。代价都是同一个 —— 一份本可装上的设置文件整份不装(同文件的 `permissions.deny` 一起不生效),所以每条都写了它挡的是什么。
11
+ 这七处都只在**更严**的方向上:CC 会装上的文档,这里可能整份不装;反过来的情形在这七处里不存在(登记表之外的更松面是缺陷,不登在这里,见 CHANGELOG 20.0.0 的已知限制)。代价都是同一个 —— 一份本可装上的设置文件整份不装(同文件的 `permissions.deny` 一起不生效),所以每条都写了它挡的是什么。
12
12
 
13
13
  | # | 本包 | CC 2.1.296 | 为什么 |
14
14
  |---|---|---|---|
@@ -18,9 +18,9 @@
18
18
  | H4 | 已知非守卫事件的值写成一只匹配器(不是数组)⇒ 整份拒 | 剔掉那个键(警告) | 匹配器形本身就是迹象(规则一条,不因事件名分档) |
19
19
  | H5 | 整份文档本身写成一只匹配器(顶层带 `matcher` 键 + 匹配器形)⇒ 整份拒 | 无此判 | 把一只守卫匹配器误贴成整份设置时,CC 剔掉坏的 `hooks` 后照装 |
20
20
  | H6 | `hooks` 是装着**数组**的数组 ⇒ 整份拒(与装对象同判) | 只对装对象 / 装迹象的数组整份拒,装数组的剔掉 | 套一层数组的守卫不该被当成标量剔掉 |
21
- | H7 | 条目字段以本包字段表为准(`HOOK_ENTRY_FIELDS`):command 收 `args`(exec 形参数表;元素另判零 NUL —— `spawn()` 对含 NUL 的参数抛,CC 的串数组不判)、command / http 收 `onFailure`(词表 `HOOK_ON_FAILURE_WORDS` = `continue` \| `block`;缺席不补缺省);其余 CC 独有字段(`cloud` / `continueOnBlock` / `rewakeMessage` / `rewakeSummary` …,CC 标 `@internal` 的键与 prompt 条目的 `continueOnBlock`)不进装上的那一份,也不算坏块 —— `args` 写在 command 以外、`onFailure` 写在 command / http 以外的条目上同属这一类(键下装着守卫迹象的除外:H3,整份拒) | 认得这些字段(`cli309.js:252382`:`args` 只在 command 的 schema 上,`onFailure` 在 command 与 http 的 schema 上) | 契约只收本包定义的字段;`args` / `onFailure` 19.0.0 起进表(此前被剥掉:exec 形条目只剩可执行名去跑,`block` 的守卫起不来照放行);字段级的上游漂移今天没有门(type 集有,见漂移门 ①b) —— 未闭环 |
21
+ | H7 | 条目字段以本包字段表为准(`HOOK_ENTRY_FIELDS`),CC 五型条目 schema 上的每个键都在表里(`cli309.js:252382`):`args`(command;exec 形参数表,元素另判零 NUL —— `spawn()` 对含 NUL 的参数抛,CC 的串数组不判)· `onFailure`(command / http;词表 `HOOK_ON_FAILURE_WORDS` = `continue` \| `block`;缺席不补缺省)· `rewakeMessage` / `rewakeSummary`(command;非空串 —— CC 的 `min(1)`,空白 / 多行 / NUL 都是值)· `cloud`(command / http;**任意值照带** —— CC 的 `.catch("skip")` 没有坏值,词表 `HOOK_CLOUD_WORDS` = `device` \| `skip` 只是读者折法的参考)· `continueOnBlock`(prompt;布尔)。`args` / `onFailure` / `rewakeMessage` / `rewakeSummary` / `continueOnBlock` 的坏值一律是坏块(不剥键、不折默认);写在 CC 的 schema 没有它的型上、或 CC 不认识的键,仍是契约外的键(剥掉,不算坏块;键下装着守卫迹象的除外:H3,整份拒) | 认得这些字段,逐键同归属型(`cli309.js:252382`:`args` 只在 command,`onFailure` 与 `cloud` 在 command 与 http,`rewakeMessage` / `rewakeSummary` 只在 command,`continueOnBlock` 只在 prompt);`cloud` 的任何值都合法 | 契约只收本包定义的字段;`args` / `onFailure` 19.0.0 起进表、另四键 20.0.0 起进表(此前被剥掉:exec 形条目只剩可执行名去跑,`block` 的守卫起不来照放行,守卫事件里 `rewakeMessage: ""` / 非布尔 `continueOnBlock` 照装 —— 比 CC 松,这一条随 20.0.0 收了);字段级的上游漂移今天没有门(type 集有,见漂移门 ①b)—— 未闭环 |
22
22
 
23
- 不是偏差的(与 CC 同):守卫事件集 {`PreToolUse`, `PermissionRequest`};守卫事件值 `null` = 剔不拒;非守卫事件里坏匹配器 / 坏条目逐个剔;hook 条目 type 五种。
23
+ 不是偏差的(与 CC 同):守卫事件集 {`PreToolUse`, `PermissionRequest`};守卫事件值 `null` = 剔不拒;非守卫事件里坏匹配器 / 坏条目逐个剔;hook 条目 type 五种;command / http 条目的 `cloud` 任意值照带(CC 的 `.catch("skip")` 接住任何值、读作 `skip`、文件照装,折在读者;本包不判、不折、不剥)。
24
24
 
25
25
  ## URL 名单与 http hook 名单(`src/url-pattern.ts` / `src/http-hook-allowlists.ts`)
26
26
 
@@ -215,7 +215,7 @@ sema-test 的读数,是本仓自己重跑 `node scripts/conformance-historical.m
215
215
 
216
216
  | id | 影响的腿 | 动了什么 |
217
217
  |---|---|---|
218
- | `T1-prompts-materialisation` | wire | `buildEffective` 恒物化 `prompts`(缺席 ⇒ `{}`;14.0.0 前是 `{bindings:[]}`);wire 按**在场性** verbatim 挂回(缺席进缺席出,且在场时是**未解析的原文档**) |
218
+ | `T1-wire-carried-domains` | wire | `buildEffective` 恒物化每个域;wire 对承运表 `WIRE_CARRIED_DOMAINS`(`prompts`、`a2a`)按**在场性**挂回 —— 线上读口不编造生产方没发的域:缺席进缺席出;在场时 `prompts` 是**未解析的原文档**,`a2a` 是域腿读数。**由常量派生,不手抄域名**;覆盖律要求表里每个域都有语料让两腿在它上面真的分开 |
219
219
  | `T2-skills-representation` | wire | 域形带 `content`,wire 形带 `contentHash`(manifest);判据 schema 随表示走,于是 wire 腿**没有** skills 的剥键告警 |
220
220
  | `T3-non-portable-domains` | local-root | `config.d/` 只读 `PORTABLE_DOMAINS`;其余域取 schema 默认 + `unread-config-file{non-portable-domain}`。**由常量派生,不手抄域名** |
221
221
  | `T4-unknown-top-level-key` | wire + local-root | wire 是 open-world,不认识的顶层键**逐字承运**;`domains` 腿按域名取文档故无声;local-root 报 `unread-config-file{not-a-domain}` |