@adea-ai/contracts 2.2.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,7 @@ import { z } from 'zod';
2
2
  import { ServiceCallerAssertionSchema } from './authentication.js';
3
3
  import { CorrelationMetadataSchema } from './envelopes.js';
4
4
  import { IdentifierSchemas } from './identifiers.js';
5
+ import { CursorSchema } from './pagination.js';
5
6
  import { ContractVersionSchema } from './versioning.js';
6
7
  declare const TimestampSchema: z.ZodISODateTime;
7
8
  declare const DigestSchema: z.ZodString;
@@ -266,38 +267,6 @@ export type CredentialGetRequest = z.input<typeof CredentialGetRequestSchema>;
266
267
  export type CredentialListRequest = z.input<typeof CredentialListRequestSchema>;
267
268
  export type CredentialResponse = z.output<typeof CredentialResponseSchema>;
268
269
  export type CredentialListResponse = z.output<typeof CredentialListResponseSchema>;
269
- declare const RuntimeNodeCredentialIdSchema: z.ZodString;
270
- export declare const RuntimeNodeCredentialRevokeRequestSchema: z.ZodObject<{
271
- caller: typeof ServiceCallerAssertionSchema;
272
- contractVersion: typeof ContractVersionSchema;
273
- requestId: typeof IdentifierSchemas.requestId;
274
- workspaceId: typeof IdentifierSchemas.workspaceId;
275
- correlation: typeof CorrelationMetadataSchema;
276
- commandId: typeof IdentifierSchemas.commandId;
277
- idempotencyKey: typeof IdempotencyKeySchema;
278
- payloadHash: typeof PayloadHashSchema;
279
- operation: z.ZodLiteral<"runtime-node-credential.revoke">;
280
- issuedAt: typeof TimestampSchema;
281
- payload: z.ZodObject<{
282
- credentialId: z.ZodString;
283
- }, z.core.$strict>;
284
- }, z.core.$strict>;
285
- export declare const RuntimeNodeCredentialRevocationResponseSchema: z.ZodObject<{
286
- contractVersion: typeof ContractVersionSchema;
287
- requestId: typeof IdentifierSchemas.requestId;
288
- correlation: typeof CorrelationMetadataSchema;
289
- data: z.ZodObject<{
290
- credential: z.ZodObject<{
291
- credentialId: typeof RuntimeNodeCredentialIdSchema;
292
- nodeId: z.ZodString;
293
- workspaceId: typeof IdentifierSchemas.workspaceId;
294
- revocationVersion: z.ZodNumber;
295
- revokedAt: typeof TimestampSchema;
296
- }, z.core.$strict>;
297
- }, z.core.$strict>;
298
- }, z.core.$strip>;
299
- export type RuntimeNodeCredentialRevokeRequest = z.input<typeof RuntimeNodeCredentialRevokeRequestSchema>;
300
- export type RuntimeNodeCredentialRevocationResponse = z.output<typeof RuntimeNodeCredentialRevocationResponseSchema>;
301
270
  export declare const ProjectStateResolutionRequestSchema: z.ZodObject<{
302
271
  caller: typeof ServiceCallerAssertionSchema;
303
272
  contractVersion: typeof ContractVersionSchema;
@@ -417,6 +386,8 @@ export declare const MarketplaceCatalogRequestSchema: z.ZodObject<{
417
386
  parameters: z.ZodObject<{
418
387
  workspaceIdentity: typeof MarketplaceIdentitySchema;
419
388
  installedBy: z.ZodOptional<z.ZodString>;
389
+ limit: z.ZodOptional<z.ZodNumber>;
390
+ cursor: z.ZodOptional<typeof CursorSchema>;
420
391
  }, z.core.$strip>;
421
392
  }, z.core.$strip>;
422
393
  export declare const MarketplaceCatalogResponseSchema: z.ZodObject<{
@@ -446,6 +417,9 @@ export declare const MarketplaceCatalogResponseSchema: z.ZodObject<{
446
417
  unavailable: "unavailable";
447
418
  }>;
448
419
  }, z.core.$strict>>;
420
+ installationsPage: z.ZodOptional<z.ZodObject<{
421
+ nextCursor: z.ZodOptional<z.ZodString>;
422
+ }, z.core.$strip>>;
449
423
  }, z.core.$strip>;
450
424
  }, z.core.$strip>;
451
425
  export declare const MarketplaceInstallRequestSchema: z.ZodObject<{
@@ -1259,4 +1233,212 @@ export declare const CredentialApiFixtures: Readonly<{
1259
1233
  };
1260
1234
  };
1261
1235
  }>;
