@adea-ai/contracts 1.14.0 → 1.15.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/index.d.ts CHANGED
@@ -13,4 +13,5 @@ export * from './runtime-discovery.js';
13
13
  export * from './versioning.js';
14
14
  export * from './workspace-catalog.js';
15
15
  export declare const packageName = "contracts";
16
+ export * from './model-connections.js';
16
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AAEtC,eAAO,MAAM,WAAW,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AAEtC,eAAO,MAAM,WAAW,cAAc,CAAA;AAEtC,cAAc,wBAAwB,CAAA"}
package/dist/index.js CHANGED
@@ -13,4 +13,5 @@ export * from './runtime-discovery.js';
13
13
  export * from './versioning.js';
14
14
  export * from './workspace-catalog.js';
15
15
  export const packageName = 'contracts';
16
+ export * from './model-connections.js';
16
17
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AAEtC,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AAEtC,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAA;AAEtC,cAAc,wBAAwB,CAAA"}
@@ -0,0 +1,572 @@
1
+ import { z } from 'zod';
2
+ export declare const ModelFundingSourceSchema: z.ZodEnum<{
3
+ byo_api: "byo_api";
4
+ external_subscription: "external_subscription";
5
+ hq_managed: "hq_managed";
6
+ }>;
7
+ export declare const ModelConnectionRefSchema: z.ZodString;
8
+ export declare const ModelSelectionRefSchema: z.ZodString;
9
+ export declare const ModelExecutionTargetSchema: z.ZodObject<{
10
+ location: z.ZodEnum<{
11
+ agent_hq_cloud: "agent_hq_cloud";
12
+ local_device: "local_device";
13
+ remote_host: "remote_host";
14
+ }>;
15
+ harness: z.ZodEnum<{
16
+ acp: "acp";
17
+ cloudflare_agents: "cloudflare_agents";
18
+ pi: "pi";
19
+ pi_durable: "pi_durable";
20
+ }>;
21
+ harnessVersion: z.ZodString;
22
+ providerBinding: z.ZodEnum<{
23
+ cloudflare_binding: "cloudflare_binding";
24
+ native_harness: "native_harness";
25
+ pi_durable_models: "pi_durable_models";
26
+ pi_model_runtime: "pi_model_runtime";
27
+ }>;
28
+ }, z.core.$strict>;
29
+ export declare const ModelConnectionSchema: z.ZodObject<{
30
+ credentialRef: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"credential ID">, string>>;
31
+ credentialRevision: z.ZodNumber;
32
+ provider: z.ZodString;
33
+ accountRef: z.ZodString;
34
+ authKind: z.ZodEnum<{
35
+ api_key: "api_key";
36
+ local_runtime: "local_runtime";
37
+ provider_subscription: "provider_subscription";
38
+ }>;
39
+ fundingSource: z.ZodEnum<{
40
+ byo_api: "byo_api";
41
+ external_subscription: "external_subscription";
42
+ hq_managed: "hq_managed";
43
+ }>;
44
+ connectionRef: z.ZodString;
45
+ revision: z.ZodNumber;
46
+ workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
47
+ ownerRef: z.ZodString;
48
+ status: z.ZodEnum<{
49
+ active: "active";
50
+ revoked: "revoked";
51
+ }>;
52
+ models: z.ZodArray<z.ZodString>;
53
+ workspaceGrant: z.ZodObject<{
54
+ grantRef: z.ZodString;
55
+ revision: z.ZodNumber;
56
+ status: z.ZodEnum<{
57
+ active: "active";
58
+ revoked: "revoked";
59
+ }>;
60
+ expiresAt: z.ZodISODateTime;
61
+ }, z.core.$strict>;
62
+ }, z.core.$strict>;
63
+ /** Immutable, non-secret admission evidence. Never persist lease capabilities or provider objects. */
64
+ export declare const RuntimeProviderSelectionSchema: z.ZodObject<{
65
+ location: z.ZodEnum<{
66
+ agent_hq_cloud: "agent_hq_cloud";
67
+ local_device: "local_device";
68
+ remote_host: "remote_host";
69
+ }>;
70
+ harness: z.ZodEnum<{
71
+ acp: "acp";
72
+ cloudflare_agents: "cloudflare_agents";
73
+ pi: "pi";
74
+ pi_durable: "pi_durable";
75
+ }>;
76
+ harnessVersion: z.ZodString;
77
+ providerBinding: z.ZodEnum<{
78
+ cloudflare_binding: "cloudflare_binding";
79
+ native_harness: "native_harness";
80
+ pi_durable_models: "pi_durable_models";
81
+ pi_model_runtime: "pi_model_runtime";
82
+ }>;
83
+ credentialRef: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"credential ID">, string>>;
84
+ credentialRevision: z.ZodNumber;
85
+ provider: z.ZodString;
86
+ accountRef: z.ZodString;
87
+ authKind: z.ZodEnum<{
88
+ api_key: "api_key";
89
+ local_runtime: "local_runtime";
90
+ provider_subscription: "provider_subscription";
91
+ }>;
92
+ fundingSource: z.ZodEnum<{
93
+ byo_api: "byo_api";
94
+ external_subscription: "external_subscription";
95
+ hq_managed: "hq_managed";
96
+ }>;
97
+ schemaVersion: z.ZodLiteral<"model-selection/v1">;
98
+ selectionRef: z.ZodString;
99
+ selectionRevision: z.ZodNumber;
100
+ workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
101
+ connectionRef: z.ZodString;
102
+ connectionRevision: z.ZodNumber;
103
+ providerModel: z.ZodString;
104
+ workspaceGrant: z.ZodObject<{
105
+ grantRef: z.ZodString;
106
+ revision: z.ZodNumber;
107
+ }, z.core.$strict>;
108
+ configurationRevision: z.ZodNumber;
109
+ }, z.core.$strict>;
110
+ export declare const ModelChoiceSchema: z.ZodObject<{
111
+ connectionRef: z.ZodString;
112
+ providerModel: z.ZodString;
113
+ }, z.core.$strict>;
114
+ export declare const WorkspaceModelDefaultsSchema: z.ZodObject<{
115
+ workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
116
+ revision: z.ZodNumber;
117
+ lead: z.ZodOptional<z.ZodObject<{
118
+ connectionRef: z.ZodString;
119
+ providerModel: z.ZodString;
120
+ }, z.core.$strict>>;
121
+ child: z.ZodOptional<z.ZodObject<{
122
+ connectionRef: z.ZodString;
123
+ providerModel: z.ZodString;
124
+ }, z.core.$strict>>;
125
+ direct: z.ZodOptional<z.ZodObject<{
126
+ connectionRef: z.ZodString;
127
+ providerModel: z.ZodString;
128
+ }, z.core.$strict>>;
129
+ }, z.core.$strict>;
130
+ export declare const ModelReadinessReasonSchema: z.ZodEnum<{
131
+ AUTH_MODE_UNSUPPORTED: "AUTH_MODE_UNSUPPORTED";
132
+ CONNECTION_MISSING: "CONNECTION_MISSING";
133
+ CONNECTION_REVOKED: "CONNECTION_REVOKED";
134
+ CREDENTIAL_EXPIRED: "CREDENTIAL_EXPIRED";
135
+ CREDENTIAL_MISSING: "CREDENTIAL_MISSING";
136
+ CREDENTIAL_REVISION_CHANGED: "CREDENTIAL_REVISION_CHANGED";
137
+ CREDENTIAL_REVOKED: "CREDENTIAL_REVOKED";
138
+ INCOMPATIBLE_HARNESS: "INCOMPATIBLE_HARNESS";
139
+ INCOMPATIBLE_LOCATION: "INCOMPATIBLE_LOCATION";
140
+ MODEL_UNAVAILABLE: "MODEL_UNAVAILABLE";
141
+ PROVIDER_POLICY_DENIED: "PROVIDER_POLICY_DENIED";
142
+ QUOTA_EXHAUSTED: "QUOTA_EXHAUSTED";
143
+ READINESS_UNAVAILABLE: "READINESS_UNAVAILABLE";
144
+ READY: "READY";
145
+ SELECTION_CHANGED: "SELECTION_CHANGED";
146
+ WORKSPACE_GRANT_EXPIRED: "WORKSPACE_GRANT_EXPIRED";
147
+ WORKSPACE_GRANT_REVOKED: "WORKSPACE_GRANT_REVOKED";
148
+ }>;
149
+ export type ModelConnection = z.output<typeof ModelConnectionSchema>;
150
+ export type RuntimeProviderSelection = z.output<typeof RuntimeProviderSelectionSchema>;
151
+ export type ModelExecutionTarget = z.output<typeof ModelExecutionTargetSchema>;
152
+ export type ModelChoice = z.output<typeof ModelChoiceSchema>;
153
+ export type WorkspaceModelDefaults = z.output<typeof WorkspaceModelDefaultsSchema>;
154
+ export type ModelReadinessReason = z.output<typeof ModelReadinessReasonSchema>;
155
+ export declare const ModelConnectionListRequestSchema: z.ZodObject<{
156
+ contractVersion: z.ZodObject<{
157
+ major: z.ZodNumber;
158
+ minor: z.ZodNumber;
159
+ }, z.core.$strict>;
160
+ requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"request ID">, string>>;
161
+ workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
162
+ correlation: z.ZodObject<{
163
+ traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"trace ID">, string>>;
164
+ causationCommandId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"command ID">, string>>>;
165
+ parentEventId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"event ID">, string>>>;
166
+ }, z.core.$strip>;
167
+ requestedAt: z.ZodISODateTime;
168
+ caller: z.ZodObject<{
169
+ servicePrincipalId: z.ZodString;
170
+ }, z.core.$strip>;
171
+ operation: z.ZodLiteral<"model-connections.list">;
172
+ parameters: z.ZodObject<{
173
+ target: z.ZodObject<{
174
+ location: z.ZodEnum<{
175
+ agent_hq_cloud: "agent_hq_cloud";
176
+ local_device: "local_device";
177
+ remote_host: "remote_host";
178
+ }>;
179
+ harness: z.ZodEnum<{
180
+ acp: "acp";
181
+ cloudflare_agents: "cloudflare_agents";
182
+ pi: "pi";
183
+ pi_durable: "pi_durable";
184
+ }>;
185
+ harnessVersion: z.ZodString;
186
+ providerBinding: z.ZodEnum<{
187
+ cloudflare_binding: "cloudflare_binding";
188
+ native_harness: "native_harness";
189
+ pi_durable_models: "pi_durable_models";
190
+ pi_model_runtime: "pi_model_runtime";
191
+ }>;
192
+ }, z.core.$strict>;
193
+ }, z.core.$strict>;
194
+ }, z.core.$strict>;
195
+ export declare const ModelDefaultsGetRequestSchema: z.ZodObject<{
196
+ contractVersion: z.ZodObject<{
197
+ major: z.ZodNumber;
198
+ minor: z.ZodNumber;
199
+ }, z.core.$strict>;
200
+ requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"request ID">, string>>;
201
+ workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
202
+ correlation: z.ZodObject<{
203
+ traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"trace ID">, string>>;
204
+ causationCommandId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"command ID">, string>>>;
205
+ parentEventId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"event ID">, string>>>;
206
+ }, z.core.$strip>;
207
+ requestedAt: z.ZodISODateTime;
208
+ caller: z.ZodObject<{
209
+ servicePrincipalId: z.ZodString;
210
+ }, z.core.$strip>;
211
+ operation: z.ZodLiteral<"model-defaults.get">;
212
+ parameters: z.ZodObject<{}, z.core.$strict>;
213
+ }, z.core.$strict>;
214
+ export declare const ModelDefaultsSetRequestSchema: z.ZodObject<{
215
+ contractVersion: z.ZodObject<{
216
+ major: z.ZodNumber;
217
+ minor: z.ZodNumber;
218
+ }, z.core.$strict>;
219
+ requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"request ID">, string>>;
220
+ workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
221
+ correlation: z.ZodObject<{
222
+ traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"trace ID">, string>>;
223
+ causationCommandId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"command ID">, string>>>;
224
+ parentEventId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"event ID">, string>>>;
225
+ }, z.core.$strip>;
226
+ commandId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"command ID">, string>>;
227
+ idempotencyKey: z.ZodString;
228
+ payloadHash: z.ZodString;
229
+ issuedAt: z.ZodISODateTime;
230
+ caller: z.ZodObject<{
231
+ servicePrincipalId: z.ZodString;
232
+ }, z.core.$strip>;
233
+ operation: z.ZodLiteral<"model-defaults.set">;
234
+ payload: z.ZodObject<{
235
+ expectedRevision: z.ZodNumber;
236
+ lead: z.ZodOptional<z.ZodObject<{
237
+ connectionRef: z.ZodString;
238
+ providerModel: z.ZodString;
239
+ }, z.core.$strict>>;
240
+ child: z.ZodOptional<z.ZodObject<{
241
+ connectionRef: z.ZodString;
242
+ providerModel: z.ZodString;
243
+ }, z.core.$strict>>;
244
+ direct: z.ZodOptional<z.ZodObject<{
245
+ connectionRef: z.ZodString;
246
+ providerModel: z.ZodString;
247
+ }, z.core.$strict>>;
248
+ }, z.core.$strict>;
249
+ }, z.core.$strict>;
250
+ export declare const ModelSelectionResolveRequestSchema: z.ZodObject<{
251
+ contractVersion: z.ZodObject<{
252
+ major: z.ZodNumber;
253
+ minor: z.ZodNumber;
254
+ }, z.core.$strict>;
255
+ requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"request ID">, string>>;
256
+ workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
257
+ correlation: z.ZodObject<{
258
+ traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"trace ID">, string>>;
259
+ causationCommandId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"command ID">, string>>>;
260
+ parentEventId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"event ID">, string>>>;
261
+ }, z.core.$strip>;
262
+ requestedAt: z.ZodISODateTime;
263
+ caller: z.ZodObject<{
264
+ servicePrincipalId: z.ZodString;
265
+ }, z.core.$strip>;
266
+ operation: z.ZodLiteral<"model-selection.resolve">;
267
+ parameters: z.ZodObject<{
268
+ role: z.ZodEnum<{
269
+ child: "child";
270
+ direct: "direct";
271
+ lead: "lead";
272
+ }>;
273
+ target: z.ZodObject<{
274
+ location: z.ZodEnum<{
275
+ agent_hq_cloud: "agent_hq_cloud";
276
+ local_device: "local_device";
277
+ remote_host: "remote_host";
278
+ }>;
279
+ harness: z.ZodEnum<{
280
+ acp: "acp";
281
+ cloudflare_agents: "cloudflare_agents";
282
+ pi: "pi";
283
+ pi_durable: "pi_durable";
284
+ }>;
285
+ harnessVersion: z.ZodString;
286
+ providerBinding: z.ZodEnum<{
287
+ cloudflare_binding: "cloudflare_binding";
288
+ native_harness: "native_harness";
289
+ pi_durable_models: "pi_durable_models";
290
+ pi_model_runtime: "pi_model_runtime";
291
+ }>;
292
+ }, z.core.$strict>;
293
+ override: z.ZodOptional<z.ZodObject<{
294
+ connectionRef: z.ZodString;
295
+ providerModel: z.ZodString;
296
+ }, z.core.$strict>>;
297
+ }, z.core.$strict>;
298
+ }, z.core.$strict>;
299
+ export declare const ModelConnectionListResponseSchema: z.ZodObject<{
300
+ contractVersion: z.ZodObject<{
301
+ major: z.ZodNumber;
302
+ minor: z.ZodNumber;
303
+ }, z.core.$strict>;
304
+ requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"request ID">, string>>;
305
+ correlation: z.ZodObject<{
306
+ traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"trace ID">, string>>;
307
+ causationCommandId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"command ID">, string>>>;
308
+ parentEventId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"event ID">, string>>>;
309
+ }, z.core.$strip>;
310
+ data: z.ZodObject<{
311
+ connections: z.ZodArray<z.ZodObject<{
312
+ connection: z.ZodObject<{
313
+ credentialRef: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"credential ID">, string>>;
314
+ credentialRevision: z.ZodNumber;
315
+ provider: z.ZodString;
316
+ accountRef: z.ZodString;
317
+ authKind: z.ZodEnum<{
318
+ api_key: "api_key";
319
+ local_runtime: "local_runtime";
320
+ provider_subscription: "provider_subscription";
321
+ }>;
322
+ fundingSource: z.ZodEnum<{
323
+ byo_api: "byo_api";
324
+ external_subscription: "external_subscription";
325
+ hq_managed: "hq_managed";
326
+ }>;
327
+ connectionRef: z.ZodString;
328
+ revision: z.ZodNumber;
329
+ workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
330
+ ownerRef: z.ZodString;
331
+ status: z.ZodEnum<{
332
+ active: "active";
333
+ revoked: "revoked";
334
+ }>;
335
+ models: z.ZodArray<z.ZodString>;
336
+ workspaceGrant: z.ZodObject<{
337
+ grantRef: z.ZodString;
338
+ revision: z.ZodNumber;
339
+ status: z.ZodEnum<{
340
+ active: "active";
341
+ revoked: "revoked";
342
+ }>;
343
+ expiresAt: z.ZodISODateTime;
344
+ }, z.core.$strict>;
345
+ }, z.core.$strict>;
346
+ models: z.ZodArray<z.ZodObject<{
347
+ providerModel: z.ZodString;
348
+ readiness: z.ZodObject<{
349
+ ready: z.ZodBoolean;
350
+ reasonCode: z.ZodEnum<{
351
+ AUTH_MODE_UNSUPPORTED: "AUTH_MODE_UNSUPPORTED";
352
+ CONNECTION_MISSING: "CONNECTION_MISSING";
353
+ CONNECTION_REVOKED: "CONNECTION_REVOKED";
354
+ CREDENTIAL_EXPIRED: "CREDENTIAL_EXPIRED";
355
+ CREDENTIAL_MISSING: "CREDENTIAL_MISSING";
356
+ CREDENTIAL_REVISION_CHANGED: "CREDENTIAL_REVISION_CHANGED";
357
+ CREDENTIAL_REVOKED: "CREDENTIAL_REVOKED";
358
+ INCOMPATIBLE_HARNESS: "INCOMPATIBLE_HARNESS";
359
+ INCOMPATIBLE_LOCATION: "INCOMPATIBLE_LOCATION";
360
+ MODEL_UNAVAILABLE: "MODEL_UNAVAILABLE";
361
+ PROVIDER_POLICY_DENIED: "PROVIDER_POLICY_DENIED";
362
+ QUOTA_EXHAUSTED: "QUOTA_EXHAUSTED";
363
+ READINESS_UNAVAILABLE: "READINESS_UNAVAILABLE";
364
+ READY: "READY";
365
+ SELECTION_CHANGED: "SELECTION_CHANGED";
366
+ WORKSPACE_GRANT_EXPIRED: "WORKSPACE_GRANT_EXPIRED";
367
+ WORKSPACE_GRANT_REVOKED: "WORKSPACE_GRANT_REVOKED";
368
+ }>;
369
+ }, z.core.$strict>;
370
+ }, z.core.$strict>>;
371
+ }, z.core.$strict>>;
372
+ }, z.core.$strict>;
373
+ }, z.core.$strict>;
374
+ export declare const ModelDefaultsResponseSchema: z.ZodObject<{
375
+ contractVersion: z.ZodObject<{
376
+ major: z.ZodNumber;
377
+ minor: z.ZodNumber;
378
+ }, z.core.$strict>;
379
+ requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"request ID">, string>>;
380
+ correlation: z.ZodObject<{
381
+ traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"trace ID">, string>>;
382
+ causationCommandId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"command ID">, string>>>;
383
+ parentEventId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"event ID">, string>>>;
384
+ }, z.core.$strip>;
385
+ data: z.ZodObject<{
386
+ defaults: z.ZodNullable<z.ZodObject<{
387
+ workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
388
+ revision: z.ZodNumber;
389
+ lead: z.ZodOptional<z.ZodObject<{
390
+ connectionRef: z.ZodString;
391
+ providerModel: z.ZodString;
392
+ }, z.core.$strict>>;
393
+ child: z.ZodOptional<z.ZodObject<{
394
+ connectionRef: z.ZodString;
395
+ providerModel: z.ZodString;
396
+ }, z.core.$strict>>;
397
+ direct: z.ZodOptional<z.ZodObject<{
398
+ connectionRef: z.ZodString;
399
+ providerModel: z.ZodString;
400
+ }, z.core.$strict>>;
401
+ }, z.core.$strict>>;
402
+ }, z.core.$strict>;
403
+ }, z.core.$strict>;
404
+ export declare const ModelSelectionResponseSchema: z.ZodObject<{
405
+ contractVersion: z.ZodObject<{
406
+ major: z.ZodNumber;
407
+ minor: z.ZodNumber;
408
+ }, z.core.$strict>;
409
+ requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"request ID">, string>>;
410
+ correlation: z.ZodObject<{
411
+ traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"trace ID">, string>>;
412
+ causationCommandId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"command ID">, string>>>;
413
+ parentEventId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"event ID">, string>>>;
414
+ }, z.core.$strip>;
415
+ data: z.ZodObject<{
416
+ selection: z.ZodObject<{
417
+ location: z.ZodEnum<{
418
+ agent_hq_cloud: "agent_hq_cloud";
419
+ local_device: "local_device";
420
+ remote_host: "remote_host";
421
+ }>;
422
+ harness: z.ZodEnum<{
423
+ acp: "acp";
424
+ cloudflare_agents: "cloudflare_agents";
425
+ pi: "pi";
426
+ pi_durable: "pi_durable";
427
+ }>;
428
+ harnessVersion: z.ZodString;
429
+ providerBinding: z.ZodEnum<{
430
+ cloudflare_binding: "cloudflare_binding";
431
+ native_harness: "native_harness";
432
+ pi_durable_models: "pi_durable_models";
433
+ pi_model_runtime: "pi_model_runtime";
434
+ }>;
435
+ credentialRef: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"credential ID">, string>>;
436
+ credentialRevision: z.ZodNumber;
437
+ provider: z.ZodString;
438
+ accountRef: z.ZodString;
439
+ authKind: z.ZodEnum<{
440
+ api_key: "api_key";
441
+ local_runtime: "local_runtime";
442
+ provider_subscription: "provider_subscription";
443
+ }>;
444
+ fundingSource: z.ZodEnum<{
445
+ byo_api: "byo_api";
446
+ external_subscription: "external_subscription";
447
+ hq_managed: "hq_managed";
448
+ }>;
449
+ schemaVersion: z.ZodLiteral<"model-selection/v1">;
450
+ selectionRef: z.ZodString;
451
+ selectionRevision: z.ZodNumber;
452
+ workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
453
+ connectionRef: z.ZodString;
454
+ connectionRevision: z.ZodNumber;
455
+ providerModel: z.ZodString;
456
+ workspaceGrant: z.ZodObject<{
457
+ grantRef: z.ZodString;
458
+ revision: z.ZodNumber;
459
+ }, z.core.$strict>;
460
+ configurationRevision: z.ZodNumber;
461
+ }, z.core.$strict>;
462
+ }, z.core.$strict>;
463
+ }, z.core.$strict>;
464
+ export declare const ModelConnectionCreateRequestSchema: z.ZodObject<{
465
+ contractVersion: z.ZodObject<{
466
+ major: z.ZodNumber;
467
+ minor: z.ZodNumber;
468
+ }, z.core.$strict>;
469
+ requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"request ID">, string>>;
470
+ workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
471
+ correlation: z.ZodObject<{
472
+ traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"trace ID">, string>>;
473
+ causationCommandId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"command ID">, string>>>;
474
+ parentEventId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"event ID">, string>>>;
475
+ }, z.core.$strip>;
476
+ commandId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"command ID">, string>>;
477
+ idempotencyKey: z.ZodString;
478
+ payloadHash: z.ZodString;
479
+ issuedAt: z.ZodISODateTime;
480
+ caller: z.ZodObject<{
481
+ servicePrincipalId: z.ZodString;
482
+ }, z.core.$strip>;
483
+ operation: z.ZodLiteral<"model-connections.create">;
484
+ payload: z.ZodObject<{
485
+ credentialRef: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"credential ID">, string>>;
486
+ credentialRevision: z.ZodNumber;
487
+ }, z.core.$strict>;
488
+ }, z.core.$strict>;
489
+ export declare const ModelConnectionRevokeRequestSchema: z.ZodObject<{
490
+ contractVersion: z.ZodObject<{
491
+ major: z.ZodNumber;
492
+ minor: z.ZodNumber;
493
+ }, z.core.$strict>;
494
+ requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"request ID">, string>>;
495
+ workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
496
+ correlation: z.ZodObject<{
497
+ traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"trace ID">, string>>;
498
+ causationCommandId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"command ID">, string>>>;
499
+ parentEventId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"event ID">, string>>>;
500
+ }, z.core.$strip>;
501
+ commandId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"command ID">, string>>;
502
+ idempotencyKey: z.ZodString;
503
+ payloadHash: z.ZodString;
504
+ issuedAt: z.ZodISODateTime;
505
+ caller: z.ZodObject<{
506
+ servicePrincipalId: z.ZodString;
507
+ }, z.core.$strip>;
508
+ operation: z.ZodLiteral<"model-connections.revoke">;
509
+ payload: z.ZodObject<{
510
+ connectionRef: z.ZodString;
511
+ expectedRevision: z.ZodNumber;
512
+ }, z.core.$strict>;
513
+ }, z.core.$strict>;
514
+ export declare const ModelConnectionResponseSchema: z.ZodObject<{
515
+ contractVersion: z.ZodObject<{
516
+ major: z.ZodNumber;
517
+ minor: z.ZodNumber;
518
+ }, z.core.$strict>;
519
+ requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"request ID">, string>>;
520
+ correlation: z.ZodObject<{
521
+ traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"trace ID">, string>>;
522
+ causationCommandId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"command ID">, string>>>;
523
+ parentEventId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"event ID">, string>>>;
524
+ }, z.core.$strip>;
525
+ data: z.ZodObject<{
526
+ connection: z.ZodObject<{
527
+ credentialRef: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"credential ID">, string>>;
528
+ credentialRevision: z.ZodNumber;
529
+ provider: z.ZodString;
530
+ accountRef: z.ZodString;
531
+ authKind: z.ZodEnum<{
532
+ api_key: "api_key";
533
+ local_runtime: "local_runtime";
534
+ provider_subscription: "provider_subscription";
535
+ }>;
536
+ fundingSource: z.ZodEnum<{
537
+ byo_api: "byo_api";
538
+ external_subscription: "external_subscription";
539
+ hq_managed: "hq_managed";
540
+ }>;
541
+ connectionRef: z.ZodString;
542
+ revision: z.ZodNumber;
543
+ workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
544
+ ownerRef: z.ZodString;
545
+ status: z.ZodEnum<{
546
+ active: "active";
547
+ revoked: "revoked";
548
+ }>;
549
+ models: z.ZodArray<z.ZodString>;
550
+ workspaceGrant: z.ZodObject<{
551
+ grantRef: z.ZodString;
552
+ revision: z.ZodNumber;
553
+ status: z.ZodEnum<{
554
+ active: "active";
555
+ revoked: "revoked";
556
+ }>;
557
+ expiresAt: z.ZodISODateTime;
558
+ }, z.core.$strict>;
559
+ }, z.core.$strict>;
560
+ }, z.core.$strict>;
561
+ }, z.core.$strict>;
562
+ export type ModelConnectionListRequest = z.output<typeof ModelConnectionListRequestSchema>;
563
+ export type ModelConnectionListResponse = z.output<typeof ModelConnectionListResponseSchema>;
564
+ export type ModelDefaultsGetRequest = z.output<typeof ModelDefaultsGetRequestSchema>;
565
+ export type ModelDefaultsSetRequest = z.output<typeof ModelDefaultsSetRequestSchema>;
566
+ export type ModelSelectionResolveRequest = z.output<typeof ModelSelectionResolveRequestSchema>;
567
+ export type ModelDefaultsResponse = z.output<typeof ModelDefaultsResponseSchema>;
568
+ export type ModelSelectionResponse = z.output<typeof ModelSelectionResponseSchema>;
569
+ export type ModelConnectionCreateRequest = z.output<typeof ModelConnectionCreateRequestSchema>;
570
+ export type ModelConnectionRevokeRequest = z.output<typeof ModelConnectionRevokeRequestSchema>;
571
+ export type ModelConnectionResponse = z.output<typeof ModelConnectionResponseSchema>;
572
+ //# sourceMappingURL=model-connections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-connections.d.ts","sourceRoot":"","sources":["../src/model-connections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAevB,eAAO,MAAM,wBAAwB;;;;EAA6D,CAAA;AAClG,eAAO,MAAM,wBAAwB,aAA2C,CAAA;AAChF,eAAO,MAAM,uBAAuB,aAA0C,CAAA;AAE9E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;kBAUrC,CAAA;AA6BF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAoBwD,CAAA;AAE1F,sGAAsG;AACtG,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAe8C,CAAA;AAEzF,eAAO,MAAM,iBAAiB;;;kBAG5B,CAAA;AACF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;kBAMvC,CAAA;AACF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;EAkBrC,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAA;AACpE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,8BAA8B,CAAC,CAAA;AACtF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,O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F,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iCAAiC,CAAC,CAAA;AAE5F,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAEpF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAEpF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAE9F,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAEhF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAElF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAE9F,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAE9F,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAA"}
@@ -0,0 +1,192 @@
1
+ import { z } from 'zod';
2
+ import { ReadRequestEnvelopeSchema, StateChangingCommandEnvelopeSchema, SuccessResponseEnvelopeSchema, } from './envelopes.js';
3
+ import { ServiceCallerAssertionSchema } from './authentication.js';
4
+ import { IdentifierSchemas } from './identifiers.js';
5
+ const Ref = z
6
+ .string()
7
+ .min(1)
8
+ .max(256)
9
+ .regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/);
10
+ const Revision = z.number().int().positive().max(Number.MAX_SAFE_INTEGER);
11
+ export const ModelFundingSourceSchema = z.enum(['hq_managed', 'external_subscription', 'byo_api']);
12
+ export const ModelConnectionRefSchema = z.string().regex(/^mconn_[a-f0-9]{32}$/);
13
+ export const ModelSelectionRefSchema = z.string().regex(/^msel_[a-f0-9]{32}$/);
14
+ const Auth = z.enum(['api_key', 'provider_subscription', 'local_runtime']);
15
+ export const ModelExecutionTargetSchema = z.strictObject({
16
+ location: z.enum(['local_device', 'remote_host', 'agent_hq_cloud']),
17
+ harness: z.enum(['pi', 'pi_durable', 'cloudflare_agents', 'acp']),
18
+ 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
+ ]),
25
+ });
26
+ const ConnectionIdentity = {
27
+ credentialRef: IdentifierSchemas.credentialId,
28
+ credentialRevision: Revision,
29
+ provider: z
30
+ .string()
31
+ .min(1)
32
+ .max(128)
33
+ .regex(/^[a-z][a-z0-9.-]*$/),
34
+ accountRef: Ref,
35
+ authKind: Auth,
36
+ fundingSource: ModelFundingSourceSchema,
37
+ };
38
+ function fundingMatches(value) {
39
+ return value.authKind === 'api_key'
40
+ ? value.fundingSource === 'byo_api' || value.fundingSource === 'hq_managed'
41
+ : value.fundingSource === 'external_subscription';
42
+ }
43
+ function bindingMatches(value) {
44
+ return (value.providerBinding ===
45
+ {
46
+ pi: 'pi_model_runtime',
47
+ pi_durable: 'pi_durable_models',
48
+ cloudflare_agents: 'cloudflare_binding',
49
+ acp: 'native_harness',
50
+ }[value.harness]);
51
+ }
52
+ export const ModelConnectionSchema = z
53
+ .strictObject({
54
+ connectionRef: ModelConnectionRefSchema,
55
+ revision: Revision,
56
+ workspaceId: IdentifierSchemas.workspaceId,
57
+ ownerRef: Ref,
58
+ ...ConnectionIdentity,
59
+ status: z.enum(['active', 'revoked']),
60
+ models: z
61
+ .array(Ref)
62
+ .min(1)
63
+ .max(256)
64
+ .refine((values) => new Set(values).size === values.length),
65
+ workspaceGrant: z.strictObject({
66
+ grantRef: Ref,
67
+ revision: Revision,
68
+ status: z.enum(['active', 'revoked']),
69
+ expiresAt: z.iso.datetime(),
70
+ }),
71
+ })
72
+ .refine(fundingMatches, { message: 'Authentication and funding provenance must agree' });
73
+ /** Immutable, non-secret admission evidence. Never persist lease capabilities or provider objects. */
74
+ export const RuntimeProviderSelectionSchema = z
75
+ .strictObject({
76
+ schemaVersion: z.literal('model-selection/v1'),
77
+ selectionRef: ModelSelectionRefSchema,
78
+ selectionRevision: Revision,
79
+ workspaceId: IdentifierSchemas.workspaceId,
80
+ connectionRef: ModelConnectionRefSchema,
81
+ connectionRevision: Revision,
82
+ ...ConnectionIdentity,
83
+ providerModel: Ref,
84
+ ...ModelExecutionTargetSchema.shape,
85
+ workspaceGrant: z.strictObject({ grantRef: Ref, revision: Revision }),
86
+ configurationRevision: Revision,
87
+ })
88
+ .refine(fundingMatches, { message: 'Authentication and funding provenance must agree' })
89
+ .refine(bindingMatches, { message: 'Harness requires its supported provider binding' });
90
+ export const ModelChoiceSchema = z.strictObject({
91
+ connectionRef: ModelConnectionRefSchema,
92
+ providerModel: Ref,
93
+ });
94
+ export const WorkspaceModelDefaultsSchema = z.strictObject({
95
+ workspaceId: IdentifierSchemas.workspaceId,
96
+ revision: Revision,
97
+ lead: ModelChoiceSchema.optional(),
98
+ child: ModelChoiceSchema.optional(),
99
+ direct: ModelChoiceSchema.optional(),
100
+ });
101
+ export const ModelReadinessReasonSchema = z.enum([
102
+ 'READY',
103
+ 'CONNECTION_MISSING',
104
+ 'CONNECTION_REVOKED',
105
+ 'CREDENTIAL_MISSING',
106
+ 'CREDENTIAL_EXPIRED',
107
+ 'CREDENTIAL_REVOKED',
108
+ 'CREDENTIAL_REVISION_CHANGED',
109
+ 'WORKSPACE_GRANT_EXPIRED',
110
+ 'WORKSPACE_GRANT_REVOKED',
111
+ 'SELECTION_CHANGED',
112
+ 'MODEL_UNAVAILABLE',
113
+ 'QUOTA_EXHAUSTED',
114
+ 'INCOMPATIBLE_HARNESS',
115
+ 'INCOMPATIBLE_LOCATION',
116
+ 'AUTH_MODE_UNSUPPORTED',
117
+ 'PROVIDER_POLICY_DENIED',
118
+ 'READINESS_UNAVAILABLE',
119
+ ]);
120
+ const Read = ReadRequestEnvelopeSchema.omit({ projectId: true }).extend({
121
+ caller: ServiceCallerAssertionSchema,
122
+ });
123
+ const Command = StateChangingCommandEnvelopeSchema.omit({ projectId: true }).extend({
124
+ caller: ServiceCallerAssertionSchema,
125
+ });
126
+ export const ModelConnectionListRequestSchema = Read.extend({
127
+ operation: z.literal('model-connections.list'),
128
+ parameters: z.strictObject({ target: ModelExecutionTargetSchema }),
129
+ }).strict();
130
+ export const ModelDefaultsGetRequestSchema = Read.extend({
131
+ operation: z.literal('model-defaults.get'),
132
+ parameters: z.strictObject({}),
133
+ }).strict();
134
+ export const ModelDefaultsSetRequestSchema = Command.extend({
135
+ operation: z.literal('model-defaults.set'),
136
+ payload: z.strictObject({
137
+ expectedRevision: z.number().int().nonnegative(),
138
+ lead: ModelChoiceSchema.optional(),
139
+ child: ModelChoiceSchema.optional(),
140
+ direct: ModelChoiceSchema.optional(),
141
+ }),
142
+ }).strict();
143
+ export const ModelSelectionResolveRequestSchema = Read.extend({
144
+ operation: z.literal('model-selection.resolve'),
145
+ parameters: z.strictObject({
146
+ role: z.enum(['lead', 'child', 'direct']),
147
+ target: ModelExecutionTargetSchema,
148
+ override: ModelChoiceSchema.optional(),
149
+ }),
150
+ }).strict();
151
+ export const ModelConnectionListResponseSchema = SuccessResponseEnvelopeSchema.extend({
152
+ data: z.strictObject({
153
+ connections: z
154
+ .array(z.strictObject({
155
+ connection: ModelConnectionSchema,
156
+ models: z
157
+ .array(z.strictObject({
158
+ providerModel: ModelChoiceSchema.shape.providerModel,
159
+ readiness: z.strictObject({
160
+ ready: z.boolean(),
161
+ reasonCode: ModelReadinessReasonSchema,
162
+ }),
163
+ }))
164
+ .max(256),
165
+ }))
166
+ .max(128),
167
+ }),
168
+ }).strict();
169
+ export const ModelDefaultsResponseSchema = SuccessResponseEnvelopeSchema.extend({
170
+ data: z.strictObject({ defaults: WorkspaceModelDefaultsSchema.nullable() }),
171
+ }).strict();
172
+ export const ModelSelectionResponseSchema = SuccessResponseEnvelopeSchema.extend({
173
+ data: z.strictObject({ selection: RuntimeProviderSelectionSchema }),
174
+ }).strict();
175
+ export const ModelConnectionCreateRequestSchema = Command.extend({
176
+ operation: z.literal('model-connections.create'),
177
+ payload: z.strictObject({
178
+ credentialRef: ModelConnectionSchema.shape.credentialRef,
179
+ credentialRevision: ModelConnectionSchema.shape.credentialRevision,
180
+ }),
181
+ }).strict();
182
+ export const ModelConnectionRevokeRequestSchema = Command.extend({
183
+ operation: z.literal('model-connections.revoke'),
184
+ payload: z.strictObject({
185
+ connectionRef: ModelChoiceSchema.shape.connectionRef,
186
+ expectedRevision: z.number().int().positive(),
187
+ }),
188
+ }).strict();
189
+ export const ModelConnectionResponseSchema = SuccessResponseEnvelopeSchema.extend({
190
+ data: z.strictObject({ connection: ModelConnectionSchema }),
191
+ }).strict();
192
+ //# sourceMappingURL=model-connections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-connections.js","sourceRoot":"","sources":["../src/model-connections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EACL,yBAAyB,EACzB,kCAAkC,EAClC,6BAA6B,GAC9B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD,MAAM,GAAG,GAAG,CAAC;KACV,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,GAAG,CAAC;KACR,KAAK,CAAC,gCAAgC,CAAC,CAAA;AAC1C,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA;AACzE,MAAM,CAAC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EAAE,CAAC;CAC5E,CAAC,CAAC,MAAM,EAAE,CAAA;AACX,MAAM,CAAC,MAAM,4BAA4B,GAAG,6BAA6B,CAAC,MAAM,CAAC;IAC/E,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,8BAA8B,EAAE,CAAC;CACpE,CAAC,CAAC,MAAM,EAAE,CAAA;AAEX,MAAM,CAAC,MAAM,kCAAkC,GAAG,OAAO,CAAC,MAAM,CAAC;IAC/D,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,YAAY,CAAC;QACtB,aAAa,EAAE,qBAAqB,CAAC,KAAK,CAAC,aAAa;QACxD,kBAAkB,EAAE,qBAAqB,CAAC,KAAK,CAAC,kBAAkB;KACnE,CAAC;CACH,CAAC,CAAC,MAAM,EAAE,CAAA;AACX,MAAM,CAAC,MAAM,kCAAkC,GAAG,OAAO,CAAC,MAAM,CAAC;IAC/D,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,YAAY,CAAC;QACtB,aAAa,EAAE,iBAAiB,CAAC,KAAK,CAAC,aAAa;QACpD,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;KAC9C,CAAC;CACH,CAAC,CAAC,MAAM,EAAE,CAAA;AACX,MAAM,CAAC,MAAM,6BAA6B,GAAG,6BAA6B,CAAC,MAAM,CAAC;IAChF,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,UAAU,EAAE,qBAAqB,EAAE,CAAC;CAC5D,CAAC,CAAC,MAAM,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/contracts",
3
- "version": "1.14.0",
3
+ "version": "1.15.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",