@adea-ai/contracts 3.0.1 → 3.1.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/dist/control-api.d.ts +318 -0
- package/dist/control-api.js +21 -1
- package/dist/decision-resolution.d.ts +110 -7
- package/dist/decision-resolution.js +85 -5
- package/package.json +1 -1
package/dist/control-api.d.ts
CHANGED
|
@@ -90,6 +90,322 @@ export declare const ProfileResolutionRequestSchema: z.ZodObject<{
|
|
|
90
90
|
profileVersionId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"profile-version ID">, string>>>;
|
|
91
91
|
}, z.core.$strip>;
|
|
92
92
|
}, z.core.$strip>;
|
|
93
|
+
/**
|
|
94
|
+
* The decision layer (control-plane#558) over the public API. The envelope carries the request
|
|
95
|
+
* identity; `parameters` are the decision inputs. Every composition resolves with the same
|
|
96
|
+
* policy, so a desktop or VPS Local composition and managed cloud answer alike, and nothing here
|
|
97
|
+
* executes.
|
|
98
|
+
*/
|
|
99
|
+
export declare const DecisionResolveRequestSchema: z.ZodObject<{
|
|
100
|
+
caller: typeof ServiceCallerAssertionSchema;
|
|
101
|
+
contractVersion: typeof ContractVersionSchema;
|
|
102
|
+
requestId: typeof IdentifierSchemas.requestId;
|
|
103
|
+
workspaceId: typeof IdentifierSchemas.workspaceId;
|
|
104
|
+
projectId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"project ID">, string>>>;
|
|
105
|
+
correlation: typeof CorrelationMetadataSchema;
|
|
106
|
+
operation: z.ZodLiteral<"decision.resolve">;
|
|
107
|
+
requestedAt: typeof TimestampSchema;
|
|
108
|
+
parameters: z.ZodObject<{
|
|
109
|
+
objective: z.ZodString;
|
|
110
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
111
|
+
auto: "auto";
|
|
112
|
+
customize: "customize";
|
|
113
|
+
}>>;
|
|
114
|
+
agentProfile: z.ZodObject<{
|
|
115
|
+
profileId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"profile ID">, string>>;
|
|
116
|
+
profileVersionId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"profile-version ID">, string>>>;
|
|
117
|
+
}, z.core.$strict>;
|
|
118
|
+
availableRuntimes: z.ZodArray<z.ZodObject<{
|
|
119
|
+
runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
|
|
120
|
+
kind: z.ZodEnum<{
|
|
121
|
+
local: "local";
|
|
122
|
+
}>;
|
|
123
|
+
host: z.ZodEnum<{
|
|
124
|
+
desktop: "desktop";
|
|
125
|
+
vps: "vps";
|
|
126
|
+
}>;
|
|
127
|
+
transport: z.ZodEnum<{
|
|
128
|
+
"direct-local": "direct-local";
|
|
129
|
+
}>;
|
|
130
|
+
harnessIds: z.ZodArray<z.ZodString>;
|
|
131
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
132
|
+
}, z.core.$strict>>;
|
|
133
|
+
entitlements: z.ZodObject<{
|
|
134
|
+
modelAccess: z.ZodEnum<{
|
|
135
|
+
byok: "byok";
|
|
136
|
+
"free-tier": "free-tier";
|
|
137
|
+
none: "none";
|
|
138
|
+
provisioned: "provisioned";
|
|
139
|
+
}>;
|
|
140
|
+
grantedCapabilityNames: z.ZodArray<z.ZodString>;
|
|
141
|
+
}, z.core.$strict>;
|
|
142
|
+
requiredCapabilities: z.ZodArray<z.ZodString>;
|
|
143
|
+
availableSkills: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
144
|
+
skillVersionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"skill-version ID">, string>>;
|
|
145
|
+
requiredCapabilities: z.ZodArray<z.ZodString>;
|
|
146
|
+
}, z.core.$strict>>>;
|
|
147
|
+
costLatencyPreference: z.ZodEnum<{
|
|
148
|
+
balanced: "balanced";
|
|
149
|
+
cost: "cost";
|
|
150
|
+
latency: "latency";
|
|
151
|
+
}>;
|
|
152
|
+
projectDefaults: z.ZodObject<{
|
|
153
|
+
harness: z.ZodOptional<z.ZodObject<{
|
|
154
|
+
harnessId: z.ZodString;
|
|
155
|
+
}, z.core.$strict>>;
|
|
156
|
+
model: z.ZodOptional<z.ZodObject<{
|
|
157
|
+
modelId: z.ZodString;
|
|
158
|
+
}, z.core.$strict>>;
|
|
159
|
+
skills: z.ZodOptional<z.ZodObject<{
|
|
160
|
+
skillVersionIds: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"skill-version ID">, string>>>;
|
|
161
|
+
}, z.core.$strict>>;
|
|
162
|
+
capabilities: z.ZodOptional<z.ZodObject<{
|
|
163
|
+
capabilityNames: z.ZodArray<z.ZodString>;
|
|
164
|
+
}, z.core.$strict>>;
|
|
165
|
+
runtime: z.ZodOptional<z.ZodObject<{
|
|
166
|
+
runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
|
|
167
|
+
}, z.core.$strict>>;
|
|
168
|
+
sandbox: z.ZodOptional<z.ZodObject<{
|
|
169
|
+
mode: z.ZodEnum<{
|
|
170
|
+
managed: "managed";
|
|
171
|
+
none: "none";
|
|
172
|
+
}>;
|
|
173
|
+
effectiveCapabilities: z.ZodArray<z.ZodString>;
|
|
174
|
+
}, z.core.$strict>>;
|
|
175
|
+
contextPackage: z.ZodOptional<z.ZodObject<{
|
|
176
|
+
mode: z.ZodEnum<{
|
|
177
|
+
author: "author";
|
|
178
|
+
existing: "existing";
|
|
179
|
+
none: "none";
|
|
180
|
+
}>;
|
|
181
|
+
contextPackageId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"ContextPackage ID">, string>>>;
|
|
182
|
+
}, z.core.$strict>>;
|
|
183
|
+
delegation: z.ZodOptional<z.ZodObject<{
|
|
184
|
+
fanOut: z.ZodEnum<{
|
|
185
|
+
bounded: "bounded";
|
|
186
|
+
none: "none";
|
|
187
|
+
}>;
|
|
188
|
+
maxChildren: z.ZodOptional<z.ZodNumber>;
|
|
189
|
+
promotion: z.ZodEnum<{
|
|
190
|
+
"auto-eligible": "auto-eligible";
|
|
191
|
+
"review-required": "review-required";
|
|
192
|
+
}>;
|
|
193
|
+
}, z.core.$strict>>;
|
|
194
|
+
}, z.core.$strict>;
|
|
195
|
+
profileDefaults: z.ZodObject<{
|
|
196
|
+
harness: z.ZodOptional<z.ZodObject<{
|
|
197
|
+
harnessId: z.ZodString;
|
|
198
|
+
}, z.core.$strict>>;
|
|
199
|
+
model: z.ZodOptional<z.ZodObject<{
|
|
200
|
+
modelId: z.ZodString;
|
|
201
|
+
}, z.core.$strict>>;
|
|
202
|
+
skills: z.ZodOptional<z.ZodObject<{
|
|
203
|
+
skillVersionIds: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"skill-version ID">, string>>>;
|
|
204
|
+
}, z.core.$strict>>;
|
|
205
|
+
capabilities: z.ZodOptional<z.ZodObject<{
|
|
206
|
+
capabilityNames: z.ZodArray<z.ZodString>;
|
|
207
|
+
}, z.core.$strict>>;
|
|
208
|
+
runtime: z.ZodOptional<z.ZodObject<{
|
|
209
|
+
runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
|
|
210
|
+
}, z.core.$strict>>;
|
|
211
|
+
sandbox: z.ZodOptional<z.ZodObject<{
|
|
212
|
+
mode: z.ZodEnum<{
|
|
213
|
+
managed: "managed";
|
|
214
|
+
none: "none";
|
|
215
|
+
}>;
|
|
216
|
+
effectiveCapabilities: z.ZodArray<z.ZodString>;
|
|
217
|
+
}, z.core.$strict>>;
|
|
218
|
+
contextPackage: z.ZodOptional<z.ZodObject<{
|
|
219
|
+
mode: z.ZodEnum<{
|
|
220
|
+
author: "author";
|
|
221
|
+
existing: "existing";
|
|
222
|
+
none: "none";
|
|
223
|
+
}>;
|
|
224
|
+
contextPackageId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"ContextPackage ID">, string>>>;
|
|
225
|
+
}, z.core.$strict>>;
|
|
226
|
+
delegation: z.ZodOptional<z.ZodObject<{
|
|
227
|
+
fanOut: z.ZodEnum<{
|
|
228
|
+
bounded: "bounded";
|
|
229
|
+
none: "none";
|
|
230
|
+
}>;
|
|
231
|
+
maxChildren: z.ZodOptional<z.ZodNumber>;
|
|
232
|
+
promotion: z.ZodEnum<{
|
|
233
|
+
"auto-eligible": "auto-eligible";
|
|
234
|
+
"review-required": "review-required";
|
|
235
|
+
}>;
|
|
236
|
+
}, z.core.$strict>>;
|
|
237
|
+
}, z.core.$strict>;
|
|
238
|
+
explicitPins: z.ZodObject<{
|
|
239
|
+
harness: z.ZodOptional<z.ZodObject<{
|
|
240
|
+
harnessId: z.ZodString;
|
|
241
|
+
}, z.core.$strict>>;
|
|
242
|
+
model: z.ZodOptional<z.ZodObject<{
|
|
243
|
+
modelId: z.ZodString;
|
|
244
|
+
}, z.core.$strict>>;
|
|
245
|
+
skills: z.ZodOptional<z.ZodObject<{
|
|
246
|
+
skillVersionIds: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"skill-version ID">, string>>>;
|
|
247
|
+
}, z.core.$strict>>;
|
|
248
|
+
capabilities: z.ZodOptional<z.ZodObject<{
|
|
249
|
+
capabilityNames: z.ZodArray<z.ZodString>;
|
|
250
|
+
}, z.core.$strict>>;
|
|
251
|
+
runtime: z.ZodOptional<z.ZodObject<{
|
|
252
|
+
runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
|
|
253
|
+
}, z.core.$strict>>;
|
|
254
|
+
sandbox: z.ZodOptional<z.ZodObject<{
|
|
255
|
+
mode: z.ZodEnum<{
|
|
256
|
+
managed: "managed";
|
|
257
|
+
none: "none";
|
|
258
|
+
}>;
|
|
259
|
+
effectiveCapabilities: z.ZodArray<z.ZodString>;
|
|
260
|
+
}, z.core.$strict>>;
|
|
261
|
+
contextPackage: z.ZodOptional<z.ZodObject<{
|
|
262
|
+
mode: z.ZodEnum<{
|
|
263
|
+
author: "author";
|
|
264
|
+
existing: "existing";
|
|
265
|
+
none: "none";
|
|
266
|
+
}>;
|
|
267
|
+
contextPackageId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"ContextPackage ID">, string>>>;
|
|
268
|
+
}, z.core.$strict>>;
|
|
269
|
+
delegation: z.ZodOptional<z.ZodObject<{
|
|
270
|
+
fanOut: z.ZodEnum<{
|
|
271
|
+
bounded: "bounded";
|
|
272
|
+
none: "none";
|
|
273
|
+
}>;
|
|
274
|
+
maxChildren: z.ZodOptional<z.ZodNumber>;
|
|
275
|
+
promotion: z.ZodEnum<{
|
|
276
|
+
"auto-eligible": "auto-eligible";
|
|
277
|
+
"review-required": "review-required";
|
|
278
|
+
}>;
|
|
279
|
+
}, z.core.$strict>>;
|
|
280
|
+
}, z.core.$strict>;
|
|
281
|
+
}, z.core.$strict>;
|
|
282
|
+
}, z.core.$strip>;
|
|
283
|
+
export declare const DecisionResolveResponseSchema: z.ZodObject<{
|
|
284
|
+
contractVersion: typeof ContractVersionSchema;
|
|
285
|
+
requestId: typeof IdentifierSchemas.requestId;
|
|
286
|
+
correlation: typeof CorrelationMetadataSchema;
|
|
287
|
+
data: z.ZodObject<{
|
|
288
|
+
schemaVersion: z.ZodNumber;
|
|
289
|
+
requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"request ID">, string>>;
|
|
290
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
|
|
291
|
+
contractVersion: z.ZodObject<{
|
|
292
|
+
major: z.ZodNumber;
|
|
293
|
+
minor: z.ZodNumber;
|
|
294
|
+
}, z.core.$strict>;
|
|
295
|
+
resolvedAt: z.ZodISODateTime;
|
|
296
|
+
mode: z.ZodEnum<{
|
|
297
|
+
auto: "auto";
|
|
298
|
+
customize: "customize";
|
|
299
|
+
}>;
|
|
300
|
+
resolution: z.ZodObject<{
|
|
301
|
+
harness: z.ZodObject<{
|
|
302
|
+
harnessId: z.ZodString;
|
|
303
|
+
}, z.core.$strict>;
|
|
304
|
+
model: z.ZodUnion<readonly [z.ZodObject<{
|
|
305
|
+
modelId: z.ZodString;
|
|
306
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
307
|
+
withheld: z.ZodEnum<{
|
|
308
|
+
AUTO_MODE_EXPLICIT_PIN: "AUTO_MODE_EXPLICIT_PIN";
|
|
309
|
+
CAPABILITY_BEYOND_GRANT: "CAPABILITY_BEYOND_GRANT";
|
|
310
|
+
CONTEXT_PACKAGE_PIN_MISMATCH: "CONTEXT_PACKAGE_PIN_MISMATCH";
|
|
311
|
+
DELEGATION_BEYOND_POLICY: "DELEGATION_BEYOND_POLICY";
|
|
312
|
+
HARNESS_MAP_CONFLICTS_WITH_PIN: "HARNESS_MAP_CONFLICTS_WITH_PIN";
|
|
313
|
+
HARNESS_MAP_MODEL_ABSENT: "HARNESS_MAP_MODEL_ABSENT";
|
|
314
|
+
HARNESS_MAP_MODEL_UNMAPPED: "HARNESS_MAP_MODEL_UNMAPPED";
|
|
315
|
+
HARNESS_UNAVAILABLE_ON_PINNED_RUNTIME: "HARNESS_UNAVAILABLE_ON_PINNED_RUNTIME";
|
|
316
|
+
MODEL_ACCESS_NOT_ENTITLED: "MODEL_ACCESS_NOT_ENTITLED";
|
|
317
|
+
NO_COMPATIBLE_RUNTIME: "NO_COMPATIBLE_RUNTIME";
|
|
318
|
+
NO_DEFAULT_MODEL: "NO_DEFAULT_MODEL";
|
|
319
|
+
SKILL_BEYOND_CAPABILITIES: "SKILL_BEYOND_CAPABILITIES";
|
|
320
|
+
SKILL_UNAVAILABLE: "SKILL_UNAVAILABLE";
|
|
321
|
+
UNSUPPORTED_RUNTIME_PIN: "UNSUPPORTED_RUNTIME_PIN";
|
|
322
|
+
}>;
|
|
323
|
+
}, z.core.$strict>]>;
|
|
324
|
+
skills: z.ZodObject<{
|
|
325
|
+
skillVersionIds: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"skill-version ID">, string>>>;
|
|
326
|
+
}, z.core.$strict>;
|
|
327
|
+
capabilities: z.ZodObject<{
|
|
328
|
+
capabilityNames: z.ZodArray<z.ZodString>;
|
|
329
|
+
}, z.core.$strict>;
|
|
330
|
+
runtime: z.ZodObject<{
|
|
331
|
+
runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
|
|
332
|
+
kind: z.ZodEnum<{
|
|
333
|
+
local: "local";
|
|
334
|
+
}>;
|
|
335
|
+
host: z.ZodEnum<{
|
|
336
|
+
desktop: "desktop";
|
|
337
|
+
vps: "vps";
|
|
338
|
+
}>;
|
|
339
|
+
transport: z.ZodEnum<{
|
|
340
|
+
"direct-local": "direct-local";
|
|
341
|
+
}>;
|
|
342
|
+
harnessIds: z.ZodArray<z.ZodString>;
|
|
343
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
344
|
+
}, z.core.$strict>;
|
|
345
|
+
sandbox: z.ZodObject<{
|
|
346
|
+
mode: z.ZodEnum<{
|
|
347
|
+
managed: "managed";
|
|
348
|
+
none: "none";
|
|
349
|
+
}>;
|
|
350
|
+
effectiveCapabilities: z.ZodArray<z.ZodString>;
|
|
351
|
+
}, z.core.$strict>;
|
|
352
|
+
contextPackage: z.ZodObject<{
|
|
353
|
+
mode: z.ZodEnum<{
|
|
354
|
+
author: "author";
|
|
355
|
+
existing: "existing";
|
|
356
|
+
none: "none";
|
|
357
|
+
}>;
|
|
358
|
+
contextPackageId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"ContextPackage ID">, string>>>;
|
|
359
|
+
}, z.core.$strict>;
|
|
360
|
+
delegation: z.ZodObject<{
|
|
361
|
+
fanOut: z.ZodEnum<{
|
|
362
|
+
bounded: "bounded";
|
|
363
|
+
none: "none";
|
|
364
|
+
}>;
|
|
365
|
+
maxChildren: z.ZodOptional<z.ZodNumber>;
|
|
366
|
+
promotion: z.ZodEnum<{
|
|
367
|
+
"auto-eligible": "auto-eligible";
|
|
368
|
+
"review-required": "review-required";
|
|
369
|
+
}>;
|
|
370
|
+
identity: z.ZodObject<{
|
|
371
|
+
servicePrincipalId: z.ZodString;
|
|
372
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
|
|
373
|
+
projectId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"project ID">, string>>>;
|
|
374
|
+
}, z.core.$strict>;
|
|
375
|
+
childCeiling: z.ZodObject<{
|
|
376
|
+
runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
|
|
377
|
+
capabilityNames: z.ZodArray<z.ZodString>;
|
|
378
|
+
}, z.core.$strict>;
|
|
379
|
+
}, z.core.$strict>;
|
|
380
|
+
}, z.core.$strict>;
|
|
381
|
+
trace: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
382
|
+
source: z.ZodEnum<{
|
|
383
|
+
"explicit-pin": "explicit-pin";
|
|
384
|
+
"policy-default": "policy-default";
|
|
385
|
+
"profile-default": "profile-default";
|
|
386
|
+
"project-default": "project-default";
|
|
387
|
+
}>;
|
|
388
|
+
value: z.ZodJSONSchema;
|
|
389
|
+
}, z.core.$strict>>;
|
|
390
|
+
diagnostics: z.ZodArray<z.ZodEnum<{
|
|
391
|
+
AUTO_MODE_EXPLICIT_PIN: "AUTO_MODE_EXPLICIT_PIN";
|
|
392
|
+
CAPABILITY_BEYOND_GRANT: "CAPABILITY_BEYOND_GRANT";
|
|
393
|
+
CONTEXT_PACKAGE_PIN_MISMATCH: "CONTEXT_PACKAGE_PIN_MISMATCH";
|
|
394
|
+
DELEGATION_BEYOND_POLICY: "DELEGATION_BEYOND_POLICY";
|
|
395
|
+
HARNESS_MAP_CONFLICTS_WITH_PIN: "HARNESS_MAP_CONFLICTS_WITH_PIN";
|
|
396
|
+
HARNESS_MAP_MODEL_ABSENT: "HARNESS_MAP_MODEL_ABSENT";
|
|
397
|
+
HARNESS_MAP_MODEL_UNMAPPED: "HARNESS_MAP_MODEL_UNMAPPED";
|
|
398
|
+
HARNESS_UNAVAILABLE_ON_PINNED_RUNTIME: "HARNESS_UNAVAILABLE_ON_PINNED_RUNTIME";
|
|
399
|
+
MODEL_ACCESS_NOT_ENTITLED: "MODEL_ACCESS_NOT_ENTITLED";
|
|
400
|
+
NO_COMPATIBLE_RUNTIME: "NO_COMPATIBLE_RUNTIME";
|
|
401
|
+
NO_DEFAULT_MODEL: "NO_DEFAULT_MODEL";
|
|
402
|
+
SKILL_BEYOND_CAPABILITIES: "SKILL_BEYOND_CAPABILITIES";
|
|
403
|
+
SKILL_UNAVAILABLE: "SKILL_UNAVAILABLE";
|
|
404
|
+
UNSUPPORTED_RUNTIME_PIN: "UNSUPPORTED_RUNTIME_PIN";
|
|
405
|
+
}>>;
|
|
406
|
+
resolutionDigest: z.ZodString;
|
|
407
|
+
}, z.core.$strict>;
|
|
408
|
+
}, z.core.$strip>;
|
|
93
409
|
export declare const ProfileResolutionResponseSchema: z.ZodObject<{
|
|
94
410
|
contractVersion: typeof ContractVersionSchema;
|
|
95
411
|
requestId: typeof IdentifierSchemas.requestId;
|
|
@@ -930,6 +1246,8 @@ export type InteractionResponseCommand = z.input<typeof InteractionResponseComma
|
|
|
930
1246
|
export type InteractionResponseCommandResult = z.output<typeof InteractionResponseCommandResultSchema>;
|
|
931
1247
|
export type ServiceAuthenticationRequest = z.input<typeof ServiceAuthenticationRequestSchema>;
|
|
932
1248
|
export type ServiceAuthenticationResponse = z.output<typeof ServiceAuthenticationResponseSchema>;
|
|
1249
|
+
export type DecisionResolveRequest = z.input<typeof DecisionResolveRequestSchema>;
|
|
1250
|
+
export type DecisionResolveResponse = z.output<typeof DecisionResolveResponseSchema>;
|
|
933
1251
|
export type ProfileResolutionRequest = z.input<typeof ProfileResolutionRequestSchema>;
|
|
934
1252
|
export type ProfileResolutionResponse = z.output<typeof ProfileResolutionResponseSchema>;
|
|
935
1253
|
export type ProjectStateResolutionRequest = z.input<typeof ProjectStateResolutionRequestSchema>;
|
package/dist/control-api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ServiceCallerAssertionSchema, ServiceScopeSchema } from './authentication.js';
|
|
3
3
|
import { executionScopeFields, validateExecutionScopeFields } from './execution-scope.js';
|
|
4
|
-
import { ModelIdSchema } from './decision-resolution.js';
|
|
4
|
+
import { DecisionLayerResolutionSchema, DecisionResolutionRequestSchema, ModelIdSchema, } from './decision-resolution.js';
|
|
5
5
|
import { CorrelationMetadataSchema } from './envelopes.js';
|
|
6
6
|
import { IdentifierSchemas } from './identifiers.js';
|
|
7
7
|
import { CursorSchema } from './pagination.js';
|
|
@@ -104,6 +104,26 @@ export const ProfileResolutionRequestSchema = RequestContextSchema.extend({
|
|
|
104
104
|
profileVersionId: IdentifierSchemas.profileVersionId.optional(),
|
|
105
105
|
}),
|
|
106
106
|
});
|
|
107
|
+
/**
|
|
108
|
+
* The decision layer (control-plane#558) over the public API. The envelope carries the request
|
|
109
|
+
* identity; `parameters` are the decision inputs. Every composition resolves with the same
|
|
110
|
+
* policy, so a desktop or VPS Local composition and managed cloud answer alike, and nothing here
|
|
111
|
+
* executes.
|
|
112
|
+
*/
|
|
113
|
+
export const DecisionResolveRequestSchema = RequestContextSchema.extend({
|
|
114
|
+
operation: z.literal('decision.resolve'),
|
|
115
|
+
requestedAt: TimestampSchema,
|
|
116
|
+
parameters: DecisionResolutionRequestSchema.omit({
|
|
117
|
+
caller: true,
|
|
118
|
+
contractVersion: true,
|
|
119
|
+
requestId: true,
|
|
120
|
+
workspaceId: true,
|
|
121
|
+
projectId: true,
|
|
122
|
+
correlation: true,
|
|
123
|
+
requestedAt: true,
|
|
124
|
+
}),
|
|
125
|
+
});
|
|
126
|
+
export const DecisionResolveResponseSchema = successResponse(DecisionLayerResolutionSchema);
|
|
107
127
|
export const ProfileResolutionResponseSchema = successResponse(z.object({
|
|
108
128
|
profile: z.object({
|
|
109
129
|
profileId: IdentifierSchemas.profileId,
|
|
@@ -10,10 +10,23 @@ import { z } from 'zod';
|
|
|
10
10
|
* explicit user pin > project default > profile default > policy default.
|
|
11
11
|
* Policy enforcement remains the PolicyDecisionPoint authorize() call; a
|
|
12
12
|
* resolution selects, it never authorizes.
|
|
13
|
+
*
|
|
14
|
+
* Two surfaces sit on this one contract. The developer surface pins any
|
|
15
|
+
* subset of the outputs (`mode: 'customize'`). The consumer surface is
|
|
16
|
+
* `Agent: <profile>` plus `Mode: Auto | Customize`: Auto resolves every output
|
|
17
|
+
* from the profile, project and policy layers and carries no explicit pins;
|
|
18
|
+
* Customize is the developer surface. Explicit selection is authoritative: a
|
|
19
|
+
* pin the request cannot honor is denied, never replaced.
|
|
20
|
+
*
|
|
21
|
+
* Execution runs only on the user's own machines (a desktop or a VPS running
|
|
22
|
+
* the Local composition). Managed cloud resolves decisions but runs nothing,
|
|
23
|
+
* so every runtime is a Local runtime on a named host.
|
|
24
|
+
*
|
|
25
|
+
* Spec: docs/architecture/decision-558-resolution-contract.md.
|
|
13
26
|
*/
|
|
14
27
|
export declare const DECISION_RESOLUTION_CONTRACT_VERSION: Readonly<{
|
|
15
28
|
major: 1;
|
|
16
|
-
minor:
|
|
29
|
+
minor: 1;
|
|
17
30
|
}>;
|
|
18
31
|
export declare const HarnessIdSchema: z.ZodString;
|
|
19
32
|
export declare const ModelIdSchema: z.ZodString;
|
|
@@ -38,6 +51,7 @@ export declare const SandboxResolutionSchema: z.ZodObject<{
|
|
|
38
51
|
effectiveCapabilities: z.ZodArray<z.ZodString>;
|
|
39
52
|
}, z.core.$strict>;
|
|
40
53
|
export type SandboxResolution = z.output<typeof SandboxResolutionSchema>;
|
|
54
|
+
/** A delegation pin or default: the fan-out policy only, never an identity. */
|
|
41
55
|
export declare const DelegationResolutionSchema: z.ZodObject<{
|
|
42
56
|
fanOut: z.ZodEnum<{
|
|
43
57
|
bounded: "bounded";
|
|
@@ -50,6 +64,56 @@ export declare const DelegationResolutionSchema: z.ZodObject<{
|
|
|
50
64
|
}>;
|
|
51
65
|
}, z.core.$strict>;
|
|
52
66
|
export type DelegationResolution = z.output<typeof DelegationResolutionSchema>;
|
|
67
|
+
/**
|
|
68
|
+
* The delegation policy a resolution carries. Children resolve through the
|
|
69
|
+
* Control Plane identity of the parent request — the same service principal,
|
|
70
|
+
* workspace and project — and inherit the parent's runtime, so a child never
|
|
71
|
+
* moves to another machine. Their capabilities are bounded by the parent's
|
|
72
|
+
* effective sandbox capabilities. None of this is pinnable: the identity and
|
|
73
|
+
* the ceiling are derived, so a pin cannot widen them.
|
|
74
|
+
*/
|
|
75
|
+
export declare const ResolvedDelegationSchema: z.ZodObject<{
|
|
76
|
+
fanOut: z.ZodEnum<{
|
|
77
|
+
bounded: "bounded";
|
|
78
|
+
none: "none";
|
|
79
|
+
}>;
|
|
80
|
+
maxChildren: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
promotion: z.ZodEnum<{
|
|
82
|
+
"auto-eligible": "auto-eligible";
|
|
83
|
+
"review-required": "review-required";
|
|
84
|
+
}>;
|
|
85
|
+
identity: z.ZodObject<{
|
|
86
|
+
servicePrincipalId: z.ZodString;
|
|
87
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
|
|
88
|
+
projectId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"project ID">, string>>>;
|
|
89
|
+
}, z.core.$strict>;
|
|
90
|
+
childCeiling: z.ZodObject<{
|
|
91
|
+
runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
|
|
92
|
+
capabilityNames: z.ZodArray<z.ZodString>;
|
|
93
|
+
}, z.core.$strict>;
|
|
94
|
+
}, z.core.$strict>;
|
|
95
|
+
export type ResolvedDelegation = z.output<typeof ResolvedDelegationSchema>;
|
|
96
|
+
/**
|
|
97
|
+
* Consumer `Mode`. `auto` resolves every output and refuses explicit pins;
|
|
98
|
+
* `customize` honors them. An absent mode is `customize`, the developer
|
|
99
|
+
* surface.
|
|
100
|
+
*/
|
|
101
|
+
export declare const DecisionModeSchema: z.ZodEnum<{
|
|
102
|
+
auto: "auto";
|
|
103
|
+
customize: "customize";
|
|
104
|
+
}>;
|
|
105
|
+
export type DecisionMode = z.output<typeof DecisionModeSchema>;
|
|
106
|
+
/**
|
|
107
|
+
* A skill the request may resolve: a published, approved skill version and
|
|
108
|
+
* the capabilities it needs. When the request lists its available skills,
|
|
109
|
+
* every resolved skill must be one of them and its capabilities must be
|
|
110
|
+
* inside the resolved capability set.
|
|
111
|
+
*/
|
|
112
|
+
export declare const AvailableSkillSchema: z.ZodObject<{
|
|
113
|
+
skillVersionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"skill-version ID">, string>>;
|
|
114
|
+
requiredCapabilities: z.ZodArray<z.ZodString>;
|
|
115
|
+
}, z.core.$strict>;
|
|
116
|
+
export type AvailableSkill = z.output<typeof AvailableSkillSchema>;
|
|
53
117
|
/**
|
|
54
118
|
* Every output the decision layer resolves. Pins make any subset explicit;
|
|
55
119
|
* unpinned outputs still resolve.
|
|
@@ -108,9 +172,11 @@ export type ModelAccessEntitlement = z.output<typeof ModelAccessEntitlementSchem
|
|
|
108
172
|
export declare const AvailableRuntimeSchema: z.ZodObject<{
|
|
109
173
|
runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
|
|
110
174
|
kind: z.ZodEnum<{
|
|
111
|
-
cloud: "cloud";
|
|
112
175
|
local: "local";
|
|
113
|
-
|
|
176
|
+
}>;
|
|
177
|
+
host: z.ZodEnum<{
|
|
178
|
+
desktop: "desktop";
|
|
179
|
+
vps: "vps";
|
|
114
180
|
}>;
|
|
115
181
|
transport: z.ZodEnum<{
|
|
116
182
|
"direct-local": "direct-local";
|
|
@@ -137,6 +203,10 @@ export declare const DecisionResolutionRequestSchema: z.ZodObject<{
|
|
|
137
203
|
}, z.core.$strip>;
|
|
138
204
|
requestedAt: z.ZodISODateTime;
|
|
139
205
|
objective: z.ZodString;
|
|
206
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
207
|
+
auto: "auto";
|
|
208
|
+
customize: "customize";
|
|
209
|
+
}>>;
|
|
140
210
|
agentProfile: z.ZodObject<{
|
|
141
211
|
profileId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"profile ID">, string>>;
|
|
142
212
|
profileVersionId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"profile-version ID">, string>>>;
|
|
@@ -144,9 +214,11 @@ export declare const DecisionResolutionRequestSchema: z.ZodObject<{
|
|
|
144
214
|
availableRuntimes: z.ZodArray<z.ZodObject<{
|
|
145
215
|
runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
|
|
146
216
|
kind: z.ZodEnum<{
|
|
147
|
-
cloud: "cloud";
|
|
148
217
|
local: "local";
|
|
149
|
-
|
|
218
|
+
}>;
|
|
219
|
+
host: z.ZodEnum<{
|
|
220
|
+
desktop: "desktop";
|
|
221
|
+
vps: "vps";
|
|
150
222
|
}>;
|
|
151
223
|
transport: z.ZodEnum<{
|
|
152
224
|
"direct-local": "direct-local";
|
|
@@ -164,6 +236,10 @@ export declare const DecisionResolutionRequestSchema: z.ZodObject<{
|
|
|
164
236
|
grantedCapabilityNames: z.ZodArray<z.ZodString>;
|
|
165
237
|
}, z.core.$strict>;
|
|
166
238
|
requiredCapabilities: z.ZodArray<z.ZodString>;
|
|
239
|
+
availableSkills: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
240
|
+
skillVersionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"skill-version ID">, string>>;
|
|
241
|
+
requiredCapabilities: z.ZodArray<z.ZodString>;
|
|
242
|
+
}, z.core.$strict>>>;
|
|
167
243
|
costLatencyPreference: z.ZodEnum<{
|
|
168
244
|
balanced: "balanced";
|
|
169
245
|
cost: "cost";
|
|
@@ -302,8 +378,10 @@ export declare const DecisionResolutionRequestSchema: z.ZodObject<{
|
|
|
302
378
|
export type DecisionResolutionRequest = z.output<typeof DecisionResolutionRequestSchema>;
|
|
303
379
|
/** Fail-closed denial codes; a denial never narrows silently. */
|
|
304
380
|
export declare const DecisionResolutionDiagnosticSchema: z.ZodEnum<{
|
|
381
|
+
AUTO_MODE_EXPLICIT_PIN: "AUTO_MODE_EXPLICIT_PIN";
|
|
305
382
|
CAPABILITY_BEYOND_GRANT: "CAPABILITY_BEYOND_GRANT";
|
|
306
383
|
CONTEXT_PACKAGE_PIN_MISMATCH: "CONTEXT_PACKAGE_PIN_MISMATCH";
|
|
384
|
+
DELEGATION_BEYOND_POLICY: "DELEGATION_BEYOND_POLICY";
|
|
307
385
|
HARNESS_MAP_CONFLICTS_WITH_PIN: "HARNESS_MAP_CONFLICTS_WITH_PIN";
|
|
308
386
|
HARNESS_MAP_MODEL_ABSENT: "HARNESS_MAP_MODEL_ABSENT";
|
|
309
387
|
HARNESS_MAP_MODEL_UNMAPPED: "HARNESS_MAP_MODEL_UNMAPPED";
|
|
@@ -311,6 +389,8 @@ export declare const DecisionResolutionDiagnosticSchema: z.ZodEnum<{
|
|
|
311
389
|
MODEL_ACCESS_NOT_ENTITLED: "MODEL_ACCESS_NOT_ENTITLED";
|
|
312
390
|
NO_COMPATIBLE_RUNTIME: "NO_COMPATIBLE_RUNTIME";
|
|
313
391
|
NO_DEFAULT_MODEL: "NO_DEFAULT_MODEL";
|
|
392
|
+
SKILL_BEYOND_CAPABILITIES: "SKILL_BEYOND_CAPABILITIES";
|
|
393
|
+
SKILL_UNAVAILABLE: "SKILL_UNAVAILABLE";
|
|
314
394
|
UNSUPPORTED_RUNTIME_PIN: "UNSUPPORTED_RUNTIME_PIN";
|
|
315
395
|
}>;
|
|
316
396
|
export type DecisionResolutionDiagnostic = z.output<typeof DecisionResolutionDiagnosticSchema>;
|
|
@@ -334,6 +414,10 @@ export declare const DecisionLayerResolutionSchema: z.ZodObject<{
|
|
|
334
414
|
minor: z.ZodNumber;
|
|
335
415
|
}, z.core.$strict>;
|
|
336
416
|
resolvedAt: z.ZodISODateTime;
|
|
417
|
+
mode: z.ZodEnum<{
|
|
418
|
+
auto: "auto";
|
|
419
|
+
customize: "customize";
|
|
420
|
+
}>;
|
|
337
421
|
resolution: z.ZodObject<{
|
|
338
422
|
harness: z.ZodObject<{
|
|
339
423
|
harnessId: z.ZodString;
|
|
@@ -342,8 +426,10 @@ export declare const DecisionLayerResolutionSchema: z.ZodObject<{
|
|
|
342
426
|
modelId: z.ZodString;
|
|
343
427
|
}, z.core.$strict>, z.ZodObject<{
|
|
344
428
|
withheld: z.ZodEnum<{
|
|
429
|
+
AUTO_MODE_EXPLICIT_PIN: "AUTO_MODE_EXPLICIT_PIN";
|
|
345
430
|
CAPABILITY_BEYOND_GRANT: "CAPABILITY_BEYOND_GRANT";
|
|
346
431
|
CONTEXT_PACKAGE_PIN_MISMATCH: "CONTEXT_PACKAGE_PIN_MISMATCH";
|
|
432
|
+
DELEGATION_BEYOND_POLICY: "DELEGATION_BEYOND_POLICY";
|
|
347
433
|
HARNESS_MAP_CONFLICTS_WITH_PIN: "HARNESS_MAP_CONFLICTS_WITH_PIN";
|
|
348
434
|
HARNESS_MAP_MODEL_ABSENT: "HARNESS_MAP_MODEL_ABSENT";
|
|
349
435
|
HARNESS_MAP_MODEL_UNMAPPED: "HARNESS_MAP_MODEL_UNMAPPED";
|
|
@@ -351,6 +437,8 @@ export declare const DecisionLayerResolutionSchema: z.ZodObject<{
|
|
|
351
437
|
MODEL_ACCESS_NOT_ENTITLED: "MODEL_ACCESS_NOT_ENTITLED";
|
|
352
438
|
NO_COMPATIBLE_RUNTIME: "NO_COMPATIBLE_RUNTIME";
|
|
353
439
|
NO_DEFAULT_MODEL: "NO_DEFAULT_MODEL";
|
|
440
|
+
SKILL_BEYOND_CAPABILITIES: "SKILL_BEYOND_CAPABILITIES";
|
|
441
|
+
SKILL_UNAVAILABLE: "SKILL_UNAVAILABLE";
|
|
354
442
|
UNSUPPORTED_RUNTIME_PIN: "UNSUPPORTED_RUNTIME_PIN";
|
|
355
443
|
}>;
|
|
356
444
|
}, z.core.$strict>]>;
|
|
@@ -363,9 +451,11 @@ export declare const DecisionLayerResolutionSchema: z.ZodObject<{
|
|
|
363
451
|
runtime: z.ZodObject<{
|
|
364
452
|
runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
|
|
365
453
|
kind: z.ZodEnum<{
|
|
366
|
-
cloud: "cloud";
|
|
367
454
|
local: "local";
|
|
368
|
-
|
|
455
|
+
}>;
|
|
456
|
+
host: z.ZodEnum<{
|
|
457
|
+
desktop: "desktop";
|
|
458
|
+
vps: "vps";
|
|
369
459
|
}>;
|
|
370
460
|
transport: z.ZodEnum<{
|
|
371
461
|
"direct-local": "direct-local";
|
|
@@ -398,6 +488,15 @@ export declare const DecisionLayerResolutionSchema: z.ZodObject<{
|
|
|
398
488
|
"auto-eligible": "auto-eligible";
|
|
399
489
|
"review-required": "review-required";
|
|
400
490
|
}>;
|
|
491
|
+
identity: z.ZodObject<{
|
|
492
|
+
servicePrincipalId: z.ZodString;
|
|
493
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
|
|
494
|
+
projectId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"project ID">, string>>>;
|
|
495
|
+
}, z.core.$strict>;
|
|
496
|
+
childCeiling: z.ZodObject<{
|
|
497
|
+
runtimeDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"runtime-definition ID">, string>>;
|
|
498
|
+
capabilityNames: z.ZodArray<z.ZodString>;
|
|
499
|
+
}, z.core.$strict>;
|
|
401
500
|
}, z.core.$strict>;
|
|
402
501
|
}, z.core.$strict>;
|
|
403
502
|
trace: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -410,8 +509,10 @@ export declare const DecisionLayerResolutionSchema: z.ZodObject<{
|
|
|
410
509
|
value: z.ZodJSONSchema;
|
|
411
510
|
}, z.core.$strict>>;
|
|
412
511
|
diagnostics: z.ZodArray<z.ZodEnum<{
|
|
512
|
+
AUTO_MODE_EXPLICIT_PIN: "AUTO_MODE_EXPLICIT_PIN";
|
|
413
513
|
CAPABILITY_BEYOND_GRANT: "CAPABILITY_BEYOND_GRANT";
|
|
414
514
|
CONTEXT_PACKAGE_PIN_MISMATCH: "CONTEXT_PACKAGE_PIN_MISMATCH";
|
|
515
|
+
DELEGATION_BEYOND_POLICY: "DELEGATION_BEYOND_POLICY";
|
|
415
516
|
HARNESS_MAP_CONFLICTS_WITH_PIN: "HARNESS_MAP_CONFLICTS_WITH_PIN";
|
|
416
517
|
HARNESS_MAP_MODEL_ABSENT: "HARNESS_MAP_MODEL_ABSENT";
|
|
417
518
|
HARNESS_MAP_MODEL_UNMAPPED: "HARNESS_MAP_MODEL_UNMAPPED";
|
|
@@ -419,6 +520,8 @@ export declare const DecisionLayerResolutionSchema: z.ZodObject<{
|
|
|
419
520
|
MODEL_ACCESS_NOT_ENTITLED: "MODEL_ACCESS_NOT_ENTITLED";
|
|
420
521
|
NO_COMPATIBLE_RUNTIME: "NO_COMPATIBLE_RUNTIME";
|
|
421
522
|
NO_DEFAULT_MODEL: "NO_DEFAULT_MODEL";
|
|
523
|
+
SKILL_BEYOND_CAPABILITIES: "SKILL_BEYOND_CAPABILITIES";
|
|
524
|
+
SKILL_UNAVAILABLE: "SKILL_UNAVAILABLE";
|
|
422
525
|
UNSUPPORTED_RUNTIME_PIN: "UNSUPPORTED_RUNTIME_PIN";
|
|
423
526
|
}>>;
|
|
424
527
|
resolutionDigest: z.ZodString;
|
|
@@ -14,8 +14,21 @@ import { ContractVersionSchema } from './versioning.js';
|
|
|
14
14
|
* explicit user pin > project default > profile default > policy default.
|
|
15
15
|
* Policy enforcement remains the PolicyDecisionPoint authorize() call; a
|
|
16
16
|
* resolution selects, it never authorizes.
|
|
17
|
+
*
|
|
18
|
+
* Two surfaces sit on this one contract. The developer surface pins any
|
|
19
|
+
* subset of the outputs (`mode: 'customize'`). The consumer surface is
|
|
20
|
+
* `Agent: <profile>` plus `Mode: Auto | Customize`: Auto resolves every output
|
|
21
|
+
* from the profile, project and policy layers and carries no explicit pins;
|
|
22
|
+
* Customize is the developer surface. Explicit selection is authoritative: a
|
|
23
|
+
* pin the request cannot honor is denied, never replaced.
|
|
24
|
+
*
|
|
25
|
+
* Execution runs only on the user's own machines (a desktop or a VPS running
|
|
26
|
+
* the Local composition). Managed cloud resolves decisions but runs nothing,
|
|
27
|
+
* so every runtime is a Local runtime on a named host.
|
|
28
|
+
*
|
|
29
|
+
* Spec: docs/architecture/decision-558-resolution-contract.md.
|
|
17
30
|
*/
|
|
18
|
-
export const DECISION_RESOLUTION_CONTRACT_VERSION = Object.freeze({ major: 1, minor:
|
|
31
|
+
export const DECISION_RESOLUTION_CONTRACT_VERSION = Object.freeze({ major: 1, minor: 1 });
|
|
19
32
|
const TimestampSchema = z.iso.datetime();
|
|
20
33
|
const DigestSchema = z.string().regex(/^sha256:[a-f0-9]{64}$/);
|
|
21
34
|
const CapabilityNameSchema = z
|
|
@@ -33,6 +46,15 @@ export const ModelIdSchema = z
|
|
|
33
46
|
.min(1)
|
|
34
47
|
.max(128)
|
|
35
48
|
.regex(/^[a-z0-9][a-z0-9._/-]*$/i);
|
|
49
|
+
/**
|
|
50
|
+
* A model the decision layer resolves: the same spelling a provider model selection accepts
|
|
51
|
+
* (model-connections `providerModel`), so every selectable model can be pinned and resolved.
|
|
52
|
+
*/
|
|
53
|
+
const DecisionModelIdSchema = z
|
|
54
|
+
.string()
|
|
55
|
+
.min(1)
|
|
56
|
+
.max(256)
|
|
57
|
+
.regex(/^[a-z0-9][a-z0-9._:/-]*$/i);
|
|
36
58
|
/** Where a resolved output value came from. Precedence order is list order. */
|
|
37
59
|
export const ResolutionSourceSchema = z.enum([
|
|
38
60
|
'explicit-pin',
|
|
@@ -51,6 +73,7 @@ export const SandboxResolutionSchema = z
|
|
|
51
73
|
effectiveCapabilities: z.array(CapabilityNameSchema).max(64),
|
|
52
74
|
})
|
|
53
75
|
.strict();
|
|
76
|
+
/** A delegation pin or default: the fan-out policy only, never an identity. */
|
|
54
77
|
export const DelegationResolutionSchema = z
|
|
55
78
|
.object({
|
|
56
79
|
fanOut: z.enum(['none', 'bounded']),
|
|
@@ -67,6 +90,48 @@ export const DelegationResolutionSchema = z
|
|
|
67
90
|
});
|
|
68
91
|
}
|
|
69
92
|
});
|
|
93
|
+
/**
|
|
94
|
+
* The delegation policy a resolution carries. Children resolve through the
|
|
95
|
+
* Control Plane identity of the parent request — the same service principal,
|
|
96
|
+
* workspace and project — and inherit the parent's runtime, so a child never
|
|
97
|
+
* moves to another machine. Their capabilities are bounded by the parent's
|
|
98
|
+
* effective sandbox capabilities. None of this is pinnable: the identity and
|
|
99
|
+
* the ceiling are derived, so a pin cannot widen them.
|
|
100
|
+
*/
|
|
101
|
+
export const ResolvedDelegationSchema = z
|
|
102
|
+
.object({
|
|
103
|
+
fanOut: z.enum(['none', 'bounded']),
|
|
104
|
+
maxChildren: z.number().int().min(0).max(8).optional(),
|
|
105
|
+
promotion: z.enum(['review-required', 'auto-eligible']),
|
|
106
|
+
identity: z.strictObject({
|
|
107
|
+
servicePrincipalId: ServiceCallerAssertionSchema.shape.servicePrincipalId,
|
|
108
|
+
workspaceId: IdentifierSchemas.workspaceId,
|
|
109
|
+
projectId: IdentifierSchemas.projectId.optional(),
|
|
110
|
+
}),
|
|
111
|
+
childCeiling: z.strictObject({
|
|
112
|
+
runtimeDefinitionId: IdentifierSchemas.runtimeDefinitionId,
|
|
113
|
+
capabilityNames: z.array(CapabilityNameSchema).max(64),
|
|
114
|
+
}),
|
|
115
|
+
})
|
|
116
|
+
.strict();
|
|
117
|
+
/**
|
|
118
|
+
* Consumer `Mode`. `auto` resolves every output and refuses explicit pins;
|
|
119
|
+
* `customize` honors them. An absent mode is `customize`, the developer
|
|
120
|
+
* surface.
|
|
121
|
+
*/
|
|
122
|
+
export const DecisionModeSchema = z.enum(['auto', 'customize']);
|
|
123
|
+
/**
|
|
124
|
+
* A skill the request may resolve: a published, approved skill version and
|
|
125
|
+
* the capabilities it needs. When the request lists its available skills,
|
|
126
|
+
* every resolved skill must be one of them and its capabilities must be
|
|
127
|
+
* inside the resolved capability set.
|
|
128
|
+
*/
|
|
129
|
+
export const AvailableSkillSchema = z
|
|
130
|
+
.object({
|
|
131
|
+
skillVersionId: IdentifierSchemas.skillVersionId,
|
|
132
|
+
requiredCapabilities: z.array(CapabilityNameSchema).max(64),
|
|
133
|
+
})
|
|
134
|
+
.strict();
|
|
70
135
|
/**
|
|
71
136
|
* Every output the decision layer resolves. Pins make any subset explicit;
|
|
72
137
|
* unpinned outputs still resolve.
|
|
@@ -74,7 +139,7 @@ export const DelegationResolutionSchema = z
|
|
|
74
139
|
export const DecisionPinsSchema = z
|
|
75
140
|
.object({
|
|
76
141
|
harness: z.strictObject({ harnessId: HarnessIdSchema }).optional(),
|
|
77
|
-
model: z.strictObject({ modelId:
|
|
142
|
+
model: z.strictObject({ modelId: DecisionModelIdSchema }).optional(),
|
|
78
143
|
skills: z
|
|
79
144
|
.strictObject({ skillVersionIds: z.array(IdentifierSchemas.skillVersionId).max(64) })
|
|
80
145
|
.optional(),
|
|
@@ -98,7 +163,10 @@ export const ModelAccessEntitlementSchema = z.enum(['byok', 'provisioned', 'free
|
|
|
98
163
|
export const AvailableRuntimeSchema = z
|
|
99
164
|
.object({
|
|
100
165
|
runtimeDefinitionId: IdentifierSchemas.runtimeDefinitionId,
|
|
101
|
-
|
|
166
|
+
// Every runtime is the Local composition. `host` names the machine
|
|
167
|
+
// class: the user's desktop or a VPS the user runs it on.
|
|
168
|
+
kind: z.enum(['local']),
|
|
169
|
+
host: z.enum(['desktop', 'vps']),
|
|
102
170
|
transport: z.enum(['direct-local']),
|
|
103
171
|
harnessIds: z.array(HarnessIdSchema).max(16),
|
|
104
172
|
capabilities: z.array(CapabilityNameSchema).max(64),
|
|
@@ -114,6 +182,7 @@ export const DecisionResolutionRequestSchema = z
|
|
|
114
182
|
correlation: CorrelationMetadataSchema,
|
|
115
183
|
requestedAt: TimestampSchema,
|
|
116
184
|
objective: z.string().min(1).max(4096),
|
|
185
|
+
mode: DecisionModeSchema.optional(),
|
|
117
186
|
agentProfile: z.strictObject({
|
|
118
187
|
profileId: IdentifierSchemas.profileId,
|
|
119
188
|
profileVersionId: IdentifierSchemas.profileVersionId.optional(),
|
|
@@ -124,6 +193,7 @@ export const DecisionResolutionRequestSchema = z
|
|
|
124
193
|
grantedCapabilityNames: z.array(CapabilityNameSchema).max(64),
|
|
125
194
|
}),
|
|
126
195
|
requiredCapabilities: z.array(CapabilityNameSchema).max(64),
|
|
196
|
+
availableSkills: z.array(AvailableSkillSchema).max(256).optional(),
|
|
127
197
|
costLatencyPreference: z.enum(['cost', 'balanced', 'latency']),
|
|
128
198
|
projectDefaults: DecisionPinsSchema,
|
|
129
199
|
profileDefaults: DecisionPinsSchema,
|
|
@@ -139,6 +209,15 @@ export const DecisionResolutionDiagnosticSchema = z.enum([
|
|
|
139
209
|
'HARNESS_UNAVAILABLE_ON_PINNED_RUNTIME',
|
|
140
210
|
'NO_COMPATIBLE_RUNTIME',
|
|
141
211
|
'CONTEXT_PACKAGE_PIN_MISMATCH',
|
|
212
|
+
// Consumer Auto mode carries no explicit pins; a pin is refused rather
|
|
213
|
+
// than silently ignored.
|
|
214
|
+
'AUTO_MODE_EXPLICIT_PIN',
|
|
215
|
+
// A resolved skill that is not an available skill version, or that needs a
|
|
216
|
+
// capability outside the resolved set.
|
|
217
|
+
'SKILL_UNAVAILABLE',
|
|
218
|
+
'SKILL_BEYOND_CAPABILITIES',
|
|
219
|
+
// A delegation fan-out above the deployment's child ceiling.
|
|
220
|
+
'DELEGATION_BEYOND_POLICY',
|
|
142
221
|
// M12/#678 per-model harness mapping. A configured map is a policy, not a
|
|
143
222
|
// fallback: an execution without a model, with a model the map does not
|
|
144
223
|
// name, or whose mapped harness contradicts an explicit pin, is denied
|
|
@@ -161,11 +240,12 @@ export const DecisionLayerResolutionSchema = z
|
|
|
161
240
|
workspaceId: IdentifierSchemas.workspaceId,
|
|
162
241
|
contractVersion: ContractVersionSchema,
|
|
163
242
|
resolvedAt: TimestampSchema,
|
|
243
|
+
mode: DecisionModeSchema,
|
|
164
244
|
resolution: z
|
|
165
245
|
.strictObject({
|
|
166
246
|
harness: z.strictObject({ harnessId: HarnessIdSchema }),
|
|
167
247
|
model: z.union([
|
|
168
|
-
z.strictObject({ modelId:
|
|
248
|
+
z.strictObject({ modelId: DecisionModelIdSchema }),
|
|
169
249
|
z.strictObject({ withheld: DecisionResolutionDiagnosticSchema }),
|
|
170
250
|
]),
|
|
171
251
|
skills: z.strictObject({
|
|
@@ -178,7 +258,7 @@ export const DecisionLayerResolutionSchema = z
|
|
|
178
258
|
mode: z.enum(['none', 'existing', 'author']),
|
|
179
259
|
contextPackageId: IdentifierSchemas.contextPackageId.optional(),
|
|
180
260
|
}),
|
|
181
|
-
delegation:
|
|
261
|
+
delegation: ResolvedDelegationSchema,
|
|
182
262
|
})
|
|
183
263
|
.strict(),
|
|
184
264
|
trace: z.record(z.string(), ResolvedOutputSchema),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adea-ai/contracts",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
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",
|