@adea-ai/contracts 3.0.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/control-api.d.ts +328 -14
- package/dist/control-api.js +24 -4
- package/dist/decision-resolution.d.ts +110 -7
- package/dist/decision-resolution.js +85 -5
- package/dist/fixtures.d.ts +8 -8
- package/dist/fixtures.js +1 -1
- package/dist/model-connections.d.ts +27 -10
- package/dist/model-connections.js +20 -1
- package/dist/runtime-discovery.d.ts +0 -8
- package/dist/runtime-discovery.js +3 -3
- package/dist/versioning.js +6 -3
- package/dist/workspace-catalog.d.ts +11 -11
- package/dist/workspace-catalog.js +1 -1
- package/package.json +3 -2
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;
|
|
@@ -605,9 +921,7 @@ export declare const RuntimeReadModelSchema: z.ZodObject<{
|
|
|
605
921
|
runtimeDefinitionId: typeof IdentifierSchemas.runtimeDefinitionId;
|
|
606
922
|
family: z.ZodString;
|
|
607
923
|
location: z.ZodEnum<{
|
|
608
|
-
agent_hq_cloud: "agent_hq_cloud";
|
|
609
924
|
local_device: "local_device";
|
|
610
|
-
remote_host: "remote_host";
|
|
611
925
|
}>;
|
|
612
926
|
status: z.ZodEnum<{
|
|
613
927
|
available: "available";
|
|
@@ -650,9 +964,7 @@ export declare const RuntimeListResponseSchema: z.ZodObject<{
|
|
|
650
964
|
runtimeDefinitionId: typeof IdentifierSchemas.runtimeDefinitionId;
|
|
651
965
|
family: z.ZodString;
|
|
652
966
|
location: z.ZodEnum<{
|
|
653
|
-
agent_hq_cloud: "agent_hq_cloud";
|
|
654
967
|
local_device: "local_device";
|
|
655
|
-
remote_host: "remote_host";
|
|
656
968
|
}>;
|
|
657
969
|
status: z.ZodEnum<{
|
|
658
970
|
available: "available";
|
|
@@ -930,6 +1242,8 @@ export type InteractionResponseCommand = z.input<typeof InteractionResponseComma
|
|
|
930
1242
|
export type InteractionResponseCommandResult = z.output<typeof InteractionResponseCommandResultSchema>;
|
|
931
1243
|
export type ServiceAuthenticationRequest = z.input<typeof ServiceAuthenticationRequestSchema>;
|
|
932
1244
|
export type ServiceAuthenticationResponse = z.output<typeof ServiceAuthenticationResponseSchema>;
|
|
1245
|
+
export type DecisionResolveRequest = z.input<typeof DecisionResolveRequestSchema>;
|
|
1246
|
+
export type DecisionResolveResponse = z.output<typeof DecisionResolveResponseSchema>;
|
|
933
1247
|
export type ProfileResolutionRequest = z.input<typeof ProfileResolutionRequestSchema>;
|
|
934
1248
|
export type ProfileResolutionResponse = z.output<typeof ProfileResolutionResponseSchema>;
|
|
935
1249
|
export type ProjectStateResolutionRequest = z.input<typeof ProjectStateResolutionRequestSchema>;
|
|
@@ -1008,7 +1322,7 @@ export declare const CredentialApiFixtures: Readonly<{
|
|
|
1008
1322
|
servicePrincipalId: string;
|
|
1009
1323
|
};
|
|
1010
1324
|
contractVersion: {
|
|
1011
|
-
readonly major:
|
|
1325
|
+
readonly major: 4;
|
|
1012
1326
|
readonly minor: 0;
|
|
1013
1327
|
};
|
|
1014
1328
|
requestId: string;
|
|
@@ -1029,7 +1343,7 @@ export declare const CredentialApiFixtures: Readonly<{
|
|
|
1029
1343
|
};
|
|
1030
1344
|
response: {
|
|
1031
1345
|
contractVersion: {
|
|
1032
|
-
readonly major:
|
|
1346
|
+
readonly major: 4;
|
|
1033
1347
|
readonly minor: 0;
|
|
1034
1348
|
};
|
|
1035
1349
|
requestId: string;
|
|
@@ -1056,7 +1370,7 @@ export declare const CredentialApiFixtures: Readonly<{
|
|
|
1056
1370
|
servicePrincipalId: string;
|
|
1057
1371
|
};
|
|
1058
1372
|
contractVersion: {
|
|
1059
|
-
readonly major:
|
|
1373
|
+
readonly major: 4;
|
|
1060
1374
|
readonly minor: 0;
|
|
1061
1375
|
};
|
|
1062
1376
|
requestId: string;
|
|
@@ -1077,7 +1391,7 @@ export declare const CredentialApiFixtures: Readonly<{
|
|
|
1077
1391
|
};
|
|
1078
1392
|
response: {
|
|
1079
1393
|
contractVersion: {
|
|
1080
|
-
readonly major:
|
|
1394
|
+
readonly major: 4;
|
|
1081
1395
|
readonly minor: 0;
|
|
1082
1396
|
};
|
|
1083
1397
|
requestId: string;
|
|
@@ -1105,7 +1419,7 @@ export declare const CredentialApiFixtures: Readonly<{
|
|
|
1105
1419
|
servicePrincipalId: string;
|
|
1106
1420
|
};
|
|
1107
1421
|
contractVersion: {
|
|
1108
|
-
readonly major:
|
|
1422
|
+
readonly major: 4;
|
|
1109
1423
|
readonly minor: 0;
|
|
1110
1424
|
};
|
|
1111
1425
|
requestId: string;
|
|
@@ -1124,7 +1438,7 @@ export declare const CredentialApiFixtures: Readonly<{
|
|
|
1124
1438
|
};
|
|
1125
1439
|
response: {
|
|
1126
1440
|
contractVersion: {
|
|
1127
|
-
readonly major:
|
|
1441
|
+
readonly major: 4;
|
|
1128
1442
|
readonly minor: 0;
|
|
1129
1443
|
};
|
|
1130
1444
|
requestId: string;
|
|
@@ -1152,7 +1466,7 @@ export declare const CredentialApiFixtures: Readonly<{
|
|
|
1152
1466
|
servicePrincipalId: string;
|
|
1153
1467
|
};
|
|
1154
1468
|
contractVersion: {
|
|
1155
|
-
readonly major:
|
|
1469
|
+
readonly major: 4;
|
|
1156
1470
|
readonly minor: 0;
|
|
1157
1471
|
};
|
|
1158
1472
|
requestId: string;
|
|
@@ -1168,7 +1482,7 @@ export declare const CredentialApiFixtures: Readonly<{
|
|
|
1168
1482
|
};
|
|
1169
1483
|
response: {
|
|
1170
1484
|
contractVersion: {
|
|
1171
|
-
readonly major:
|
|
1485
|
+
readonly major: 4;
|
|
1172
1486
|
readonly minor: 0;
|
|
1173
1487
|
};
|
|
1174
1488
|
requestId: string;
|
|
@@ -1195,7 +1509,7 @@ export declare const CredentialApiFixtures: Readonly<{
|
|
|
1195
1509
|
servicePrincipalId: string;
|
|
1196
1510
|
};
|
|
1197
1511
|
contractVersion: {
|
|
1198
|
-
readonly major:
|
|
1512
|
+
readonly major: 4;
|
|
1199
1513
|
readonly minor: 0;
|
|
1200
1514
|
};
|
|
1201
1515
|
requestId: string;
|
|
@@ -1211,7 +1525,7 @@ export declare const CredentialApiFixtures: Readonly<{
|
|
|
1211
1525
|
};
|
|
1212
1526
|
response: {
|
|
1213
1527
|
contractVersion: {
|
|
1214
|
-
readonly major:
|
|
1528
|
+
readonly major: 4;
|
|
1215
1529
|
readonly minor: 0;
|
|
1216
1530
|
};
|
|
1217
1531
|
requestId: string;
|
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,
|
|
@@ -403,7 +423,7 @@ export const RuntimeReadModelSchema = z.object({
|
|
|
403
423
|
runtimeConnectionId: IdentifierSchemas.runtimeConnectionId.optional(),
|
|
404
424
|
runtimeDefinitionId: IdentifierSchemas.runtimeDefinitionId,
|
|
405
425
|
family: z.string().min(1).max(64),
|
|
406
|
-
location: z.enum(['local_device'
|
|
426
|
+
location: z.enum(['local_device']),
|
|
407
427
|
status: z.enum(['available', 'degraded', 'unavailable', 'revoked']),
|
|
408
428
|
observedAt: TimestampSchema,
|
|
409
429
|
capabilities: z.array(CapabilityNameSchema).max(128),
|
|
@@ -589,7 +609,7 @@ export const InteractionResponseCommandResultSchema = successResponse(z.strictOb
|
|
|
589
609
|
status: z.literal('accepted'),
|
|
590
610
|
replayed: z.boolean(),
|
|
591
611
|
}));
|
|
592
|
-
const contractVersion = { major:
|
|
612
|
+
const contractVersion = { major: 4, minor: 0 };
|
|
593
613
|
const requestId = 'req_01JABCDEF0123456789ABCDEFG';
|
|
594
614
|
const commandId = 'cmd_01JABCDEF0123456789ABCDEFG';
|
|
595
615
|
const workspaceId = 'wsp_01JABCDEF0123456789ABCDEFG';
|
|
@@ -786,7 +806,7 @@ export const ControlApiFixtures = Object.freeze({
|
|
|
786
806
|
runtimeConnectionId: 'rtc_01JABCDEF0123456789ABCDEFG',
|
|
787
807
|
runtimeDefinitionId: 'rtd_01JABCDEF0123456789ABCDEFG',
|
|
788
808
|
family: 'mock',
|
|
789
|
-
location: '
|
|
809
|
+
location: 'local_device',
|
|
790
810
|
status: 'available',
|
|
791
811
|
observedAt: '2026-08-23T12:00:00.000Z',
|
|
792
812
|
capabilities: ['tool.call'],
|
|
@@ -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/dist/fixtures.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare const PublicContractFixtures: Readonly<{
|
|
|
4
4
|
servicePrincipalId: string;
|
|
5
5
|
};
|
|
6
6
|
contractVersion: {
|
|
7
|
-
readonly major:
|
|
7
|
+
readonly major: 4;
|
|
8
8
|
readonly minor: 0;
|
|
9
9
|
};
|
|
10
10
|
requestId: string;
|
|
@@ -27,7 +27,7 @@ export declare const PublicContractFixtures: Readonly<{
|
|
|
27
27
|
servicePrincipalId: string;
|
|
28
28
|
};
|
|
29
29
|
contractVersion: {
|
|
30
|
-
readonly major:
|
|
30
|
+
readonly major: 4;
|
|
31
31
|
readonly minor: 0;
|
|
32
32
|
};
|
|
33
33
|
requestId: string;
|
|
@@ -44,7 +44,7 @@ export declare const PublicContractFixtures: Readonly<{
|
|
|
44
44
|
};
|
|
45
45
|
response: {
|
|
46
46
|
contractVersion: {
|
|
47
|
-
readonly major:
|
|
47
|
+
readonly major: 4;
|
|
48
48
|
readonly minor: 0;
|
|
49
49
|
};
|
|
50
50
|
requestId: string;
|
|
@@ -57,7 +57,7 @@ export declare const PublicContractFixtures: Readonly<{
|
|
|
57
57
|
};
|
|
58
58
|
errorResponse: {
|
|
59
59
|
contractVersion: {
|
|
60
|
-
readonly major:
|
|
60
|
+
readonly major: 4;
|
|
61
61
|
readonly minor: 0;
|
|
62
62
|
};
|
|
63
63
|
requestId: string;
|
|
@@ -74,7 +74,7 @@ export declare const PublicContractFixtures: Readonly<{
|
|
|
74
74
|
};
|
|
75
75
|
event: {
|
|
76
76
|
contractVersion: {
|
|
77
|
-
readonly major:
|
|
77
|
+
readonly major: 4;
|
|
78
78
|
readonly minor: 0;
|
|
79
79
|
};
|
|
80
80
|
eventId: string;
|
|
@@ -92,7 +92,7 @@ export declare const PublicContractFixtures: Readonly<{
|
|
|
92
92
|
};
|
|
93
93
|
usage: {
|
|
94
94
|
contractVersion: {
|
|
95
|
-
readonly major:
|
|
95
|
+
readonly major: 4;
|
|
96
96
|
readonly minor: 0;
|
|
97
97
|
};
|
|
98
98
|
requestId: string;
|
|
@@ -114,7 +114,7 @@ export declare const PublicContractFixtures: Readonly<{
|
|
|
114
114
|
};
|
|
115
115
|
artifact: {
|
|
116
116
|
contractVersion: {
|
|
117
|
-
readonly major:
|
|
117
|
+
readonly major: 4;
|
|
118
118
|
readonly minor: 0;
|
|
119
119
|
};
|
|
120
120
|
artifactId: string;
|
|
@@ -126,7 +126,7 @@ export declare const PublicContractFixtures: Readonly<{
|
|
|
126
126
|
};
|
|
127
127
|
runtime: {
|
|
128
128
|
contractVersion: {
|
|
129
|
-
readonly major:
|
|
129
|
+
readonly major: 4;
|
|
130
130
|
readonly minor: 0;
|
|
131
131
|
};
|
|
132
132
|
runtimeNodeRefId: string;
|
package/dist/fixtures.js
CHANGED
|
@@ -9,9 +9,7 @@ export declare const ModelConnectionRefSchema: z.ZodString;
|
|
|
9
9
|
export declare const ModelSelectionRefSchema: z.ZodString;
|
|
10
10
|
export declare const ModelExecutionTargetSchema: z.ZodObject<{
|
|
11
11
|
location: z.ZodEnum<{
|
|
12
|
-
agent_hq_cloud: "agent_hq_cloud";
|
|
13
12
|
local_device: "local_device";
|
|
14
|
-
remote_host: "remote_host";
|
|
15
13
|
}>;
|
|
16
14
|
harness: z.ZodEnum<{
|
|
17
15
|
acp: "acp";
|
|
@@ -62,9 +60,7 @@ export declare const ModelConnectionSchema: z.ZodObject<{
|
|
|
62
60
|
/** Immutable, non-secret admission evidence. Never persist lease capabilities or provider objects. */
|
|
63
61
|
export declare const RuntimeProviderSelectionSchema: z.ZodObject<{
|
|
64
62
|
location: z.ZodEnum<{
|
|
65
|
-
agent_hq_cloud: "agent_hq_cloud";
|
|
66
63
|
local_device: "local_device";
|
|
67
|
-
remote_host: "remote_host";
|
|
68
64
|
}>;
|
|
69
65
|
harness: z.ZodEnum<{
|
|
70
66
|
acp: "acp";
|
|
@@ -188,9 +184,7 @@ export declare const ModelConnectionListRequestSchema: z.ZodObject<{
|
|
|
188
184
|
parameters: z.ZodObject<{
|
|
189
185
|
target: z.ZodObject<{
|
|
190
186
|
location: z.ZodEnum<{
|
|
191
|
-
agent_hq_cloud: "agent_hq_cloud";
|
|
192
187
|
local_device: "local_device";
|
|
193
|
-
remote_host: "remote_host";
|
|
194
188
|
}>;
|
|
195
189
|
harness: z.ZodEnum<{
|
|
196
190
|
acp: "acp";
|
|
@@ -288,9 +282,7 @@ export declare const ModelSelectionResolveRequestSchema: z.ZodObject<{
|
|
|
288
282
|
}>;
|
|
289
283
|
target: z.ZodObject<{
|
|
290
284
|
location: z.ZodEnum<{
|
|
291
|
-
agent_hq_cloud: "agent_hq_cloud";
|
|
292
285
|
local_device: "local_device";
|
|
293
|
-
remote_host: "remote_host";
|
|
294
286
|
}>;
|
|
295
287
|
harness: z.ZodEnum<{
|
|
296
288
|
acp: "acp";
|
|
@@ -310,6 +302,23 @@ export declare const ModelSelectionResolveRequestSchema: z.ZodObject<{
|
|
|
310
302
|
}, z.core.$strict>>;
|
|
311
303
|
}, z.core.$strict>;
|
|
312
304
|
}, z.core.$strict>;
|
|
305
|
+
/**
|
|
306
|
+
* What a model costs and how fast it answers, for ranking by the request's cost/latency
|
|
307
|
+
* preference (#558). Price is the table's blended list price, latency is measured on the machine
|
|
308
|
+
* from its own recent requests or, with no history, the table's default. Ranking input only: it
|
|
309
|
+
* never admits a model, widens entitlement or replaces a pin.
|
|
310
|
+
*/
|
|
311
|
+
export declare const ModelCostLatencySchema: z.ZodObject<{
|
|
312
|
+
tableVersion: z.ZodNumber;
|
|
313
|
+
priceMicrosPerMillionTokens: z.ZodNumber;
|
|
314
|
+
latencyMs: z.ZodNumber;
|
|
315
|
+
latencySource: z.ZodEnum<{
|
|
316
|
+
default: "default";
|
|
317
|
+
measured: "measured";
|
|
318
|
+
}>;
|
|
319
|
+
qualityTier: z.ZodNumber;
|
|
320
|
+
}, z.core.$strict>;
|
|
321
|
+
export type ModelCostLatency = z.infer<typeof ModelCostLatencySchema>;
|
|
313
322
|
export declare const ModelConnectionListResponseSchema: z.ZodObject<{
|
|
314
323
|
contractVersion: z.ZodObject<{
|
|
315
324
|
major: z.ZodNumber;
|
|
@@ -381,6 +390,16 @@ export declare const ModelConnectionListResponseSchema: z.ZodObject<{
|
|
|
381
390
|
WORKSPACE_GRANT_REVOKED: "WORKSPACE_GRANT_REVOKED";
|
|
382
391
|
}>;
|
|
383
392
|
}, z.core.$strict>;
|
|
393
|
+
costLatency: z.ZodOptional<z.ZodObject<{
|
|
394
|
+
tableVersion: z.ZodNumber;
|
|
395
|
+
priceMicrosPerMillionTokens: z.ZodNumber;
|
|
396
|
+
latencyMs: z.ZodNumber;
|
|
397
|
+
latencySource: z.ZodEnum<{
|
|
398
|
+
default: "default";
|
|
399
|
+
measured: "measured";
|
|
400
|
+
}>;
|
|
401
|
+
qualityTier: z.ZodNumber;
|
|
402
|
+
}, z.core.$strict>>;
|
|
384
403
|
}, z.core.$strict>>;
|
|
385
404
|
}, z.core.$strict>>;
|
|
386
405
|
connectionsPage: z.ZodObject<{
|
|
@@ -432,9 +451,7 @@ export declare const ModelSelectionResponseSchema: z.ZodObject<{
|
|
|
432
451
|
data: z.ZodObject<{
|
|
433
452
|
selection: z.ZodObject<{
|
|
434
453
|
location: z.ZodEnum<{
|
|
435
|
-
agent_hq_cloud: "agent_hq_cloud";
|
|
436
454
|
local_device: "local_device";
|
|
437
|
-
remote_host: "remote_host";
|
|
438
455
|
}>;
|
|
439
456
|
harness: z.ZodEnum<{
|
|
440
457
|
acp: "acp";
|
|
@@ -14,7 +14,7 @@ export const ModelConnectionRefSchema = z.string().regex(/^mconn_[a-f0-9]{32}$/)
|
|
|
14
14
|
export const ModelSelectionRefSchema = z.string().regex(/^msel_[a-f0-9]{32}$/);
|
|
15
15
|
const Auth = z.enum(['api_key', 'provider_subscription', 'local_runtime']);
|
|
16
16
|
export const ModelExecutionTargetSchema = z.strictObject({
|
|
17
|
-
location: z.enum(['local_device'
|
|
17
|
+
location: z.enum(['local_device']),
|
|
18
18
|
harness: z.enum(['pi', 'pi_durable', 'acp']),
|
|
19
19
|
harnessVersion: z.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/),
|
|
20
20
|
providerBinding: z.enum(['pi_model_runtime', 'pi_durable_models', 'native_harness']),
|
|
@@ -164,6 +164,23 @@ export const ModelSelectionResolveRequestSchema = Read.extend({
|
|
|
164
164
|
override: ModelChoiceSchema.optional(),
|
|
165
165
|
}),
|
|
166
166
|
}).strict();
|
|
167
|
+
/**
|
|
168
|
+
* What a model costs and how fast it answers, for ranking by the request's cost/latency
|
|
169
|
+
* preference (#558). Price is the table's blended list price, latency is measured on the machine
|
|
170
|
+
* from its own recent requests or, with no history, the table's default. Ranking input only: it
|
|
171
|
+
* never admits a model, widens entitlement or replaces a pin.
|
|
172
|
+
*/
|
|
173
|
+
export const ModelCostLatencySchema = z.strictObject({
|
|
174
|
+
/** The version of the price table the price and default latency came from. */
|
|
175
|
+
tableVersion: z.number().int().positive(),
|
|
176
|
+
/** Blended list price, millionths of a US dollar per million tokens. */
|
|
177
|
+
priceMicrosPerMillionTokens: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
178
|
+
/** Expected response time in milliseconds. */
|
|
179
|
+
latencyMs: z.number().int().nonnegative().max(3_600_000),
|
|
180
|
+
latencySource: z.enum(['measured', 'default']),
|
|
181
|
+
/** 1 to 5, higher is better; breaks ties between models the preference cannot separate. */
|
|
182
|
+
qualityTier: z.number().int().min(1).max(5),
|
|
183
|
+
});
|
|
167
184
|
export const ModelConnectionListResponseSchema = SuccessResponseEnvelopeSchema.extend({
|
|
168
185
|
data: z.strictObject({
|
|
169
186
|
connections: z
|
|
@@ -176,6 +193,8 @@ export const ModelConnectionListResponseSchema = SuccessResponseEnvelopeSchema.e
|
|
|
176
193
|
ready: z.boolean(),
|
|
177
194
|
reasonCode: ModelReadinessReasonSchema,
|
|
178
195
|
}),
|
|
196
|
+
/** Absent for a model the price table does not list; it is never guessed. */
|
|
197
|
+
costLatency: ModelCostLatencySchema.optional(),
|
|
179
198
|
}))
|
|
180
199
|
.max(256),
|
|
181
200
|
}))
|
|
@@ -30,11 +30,9 @@ export declare const RuntimeConnectionDiscoveryReadModelSchema: z.ZodObject<{
|
|
|
30
30
|
family: z.ZodString;
|
|
31
31
|
connectionType: z.ZodEnum<{
|
|
32
32
|
external_local: "external_local";
|
|
33
|
-
managed_cloud: "managed_cloud";
|
|
34
33
|
managed_local: "managed_local";
|
|
35
34
|
}>;
|
|
36
35
|
location: z.ZodEnum<{
|
|
37
|
-
agent_hq_cloud: "agent_hq_cloud";
|
|
38
36
|
local_device: "local_device";
|
|
39
37
|
}>;
|
|
40
38
|
status: z.ZodEnum<{
|
|
@@ -46,9 +44,7 @@ export declare const RuntimeConnectionDiscoveryReadModelSchema: z.ZodObject<{
|
|
|
46
44
|
node: z.ZodOptional<z.ZodObject<{
|
|
47
45
|
runtimeNodeRefId: typeof IdentifierSchemas.runtimeNodeRefId;
|
|
48
46
|
location: z.ZodEnum<{
|
|
49
|
-
agent_hq_cloud: "agent_hq_cloud";
|
|
50
47
|
local_device: "local_device";
|
|
51
|
-
remote_host: "remote_host";
|
|
52
48
|
}>;
|
|
53
49
|
status: z.ZodEnum<{
|
|
54
50
|
offline: "offline";
|
|
@@ -248,11 +244,9 @@ export declare const RuntimeConnectionGetResponseSchema: z.ZodObject<{
|
|
|
248
244
|
family: z.ZodString;
|
|
249
245
|
connectionType: z.ZodEnum<{
|
|
250
246
|
external_local: "external_local";
|
|
251
|
-
managed_cloud: "managed_cloud";
|
|
252
247
|
managed_local: "managed_local";
|
|
253
248
|
}>;
|
|
254
249
|
location: z.ZodEnum<{
|
|
255
|
-
agent_hq_cloud: "agent_hq_cloud";
|
|
256
250
|
local_device: "local_device";
|
|
257
251
|
}>;
|
|
258
252
|
status: z.ZodEnum<{
|
|
@@ -264,9 +258,7 @@ export declare const RuntimeConnectionGetResponseSchema: z.ZodObject<{
|
|
|
264
258
|
node: z.ZodOptional<z.ZodObject<{
|
|
265
259
|
runtimeNodeRefId: typeof IdentifierSchemas.runtimeNodeRefId;
|
|
266
260
|
location: z.ZodEnum<{
|
|
267
|
-
agent_hq_cloud: "agent_hq_cloud";
|
|
268
261
|
local_device: "local_device";
|
|
269
|
-
remote_host: "remote_host";
|
|
270
262
|
}>;
|
|
271
263
|
status: z.ZodEnum<{
|
|
272
264
|
offline: "offline";
|
|
@@ -51,13 +51,13 @@ export const RuntimeConnectionDiscoveryReadModelSchema = z.object({
|
|
|
51
51
|
.min(1)
|
|
52
52
|
.max(64)
|
|
53
53
|
.regex(/^[a-z][a-z0-9-]*$/),
|
|
54
|
-
connectionType: z.enum(['
|
|
55
|
-
location: z.enum(['local_device'
|
|
54
|
+
connectionType: z.enum(['managed_local', 'external_local']),
|
|
55
|
+
location: z.enum(['local_device']),
|
|
56
56
|
status: z.enum(['available', 'degraded', 'unavailable', 'revoked']),
|
|
57
57
|
node: z
|
|
58
58
|
.object({
|
|
59
59
|
runtimeNodeRefId: IdentifierSchemas.runtimeNodeRefId,
|
|
60
|
-
location: z.enum(['local_device'
|
|
60
|
+
location: z.enum(['local_device']),
|
|
61
61
|
status: z.enum(['online', 'offline', 'revoked']),
|
|
62
62
|
health: z.enum(['online', 'offline', 'unknown', 'revoked']),
|
|
63
63
|
observedAt: TimestampSchema,
|
package/dist/versioning.js
CHANGED
|
@@ -7,9 +7,11 @@ export const ContractVersionSchema = z
|
|
|
7
7
|
.strict();
|
|
8
8
|
export const PublicContractManifest = Object.freeze({
|
|
9
9
|
name: 'agent-hq-control-plane',
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
|
|
10
|
+
// 4.0 removes the managed-cloud, Agent HQ cloud and remote-host runtime vocabulary; every Pi
|
|
11
|
+
// device is `local_device`. Everything 3.3 added (negotiated, read-only observation of an
|
|
12
|
+
// already-open Pi child owner, which conveys no attachment or control permission) is part of 4.0.
|
|
13
|
+
// Major 3 is still served until its consumers have moved.
|
|
14
|
+
current: { major: 4, minor: 0 },
|
|
13
15
|
supported: [
|
|
14
16
|
{ major: 1, minor: 0 },
|
|
15
17
|
{ major: 2, minor: 0 },
|
|
@@ -17,6 +19,7 @@ export const PublicContractManifest = Object.freeze({
|
|
|
17
19
|
{ major: 3, minor: 1 },
|
|
18
20
|
{ major: 3, minor: 2 },
|
|
19
21
|
{ major: 3, minor: 3 },
|
|
22
|
+
{ major: 4, minor: 0 },
|
|
20
23
|
],
|
|
21
24
|
});
|
|
22
25
|
export function assessContractCompatibility(input) {
|
|
@@ -418,7 +418,7 @@ export declare const WorkspaceCatalogFixtures: Readonly<{
|
|
|
418
418
|
readonly servicePrincipalId: 'svc_agent-hq';
|
|
419
419
|
};
|
|
420
420
|
contractVersion: {
|
|
421
|
-
readonly major:
|
|
421
|
+
readonly major: 4;
|
|
422
422
|
readonly minor: 0;
|
|
423
423
|
};
|
|
424
424
|
requestId: 'req_01JABCDEF0123456789ABCDEFG';
|
|
@@ -434,7 +434,7 @@ export declare const WorkspaceCatalogFixtures: Readonly<{
|
|
|
434
434
|
};
|
|
435
435
|
response: {
|
|
436
436
|
contractVersion: {
|
|
437
|
-
readonly major:
|
|
437
|
+
readonly major: 4;
|
|
438
438
|
readonly minor: 0;
|
|
439
439
|
};
|
|
440
440
|
requestId: "req_01JABCDEF0123456789ABCDEFG";
|
|
@@ -476,7 +476,7 @@ export declare const WorkspaceCatalogFixtures: Readonly<{
|
|
|
476
476
|
readonly servicePrincipalId: 'svc_agent-hq';
|
|
477
477
|
};
|
|
478
478
|
contractVersion: {
|
|
479
|
-
readonly major:
|
|
479
|
+
readonly major: 4;
|
|
480
480
|
readonly minor: 0;
|
|
481
481
|
};
|
|
482
482
|
requestId: 'req_01JABCDEF0123456789ABCDEFG';
|
|
@@ -492,7 +492,7 @@ export declare const WorkspaceCatalogFixtures: Readonly<{
|
|
|
492
492
|
};
|
|
493
493
|
response: {
|
|
494
494
|
contractVersion: {
|
|
495
|
-
readonly major:
|
|
495
|
+
readonly major: 4;
|
|
496
496
|
readonly minor: 0;
|
|
497
497
|
};
|
|
498
498
|
requestId: "req_01JABCDEF0123456789ABCDEFG";
|
|
@@ -559,7 +559,7 @@ export declare const WorkspaceCatalogFixtures: Readonly<{
|
|
|
559
559
|
readonly servicePrincipalId: 'svc_agent-hq';
|
|
560
560
|
};
|
|
561
561
|
contractVersion: {
|
|
562
|
-
readonly major:
|
|
562
|
+
readonly major: 4;
|
|
563
563
|
readonly minor: 0;
|
|
564
564
|
};
|
|
565
565
|
requestId: 'req_01JABCDEF0123456789ABCDEFG';
|
|
@@ -600,7 +600,7 @@ export declare const WorkspaceCatalogFixtures: Readonly<{
|
|
|
600
600
|
readonly servicePrincipalId: 'svc_agent-hq';
|
|
601
601
|
};
|
|
602
602
|
contractVersion: {
|
|
603
|
-
readonly major:
|
|
603
|
+
readonly major: 4;
|
|
604
604
|
readonly minor: 0;
|
|
605
605
|
};
|
|
606
606
|
requestId: 'req_01JABCDEF0123456789ABCDEFG';
|
|
@@ -622,7 +622,7 @@ export declare const WorkspaceCatalogFixtures: Readonly<{
|
|
|
622
622
|
};
|
|
623
623
|
response: {
|
|
624
624
|
contractVersion: {
|
|
625
|
-
readonly major:
|
|
625
|
+
readonly major: 4;
|
|
626
626
|
readonly minor: 0;
|
|
627
627
|
};
|
|
628
628
|
requestId: "req_01JABCDEF0123456789ABCDEFG";
|
|
@@ -663,7 +663,7 @@ export declare const WorkspaceCatalogFixtures: Readonly<{
|
|
|
663
663
|
readonly servicePrincipalId: 'svc_agent-hq';
|
|
664
664
|
};
|
|
665
665
|
contractVersion: {
|
|
666
|
-
readonly major:
|
|
666
|
+
readonly major: 4;
|
|
667
667
|
readonly minor: 0;
|
|
668
668
|
};
|
|
669
669
|
requestId: 'req_01JABCDEF0123456789ABCDEFG';
|
|
@@ -677,7 +677,7 @@ export declare const WorkspaceCatalogFixtures: Readonly<{
|
|
|
677
677
|
};
|
|
678
678
|
response: {
|
|
679
679
|
contractVersion: {
|
|
680
|
-
readonly major:
|
|
680
|
+
readonly major: 4;
|
|
681
681
|
readonly minor: 0;
|
|
682
682
|
};
|
|
683
683
|
requestId: "req_01JABCDEF0123456789ABCDEFG";
|
|
@@ -720,7 +720,7 @@ export declare const WorkspaceCatalogFixtures: Readonly<{
|
|
|
720
720
|
readonly servicePrincipalId: 'svc_agent-hq';
|
|
721
721
|
};
|
|
722
722
|
contractVersion: {
|
|
723
|
-
readonly major:
|
|
723
|
+
readonly major: 4;
|
|
724
724
|
readonly minor: 0;
|
|
725
725
|
};
|
|
726
726
|
requestId: 'req_01JABCDEF0123456789ABCDEFG';
|
|
@@ -742,7 +742,7 @@ export declare const WorkspaceCatalogFixtures: Readonly<{
|
|
|
742
742
|
readonly servicePrincipalId: 'svc_agent-hq';
|
|
743
743
|
};
|
|
744
744
|
contractVersion: {
|
|
745
|
-
readonly major:
|
|
745
|
+
readonly major: 4;
|
|
746
746
|
readonly minor: 0;
|
|
747
747
|
};
|
|
748
748
|
requestId: 'req_01JABCDEF0123456789ABCDEFG';
|
|
@@ -298,7 +298,7 @@ export const WorkspaceCatalogScopes = Object.freeze({
|
|
|
298
298
|
});
|
|
299
299
|
const fixtureContext = {
|
|
300
300
|
caller: { servicePrincipalId: 'svc_agent-hq' },
|
|
301
|
-
contractVersion: { major:
|
|
301
|
+
contractVersion: { major: 4, minor: 0 },
|
|
302
302
|
requestId: 'req_01JABCDEF0123456789ABCDEFG',
|
|
303
303
|
workspaceId: 'wsp_01JABCDEF0123456789ABCDEFG',
|
|
304
304
|
correlation: { traceId: 'trc_01JABCDEF0123456789ABCDEFG' },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adea-ai/contracts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.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",
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
|
-
"access": "public"
|
|
42
|
+
"access": "public",
|
|
43
|
+
"provenance": true
|
|
43
44
|
},
|
|
44
45
|
"scripts": {
|
|
45
46
|
"build": "tsc -p tsconfig.json",
|