@adea-ai/contracts 3.1.0 → 5.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/README.md CHANGED
@@ -56,7 +56,7 @@ reproduce the published contracts 1.23.1 payload used by strict installed-packag
56
56
  qualification. Other packages retain the root optimization, and the unchanged
57
57
  repository distribution ceiling still applies.
58
58
 
59
- `src/declaration-emit.test.mjs` compiles an isolated public contract through both
59
+ `src/declaration-emit.test.ts` compiles an isolated public contract through both
60
60
  configurations and checks the exact declaration bytes: contracts retain public
61
61
  documentation while the root configuration strips it. Complete release payload
62
62
  qualification additionally compares the packed source files against the exact
@@ -921,9 +921,7 @@ export declare const RuntimeReadModelSchema: z.ZodObject<{
921
921
  runtimeDefinitionId: typeof IdentifierSchemas.runtimeDefinitionId;
922
922
  family: z.ZodString;
923
923
  location: z.ZodEnum<{
924
- agent_hq_cloud: "agent_hq_cloud";
925
924
  local_device: "local_device";
926
- remote_host: "remote_host";
927
925
  }>;
928
926
  status: z.ZodEnum<{
929
927
  available: "available";
@@ -966,9 +964,7 @@ export declare const RuntimeListResponseSchema: z.ZodObject<{
966
964
  runtimeDefinitionId: typeof IdentifierSchemas.runtimeDefinitionId;
967
965
  family: z.ZodString;
968
966
  location: z.ZodEnum<{
969
- agent_hq_cloud: "agent_hq_cloud";
970
967
  local_device: "local_device";
971
- remote_host: "remote_host";
972
968
  }>;
973
969
  status: z.ZodEnum<{
974
970
  available: "available";
@@ -1326,7 +1322,7 @@ export declare const CredentialApiFixtures: Readonly<{
1326
1322
  servicePrincipalId: string;
1327
1323
  };
1328
1324
  contractVersion: {
1329
- readonly major: 3;
1325
+ readonly major: 4;
1330
1326
  readonly minor: 0;
1331
1327
  };
1332
1328
  requestId: string;
@@ -1347,7 +1343,7 @@ export declare const CredentialApiFixtures: Readonly<{
1347
1343
  };
1348
1344
  response: {
1349
1345
  contractVersion: {
1350
- readonly major: 3;
1346
+ readonly major: 4;
1351
1347
  readonly minor: 0;
1352
1348
  };
1353
1349
  requestId: string;
@@ -1374,7 +1370,7 @@ export declare const CredentialApiFixtures: Readonly<{
1374
1370
  servicePrincipalId: string;
1375
1371
  };
1376
1372
  contractVersion: {
1377
- readonly major: 3;
1373
+ readonly major: 4;
1378
1374
  readonly minor: 0;
1379
1375
  };
1380
1376
  requestId: string;
@@ -1395,7 +1391,7 @@ export declare const CredentialApiFixtures: Readonly<{
1395
1391
  };
1396
1392
  response: {
1397
1393
  contractVersion: {
1398
- readonly major: 3;
1394
+ readonly major: 4;
1399
1395
  readonly minor: 0;
1400
1396
  };
1401
1397
  requestId: string;
@@ -1423,7 +1419,7 @@ export declare const CredentialApiFixtures: Readonly<{
1423
1419
  servicePrincipalId: string;
1424
1420
  };
1425
1421
  contractVersion: {
1426
- readonly major: 3;
1422
+ readonly major: 4;
1427
1423
  readonly minor: 0;
1428
1424
  };
1429
1425
  requestId: string;
@@ -1442,7 +1438,7 @@ export declare const CredentialApiFixtures: Readonly<{
1442
1438
  };
1443
1439
  response: {
1444
1440
  contractVersion: {
1445
- readonly major: 3;
1441
+ readonly major: 4;
1446
1442
  readonly minor: 0;
1447
1443
  };
1448
1444
  requestId: string;
@@ -1470,7 +1466,7 @@ export declare const CredentialApiFixtures: Readonly<{
1470
1466
  servicePrincipalId: string;
1471
1467
  };
1472
1468
  contractVersion: {
1473
- readonly major: 3;
1469
+ readonly major: 4;
1474
1470
  readonly minor: 0;
1475
1471
  };
1476
1472
  requestId: string;
@@ -1486,7 +1482,7 @@ export declare const CredentialApiFixtures: Readonly<{
1486
1482
  };
1487
1483
  response: {
1488
1484
  contractVersion: {
1489
- readonly major: 3;
1485
+ readonly major: 4;
1490
1486
  readonly minor: 0;
1491
1487
  };
1492
1488
  requestId: string;
@@ -1513,7 +1509,7 @@ export declare const CredentialApiFixtures: Readonly<{
1513
1509
  servicePrincipalId: string;
1514
1510
  };
1515
1511
  contractVersion: {
1516
- readonly major: 3;
1512
+ readonly major: 4;
1517
1513
  readonly minor: 0;
1518
1514
  };
1519
1515
  requestId: string;
@@ -1529,7 +1525,7 @@ export declare const CredentialApiFixtures: Readonly<{
1529
1525
  };
1530
1526
  response: {
1531
1527
  contractVersion: {
1532
- readonly major: 3;
1528
+ readonly major: 4;
1533
1529
  readonly minor: 0;
1534
1530
  };
1535
1531
  requestId: string;
@@ -423,7 +423,7 @@ export const RuntimeReadModelSchema = z.object({
423
423
  runtimeConnectionId: IdentifierSchemas.runtimeConnectionId.optional(),
424
424
  runtimeDefinitionId: IdentifierSchemas.runtimeDefinitionId,
425
425
  family: z.string().min(1).max(64),
426
- location: z.enum(['local_device', 'remote_host', 'agent_hq_cloud']),
426
+ location: z.enum(['local_device']),
427
427
  status: z.enum(['available', 'degraded', 'unavailable', 'revoked']),
428
428
  observedAt: TimestampSchema,
429
429
  capabilities: z.array(CapabilityNameSchema).max(128),
@@ -609,7 +609,7 @@ export const InteractionResponseCommandResultSchema = successResponse(z.strictOb
609
609
  status: z.literal('accepted'),
610
610
  replayed: z.boolean(),
611
611
  }));
612
- const contractVersion = { major: 3, minor: 0 };
612
+ const contractVersion = { major: 4, minor: 0 };
613
613
  const requestId = 'req_01JABCDEF0123456789ABCDEFG';
614
614
  const commandId = 'cmd_01JABCDEF0123456789ABCDEFG';
615
615
  const workspaceId = 'wsp_01JABCDEF0123456789ABCDEFG';
@@ -806,7 +806,7 @@ export const ControlApiFixtures = Object.freeze({
806
806
  runtimeConnectionId: 'rtc_01JABCDEF0123456789ABCDEFG',
807
807
  runtimeDefinitionId: 'rtd_01JABCDEF0123456789ABCDEFG',
808
808
  family: 'mock',
809
- location: 'agent_hq_cloud',
809
+ location: 'local_device',
810
810
  status: 'available',
811
811
  observedAt: '2026-08-23T12:00:00.000Z',
812
812
  capabilities: ['tool.call'],
@@ -26,7 +26,7 @@ import { z } from 'zod';
26
26
  */
27
27
  export declare const DECISION_RESOLUTION_CONTRACT_VERSION: Readonly<{
28
28
  major: 1;
29
- minor: 1;
29
+ minor: 2;
30
30
  }>;
31
31
  export declare const HarnessIdSchema: z.ZodString;
32
32
  export declare const ModelIdSchema: z.ZodString;
@@ -38,6 +38,11 @@ export declare const ResolutionSourceSchema: z.ZodEnum<{
38
38
  "project-default": "project-default";
39
39
  }>;
40
40
  export type ResolutionSource = z.output<typeof ResolutionSourceSchema>;
41
+ /**
42
+ * The versioned precedence order, highest first. It is part of the contract:
43
+ * changing it is a major version, never an edit in place.
44
+ */
45
+ export declare const DECISION_RESOLUTION_PRECEDENCE: readonly ResolutionSource[];
41
46
  /**
42
47
  * Sandbox selection stays inside M10-granted capabilities; it never grants.
43
48
  * `effectiveCapabilities` is always a subset of the resolved capability set
@@ -394,6 +399,30 @@ export declare const DecisionResolutionDiagnosticSchema: z.ZodEnum<{
394
399
  UNSUPPORTED_RUNTIME_PIN: "UNSUPPORTED_RUNTIME_PIN";
395
400
  }>;
396
401
  export type DecisionResolutionDiagnostic = z.output<typeof DecisionResolutionDiagnosticSchema>;
402
+ /**
403
+ * Every code a denial can carry. A denial is thrown, never returned in a
404
+ * resolution, so the codes v1.2 added live here and leave the response's
405
+ * closed `diagnostics` enum unchanged.
406
+ */
407
+ export declare const DecisionResolutionDenialSchema: z.ZodEnum<{
408
+ AUTO_MODE_EXPLICIT_PIN: "AUTO_MODE_EXPLICIT_PIN";
409
+ CAPABILITY_BEYOND_GRANT: "CAPABILITY_BEYOND_GRANT";
410
+ CONTEXT_PACKAGE_PIN_MISMATCH: "CONTEXT_PACKAGE_PIN_MISMATCH";
411
+ DELEGATION_BEYOND_POLICY: "DELEGATION_BEYOND_POLICY";
412
+ HARNESS_MAP_CONFLICTS_WITH_PIN: "HARNESS_MAP_CONFLICTS_WITH_PIN";
413
+ HARNESS_MAP_MODEL_ABSENT: "HARNESS_MAP_MODEL_ABSENT";
414
+ HARNESS_MAP_MODEL_UNMAPPED: "HARNESS_MAP_MODEL_UNMAPPED";
415
+ HARNESS_UNAVAILABLE_ON_PINNED_RUNTIME: "HARNESS_UNAVAILABLE_ON_PINNED_RUNTIME";
416
+ MODEL_ACCESS_NOT_ENTITLED: "MODEL_ACCESS_NOT_ENTITLED";
417
+ NO_COMPATIBLE_RUNTIME: "NO_COMPATIBLE_RUNTIME";
418
+ NO_DEFAULT_MODEL: "NO_DEFAULT_MODEL";
419
+ REQUIRED_CAPABILITY_NOT_RESOLVED: "REQUIRED_CAPABILITY_NOT_RESOLVED";
420
+ SANDBOX_PIN_MISMATCH: "SANDBOX_PIN_MISMATCH";
421
+ SKILL_BEYOND_CAPABILITIES: "SKILL_BEYOND_CAPABILITIES";
422
+ SKILL_UNAVAILABLE: "SKILL_UNAVAILABLE";
423
+ UNSUPPORTED_RUNTIME_PIN: "UNSUPPORTED_RUNTIME_PIN";
424
+ }>;
425
+ export type DecisionResolutionDenial = z.output<typeof DecisionResolutionDenialSchema>;
397
426
  /** One resolved output plus the precedence layer it came from. */
398
427
  export declare const ResolvedOutputSchema: z.ZodObject<{
399
428
  source: z.ZodEnum<{
@@ -28,7 +28,7 @@ import { ContractVersionSchema } from './versioning.js';
28
28
  *
29
29
  * Spec: docs/architecture/decision-558-resolution-contract.md.
30
30
  */
31
- export const DECISION_RESOLUTION_CONTRACT_VERSION = Object.freeze({ major: 1, minor: 1 });
31
+ export const DECISION_RESOLUTION_CONTRACT_VERSION = Object.freeze({ major: 1, minor: 2 });
32
32
  const TimestampSchema = z.iso.datetime();
33
33
  const DigestSchema = z.string().regex(/^sha256:[a-f0-9]{64}$/);
34
34
  const CapabilityNameSchema = z
@@ -62,6 +62,13 @@ export const ResolutionSourceSchema = z.enum([
62
62
  'profile-default',
63
63
  'policy-default',
64
64
  ]);
65
+ /**
66
+ * The versioned precedence order, highest first. It is part of the contract:
67
+ * changing it is a major version, never an edit in place.
68
+ */
69
+ export const DECISION_RESOLUTION_PRECEDENCE = Object.freeze([
70
+ ...ResolutionSourceSchema.options,
71
+ ]);
65
72
  /**
66
73
  * Sandbox selection stays inside M10-granted capabilities; it never grants.
67
74
  * `effectiveCapabilities` is always a subset of the resolved capability set
@@ -226,6 +233,20 @@ export const DecisionResolutionDiagnosticSchema = z.enum([
226
233
  'HARNESS_MAP_MODEL_UNMAPPED',
227
234
  'HARNESS_MAP_CONFLICTS_WITH_PIN',
228
235
  ]);
236
+ /**
237
+ * Every code a denial can carry. A denial is thrown, never returned in a
238
+ * resolution, so the codes v1.2 added live here and leave the response's
239
+ * closed `diagnostics` enum unchanged.
240
+ */
241
+ export const DecisionResolutionDenialSchema = z.enum([
242
+ ...DecisionResolutionDiagnosticSchema.options,
243
+ // v1.2: a resolved capability set that leaves out a capability the request
244
+ // requires. The run would otherwise start without it: a silent narrowing.
245
+ 'REQUIRED_CAPABILITY_NOT_RESOLVED',
246
+ // v1.2: a sandbox pin of mode `none` that names capabilities. `none` runs
247
+ // without the managed sandbox, so it can carry no capability.
248
+ 'SANDBOX_PIN_MISMATCH',
249
+ ]);
229
250
  /** One resolved output plus the precedence layer it came from. */
230
251
  export const ResolvedOutputSchema = z
231
252
  .object({
@@ -4,7 +4,7 @@ export declare const PublicContractFixtures: Readonly<{
4
4
  servicePrincipalId: string;
5
5
  };
6
6
  contractVersion: {
7
- readonly major: 3;
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: 3;
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: 3;
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: 3;
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: 3;
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: 3;
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: 3;
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: 3;
129
+ readonly major: 4;
130
130
  readonly minor: 0;
131
131
  };
132
132
  runtimeNodeRefId: string;
package/dist/fixtures.js CHANGED
@@ -1,4 +1,4 @@
1
- const contractVersion = { major: 3, minor: 0 };
1
+ const contractVersion = { major: 4, minor: 0 };
2
2
  const requestId = 'req_01JABCDEF0123456789ABCDEFG';
3
3
  const commandId = 'cmd_01JABCDEF0123456789ABCDEFG';
4
4
  const workspaceId = 'wsp_01JABCDEF0123456789ABCDEFG';
@@ -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', 'remote_host', 'agent_hq_cloud']),
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(['managed_cloud', 'managed_local', 'external_local']),
55
- location: z.enum(['local_device', 'agent_hq_cloud']),
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', 'remote_host', 'agent_hq_cloud']),
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,
@@ -7,17 +7,12 @@ export const ContractVersionSchema = z
7
7
  .strict();
8
8
  export const PublicContractManifest = Object.freeze({
9
9
  name: 'agent-hq-control-plane',
10
- // 3.3 adds a negotiated, read-only observation of an already-open Pi child owner.
11
- // Earlier versions retain their strict shapes. It conveys no attachment or control permission.
12
- current: { major: 3, minor: 3 },
13
- supported: [
14
- { major: 1, minor: 0 },
15
- { major: 2, minor: 0 },
16
- { major: 3, minor: 0 },
17
- { major: 3, minor: 1 },
18
- { major: 3, minor: 2 },
19
- { major: 3, minor: 3 },
20
- ],
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
+ // Only major 4 is served.
14
+ current: { major: 4, minor: 0 },
15
+ supported: [{ major: 4, minor: 0 }],
21
16
  });
22
17
  export function assessContractCompatibility(input) {
23
18
  const consumer = ContractVersionSchema.parse(input.consumer);
@@ -418,7 +418,7 @@ export declare const WorkspaceCatalogFixtures: Readonly<{
418
418
  readonly servicePrincipalId: 'svc_agent-hq';
419
419
  };
420
420
  contractVersion: {
421
- readonly major: 3;
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: 3;
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: 3;
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: 3;
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: 3;
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: 3;
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: 3;
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: 3;
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: 3;
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: 3;
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: 3;
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: 3, minor: 0 },
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.1.0",
3
+ "version": "5.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",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "scripts": {
45
45
  "build": "tsc -p tsconfig.json",
46
- "typecheck": "bun check -p tsconfig.json",
46
+ "typecheck": "bun check -p tsconfig.json && bun check -p tsconfig.test.json",
47
47
  "lint": "oxlint src",
48
48
  "test": "bun test --pass-with-no-tests"
49
49
  },