1236
+ export declare const DeviceSyncUploadRequestSchema: z.ZodObject<{
1237
+ caller: typeof ServiceCallerAssertionSchema;
1238
+ contractVersion: typeof ContractVersionSchema;
1239
+ requestId: typeof IdentifierSchemas.requestId;
1240
+ workspaceId: typeof IdentifierSchemas.workspaceId;
1241
+ projectId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"project ID">, string>>>;
1242
+ correlation: typeof CorrelationMetadataSchema;
1243
+ commandId: typeof IdentifierSchemas.commandId;
1244
+ idempotencyKey: typeof IdempotencyKeySchema;
1245
+ payloadHash: typeof PayloadHashSchema;
1246
+ operation: z.ZodLiteral<"device-sync.upload">;
1247
+ issuedAt: typeof TimestampSchema;
1248
+ payload: z.ZodObject<{
1249
+ objectId: z.ZodString;
1250
+ size: z.ZodNumber;
1251
+ ciphertextSha256: z.ZodString;
1252
+ authorKeyId: z.ZodString;
1253
+ }, z.core.$strict>;
1254
+ }, z.core.$strip>;
1255
+ export declare const DeviceSyncUploadResponseSchema: z.ZodObject<{
1256
+ contractVersion: typeof ContractVersionSchema;
1257
+ requestId: typeof IdentifierSchemas.requestId;
1258
+ correlation: typeof CorrelationMetadataSchema;
1259
+ data: z.ZodObject<{
1260
+ objectId: z.ZodString;
1261
+ url: z.ZodURL;
1262
+ headers: z.ZodRecord<z.ZodString, z.ZodString>;
1263
+ expiresAt: z.ZodISODateTime;
1264
+ }, z.core.$strict>;
1265
+ }, z.core.$strip>;
1266
+ export declare const DeviceSyncCommitRequestSchema: z.ZodObject<{
1267
+ caller: typeof ServiceCallerAssertionSchema;
1268
+ contractVersion: typeof ContractVersionSchema;
1269
+ requestId: typeof IdentifierSchemas.requestId;
1270
+ workspaceId: typeof IdentifierSchemas.workspaceId;
1271
+ projectId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"project ID">, string>>>;
1272
+ correlation: typeof CorrelationMetadataSchema;
1273
+ commandId: typeof IdentifierSchemas.commandId;
1274
+ idempotencyKey: typeof IdempotencyKeySchema;
1275
+ payloadHash: typeof PayloadHashSchema;
1276
+ operation: z.ZodLiteral<"device-sync.commit">;
1277
+ issuedAt: typeof TimestampSchema;
1278
+ payload: z.ZodObject<{
1279
+ objectId: z.ZodString;
1280
+ }, z.core.$strict>;
1281
+ }, z.core.$strip>;
1282
+ export declare const DeviceSyncCommitResponseSchema: z.ZodObject<{
1283
+ contractVersion: typeof ContractVersionSchema;
1284
+ requestId: typeof IdentifierSchemas.requestId;
1285
+ correlation: typeof CorrelationMetadataSchema;
1286
+ data: z.ZodObject<{
1287
+ objectId: z.ZodString;
1288
+ size: z.ZodNumber;
1289
+ }, z.core.$strict>;
1290
+ }, z.core.$strip>;
1291
+ export declare const DeviceSyncDownloadRequestSchema: z.ZodObject<{
1292
+ caller: typeof ServiceCallerAssertionSchema;
1293
+ contractVersion: typeof ContractVersionSchema;
1294
+ requestId: typeof IdentifierSchemas.requestId;
1295
+ workspaceId: typeof IdentifierSchemas.workspaceId;
1296
+ projectId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"project ID">, string>>>;
1297
+ correlation: typeof CorrelationMetadataSchema;
1298
+ operation: z.ZodLiteral<"device-sync.download">;
1299
+ requestedAt: typeof TimestampSchema;
1300
+ parameters: z.ZodObject<{
1301
+ objectIds: z.ZodArray<z.ZodString>;
1302
+ }, z.core.$strict>;
1303
+ }, z.core.$strip>;
1304
+ export declare const DeviceSyncDownloadResponseSchema: z.ZodObject<{
1305
+ contractVersion: typeof ContractVersionSchema;
1306
+ requestId: typeof IdentifierSchemas.requestId;
1307
+ correlation: typeof CorrelationMetadataSchema;
1308
+ data: z.ZodObject<{
1309
+ downloads: z.ZodArray<z.ZodObject<{
1310
+ objectId: z.ZodString;
1311
+ url: z.ZodURL;
1312
+ size: z.ZodNumber;
1313
+ }, z.core.$strict>>;
1314
+ missing: z.ZodArray<z.ZodString>;
1315
+ expiresAt: z.ZodISODateTime;
1316
+ }, z.core.$strict>;
1317
+ }, z.core.$strip>;
1318
+ export declare const DeviceSyncReleaseRequestSchema: z.ZodObject<{
1319
+ caller: typeof ServiceCallerAssertionSchema;
1320
+ contractVersion: typeof ContractVersionSchema;
1321
+ requestId: typeof IdentifierSchemas.requestId;
1322
+ workspaceId: typeof IdentifierSchemas.workspaceId;
1323
+ projectId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"project ID">, string>>>;
1324
+ correlation: typeof CorrelationMetadataSchema;
1325
+ commandId: typeof IdentifierSchemas.commandId;
1326
+ idempotencyKey: typeof IdempotencyKeySchema;
1327
+ payloadHash: typeof PayloadHashSchema;
1328
+ operation: z.ZodLiteral<"device-sync.release">;
1329
+ issuedAt: typeof TimestampSchema;
1330
+ payload: z.ZodObject<{
1331
+ objectIds: z.ZodArray<z.ZodString>;
1332
+ }, z.core.$strict>;
1333
+ }, z.core.$strip>;
1334
+ export declare const DeviceSyncReleaseResponseSchema: z.ZodObject<{
1335
+ contractVersion: typeof ContractVersionSchema;
1336
+ requestId: typeof IdentifierSchemas.requestId;
1337
+ correlation: typeof CorrelationMetadataSchema;
1338
+ data: z.ZodObject<{
1339
+ released: z.ZodNumber;
1340
+ }, z.core.$strict>;
1341
+ }, z.core.$strip>;
1342
+ export declare const DeviceSyncAppendRequestSchema: z.ZodObject<{
1343
+ caller: typeof ServiceCallerAssertionSchema;
1344
+ contractVersion: typeof ContractVersionSchema;
1345
+ requestId: typeof IdentifierSchemas.requestId;
1346
+ workspaceId: typeof IdentifierSchemas.workspaceId;
1347
+ projectId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"project ID">, string>>>;
1348
+ correlation: typeof CorrelationMetadataSchema;
1349
+ commandId: typeof IdentifierSchemas.commandId;
1350
+ idempotencyKey: typeof IdempotencyKeySchema;
1351
+ payloadHash: typeof PayloadHashSchema;
1352
+ operation: z.ZodLiteral<"device-sync.append">;
1353
+ issuedAt: typeof TimestampSchema;
1354
+ payload: z.ZodObject<{
1355
+ entries: z.ZodArray<z.ZodObject<{
1356
+ entryId: z.ZodString;
1357
+ authorKeyId: z.ZodString;
1358
+ objectIds: z.ZodArray<z.ZodString>;
1359
+ ckv: z.ZodNumber;
1360
+ nonce: z.ZodString;
1361
+ ciphertext: z.ZodString;
1362
+ signature: z.ZodString;
1363
+ }, z.core.$strict>>;
1364
+ }, z.core.$strict>;
1365
+ }, z.core.$strip>;
1366
+ export declare const DeviceSyncAppendResponseSchema: z.ZodObject<{
1367
+ contractVersion: typeof ContractVersionSchema;
1368
+ requestId: typeof IdentifierSchemas.requestId;
1369
+ correlation: typeof CorrelationMetadataSchema;
1370
+ data: z.ZodObject<{
1371
+ entries: z.ZodArray<z.ZodObject<{
1372
+ entryId: z.ZodString;
1373
+ seq: z.ZodNumber;
1374
+ }, z.core.$strict>>;
1375
+ }, z.core.$strict>;
1376
+ }, z.core.$strip>;
1377
+ export declare const DeviceSyncLogRequestSchema: z.ZodObject<{
1378
+ caller: typeof ServiceCallerAssertionSchema;
1379
+ contractVersion: typeof ContractVersionSchema;
1380
+ requestId: typeof IdentifierSchemas.requestId;
1381
+ workspaceId: typeof IdentifierSchemas.workspaceId;
1382
+ projectId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"project ID">, string>>>;
1383
+ correlation: typeof CorrelationMetadataSchema;
1384
+ operation: z.ZodLiteral<"device-sync.log">;
1385
+ requestedAt: typeof TimestampSchema;
1386
+ parameters: z.ZodObject<{
1387
+ afterSeq: z.ZodNumber;
1388
+ limit: z.ZodOptional<z.ZodNumber>;
1389
+ }, z.core.$strict>;
1390
+ }, z.core.$strip>;
1391
+ export declare const DeviceSyncLogResponseSchema: z.ZodObject<{
1392
+ contractVersion: typeof ContractVersionSchema;
1393
+ requestId: typeof IdentifierSchemas.requestId;
1394
+ correlation: typeof CorrelationMetadataSchema;
1395
+ data: z.ZodObject<{
1396
+ entries: z.ZodArray<z.ZodObject<{
1397
+ entryId: z.ZodString;
1398
+ authorKeyId: z.ZodString;
1399
+ objectIds: z.ZodArray<z.ZodString>;
1400
+ ckv: z.ZodNumber;
1401
+ nonce: z.ZodString;
1402
+ ciphertext: z.ZodString;
1403
+ signature: z.ZodString;
1404
+ seq: z.ZodNumber;
1405
+ createdAt: z.ZodISODateTime;
1406
+ }, z.core.$strict>>;
1407
+ headSeq: z.ZodNumber;
1408
+ }, z.core.$strict>;
1409
+ }, z.core.$strip>;
1410
+ export declare const DeviceSyncUsageRequestSchema: z.ZodObject<{
1411
+ caller: typeof ServiceCallerAssertionSchema;
1412
+ contractVersion: typeof ContractVersionSchema;
1413
+ requestId: typeof IdentifierSchemas.requestId;
1414
+ workspaceId: typeof IdentifierSchemas.workspaceId;
1415
+ projectId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"project ID">, string>>>;
1416
+ correlation: typeof CorrelationMetadataSchema;
1417
+ operation: z.ZodLiteral<"device-sync.usage">;
1418
+ requestedAt: typeof TimestampSchema;
1419
+ parameters: z.ZodObject<{}, z.core.$strict>;
1420
+ }, z.core.$strip>;
1421
+ export declare const DeviceSyncUsageResponseSchema: z.ZodObject<{
1422
+ contractVersion: typeof ContractVersionSchema;
1423
+ requestId: typeof IdentifierSchemas.requestId;
1424
+ correlation: typeof CorrelationMetadataSchema;
1425
+ data: z.ZodObject<{
1426
+ usedBytes: z.ZodNumber;
1427
+ quotaBytes: z.ZodNumber;
1428
+ }, z.core.$strict>;
1429
+ }, z.core.$strip>;
1430
+ export type DeviceSyncUploadRequest = z.input<typeof DeviceSyncUploadRequestSchema>;
1431
+ export type DeviceSyncUploadResponse = z.output<typeof DeviceSyncUploadResponseSchema>;
1432
+ export type DeviceSyncCommitRequest = z.input<typeof DeviceSyncCommitRequestSchema>;
1433
+ export type DeviceSyncCommitResponse = z.output<typeof DeviceSyncCommitResponseSchema>;
1434
+ export type DeviceSyncDownloadRequest = z.input<typeof DeviceSyncDownloadRequestSchema>;
1435
+ export type DeviceSyncDownloadResponse = z.output<typeof DeviceSyncDownloadResponseSchema>;
1436
+ export type DeviceSyncReleaseRequest = z.input<typeof DeviceSyncReleaseRequestSchema>;
1437
+ export type DeviceSyncReleaseResponse = z.output<typeof DeviceSyncReleaseResponseSchema>;
1438
+ export type DeviceSyncAppendRequest = z.input<typeof DeviceSyncAppendRequestSchema>;
1439
+ export type DeviceSyncAppendResponse = z.output<typeof DeviceSyncAppendResponseSchema>;
1440
+ export type DeviceSyncLogRequest = z.input<typeof DeviceSyncLogRequestSchema>;
1441
+ export type DeviceSyncLogResponse = z.output<typeof DeviceSyncLogResponseSchema>;
1442
+ export type DeviceSyncUsageRequest = z.input<typeof DeviceSyncUsageRequestSchema>;
1443
+ export type DeviceSyncUsageResponse = z.output<typeof DeviceSyncUsageResponseSchema>;
1262
1444
  export {};
