@sema-agent/settings-schema 12.2.1 → 13.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 +223 -0
- package/README.md +41 -6
- package/conformance/VERSION +1 -1
- package/conformance/cases/c01-entry-salvage-then-typo/expected.json +1 -3
- package/conformance/cases/c03-literal-dotted-top-key/expected.json +4 -12
- package/conformance/cases/c10-record-key-secret-redacted-twice/expected.json +1 -3
- package/conformance/cases/c23-mixed-validity-models/expected.json +2 -6
- package/conformance/cases/c24-valid-entries-with-unknown-keys/expected.json +2 -6
- package/conformance/cases/c25-published-roundtrip-zero-warnings/expected.json +2 -6
- package/conformance/cases/c30-version-triple-a-first/expected.json +2 -6
- package/conformance/cases/c31-version-triple-b-changed/expected.json +2 -6
- package/conformance/cases/c32-version-triple-a-restored/expected.json +2 -6
- package/conformance/cases/c40-s712-identity-only-what-reads-out/expected.json +1 -3
- package/conformance/cases/c41-s792-encoded-pem-identity/expected.json +1 -3
- package/conformance/cases/c42-s792-unknown-key-secret-redacted/expected.json +2 -6
- package/conformance/cases/c43-s792-form-and-deep-encoded-pem/expected.json +1 -3
- package/conformance/cases/c44-s792-utf8-escape-glued-token/expected.json +1 -3
- package/conformance/cases/c45-s792-identity-bounds-and-decode-depth/expected.json +1 -3
- package/conformance/cases/c47-s811-roles-key-url-userinfo-withheld/expected.json +1 -3
- package/conformance/cases/c48-s935-model-headers-transported/expected.json +6 -18
- package/conformance/cases/c49-s935-model-headers-secret-entry-dropped/expected.json +1 -3
- package/conformance/cases/c69-deep-encoded-token-past-every-reading/expected.json +1 -3
- package/conformance/cases/c70-rewritten-token-in-front-of-encoded-pem-header/expected.json +1 -3
- package/conformance/cases/c72-dangling-reference-write-seat-refuses/expected.json +1 -3
- package/conformance/cases/c76-projects-entry-salvage-nested/expected.json +142 -0
- package/conformance/cases/c76-projects-entry-salvage-nested/input.json +54 -0
- package/conformance/cases/c76-projects-entry-salvage-nested/meta.json +6 -0
- package/conformance/cases/cc03-model-compat-unknown-subkey/expected.json +2 -6
- package/conformance/cases/cli01-model-name-nfc-vs-nfd/expected.json +1 -3
- package/conformance/cases/cli02-control-and-zero-width-chars/expected.json +1 -3
- package/conformance/cases/cli05-long-and-prefix-colliding-names/expected.json +6 -18
- package/conformance/cases/t01-absent-domain-key-not-null/expected.json +1 -3
- package/conformance/cases/t03-prototype-name-key-not-swallowed/expected.json +2 -6
- package/conformance/cases/t04-secret-literal-never-in-warning-value/expected.json +1 -3
- package/dist/config-fns.d.ts +94 -8
- package/dist/config-fns.js +254 -116
- package/dist/hooks-config.d.ts +235 -0
- package/dist/hooks-config.js +458 -0
- package/dist/hooks.d.ts +16 -154
- package/dist/hooks.js +17 -111
- package/dist/http-hook-allowlists.d.ts +63 -0
- package/dist/http-hook-allowlists.js +73 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6 -1
- package/dist/mcp-server-policy.d.ts +75 -0
- package/dist/mcp-server-policy.js +84 -0
- package/dist/safety-merge-spec.d.ts +13 -3
- package/dist/safety-merge-spec.js +10 -3
- package/dist/settings-sources.d.ts +91 -0
- package/dist/settings-sources.js +107 -0
- package/dist/types.d.ts +6 -6
- package/dist/types.js +9 -5
- package/dist/ui-language.d.ts +40 -0
- package/dist/ui-language.js +37 -0
- package/dist/url-pattern.d.ts +33 -0
- package/dist/url-pattern.js +239 -0
- package/package.json +1 -1
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `hooks-config` — the hooks CONFIG surface: what a settings document's `hooks` key may carry (the shape `TaskRequest.settings.hooks`
|
|
3
|
+
* carries on the wire and the shell reads from settings JSON: `{ [eventName]: [{ matcher?, hooks: [entry, …] }] }`).
|
|
4
|
+
* Re-exported whole by `./hooks` (and the main barrel) — this file is where the surface is DEFINED, `./hooks` is where it is imported from.
|
|
5
|
+
*
|
|
6
|
+
* ONE READER. "Can this document's hooks be loaded, and which pieces must go?" has one answer: {@link classifyHooksConfig}. The zod faces
|
|
7
|
+
* below ({@link HooksConfig}, {@link HookMatcherEntry}, {@link HookEntry} and the per-type five) are its PROJECTIONS — accepted ⇔ the
|
|
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).
|
|
11
|
+
*
|
|
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
|
+
* · Outside the guard events, a bad piece is DROPPED alone (the rest of the document — its `permissions.deny`, its `env` — still applies).
|
|
14
|
+
* · The GUARD events are `PreToolUse` and `PermissionRequest` (CC's `SV`): their hooks may be what guards the permissions declared beside
|
|
15
|
+
* them, so ANY bad piece in a guard event REJECTS the whole document (nothing in it is applied), except a guard event whose value is
|
|
16
|
+
* `null` — that one is dropped (CC: a warning, the key is removed).
|
|
17
|
+
* · A GUARD SIGN is an object member keyed by a guard-event name whose value is not null / undefined / `[]`, or a matcher-shaped object
|
|
18
|
+
* (`{ matcher?, hooks }` holding a non-empty `hooks` array, or a single entry under `hooks` with `matcher` present or a string `type`) in
|
|
19
|
+
* any place other than a matcher's legal place (an element of the array under an event name). String VALUES are not scanned: a value
|
|
20
|
+
* that merely spells `PreToolUse` is not a sign. A piece holding a sign is never dropped — dropping it could make a misplaced guard vanish —
|
|
21
|
+
* the document is rejected instead, wherever the sign sits: outside `hooks`, under an unknown event, in a non-array event value, in a matcher's
|
|
22
|
+
* or an entry's fields (including fields the contract does not know and would otherwise not carry).
|
|
23
|
+
*
|
|
24
|
+
* CC 2.1.296 DIVERGENCES (each in the stricter direction — a document CC would load may be rejected here, never the reverse): listed once,
|
|
25
|
+
* in `docs/CC-DIVERGENCE.md` (section "hooks classifier", H1–H7) — the whole-subtree guard-sign scan is the first of them.
|
|
26
|
+
*
|
|
27
|
+
* 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
|
|
28
|
+
* anything, a pasted credential included: pass a coordinate through `outgoingPath` before it leaves the process (log, UI, wire). The classifier
|
|
29
|
+
* echoes no values and writes no sentences — the sentences are the consumers' (same law as `DROPPED_ENTRY_REASON_CODES`).
|
|
30
|
+
*
|
|
31
|
+
* SELF-CONTAINED. {@link classifyHooksConfig} and the module-private declarations it uses reference nothing outside themselves except
|
|
32
|
+
* {@link HOOK_EVENTS} and JavaScript built-ins (no zod): a consumer that copies the function into its own bundle (client-core's generator
|
|
33
|
+
* does, with the private declarations it uses) copies one closure plus the event vocabulary. The hooks-classify test file (group ⑤) holds this.
|
|
34
|
+
*
|
|
35
|
+
* Input is a settings document as parsed from JSON. Values JSON cannot produce (accessors, class instances, cycles) are not part of the
|
|
36
|
+
* contract; cycles are tolerated, a throwing accessor propagates.
|
|
37
|
+
*/
|
|
38
|
+
import { z } from "zod";
|
|
39
|
+
import type { ConfigPath } from "./config-fns.js";
|
|
40
|
+
/** The full 33-event contract set = CC 198's 27 + the 6 post-198 events — the one exported closed set of hook event names. */
|
|
41
|
+
export declare const HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "PostToolUseFailure", "PostToolBatch", "Notification", "UserPromptSubmit", "UserPromptExpansion", "SessionStart", "SessionEnd", "Stop", "StopFailure", "SubagentStart", "SubagentStop", "PreCompact", "PostCompact", "PermissionRequest", "PermissionDenied", "Setup", "TeammateIdle", "TaskCreated", "TaskCompleted", "Elicitation", "ElicitationResult", "ConfigChange", "WorktreeCreate", "WorktreeRemove", "InstructionsLoaded", "CwdChanged", "FileChanged", "MessageDisplay", "DirectoryAdded", "PreModelSwitch", "PostModelSwitch"];
|
|
42
|
+
/** One hook event name (the same union as `./hooks`' `HookEventName`, which is the zod enum over {@link HOOK_EVENTS}). */
|
|
43
|
+
type HookEventWord = (typeof HOOK_EVENTS)[number];
|
|
44
|
+
/**
|
|
45
|
+
* The hook entry `type` closed set — CC 2.1.296's five (`cli296.js:237454`): `command` (shell command on the host that runs the hook),
|
|
46
|
+
* `prompt` (one-shot LLM evaluation of the hook input), `agent` (agentic verifier loop), `http` (POST the hook input to a URL),
|
|
47
|
+
* `mcp_tool` (call a tool on an already-configured MCP server). An entry of another type is a bad piece — and in a guard event that rejects
|
|
48
|
+
* the whole document, which is why `test/upstream-drift.test.ts` ①b holds this set against the CC anchor snapshot.
|
|
49
|
+
*/
|
|
50
|
+
export declare const HOOK_ENTRY_TYPES: readonly ["command", "prompt", "agent", "http", "mcp_tool"];
|
|
51
|
+
export type HookEntryType = (typeof HOOK_ENTRY_TYPES)[number];
|
|
52
|
+
/** `shell` values: 'bash' = the user's $SHELL family; 'powershell' = pwsh. Default bash. */
|
|
53
|
+
declare const HOOK_SHELLS: readonly ["bash", "powershell"];
|
|
54
|
+
/**
|
|
55
|
+
* THE field table of a hook entry, per type — read by {@link classifyHooksConfig} (which field is bad, what is carried) and by the entry
|
|
56
|
+
* types below (derived from it). Field order = the order a loaded entry's keys come out in.
|
|
57
|
+
* · command: `shell` (see above), `async` = run in background without blocking, `asyncRewake` = background + wake the model on exit 2;
|
|
58
|
+
* · prompt / agent: `prompt` ($ARGUMENTS = the hook input JSON), `model`;
|
|
59
|
+
* · http: `url`, `headers` (values may reference $NAMEs listed in `allowedEnvVars` — env-NAME interpolation only, the config never carries a
|
|
60
|
+
* secret value; `interpolateHookEnvVars` is the one reading), `allowedEnvVars`;
|
|
61
|
+
* · mcp_tool: `server` (an already-configured MCP server's name), `tool`, `input` (the tool's arguments; string values may interpolate
|
|
62
|
+
* `${path}` from the hook input JSON — CC 2.1.296 semantics, the runner's business).
|
|
63
|
+
*/
|
|
64
|
+
declare const HOOK_ENTRY_FIELDS: {
|
|
65
|
+
readonly command: {
|
|
66
|
+
readonly if: "string?";
|
|
67
|
+
readonly timeout: "seconds?";
|
|
68
|
+
readonly statusMessage: "string?";
|
|
69
|
+
readonly once: "boolean?";
|
|
70
|
+
readonly command: "text";
|
|
71
|
+
readonly shell: "shell?";
|
|
72
|
+
readonly async: "boolean?";
|
|
73
|
+
readonly asyncRewake: "boolean?";
|
|
74
|
+
};
|
|
75
|
+
readonly prompt: {
|
|
76
|
+
readonly if: "string?";
|
|
77
|
+
readonly timeout: "seconds?";
|
|
78
|
+
readonly statusMessage: "string?";
|
|
79
|
+
readonly once: "boolean?";
|
|
80
|
+
readonly prompt: "text";
|
|
81
|
+
readonly model: "string?";
|
|
82
|
+
};
|
|
83
|
+
readonly agent: {
|
|
84
|
+
readonly if: "string?";
|
|
85
|
+
readonly timeout: "seconds?";
|
|
86
|
+
readonly statusMessage: "string?";
|
|
87
|
+
readonly once: "boolean?";
|
|
88
|
+
readonly prompt: "text";
|
|
89
|
+
readonly model: "string?";
|
|
90
|
+
};
|
|
91
|
+
readonly http: {
|
|
92
|
+
readonly if: "string?";
|
|
93
|
+
readonly timeout: "seconds?";
|
|
94
|
+
readonly statusMessage: "string?";
|
|
95
|
+
readonly once: "boolean?";
|
|
96
|
+
readonly url: "text";
|
|
97
|
+
readonly headers: "stringRecord?";
|
|
98
|
+
readonly allowedEnvVars: "stringList?";
|
|
99
|
+
};
|
|
100
|
+
readonly mcp_tool: {
|
|
101
|
+
readonly if: "string?";
|
|
102
|
+
readonly timeout: "seconds?";
|
|
103
|
+
readonly statusMessage: "string?";
|
|
104
|
+
readonly once: "boolean?";
|
|
105
|
+
readonly server: "string";
|
|
106
|
+
readonly tool: "string";
|
|
107
|
+
readonly input: "record?";
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
type HookFieldBaseValue<B> = B extends "text" | "string" ? string : B extends "shell" ? (typeof HOOK_SHELLS)[number] : B extends "boolean" ? boolean : B extends "seconds" ? number : B extends "stringRecord" ? Record<string, string> : B extends "stringList" ? string[] : B extends "record" ? Record<string, unknown> : never;
|
|
111
|
+
type HookFieldValue<K> = K extends `${infer B}?` ? HookFieldBaseValue<B> : HookFieldBaseValue<K>;
|
|
112
|
+
type Flat<O> = {
|
|
113
|
+
[K in keyof O]: O[K];
|
|
114
|
+
};
|
|
115
|
+
/** One entry type's shape, derived from {@link HOOK_ENTRY_FIELDS}: `type` + required fields + optional (`?`) fields. */
|
|
116
|
+
type HookEntryOf<T extends HookEntryType, F = (typeof HOOK_ENTRY_FIELDS)[T]> = Flat<{
|
|
117
|
+
type: T;
|
|
118
|
+
} & {
|
|
119
|
+
-readonly [K in keyof F as F[K] extends `${string}?` ? never : K]: HookFieldValue<F[K]>;
|
|
120
|
+
} & {
|
|
121
|
+
-readonly [K in keyof F as F[K] extends `${string}?` ? K : never]?: HookFieldValue<F[K]>;
|
|
122
|
+
}>;
|
|
123
|
+
/** `command` — shell command on the host that runs the hook (DESIGN POINT ② in `./hooks`). */
|
|
124
|
+
export type CommandHookEntry = HookEntryOf<"command">;
|
|
125
|
+
/** `prompt` — one-shot LLM evaluation of the hook input ($ARGUMENTS = input JSON). */
|
|
126
|
+
export type PromptHookEntry = HookEntryOf<"prompt">;
|
|
127
|
+
/** `agent` — agentic verifier loop over the hook input ($ARGUMENTS = input JSON). */
|
|
128
|
+
export type AgentHookEntry = HookEntryOf<"agent">;
|
|
129
|
+
/** `http` — POST the hook input JSON to a URL. */
|
|
130
|
+
export type HttpHookEntry = HookEntryOf<"http">;
|
|
131
|
+
/** `mcp_tool` — call `tool` on the already-configured MCP server `server` with `input`. */
|
|
132
|
+
export type McpToolHookEntry = HookEntryOf<"mcp_tool">;
|
|
133
|
+
/** One configured hook (CC settings shape + shell superset fields; discriminated on `type`). */
|
|
134
|
+
export type HookEntry = {
|
|
135
|
+
[T in HookEntryType]: HookEntryOf<T>;
|
|
136
|
+
}[HookEntryType];
|
|
137
|
+
/** One matcher group: `matcher` (read by `hookMatcherSelects` — name list or unanchored JS regex; empty/`*`/absent matches everything) +
|
|
138
|
+
* the hooks it fires. */
|
|
139
|
+
export type HookMatcherEntry = {
|
|
140
|
+
matcher?: string;
|
|
141
|
+
hooks: HookEntry[];
|
|
142
|
+
};
|
|
143
|
+
/** The hooks config record: keys limited to the {@link HOOK_EVENTS} contract events, all optional. */
|
|
144
|
+
export type HooksConfig = Partial<Record<HookEventWord, HookMatcherEntry[]>>;
|
|
145
|
+
/** What happened to a document's hooks: all loaded / loaded with pieces dropped / the document rejected (nothing in it applies). */
|
|
146
|
+
export declare const HOOKS_CLASSIFICATION_OUTCOMES: readonly ["loaded", "loaded-partial", "rejected"];
|
|
147
|
+
export type HooksClassificationOutcome = (typeof HOOKS_CLASSIFICATION_OUTCOMES)[number];
|
|
148
|
+
/**
|
|
149
|
+
* Why a piece was DROPPED (closed; one word per level of piece, no `other`):
|
|
150
|
+
* · `hooks-not-object` — `hooks` is null / a scalar / an array holding only scalars ⇒ the whole `hooks` key goes;
|
|
151
|
+
* · `unknown-event` — a key under `hooks` that is not a {@link HOOK_EVENTS} name;
|
|
152
|
+
* · `event-not-array` — a known event whose value is not an array (for a guard event: only `null`);
|
|
153
|
+
* · `matcher-invalid` — a matcher that is not an object, whose `matcher` is not a string or whose `hooks` is not an array (non-guard event);
|
|
154
|
+
* · `entry-invalid` — an entry that is not an object, has no / an unknown `type`, or a field outside its kind (non-guard event).
|
|
155
|
+
*/
|
|
156
|
+
export declare const HOOKS_DROPPED_PIECE_CODES: readonly ["hooks-not-object", "unknown-event", "event-not-array", "matcher-invalid", "entry-invalid"];
|
|
157
|
+
export type HooksDroppedPieceCode = (typeof HOOKS_DROPPED_PIECE_CODES)[number];
|
|
158
|
+
/**
|
|
159
|
+
* Why the document was REJECTED (closed; each is "a guard may be in this piece"):
|
|
160
|
+
* · `guard-outside-hooks` — a guard sign outside `hooks` (top level, under another key, or the document itself matcher-shaped);
|
|
161
|
+
* · `hooks-is-matcher` — `hooks` is an array holding objects / arrays, a single matcher, or a single entry;
|
|
162
|
+
* · `guard-under-unknown-event` — an unknown event name holding a guard sign;
|
|
163
|
+
* · `guard-event-not-array` — a guard event whose value is not an array (and not null), or a known event whose non-array value holds a sign;
|
|
164
|
+
* · `guard-matcher-invalid` — a bad matcher in a guard event, or a matcher holding a sign (in any event);
|
|
165
|
+
* · `guard-entry-invalid` — a bad entry in a guard event, or an entry holding a sign (in any event).
|
|
166
|
+
*/
|
|
167
|
+
export declare const HOOKS_REJECTION_CODES: readonly ["guard-outside-hooks", "hooks-is-matcher", "guard-under-unknown-event", "guard-event-not-array", "guard-matcher-invalid", "guard-entry-invalid"];
|
|
168
|
+
export type HooksRejectionCode = (typeof HOOKS_REJECTION_CODES)[number];
|
|
169
|
+
/** One dropped piece: `path` = its coordinate (raw segments — see the file header on `outgoingPath`); `field` = for a matcher / entry, the
|
|
170
|
+
* contract field whose value is wrong (`"type"` when the type is missing or unknown; absent when the piece is not an object at all). */
|
|
171
|
+
export interface HooksDroppedPiece {
|
|
172
|
+
readonly code: HooksDroppedPieceCode;
|
|
173
|
+
readonly path: ConfigPath;
|
|
174
|
+
readonly field?: string;
|
|
175
|
+
}
|
|
176
|
+
/** One reason the document was rejected: `path` = the offending piece (for `guard-outside-hooks`: the guard sign itself); `field` as above. */
|
|
177
|
+
export interface HooksRejection {
|
|
178
|
+
readonly code: HooksRejectionCode;
|
|
179
|
+
readonly path: ConfigPath;
|
|
180
|
+
readonly field?: string;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* What {@link classifyHooksConfig} answers. `hooks` = what loads: the `hooks` value with every dropped piece removed and every entry carrying
|
|
184
|
+
* only its contract fields; `undefined` when the document has no `hooks` key, when `hooks` itself was dropped, and always when rejected.
|
|
185
|
+
* Invariants (by construction): `loaded` ⇔ nothing dropped or rejected; `loaded-partial` ⇔ dropped pieces, no rejection; `rejected` ⇔ at
|
|
186
|
+
* least one rejection (dropped is then empty — nothing in the document applies).
|
|
187
|
+
*/
|
|
188
|
+
export type HooksClassification = {
|
|
189
|
+
readonly outcome: "loaded";
|
|
190
|
+
readonly hooks: HooksConfig | undefined;
|
|
191
|
+
readonly dropped: readonly [];
|
|
192
|
+
readonly rejections: readonly [];
|
|
193
|
+
} | {
|
|
194
|
+
readonly outcome: "loaded-partial";
|
|
195
|
+
readonly hooks: HooksConfig | undefined;
|
|
196
|
+
readonly dropped: readonly HooksDroppedPiece[];
|
|
197
|
+
readonly rejections: readonly [];
|
|
198
|
+
} | {
|
|
199
|
+
readonly outcome: "rejected";
|
|
200
|
+
readonly hooks: undefined;
|
|
201
|
+
readonly dropped: readonly [];
|
|
202
|
+
readonly rejections: readonly HooksRejection[];
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* THE one reading of a settings document's hooks (see the file header for the law): which pieces drop, whether the document is rejected,
|
|
206
|
+
* and what loads. Pure: reads `settingsDoc` (the WHOLE document — guard signs outside `hooks` count), never modifies it, no I/O, no sentences.
|
|
207
|
+
* Rejections and drops are listed in document order.
|
|
208
|
+
*
|
|
209
|
+
* COPYING THIS FUNCTION (client-core's generator, or any consumer that emits it as source): its one free name besides JavaScript built-ins is
|
|
210
|
+
* {@link HOOK_EVENTS}. The copy's scope must be GIVEN that name, bound to this package's runtime export `HOOK_EVENTS` (the upstream constant —
|
|
211
|
+
* the generator injects it as a registered value, it does not re-declare it). Never paste a literal event list into the generated text: that is
|
|
212
|
+
* a second event table, which the upstream drift gate (it watches `HOOK_EVENTS`) cannot see, and which goes stale the first time CC adds an event.
|
|
213
|
+
* The module-private declarations the closure uses (the `HOOK_*` constants and `hook*` helpers below the classifier line) are copied with it;
|
|
214
|
+
* the hooks-classify test file (group ⑤) pins that the free names are exactly these.
|
|
215
|
+
*/
|
|
216
|
+
export declare function classifyHooksConfig(settingsDoc: unknown): HooksClassification;
|
|
217
|
+
export declare const CommandHookEntry: z.ZodType<CommandHookEntry>;
|
|
218
|
+
export declare const PromptHookEntry: z.ZodType<PromptHookEntry>;
|
|
219
|
+
export declare const AgentHookEntry: z.ZodType<AgentHookEntry>;
|
|
220
|
+
export declare const HttpHookEntry: z.ZodType<HttpHookEntry>;
|
|
221
|
+
export declare const McpToolHookEntry: z.ZodType<McpToolHookEntry>;
|
|
222
|
+
/** One hook entry of any {@link HOOK_ENTRY_TYPES} type (projection of the classifier). */
|
|
223
|
+
export declare const HookEntry: z.ZodType<HookEntry>;
|
|
224
|
+
/** One matcher group (projection of the classifier). */
|
|
225
|
+
export declare const HookMatcherEntry: z.ZodType<HookMatcherEntry>;
|
|
226
|
+
/**
|
|
227
|
+
* The hooks config record (projection of the classifier): accepted ⇔ {@link classifyHooksConfig} loads all of it; the parsed value is what it
|
|
228
|
+
* loaded (entries carry their contract fields only). Strict on purpose — a wire / an API carrying hooks refuses a bad piece outright (each
|
|
229
|
+
* issue = one piece: message = its code, path = its coordinate); a settings file loader asks the classifier itself and drops what it may.
|
|
230
|
+
*
|
|
231
|
+
* 🔴 The event-name set is closed: an event this package has not adopted yet is an unknown event (dropped from a settings file, refused here).
|
|
232
|
+
* That blast radius is why {@link HOOK_EVENTS} and {@link HOOK_ENTRY_TYPES} have an upstream drift gate rather than a human promise.
|
|
233
|
+
*/
|
|
234
|
+
export declare const HooksConfig: z.ZodType<HooksConfig>;
|
|
235
|
+
export {};
|