@responsibleai/agent-hooks 0.1.0-beta.1 → 0.1.0-beta.3
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/README.md +72 -7
- package/binding.d.ts +27 -0
- package/binding.js +59 -54
- package/dist/builder.js +3 -4
- package/dist/ctk/index.d.ts +44 -5
- package/dist/ctk/index.js +6 -10
- package/dist/ctk/reference.d.ts +8 -8
- package/dist/ctk/reference.declaration.json +33 -0
- package/dist/ctk/reference.js +86 -34
- package/dist/ctk/runner.d.ts +30 -10
- package/dist/ctk/runner.js +569 -42
- package/dist/declaration.d.ts +378 -0
- package/dist/declaration.js +752 -0
- package/dist/emitter.d.ts +68 -14
- package/dist/emitter.js +281 -45
- package/dist/index.d.ts +23 -3
- package/dist/index.js +49 -8
- package/dist/native.d.ts +9 -8
- package/dist/native.js +13 -5
- package/package.json +6 -6
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import { AgentContext, ApprovalResolver, CompositionConfig, CompositionProfile, EnforcementMode, InterceptionPoint, Interceptor, JsonValue, OnApproval, SynthesisPolicy } from "./index";
|
|
2
|
+
/** The declaration contract version this SDK writes and accepts
|
|
3
|
+
* (§7.7.2). A test pins it to the core's `declaration_versions()`. */
|
|
4
|
+
export declare const DECLARATION_VERSION = "agent-hooks-declaration/1.0";
|
|
5
|
+
/** Every contract version the loader accepts (§7.7.2). Any other
|
|
6
|
+
* `declaration` value is refused as `declaration_error:version_unsupported`. */
|
|
7
|
+
export declare const SUPPORTED_DECLARATION_VERSIONS: readonly string[];
|
|
8
|
+
/** Largest document the text and file paths accept, in bytes (§7.7.3). */
|
|
9
|
+
export declare const MAX_DOCUMENT_BYTES: number;
|
|
10
|
+
/** Deepest nesting the text paths accept (§7.7.3). */
|
|
11
|
+
export declare const MAX_DEPTH = 32;
|
|
12
|
+
/** Most entries in `bindings` (§7.7.3). */
|
|
13
|
+
export declare const MAX_BINDINGS = 256;
|
|
14
|
+
/** Longest binding `id`, registered name and document `id` (§7.7.3). */
|
|
15
|
+
export declare const MAX_ID_LEN = 64;
|
|
16
|
+
/** Longest binding `kind` (§7.7.5). */
|
|
17
|
+
export declare const MAX_KIND_LEN = 128;
|
|
18
|
+
/** Longest refusal detail (§7.7.3). */
|
|
19
|
+
export declare const MAX_DETAIL_LEN = 512;
|
|
20
|
+
/** Largest `timeout_ms`, `interceptor_ms` and `approval_resolver_ms` (§7.7.3). */
|
|
21
|
+
export declare const MAX_TIMEOUT_MS = 3600000;
|
|
22
|
+
/** The closed capability vocabulary a surface may name (§7.7.4). */
|
|
23
|
+
export declare const CAPABILITIES: readonly string[];
|
|
24
|
+
/** The eleven refusal classes (§7.7.6), in pipeline order. */
|
|
25
|
+
export declare const DeclarationErrorClass: Readonly<{
|
|
26
|
+
readonly Unreadable: "declaration_error:unreadable";
|
|
27
|
+
readonly Malformed: "declaration_error:malformed";
|
|
28
|
+
readonly VersionUnsupported: "declaration_error:version_unsupported";
|
|
29
|
+
readonly SpecUnsupported: "declaration_error:spec_unsupported";
|
|
30
|
+
readonly UnknownField: "declaration_error:unknown_field";
|
|
31
|
+
readonly InvalidField: "declaration_error:invalid_field";
|
|
32
|
+
readonly Inconsistent: "declaration_error:inconsistent";
|
|
33
|
+
readonly SurfaceUnsupported: "declaration_error:surface_unsupported";
|
|
34
|
+
readonly ReferenceUnresolved: "declaration_error:reference_unresolved";
|
|
35
|
+
readonly KindUnknown: "declaration_error:kind_unknown";
|
|
36
|
+
readonly BindingRejected: "declaration_error:binding_rejected";
|
|
37
|
+
}>;
|
|
38
|
+
export type DeclarationErrorClass = (typeof DeclarationErrorClass)[keyof typeof DeclarationErrorClass];
|
|
39
|
+
/** One problem a load step found: a JSON pointer into the document
|
|
40
|
+
* (`/bindings/1/kind`; the empty string is the root) and a detail that
|
|
41
|
+
* names members, kinds and ids but never binding configuration. */
|
|
42
|
+
export interface Finding {
|
|
43
|
+
pointer: string;
|
|
44
|
+
detail: string;
|
|
45
|
+
}
|
|
46
|
+
/** A refused declaration (§7.7.6). Carries one class, every finding
|
|
47
|
+
* that step produced and, for `version_unsupported`, the accepted
|
|
48
|
+
* version set. Thrown by every construction path; never a verdict. */
|
|
49
|
+
export declare class DeclarationError extends Error {
|
|
50
|
+
/** The namespaced code, `declaration_error:<class>`. */
|
|
51
|
+
readonly code: DeclarationErrorClass;
|
|
52
|
+
readonly findings: readonly Finding[];
|
|
53
|
+
readonly accepted: readonly string[];
|
|
54
|
+
constructor(
|
|
55
|
+
/** The namespaced code, `declaration_error:<class>`. */
|
|
56
|
+
code: DeclarationErrorClass, findings: readonly Finding[], accepted?: readonly string[]);
|
|
57
|
+
/** One finding under `code`. */
|
|
58
|
+
static single(code: DeclarationErrorClass, pointer: string, detail: string): DeclarationError;
|
|
59
|
+
/** Rebuild the error the core reported across the native boundary:
|
|
60
|
+
* `code` is the `declaration_error:*` string and `detail` the JSON
|
|
61
|
+
* `{"findings": [...], "accepted": [...]}`. */
|
|
62
|
+
static fromCore(code: string, detail: string): DeclarationError;
|
|
63
|
+
/** Copy `findings` with every detail truncated to {@link MAX_DETAIL_LEN}. */
|
|
64
|
+
private static bound;
|
|
65
|
+
/** `code: pointer: detail; pointer: detail` (the Rust `Display`). */
|
|
66
|
+
private static describe;
|
|
67
|
+
}
|
|
68
|
+
/** A host registry programming error: a duplicate or reserved name, or
|
|
69
|
+
* a code surface the core rejects. Distinct from
|
|
70
|
+
* {@link DeclarationError}: the document is not at fault. */
|
|
71
|
+
export declare class HostRegistryError extends Error {
|
|
72
|
+
constructor(detail: string);
|
|
73
|
+
}
|
|
74
|
+
/** What the host does with the run after a `host_error:*` deny at the
|
|
75
|
+
* tool seam (§6.2, §13.1). */
|
|
76
|
+
export type ToolSeamPosture = "continue" | "terminate";
|
|
77
|
+
/** Whether a build bounds interceptor and resolver execution (§7).
|
|
78
|
+
* This SDK always does, in its own event loop. */
|
|
79
|
+
export type TimeoutSupport = "bounded" | "unbounded";
|
|
80
|
+
/** The knob values a host supports for one profile (§13.1). Only the
|
|
81
|
+
* knobs the profile consults are present. */
|
|
82
|
+
export interface KnobSupport {
|
|
83
|
+
on_approval?: OnApproval[];
|
|
84
|
+
on_disagreement?: SynthesisPolicy[];
|
|
85
|
+
on_transform_conflict?: SynthesisPolicy[];
|
|
86
|
+
}
|
|
87
|
+
/** Every value of every knob the profile consults (§7.2). */
|
|
88
|
+
export declare function fullKnobSupport(profile: CompositionProfile): KnobSupport;
|
|
89
|
+
/** The informative `host` block of a document. */
|
|
90
|
+
export interface HostInfo {
|
|
91
|
+
name: string;
|
|
92
|
+
version?: string;
|
|
93
|
+
}
|
|
94
|
+
/** What the host's code can honour (§7.7.4, §13.1): the one value the
|
|
95
|
+
* loader checks a document against and the CTK derives the harness
|
|
96
|
+
* surface from. A document may select a subset of this, never more.
|
|
97
|
+
* The shape is the core's `HostSurface` JSON form. */
|
|
98
|
+
export interface HostSurface {
|
|
99
|
+
/** Points the host emits. Always includes the §3.2 floor. */
|
|
100
|
+
interception_points: InterceptionPoint[];
|
|
101
|
+
/** Closed vocabulary ({@link CAPABILITIES}). */
|
|
102
|
+
capabilities: string[];
|
|
103
|
+
/** Profiles and the knob values supported under each. */
|
|
104
|
+
profiles: Partial<Record<CompositionProfile, KnobSupport>>;
|
|
105
|
+
/** The posture the code implements (§13.1). */
|
|
106
|
+
tool_seam_host_error: ToolSeamPosture;
|
|
107
|
+
/** Whether the host may declare `buffered_output: false` (§12.1a). */
|
|
108
|
+
streams_unbuffered: boolean;
|
|
109
|
+
/** The §12.1a exposure bound the host enforces. Required when
|
|
110
|
+
* `capabilities` names `incremental_output`. */
|
|
111
|
+
exposure_bound?: string;
|
|
112
|
+
/** Whether this build bounds execution. Always `"bounded"` here:
|
|
113
|
+
* the emitter races every call against its timeout. */
|
|
114
|
+
interceptor_timeout: TimeoutSupport;
|
|
115
|
+
/** Contract versions the host accepts; a subset of
|
|
116
|
+
* {@link SUPPORTED_DECLARATION_VERSIONS}. */
|
|
117
|
+
declaration_versions: string[];
|
|
118
|
+
}
|
|
119
|
+
/** Constructors for {@link HostSurface}. The core validates the
|
|
120
|
+
* surface (floor, pairs, closed vocabularies) when a document is
|
|
121
|
+
* resolved against it; a surface that fails there is a
|
|
122
|
+
* {@link HostRegistryError}, never a refusal of the document. */
|
|
123
|
+
export declare const HostSurface: Readonly<{
|
|
124
|
+
/** The smallest honest surface for this SDK: the lifecycle floor,
|
|
125
|
+
* `host_declaration`, every profile with every knob value, posture
|
|
126
|
+
* `continue`, buffered output, bounded timeouts and every accepted
|
|
127
|
+
* contract version. A host adds what its runtime does. */
|
|
128
|
+
sdkDefault(): HostSurface;
|
|
129
|
+
/** The surface the CTK derives from a harness's capability list and
|
|
130
|
+
* posture (§7.7.9): the floor plus the model points iff
|
|
131
|
+
* `model_calls` plus the tool points iff `tool_calls`. A list naming
|
|
132
|
+
* `incremental_output` needs {@link HostSurface.withExposureBound}
|
|
133
|
+
* on top, or the core refuses the surface. */
|
|
134
|
+
fromCapabilities(caps: Iterable<string>, posture?: ToolSeamPosture): HostSurface;
|
|
135
|
+
/** Add points (the model pair, the tool pair, or both). */
|
|
136
|
+
withPoints(surface: HostSurface, points: Iterable<InterceptionPoint>): HostSurface;
|
|
137
|
+
/** Add capabilities. */
|
|
138
|
+
withCapabilities(surface: HostSurface, caps: Iterable<string>): HostSurface;
|
|
139
|
+
/** State the §12.1a exposure bound an incremental host enforces. Also
|
|
140
|
+
* marks the host as able to declare `buffered_output: false`. */
|
|
141
|
+
withExposureBound(surface: HostSurface, bound: string): HostSurface;
|
|
142
|
+
}>;
|
|
143
|
+
/** What a kind resolver learns about the binding it builds (§7.7.5). */
|
|
144
|
+
export interface BindingContext {
|
|
145
|
+
id: string;
|
|
146
|
+
kind: string;
|
|
147
|
+
/** The resolved `at` set, in lifecycle order. */
|
|
148
|
+
at: readonly InterceptionPoint[];
|
|
149
|
+
/** The resolved per-binding bound in milliseconds; `null` is unbounded. */
|
|
150
|
+
timeoutMs: number | null;
|
|
151
|
+
host: HostInfo | null;
|
|
152
|
+
declarationVersion: string;
|
|
153
|
+
}
|
|
154
|
+
/** Host code that turns one binding's `config` into one interceptor,
|
|
155
|
+
* or refuses it by throwing. The thrown message MUST NOT echo the
|
|
156
|
+
* config (§7.7.5); the loader never does. */
|
|
157
|
+
export type KindResolver = (config: JsonValue, context: BindingContext) => Interceptor;
|
|
158
|
+
/** The names a registry holds, derived from what was registered and
|
|
159
|
+
* never hand-written (§7.7.5). */
|
|
160
|
+
export interface RegistryNames {
|
|
161
|
+
identity_providers: string[];
|
|
162
|
+
approval_resolvers: string[];
|
|
163
|
+
approval_redactors: string[];
|
|
164
|
+
kinds: string[];
|
|
165
|
+
}
|
|
166
|
+
/** Reference grammar for resolver and redactor names and binding ids:
|
|
167
|
+
* `^[a-z][a-z0-9_-]{0,63}$`. */
|
|
168
|
+
export declare function validReference(s: string): boolean;
|
|
169
|
+
/** Binding kind grammar (§7.7.5): dot-separated lowercase segments, at
|
|
170
|
+
* least two, at most 128 characters. */
|
|
171
|
+
export declare function validKind(s: string): boolean;
|
|
172
|
+
/** Everything a host registers in code for a declaration to reference
|
|
173
|
+
* (§7.7.5): the code surface, kind resolvers, custom identity
|
|
174
|
+
* providers, approval resolvers and approval redactors. One registry
|
|
175
|
+
* can build many emitters. */
|
|
176
|
+
export declare class HostRegistry {
|
|
177
|
+
readonly surface: HostSurface;
|
|
178
|
+
private readonly allowReserved;
|
|
179
|
+
private readonly kinds;
|
|
180
|
+
private readonly identityProviders;
|
|
181
|
+
private readonly approvalResolvers;
|
|
182
|
+
private readonly approvalRedactors;
|
|
183
|
+
/** A registry over the given code surface. Kinds under the reserved
|
|
184
|
+
* `agent_hooks` and `ctk` segments are refused. */
|
|
185
|
+
constructor(surface: HostSurface, allowReserved?: boolean);
|
|
186
|
+
/** The conformance kit's registry: as the constructor, but the `ctk`
|
|
187
|
+
* kind segment may be registered. */
|
|
188
|
+
static forConformance(surface: HostSurface): HostRegistry;
|
|
189
|
+
/** Register a kind resolver. */
|
|
190
|
+
kind(kind: string, resolver: KindResolver): this;
|
|
191
|
+
/** Register a custom identity provider (§10.1 name rules apply). */
|
|
192
|
+
identityProvider(name: string, fn: (ctx: AgentContext) => string): this;
|
|
193
|
+
/** Register an approval resolver under a reference name. */
|
|
194
|
+
approvalResolver(name: string, resolver: ApprovalResolver): this;
|
|
195
|
+
/** Register an approval redactor under a reference name. */
|
|
196
|
+
approvalRedactor(name: string, fn: (ctx: AgentContext) => AgentContext): this;
|
|
197
|
+
/** The registered names, derived (§7.7.5). */
|
|
198
|
+
names(): RegistryNames;
|
|
199
|
+
/** The `host_json` the core's `declaration_resolve` takes: the surface
|
|
200
|
+
* plus the registered names. */
|
|
201
|
+
hostDescription(): string;
|
|
202
|
+
/** @internal */
|
|
203
|
+
kindResolver(kind: string): KindResolver | undefined;
|
|
204
|
+
/** @internal */
|
|
205
|
+
identityFn(name: string): ((ctx: AgentContext) => string) | undefined;
|
|
206
|
+
/** @internal */
|
|
207
|
+
approvalResolverRef(name: string): ApprovalResolver | undefined;
|
|
208
|
+
/** @internal */
|
|
209
|
+
redactorFn(name: string): ((ctx: AgentContext) => AgentContext) | undefined;
|
|
210
|
+
private static checkReference;
|
|
211
|
+
}
|
|
212
|
+
/** A declaration that passed steps 2 to 7 (§7.7.6): parsed, of an
|
|
213
|
+
* accepted version, closed, well-typed and internally consistent as
|
|
214
|
+
* stated. Not yet checked against any host; `InterceptionEmitter.
|
|
215
|
+
* fromDeclaration` does that. */
|
|
216
|
+
export declare class HostDeclaration {
|
|
217
|
+
private readonly doc;
|
|
218
|
+
private readonly text;
|
|
219
|
+
/** `text` is the core's serialization of the validated document and
|
|
220
|
+
* is what every later core call receives. The loader refuses any
|
|
221
|
+
* integer token beyond 2^53 - 1 anywhere in the document (§7.7.6),
|
|
222
|
+
* so `doc`, the JavaScript view of the same text, carries every
|
|
223
|
+
* number exactly. */
|
|
224
|
+
private constructor();
|
|
225
|
+
/** Step 1 then {@link HostDeclaration.fromJson}: open exactly `path`,
|
|
226
|
+
* require a regular file of at most {@link MAX_DOCUMENT_BYTES},
|
|
227
|
+
* strict UTF-8 without a byte-order mark, read once. */
|
|
228
|
+
static fromPath(path: string): Promise<HostDeclaration>;
|
|
229
|
+
/** Steps 2 to 7 over JSON text, in the core. */
|
|
230
|
+
static fromJson(text: string): HostDeclaration;
|
|
231
|
+
/** Steps 2 to 7 over an in-memory value: serialized and handed to
|
|
232
|
+
* {@link HostDeclaration.fromJson}, so size, depth and shape checks
|
|
233
|
+
* are the same code on every path. A non-finite number, which
|
|
234
|
+
* `JSON.stringify` would corrupt to `null`, is refused as
|
|
235
|
+
* `malformed` first. */
|
|
236
|
+
static fromValue(value: unknown): HostDeclaration;
|
|
237
|
+
/** A builder for the code path (§7.7.7). */
|
|
238
|
+
static builder(): DeclarationBuilder;
|
|
239
|
+
/** The document's own `declaration` value. */
|
|
240
|
+
get version(): string;
|
|
241
|
+
/** The validated document, verbatim (including `$schema`). A copy.
|
|
242
|
+
* Every integer in a validated document is within ±(2^53 - 1), so
|
|
243
|
+
* this view loses nothing against {@link HostDeclaration.toJson}. */
|
|
244
|
+
toValue(): Record<string, JsonValue>;
|
|
245
|
+
/** @internal The validated document as JSON text, as the core
|
|
246
|
+
* serialized it. */
|
|
247
|
+
toJson(): string;
|
|
248
|
+
}
|
|
249
|
+
/** Resolved configuration: every default filled (§7.7.3). */
|
|
250
|
+
export interface ResolvedConfiguration {
|
|
251
|
+
mode: EnforcementMode;
|
|
252
|
+
composition: CompositionConfig;
|
|
253
|
+
identity_provider: string | null;
|
|
254
|
+
approval: {
|
|
255
|
+
resolver: string | null;
|
|
256
|
+
redactor: string | null;
|
|
257
|
+
};
|
|
258
|
+
posture: {
|
|
259
|
+
tool_seam_host_error: ToolSeamPosture;
|
|
260
|
+
};
|
|
261
|
+
timeouts: {
|
|
262
|
+
interceptor_ms: number | null;
|
|
263
|
+
approval_resolver_ms: number | null;
|
|
264
|
+
};
|
|
265
|
+
records: {
|
|
266
|
+
max_buffered: number | null;
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
/** Resolved surface (§7.7.4): the document's, or the code's when the
|
|
270
|
+
* document stated none. */
|
|
271
|
+
export interface ResolvedSurface {
|
|
272
|
+
interception_points: InterceptionPoint[];
|
|
273
|
+
capabilities: string[];
|
|
274
|
+
profiles: Partial<Record<CompositionProfile, KnobSupport>>;
|
|
275
|
+
buffered_output: boolean;
|
|
276
|
+
exposure_bound?: string;
|
|
277
|
+
declaration_versions: string[];
|
|
278
|
+
}
|
|
279
|
+
/** One binding with `at` and `timeout_ms` filled. */
|
|
280
|
+
export interface ResolvedBinding {
|
|
281
|
+
id: string;
|
|
282
|
+
kind: string;
|
|
283
|
+
config: JsonValue;
|
|
284
|
+
at: InterceptionPoint[];
|
|
285
|
+
timeout_ms: number | null;
|
|
286
|
+
}
|
|
287
|
+
/** The resolved declaration (§7.7.3 "Resolved form"): every default
|
|
288
|
+
* filled, composition knobs resolved exactly as §7.2 resolves them,
|
|
289
|
+
* `$schema` dropped, sets sorted. Its canonical JSON
|
|
290
|
+
* ({@link canonicalDeclaration}) is the equivalence oracle for the
|
|
291
|
+
* construction paths (§7.7.7). */
|
|
292
|
+
export interface ResolvedDeclaration {
|
|
293
|
+
declaration: string;
|
|
294
|
+
spec: string;
|
|
295
|
+
id?: string;
|
|
296
|
+
host?: HostInfo;
|
|
297
|
+
configuration: ResolvedConfiguration;
|
|
298
|
+
surface: ResolvedSurface;
|
|
299
|
+
bindings: ResolvedBinding[];
|
|
300
|
+
extensions: Record<string, JsonValue>;
|
|
301
|
+
}
|
|
302
|
+
/** RFC 8785 canonical JSON of a resolved declaration (the core's
|
|
303
|
+
* `canonical_json`). */
|
|
304
|
+
export declare function canonicalDeclaration(resolved: ResolvedDeclaration): string;
|
|
305
|
+
/** Steps 8 to 10 of §7.7.6 (after steps 2 to 7 again, in the core):
|
|
306
|
+
* resolve a validated declaration against the registry's surface and
|
|
307
|
+
* names. Throws {@link DeclarationError} on refusal. */
|
|
308
|
+
export declare function resolveDeclaration(declaration: HostDeclaration, registry: HostRegistry): ResolvedDeclaration;
|
|
309
|
+
/** Steps 7 (on the filled surface) and 8 against a code surface alone,
|
|
310
|
+
* without a registry: what the CTK runner uses on a harness's own
|
|
311
|
+
* document to learn the surface a run is assessed against (§7.7.9). */
|
|
312
|
+
export declare function resolveSurfaceOnly(declaration: HostDeclaration, surface: HostSurface): ResolvedDeclaration;
|
|
313
|
+
/** The contract versions the core writes and accepts (§7.7.2). */
|
|
314
|
+
export declare function declarationVersions(): {
|
|
315
|
+
current: string;
|
|
316
|
+
supported: string[];
|
|
317
|
+
};
|
|
318
|
+
/** Builds a declaration document in code, one setter per member
|
|
319
|
+
* (§7.7.7). {@link DeclarationBuilder.build} hands the document to
|
|
320
|
+
* {@link HostDeclaration.fromValue}, so the code path is validated by
|
|
321
|
+
* the same function, with the same classes, as a file. */
|
|
322
|
+
export declare class DeclarationBuilder {
|
|
323
|
+
private readonly doc;
|
|
324
|
+
/** A builder with `declaration` set to {@link DECLARATION_VERSION}
|
|
325
|
+
* and an empty `bindings` array. */
|
|
326
|
+
constructor();
|
|
327
|
+
/** A builder with no member set at all, not even `declaration` or
|
|
328
|
+
* `bindings`. For harnesses that must express an incomplete
|
|
329
|
+
* document; a host wants the constructor. */
|
|
330
|
+
static empty(): DeclarationBuilder;
|
|
331
|
+
private configuration;
|
|
332
|
+
private configurationSub;
|
|
333
|
+
private surface;
|
|
334
|
+
private sub;
|
|
335
|
+
/** `declaration` (defaults to {@link DECLARATION_VERSION}). */
|
|
336
|
+
version(v: string): this;
|
|
337
|
+
spec(v: string): this;
|
|
338
|
+
id(v: string): this;
|
|
339
|
+
host(name: string, version?: string): this;
|
|
340
|
+
mode(mode: EnforcementMode): this;
|
|
341
|
+
/** The composition as the host states it. Knobs the profile does not
|
|
342
|
+
* consult are written out and refused by {@link build}, exactly as
|
|
343
|
+
* in a file. */
|
|
344
|
+
composition(c: CompositionConfig): this;
|
|
345
|
+
/** A name for `jcs-sha256` or a custom provider, `null` for
|
|
346
|
+
* identity-unbound. */
|
|
347
|
+
identityProvider(name: string | null): this;
|
|
348
|
+
approvalResolver(name: string | null): this;
|
|
349
|
+
approvalRedactor(name: string | null): this;
|
|
350
|
+
toolSeamHostError(posture: ToolSeamPosture): this;
|
|
351
|
+
/** `null` writes `null` (unbounded). */
|
|
352
|
+
interceptorTimeoutMs(ms: number | null): this;
|
|
353
|
+
/** `null` writes `null` (unbounded). */
|
|
354
|
+
approvalResolverTimeoutMs(ms: number | null): this;
|
|
355
|
+
/** `null` writes `null` (unbounded). */
|
|
356
|
+
maxBufferedRecords(n: number | null): this;
|
|
357
|
+
surfacePoints(points: Iterable<InterceptionPoint>): this;
|
|
358
|
+
surfaceCapabilities(caps: Iterable<string>): this;
|
|
359
|
+
/** Declare support for one profile and its knob values. */
|
|
360
|
+
surfaceProfile(profile: CompositionProfile, knobs: KnobSupport): this;
|
|
361
|
+
/** `buffered_output` and, when `false`, the required exposure bound. */
|
|
362
|
+
bufferedOutput(buffered: boolean, exposureBound?: string): this;
|
|
363
|
+
surfaceDeclarationVersions(versions: Iterable<string>): this;
|
|
364
|
+
/** Append one binding. `at` omitted binds at every surface point;
|
|
365
|
+
* `timeoutMs` omitted inherits the configured interceptor timeout,
|
|
366
|
+
* `null` writes `null` (unbounded), a number bounds. */
|
|
367
|
+
bind(id: string, kind: string, config?: JsonValue, at?: Iterable<InterceptionPoint>, timeoutMs?: number | null): this;
|
|
368
|
+
/** One `extensions` entry, kept verbatim. */
|
|
369
|
+
extension(key: string, value: JsonValue): this;
|
|
370
|
+
/** Set a top-level member verbatim. For members this builder has no
|
|
371
|
+
* setter for; the result is validated like any other document (an
|
|
372
|
+
* unknown member is refused as `unknown_field`). */
|
|
373
|
+
raw(key: string, value: JsonValue): this;
|
|
374
|
+
/** The document as built, before validation. A copy. */
|
|
375
|
+
toValue(): Record<string, JsonValue>;
|
|
376
|
+
/** Validate (steps 2 to 7) through {@link HostDeclaration.fromValue}. */
|
|
377
|
+
build(): HostDeclaration;
|
|
378
|
+
}
|