@@ -5,6 +5,7 @@ import { 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';
8
+ import { SyncAppendRequestSchema, SyncAppendResponseSchema, SyncAuthorKeyIdSchema, SyncCommitResponseSchema, SyncDownloadRequestSchema, SyncDownloadResponseSchema, SyncLogPageSchema, SyncLogRequestSchema, SyncObjectRequestSchema, SyncReleaseResponseSchema, SyncUploadRequestSchema, SyncUploadResponseSchema, SyncUsageSchema, } from './device-sync.js';
8
9
  import { ContractVersionSchema } from './versioning.js';
9
10
  const TimestampSchema = z.iso.datetime();
10
11
  const DigestSchema = z.string().regex(/^sha256:[a-f0-9]{64}$/);
@@ -209,32 +210,6 @@ export const CredentialListResponseSchema = successResponse(z
209
210
  nextCursor: CursorSchema.optional(),
210
211
  })
211
212
  .strict());
212
- // Hosted RuntimeNode credential revocation. Shares the connector credential scope
213
- // (`credential:write`) and envelope workspace binding; the credential ID is the
214
- // RuntimeNode `rgc_` identifier, which is distinct from connector credential IDs.
215
- const RuntimeNodeCredentialIdSchema = z
216
- .string()
217
- .min(8)
218
- .max(128)
219
- .regex(/^rgc_[A-Za-z0-9_-]+$/);
220
- export const RuntimeNodeCredentialRevokeRequestSchema = CredentialCommandContextSchema.extend({
221
- operation: z.literal('runtime-node-credential.revoke'),
222
- issuedAt: TimestampSchema,
223
- payload: z.object({ credentialId: RuntimeNodeCredentialIdSchema }).strict(),
224
- }).strict();
225
- export const RuntimeNodeCredentialRevocationResponseSchema = successResponse(z
226
- .object({
227
- credential: z
228
- .object({
229
- credentialId: RuntimeNodeCredentialIdSchema,
230
- nodeId: z.string().regex(/^rnr_[0-9A-HJKMNP-TV-Z]{26}$/),
231
- workspaceId: IdentifierSchemas.workspaceId,
232
- revocationVersion: z.number().int().positive(),
233
- revokedAt: TimestampSchema,
234
- })
235
- .strict(),
236
- })
237
- .strict());
238
213
  export const ProjectStateResolutionRequestSchema = RequestContextSchema.extend({
239
214
  operation: z.literal('project-state.resolve'),
240
215
  requestedAt: TimestampSchema,
@@ -317,6 +292,10 @@ export const MarketplaceCatalogRequestSchema = RequestContextSchema.extend({
317
292
  // `workspaceIdentity.userId` of the install request) matches. Omitted,
318
293
  // every active installation in the workspace is returned, as before.
319
294
  installedBy: z.string().min(1).max(128).optional(),
295
+ // Additive 3.x paging of `installations`: at most `limit` (default and
296
+ // maximum 100) per response, continued with `installationsPage.nextCursor`.
297
+ limit: z.number().int().min(1).max(100).optional(),
298
+ cursor: CursorSchema.optional(),
320
299
  }),
321
300
  });
