@adea-ai/contracts 1.8.2 → 1.9.1

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.
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Deterministic JSON serialization ("canonical JSON") for content digests,
3
+ * idempotency keys, fingerprints and structural equality checks.
4
+ *
5
+ * Pinned semantics:
6
+ *
7
+ * - Object entries are sorted by key in CODE-POINT (UTF-16 code unit) order:
8
+ * `(a, b) => (a < b ? -1 : a > b ? 1 : 0)`.
9
+ * NEVER use `String.prototype.localeCompare` for this ordering: it delegates
10
+ * to ICU and is locale- and ICU-version-dependent. Proven divergence fixture:
11
+ * the keys `['a-b', 'ab', 'a_b', 'Aa', 'a!']` order differently under
12
+ * `localeCompare` than under code-point comparison (ICU collation treats
13
+ * `-`/`_` as variable-weight punctuation), so the same object serializes to
14
+ * different bytes on different hosts and any digest, idempotency key or
15
+ * scope check derived from it can silently break across deployments.
16
+ * - Object entries whose value is `undefined` are omitted (JSON.stringify
17
+ * parity).
18
+ * - Arrays keep their order; `undefined` array elements serialize as `null`
19
+ * (JSON.stringify parity).
20
+ * - Leaves serialize exactly like `JSON.stringify`: finite numbers as JSON
21
+ * numbers, with `NaN`, `Infinity` and `-Infinity` mapped to `null`
22
+ * (JSON.stringify parity) and `-0` normalized to `0` (JSON.stringify parity).
23
+ * - `undefined` at the document root serializes as `null`.
24
+ * - `bigint`, function and symbol values throw `TypeError` (JSON.stringify
25
+ * parity for bigint; functions and symbols are likewise rejected instead of
26
+ * being silently dropped or coerced).
27
+ * - Values must be JSON-compatible plain data: arrays, plain objects
28
+ * (prototype `Object.prototype` or `null`) and JSON leaves. Anything else
29
+ * (Date, Map, Set, class instances, ...) throws `TypeError` rather than
30
+ * serializing to a lossy or implementation-dependent form.
31
+ */
32
+ export declare function canonicalJsonStringify(value: unknown): string;
33
+ //# sourceMappingURL=canonical-json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonical-json.d.ts","sourceRoot":"","sources":["../src/canonical-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE7D"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Deterministic JSON serialization ("canonical JSON") for content digests,
3
+ * idempotency keys, fingerprints and structural equality checks.
4
+ *
5
+ * Pinned semantics:
6
+ *
7
+ * - Object entries are sorted by key in CODE-POINT (UTF-16 code unit) order:
8
+ * `(a, b) => (a < b ? -1 : a > b ? 1 : 0)`.
9
+ * NEVER use `String.prototype.localeCompare` for this ordering: it delegates
10
+ * to ICU and is locale- and ICU-version-dependent. Proven divergence fixture:
11
+ * the keys `['a-b', 'ab', 'a_b', 'Aa', 'a!']` order differently under
12
+ * `localeCompare` than under code-point comparison (ICU collation treats
13
+ * `-`/`_` as variable-weight punctuation), so the same object serializes to
14
+ * different bytes on different hosts and any digest, idempotency key or
15
+ * scope check derived from it can silently break across deployments.
16
+ * - Object entries whose value is `undefined` are omitted (JSON.stringify
17
+ * parity).
18
+ * - Arrays keep their order; `undefined` array elements serialize as `null`
19
+ * (JSON.stringify parity).
20
+ * - Leaves serialize exactly like `JSON.stringify`: finite numbers as JSON
21
+ * numbers, with `NaN`, `Infinity` and `-Infinity` mapped to `null`
22
+ * (JSON.stringify parity) and `-0` normalized to `0` (JSON.stringify parity).
23
+ * - `undefined` at the document root serializes as `null`.
24
+ * - `bigint`, function and symbol values throw `TypeError` (JSON.stringify
25
+ * parity for bigint; functions and symbols are likewise rejected instead of
26
+ * being silently dropped or coerced).
27
+ * - Values must be JSON-compatible plain data: arrays, plain objects
28
+ * (prototype `Object.prototype` or `null`) and JSON leaves. Anything else
29
+ * (Date, Map, Set, class instances, ...) throws `TypeError` rather than
30
+ * serializing to a lossy or implementation-dependent form.
31
+ */
32
+ export function canonicalJsonStringify(value) {
33
+ return serialize(value);
34
+ }
35
+ function compareCodePoint(left, right) {
36
+ return left < right ? -1 : left > right ? 1 : 0;
37
+ }
38
+ function serialize(value) {
39
+ if (value === undefined || value === null)
40
+ return 'null';
41
+ const type = typeof value;
42
+ if (type === 'string' || type === 'boolean')
43
+ return JSON.stringify(value);
44
+ if (type === 'number') {
45
+ if (!Number.isFinite(value))
46
+ return 'null';
47
+ return JSON.stringify(value);
48
+ }
49
+ if (type === 'bigint' || type === 'function' || type === 'symbol')
50
+ throw new TypeError(`canonicalJsonStringify: cannot serialize ${type} value`);
51
+ if (Array.isArray(value))
52
+ return `[${value.map((entry) => serialize(entry)).join(',')}]`;
53
+ const prototype = Object.getPrototypeOf(value);
54
+ if (prototype !== Object.prototype && prototype !== null)
55
+ throw new TypeError('canonicalJsonStringify: value is not JSON-compatible plain data');
56
+ const entries = Object.entries(value)
57
+ .filter(([, entry]) => entry !== undefined)
58
+ .sort(([left], [right]) => compareCodePoint(left, right));
59
+ return `{${entries
60
+ .map(([key, entry]) => `${JSON.stringify(key)}:${serialize(entry)}`)
61
+ .join(',')}}`;
62
+ }
63
+ //# sourceMappingURL=canonical-json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonical-json.js","sourceRoot":"","sources":["../src/canonical-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAc;IACnD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAA;AACzB,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAY,EAAE,KAAa;IACnD,OAAO,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACjD,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAA;I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AE,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;SACnE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAA;AACjB,CAAC"}
@@ -0,0 +1,416 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Decision-layer contract (control-plane#558).
4
+ *
5
+ * The Control Plane owns the decision layer that resolves what runs: harness,
6
+ * model, skills, tools/capabilities, runtime, sandbox, context package, and
7
+ * delegation policy. Resolution is logistics — it selects among what harnesses
8
+ * expose; it never implements routing inside a harness's model semantics
9
+ * (owner standing directive, adea#400). Precedence for every output:
10
+ * explicit user pin > project default > profile default > policy default.
11
+ * Policy enforcement remains the PolicyDecisionPoint authorize() call; a
12
+ * resolution selects, it never authorizes.
13
+ */
14
+ export declare const DECISION_RESOLUTION_CONTRACT_VERSION: Readonly<{
15
+ major: 1;
16
+ minor: 0;
17
+ }>;
18
+ /** Where a resolved output value came from. Precedence order is list order. */
19
+ export declare const ResolutionSourceSchema: z.ZodEnum<{
20
+ "explicit-pin": "explicit-pin";
21
+ "project-default": "project-default";
22
+ "profile-default": "profile-default";
23
+ "policy-default": "policy-default";
24
+ }>;
25
+ export type ResolutionSource = z.output<typeof ResolutionSourceSchema>;
26
+ /**
27
+ * Sandbox selection stays inside M10-granted capabilities; it never grants.
28
+ * `effectiveCapabilities` is always a subset of the resolved capability set
29
+ * intersected with entitlement grants.
30
+ */
31
+ export declare const SandboxResolutionSchema: z.ZodObject<{
32
+ mode: z.ZodEnum<{
33
+ none: "none";
34
+ managed: "managed";
35
+ }>;
36
+ effectiveCapabilities: z.ZodArray<z.ZodString>;
37
+ }, z.core.$strict>;
38
+ export type SandboxResolution = z.output<typeof SandboxResolutionSchema>;
39
+ export declare const DelegationResolutionSchema: z.ZodObject<{
40
+ fanOut: z.ZodEnum<{
41
+ none: "none";
42
+ bounded: "bounded";
43
+ }>;
44
+ maxChildren: z.ZodOptional<z.ZodNumber>;
45
+ promotion: z.ZodEnum<{
46
+ "review-required": "review-required";
47
+ "auto-eligible": "auto-eligible";
48
+ }>;
49
+ }, z.core.$strict>;
50
+ export type DelegationResolution = z.output<typeof DelegationResolutionSchema>;
51
+ /**
52
+ * Every output the decision layer resolves. Pins make any subset explicit;
53
+ * unpinned outputs still resolve.
54
+ */
55
+ export declare const DecisionPinsSchema: z.ZodObject<{
56
+ harness: z.ZodOptional<z.ZodObject<{
57
+ harnessId: z.ZodString;
58
+ }, z.core.$strict>>;
59
+ model: z.ZodOptional<z.ZodObject<{
60
+ modelId: z.ZodString;
61
+ }, z.core.$strict>>;
62
+ skills: z.ZodOptional<z.ZodObject<{
63
+ skillVersionIds: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"skill-version ID">, string>>>;
64
+ }, z.core.$strict>>;
65
+ capabilities: z.ZodOptional<z.ZodObject<{
66
+ capabilityNames: z.ZodArray<z.ZodString>;
67
+ }, z.core.$strict>>;
68
+ runtime: z.ZodOptional<z.ZodObject<{
69
+ runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
70
+ }, z.core.$strict>>;
71
+ sandbox: z.ZodOptional<z.ZodObject<{
72
+ mode: z.ZodEnum<{
73
+ none: "none";
74
+ managed: "managed";
75
+ }>;
76
+ effectiveCapabilities: z.ZodArray<z.ZodString>;
77
+ }, z.core.$strict>>;
78
+ contextPackage: z.ZodOptional<z.ZodObject<{
79
+ mode: z.ZodEnum<{
80
+ none: "none";
81
+ existing: "existing";
82
+ author: "author";
83
+ }>;
84
+ contextPackageId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"ContextPackage ID">, string>>>;
85
+ }, z.core.$strict>>;
86
+ delegation: z.ZodOptional<z.ZodObject<{
87
+ fanOut: z.ZodEnum<{
88
+ none: "none";
89
+ bounded: "bounded";
90
+ }>;
91
+ maxChildren: z.ZodOptional<z.ZodNumber>;
92
+ promotion: z.ZodEnum<{
93
+ "review-required": "review-required";
94
+ "auto-eligible": "auto-eligible";
95
+ }>;
96
+ }, z.core.$strict>>;
97
+ }, z.core.$strict>;
98
+ export type DecisionPins = z.output<typeof DecisionPinsSchema>;
99
+ export declare const ModelAccessEntitlementSchema: z.ZodEnum<{
100
+ none: "none";
101
+ byok: "byok";
102
+ provisioned: "provisioned";
103
+ "free-tier": "free-tier";
104
+ }>;
105
+ export type ModelAccessEntitlement = z.output<typeof ModelAccessEntitlementSchema>;
106
+ export declare const AvailableRuntimeSchema: z.ZodObject<{
107
+ runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
108
+ kind: z.ZodEnum<{
109
+ cloud: "cloud";
110
+ local: "local";
111
+ "self-hosted": "self-hosted";
112
+ }>;
113
+ transport: z.ZodEnum<{
114
+ "direct-local": "direct-local";
115
+ "remote-gateway": "remote-gateway";
116
+ }>;
117
+ harnessIds: z.ZodArray<z.ZodString>;
118
+ capabilities: z.ZodArray<z.ZodString>;
119
+ }, z.core.$strict>;
120
+ export type AvailableRuntime = z.output<typeof AvailableRuntimeSchema>;
121
+ export declare const DecisionResolutionRequestSchema: z.ZodObject<{
122
+ contractVersion: z.ZodObject<{
123
+ major: z.ZodNumber;
124
+ minor: z.ZodNumber;
125
+ }, z.core.$strict>;
126
+ caller: z.ZodObject<{
127
+ servicePrincipalId: z.ZodString;
128
+ }, z.core.$strip>;
129
+ requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"request ID">, string>>;
130
+ workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
131
+ projectId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"project ID">, string>>>;
132
+ correlation: z.ZodObject<{
133
+ traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"trace ID">, string>>;
134
+ causationCommandId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"command ID">, string>>>;
135
+ parentEventId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"event ID">, string>>>;
136
+ }, z.core.$strip>;
137
+ requestedAt: z.ZodISODateTime;
138
+ objective: z.ZodString;
139
+ agentProfile: z.ZodObject<{
140
+ profileId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"profile ID">, string>>;
141
+ profileVersionId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"profile-version ID">, string>>>;
142
+ }, z.core.$strict>;
143
+ availableRuntimes: z.ZodArray<z.ZodObject<{
144
+ runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
145
+ kind: z.ZodEnum<{
146
+ cloud: "cloud";
147
+ local: "local";
148
+ "self-hosted": "self-hosted";
149
+ }>;
150
+ transport: z.ZodEnum<{
151
+ "direct-local": "direct-local";
152
+ "remote-gateway": "remote-gateway";
153
+ }>;
154
+ harnessIds: z.ZodArray<z.ZodString>;
155
+ capabilities: z.ZodArray<z.ZodString>;
156
+ }, z.core.$strict>>;
157
+ entitlements: z.ZodObject<{
158
+ modelAccess: z.ZodEnum<{
159
+ none: "none";
160
+ byok: "byok";
161
+ provisioned: "provisioned";
162
+ "free-tier": "free-tier";
163
+ }>;
164
+ grantedCapabilityNames: z.ZodArray<z.ZodString>;
165
+ }, z.core.$strict>;
166
+ requiredCapabilities: z.ZodArray<z.ZodString>;
167
+ costLatencyPreference: z.ZodEnum<{
168
+ cost: "cost";
169
+ balanced: "balanced";
170
+ latency: "latency";
171
+ }>;
172
+ projectDefaults: z.ZodObject<{
173
+ harness: z.ZodOptional<z.ZodObject<{
174
+ harnessId: z.ZodString;
175
+ }, z.core.$strict>>;
176
+ model: z.ZodOptional<z.ZodObject<{
177
+ modelId: z.ZodString;
178
+ }, z.core.$strict>>;
179
+ skills: z.ZodOptional<z.ZodObject<{
180
+ skillVersionIds: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"skill-version ID">, string>>>;
181
+ }, z.core.$strict>>;
182
+ capabilities: z.ZodOptional<z.ZodObject<{
183
+ capabilityNames: z.ZodArray<z.ZodString>;
184
+ }, z.core.$strict>>;
185
+ runtime: z.ZodOptional<z.ZodObject<{
186
+ runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
187
+ }, z.core.$strict>>;
188
+ sandbox: z.ZodOptional<z.ZodObject<{
189
+ mode: z.ZodEnum<{
190
+ none: "none";
191
+ managed: "managed";
192
+ }>;
193
+ effectiveCapabilities: z.ZodArray<z.ZodString>;
194
+ }, z.core.$strict>>;
195
+ contextPackage: z.ZodOptional<z.ZodObject<{
196
+ mode: z.ZodEnum<{
197
+ none: "none";
198
+ existing: "existing";
199
+ author: "author";
200
+ }>;
201
+ contextPackageId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"ContextPackage ID">, string>>>;
202
+ }, z.core.$strict>>;
203
+ delegation: z.ZodOptional<z.ZodObject<{
204
+ fanOut: z.ZodEnum<{
205
+ none: "none";
206
+ bounded: "bounded";
207
+ }>;
208
+ maxChildren: z.ZodOptional<z.ZodNumber>;
209
+ promotion: z.ZodEnum<{
210
+ "review-required": "review-required";
211
+ "auto-eligible": "auto-eligible";
212
+ }>;
213
+ }, z.core.$strict>>;
214
+ }, z.core.$strict>;
215
+ profileDefaults: z.ZodObject<{
216
+ harness: z.ZodOptional<z.ZodObject<{
217
+ harnessId: z.ZodString;
218
+ }, z.core.$strict>>;
219
+ model: z.ZodOptional<z.ZodObject<{
220
+ modelId: z.ZodString;
221
+ }, z.core.$strict>>;
222
+ skills: z.ZodOptional<z.ZodObject<{
223
+ skillVersionIds: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"skill-version ID">, string>>>;
224
+ }, z.core.$strict>>;
225
+ capabilities: z.ZodOptional<z.ZodObject<{
226
+ capabilityNames: z.ZodArray<z.ZodString>;
227
+ }, z.core.$strict>>;
228
+ runtime: z.ZodOptional<z.ZodObject<{
229
+ runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
230
+ }, z.core.$strict>>;
231
+ sandbox: z.ZodOptional<z.ZodObject<{
232
+ mode: z.ZodEnum<{
233
+ none: "none";
234
+ managed: "managed";
235
+ }>;
236
+ effectiveCapabilities: z.ZodArray<z.ZodString>;
237
+ }, z.core.$strict>>;
238
+ contextPackage: z.ZodOptional<z.ZodObject<{
239
+ mode: z.ZodEnum<{
240
+ none: "none";
241
+ existing: "existing";
242
+ author: "author";
243
+ }>;
244
+ contextPackageId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"ContextPackage ID">, string>>>;
245
+ }, z.core.$strict>>;
246
+ delegation: z.ZodOptional<z.ZodObject<{
247
+ fanOut: z.ZodEnum<{
248
+ none: "none";
249
+ bounded: "bounded";
250
+ }>;
251
+ maxChildren: z.ZodOptional<z.ZodNumber>;
252
+ promotion: z.ZodEnum<{
253
+ "review-required": "review-required";
254
+ "auto-eligible": "auto-eligible";
255
+ }>;
256
+ }, z.core.$strict>>;
257
+ }, z.core.$strict>;
258
+ explicitPins: z.ZodObject<{
259
+ harness: z.ZodOptional<z.ZodObject<{
260
+ harnessId: z.ZodString;
261
+ }, z.core.$strict>>;
262
+ model: z.ZodOptional<z.ZodObject<{
263
+ modelId: z.ZodString;
264
+ }, z.core.$strict>>;
265
+ skills: z.ZodOptional<z.ZodObject<{
266
+ skillVersionIds: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"skill-version ID">, string>>>;
267
+ }, z.core.$strict>>;
268
+ capabilities: z.ZodOptional<z.ZodObject<{
269
+ capabilityNames: z.ZodArray<z.ZodString>;
270
+ }, z.core.$strict>>;
271
+ runtime: z.ZodOptional<z.ZodObject<{
272
+ runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
273
+ }, z.core.$strict>>;
274
+ sandbox: z.ZodOptional<z.ZodObject<{
275
+ mode: z.ZodEnum<{
276
+ none: "none";
277
+ managed: "managed";
278
+ }>;
279
+ effectiveCapabilities: z.ZodArray<z.ZodString>;
280
+ }, z.core.$strict>>;
281
+ contextPackage: z.ZodOptional<z.ZodObject<{
282
+ mode: z.ZodEnum<{
283
+ none: "none";
284
+ existing: "existing";
285
+ author: "author";
286
+ }>;
287
+ contextPackageId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"ContextPackage ID">, string>>>;
288
+ }, z.core.$strict>>;
289
+ delegation: z.ZodOptional<z.ZodObject<{
290
+ fanOut: z.ZodEnum<{
291
+ none: "none";
292
+ bounded: "bounded";
293
+ }>;
294
+ maxChildren: z.ZodOptional<z.ZodNumber>;
295
+ promotion: z.ZodEnum<{
296
+ "review-required": "review-required";
297
+ "auto-eligible": "auto-eligible";
298
+ }>;
299
+ }, z.core.$strict>>;
300
+ }, z.core.$strict>;
301
+ }, z.core.$strict>;
302
+ export type DecisionResolutionRequest = z.output<typeof DecisionResolutionRequestSchema>;
303
+ /** Fail-closed denial codes; a denial never narrows silently. */
304
+ export declare const DecisionResolutionDiagnosticSchema: z.ZodEnum<{
305
+ UNSUPPORTED_RUNTIME_PIN: "UNSUPPORTED_RUNTIME_PIN";
306
+ MODEL_ACCESS_NOT_ENTITLED: "MODEL_ACCESS_NOT_ENTITLED";
307
+ NO_DEFAULT_MODEL: "NO_DEFAULT_MODEL";
308
+ CAPABILITY_BEYOND_GRANT: "CAPABILITY_BEYOND_GRANT";
309
+ HARNESS_UNAVAILABLE_ON_PINNED_RUNTIME: "HARNESS_UNAVAILABLE_ON_PINNED_RUNTIME";
310
+ CONTEXT_PACKAGE_PIN_MISMATCH: "CONTEXT_PACKAGE_PIN_MISMATCH";
311
+ }>;
312
+ export type DecisionResolutionDiagnostic = z.output<typeof DecisionResolutionDiagnosticSchema>;
313
+ /** One resolved output plus the precedence layer it came from. */
314
+ export declare const ResolvedOutputSchema: z.ZodObject<{
315
+ source: z.ZodEnum<{
316
+ "explicit-pin": "explicit-pin";
317
+ "project-default": "project-default";
318
+ "profile-default": "profile-default";
319
+ "policy-default": "policy-default";
320
+ }>;
321
+ value: z.ZodJSONSchema;
322
+ }, z.core.$strict>;
323
+ export type ResolvedOutput = z.output<typeof ResolvedOutputSchema>;
324
+ export declare const DecisionLayerResolutionSchema: z.ZodObject<{
325
+ schemaVersion: z.ZodNumber;
326
+ requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"request ID">, string>>;
327
+ workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
328
+ contractVersion: z.ZodObject<{
329
+ major: z.ZodNumber;
330
+ minor: z.ZodNumber;
331
+ }, z.core.$strict>;
332
+ resolvedAt: z.ZodISODateTime;
333
+ resolution: z.ZodObject<{
334
+ harness: z.ZodObject<{
335
+ harnessId: z.ZodString;
336
+ }, z.core.$strict>;
337
+ model: z.ZodUnion<readonly [z.ZodObject<{
338
+ modelId: z.ZodString;
339
+ }, z.core.$strict>, z.ZodObject<{
340
+ withheld: z.ZodEnum<{
341
+ UNSUPPORTED_RUNTIME_PIN: "UNSUPPORTED_RUNTIME_PIN";
342
+ MODEL_ACCESS_NOT_ENTITLED: "MODEL_ACCESS_NOT_ENTITLED";
343
+ NO_DEFAULT_MODEL: "NO_DEFAULT_MODEL";
344
+ CAPABILITY_BEYOND_GRANT: "CAPABILITY_BEYOND_GRANT";
345
+ HARNESS_UNAVAILABLE_ON_PINNED_RUNTIME: "HARNESS_UNAVAILABLE_ON_PINNED_RUNTIME";
346
+ CONTEXT_PACKAGE_PIN_MISMATCH: "CONTEXT_PACKAGE_PIN_MISMATCH";
347
+ }>;
348
+ }, z.core.$strict>]>;
349
+ skills: z.ZodObject<{
350
+ skillVersionIds: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"skill-version ID">, string>>>;
351
+ }, z.core.$strict>;
352
+ capabilities: z.ZodObject<{
353
+ capabilityNames: z.ZodArray<z.ZodString>;
354
+ }, z.core.$strict>;
355
+ runtime: z.ZodObject<{
356
+ runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
357
+ kind: z.ZodEnum<{
358
+ cloud: "cloud";
359
+ local: "local";
360
+ "self-hosted": "self-hosted";
361
+ }>;
362
+ transport: z.ZodEnum<{
363
+ "direct-local": "direct-local";
364
+ "remote-gateway": "remote-gateway";
365
+ }>;
366
+ harnessIds: z.ZodArray<z.ZodString>;
367
+ capabilities: z.ZodArray<z.ZodString>;
368
+ }, z.core.$strict>;
369
+ sandbox: z.ZodObject<{
370
+ mode: z.ZodEnum<{
371
+ none: "none";
372
+ managed: "managed";
373
+ }>;
374
+ effectiveCapabilities: z.ZodArray<z.ZodString>;
375
+ }, z.core.$strict>;
376
+ contextPackage: z.ZodObject<{
377
+ mode: z.ZodEnum<{
378
+ none: "none";
379
+ existing: "existing";
380
+ author: "author";
381
+ }>;
382
+ contextPackageId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"ContextPackage ID">, string>>>;
383
+ }, z.core.$strict>;
384
+ delegation: z.ZodObject<{
385
+ fanOut: z.ZodEnum<{
386
+ none: "none";
387
+ bounded: "bounded";
388
+ }>;
389
+ maxChildren: z.ZodOptional<z.ZodNumber>;
390
+ promotion: z.ZodEnum<{
391
+ "review-required": "review-required";
392
+ "auto-eligible": "auto-eligible";
393
+ }>;
394
+ }, z.core.$strict>;
395
+ }, z.core.$strict>;
396
+ trace: z.ZodRecord<z.ZodString, z.ZodObject<{
397
+ source: z.ZodEnum<{
398
+ "explicit-pin": "explicit-pin";
399
+ "project-default": "project-default";
400
+ "profile-default": "profile-default";
401
+ "policy-default": "policy-default";
402
+ }>;
403
+ value: z.ZodJSONSchema;
404
+ }, z.core.$strict>>;
405
+ diagnostics: z.ZodArray<z.ZodEnum<{
406
+ UNSUPPORTED_RUNTIME_PIN: "UNSUPPORTED_RUNTIME_PIN";
407
+ MODEL_ACCESS_NOT_ENTITLED: "MODEL_ACCESS_NOT_ENTITLED";
408
+ NO_DEFAULT_MODEL: "NO_DEFAULT_MODEL";
409
+ CAPABILITY_BEYOND_GRANT: "CAPABILITY_BEYOND_GRANT";
410
+ HARNESS_UNAVAILABLE_ON_PINNED_RUNTIME: "HARNESS_UNAVAILABLE_ON_PINNED_RUNTIME";
411
+ CONTEXT_PACKAGE_PIN_MISMATCH: "CONTEXT_PACKAGE_PIN_MISMATCH";
412
+ }>>;
413
+ resolutionDigest: z.ZodString;
414
+ }, z.core.$strict>;
415
+ export type DecisionLayerResolution = z.output<typeof DecisionLayerResolutionSchema>;
416
+ //# sourceMappingURL=decision-resolution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decision-resolution.d.ts","sourceRoot":"","sources":["../src/decision-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,oCAAoC;;;EAAwC,CAAA;AAoBzF,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MAAM,kCAAkC;;;;;;;EAO7C,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAE9F,kEAAkE;AAClE,eAAO,MAAM,oBAAoB;;;;;;;;kBAKtB,CAAA;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAElE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA+B/B,CAAA;AACX,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAA"}
@@ -0,0 +1,181 @@
1
+ import { z } from 'zod';
2
+ import { ServiceCallerAssertionSchema } from './authentication.js';
3
+ import { CorrelationMetadataSchema } from './envelopes.js';
4
+ import { IdentifierSchemas } from './identifiers.js';
5
+ import { ContractVersionSchema } from './versioning.js';
6
+ /**
7
+ * Decision-layer contract (control-plane#558).
8
+ *
9
+ * The Control Plane owns the decision layer that resolves what runs: harness,
10
+ * model, skills, tools/capabilities, runtime, sandbox, context package, and
11
+ * delegation policy. Resolution is logistics — it selects among what harnesses
12
+ * expose; it never implements routing inside a harness's model semantics
13
+ * (owner standing directive, adea#400). Precedence for every output:
14
+ * explicit user pin > project default > profile default > policy default.
15
+ * Policy enforcement remains the PolicyDecisionPoint authorize() call; a
16
+ * resolution selects, it never authorizes.
17
+ */
18
+ export const DECISION_RESOLUTION_CONTRACT_VERSION = Object.freeze({ major: 1, minor: 0 });
19
+ const TimestampSchema = z.iso.datetime();
20
+ const DigestSchema = z.string().regex(/^sha256:[a-f0-9]{64}$/);
21
+ const CapabilityNameSchema = z
22
+ .string()
23
+ .min(1)
24
+ .max(128)
25
+ .regex(/^[a-z][a-z0-9.-]*$/);
26
+ const HarnessIdSchema = z
27
+ .string()
28
+ .min(1)
29
+ .max(64)
30
+ .regex(/^[a-z][a-z0-9-]*$/);
31
+ const ModelIdSchema = z
32
+ .string()
33
+ .min(1)
34
+ .max(128)
35
+ .regex(/^[a-z0-9][a-z0-9._/-]*$/i);
36
+ /** Where a resolved output value came from. Precedence order is list order. */
37
+ export const ResolutionSourceSchema = z.enum([
38
+ 'explicit-pin',
39
+ 'project-default',
40
+ 'profile-default',
41
+ 'policy-default',
42
+ ]);
43
+ /**
44
+ * Sandbox selection stays inside M10-granted capabilities; it never grants.
45
+ * `effectiveCapabilities` is always a subset of the resolved capability set
46
+ * intersected with entitlement grants.
47
+ */
48
+ export const SandboxResolutionSchema = z
49
+ .object({
50
+ mode: z.enum(['none', 'managed']),
51
+ effectiveCapabilities: z.array(CapabilityNameSchema).max(64),
52
+ })
53
+ .strict();
54
+ export const DelegationResolutionSchema = z
55
+ .object({
56
+ fanOut: z.enum(['none', 'bounded']),
57
+ maxChildren: z.number().int().min(0).max(8).optional(),
58
+ promotion: z.enum(['review-required', 'auto-eligible']),
59
+ })
60
+ .strict()
61
+ .superRefine((delegation, context) => {
62
+ if (delegation.fanOut === 'bounded' && delegation.maxChildren === undefined) {
63
+ context.addIssue({
64
+ code: 'custom',
65
+ path: ['maxChildren'],
66
+ message: 'maxChildren is required when fanOut is bounded',
67
+ });
68
+ }
69
+ });
70
+ /**
71
+ * Every output the decision layer resolves. Pins make any subset explicit;
72
+ * unpinned outputs still resolve.
73
+ */
74
+ export const DecisionPinsSchema = z
75
+ .object({
76
+ harness: z.strictObject({ harnessId: HarnessIdSchema }).optional(),
77
+ model: z.strictObject({ modelId: ModelIdSchema }).optional(),
78
+ skills: z
79
+ .strictObject({ skillVersionIds: z.array(IdentifierSchemas.skillVersionId).max(64) })
80
+ .optional(),
81
+ capabilities: z
82
+ .strictObject({ capabilityNames: z.array(CapabilityNameSchema).max(64) })
83
+ .optional(),
84
+ runtime: z
85
+ .strictObject({ runtimeDefinitionId: IdentifierSchemas.runtimeDefinitionId })
86
+ .optional(),
87
+ sandbox: SandboxResolutionSchema.optional(),
88
+ contextPackage: z
89
+ .strictObject({
90
+ mode: z.enum(['none', 'existing', 'author']),
91
+ contextPackageId: IdentifierSchemas.contextPackageId.optional(),
92
+ })
93
+ .optional(),
94
+ delegation: DelegationResolutionSchema.optional(),
95
+ })
96
+ .strict();
97
+ export const ModelAccessEntitlementSchema = z.enum(['byok', 'provisioned', 'free-tier', 'none']);
98
+ export const AvailableRuntimeSchema = z
99
+ .object({
100
+ runtimeDefinitionId: IdentifierSchemas.runtimeDefinitionId,
101
+ kind: z.enum(['local', 'self-hosted', 'cloud']),
102
+ transport: z.enum(['direct-local', 'remote-gateway']),
103
+ harnessIds: z.array(HarnessIdSchema).max(16),
104
+ capabilities: z.array(CapabilityNameSchema).max(64),
105
+ })
106
+ .strict();
107
+ export const DecisionResolutionRequestSchema = z
108
+ .object({
109
+ contractVersion: ContractVersionSchema,
110
+ caller: ServiceCallerAssertionSchema,
111
+ requestId: IdentifierSchemas.requestId,
112
+ workspaceId: IdentifierSchemas.workspaceId,
113
+ projectId: IdentifierSchemas.projectId.optional(),
114
+ correlation: CorrelationMetadataSchema,
115
+ requestedAt: TimestampSchema,
116
+ objective: z.string().min(1).max(4096),
117
+ agentProfile: z.strictObject({
118
+ profileId: IdentifierSchemas.profileId,
119
+ profileVersionId: IdentifierSchemas.profileVersionId.optional(),
120
+ }),
121
+ availableRuntimes: z.array(AvailableRuntimeSchema).max(64),
122
+ entitlements: z.strictObject({
123
+ modelAccess: ModelAccessEntitlementSchema,
124
+ grantedCapabilityNames: z.array(CapabilityNameSchema).max(64),
125
+ }),
126
+ requiredCapabilities: z.array(CapabilityNameSchema).max(64),
127
+ costLatencyPreference: z.enum(['cost', 'balanced', 'latency']),
128
+ projectDefaults: DecisionPinsSchema,
129
+ profileDefaults: DecisionPinsSchema,
130
+ explicitPins: DecisionPinsSchema,
131
+ })
132
+ .strict();
133
+ /** Fail-closed denial codes; a denial never narrows silently. */
134
+ export const DecisionResolutionDiagnosticSchema = z.enum([
135
+ 'UNSUPPORTED_RUNTIME_PIN',
136
+ 'MODEL_ACCESS_NOT_ENTITLED',
137
+ 'NO_DEFAULT_MODEL',
138
+ 'CAPABILITY_BEYOND_GRANT',
139
+ 'HARNESS_UNAVAILABLE_ON_PINNED_RUNTIME',
140
+ 'CONTEXT_PACKAGE_PIN_MISMATCH',
141
+ ]);
142
+ /** One resolved output plus the precedence layer it came from. */
143
+ export const ResolvedOutputSchema = z
144
+ .object({
145
+ source: ResolutionSourceSchema,
146
+ value: z.json(),
147
+ })
148
+ .strict();
149
+ export const DecisionLayerResolutionSchema = z
150
+ .object({
151
+ schemaVersion: z.number().int().positive(),
152
+ requestId: IdentifierSchemas.requestId,
153
+ workspaceId: IdentifierSchemas.workspaceId,
154
+ contractVersion: ContractVersionSchema,
155
+ resolvedAt: TimestampSchema,
156
+ resolution: z
157
+ .strictObject({
158
+ harness: z.strictObject({ harnessId: HarnessIdSchema }),
159
+ model: z.union([
160
+ z.strictObject({ modelId: ModelIdSchema }),
161
+ z.strictObject({ withheld: DecisionResolutionDiagnosticSchema }),
162
+ ]),
163
+ skills: z.strictObject({
164
+ skillVersionIds: z.array(IdentifierSchemas.skillVersionId).max(64),
165
+ }),
166
+ capabilities: z.strictObject({ capabilityNames: z.array(CapabilityNameSchema).max(64) }),
167
+ runtime: AvailableRuntimeSchema,
168
+ sandbox: SandboxResolutionSchema,
169
+ contextPackage: z.strictObject({
170
+ mode: z.enum(['none', 'existing', 'author']),
171
+ contextPackageId: IdentifierSchemas.contextPackageId.optional(),
172
+ }),
173
+ delegation: DelegationResolutionSchema,
174
+ })
175
+ .strict(),
176
+ trace: z.record(z.string(), ResolvedOutputSchema),
177
+ diagnostics: z.array(DecisionResolutionDiagnosticSchema).max(16),
178
+ resolutionDigest: DigestSchema,
179
+ })
180
+ .strict();
181
+ //# sourceMappingURL=decision-resolution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decision-resol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CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;QACxF,OAAO,EAAE,sBAAsB;QAC/B,OAAO,EAAE,uBAAuB;QAChC,cAAc,EAAE,CAAC,CAAC,YAAY,CAAC;YAC7B,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;YAC5C,gBAAgB,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,QAAQ,EAAE;SAChE,CAAC;QACF,UAAU,EAAE,0BAA0B;KACvC,CAAC;SACD,MAAM,EAAE;IACX,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,oBAAoB,CAAC;IACjD,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAChE,gBAAgB,EAAE,YAAY;CAC/B,CAAC;KACD,MAAM,EAAE,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export * from './authentication.js';
2
+ export * from './canonical-json.js';
2
3
  export * from './control-api.js';
3
4
  export * from './context-providers.js';
5
+ export * from './decision-resolution.js';
4
6
  export * from './envelopes.js';
5
7
  export * from './fixtures.js';
6
8
  export * from './identifiers.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAE/B,eAAO,MAAM,WAAW,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAE/B,eAAO,MAAM,WAAW,cAAc,CAAA"}
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  export * from './authentication.js';
2
+ export * from './canonical-json.js';
2
3
  export * from './control-api.js';
3
4
  export * from './context-providers.js';
5
+ export * from './decision-resolution.js';
4
6
  export * from './envelopes.js';
5
7
  export * from './fixtures.js';
6
8
  export * from './identifiers.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAE/B,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAE/B,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/contracts",
3
- "version": "1.8.2",
3
+ "version": "1.9.1",
4
4
  "description": "Runtime-independent service boundary between Adea and the Control Plane: canonical identifiers, envelopes, Control API schemas, pagination, and versioning.",
5
5
  "keywords": [
6
6
  "agents",
@@ -40,10 +40,10 @@
40
40
  "test": "bun test --pass-with-no-tests"
41
41
  },
42
42
  "dependencies": {
43
- "zod": "4.5.4"
43
+ "zod": "4.6.5"
44
44
  },
45
45
  "engines": {
46
- "node": ">=24 <25"
46
+ "node": "24.18.0"
47
47
  },
48
48
  "devDependencies": {},
49
49
  "peerDependencies": {}