322
301
  export const MarketplaceCatalogResponseSchema = successResponse(z.object({
@@ -324,14 +303,18 @@ export const MarketplaceCatalogResponseSchema = successResponse(z.object({
324
303
  releaseId: z.string().regex(/^catalog:[a-f0-9]{64}$/),
325
304
  state: z.enum(['ready', 'stale']),
326
305
  artifacts: MarketplaceArtifactsSchema,
327
- installations: z.array(MarketplacePluginReferenceContractSchema.extend({
306
+ installations: z
307
+ .array(MarketplacePluginReferenceContractSchema.extend({
328
308
  // Additive 3.x field: the handle for the installation get and
329
309
  // uninstall operations.
330
310
  installationId: z.string().min(1).max(128).optional(),
331
311
  installationInstanceId: z.string().min(1).max(256).optional(),
332
312
  packageDigest: DigestSchema.optional(),
333
313
  state: z.enum(MarketplaceInstallationDecisionStates),
334
- })),
314
+ }))
315
+ .max(100),
316
+ // Additive 3.x field; absent from servers that predate installation paging.
317
+ installationsPage: z.object({ nextCursor: CursorSchema.optional() }).optional(),
335
318
  }));
336
319
  export const MarketplaceInstallRequestSchema = CommandContextSchema.extend({
337
320
  operation: z.literal('marketplace.install.request'),
@@ -1031,3 +1014,29 @@ export const CredentialApiFixtures = Object.freeze({
1031
1014
  response: { ...responseContext, data: { credentials: [credentialFixtureMetadata] } },
1032
1015
  },
1033
1016
  });
1017
+ // ---------------------------------------------------------------------------------------------
1018
+ // Encrypted device sync envelopes (adea-ai/control-plane#1566); the bodies live in device-sync.ts.
1019
+ const deviceSyncCommand = (operation, payload) => CommandContextSchema.extend({
1020
+ operation: z.literal(operation),
1021
+ issuedAt: TimestampSchema,
1022
+ payload,
1023
+ });
1024
+ const deviceSyncRead = (operation, parameters) => RequestContextSchema.extend({
1025
+ operation: z.literal(operation),
1026
+ requestedAt: TimestampSchema,
1027
+ parameters,
1028
+ });
1029
+ export const DeviceSyncUploadRequestSchema = deviceSyncCommand('device-sync.upload', SyncUploadRequestSchema.extend({ authorKeyId: SyncAuthorKeyIdSchema }).strict());
1030
+ export const DeviceSyncUploadResponseSchema = successResponse(SyncUploadResponseSchema);
1031
+ export const DeviceSyncCommitRequestSchema = deviceSyncCommand('device-sync.commit', SyncObjectRequestSchema);
1032
+ export const DeviceSyncCommitResponseSchema = successResponse(SyncCommitResponseSchema);
1033
+ export const DeviceSyncDownloadRequestSchema = deviceSyncRead('device-sync.download', SyncDownloadRequestSchema);
1034
+ export const DeviceSyncDownloadResponseSchema = successResponse(SyncDownloadResponseSchema);
1035
+ export const DeviceSyncReleaseRequestSchema = deviceSyncCommand('device-sync.release', SyncDownloadRequestSchema);
1036
+ export const DeviceSyncReleaseResponseSchema = successResponse(SyncReleaseResponseSchema);
1037
+ export const DeviceSyncAppendRequestSchema = deviceSyncCommand('device-sync.append', SyncAppendRequestSchema);
1038
+ export const DeviceSyncAppendResponseSchema = successResponse(SyncAppendResponseSchema);
1039
+ export const DeviceSyncLogRequestSchema = deviceSyncRead('device-sync.log', SyncLogRequestSchema);
1040
+ export const DeviceSyncLogResponseSchema = successResponse(SyncLogPageSchema);
1041
+ export const DeviceSyncUsageRequestSchema = deviceSyncRead('device-sync.usage', z.object({}).strict());
1042
+ export const DeviceSyncUsageResponseSchema = successResponse(SyncUsageSchema);
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import type { RuntimeConnectionDiscoveryReadModel } from './runtime-discovery.js';
3
2
  /**
4
3
  * Decision-layer contract (control-plane#558).
5
4
  *
@@ -115,13 +114,11 @@ export declare const AvailableRuntimeSchema: z.ZodObject<{
115
114
  }>;
116
115
  transport: z.ZodEnum<{
117
116
  "direct-local": "direct-local";
118
- "remote-gateway": "remote-gateway";
119
117
  }>;
120
118
  harnessIds: z.ZodArray<z.ZodString>;
121
119
  capabilities: z.ZodArray<z.ZodString>;
122
120
  }, z.core.$strict>;
123
121
  export type AvailableRuntime = z.output<typeof AvailableRuntimeSchema>;
124
- export declare function availableRuntimesFromDiscovery(models: readonly RuntimeConnectionDiscoveryReadModel[]): AvailableRuntime[];
125
122
  export declare const DecisionResolutionRequestSchema: z.ZodObject<{
126
123
  contractVersion: z.ZodObject<{
127
124
  major: z.ZodNumber;
@@ -153,7 +150,6 @@ export declare const DecisionResolutionRequestSchema: z.ZodObject<{
153
150
  }>;
154
151
  transport: z.ZodEnum<{
155
152
  "direct-local": "direct-local";
156
- "remote-gateway": "remote-gateway";
157
153
  }>;
158
154
  harnessIds: z.ZodArray<z.ZodString>;
159
155
  capabilities: z.ZodArray<z.ZodString>;
@@ -373,7 +369,6 @@ export declare const DecisionLayerResolutionSchema: z.ZodObject<{
373
369
  }>;
374
370
  transport: z.ZodEnum<{
375
371
  "direct-local": "direct-local";
376
- "remote-gateway": "remote-gateway";
377
372
  }>;
378
373
  harnessIds: z.ZodArray<z.ZodString>;
379
374
  capabilities: z.ZodArray<z.ZodString>;
@@ -99,39 +99,11 @@ export const AvailableRuntimeSchema = z
99
99
  .object({
100
100
  runtimeDefinitionId: IdentifierSchemas.runtimeDefinitionId,
101
101
  kind: z.enum(['local', 'self-hosted', 'cloud']),
102
- transport: z.enum(['direct-local', 'remote-gateway']),
102
+ transport: z.enum(['direct-local']),
103
103
  harnessIds: z.array(HarnessIdSchema).max(16),
104
104
  capabilities: z.array(CapabilityNameSchema).max(64),
105
105
  })
106
106
  .strict();
107
- /**
108
- * Maps runtime-discovery read models onto the decision layer's runtime view
109
- * (#74 / M12 wiring). The discovery `family` is the harness family id — the
110
- * same kebab-case shape HarnessIdSchema requires — so a runtime advertising
111
- * family `pi` exposes harness id `pi`. Unavailable and revoked connections are
112
- * not offered to resolution; degraded ones remain selectable because policy
113
- * decides whether a degraded runtime is acceptable.
114
- */
115
- function runtimeKind(model) {
116
- // The discovery model's location is local_device | agent_hq_cloud; the
117
- // managed/external connection types resolve the remaining distinction.
118
- if (model.connectionType === 'managed_cloud')
119
- return 'cloud';
120
- if (model.connectionType === 'managed_local')
121
- return 'local';
122
- return model.location === 'local_device' ? 'local' : 'self-hosted';
123
- }
124
- export function availableRuntimesFromDiscovery(models) {
125
- return models
126
- .filter((model) => model.status === 'available' || model.status === 'degraded')
127
- .map((model) => AvailableRuntimeSchema.parse({
128
- runtimeDefinitionId: model.runtimeDefinitionId,
129
- kind: runtimeKind(model),
130
- transport: 'remote-gateway',
131
- harnessIds: [model.family],
132
- capabilities: [...model.capabilities],
133
- }));
134
- }
135
107
  export const DecisionResolutionRequestSchema = z
136
108
  .object({
137
109
  contractVersion: ContractVersionSchema,
@@ -0,0 +1,128 @@
1
+ import { z } from 'zod';
2
+ export declare const DeviceSyncErrorCodeSchema: z.ZodEnum<{
3
+ SYNC_AUTHOR_REVOKED: "SYNC_AUTHOR_REVOKED";
4
+ SYNC_AUTHOR_UNKNOWN: "SYNC_AUTHOR_UNKNOWN";
5
+ SYNC_BLOB_INVALID: "SYNC_BLOB_INVALID";
6
+ SYNC_BLOB_TOO_LARGE: "SYNC_BLOB_TOO_LARGE";
7
+ SYNC_DECRYPTION_FAILED: "SYNC_DECRYPTION_FAILED";
8
+ SYNC_ENTRY_CONFLICT: "SYNC_ENTRY_CONFLICT";
9
+ SYNC_ENTRY_INVALID: "SYNC_ENTRY_INVALID";
10
+ SYNC_ENTRY_TOO_LARGE: "SYNC_ENTRY_TOO_LARGE";
11
+ SYNC_KEY_UNAVAILABLE: "SYNC_KEY_UNAVAILABLE";
12
+ SYNC_LOG_ROLLED_BACK: "SYNC_LOG_ROLLED_BACK";
13
+ SYNC_OBJECT_CONFLICT: "SYNC_OBJECT_CONFLICT";
14
+ SYNC_OBJECT_NOT_COMMITTED: "SYNC_OBJECT_NOT_COMMITTED";
15
+ SYNC_QUOTA_EXCEEDED: "SYNC_QUOTA_EXCEEDED";
16
+ SYNC_REQUEST_EXPIRED: "SYNC_REQUEST_EXPIRED";
17
+ SYNC_REQUEST_INVALID: "SYNC_REQUEST_INVALID";
18
+ SYNC_SIGNATURE_INVALID: "SYNC_SIGNATURE_INVALID";
19
+ SYNC_UNAVAILABLE: "SYNC_UNAVAILABLE";
20
+ }>;
21
+ export type DeviceSyncErrorCode = z.infer<typeof DeviceSyncErrorCodeSchema>;
22
+ /** The largest sealed log entry plaintext. */
23
+ export declare const MAX_SYNC_ENTRY_BYTES: number;
24
+ /** Entries per append and object ids per download or release. */
25
+ export declare const MAX_SYNC_BATCH = 100;
26
+ export declare const MAX_SYNC_LOG_PAGE = 500;
27
+ /** The smallest sealed object: a 12-byte header, the 8-byte length prefix and one 16-byte tag. */
28
+ export declare const MIN_SYNC_CIPHERTEXT_BYTES = 36;
29
+ /** The sealed size of the largest (256 MiB) object; device-sync tests pin it to the blob format. */
30
+ export declare const MAX_SYNC_CIPHERTEXT_BYTES = 276828300;
31
+ export declare const SyncAuthorKeyIdSchema: z.ZodString;
32
+ export declare const SyncObjectIdSchema: z.ZodString;
33
+ export declare const SyncEntryIdSchema: z.ZodString;
34
+ /** What the server stores and serves for one entry, signed by its author over these fields. */
35
+ export declare const SignedSyncEntrySchema: z.ZodObject<{
36
+ entryId: z.ZodString;
37
+ authorKeyId: z.ZodString;
38
+ objectIds: z.ZodArray<z.ZodString>;
39
+ ckv: z.ZodNumber;
40
+ nonce: z.ZodString;
41
+ ciphertext: z.ZodString;
42
+ signature: z.ZodString;
43
+ }, z.core.$strict>;
44
+ export type SignedSyncEntry = z.infer<typeof SignedSyncEntrySchema>;
45
+ export declare const StoredSyncEntrySchema: z.ZodObject<{
46
+ entryId: z.ZodString;
47
+ authorKeyId: z.ZodString;
48
+ objectIds: z.ZodArray<z.ZodString>;
49
+ ckv: z.ZodNumber;
50
+ nonce: z.ZodString;
51
+ ciphertext: z.ZodString;
52
+ signature: z.ZodString;
53
+ seq: z.ZodNumber;
54
+ createdAt: z.ZodISODateTime;
55
+ }, z.core.$strict>;
56
+ export type StoredSyncEntry = z.infer<typeof StoredSyncEntrySchema>;
57
+ export declare const SyncUploadRequestSchema: z.ZodObject<{
58
+ objectId: z.ZodString;
59
+ size: z.ZodNumber;
60
+ ciphertextSha256: z.ZodString;
61
+ }, z.core.$strict>;
62
+ export declare const SyncUploadResponseSchema: z.ZodObject<{
63
+ objectId: z.ZodString;
64
+ url: z.ZodURL;
65
+ headers: z.ZodRecord<z.ZodString, z.ZodString>;
66
+ expiresAt: z.ZodISODateTime;
67
+ }, z.core.$strict>;
68
+ export declare const SyncObjectRequestSchema: z.ZodObject<{
69
+ objectId: z.ZodString;
70
+ }, z.core.$strict>;
71
+ export declare const SyncCommitResponseSchema: z.ZodObject<{
72
+ objectId: z.ZodString;
73
+ size: z.ZodNumber;
74
+ }, z.core.$strict>;
75
+ export declare const SyncDownloadRequestSchema: z.ZodObject<{
76
+ objectIds: z.ZodArray<z.ZodString>;
77
+ }, z.core.$strict>;
78
+ export declare const SyncDownloadResponseSchema: z.ZodObject<{
79
+ downloads: z.ZodArray<z.ZodObject<{
80
+ objectId: z.ZodString;
81
+ url: z.ZodURL;
82
+ size: z.ZodNumber;
83
+ }, z.core.$strict>>;
84
+ missing: z.ZodArray<z.ZodString>;
85
+ expiresAt: z.ZodISODateTime;
86
+ }, z.core.$strict>;
87
+ export declare const SyncReleaseResponseSchema: z.ZodObject<{
88
+ released: z.ZodNumber;
89
+ }, z.core.$strict>;
90
+ export declare const SyncAppendRequestSchema: z.ZodObject<{
91
+ entries: z.ZodArray<z.ZodObject<{
92
+ entryId: z.ZodString;
93
+ authorKeyId: z.ZodString;
94
+ objectIds: z.ZodArray<z.ZodString>;
95
+ ckv: z.ZodNumber;
96
+ nonce: z.ZodString;
97
+ ciphertext: z.ZodString;
98
+ signature: z.ZodString;
99
+ }, z.core.$strict>>;
100
+ }, z.core.$strict>;
101
+ export declare const SyncAppendResponseSchema: z.ZodObject<{
102
+ entries: z.ZodArray<z.ZodObject<{
103
+ entryId: z.ZodString;
104
+ seq: z.ZodNumber;
105
+ }, z.core.$strict>>;
106
+ }, z.core.$strict>;
107
+ export declare const SyncLogRequestSchema: z.ZodObject<{
108
+ afterSeq: z.ZodNumber;
109
+ limit: z.ZodOptional<z.ZodNumber>;
110
+ }, z.core.$strict>;
111
+ export declare const SyncLogPageSchema: z.ZodObject<{
112
+ entries: z.ZodArray<z.ZodObject<{
113
+ entryId: z.ZodString;
114
+ authorKeyId: z.ZodString;
115
+ objectIds: z.ZodArray<z.ZodString>;
116
+ ckv: z.ZodNumber;
117
+ nonce: z.ZodString;
118
+ ciphertext: z.ZodString;
119
+ signature: z.ZodString;
120
+ seq: z.ZodNumber;
121
+ createdAt: z.ZodISODateTime;
122
+ }, z.core.$strict>>;
123
+ headSeq: z.ZodNumber;
124
+ }, z.core.$strict>;
125
+ export declare const SyncUsageSchema: z.ZodObject<{
126
+ usedBytes: z.ZodNumber;
127
+ quotaBytes: z.ZodNumber;
128
+ }, z.core.$strict>;
@@ -0,0 +1,115 @@
1
+ // Encrypted device sync (adea-ai/control-plane#1566): the wire bodies only. Every field is an
2
+ // opaque id, a padded size, an author key id or ciphertext. The crypto lives in
3
+ // @adea-ai/runtime-gateway-protocol/device-sync, which re-exports these schemas; this
4
+ // module has no other import so browser bundles stay small.
5
+ import { z } from 'zod';
6
+ const TimestampSchema = z.iso.datetime();
7
+ export const DeviceSyncErrorCodeSchema = z.enum([
8
+ 'SYNC_BLOB_INVALID',
9
+ 'SYNC_BLOB_TOO_LARGE',
10
+ 'SYNC_DECRYPTION_FAILED',
11
+ 'SYNC_KEY_UNAVAILABLE',
12
+ 'SYNC_ENTRY_INVALID',
13
+ 'SYNC_ENTRY_TOO_LARGE',
14
+ 'SYNC_SIGNATURE_INVALID',
15
+ 'SYNC_AUTHOR_UNKNOWN',
16
+ 'SYNC_AUTHOR_REVOKED',
17
+ 'SYNC_REQUEST_INVALID',
18
+ 'SYNC_REQUEST_EXPIRED',
19
+ 'SYNC_LOG_ROLLED_BACK',
20
+ 'SYNC_QUOTA_EXCEEDED',
21
+ 'SYNC_OBJECT_NOT_COMMITTED',
22
+ 'SYNC_OBJECT_CONFLICT',
23
+ 'SYNC_ENTRY_CONFLICT',
24
+ 'SYNC_UNAVAILABLE',
25
+ ]);
26
+ /** The largest sealed log entry plaintext. */
27
+ export const MAX_SYNC_ENTRY_BYTES = 16 * 1024;
28
+ /** Entries per append and object ids per download or release. */
29
+ export const MAX_SYNC_BATCH = 100;
30
+ export const MAX_SYNC_LOG_PAGE = 500;
31
+ /** The smallest sealed object: a 12-byte header, the 8-byte length prefix and one 16-byte tag. */
32
+ export const MIN_SYNC_CIPHERTEXT_BYTES = 36;
33
+ /** The sealed size of the largest (256 MiB) object; device-sync tests pin it to the blob format. */
34
+ export const MAX_SYNC_CIPHERTEXT_BYTES = 276_828_300;
35
+ const SyncBase64UrlSchema = z
36
+ .string()
37
+ .min(1)
38
+ .regex(/^[A-Za-z0-9_-]+$/);
39
+ export const SyncAuthorKeyIdSchema = z.string().regex(/^(?:spk|dpk)_[a-f0-9]{32}$/);
40
+ export const SyncObjectIdSchema = z.string().regex(/^sob_[a-f0-9]{32}$/);
41
+ export const SyncEntryIdSchema = z.string().regex(/^sen_[a-f0-9]{32}$/);
42
+ const SyncSha256Schema = z.string().regex(/^sha256:[a-f0-9]{64}$/);
43
+ /** What the server stores and serves for one entry, signed by its author over these fields. */
44
+ export const SignedSyncEntrySchema = z
45
+ .object({
46
+ entryId: SyncEntryIdSchema,
47
+ authorKeyId: SyncAuthorKeyIdSchema,
48
+ objectIds: z.array(SyncObjectIdSchema).max(1),
49
+ ckv: z.number().int().min(1),
50
+ nonce: SyncBase64UrlSchema.length(16),
51
+ ciphertext: SyncBase64UrlSchema.max(Math.ceil(((MAX_SYNC_ENTRY_BYTES + 16) * 4) / 3)),
52
+ signature: SyncBase64UrlSchema.length(86),
53
+ })
54
+ .strict();
55
+ export const StoredSyncEntrySchema = SignedSyncEntrySchema.extend({
56
+ seq: z.number().int().min(1),
57
+ createdAt: TimestampSchema,
58
+ }).strict();
59
+ export const SyncUploadRequestSchema = z
60
+ .object({
61
+ objectId: SyncObjectIdSchema,
62
+ size: z.number().int().min(MIN_SYNC_CIPHERTEXT_BYTES).max(MAX_SYNC_CIPHERTEXT_BYTES),
63
+ ciphertextSha256: SyncSha256Schema,
64
+ })
65
+ .strict();
66
+ const PresignedSyncUrlSchema = z.url().max(4096);
67
+ export const SyncUploadResponseSchema = z
68
+ .object({
69
+ objectId: SyncObjectIdSchema,
70
+ url: PresignedSyncUrlSchema,
71
+ headers: z.record(z.string(), z.string()),
72
+ expiresAt: TimestampSchema,
73
+ })
74
+ .strict();
75
+ export const SyncObjectRequestSchema = z.object({ objectId: SyncObjectIdSchema }).strict();
76
+ export const SyncCommitResponseSchema = z
77
+ .object({ objectId: SyncObjectIdSchema, size: z.number().int().min(1) })
78
+ .strict();
79
+ export const SyncDownloadRequestSchema = z
80
+ .object({ objectIds: z.array(SyncObjectIdSchema).min(1).max(MAX_SYNC_BATCH) })
81
+ .strict();
82
+ export const SyncDownloadResponseSchema = z
83
+ .object({
84
+ downloads: z.array(z
85
+ .object({
86
+ objectId: SyncObjectIdSchema,
87
+ url: PresignedSyncUrlSchema,
88
+ size: z.number().int().min(1),
89
+ })
90
+ .strict()),
91
+ missing: z.array(SyncObjectIdSchema),
92
+ expiresAt: TimestampSchema,
93
+ })
94
+ .strict();
95
+ export const SyncReleaseResponseSchema = z.object({ released: z.number().int().min(0) }).strict();
96
+ export const SyncAppendRequestSchema = z
97
+ .object({ entries: z.array(SignedSyncEntrySchema).min(1).max(MAX_SYNC_BATCH) })
98
+ .strict();
99
+ export const SyncAppendResponseSchema = z
100
+ .object({
101
+ entries: z.array(z.object({ entryId: SyncEntryIdSchema, seq: z.number().int().min(1) }).strict()),
102
+ })
103
+ .strict();
104
+ export const SyncLogRequestSchema = z
105
+ .object({
106
+ afterSeq: z.number().int().min(0),
107
+ limit: z.number().int().min(1).max(MAX_SYNC_LOG_PAGE).optional(),
108
+ })
109
+ .strict();
110
+ export const SyncLogPageSchema = z
111
+ .object({ entries: z.array(StoredSyncEntrySchema), headSeq: z.number().int().min(0) })
112
+ .strict();
113
+ export const SyncUsageSchema = z
114
+ .object({ usedBytes: z.number().int().min(0), quotaBytes: z.number().int().min(0) })
115
+ .strict();
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './canonical-json.js';
5
5
  export * from './control-api.js';
6
6
  export * from './context-providers.js';
7
7
  export * from './decision-resolution.js';
8
+ export * from './device-sync.js';
8
9
  export * from './envelopes.js';
9
10
  export * from './execution-scope.js';
10
11
  export * from './fixtures.js';
package/dist/index.js CHANGED
@@ -9,6 +9,7 @@ export * from './canonical-json.js';
9
9
  export * from './control-api.js';
10
10
  export * from './context-providers.js';
11
11
  export * from './decision-resolution.js';
12
+ export * from './device-sync.js';
12
13
  export * from './envelopes.js';
13
14
  export * from './execution-scope.js';
14
15
  export * from './fixtures.js';
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { CursorSchema } from './pagination.js';
2
3
  export declare const ModelFundingSourceSchema: z.ZodEnum<{
3
4
  byo_api: "byo_api";
4
5
  external_subscription: "external_subscription";
@@ -14,13 +15,11 @@ export declare const ModelExecutionTargetSchema: z.ZodObject<{
14
15
  }>;
15
16
  harness: z.ZodEnum<{
16
17
  acp: "acp";
17
- cloudflare_agents: "cloudflare_agents";
18
18
  pi: "pi";
19
19
  pi_durable: "pi_durable";
20
20
  }>;
21
21
  harnessVersion: z.ZodString;
22
22
  providerBinding: z.ZodEnum<{
23
- cloudflare_binding: "cloudflare_binding";
24
23
  native_harness: "native_harness";
25
24
  pi_durable_models: "pi_durable_models";
26
25
  pi_model_runtime: "pi_model_runtime";
@@ -69,13 +68,11 @@ export declare const RuntimeProviderSelectionSchema: z.ZodObject<{
69
68
  }>;
70
69
  harness: z.ZodEnum<{
71
70
  acp: "acp";
72
- cloudflare_agents: "cloudflare_agents";
73
71
  pi: "pi";
74
72
  pi_durable: "pi_durable";
75
73
  }>;
76
74
  harnessVersion: z.ZodString;
77
75
  providerBinding: z.ZodEnum<{
78
- cloudflare_binding: "cloudflare_binding";
79
76
  native_harness: "native_harness";
80
77
  pi_durable_models: "pi_durable_models";
81
78
  pi_model_runtime: "pi_model_runtime";
@@ -169,6 +166,8 @@ export type ModelExecutionTarget = z.output<typeof ModelExecutionTargetSchema>;
169
166
  export type ModelChoice = z.output<typeof ModelChoiceSchema>;
170
167
  export type WorkspaceModelDefaults = z.output<typeof WorkspaceModelDefaultsSchema>;
171
168
  export type ModelReadinessReason = z.output<typeof ModelReadinessReasonSchema>;
169
+ /** The most connections one `model-connections.list` page carries; the default page size. */
170
+ export declare const MODEL_CONNECTIONS_PAGE_MAX = 32;
172
171
  export declare const ModelConnectionListRequestSchema: z.ZodObject<{
173
172
  contractVersion: z.ZodObject<{
174
173
  major: z.ZodNumber;
@@ -195,18 +194,18 @@ export declare const ModelConnectionListRequestSchema: z.ZodObject<{
195
194
  }>;
196
195
  harness: z.ZodEnum<{
197
196
  acp: "acp";
198
- cloudflare_agents: "cloudflare_agents";
199
197
  pi: "pi";
200
198
  pi_durable: "pi_durable";
201
199
  }>;
202
200
  harnessVersion: z.ZodString;
203
201
  providerBinding: z.ZodEnum<{
204
- cloudflare_binding: "cloudflare_binding";
205
202
  native_harness: "native_harness";
206
203
  pi_durable_models: "pi_durable_models";
207
204
  pi_model_runtime: "pi_model_runtime";
208
205
  }>;
209
206
  }, z.core.$strict>;
207
+ limit: z.ZodOptional<z.ZodNumber>;
208
+ cursor: z.ZodOptional<typeof CursorSchema>;
210
209
  }, z.core.$strict>;
211
210
  }, z.core.$strict>;
212
211
  export declare const ModelDefaultsGetRequestSchema: z.ZodObject<{
@@ -295,13 +294,11 @@ export declare const ModelSelectionResolveRequestSchema: z.ZodObject<{
295
294
  }>;
296
295
  harness: z.ZodEnum<{
297
296
  acp: "acp";
298
- cloudflare_agents: "cloudflare_agents";
299
297
  pi: "pi";
300
298
  pi_durable: "pi_durable";
301
299
  }>;
302
300
  harnessVersion: z.ZodString;
303
301
  providerBinding: z.ZodEnum<{
304
- cloudflare_binding: "cloudflare_binding";
305
302
  native_harness: "native_harness";
306
303
  pi_durable_models: "pi_durable_models";
307
304
  pi_model_runtime: "pi_model_runtime";
@@ -386,6 +383,9 @@ export declare const ModelConnectionListResponseSchema: z.ZodObject<{
386
383
  }, z.core.$strict>;
387
384
  }, z.core.$strict>>;
388
385
  }, z.core.$strict>>;
386
+ connectionsPage: z.ZodObject<{
387
+ nextCursor: z.ZodOptional<z.ZodString>;
388
+ }, z.core.$strict>;
389
389
  }, z.core.$strict>;
390
390
  }, z.core.$strict>;
391
391
  export declare const ModelDefaultsResponseSchema: z.ZodObject<{
@@ -438,13 +438,11 @@ export declare const ModelSelectionResponseSchema: z.ZodObject<{
438
438
  }>;
439
439
  harness: z.ZodEnum<{
440
440
  acp: "acp";
441
- cloudflare_agents: "cloudflare_agents";
442
441
  pi: "pi";
443
442
  pi_durable: "pi_durable";
444
443
  }>;
445
444
  harnessVersion: z.ZodString;
446
445
  providerBinding: z.ZodEnum<{
447
- cloudflare_binding: "cloudflare_binding";
448
446
  native_harness: "native_harness";
449
447
  pi_durable_models: "pi_durable_models";
450
448
  pi_model_runtime: "pi_model_runtime";
@@ -2,6 +2,7 @@ import { z } from 'zod';
2
2
  import { ReadRequestEnvelopeSchema, StateChangingCommandEnvelopeSchema, SuccessResponseEnvelopeSchema, } from './envelopes.js';
3
3
  import { ServiceCallerAssertionSchema } from './authentication.js';
4
4
  import { IdentifierSchemas } from './identifiers.js';
5
+ import { CursorSchema } from './pagination.js';
5
6
  const Ref = z
6
7
  .string()
7
8
  .min(1)
@@ -14,14 +15,9 @@ export const ModelSelectionRefSchema = z.string().regex(/^msel_[a-f0-9]{32}$/);
14
15
  const Auth = z.enum(['api_key', 'provider_subscription', 'local_runtime']);
15
16
  export const ModelExecutionTargetSchema = z.strictObject({
16
17
  location: z.enum(['local_device', 'remote_host', 'agent_hq_cloud']),
17
- harness: z.enum(['pi', 'pi_durable', 'cloudflare_agents', 'acp']),
18
+ harness: z.enum(['pi', 'pi_durable', 'acp']),
18
19
  harnessVersion: z.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/),
19
- providerBinding: z.enum([
20
- 'pi_model_runtime',
21
- 'pi_durable_models',
22
- 'cloudflare_binding',
23
- 'native_harness',
24
- ]),
20
+ providerBinding: z.enum(['pi_model_runtime', 'pi_durable_models', 'native_harness']),
25
21
  });
26
22
  const ConnectionIdentity = {
27
23
  credentialRef: IdentifierSchemas.credentialId,
@@ -45,7 +41,6 @@ function bindingMatches(value) {
45
41
  {
46
42
  pi: 'pi_model_runtime',
47
43
  pi_durable: 'pi_durable_models',
48
- cloudflare_agents: 'cloudflare_binding',
49
44
  acp: 'native_harness',
50
45
  }[value.harness]);
51
46
  }
@@ -136,9 +131,17 @@ const Read = ReadRequestEnvelopeSchema.omit({ projectId: true }).extend({
136
131
  const Command = StateChangingCommandEnvelopeSchema.omit({ projectId: true }).extend({
137
132
  caller: ServiceCallerAssertionSchema,
138
133
  });
134
+ /** The most connections one `model-connections.list` page carries; the default page size. */
135
+ export const MODEL_CONNECTIONS_PAGE_MAX = 32;
139
136
  export const ModelConnectionListRequestSchema = Read.extend({
140
137
  operation: z.literal('model-connections.list'),
141
- parameters: z.strictObject({ target: ModelExecutionTargetSchema }),
138
+ parameters: z.strictObject({
139
+ target: ModelExecutionTargetSchema,
140
+ // Additive paging of `connections`, in connection-ref order: at most `limit` (default and
141
+ // maximum MODEL_CONNECTIONS_PAGE_MAX) per response, continued with `connectionsPage.nextCursor`.
142
+ limit: z.number().int().min(1).max(MODEL_CONNECTIONS_PAGE_MAX).optional(),
143
+ cursor: CursorSchema.optional(),
144
+ }),
142
145
  }).strict();
143
146
  export const ModelDefaultsGetRequestSchema = Read.extend({
144
147
  operation: z.literal('model-defaults.get'),
@@ -176,7 +179,8 @@ export const ModelConnectionListResponseSchema = SuccessResponseEnvelopeSchema.e
176
179
  }))
177
180
  .max(256),
178
181
  }))
179
- .max(128),
182
+ .max(MODEL_CONNECTIONS_PAGE_MAX),
183
+ connectionsPage: z.strictObject({ nextCursor: CursorSchema.optional() }),
180
184
  }),
181
185
  }).strict();
182
186
  export const ModelDefaultsResponseSchema = SuccessResponseEnvelopeSchema.extend({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/contracts",
3
- "version": "2.2.0",
3
+ "version": "3.0.1",
4
4
  "description": "Runtime-independent service boundary between Adea and the Control Plane: canonical identifiers, envelopes, Control API schemas, pagination, and versioning.",
5
5
  "keywords": [
6
6
  "agents",
@@ -32,11 +32,14 @@
32
32
  "./canonical-json": {
33
33
  "types": "./dist/canonical-json.d.ts",
34
34
  "default": "./dist/canonical-json.js"
35
+ },
36
+ "./device-sync": {
37
+ "types": "./dist/device-sync.d.ts",
38
+ "default": "./dist/device-sync.js"
35
39
  }
36
40
  },
37
41
  "publishConfig": {
38
- "access": "public",
39
- "provenance": true
42
+ "access": "public"
40
43
  },
41
44
  "scripts": {
42
45
  "build": "tsc -p tsconfig.json",