@roll-agent/relay-protocol 0.1.0 → 0.2.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.
Files changed (35) hide show
  1. package/README.md +90 -39
  2. package/dist/conformance.d.ts +571 -4
  3. package/dist/conformance.js +677 -8
  4. package/dist/index.d.ts +3977 -303
  5. package/dist/index.js +664 -77
  6. package/dist/reference-adapter.d.ts +56 -0
  7. package/dist/reference-adapter.js +122 -0
  8. package/dist/schema/roll-relay-protocol-v1.1.schema.json +3791 -0
  9. package/fixtures/v1.1/invalid-approval-projection-raw-input-leak.json +19 -0
  10. package/fixtures/v1.1/invalid-authentication-local-only.json +12 -0
  11. package/fixtures/v1.1/invalid-file-picker-local-only.json +12 -0
  12. package/fixtures/v1.1/invalid-interaction-cancelled-reason-leak.json +10 -0
  13. package/fixtures/v1.1/invalid-interaction-resolved-result-leak.json +18 -0
  14. package/fixtures/v1.1/invalid-legacy-approval-candidate.json +7 -0
  15. package/fixtures/v1.1/invalid-legacy-approval-respond.json +7 -0
  16. package/fixtures/v1.1/invalid-n-minus-one-device-connect.json +6 -0
  17. package/fixtures/v1.1/invalid-non-normal-sensitivity.json +21 -0
  18. package/fixtures/v1.1/invalid-runtime-event-tool-input-leak.json +22 -0
  19. package/fixtures/v1.1/invalid-runtime-event-tool-output-leak.json +21 -0
  20. package/fixtures/v1.1/invalid-user-input-projection-secret-leak.json +22 -0
  21. package/fixtures/v1.1/manifest.json +673 -0
  22. package/fixtures/v1.1/valid-device-connect.json +6 -0
  23. package/fixtures/v1.1/valid-interaction-cancelled.json +9 -0
  24. package/fixtures/v1.1/valid-interaction-candidate-user-input.json +25 -0
  25. package/fixtures/v1.1/valid-interaction-request-approval.json +17 -0
  26. package/fixtures/v1.1/valid-interaction-request-user-input.json +40 -0
  27. package/fixtures/v1.1/valid-interaction-resolved.json +9 -0
  28. package/fixtures/v1.1/valid-runtime-ack.json +5 -0
  29. package/fixtures/v1.1/valid-runtime-encrypted-interaction.json +10 -0
  30. package/fixtures/v1.1/valid-runtime-event-runtime-n-minus-one.json +16 -0
  31. package/fixtures/v1.1/valid-runtime-event.json +16 -0
  32. package/fixtures/v1.1/valid-runtime-gap.json +7 -0
  33. package/fixtures/v1.1/valid-runtime-request.json +10 -0
  34. package/fixtures/v1.1/valid-runtime-response.json +8 -0
  35. package/package.json +8 -2
package/dist/index.d.ts CHANGED
@@ -1,10 +1,36 @@
1
- import { type JsonValue } from "@roll-agent/protocol";
1
+ import { operationGetResultSchema, type JsonValue, type ThreadSnapshotV11 } from "@roll-agent/protocol";
2
2
  import { z } from "zod/v4";
3
- export declare const SUPPORTED_RELAY_PROTOCOL_VERSIONS: readonly ["1.0"];
3
+ export declare const SUPPORTED_RELAY_PROTOCOL_VERSIONS: readonly ["1.1", "1.0"];
4
4
  export type RelayProtocolVersion = (typeof SUPPORTED_RELAY_PROTOCOL_VERSIONS)[number];
5
+ export declare const LATEST_RELAY_PROTOCOL_VERSION: "1.1";
6
+ /** @deprecated Legacy generic Relay exports remain pinned to Wire 1.0. */
5
7
  export declare const RELAY_PROTOCOL_VERSION: "1.0";
6
- /** @deprecated Use `RELAY_PROTOCOL_VERSION`. */
8
+ /** @deprecated The one-argument Companion connection API remains pinned to Wire 1.0. */
7
9
  export declare const COMPANION_RELAY_PROTOCOL_VERSION: "1.0";
10
+ export declare const RELAY_MESSAGE_TYPES_V10: {
11
+ readonly deviceConnect: "device.connect";
12
+ readonly runtimeRequest: "runtime.request";
13
+ readonly runtimeResponse: "runtime.response";
14
+ readonly runtimeEvent: "runtime.event";
15
+ readonly runtimeAck: "runtime.ack";
16
+ readonly runtimeGap: "runtime.gap";
17
+ readonly runtimeEncrypted: "runtime.encrypted";
18
+ };
19
+ export declare const RELAY_MESSAGE_TYPES_V11: {
20
+ readonly interactionRequest: "interaction.request";
21
+ readonly interactionResolved: "interaction.resolved";
22
+ readonly interactionCancelled: "interaction.cancelled";
23
+ readonly deviceConnect: "device.connect";
24
+ readonly runtimeRequest: "runtime.request";
25
+ readonly runtimeResponse: "runtime.response";
26
+ readonly runtimeEvent: "runtime.event";
27
+ readonly runtimeAck: "runtime.ack";
28
+ readonly runtimeGap: "runtime.gap";
29
+ readonly runtimeEncrypted: "runtime.encrypted";
30
+ };
31
+ export declare const RELAY_MESSAGE_TYPE_VALUES_V10: readonly ["device.connect", "runtime.request", "runtime.response", "runtime.event", "runtime.ack", "runtime.gap", "runtime.encrypted"];
32
+ export declare const RELAY_MESSAGE_TYPE_VALUES_V11: readonly ["device.connect", "runtime.request", "runtime.response", "runtime.event", "runtime.ack", "runtime.gap", "runtime.encrypted", "interaction.request", "interaction.resolved", "interaction.cancelled"];
33
+ /** @deprecated Legacy generic Relay exports remain pinned to Wire 1.0. */
8
34
  export declare const RELAY_MESSAGE_TYPES: {
9
35
  readonly deviceConnect: "device.connect";
10
36
  readonly runtimeRequest: "runtime.request";
@@ -14,11 +40,44 @@ export declare const RELAY_MESSAGE_TYPES: {
14
40
  readonly runtimeGap: "runtime.gap";
15
41
  readonly runtimeEncrypted: "runtime.encrypted";
16
42
  };
43
+ /** @deprecated Legacy generic Relay exports remain pinned to Wire 1.0. */
17
44
  export declare const RELAY_MESSAGE_TYPE_VALUES: readonly ["device.connect", "runtime.request", "runtime.response", "runtime.event", "runtime.ack", "runtime.gap", "runtime.encrypted"];
18
45
  /**
19
46
  * Relay Wire 1.0 is intentionally independent from the latest Runtime registry.
20
47
  * New Runtime methods never become remotely callable without a Relay version change.
21
48
  */
49
+ export declare const RELAY_REQUEST_METHODS_V10: {
50
+ readonly initialize: "initialize";
51
+ readonly threadList: "thread.list";
52
+ readonly threadCreate: "thread.create";
53
+ readonly threadOpen: "thread.open";
54
+ readonly threadSnapshot: "thread.snapshot";
55
+ readonly threadRename: "thread.rename";
56
+ readonly threadDelete: "thread.delete";
57
+ readonly threadDetach: "thread.detach";
58
+ readonly threadCapabilities: "thread.capabilities";
59
+ readonly turnStart: "turn.start";
60
+ readonly turnCancel: "turn.cancel";
61
+ readonly approvalRespond: "approval.respond";
62
+ readonly operationGet: "operation.get";
63
+ readonly approvalCandidate: "approval.candidate";
64
+ };
65
+ export declare const RELAY_REQUEST_METHODS_V11: {
66
+ readonly initialize: "initialize";
67
+ readonly threadList: "thread.list";
68
+ readonly threadCreate: "thread.create";
69
+ readonly threadOpen: "thread.open";
70
+ readonly threadSnapshot: "thread.snapshot";
71
+ readonly threadRename: "thread.rename";
72
+ readonly threadDelete: "thread.delete";
73
+ readonly threadDetach: "thread.detach";
74
+ readonly threadCapabilities: "thread.capabilities";
75
+ readonly turnStart: "turn.start";
76
+ readonly turnCancel: "turn.cancel";
77
+ readonly operationGet: "operation.get";
78
+ readonly interactionCandidate: "interaction.candidate";
79
+ };
80
+ /** @deprecated Legacy generic Relay exports remain pinned to Wire 1.0. */
22
81
  export declare const RELAY_REQUEST_METHODS: {
23
82
  readonly initialize: "initialize";
24
83
  readonly threadList: "thread.list";
@@ -35,8 +94,43 @@ export declare const RELAY_REQUEST_METHODS: {
35
94
  readonly operationGet: "operation.get";
36
95
  readonly approvalCandidate: "approval.candidate";
37
96
  };
38
- export type RelayRequestMethod = (typeof RELAY_REQUEST_METHODS)[keyof typeof RELAY_REQUEST_METHODS];
97
+ export type RelayRequestMethod = (typeof RELAY_REQUEST_METHODS_V10)[keyof typeof RELAY_REQUEST_METHODS_V10];
98
+ export declare const RELAY_REQUEST_METHOD_VALUES_V10: readonly ["initialize", "thread.list", "thread.create", "thread.open", "thread.snapshot", "thread.rename", "thread.delete", "thread.detach", "thread.capabilities", "turn.start", "turn.cancel", "approval.respond", "operation.get", "approval.candidate"];
99
+ export declare const RELAY_REQUEST_METHOD_VALUES_V11: readonly ["initialize", "thread.list", "thread.create", "thread.open", "thread.snapshot", "thread.rename", "thread.delete", "thread.detach", "thread.capabilities", "turn.start", "turn.cancel", "operation.get", "interaction.candidate"];
100
+ /** @deprecated Legacy generic Relay exports remain pinned to Wire 1.0. */
39
101
  export declare const RELAY_REQUEST_METHOD_VALUES: readonly ["initialize", "thread.list", "thread.create", "thread.open", "thread.snapshot", "thread.rename", "thread.delete", "thread.detach", "thread.capabilities", "turn.start", "turn.cancel", "approval.respond", "operation.get", "approval.candidate"];
102
+ export declare const RELAY_REQUEST_METHOD_DISPOSITIONS_V10: {
103
+ readonly initialize: "local-only";
104
+ readonly "thread.list": "query";
105
+ readonly "thread.create": "mutation";
106
+ readonly "thread.open": "query";
107
+ readonly "thread.snapshot": "query";
108
+ readonly "thread.rename": "mutation";
109
+ readonly "thread.delete": "mutation";
110
+ readonly "thread.detach": "mutation";
111
+ readonly "thread.capabilities": "query";
112
+ readonly "turn.start": "mutation";
113
+ readonly "turn.cancel": "mutation";
114
+ readonly "approval.respond": "mutation";
115
+ readonly "operation.get": "query";
116
+ readonly "approval.candidate": "mutation";
117
+ };
118
+ export declare const RELAY_REQUEST_METHOD_DISPOSITIONS_V11: {
119
+ readonly initialize: "local-only";
120
+ readonly "thread.list": "query";
121
+ readonly "thread.create": "mutation";
122
+ readonly "thread.open": "query";
123
+ readonly "thread.snapshot": "query";
124
+ readonly "thread.rename": "mutation";
125
+ readonly "thread.delete": "mutation";
126
+ readonly "thread.detach": "mutation";
127
+ readonly "thread.capabilities": "query";
128
+ readonly "turn.start": "mutation";
129
+ readonly "turn.cancel": "mutation";
130
+ readonly "operation.get": "query";
131
+ readonly "interaction.candidate": "mutation";
132
+ };
133
+ /** @deprecated Legacy generic Relay exports remain pinned to Wire 1.0. */
40
134
  export declare const RELAY_REQUEST_METHOD_DISPOSITIONS: {
41
135
  readonly initialize: "local-only";
42
136
  readonly "thread.list": "query";
@@ -54,7 +148,13 @@ export declare const RELAY_REQUEST_METHOD_DISPOSITIONS: {
54
148
  readonly "approval.candidate": "mutation";
55
149
  };
56
150
  export type RelayRequestMethodDisposition = (typeof RELAY_REQUEST_METHOD_DISPOSITIONS)[RelayRequestMethod];
151
+ export declare const RELAY_MUTATION_REQUEST_METHODS_V10: readonly ["thread.create", "thread.rename", "thread.delete", "thread.detach", "turn.start", "turn.cancel", "approval.respond", "approval.candidate"];
152
+ export declare const RELAY_MUTATION_REQUEST_METHODS_V11: readonly ["thread.create", "thread.rename", "thread.delete", "thread.detach", "turn.start", "turn.cancel", "interaction.candidate"];
153
+ export declare const RELAY_LOCAL_ONLY_REQUEST_METHODS_V10: readonly ["initialize"];
154
+ export declare const RELAY_LOCAL_ONLY_REQUEST_METHODS_V11: readonly ["initialize"];
155
+ /** @deprecated Legacy generic Relay exports remain pinned to Wire 1.0. */
57
156
  export declare const RELAY_MUTATION_REQUEST_METHODS: readonly ["thread.create", "thread.rename", "thread.delete", "thread.detach", "turn.start", "turn.cancel", "approval.respond", "approval.candidate"];
157
+ /** @deprecated Legacy generic Relay exports remain pinned to Wire 1.0. */
58
158
  export declare const RELAY_LOCAL_ONLY_REQUEST_METHODS: readonly ["initialize"];
59
159
  export declare const RELAY_ERROR_CODES: {
60
160
  readonly protocolVersionUnsupported: "RELAY_PROTOCOL_VERSION_UNSUPPORTED";
@@ -83,12 +183,14 @@ export declare const RELAY_ERROR_RETRYABILITY: {
83
183
  };
84
184
  export declare function getRelayErrorRetryability(code: RelayErrorCode): boolean;
85
185
  export declare const relayProtocolVersionSchema: z.ZodEnum<{
186
+ 1.1: "1.1";
86
187
  "1.0": "1.0";
87
188
  }>;
88
189
  export declare const deviceIdSchema: z.core.$ZodBranded<z.ZodString, "DeviceId">;
89
190
  export declare const workspaceIdSchema: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
90
191
  export declare const relayRequestIdSchema: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
91
192
  export declare const relayEnvelopeIdSchema: z.ZodString;
193
+ export declare const relayInteractionIdSchema: z.core.$ZodBranded<z.ZodString, "InteractionId">;
92
194
  export declare const relayApprovalCandidateParamsSchema: z.ZodReadonly<z.ZodObject<{
93
195
  threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
94
196
  turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
@@ -102,7 +204,126 @@ export declare const relayApprovalCandidateParamsSchema: z.ZodReadonly<z.ZodObje
102
204
  export declare const relayApprovalCandidateResultSchema: z.ZodReadonly<z.ZodObject<{
103
205
  accepted: z.ZodLiteral<true>;
104
206
  }, z.core.$strict>>;
105
- export declare const relayRequestMethodSchemas: {
207
+ export declare const RELAY_INTERACTION_METHODS_V11: {
208
+ readonly approvalRequest: "approval.request";
209
+ readonly userInputRequest: "userInput.request";
210
+ };
211
+ export declare const RELAY_INTERACTION_METHOD_VALUES_V11: readonly ["approval.request", "userInput.request"];
212
+ export declare const relayApprovalInteractionProjectionSchemaV11: z.ZodReadonly<z.ZodObject<{
213
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
214
+ agentName: z.ZodString;
215
+ toolName: z.ZodString;
216
+ explanation: z.ZodOptional<z.ZodString>;
217
+ }, z.core.$strict>>;
218
+ export declare const relayUserInputInteractionProjectionSchemaV11: z.ZodReadonly<z.ZodObject<{
219
+ title: z.ZodOptional<z.ZodString>;
220
+ description: z.ZodOptional<z.ZodString>;
221
+ controls: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
222
+ minLength: z.ZodOptional<z.ZodNumber>;
223
+ maxLength: z.ZodOptional<z.ZodNumber>;
224
+ id: z.ZodString;
225
+ label: z.ZodString;
226
+ description: z.ZodOptional<z.ZodString>;
227
+ required: z.ZodBoolean;
228
+ type: z.ZodLiteral<"text">;
229
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
230
+ minLength: z.ZodOptional<z.ZodNumber>;
231
+ maxLength: z.ZodOptional<z.ZodNumber>;
232
+ id: z.ZodString;
233
+ label: z.ZodString;
234
+ description: z.ZodOptional<z.ZodString>;
235
+ required: z.ZodBoolean;
236
+ type: z.ZodLiteral<"multiline">;
237
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
238
+ min: z.ZodOptional<z.ZodNumber>;
239
+ max: z.ZodOptional<z.ZodNumber>;
240
+ integer: z.ZodOptional<z.ZodBoolean>;
241
+ id: z.ZodString;
242
+ label: z.ZodString;
243
+ description: z.ZodOptional<z.ZodString>;
244
+ required: z.ZodBoolean;
245
+ type: z.ZodLiteral<"number">;
246
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
247
+ id: z.ZodString;
248
+ label: z.ZodString;
249
+ description: z.ZodOptional<z.ZodString>;
250
+ required: z.ZodBoolean;
251
+ type: z.ZodLiteral<"boolean">;
252
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
253
+ multiple: z.ZodBoolean;
254
+ options: z.ZodArray<z.ZodReadonly<z.ZodObject<{
255
+ id: z.ZodString;
256
+ label: z.ZodString;
257
+ description: z.ZodOptional<z.ZodString>;
258
+ }, z.core.$strict>>>;
259
+ minSelections: z.ZodOptional<z.ZodNumber>;
260
+ maxSelections: z.ZodOptional<z.ZodNumber>;
261
+ id: z.ZodString;
262
+ label: z.ZodString;
263
+ description: z.ZodOptional<z.ZodString>;
264
+ required: z.ZodBoolean;
265
+ type: z.ZodLiteral<"choice">;
266
+ }, z.core.$strict>>]>>;
267
+ }, z.core.$strict>>;
268
+ export declare const relayApprovalInteractionCandidateParamsSchemaV11: z.ZodReadonly<z.ZodObject<{
269
+ method: z.ZodLiteral<"approval.request">;
270
+ candidate: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
271
+ decision: z.ZodLiteral<"approve">;
272
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
273
+ decision: z.ZodLiteral<"reject">;
274
+ reason: z.ZodOptional<z.ZodString>;
275
+ }, z.core.$strict>>]>;
276
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
277
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
278
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
279
+ }, z.core.$strict>>;
280
+ export declare const relayUserInputInteractionCandidateParamsSchemaV11: z.ZodReadonly<z.ZodObject<{
281
+ method: z.ZodLiteral<"userInput.request">;
282
+ candidate: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
283
+ status: z.ZodLiteral<"submitted">;
284
+ values: z.ZodArray<z.ZodReadonly<z.ZodObject<{
285
+ id: z.ZodString;
286
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>;
287
+ }, z.core.$strict>>>;
288
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
289
+ status: z.ZodLiteral<"cancelled">;
290
+ reason: z.ZodOptional<z.ZodString>;
291
+ }, z.core.$strict>>]>;
292
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
293
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
294
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
295
+ }, z.core.$strict>>;
296
+ export declare const relayInteractionCandidateParamsSchemaV11: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
297
+ method: z.ZodLiteral<"approval.request">;
298
+ candidate: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
299
+ decision: z.ZodLiteral<"approve">;
300
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
301
+ decision: z.ZodLiteral<"reject">;
302
+ reason: z.ZodOptional<z.ZodString>;
303
+ }, z.core.$strict>>]>;
304
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
305
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
306
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
307
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
308
+ method: z.ZodLiteral<"userInput.request">;
309
+ candidate: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
310
+ status: z.ZodLiteral<"submitted">;
311
+ values: z.ZodArray<z.ZodReadonly<z.ZodObject<{
312
+ id: z.ZodString;
313
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>;
314
+ }, z.core.$strict>>>;
315
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
316
+ status: z.ZodLiteral<"cancelled">;
317
+ reason: z.ZodOptional<z.ZodString>;
318
+ }, z.core.$strict>>]>;
319
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
320
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
321
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
322
+ }, z.core.$strict>>]>;
323
+ export declare const relayInteractionCandidateResultSchemaV11: z.ZodReadonly<z.ZodObject<{
324
+ accepted: z.ZodLiteral<true>;
325
+ }, z.core.$strict>>;
326
+ export declare const relayRequestMethodSchemasV10: {
106
327
  readonly initialize: {
107
328
  readonly params: z.ZodReadonly<z.ZodObject<{
108
329
  protocolVersions: z.ZodArray<z.ZodString>;
@@ -112,10 +333,12 @@ export declare const relayRequestMethodSchemas: {
112
333
  }, z.core.$strict>>;
113
334
  }, z.core.$strict>>;
114
335
  readonly result: z.ZodReadonly<z.ZodObject<{
115
- protocolVersion: z.ZodEnum<{
116
- 1.1: "1.1";
117
- "1.0": "1.0";
118
- }>;
336
+ limits: z.ZodReadonly<z.ZodObject<{
337
+ maxFrameBytes: z.ZodNumber;
338
+ maxPageSize: z.ZodNumber;
339
+ eventReplay: z.ZodLiteral<false>;
340
+ idempotencyCacheEntries: z.ZodNumber;
341
+ }, z.core.$strict>>;
119
342
  runtimeInstanceId: z.core.$ZodBranded<z.ZodString, "RuntimeInstanceId">;
120
343
  server: z.ZodReadonly<z.ZodObject<{
121
344
  runtimeVersion: z.ZodString;
@@ -132,12 +355,10 @@ export declare const relayRequestMethodSchemas: {
132
355
  "operation-projection": "operation-projection";
133
356
  "process-local-sequence": "process-local-sequence";
134
357
  }>>;
135
- limits: z.ZodReadonly<z.ZodObject<{
136
- maxFrameBytes: z.ZodNumber;
137
- maxPageSize: z.ZodNumber;
138
- eventReplay: z.ZodLiteral<false>;
139
- idempotencyCacheEntries: z.ZodNumber;
140
- }, z.core.$strict>>;
358
+ protocolVersion: z.ZodEnum<{
359
+ 1.1: "1.1";
360
+ "1.0": "1.0";
361
+ }>;
141
362
  }, z.core.$strict>>;
142
363
  };
143
364
  readonly "thread.list": {
@@ -449,143 +670,2233 @@ export declare const relayRequestMethodSchemas: {
449
670
  }, z.core.$strict>>;
450
671
  };
451
672
  };
452
- export type RelayRequestParams<TMethod extends RelayRequestMethod> = z.infer<(typeof relayRequestMethodSchemas)[TMethod]["params"]>;
453
- export type RelayRequestResult<TMethod extends RelayRequestMethod> = z.infer<(typeof relayRequestMethodSchemas)[TMethod]["result"]>;
454
- export declare function isRelayRequestMethod(value: string): value is RelayRequestMethod;
455
- export declare function getRelayRequestMethodDisposition(value: string): RelayRequestMethodDisposition | undefined;
456
- export declare function isRelayMutationRequestMethod(method: RelayRequestMethod): method is (typeof RELAY_MUTATION_REQUEST_METHODS)[number];
457
- export declare function parseRelayRequestParams<TMethod extends RelayRequestMethod>(method: TMethod, value: unknown): RelayRequestParams<TMethod>;
458
- export declare function parseRelayRequestResult<TMethod extends RelayRequestMethod>(method: TMethod, value: unknown): RelayRequestResult<TMethod>;
459
- export declare const relayDeviceConnectSchema: z.ZodReadonly<z.ZodObject<{
460
- type: z.ZodLiteral<"device.connect">;
461
- protocolVersion: z.ZodLiteral<"1.0">;
462
- deviceId: z.core.$ZodBranded<z.ZodString, "DeviceId">;
463
- pairingToken: z.ZodString;
464
- }, z.core.$strict>>;
465
- export declare const relayRuntimeRequestSchema: z.ZodReadonly<z.ZodObject<{
466
- type: z.ZodLiteral<"runtime.request">;
467
- requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
468
- workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
469
- method: z.ZodEnum<{
470
- initialize: "initialize";
471
- "thread.list": "thread.list";
472
- "thread.create": "thread.create";
473
- "thread.open": "thread.open";
474
- "thread.snapshot": "thread.snapshot";
475
- "thread.rename": "thread.rename";
476
- "thread.delete": "thread.delete";
477
- "thread.detach": "thread.detach";
478
- "thread.capabilities": "thread.capabilities";
479
- "turn.start": "turn.start";
480
- "turn.cancel": "turn.cancel";
481
- "approval.respond": "approval.respond";
482
- "operation.get": "operation.get";
483
- "approval.candidate": "approval.candidate";
484
- }>;
485
- params: z.ZodJSONSchema;
486
- }, z.core.$strict>>;
487
- export declare const relayErrorSchema: z.ZodReadonly<z.ZodObject<{
488
- code: z.ZodString;
489
- message: z.ZodString;
490
- retryable: z.ZodBoolean;
491
- }, z.core.$strict>>;
492
- /**
493
- * This preserves the pre-freeze v1.0 shape: result/error are independently optional.
494
- * A strict exactly-one response belongs in a later Relay Wire version.
495
- */
496
- export declare const relayRuntimeResponseSchema: z.ZodReadonly<z.ZodObject<{
497
- type: z.ZodLiteral<"runtime.response">;
498
- requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
499
- workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
500
- result: z.ZodOptional<z.ZodJSONSchema>;
501
- error: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
502
- code: z.ZodString;
503
- message: z.ZodString;
504
- retryable: z.ZodBoolean;
505
- }, z.core.$strict>>>;
506
- }, z.core.$strict>>;
507
- export declare const relayRuntimeEventSchema: z.ZodReadonly<z.ZodObject<{
508
- type: z.ZodLiteral<"runtime.event">;
509
- workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
510
- relaySequence: z.ZodNumber;
511
- event: z.ZodReadonly<z.ZodObject<{
512
- protocolVersion: z.ZodEnum<{
513
- 1.1: "1.1";
514
- "1.0": "1.0";
515
- }>;
516
- runtimeInstanceId: z.core.$ZodBranded<z.ZodString, "RuntimeInstanceId">;
517
- sequence: z.ZodNumber;
518
- timestamp: z.ZodString;
519
- threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
520
- turnId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TurnId">>;
521
- event: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
522
- type: z.ZodLiteral<"turn.started">;
523
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
524
- type: z.ZodLiteral<"message.started">;
525
- streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
526
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
527
- type: z.ZodLiteral<"message.delta">;
528
- streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
529
- delta: z.ZodString;
530
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
531
- type: z.ZodLiteral<"message.completed">;
532
- streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
533
- text: z.ZodString;
534
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
535
- type: z.ZodLiteral<"reasoning.summary.delta">;
536
- reasoningId: z.ZodString;
537
- delta: z.ZodString;
538
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
539
- type: z.ZodLiteral<"tool.started">;
540
- toolCallId: z.ZodString;
541
- agentName: z.ZodString;
542
- toolName: z.ZodString;
543
- input: z.ZodJSONSchema;
544
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
545
- type: z.ZodLiteral<"tool.output">;
546
- toolCallId: z.ZodString;
547
- agentName: z.ZodString;
548
- toolName: z.ZodString;
549
- stream: z.ZodEnum<{
550
- stdout: "stdout";
551
- stderr: "stderr";
552
- }>;
553
- delta: z.ZodString;
554
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
555
- type: z.ZodLiteral<"tool.completed">;
556
- toolCallId: z.ZodString;
557
- agentName: z.ZodString;
558
- toolName: z.ZodString;
559
- operationId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "OperationId">>;
560
- outcome: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
561
- kind: z.ZodEnum<{
562
- success: "success";
563
- user_rejected: "user_rejected";
564
- policy_denied: "policy_denied";
565
- invalid_input: "invalid_input";
566
- cancelled: "cancelled";
567
- tool_failed: "tool_failed";
568
- }>;
569
- reason: z.ZodOptional<z.ZodString>;
570
- }, z.core.$strict>>>;
571
- display: z.ZodJSONSchema;
572
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
573
- type: z.ZodLiteral<"approval.required">;
574
- approval: z.ZodReadonly<z.ZodObject<{
575
- id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
576
- turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
577
- agentName: z.ZodString;
578
- toolName: z.ZodString;
579
- preview: z.ZodJSONSchema;
580
- reason: z.ZodOptional<z.ZodString>;
673
+ export declare const relayRequestMethodSchemasV11: {
674
+ readonly initialize: {
675
+ readonly params: z.ZodReadonly<z.ZodObject<{
676
+ protocolVersions: z.ZodArray<z.ZodString>;
677
+ client: z.ZodReadonly<z.ZodObject<{
678
+ name: z.ZodString;
679
+ version: z.ZodString;
581
680
  }, z.core.$strict>>;
582
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
583
- type: z.ZodLiteral<"approval.resolved">;
584
- approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
585
- resolution: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
586
- status: z.ZodLiteral<"resolved">;
587
- decision: z.ZodLiteral<"approve">;
588
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
681
+ }, z.core.$strict>>;
682
+ readonly result: z.ZodReadonly<z.ZodObject<{
683
+ limits: z.ZodReadonly<z.ZodObject<{
684
+ maxFrameBytes: z.ZodNumber;
685
+ maxPageSize: z.ZodNumber;
686
+ eventReplay: z.ZodLiteral<false>;
687
+ idempotencyCacheEntries: z.ZodNumber;
688
+ }, z.core.$strict>>;
689
+ runtimeInstanceId: z.core.$ZodBranded<z.ZodString, "RuntimeInstanceId">;
690
+ server: z.ZodReadonly<z.ZodObject<{
691
+ runtimeVersion: z.ZodString;
692
+ name: z.ZodString;
693
+ version: z.ZodString;
694
+ }, z.core.$strict>>;
695
+ features: z.ZodArray<z.ZodEnum<{
696
+ "thread-management": "thread-management";
697
+ snapshots: "snapshots";
698
+ turns: "turns";
699
+ approvals: "approvals";
700
+ "tool-streaming": "tool-streaming";
701
+ "reasoning-summary": "reasoning-summary";
702
+ "operation-projection": "operation-projection";
703
+ "process-local-sequence": "process-local-sequence";
704
+ }>>;
705
+ protocolVersion: z.ZodEnum<{
706
+ 1.1: "1.1";
707
+ "1.0": "1.0";
708
+ }>;
709
+ }, z.core.$strict>>;
710
+ };
711
+ readonly "thread.list": {
712
+ readonly params: z.ZodReadonly<z.ZodObject<{
713
+ cursor: z.ZodOptional<z.ZodString>;
714
+ limit: z.ZodDefault<z.ZodNumber>;
715
+ }, z.core.$strict>>;
716
+ readonly result: z.ZodReadonly<z.ZodObject<{
717
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
718
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
719
+ title: z.ZodOptional<z.ZodString>;
720
+ model: z.ZodOptional<z.ZodString>;
721
+ createdAt: z.ZodString;
722
+ updatedAt: z.ZodString;
723
+ messageCount: z.ZodNumber;
724
+ }, z.core.$strict>>>;
725
+ nextCursor: z.ZodNullable<z.ZodString>;
726
+ }, z.core.$strict>>;
727
+ };
728
+ readonly "thread.create": {
729
+ readonly params: z.ZodReadonly<z.ZodObject<{
730
+ title: z.ZodOptional<z.ZodString>;
731
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
732
+ }, z.core.$strict>>;
733
+ readonly result: z.ZodReadonly<z.ZodObject<{
734
+ thread: z.ZodReadonly<z.ZodObject<{
735
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
736
+ title: z.ZodOptional<z.ZodString>;
737
+ model: z.ZodOptional<z.ZodString>;
738
+ createdAt: z.ZodString;
739
+ updatedAt: z.ZodString;
740
+ messageCount: z.ZodNumber;
741
+ }, z.core.$strict>>;
742
+ }, z.core.$strict>>;
743
+ };
744
+ readonly "thread.open": {
745
+ readonly params: z.ZodReadonly<z.ZodObject<{
746
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
747
+ }, z.core.$strict>>;
748
+ readonly result: z.ZodReadonly<z.ZodObject<{
749
+ thread: z.ZodReadonly<z.ZodObject<{
750
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
751
+ title: z.ZodOptional<z.ZodString>;
752
+ model: z.ZodOptional<z.ZodString>;
753
+ createdAt: z.ZodString;
754
+ updatedAt: z.ZodString;
755
+ messageCount: z.ZodNumber;
756
+ }, z.core.$strict>>;
757
+ messages: z.ZodReadonly<z.ZodObject<{
758
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
759
+ sequence: z.ZodNumber;
760
+ role: z.ZodEnum<{
761
+ user: "user";
762
+ assistant: "assistant";
763
+ }>;
764
+ createdAt: z.ZodString;
765
+ parts: z.ZodArray<z.ZodReadonly<z.ZodObject<{
766
+ type: z.ZodLiteral<"text">;
767
+ text: z.ZodString;
768
+ }, z.core.$strict>>>;
769
+ }, z.core.$strict>>>;
770
+ nextBeforeSequence: z.ZodNullable<z.ZodNumber>;
771
+ }, z.core.$strict>>;
772
+ operations: z.ZodReadonly<z.ZodObject<{
773
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
774
+ id: z.core.$ZodBranded<z.ZodString, "OperationId">;
775
+ sequence: z.ZodNumber;
776
+ toolCallId: z.ZodString;
777
+ agentName: z.ZodString;
778
+ toolName: z.ZodString;
779
+ createdAt: z.ZodString;
780
+ outcome: z.ZodReadonly<z.ZodObject<{
781
+ kind: z.ZodEnum<{
782
+ success: "success";
783
+ user_rejected: "user_rejected";
784
+ policy_denied: "policy_denied";
785
+ invalid_input: "invalid_input";
786
+ cancelled: "cancelled";
787
+ tool_failed: "tool_failed";
788
+ }>;
789
+ reason: z.ZodOptional<z.ZodString>;
790
+ }, z.core.$strict>>;
791
+ display: z.ZodJSONSchema;
792
+ }, z.core.$strict>>>;
793
+ nextBeforeSequence: z.ZodNullable<z.ZodNumber>;
794
+ }, z.core.$strict>>;
795
+ activeTurn: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
796
+ id: z.core.$ZodBranded<z.ZodString, "TurnId">;
797
+ status: z.ZodEnum<{
798
+ running: "running";
799
+ cancelling: "cancelling";
800
+ }>;
801
+ startedAt: z.ZodString;
802
+ }, z.core.$strict>>>;
803
+ pendingApprovals: z.ZodArray<z.ZodReadonly<z.ZodObject<{
804
+ id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
805
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
806
+ agentName: z.ZodString;
807
+ toolName: z.ZodString;
808
+ preview: z.ZodJSONSchema;
809
+ reason: z.ZodOptional<z.ZodString>;
810
+ }, z.core.$strict>>>;
811
+ transcriptCompleteness: z.ZodEnum<{
812
+ complete: "complete";
813
+ legacy_snapshot: "legacy_snapshot";
814
+ }>;
815
+ }, z.core.$strict>>;
816
+ };
817
+ readonly "thread.snapshot": {
818
+ readonly params: z.ZodReadonly<z.ZodObject<{
819
+ messageBeforeSequence: z.ZodOptional<z.ZodNumber>;
820
+ operationBeforeSequence: z.ZodOptional<z.ZodNumber>;
821
+ limit: z.ZodDefault<z.ZodNumber>;
822
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
823
+ }, z.core.$strict>>;
824
+ readonly result: z.ZodReadonly<z.ZodObject<{
825
+ thread: z.ZodReadonly<z.ZodObject<{
826
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
827
+ title: z.ZodOptional<z.ZodString>;
828
+ model: z.ZodOptional<z.ZodString>;
829
+ createdAt: z.ZodString;
830
+ updatedAt: z.ZodString;
831
+ messageCount: z.ZodNumber;
832
+ }, z.core.$strict>>;
833
+ messages: z.ZodReadonly<z.ZodObject<{
834
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
835
+ sequence: z.ZodNumber;
836
+ role: z.ZodEnum<{
837
+ user: "user";
838
+ assistant: "assistant";
839
+ }>;
840
+ createdAt: z.ZodString;
841
+ parts: z.ZodArray<z.ZodReadonly<z.ZodObject<{
842
+ type: z.ZodLiteral<"text">;
843
+ text: z.ZodString;
844
+ }, z.core.$strict>>>;
845
+ }, z.core.$strict>>>;
846
+ nextBeforeSequence: z.ZodNullable<z.ZodNumber>;
847
+ }, z.core.$strict>>;
848
+ operations: z.ZodReadonly<z.ZodObject<{
849
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
850
+ id: z.core.$ZodBranded<z.ZodString, "OperationId">;
851
+ sequence: z.ZodNumber;
852
+ toolCallId: z.ZodString;
853
+ agentName: z.ZodString;
854
+ toolName: z.ZodString;
855
+ createdAt: z.ZodString;
856
+ outcome: z.ZodReadonly<z.ZodObject<{
857
+ kind: z.ZodEnum<{
858
+ success: "success";
859
+ user_rejected: "user_rejected";
860
+ policy_denied: "policy_denied";
861
+ invalid_input: "invalid_input";
862
+ cancelled: "cancelled";
863
+ tool_failed: "tool_failed";
864
+ }>;
865
+ reason: z.ZodOptional<z.ZodString>;
866
+ }, z.core.$strict>>;
867
+ display: z.ZodJSONSchema;
868
+ }, z.core.$strict>>>;
869
+ nextBeforeSequence: z.ZodNullable<z.ZodNumber>;
870
+ }, z.core.$strict>>;
871
+ activeTurn: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
872
+ id: z.core.$ZodBranded<z.ZodString, "TurnId">;
873
+ status: z.ZodEnum<{
874
+ running: "running";
875
+ cancelling: "cancelling";
876
+ }>;
877
+ startedAt: z.ZodString;
878
+ }, z.core.$strict>>>;
879
+ pendingApprovals: z.ZodArray<z.ZodReadonly<z.ZodObject<{
880
+ id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
881
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
882
+ agentName: z.ZodString;
883
+ toolName: z.ZodString;
884
+ preview: z.ZodJSONSchema;
885
+ reason: z.ZodOptional<z.ZodString>;
886
+ }, z.core.$strict>>>;
887
+ transcriptCompleteness: z.ZodEnum<{
888
+ complete: "complete";
889
+ legacy_snapshot: "legacy_snapshot";
890
+ }>;
891
+ }, z.core.$strict>>;
892
+ };
893
+ readonly "thread.rename": {
894
+ readonly params: z.ZodReadonly<z.ZodObject<{
895
+ title: z.ZodString;
896
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
897
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
898
+ }, z.core.$strict>>;
899
+ readonly result: z.ZodReadonly<z.ZodObject<{
900
+ thread: z.ZodReadonly<z.ZodObject<{
901
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
902
+ title: z.ZodOptional<z.ZodString>;
903
+ model: z.ZodOptional<z.ZodString>;
904
+ createdAt: z.ZodString;
905
+ updatedAt: z.ZodString;
906
+ messageCount: z.ZodNumber;
907
+ }, z.core.$strict>>;
908
+ }, z.core.$strict>>;
909
+ };
910
+ readonly "thread.delete": {
911
+ readonly params: z.ZodReadonly<z.ZodObject<{
912
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
913
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
914
+ }, z.core.$strict>>;
915
+ readonly result: z.ZodReadonly<z.ZodObject<{
916
+ deleted: z.ZodLiteral<true>;
917
+ }, z.core.$strict>>;
918
+ };
919
+ readonly "thread.detach": {
920
+ readonly params: z.ZodReadonly<z.ZodObject<{
921
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
922
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
923
+ }, z.core.$strict>>;
924
+ readonly result: z.ZodReadonly<z.ZodObject<{
925
+ detached: z.ZodBoolean;
926
+ }, z.core.$strict>>;
927
+ };
928
+ readonly "thread.capabilities": {
929
+ readonly params: z.ZodReadonly<z.ZodObject<{
930
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
931
+ }, z.core.$strict>>;
932
+ readonly result: z.ZodReadonly<z.ZodObject<{
933
+ manifest: z.ZodJSONSchema;
934
+ }, z.core.$strict>>;
935
+ };
936
+ readonly "turn.start": {
937
+ readonly params: z.ZodReadonly<z.ZodObject<{
938
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
939
+ input: z.ZodReadonly<z.ZodObject<{
940
+ text: z.ZodString;
941
+ }, z.core.$strict>>;
942
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
943
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
944
+ }, z.core.$strict>>;
945
+ readonly result: z.ZodReadonly<z.ZodObject<{
946
+ accepted: z.ZodLiteral<true>;
947
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
948
+ }, z.core.$strict>>;
949
+ };
950
+ readonly "turn.cancel": {
951
+ readonly params: z.ZodReadonly<z.ZodObject<{
952
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
953
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
954
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
955
+ }, z.core.$strict>>;
956
+ readonly result: z.ZodReadonly<z.ZodObject<{
957
+ cancelling: z.ZodBoolean;
958
+ }, z.core.$strict>>;
959
+ };
960
+ readonly "operation.get": {
961
+ readonly params: z.ZodReadonly<z.ZodObject<{
962
+ operationId: z.core.$ZodBranded<z.ZodString, "OperationId">;
963
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
964
+ }, z.core.$strict>>;
965
+ readonly result: z.ZodReadonly<z.ZodObject<{
966
+ operation: z.ZodNullable<z.ZodReadonly<z.ZodObject<{
967
+ id: z.core.$ZodBranded<z.ZodString, "OperationId">;
968
+ sequence: z.ZodNumber;
969
+ toolCallId: z.ZodString;
970
+ agentName: z.ZodString;
971
+ toolName: z.ZodString;
972
+ createdAt: z.ZodString;
973
+ outcome: z.ZodReadonly<z.ZodObject<{
974
+ kind: z.ZodEnum<{
975
+ success: "success";
976
+ user_rejected: "user_rejected";
977
+ policy_denied: "policy_denied";
978
+ invalid_input: "invalid_input";
979
+ cancelled: "cancelled";
980
+ tool_failed: "tool_failed";
981
+ }>;
982
+ reason: z.ZodOptional<z.ZodString>;
983
+ }, z.core.$strict>>;
984
+ display: z.ZodJSONSchema;
985
+ }, z.core.$strict>>>;
986
+ }, z.core.$strict>>;
987
+ };
988
+ readonly "interaction.candidate": {
989
+ readonly params: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
990
+ method: z.ZodLiteral<"approval.request">;
991
+ candidate: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
992
+ decision: z.ZodLiteral<"approve">;
993
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
994
+ decision: z.ZodLiteral<"reject">;
995
+ reason: z.ZodOptional<z.ZodString>;
996
+ }, z.core.$strict>>]>;
997
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
998
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
999
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
1000
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1001
+ method: z.ZodLiteral<"userInput.request">;
1002
+ candidate: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
1003
+ status: z.ZodLiteral<"submitted">;
1004
+ values: z.ZodArray<z.ZodReadonly<z.ZodObject<{
1005
+ id: z.ZodString;
1006
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>;
1007
+ }, z.core.$strict>>>;
1008
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1009
+ status: z.ZodLiteral<"cancelled">;
1010
+ reason: z.ZodOptional<z.ZodString>;
1011
+ }, z.core.$strict>>]>;
1012
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
1013
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1014
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
1015
+ }, z.core.$strict>>]>;
1016
+ readonly result: z.ZodReadonly<z.ZodObject<{
1017
+ accepted: z.ZodLiteral<true>;
1018
+ }, z.core.$strict>>;
1019
+ };
1020
+ };
1021
+ /** @deprecated Legacy generic Relay exports remain pinned to Wire 1.0. */
1022
+ export declare const relayRequestMethodSchemas: {
1023
+ readonly initialize: {
1024
+ readonly params: z.ZodReadonly<z.ZodObject<{
1025
+ protocolVersions: z.ZodArray<z.ZodString>;
1026
+ client: z.ZodReadonly<z.ZodObject<{
1027
+ name: z.ZodString;
1028
+ version: z.ZodString;
1029
+ }, z.core.$strict>>;
1030
+ }, z.core.$strict>>;
1031
+ readonly result: z.ZodReadonly<z.ZodObject<{
1032
+ limits: z.ZodReadonly<z.ZodObject<{
1033
+ maxFrameBytes: z.ZodNumber;
1034
+ maxPageSize: z.ZodNumber;
1035
+ eventReplay: z.ZodLiteral<false>;
1036
+ idempotencyCacheEntries: z.ZodNumber;
1037
+ }, z.core.$strict>>;
1038
+ runtimeInstanceId: z.core.$ZodBranded<z.ZodString, "RuntimeInstanceId">;
1039
+ server: z.ZodReadonly<z.ZodObject<{
1040
+ runtimeVersion: z.ZodString;
1041
+ name: z.ZodString;
1042
+ version: z.ZodString;
1043
+ }, z.core.$strict>>;
1044
+ features: z.ZodArray<z.ZodEnum<{
1045
+ "thread-management": "thread-management";
1046
+ snapshots: "snapshots";
1047
+ turns: "turns";
1048
+ approvals: "approvals";
1049
+ "tool-streaming": "tool-streaming";
1050
+ "reasoning-summary": "reasoning-summary";
1051
+ "operation-projection": "operation-projection";
1052
+ "process-local-sequence": "process-local-sequence";
1053
+ }>>;
1054
+ protocolVersion: z.ZodEnum<{
1055
+ 1.1: "1.1";
1056
+ "1.0": "1.0";
1057
+ }>;
1058
+ }, z.core.$strict>>;
1059
+ };
1060
+ readonly "thread.list": {
1061
+ readonly params: z.ZodReadonly<z.ZodObject<{
1062
+ cursor: z.ZodOptional<z.ZodString>;
1063
+ limit: z.ZodDefault<z.ZodNumber>;
1064
+ }, z.core.$strict>>;
1065
+ readonly result: z.ZodReadonly<z.ZodObject<{
1066
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
1067
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1068
+ title: z.ZodOptional<z.ZodString>;
1069
+ model: z.ZodOptional<z.ZodString>;
1070
+ createdAt: z.ZodString;
1071
+ updatedAt: z.ZodString;
1072
+ messageCount: z.ZodNumber;
1073
+ }, z.core.$strict>>>;
1074
+ nextCursor: z.ZodNullable<z.ZodString>;
1075
+ }, z.core.$strict>>;
1076
+ };
1077
+ readonly "thread.create": {
1078
+ readonly params: z.ZodReadonly<z.ZodObject<{
1079
+ title: z.ZodOptional<z.ZodString>;
1080
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
1081
+ }, z.core.$strict>>;
1082
+ readonly result: z.ZodReadonly<z.ZodObject<{
1083
+ thread: z.ZodReadonly<z.ZodObject<{
1084
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1085
+ title: z.ZodOptional<z.ZodString>;
1086
+ model: z.ZodOptional<z.ZodString>;
1087
+ createdAt: z.ZodString;
1088
+ updatedAt: z.ZodString;
1089
+ messageCount: z.ZodNumber;
1090
+ }, z.core.$strict>>;
1091
+ }, z.core.$strict>>;
1092
+ };
1093
+ readonly "thread.open": {
1094
+ readonly params: z.ZodReadonly<z.ZodObject<{
1095
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1096
+ }, z.core.$strict>>;
1097
+ readonly result: z.ZodReadonly<z.ZodObject<{
1098
+ thread: z.ZodReadonly<z.ZodObject<{
1099
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1100
+ title: z.ZodOptional<z.ZodString>;
1101
+ model: z.ZodOptional<z.ZodString>;
1102
+ createdAt: z.ZodString;
1103
+ updatedAt: z.ZodString;
1104
+ messageCount: z.ZodNumber;
1105
+ }, z.core.$strict>>;
1106
+ messages: z.ZodReadonly<z.ZodObject<{
1107
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
1108
+ sequence: z.ZodNumber;
1109
+ role: z.ZodEnum<{
1110
+ user: "user";
1111
+ assistant: "assistant";
1112
+ }>;
1113
+ createdAt: z.ZodString;
1114
+ parts: z.ZodArray<z.ZodReadonly<z.ZodObject<{
1115
+ type: z.ZodLiteral<"text">;
1116
+ text: z.ZodString;
1117
+ }, z.core.$strict>>>;
1118
+ }, z.core.$strict>>>;
1119
+ nextBeforeSequence: z.ZodNullable<z.ZodNumber>;
1120
+ }, z.core.$strict>>;
1121
+ operations: z.ZodReadonly<z.ZodObject<{
1122
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
1123
+ id: z.core.$ZodBranded<z.ZodString, "OperationId">;
1124
+ sequence: z.ZodNumber;
1125
+ toolCallId: z.ZodString;
1126
+ agentName: z.ZodString;
1127
+ toolName: z.ZodString;
1128
+ createdAt: z.ZodString;
1129
+ outcome: z.ZodReadonly<z.ZodObject<{
1130
+ kind: z.ZodEnum<{
1131
+ success: "success";
1132
+ user_rejected: "user_rejected";
1133
+ policy_denied: "policy_denied";
1134
+ invalid_input: "invalid_input";
1135
+ cancelled: "cancelled";
1136
+ tool_failed: "tool_failed";
1137
+ }>;
1138
+ reason: z.ZodOptional<z.ZodString>;
1139
+ }, z.core.$strict>>;
1140
+ display: z.ZodJSONSchema;
1141
+ }, z.core.$strict>>>;
1142
+ nextBeforeSequence: z.ZodNullable<z.ZodNumber>;
1143
+ }, z.core.$strict>>;
1144
+ activeTurn: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
1145
+ id: z.core.$ZodBranded<z.ZodString, "TurnId">;
1146
+ status: z.ZodEnum<{
1147
+ running: "running";
1148
+ cancelling: "cancelling";
1149
+ }>;
1150
+ startedAt: z.ZodString;
1151
+ }, z.core.$strict>>>;
1152
+ pendingApprovals: z.ZodArray<z.ZodReadonly<z.ZodObject<{
1153
+ id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
1154
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
1155
+ agentName: z.ZodString;
1156
+ toolName: z.ZodString;
1157
+ preview: z.ZodJSONSchema;
1158
+ reason: z.ZodOptional<z.ZodString>;
1159
+ }, z.core.$strict>>>;
1160
+ transcriptCompleteness: z.ZodEnum<{
1161
+ complete: "complete";
1162
+ legacy_snapshot: "legacy_snapshot";
1163
+ }>;
1164
+ }, z.core.$strict>>;
1165
+ };
1166
+ readonly "thread.snapshot": {
1167
+ readonly params: z.ZodReadonly<z.ZodObject<{
1168
+ messageBeforeSequence: z.ZodOptional<z.ZodNumber>;
1169
+ operationBeforeSequence: z.ZodOptional<z.ZodNumber>;
1170
+ limit: z.ZodDefault<z.ZodNumber>;
1171
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1172
+ }, z.core.$strict>>;
1173
+ readonly result: z.ZodReadonly<z.ZodObject<{
1174
+ thread: z.ZodReadonly<z.ZodObject<{
1175
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1176
+ title: z.ZodOptional<z.ZodString>;
1177
+ model: z.ZodOptional<z.ZodString>;
1178
+ createdAt: z.ZodString;
1179
+ updatedAt: z.ZodString;
1180
+ messageCount: z.ZodNumber;
1181
+ }, z.core.$strict>>;
1182
+ messages: z.ZodReadonly<z.ZodObject<{
1183
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
1184
+ sequence: z.ZodNumber;
1185
+ role: z.ZodEnum<{
1186
+ user: "user";
1187
+ assistant: "assistant";
1188
+ }>;
1189
+ createdAt: z.ZodString;
1190
+ parts: z.ZodArray<z.ZodReadonly<z.ZodObject<{
1191
+ type: z.ZodLiteral<"text">;
1192
+ text: z.ZodString;
1193
+ }, z.core.$strict>>>;
1194
+ }, z.core.$strict>>>;
1195
+ nextBeforeSequence: z.ZodNullable<z.ZodNumber>;
1196
+ }, z.core.$strict>>;
1197
+ operations: z.ZodReadonly<z.ZodObject<{
1198
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
1199
+ id: z.core.$ZodBranded<z.ZodString, "OperationId">;
1200
+ sequence: z.ZodNumber;
1201
+ toolCallId: z.ZodString;
1202
+ agentName: z.ZodString;
1203
+ toolName: z.ZodString;
1204
+ createdAt: z.ZodString;
1205
+ outcome: z.ZodReadonly<z.ZodObject<{
1206
+ kind: z.ZodEnum<{
1207
+ success: "success";
1208
+ user_rejected: "user_rejected";
1209
+ policy_denied: "policy_denied";
1210
+ invalid_input: "invalid_input";
1211
+ cancelled: "cancelled";
1212
+ tool_failed: "tool_failed";
1213
+ }>;
1214
+ reason: z.ZodOptional<z.ZodString>;
1215
+ }, z.core.$strict>>;
1216
+ display: z.ZodJSONSchema;
1217
+ }, z.core.$strict>>>;
1218
+ nextBeforeSequence: z.ZodNullable<z.ZodNumber>;
1219
+ }, z.core.$strict>>;
1220
+ activeTurn: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
1221
+ id: z.core.$ZodBranded<z.ZodString, "TurnId">;
1222
+ status: z.ZodEnum<{
1223
+ running: "running";
1224
+ cancelling: "cancelling";
1225
+ }>;
1226
+ startedAt: z.ZodString;
1227
+ }, z.core.$strict>>>;
1228
+ pendingApprovals: z.ZodArray<z.ZodReadonly<z.ZodObject<{
1229
+ id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
1230
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
1231
+ agentName: z.ZodString;
1232
+ toolName: z.ZodString;
1233
+ preview: z.ZodJSONSchema;
1234
+ reason: z.ZodOptional<z.ZodString>;
1235
+ }, z.core.$strict>>>;
1236
+ transcriptCompleteness: z.ZodEnum<{
1237
+ complete: "complete";
1238
+ legacy_snapshot: "legacy_snapshot";
1239
+ }>;
1240
+ }, z.core.$strict>>;
1241
+ };
1242
+ readonly "thread.rename": {
1243
+ readonly params: z.ZodReadonly<z.ZodObject<{
1244
+ title: z.ZodString;
1245
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1246
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
1247
+ }, z.core.$strict>>;
1248
+ readonly result: z.ZodReadonly<z.ZodObject<{
1249
+ thread: z.ZodReadonly<z.ZodObject<{
1250
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1251
+ title: z.ZodOptional<z.ZodString>;
1252
+ model: z.ZodOptional<z.ZodString>;
1253
+ createdAt: z.ZodString;
1254
+ updatedAt: z.ZodString;
1255
+ messageCount: z.ZodNumber;
1256
+ }, z.core.$strict>>;
1257
+ }, z.core.$strict>>;
1258
+ };
1259
+ readonly "thread.delete": {
1260
+ readonly params: z.ZodReadonly<z.ZodObject<{
1261
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1262
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
1263
+ }, z.core.$strict>>;
1264
+ readonly result: z.ZodReadonly<z.ZodObject<{
1265
+ deleted: z.ZodLiteral<true>;
1266
+ }, z.core.$strict>>;
1267
+ };
1268
+ readonly "thread.detach": {
1269
+ readonly params: z.ZodReadonly<z.ZodObject<{
1270
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1271
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
1272
+ }, z.core.$strict>>;
1273
+ readonly result: z.ZodReadonly<z.ZodObject<{
1274
+ detached: z.ZodBoolean;
1275
+ }, z.core.$strict>>;
1276
+ };
1277
+ readonly "thread.capabilities": {
1278
+ readonly params: z.ZodReadonly<z.ZodObject<{
1279
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1280
+ }, z.core.$strict>>;
1281
+ readonly result: z.ZodReadonly<z.ZodObject<{
1282
+ manifest: z.ZodJSONSchema;
1283
+ }, z.core.$strict>>;
1284
+ };
1285
+ readonly "turn.start": {
1286
+ readonly params: z.ZodReadonly<z.ZodObject<{
1287
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
1288
+ input: z.ZodReadonly<z.ZodObject<{
1289
+ text: z.ZodString;
1290
+ }, z.core.$strict>>;
1291
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1292
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
1293
+ }, z.core.$strict>>;
1294
+ readonly result: z.ZodReadonly<z.ZodObject<{
1295
+ accepted: z.ZodLiteral<true>;
1296
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
1297
+ }, z.core.$strict>>;
1298
+ };
1299
+ readonly "turn.cancel": {
1300
+ readonly params: z.ZodReadonly<z.ZodObject<{
1301
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
1302
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1303
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
1304
+ }, z.core.$strict>>;
1305
+ readonly result: z.ZodReadonly<z.ZodObject<{
1306
+ cancelling: z.ZodBoolean;
1307
+ }, z.core.$strict>>;
1308
+ };
1309
+ readonly "approval.respond": {
1310
+ readonly params: z.ZodReadonly<z.ZodObject<{
1311
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
1312
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
1313
+ decision: z.ZodEnum<{
1314
+ approve: "approve";
1315
+ reject: "reject";
1316
+ }>;
1317
+ reason: z.ZodOptional<z.ZodString>;
1318
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1319
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
1320
+ }, z.core.$strict>>;
1321
+ readonly result: z.ZodReadonly<z.ZodObject<{
1322
+ resolved: z.ZodLiteral<true>;
1323
+ }, z.core.$strict>>;
1324
+ };
1325
+ readonly "operation.get": {
1326
+ readonly params: z.ZodReadonly<z.ZodObject<{
1327
+ operationId: z.core.$ZodBranded<z.ZodString, "OperationId">;
1328
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1329
+ }, z.core.$strict>>;
1330
+ readonly result: z.ZodReadonly<z.ZodObject<{
1331
+ operation: z.ZodNullable<z.ZodReadonly<z.ZodObject<{
1332
+ id: z.core.$ZodBranded<z.ZodString, "OperationId">;
1333
+ sequence: z.ZodNumber;
1334
+ toolCallId: z.ZodString;
1335
+ agentName: z.ZodString;
1336
+ toolName: z.ZodString;
1337
+ createdAt: z.ZodString;
1338
+ outcome: z.ZodReadonly<z.ZodObject<{
1339
+ kind: z.ZodEnum<{
1340
+ success: "success";
1341
+ user_rejected: "user_rejected";
1342
+ policy_denied: "policy_denied";
1343
+ invalid_input: "invalid_input";
1344
+ cancelled: "cancelled";
1345
+ tool_failed: "tool_failed";
1346
+ }>;
1347
+ reason: z.ZodOptional<z.ZodString>;
1348
+ }, z.core.$strict>>;
1349
+ display: z.ZodJSONSchema;
1350
+ }, z.core.$strict>>>;
1351
+ }, z.core.$strict>>;
1352
+ };
1353
+ readonly "approval.candidate": {
1354
+ readonly params: z.ZodReadonly<z.ZodObject<{
1355
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1356
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
1357
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
1358
+ decision: z.ZodEnum<{
1359
+ approve: "approve";
1360
+ reject: "reject";
1361
+ }>;
1362
+ reason: z.ZodOptional<z.ZodString>;
1363
+ }, z.core.$strict>>;
1364
+ readonly result: z.ZodReadonly<z.ZodObject<{
1365
+ accepted: z.ZodLiteral<true>;
1366
+ }, z.core.$strict>>;
1367
+ };
1368
+ };
1369
+ export type RelayRequestParams<TMethod extends RelayRequestMethod> = z.infer<(typeof relayRequestMethodSchemas)[TMethod]["params"]>;
1370
+ export type RelayRequestResult<TMethod extends RelayRequestMethod> = z.infer<(typeof relayRequestMethodSchemas)[TMethod]["result"]>;
1371
+ export declare function isRelayRequestMethod(value: string): value is RelayRequestMethod;
1372
+ export declare function getRelayRequestMethodDisposition(value: string): RelayRequestMethodDisposition | undefined;
1373
+ export declare function isRelayMutationRequestMethod(method: RelayRequestMethod): method is (typeof RELAY_MUTATION_REQUEST_METHODS)[number];
1374
+ export declare function parseRelayRequestParams<TMethod extends RelayRequestMethod>(method: TMethod, value: unknown): RelayRequestParams<TMethod>;
1375
+ export declare function parseRelayRequestResult<TMethod extends RelayRequestMethod>(method: TMethod, value: unknown): RelayRequestResult<TMethod>;
1376
+ export declare const relayDeviceConnectSchema: z.ZodReadonly<z.ZodObject<{
1377
+ type: z.ZodLiteral<"device.connect">;
1378
+ protocolVersion: z.ZodLiteral<"1.0">;
1379
+ deviceId: z.core.$ZodBranded<z.ZodString, "DeviceId">;
1380
+ pairingToken: z.ZodString;
1381
+ }, z.core.$strict>>;
1382
+ export declare const relayRuntimeRequestSchema: z.ZodReadonly<z.ZodObject<{
1383
+ type: z.ZodLiteral<"runtime.request">;
1384
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
1385
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
1386
+ method: z.ZodEnum<{
1387
+ initialize: "initialize";
1388
+ "thread.list": "thread.list";
1389
+ "thread.create": "thread.create";
1390
+ "thread.open": "thread.open";
1391
+ "thread.snapshot": "thread.snapshot";
1392
+ "thread.rename": "thread.rename";
1393
+ "thread.delete": "thread.delete";
1394
+ "thread.detach": "thread.detach";
1395
+ "thread.capabilities": "thread.capabilities";
1396
+ "turn.start": "turn.start";
1397
+ "turn.cancel": "turn.cancel";
1398
+ "approval.respond": "approval.respond";
1399
+ "operation.get": "operation.get";
1400
+ "approval.candidate": "approval.candidate";
1401
+ }>;
1402
+ params: z.ZodJSONSchema;
1403
+ }, z.core.$strict>>;
1404
+ export declare const relayErrorSchema: z.ZodReadonly<z.ZodObject<{
1405
+ code: z.ZodString;
1406
+ message: z.ZodString;
1407
+ retryable: z.ZodBoolean;
1408
+ }, z.core.$strict>>;
1409
+ /**
1410
+ * This preserves the pre-freeze v1.0 shape: result/error are independently optional.
1411
+ * A strict exactly-one response belongs in a later Relay Wire version.
1412
+ */
1413
+ export declare const relayRuntimeResponseSchema: z.ZodReadonly<z.ZodObject<{
1414
+ type: z.ZodLiteral<"runtime.response">;
1415
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
1416
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
1417
+ result: z.ZodOptional<z.ZodJSONSchema>;
1418
+ error: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
1419
+ code: z.ZodString;
1420
+ message: z.ZodString;
1421
+ retryable: z.ZodBoolean;
1422
+ }, z.core.$strict>>>;
1423
+ }, z.core.$strict>>;
1424
+ export declare const relayRuntimeEventSchema: z.ZodReadonly<z.ZodObject<{
1425
+ type: z.ZodLiteral<"runtime.event">;
1426
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
1427
+ relaySequence: z.ZodNumber;
1428
+ event: z.ZodReadonly<z.ZodObject<{
1429
+ event: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
1430
+ type: z.ZodLiteral<"turn.started">;
1431
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1432
+ type: z.ZodLiteral<"message.started">;
1433
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
1434
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1435
+ type: z.ZodLiteral<"message.delta">;
1436
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
1437
+ delta: z.ZodString;
1438
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1439
+ type: z.ZodLiteral<"message.completed">;
1440
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
1441
+ text: z.ZodString;
1442
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1443
+ type: z.ZodLiteral<"reasoning.summary.delta">;
1444
+ reasoningId: z.ZodString;
1445
+ delta: z.ZodString;
1446
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1447
+ type: z.ZodLiteral<"tool.started">;
1448
+ toolCallId: z.ZodString;
1449
+ agentName: z.ZodString;
1450
+ toolName: z.ZodString;
1451
+ input: z.ZodJSONSchema;
1452
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1453
+ type: z.ZodLiteral<"tool.output">;
1454
+ toolCallId: z.ZodString;
1455
+ agentName: z.ZodString;
1456
+ toolName: z.ZodString;
1457
+ stream: z.ZodEnum<{
1458
+ stdout: "stdout";
1459
+ stderr: "stderr";
1460
+ }>;
1461
+ delta: z.ZodString;
1462
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1463
+ type: z.ZodLiteral<"tool.completed">;
1464
+ toolCallId: z.ZodString;
1465
+ agentName: z.ZodString;
1466
+ toolName: z.ZodString;
1467
+ operationId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "OperationId">>;
1468
+ outcome: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
1469
+ kind: z.ZodEnum<{
1470
+ success: "success";
1471
+ user_rejected: "user_rejected";
1472
+ policy_denied: "policy_denied";
1473
+ invalid_input: "invalid_input";
1474
+ cancelled: "cancelled";
1475
+ tool_failed: "tool_failed";
1476
+ }>;
1477
+ reason: z.ZodOptional<z.ZodString>;
1478
+ }, z.core.$strict>>>;
1479
+ display: z.ZodJSONSchema;
1480
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1481
+ type: z.ZodLiteral<"approval.required">;
1482
+ approval: z.ZodReadonly<z.ZodObject<{
1483
+ id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
1484
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
1485
+ agentName: z.ZodString;
1486
+ toolName: z.ZodString;
1487
+ preview: z.ZodJSONSchema;
1488
+ reason: z.ZodOptional<z.ZodString>;
1489
+ }, z.core.$strict>>;
1490
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1491
+ type: z.ZodLiteral<"approval.resolved">;
1492
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
1493
+ resolution: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
1494
+ status: z.ZodLiteral<"resolved">;
1495
+ decision: z.ZodLiteral<"approve">;
1496
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1497
+ status: z.ZodLiteral<"resolved">;
1498
+ decision: z.ZodLiteral<"reject">;
1499
+ reason: z.ZodOptional<z.ZodString>;
1500
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1501
+ status: z.ZodLiteral<"cancelled">;
1502
+ reason: z.ZodString;
1503
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1504
+ status: z.ZodLiteral<"expired">;
1505
+ reason: z.ZodOptional<z.ZodString>;
1506
+ }, z.core.$strict>>]>;
1507
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1508
+ type: z.ZodLiteral<"turn.completed">;
1509
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1510
+ type: z.ZodLiteral<"turn.cancelled">;
1511
+ reason: z.ZodString;
1512
+ message: z.ZodString;
1513
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1514
+ type: z.ZodLiteral<"turn.failed">;
1515
+ stage: z.ZodEnum<{
1516
+ bootstrap: "bootstrap";
1517
+ plan: "plan";
1518
+ execute: "execute";
1519
+ }>;
1520
+ message: z.ZodString;
1521
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1522
+ type: z.ZodLiteral<"capabilities.changed">;
1523
+ }, z.core.$strict>>]>;
1524
+ runtimeInstanceId: z.core.$ZodBranded<z.ZodString, "RuntimeInstanceId">;
1525
+ sequence: z.ZodNumber;
1526
+ timestamp: z.ZodString;
1527
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1528
+ turnId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TurnId">>;
1529
+ protocolVersion: z.ZodEnum<{
1530
+ 1.1: "1.1";
1531
+ "1.0": "1.0";
1532
+ }>;
1533
+ }, z.core.$strict>>;
1534
+ }, z.core.$strict>>;
1535
+ export declare const relayAckSchema: z.ZodReadonly<z.ZodObject<{
1536
+ type: z.ZodLiteral<"runtime.ack">;
1537
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
1538
+ throughRelaySequence: z.ZodNumber;
1539
+ }, z.core.$strict>>;
1540
+ export declare const relayGapSchema: z.ZodReadonly<z.ZodObject<{
1541
+ type: z.ZodLiteral<"runtime.gap">;
1542
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
1543
+ fromRelaySequence: z.ZodNumber;
1544
+ throughRelaySequence: z.ZodNumber;
1545
+ recovery: z.ZodLiteral<"thread.snapshot">;
1546
+ }, z.core.$strict>>;
1547
+ /**
1548
+ * This preserves the pre-freeze v1.0 metadata shape. Payload-kind-specific required
1549
+ * fields must be introduced under a later Relay Wire version.
1550
+ */
1551
+ export declare const relayEncryptedMessageSchema: z.ZodReadonly<z.ZodObject<{
1552
+ type: z.ZodLiteral<"runtime.encrypted">;
1553
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
1554
+ envelopeId: z.ZodString;
1555
+ payloadKind: z.ZodEnum<{
1556
+ event: "event";
1557
+ request: "request";
1558
+ response: "response";
1559
+ }>;
1560
+ requestId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "RelayRequestId">>;
1561
+ relaySequence: z.ZodOptional<z.ZodNumber>;
1562
+ algorithm: z.ZodString;
1563
+ nonce: z.ZodString;
1564
+ ciphertext: z.ZodString;
1565
+ }, z.core.$strict>>;
1566
+ export declare const relayDeviceConnectSchemaV10: z.ZodReadonly<z.ZodObject<{
1567
+ type: z.ZodLiteral<"device.connect">;
1568
+ protocolVersion: z.ZodLiteral<"1.0">;
1569
+ deviceId: z.core.$ZodBranded<z.ZodString, "DeviceId">;
1570
+ pairingToken: z.ZodString;
1571
+ }, z.core.$strict>>;
1572
+ export declare const relayRuntimeRequestSchemaV10: z.ZodReadonly<z.ZodObject<{
1573
+ type: z.ZodLiteral<"runtime.request">;
1574
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
1575
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
1576
+ method: z.ZodEnum<{
1577
+ initialize: "initialize";
1578
+ "thread.list": "thread.list";
1579
+ "thread.create": "thread.create";
1580
+ "thread.open": "thread.open";
1581
+ "thread.snapshot": "thread.snapshot";
1582
+ "thread.rename": "thread.rename";
1583
+ "thread.delete": "thread.delete";
1584
+ "thread.detach": "thread.detach";
1585
+ "thread.capabilities": "thread.capabilities";
1586
+ "turn.start": "turn.start";
1587
+ "turn.cancel": "turn.cancel";
1588
+ "approval.respond": "approval.respond";
1589
+ "operation.get": "operation.get";
1590
+ "approval.candidate": "approval.candidate";
1591
+ }>;
1592
+ params: z.ZodJSONSchema;
1593
+ }, z.core.$strict>>;
1594
+ export declare const relayRuntimeResponseSchemaV10: z.ZodReadonly<z.ZodObject<{
1595
+ type: z.ZodLiteral<"runtime.response">;
1596
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
1597
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
1598
+ result: z.ZodOptional<z.ZodJSONSchema>;
1599
+ error: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
1600
+ code: z.ZodString;
1601
+ message: z.ZodString;
1602
+ retryable: z.ZodBoolean;
1603
+ }, z.core.$strict>>>;
1604
+ }, z.core.$strict>>;
1605
+ export declare const relayRuntimeEventSchemaV10: z.ZodReadonly<z.ZodObject<{
1606
+ type: z.ZodLiteral<"runtime.event">;
1607
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
1608
+ relaySequence: z.ZodNumber;
1609
+ event: z.ZodReadonly<z.ZodObject<{
1610
+ event: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
1611
+ type: z.ZodLiteral<"turn.started">;
1612
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1613
+ type: z.ZodLiteral<"message.started">;
1614
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
1615
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1616
+ type: z.ZodLiteral<"message.delta">;
1617
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
1618
+ delta: z.ZodString;
1619
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1620
+ type: z.ZodLiteral<"message.completed">;
1621
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
1622
+ text: z.ZodString;
1623
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1624
+ type: z.ZodLiteral<"reasoning.summary.delta">;
1625
+ reasoningId: z.ZodString;
1626
+ delta: z.ZodString;
1627
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1628
+ type: z.ZodLiteral<"tool.started">;
1629
+ toolCallId: z.ZodString;
1630
+ agentName: z.ZodString;
1631
+ toolName: z.ZodString;
1632
+ input: z.ZodJSONSchema;
1633
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1634
+ type: z.ZodLiteral<"tool.output">;
1635
+ toolCallId: z.ZodString;
1636
+ agentName: z.ZodString;
1637
+ toolName: z.ZodString;
1638
+ stream: z.ZodEnum<{
1639
+ stdout: "stdout";
1640
+ stderr: "stderr";
1641
+ }>;
1642
+ delta: z.ZodString;
1643
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1644
+ type: z.ZodLiteral<"tool.completed">;
1645
+ toolCallId: z.ZodString;
1646
+ agentName: z.ZodString;
1647
+ toolName: z.ZodString;
1648
+ operationId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "OperationId">>;
1649
+ outcome: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
1650
+ kind: z.ZodEnum<{
1651
+ success: "success";
1652
+ user_rejected: "user_rejected";
1653
+ policy_denied: "policy_denied";
1654
+ invalid_input: "invalid_input";
1655
+ cancelled: "cancelled";
1656
+ tool_failed: "tool_failed";
1657
+ }>;
1658
+ reason: z.ZodOptional<z.ZodString>;
1659
+ }, z.core.$strict>>>;
1660
+ display: z.ZodJSONSchema;
1661
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1662
+ type: z.ZodLiteral<"approval.required">;
1663
+ approval: z.ZodReadonly<z.ZodObject<{
1664
+ id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
1665
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
1666
+ agentName: z.ZodString;
1667
+ toolName: z.ZodString;
1668
+ preview: z.ZodJSONSchema;
1669
+ reason: z.ZodOptional<z.ZodString>;
1670
+ }, z.core.$strict>>;
1671
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1672
+ type: z.ZodLiteral<"approval.resolved">;
1673
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
1674
+ resolution: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
1675
+ status: z.ZodLiteral<"resolved">;
1676
+ decision: z.ZodLiteral<"approve">;
1677
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1678
+ status: z.ZodLiteral<"resolved">;
1679
+ decision: z.ZodLiteral<"reject">;
1680
+ reason: z.ZodOptional<z.ZodString>;
1681
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1682
+ status: z.ZodLiteral<"cancelled">;
1683
+ reason: z.ZodString;
1684
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1685
+ status: z.ZodLiteral<"expired">;
1686
+ reason: z.ZodOptional<z.ZodString>;
1687
+ }, z.core.$strict>>]>;
1688
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1689
+ type: z.ZodLiteral<"turn.completed">;
1690
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1691
+ type: z.ZodLiteral<"turn.cancelled">;
1692
+ reason: z.ZodString;
1693
+ message: z.ZodString;
1694
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1695
+ type: z.ZodLiteral<"turn.failed">;
1696
+ stage: z.ZodEnum<{
1697
+ bootstrap: "bootstrap";
1698
+ plan: "plan";
1699
+ execute: "execute";
1700
+ }>;
1701
+ message: z.ZodString;
1702
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1703
+ type: z.ZodLiteral<"capabilities.changed">;
1704
+ }, z.core.$strict>>]>;
1705
+ runtimeInstanceId: z.core.$ZodBranded<z.ZodString, "RuntimeInstanceId">;
1706
+ sequence: z.ZodNumber;
1707
+ timestamp: z.ZodString;
1708
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1709
+ turnId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TurnId">>;
1710
+ protocolVersion: z.ZodEnum<{
1711
+ 1.1: "1.1";
1712
+ "1.0": "1.0";
1713
+ }>;
1714
+ }, z.core.$strict>>;
1715
+ }, z.core.$strict>>;
1716
+ export declare const relayAckSchemaV10: z.ZodReadonly<z.ZodObject<{
1717
+ type: z.ZodLiteral<"runtime.ack">;
1718
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
1719
+ throughRelaySequence: z.ZodNumber;
1720
+ }, z.core.$strict>>;
1721
+ export declare const relayGapSchemaV10: z.ZodReadonly<z.ZodObject<{
1722
+ type: z.ZodLiteral<"runtime.gap">;
1723
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
1724
+ fromRelaySequence: z.ZodNumber;
1725
+ throughRelaySequence: z.ZodNumber;
1726
+ recovery: z.ZodLiteral<"thread.snapshot">;
1727
+ }, z.core.$strict>>;
1728
+ export declare const relayEncryptedMessageSchemaV10: z.ZodReadonly<z.ZodObject<{
1729
+ type: z.ZodLiteral<"runtime.encrypted">;
1730
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
1731
+ envelopeId: z.ZodString;
1732
+ payloadKind: z.ZodEnum<{
1733
+ event: "event";
1734
+ request: "request";
1735
+ response: "response";
1736
+ }>;
1737
+ requestId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "RelayRequestId">>;
1738
+ relaySequence: z.ZodOptional<z.ZodNumber>;
1739
+ algorithm: z.ZodString;
1740
+ nonce: z.ZodString;
1741
+ ciphertext: z.ZodString;
1742
+ }, z.core.$strict>>;
1743
+ export declare const relaySafeToolOutcomeSchemaV11: z.ZodReadonly<z.ZodObject<{
1744
+ kind: z.ZodEnum<{
1745
+ success: "success";
1746
+ user_rejected: "user_rejected";
1747
+ policy_denied: "policy_denied";
1748
+ invalid_input: "invalid_input";
1749
+ cancelled: "cancelled";
1750
+ tool_failed: "tool_failed";
1751
+ }>;
1752
+ }, z.core.$strict>>;
1753
+ export declare const relaySafeApprovalResolutionSchemaV11: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
1754
+ status: z.ZodLiteral<"resolved">;
1755
+ decision: z.ZodEnum<{
1756
+ approve: "approve";
1757
+ reject: "reject";
1758
+ }>;
1759
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1760
+ status: z.ZodLiteral<"cancelled">;
1761
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1762
+ status: z.ZodLiteral<"expired">;
1763
+ }, z.core.$strict>>]>;
1764
+ export declare const relayTimelineEventSchemaV11: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
1765
+ type: z.ZodLiteral<"turn.started">;
1766
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1767
+ type: z.ZodLiteral<"message.started">;
1768
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
1769
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1770
+ type: z.ZodLiteral<"message.delta">;
1771
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
1772
+ delta: z.ZodString;
1773
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1774
+ type: z.ZodLiteral<"message.completed">;
1775
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
1776
+ text: z.ZodString;
1777
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1778
+ type: z.ZodLiteral<"reasoning.summary.delta">;
1779
+ reasoningId: z.ZodString;
1780
+ delta: z.ZodString;
1781
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1782
+ type: z.ZodLiteral<"tool.started">;
1783
+ toolCallId: z.ZodString;
1784
+ agentName: z.ZodString;
1785
+ toolName: z.ZodString;
1786
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1787
+ type: z.ZodLiteral<"tool.completed">;
1788
+ toolCallId: z.ZodString;
1789
+ agentName: z.ZodString;
1790
+ toolName: z.ZodString;
1791
+ outcome: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
1792
+ kind: z.ZodEnum<{
1793
+ success: "success";
1794
+ user_rejected: "user_rejected";
1795
+ policy_denied: "policy_denied";
1796
+ invalid_input: "invalid_input";
1797
+ cancelled: "cancelled";
1798
+ tool_failed: "tool_failed";
1799
+ }>;
1800
+ }, z.core.$strict>>>;
1801
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1802
+ type: z.ZodLiteral<"approval.required">;
1803
+ approval: z.ZodReadonly<z.ZodObject<{
1804
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
1805
+ agentName: z.ZodString;
1806
+ toolName: z.ZodString;
1807
+ explanation: z.ZodOptional<z.ZodString>;
1808
+ }, z.core.$strict>>;
1809
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1810
+ type: z.ZodLiteral<"approval.resolved">;
1811
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
1812
+ resolution: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
1813
+ status: z.ZodLiteral<"resolved">;
1814
+ decision: z.ZodEnum<{
1815
+ approve: "approve";
1816
+ reject: "reject";
1817
+ }>;
1818
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1819
+ status: z.ZodLiteral<"cancelled">;
1820
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1821
+ status: z.ZodLiteral<"expired">;
1822
+ }, z.core.$strict>>]>;
1823
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1824
+ type: z.ZodLiteral<"turn.completed">;
1825
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1826
+ type: z.ZodLiteral<"turn.cancelled">;
1827
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1828
+ type: z.ZodLiteral<"turn.failed">;
1829
+ stage: z.ZodEnum<{
1830
+ bootstrap: "bootstrap";
1831
+ plan: "plan";
1832
+ execute: "execute";
1833
+ }>;
1834
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1835
+ type: z.ZodLiteral<"capabilities.changed">;
1836
+ }, z.core.$strict>>]>;
1837
+ export declare const relayRuntimeEventEnvelopeSchemaV11: z.ZodReadonly<z.ZodObject<{
1838
+ protocolVersion: z.ZodEnum<{
1839
+ 1.1: "1.1";
1840
+ "1.0": "1.0";
1841
+ }>;
1842
+ runtimeInstanceId: z.core.$ZodBranded<z.ZodString, "RuntimeInstanceId">;
1843
+ sequence: z.ZodNumber;
1844
+ timestamp: z.ZodString;
1845
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1846
+ turnId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TurnId">>;
1847
+ event: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
1848
+ type: z.ZodLiteral<"turn.started">;
1849
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1850
+ type: z.ZodLiteral<"message.started">;
1851
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
1852
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1853
+ type: z.ZodLiteral<"message.delta">;
1854
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
1855
+ delta: z.ZodString;
1856
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1857
+ type: z.ZodLiteral<"message.completed">;
1858
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
1859
+ text: z.ZodString;
1860
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1861
+ type: z.ZodLiteral<"reasoning.summary.delta">;
1862
+ reasoningId: z.ZodString;
1863
+ delta: z.ZodString;
1864
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1865
+ type: z.ZodLiteral<"tool.started">;
1866
+ toolCallId: z.ZodString;
1867
+ agentName: z.ZodString;
1868
+ toolName: z.ZodString;
1869
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1870
+ type: z.ZodLiteral<"tool.completed">;
1871
+ toolCallId: z.ZodString;
1872
+ agentName: z.ZodString;
1873
+ toolName: z.ZodString;
1874
+ outcome: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
1875
+ kind: z.ZodEnum<{
1876
+ success: "success";
1877
+ user_rejected: "user_rejected";
1878
+ policy_denied: "policy_denied";
1879
+ invalid_input: "invalid_input";
1880
+ cancelled: "cancelled";
1881
+ tool_failed: "tool_failed";
1882
+ }>;
1883
+ }, z.core.$strict>>>;
1884
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1885
+ type: z.ZodLiteral<"approval.required">;
1886
+ approval: z.ZodReadonly<z.ZodObject<{
1887
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
1888
+ agentName: z.ZodString;
1889
+ toolName: z.ZodString;
1890
+ explanation: z.ZodOptional<z.ZodString>;
1891
+ }, z.core.$strict>>;
1892
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1893
+ type: z.ZodLiteral<"approval.resolved">;
1894
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
1895
+ resolution: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
1896
+ status: z.ZodLiteral<"resolved">;
1897
+ decision: z.ZodEnum<{
1898
+ approve: "approve";
1899
+ reject: "reject";
1900
+ }>;
1901
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1902
+ status: z.ZodLiteral<"cancelled">;
1903
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1904
+ status: z.ZodLiteral<"expired">;
1905
+ }, z.core.$strict>>]>;
1906
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1907
+ type: z.ZodLiteral<"turn.completed">;
1908
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1909
+ type: z.ZodLiteral<"turn.cancelled">;
1910
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1911
+ type: z.ZodLiteral<"turn.failed">;
1912
+ stage: z.ZodEnum<{
1913
+ bootstrap: "bootstrap";
1914
+ plan: "plan";
1915
+ execute: "execute";
1916
+ }>;
1917
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1918
+ type: z.ZodLiteral<"capabilities.changed">;
1919
+ }, z.core.$strict>>]>;
1920
+ }, z.core.$strict>>;
1921
+ export declare function projectRuntimeEventEnvelopeForRelayV11(value: unknown): z.output<typeof relayRuntimeEventEnvelopeSchemaV11> | undefined;
1922
+ /** Projects a Runtime snapshot into the allowlisted Relay Wire 1.1 query shape. */
1923
+ export declare function projectRelayThreadSnapshotV11(value: unknown): ThreadSnapshotV11;
1924
+ /** Projects an operation query result without local display or outcome details. */
1925
+ export declare function projectRelayOperationGetResultV11(value: unknown): z.output<typeof operationGetResultSchema>;
1926
+ export declare const relayApprovalInteractionRequestSchemaV11: z.ZodReadonly<z.ZodObject<{
1927
+ method: z.ZodLiteral<"approval.request">;
1928
+ projection: z.ZodReadonly<z.ZodObject<{
1929
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
1930
+ agentName: z.ZodString;
1931
+ toolName: z.ZodString;
1932
+ explanation: z.ZodOptional<z.ZodString>;
1933
+ }, z.core.$strict>>;
1934
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
1935
+ relaySequence: z.ZodNumber;
1936
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
1937
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1938
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
1939
+ expiresAt: z.ZodString;
1940
+ sensitivity: z.ZodLiteral<"normal">;
1941
+ type: z.ZodLiteral<"interaction.request">;
1942
+ }, z.core.$strict>>;
1943
+ export declare const relayUserInputInteractionRequestSchemaV11: z.ZodReadonly<z.ZodObject<{
1944
+ method: z.ZodLiteral<"userInput.request">;
1945
+ projection: z.ZodReadonly<z.ZodObject<{
1946
+ title: z.ZodOptional<z.ZodString>;
1947
+ description: z.ZodOptional<z.ZodString>;
1948
+ controls: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
1949
+ minLength: z.ZodOptional<z.ZodNumber>;
1950
+ maxLength: z.ZodOptional<z.ZodNumber>;
1951
+ id: z.ZodString;
1952
+ label: z.ZodString;
1953
+ description: z.ZodOptional<z.ZodString>;
1954
+ required: z.ZodBoolean;
1955
+ type: z.ZodLiteral<"text">;
1956
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1957
+ minLength: z.ZodOptional<z.ZodNumber>;
1958
+ maxLength: z.ZodOptional<z.ZodNumber>;
1959
+ id: z.ZodString;
1960
+ label: z.ZodString;
1961
+ description: z.ZodOptional<z.ZodString>;
1962
+ required: z.ZodBoolean;
1963
+ type: z.ZodLiteral<"multiline">;
1964
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1965
+ min: z.ZodOptional<z.ZodNumber>;
1966
+ max: z.ZodOptional<z.ZodNumber>;
1967
+ integer: z.ZodOptional<z.ZodBoolean>;
1968
+ id: z.ZodString;
1969
+ label: z.ZodString;
1970
+ description: z.ZodOptional<z.ZodString>;
1971
+ required: z.ZodBoolean;
1972
+ type: z.ZodLiteral<"number">;
1973
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1974
+ id: z.ZodString;
1975
+ label: z.ZodString;
1976
+ description: z.ZodOptional<z.ZodString>;
1977
+ required: z.ZodBoolean;
1978
+ type: z.ZodLiteral<"boolean">;
1979
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1980
+ multiple: z.ZodBoolean;
1981
+ options: z.ZodArray<z.ZodReadonly<z.ZodObject<{
1982
+ id: z.ZodString;
1983
+ label: z.ZodString;
1984
+ description: z.ZodOptional<z.ZodString>;
1985
+ }, z.core.$strict>>>;
1986
+ minSelections: z.ZodOptional<z.ZodNumber>;
1987
+ maxSelections: z.ZodOptional<z.ZodNumber>;
1988
+ id: z.ZodString;
1989
+ label: z.ZodString;
1990
+ description: z.ZodOptional<z.ZodString>;
1991
+ required: z.ZodBoolean;
1992
+ type: z.ZodLiteral<"choice">;
1993
+ }, z.core.$strict>>]>>;
1994
+ }, z.core.$strict>>;
1995
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
1996
+ relaySequence: z.ZodNumber;
1997
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
1998
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
1999
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
2000
+ expiresAt: z.ZodString;
2001
+ sensitivity: z.ZodLiteral<"normal">;
2002
+ type: z.ZodLiteral<"interaction.request">;
2003
+ }, z.core.$strict>>;
2004
+ export declare const relayInteractionRequestSchemaV11: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
2005
+ method: z.ZodLiteral<"approval.request">;
2006
+ projection: z.ZodReadonly<z.ZodObject<{
2007
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
2008
+ agentName: z.ZodString;
2009
+ toolName: z.ZodString;
2010
+ explanation: z.ZodOptional<z.ZodString>;
2011
+ }, z.core.$strict>>;
2012
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2013
+ relaySequence: z.ZodNumber;
2014
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
2015
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
2016
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
2017
+ expiresAt: z.ZodString;
2018
+ sensitivity: z.ZodLiteral<"normal">;
2019
+ type: z.ZodLiteral<"interaction.request">;
2020
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2021
+ method: z.ZodLiteral<"userInput.request">;
2022
+ projection: z.ZodReadonly<z.ZodObject<{
2023
+ title: z.ZodOptional<z.ZodString>;
2024
+ description: z.ZodOptional<z.ZodString>;
2025
+ controls: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
2026
+ minLength: z.ZodOptional<z.ZodNumber>;
2027
+ maxLength: z.ZodOptional<z.ZodNumber>;
2028
+ id: z.ZodString;
2029
+ label: z.ZodString;
2030
+ description: z.ZodOptional<z.ZodString>;
2031
+ required: z.ZodBoolean;
2032
+ type: z.ZodLiteral<"text">;
2033
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2034
+ minLength: z.ZodOptional<z.ZodNumber>;
2035
+ maxLength: z.ZodOptional<z.ZodNumber>;
2036
+ id: z.ZodString;
2037
+ label: z.ZodString;
2038
+ description: z.ZodOptional<z.ZodString>;
2039
+ required: z.ZodBoolean;
2040
+ type: z.ZodLiteral<"multiline">;
2041
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2042
+ min: z.ZodOptional<z.ZodNumber>;
2043
+ max: z.ZodOptional<z.ZodNumber>;
2044
+ integer: z.ZodOptional<z.ZodBoolean>;
2045
+ id: z.ZodString;
2046
+ label: z.ZodString;
2047
+ description: z.ZodOptional<z.ZodString>;
2048
+ required: z.ZodBoolean;
2049
+ type: z.ZodLiteral<"number">;
2050
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2051
+ id: z.ZodString;
2052
+ label: z.ZodString;
2053
+ description: z.ZodOptional<z.ZodString>;
2054
+ required: z.ZodBoolean;
2055
+ type: z.ZodLiteral<"boolean">;
2056
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2057
+ multiple: z.ZodBoolean;
2058
+ options: z.ZodArray<z.ZodReadonly<z.ZodObject<{
2059
+ id: z.ZodString;
2060
+ label: z.ZodString;
2061
+ description: z.ZodOptional<z.ZodString>;
2062
+ }, z.core.$strict>>>;
2063
+ minSelections: z.ZodOptional<z.ZodNumber>;
2064
+ maxSelections: z.ZodOptional<z.ZodNumber>;
2065
+ id: z.ZodString;
2066
+ label: z.ZodString;
2067
+ description: z.ZodOptional<z.ZodString>;
2068
+ required: z.ZodBoolean;
2069
+ type: z.ZodLiteral<"choice">;
2070
+ }, z.core.$strict>>]>>;
2071
+ }, z.core.$strict>>;
2072
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2073
+ relaySequence: z.ZodNumber;
2074
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
2075
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
2076
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
2077
+ expiresAt: z.ZodString;
2078
+ sensitivity: z.ZodLiteral<"normal">;
2079
+ type: z.ZodLiteral<"interaction.request">;
2080
+ }, z.core.$strict>>]>;
2081
+ export declare const relayInteractionResolvedSchemaV11: z.ZodReadonly<z.ZodObject<{
2082
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2083
+ relaySequence: z.ZodNumber;
2084
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
2085
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
2086
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
2087
+ method: z.ZodEnum<{
2088
+ "approval.request": "approval.request";
2089
+ "userInput.request": "userInput.request";
2090
+ }>;
2091
+ type: z.ZodLiteral<"interaction.resolved">;
2092
+ }, z.core.$strict>>;
2093
+ export declare const relayInteractionCancelledSchemaV11: z.ZodReadonly<z.ZodObject<{
2094
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2095
+ relaySequence: z.ZodNumber;
2096
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
2097
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
2098
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
2099
+ method: z.ZodEnum<{
2100
+ "approval.request": "approval.request";
2101
+ "userInput.request": "userInput.request";
2102
+ }>;
2103
+ type: z.ZodLiteral<"interaction.cancelled">;
2104
+ }, z.core.$strict>>;
2105
+ export declare const relayDeviceConnectSchemaV11: z.ZodReadonly<z.ZodObject<{
2106
+ type: z.ZodLiteral<"device.connect">;
2107
+ protocolVersion: z.ZodLiteral<"1.1">;
2108
+ deviceId: z.core.$ZodBranded<z.ZodString, "DeviceId">;
2109
+ pairingToken: z.ZodString;
2110
+ }, z.core.$strict>>;
2111
+ export declare const relayRuntimeRequestSchemaV11: z.ZodReadonly<z.ZodObject<{
2112
+ type: z.ZodLiteral<"runtime.request">;
2113
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
2114
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2115
+ method: z.ZodEnum<{
2116
+ initialize: "initialize";
2117
+ "thread.list": "thread.list";
2118
+ "thread.create": "thread.create";
2119
+ "thread.open": "thread.open";
2120
+ "thread.snapshot": "thread.snapshot";
2121
+ "thread.rename": "thread.rename";
2122
+ "thread.delete": "thread.delete";
2123
+ "thread.detach": "thread.detach";
2124
+ "thread.capabilities": "thread.capabilities";
2125
+ "turn.start": "turn.start";
2126
+ "turn.cancel": "turn.cancel";
2127
+ "operation.get": "operation.get";
2128
+ "interaction.candidate": "interaction.candidate";
2129
+ }>;
2130
+ params: z.ZodJSONSchema;
2131
+ }, z.core.$strict>>;
2132
+ export declare const relayRuntimeResponseSchemaV11: z.ZodReadonly<z.ZodObject<{
2133
+ type: z.ZodLiteral<"runtime.response">;
2134
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
2135
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2136
+ result: z.ZodOptional<z.ZodJSONSchema>;
2137
+ error: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
2138
+ code: z.ZodString;
2139
+ message: z.ZodString;
2140
+ retryable: z.ZodBoolean;
2141
+ }, z.core.$strict>>>;
2142
+ }, z.core.$strict>>;
2143
+ export declare const relayRuntimeEventSchemaV11: z.ZodReadonly<z.ZodObject<{
2144
+ type: z.ZodLiteral<"runtime.event">;
2145
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2146
+ relaySequence: z.ZodNumber;
2147
+ event: z.ZodReadonly<z.ZodObject<{
2148
+ protocolVersion: z.ZodEnum<{
2149
+ 1.1: "1.1";
2150
+ "1.0": "1.0";
2151
+ }>;
2152
+ runtimeInstanceId: z.core.$ZodBranded<z.ZodString, "RuntimeInstanceId">;
2153
+ sequence: z.ZodNumber;
2154
+ timestamp: z.ZodString;
2155
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
2156
+ turnId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TurnId">>;
2157
+ event: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
2158
+ type: z.ZodLiteral<"turn.started">;
2159
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2160
+ type: z.ZodLiteral<"message.started">;
2161
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
2162
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2163
+ type: z.ZodLiteral<"message.delta">;
2164
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
2165
+ delta: z.ZodString;
2166
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2167
+ type: z.ZodLiteral<"message.completed">;
2168
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
2169
+ text: z.ZodString;
2170
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2171
+ type: z.ZodLiteral<"reasoning.summary.delta">;
2172
+ reasoningId: z.ZodString;
2173
+ delta: z.ZodString;
2174
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2175
+ type: z.ZodLiteral<"tool.started">;
2176
+ toolCallId: z.ZodString;
2177
+ agentName: z.ZodString;
2178
+ toolName: z.ZodString;
2179
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2180
+ type: z.ZodLiteral<"tool.completed">;
2181
+ toolCallId: z.ZodString;
2182
+ agentName: z.ZodString;
2183
+ toolName: z.ZodString;
2184
+ outcome: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
2185
+ kind: z.ZodEnum<{
2186
+ success: "success";
2187
+ user_rejected: "user_rejected";
2188
+ policy_denied: "policy_denied";
2189
+ invalid_input: "invalid_input";
2190
+ cancelled: "cancelled";
2191
+ tool_failed: "tool_failed";
2192
+ }>;
2193
+ }, z.core.$strict>>>;
2194
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2195
+ type: z.ZodLiteral<"approval.required">;
2196
+ approval: z.ZodReadonly<z.ZodObject<{
2197
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
2198
+ agentName: z.ZodString;
2199
+ toolName: z.ZodString;
2200
+ explanation: z.ZodOptional<z.ZodString>;
2201
+ }, z.core.$strict>>;
2202
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2203
+ type: z.ZodLiteral<"approval.resolved">;
2204
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
2205
+ resolution: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
2206
+ status: z.ZodLiteral<"resolved">;
2207
+ decision: z.ZodEnum<{
2208
+ approve: "approve";
2209
+ reject: "reject";
2210
+ }>;
2211
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2212
+ status: z.ZodLiteral<"cancelled">;
2213
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2214
+ status: z.ZodLiteral<"expired">;
2215
+ }, z.core.$strict>>]>;
2216
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2217
+ type: z.ZodLiteral<"turn.completed">;
2218
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2219
+ type: z.ZodLiteral<"turn.cancelled">;
2220
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2221
+ type: z.ZodLiteral<"turn.failed">;
2222
+ stage: z.ZodEnum<{
2223
+ bootstrap: "bootstrap";
2224
+ plan: "plan";
2225
+ execute: "execute";
2226
+ }>;
2227
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2228
+ type: z.ZodLiteral<"capabilities.changed">;
2229
+ }, z.core.$strict>>]>;
2230
+ }, z.core.$strict>>;
2231
+ }, z.core.$strict>>;
2232
+ export declare const relayAckSchemaV11: z.ZodReadonly<z.ZodObject<{
2233
+ type: z.ZodLiteral<"runtime.ack">;
2234
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2235
+ throughRelaySequence: z.ZodNumber;
2236
+ }, z.core.$strict>>;
2237
+ export declare const relayGapSchemaV11: z.ZodReadonly<z.ZodObject<{
2238
+ type: z.ZodLiteral<"runtime.gap">;
2239
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2240
+ fromRelaySequence: z.ZodNumber;
2241
+ throughRelaySequence: z.ZodNumber;
2242
+ recovery: z.ZodLiteral<"thread.snapshot">;
2243
+ }, z.core.$strict>>;
2244
+ export declare const relayEncryptedMessageSchemaV11: z.ZodReadonly<z.ZodObject<{
2245
+ type: z.ZodLiteral<"runtime.encrypted">;
2246
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2247
+ envelopeId: z.ZodString;
2248
+ payloadKind: z.ZodEnum<{
2249
+ event: "event";
2250
+ request: "request";
2251
+ response: "response";
2252
+ interaction: "interaction";
2253
+ }>;
2254
+ requestId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "RelayRequestId">>;
2255
+ relaySequence: z.ZodOptional<z.ZodNumber>;
2256
+ algorithm: z.ZodString;
2257
+ nonce: z.ZodString;
2258
+ ciphertext: z.ZodString;
2259
+ }, z.core.$strict>>;
2260
+ export declare const relayMessageSchemasV10: {
2261
+ readonly "device.connect": z.ZodReadonly<z.ZodObject<{
2262
+ type: z.ZodLiteral<"device.connect">;
2263
+ protocolVersion: z.ZodLiteral<"1.0">;
2264
+ deviceId: z.core.$ZodBranded<z.ZodString, "DeviceId">;
2265
+ pairingToken: z.ZodString;
2266
+ }, z.core.$strict>>;
2267
+ readonly "runtime.request": z.ZodReadonly<z.ZodObject<{
2268
+ type: z.ZodLiteral<"runtime.request">;
2269
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
2270
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2271
+ method: z.ZodEnum<{
2272
+ initialize: "initialize";
2273
+ "thread.list": "thread.list";
2274
+ "thread.create": "thread.create";
2275
+ "thread.open": "thread.open";
2276
+ "thread.snapshot": "thread.snapshot";
2277
+ "thread.rename": "thread.rename";
2278
+ "thread.delete": "thread.delete";
2279
+ "thread.detach": "thread.detach";
2280
+ "thread.capabilities": "thread.capabilities";
2281
+ "turn.start": "turn.start";
2282
+ "turn.cancel": "turn.cancel";
2283
+ "approval.respond": "approval.respond";
2284
+ "operation.get": "operation.get";
2285
+ "approval.candidate": "approval.candidate";
2286
+ }>;
2287
+ params: z.ZodJSONSchema;
2288
+ }, z.core.$strict>>;
2289
+ readonly "runtime.response": z.ZodReadonly<z.ZodObject<{
2290
+ type: z.ZodLiteral<"runtime.response">;
2291
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
2292
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2293
+ result: z.ZodOptional<z.ZodJSONSchema>;
2294
+ error: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
2295
+ code: z.ZodString;
2296
+ message: z.ZodString;
2297
+ retryable: z.ZodBoolean;
2298
+ }, z.core.$strict>>>;
2299
+ }, z.core.$strict>>;
2300
+ readonly "runtime.event": z.ZodReadonly<z.ZodObject<{
2301
+ type: z.ZodLiteral<"runtime.event">;
2302
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2303
+ relaySequence: z.ZodNumber;
2304
+ event: z.ZodReadonly<z.ZodObject<{
2305
+ event: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
2306
+ type: z.ZodLiteral<"turn.started">;
2307
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2308
+ type: z.ZodLiteral<"message.started">;
2309
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
2310
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2311
+ type: z.ZodLiteral<"message.delta">;
2312
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
2313
+ delta: z.ZodString;
2314
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2315
+ type: z.ZodLiteral<"message.completed">;
2316
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
2317
+ text: z.ZodString;
2318
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2319
+ type: z.ZodLiteral<"reasoning.summary.delta">;
2320
+ reasoningId: z.ZodString;
2321
+ delta: z.ZodString;
2322
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2323
+ type: z.ZodLiteral<"tool.started">;
2324
+ toolCallId: z.ZodString;
2325
+ agentName: z.ZodString;
2326
+ toolName: z.ZodString;
2327
+ input: z.ZodJSONSchema;
2328
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2329
+ type: z.ZodLiteral<"tool.output">;
2330
+ toolCallId: z.ZodString;
2331
+ agentName: z.ZodString;
2332
+ toolName: z.ZodString;
2333
+ stream: z.ZodEnum<{
2334
+ stdout: "stdout";
2335
+ stderr: "stderr";
2336
+ }>;
2337
+ delta: z.ZodString;
2338
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2339
+ type: z.ZodLiteral<"tool.completed">;
2340
+ toolCallId: z.ZodString;
2341
+ agentName: z.ZodString;
2342
+ toolName: z.ZodString;
2343
+ operationId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "OperationId">>;
2344
+ outcome: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
2345
+ kind: z.ZodEnum<{
2346
+ success: "success";
2347
+ user_rejected: "user_rejected";
2348
+ policy_denied: "policy_denied";
2349
+ invalid_input: "invalid_input";
2350
+ cancelled: "cancelled";
2351
+ tool_failed: "tool_failed";
2352
+ }>;
2353
+ reason: z.ZodOptional<z.ZodString>;
2354
+ }, z.core.$strict>>>;
2355
+ display: z.ZodJSONSchema;
2356
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2357
+ type: z.ZodLiteral<"approval.required">;
2358
+ approval: z.ZodReadonly<z.ZodObject<{
2359
+ id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
2360
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
2361
+ agentName: z.ZodString;
2362
+ toolName: z.ZodString;
2363
+ preview: z.ZodJSONSchema;
2364
+ reason: z.ZodOptional<z.ZodString>;
2365
+ }, z.core.$strict>>;
2366
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2367
+ type: z.ZodLiteral<"approval.resolved">;
2368
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
2369
+ resolution: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
2370
+ status: z.ZodLiteral<"resolved">;
2371
+ decision: z.ZodLiteral<"approve">;
2372
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2373
+ status: z.ZodLiteral<"resolved">;
2374
+ decision: z.ZodLiteral<"reject">;
2375
+ reason: z.ZodOptional<z.ZodString>;
2376
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2377
+ status: z.ZodLiteral<"cancelled">;
2378
+ reason: z.ZodString;
2379
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2380
+ status: z.ZodLiteral<"expired">;
2381
+ reason: z.ZodOptional<z.ZodString>;
2382
+ }, z.core.$strict>>]>;
2383
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2384
+ type: z.ZodLiteral<"turn.completed">;
2385
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2386
+ type: z.ZodLiteral<"turn.cancelled">;
2387
+ reason: z.ZodString;
2388
+ message: z.ZodString;
2389
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2390
+ type: z.ZodLiteral<"turn.failed">;
2391
+ stage: z.ZodEnum<{
2392
+ bootstrap: "bootstrap";
2393
+ plan: "plan";
2394
+ execute: "execute";
2395
+ }>;
2396
+ message: z.ZodString;
2397
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2398
+ type: z.ZodLiteral<"capabilities.changed">;
2399
+ }, z.core.$strict>>]>;
2400
+ runtimeInstanceId: z.core.$ZodBranded<z.ZodString, "RuntimeInstanceId">;
2401
+ sequence: z.ZodNumber;
2402
+ timestamp: z.ZodString;
2403
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
2404
+ turnId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TurnId">>;
2405
+ protocolVersion: z.ZodEnum<{
2406
+ 1.1: "1.1";
2407
+ "1.0": "1.0";
2408
+ }>;
2409
+ }, z.core.$strict>>;
2410
+ }, z.core.$strict>>;
2411
+ readonly "runtime.ack": z.ZodReadonly<z.ZodObject<{
2412
+ type: z.ZodLiteral<"runtime.ack">;
2413
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2414
+ throughRelaySequence: z.ZodNumber;
2415
+ }, z.core.$strict>>;
2416
+ readonly "runtime.gap": z.ZodReadonly<z.ZodObject<{
2417
+ type: z.ZodLiteral<"runtime.gap">;
2418
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2419
+ fromRelaySequence: z.ZodNumber;
2420
+ throughRelaySequence: z.ZodNumber;
2421
+ recovery: z.ZodLiteral<"thread.snapshot">;
2422
+ }, z.core.$strict>>;
2423
+ readonly "runtime.encrypted": z.ZodReadonly<z.ZodObject<{
2424
+ type: z.ZodLiteral<"runtime.encrypted">;
2425
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2426
+ envelopeId: z.ZodString;
2427
+ payloadKind: z.ZodEnum<{
2428
+ event: "event";
2429
+ request: "request";
2430
+ response: "response";
2431
+ }>;
2432
+ requestId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "RelayRequestId">>;
2433
+ relaySequence: z.ZodOptional<z.ZodNumber>;
2434
+ algorithm: z.ZodString;
2435
+ nonce: z.ZodString;
2436
+ ciphertext: z.ZodString;
2437
+ }, z.core.$strict>>;
2438
+ };
2439
+ export declare const relayMessageSchemaV10: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
2440
+ type: z.ZodLiteral<"device.connect">;
2441
+ protocolVersion: z.ZodLiteral<"1.0">;
2442
+ deviceId: z.core.$ZodBranded<z.ZodString, "DeviceId">;
2443
+ pairingToken: z.ZodString;
2444
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2445
+ type: z.ZodLiteral<"runtime.request">;
2446
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
2447
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2448
+ method: z.ZodEnum<{
2449
+ initialize: "initialize";
2450
+ "thread.list": "thread.list";
2451
+ "thread.create": "thread.create";
2452
+ "thread.open": "thread.open";
2453
+ "thread.snapshot": "thread.snapshot";
2454
+ "thread.rename": "thread.rename";
2455
+ "thread.delete": "thread.delete";
2456
+ "thread.detach": "thread.detach";
2457
+ "thread.capabilities": "thread.capabilities";
2458
+ "turn.start": "turn.start";
2459
+ "turn.cancel": "turn.cancel";
2460
+ "approval.respond": "approval.respond";
2461
+ "operation.get": "operation.get";
2462
+ "approval.candidate": "approval.candidate";
2463
+ }>;
2464
+ params: z.ZodJSONSchema;
2465
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2466
+ type: z.ZodLiteral<"runtime.response">;
2467
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
2468
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2469
+ result: z.ZodOptional<z.ZodJSONSchema>;
2470
+ error: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
2471
+ code: z.ZodString;
2472
+ message: z.ZodString;
2473
+ retryable: z.ZodBoolean;
2474
+ }, z.core.$strict>>>;
2475
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2476
+ type: z.ZodLiteral<"runtime.event">;
2477
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2478
+ relaySequence: z.ZodNumber;
2479
+ event: z.ZodReadonly<z.ZodObject<{
2480
+ event: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
2481
+ type: z.ZodLiteral<"turn.started">;
2482
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2483
+ type: z.ZodLiteral<"message.started">;
2484
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
2485
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2486
+ type: z.ZodLiteral<"message.delta">;
2487
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
2488
+ delta: z.ZodString;
2489
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2490
+ type: z.ZodLiteral<"message.completed">;
2491
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
2492
+ text: z.ZodString;
2493
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2494
+ type: z.ZodLiteral<"reasoning.summary.delta">;
2495
+ reasoningId: z.ZodString;
2496
+ delta: z.ZodString;
2497
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2498
+ type: z.ZodLiteral<"tool.started">;
2499
+ toolCallId: z.ZodString;
2500
+ agentName: z.ZodString;
2501
+ toolName: z.ZodString;
2502
+ input: z.ZodJSONSchema;
2503
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2504
+ type: z.ZodLiteral<"tool.output">;
2505
+ toolCallId: z.ZodString;
2506
+ agentName: z.ZodString;
2507
+ toolName: z.ZodString;
2508
+ stream: z.ZodEnum<{
2509
+ stdout: "stdout";
2510
+ stderr: "stderr";
2511
+ }>;
2512
+ delta: z.ZodString;
2513
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2514
+ type: z.ZodLiteral<"tool.completed">;
2515
+ toolCallId: z.ZodString;
2516
+ agentName: z.ZodString;
2517
+ toolName: z.ZodString;
2518
+ operationId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "OperationId">>;
2519
+ outcome: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
2520
+ kind: z.ZodEnum<{
2521
+ success: "success";
2522
+ user_rejected: "user_rejected";
2523
+ policy_denied: "policy_denied";
2524
+ invalid_input: "invalid_input";
2525
+ cancelled: "cancelled";
2526
+ tool_failed: "tool_failed";
2527
+ }>;
2528
+ reason: z.ZodOptional<z.ZodString>;
2529
+ }, z.core.$strict>>>;
2530
+ display: z.ZodJSONSchema;
2531
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2532
+ type: z.ZodLiteral<"approval.required">;
2533
+ approval: z.ZodReadonly<z.ZodObject<{
2534
+ id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
2535
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
2536
+ agentName: z.ZodString;
2537
+ toolName: z.ZodString;
2538
+ preview: z.ZodJSONSchema;
2539
+ reason: z.ZodOptional<z.ZodString>;
2540
+ }, z.core.$strict>>;
2541
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2542
+ type: z.ZodLiteral<"approval.resolved">;
2543
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
2544
+ resolution: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
2545
+ status: z.ZodLiteral<"resolved">;
2546
+ decision: z.ZodLiteral<"approve">;
2547
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2548
+ status: z.ZodLiteral<"resolved">;
2549
+ decision: z.ZodLiteral<"reject">;
2550
+ reason: z.ZodOptional<z.ZodString>;
2551
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2552
+ status: z.ZodLiteral<"cancelled">;
2553
+ reason: z.ZodString;
2554
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2555
+ status: z.ZodLiteral<"expired">;
2556
+ reason: z.ZodOptional<z.ZodString>;
2557
+ }, z.core.$strict>>]>;
2558
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2559
+ type: z.ZodLiteral<"turn.completed">;
2560
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2561
+ type: z.ZodLiteral<"turn.cancelled">;
2562
+ reason: z.ZodString;
2563
+ message: z.ZodString;
2564
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2565
+ type: z.ZodLiteral<"turn.failed">;
2566
+ stage: z.ZodEnum<{
2567
+ bootstrap: "bootstrap";
2568
+ plan: "plan";
2569
+ execute: "execute";
2570
+ }>;
2571
+ message: z.ZodString;
2572
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2573
+ type: z.ZodLiteral<"capabilities.changed">;
2574
+ }, z.core.$strict>>]>;
2575
+ runtimeInstanceId: z.core.$ZodBranded<z.ZodString, "RuntimeInstanceId">;
2576
+ sequence: z.ZodNumber;
2577
+ timestamp: z.ZodString;
2578
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
2579
+ turnId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TurnId">>;
2580
+ protocolVersion: z.ZodEnum<{
2581
+ 1.1: "1.1";
2582
+ "1.0": "1.0";
2583
+ }>;
2584
+ }, z.core.$strict>>;
2585
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2586
+ type: z.ZodLiteral<"runtime.ack">;
2587
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2588
+ throughRelaySequence: z.ZodNumber;
2589
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2590
+ type: z.ZodLiteral<"runtime.gap">;
2591
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2592
+ fromRelaySequence: z.ZodNumber;
2593
+ throughRelaySequence: z.ZodNumber;
2594
+ recovery: z.ZodLiteral<"thread.snapshot">;
2595
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2596
+ type: z.ZodLiteral<"runtime.encrypted">;
2597
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2598
+ envelopeId: z.ZodString;
2599
+ payloadKind: z.ZodEnum<{
2600
+ event: "event";
2601
+ request: "request";
2602
+ response: "response";
2603
+ }>;
2604
+ requestId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "RelayRequestId">>;
2605
+ relaySequence: z.ZodOptional<z.ZodNumber>;
2606
+ algorithm: z.ZodString;
2607
+ nonce: z.ZodString;
2608
+ ciphertext: z.ZodString;
2609
+ }, z.core.$strict>>]>;
2610
+ /** @deprecated Legacy generic Relay exports remain pinned to Wire 1.0. */
2611
+ export declare const relayMessageSchemas: {
2612
+ readonly "device.connect": z.ZodReadonly<z.ZodObject<{
2613
+ type: z.ZodLiteral<"device.connect">;
2614
+ protocolVersion: z.ZodLiteral<"1.0">;
2615
+ deviceId: z.core.$ZodBranded<z.ZodString, "DeviceId">;
2616
+ pairingToken: z.ZodString;
2617
+ }, z.core.$strict>>;
2618
+ readonly "runtime.request": z.ZodReadonly<z.ZodObject<{
2619
+ type: z.ZodLiteral<"runtime.request">;
2620
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
2621
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2622
+ method: z.ZodEnum<{
2623
+ initialize: "initialize";
2624
+ "thread.list": "thread.list";
2625
+ "thread.create": "thread.create";
2626
+ "thread.open": "thread.open";
2627
+ "thread.snapshot": "thread.snapshot";
2628
+ "thread.rename": "thread.rename";
2629
+ "thread.delete": "thread.delete";
2630
+ "thread.detach": "thread.detach";
2631
+ "thread.capabilities": "thread.capabilities";
2632
+ "turn.start": "turn.start";
2633
+ "turn.cancel": "turn.cancel";
2634
+ "approval.respond": "approval.respond";
2635
+ "operation.get": "operation.get";
2636
+ "approval.candidate": "approval.candidate";
2637
+ }>;
2638
+ params: z.ZodJSONSchema;
2639
+ }, z.core.$strict>>;
2640
+ readonly "runtime.response": z.ZodReadonly<z.ZodObject<{
2641
+ type: z.ZodLiteral<"runtime.response">;
2642
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
2643
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2644
+ result: z.ZodOptional<z.ZodJSONSchema>;
2645
+ error: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
2646
+ code: z.ZodString;
2647
+ message: z.ZodString;
2648
+ retryable: z.ZodBoolean;
2649
+ }, z.core.$strict>>>;
2650
+ }, z.core.$strict>>;
2651
+ readonly "runtime.event": z.ZodReadonly<z.ZodObject<{
2652
+ type: z.ZodLiteral<"runtime.event">;
2653
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2654
+ relaySequence: z.ZodNumber;
2655
+ event: z.ZodReadonly<z.ZodObject<{
2656
+ event: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
2657
+ type: z.ZodLiteral<"turn.started">;
2658
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2659
+ type: z.ZodLiteral<"message.started">;
2660
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
2661
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2662
+ type: z.ZodLiteral<"message.delta">;
2663
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
2664
+ delta: z.ZodString;
2665
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2666
+ type: z.ZodLiteral<"message.completed">;
2667
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
2668
+ text: z.ZodString;
2669
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2670
+ type: z.ZodLiteral<"reasoning.summary.delta">;
2671
+ reasoningId: z.ZodString;
2672
+ delta: z.ZodString;
2673
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2674
+ type: z.ZodLiteral<"tool.started">;
2675
+ toolCallId: z.ZodString;
2676
+ agentName: z.ZodString;
2677
+ toolName: z.ZodString;
2678
+ input: z.ZodJSONSchema;
2679
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2680
+ type: z.ZodLiteral<"tool.output">;
2681
+ toolCallId: z.ZodString;
2682
+ agentName: z.ZodString;
2683
+ toolName: z.ZodString;
2684
+ stream: z.ZodEnum<{
2685
+ stdout: "stdout";
2686
+ stderr: "stderr";
2687
+ }>;
2688
+ delta: z.ZodString;
2689
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2690
+ type: z.ZodLiteral<"tool.completed">;
2691
+ toolCallId: z.ZodString;
2692
+ agentName: z.ZodString;
2693
+ toolName: z.ZodString;
2694
+ operationId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "OperationId">>;
2695
+ outcome: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
2696
+ kind: z.ZodEnum<{
2697
+ success: "success";
2698
+ user_rejected: "user_rejected";
2699
+ policy_denied: "policy_denied";
2700
+ invalid_input: "invalid_input";
2701
+ cancelled: "cancelled";
2702
+ tool_failed: "tool_failed";
2703
+ }>;
2704
+ reason: z.ZodOptional<z.ZodString>;
2705
+ }, z.core.$strict>>>;
2706
+ display: z.ZodJSONSchema;
2707
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2708
+ type: z.ZodLiteral<"approval.required">;
2709
+ approval: z.ZodReadonly<z.ZodObject<{
2710
+ id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
2711
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
2712
+ agentName: z.ZodString;
2713
+ toolName: z.ZodString;
2714
+ preview: z.ZodJSONSchema;
2715
+ reason: z.ZodOptional<z.ZodString>;
2716
+ }, z.core.$strict>>;
2717
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2718
+ type: z.ZodLiteral<"approval.resolved">;
2719
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
2720
+ resolution: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
2721
+ status: z.ZodLiteral<"resolved">;
2722
+ decision: z.ZodLiteral<"approve">;
2723
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2724
+ status: z.ZodLiteral<"resolved">;
2725
+ decision: z.ZodLiteral<"reject">;
2726
+ reason: z.ZodOptional<z.ZodString>;
2727
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2728
+ status: z.ZodLiteral<"cancelled">;
2729
+ reason: z.ZodString;
2730
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2731
+ status: z.ZodLiteral<"expired">;
2732
+ reason: z.ZodOptional<z.ZodString>;
2733
+ }, z.core.$strict>>]>;
2734
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2735
+ type: z.ZodLiteral<"turn.completed">;
2736
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2737
+ type: z.ZodLiteral<"turn.cancelled">;
2738
+ reason: z.ZodString;
2739
+ message: z.ZodString;
2740
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2741
+ type: z.ZodLiteral<"turn.failed">;
2742
+ stage: z.ZodEnum<{
2743
+ bootstrap: "bootstrap";
2744
+ plan: "plan";
2745
+ execute: "execute";
2746
+ }>;
2747
+ message: z.ZodString;
2748
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2749
+ type: z.ZodLiteral<"capabilities.changed">;
2750
+ }, z.core.$strict>>]>;
2751
+ runtimeInstanceId: z.core.$ZodBranded<z.ZodString, "RuntimeInstanceId">;
2752
+ sequence: z.ZodNumber;
2753
+ timestamp: z.ZodString;
2754
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
2755
+ turnId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TurnId">>;
2756
+ protocolVersion: z.ZodEnum<{
2757
+ 1.1: "1.1";
2758
+ "1.0": "1.0";
2759
+ }>;
2760
+ }, z.core.$strict>>;
2761
+ }, z.core.$strict>>;
2762
+ readonly "runtime.ack": z.ZodReadonly<z.ZodObject<{
2763
+ type: z.ZodLiteral<"runtime.ack">;
2764
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2765
+ throughRelaySequence: z.ZodNumber;
2766
+ }, z.core.$strict>>;
2767
+ readonly "runtime.gap": z.ZodReadonly<z.ZodObject<{
2768
+ type: z.ZodLiteral<"runtime.gap">;
2769
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2770
+ fromRelaySequence: z.ZodNumber;
2771
+ throughRelaySequence: z.ZodNumber;
2772
+ recovery: z.ZodLiteral<"thread.snapshot">;
2773
+ }, z.core.$strict>>;
2774
+ readonly "runtime.encrypted": z.ZodReadonly<z.ZodObject<{
2775
+ type: z.ZodLiteral<"runtime.encrypted">;
2776
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2777
+ envelopeId: z.ZodString;
2778
+ payloadKind: z.ZodEnum<{
2779
+ event: "event";
2780
+ request: "request";
2781
+ response: "response";
2782
+ }>;
2783
+ requestId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "RelayRequestId">>;
2784
+ relaySequence: z.ZodOptional<z.ZodNumber>;
2785
+ algorithm: z.ZodString;
2786
+ nonce: z.ZodString;
2787
+ ciphertext: z.ZodString;
2788
+ }, z.core.$strict>>;
2789
+ };
2790
+ /** @deprecated Legacy generic Relay exports remain pinned to Wire 1.0. */
2791
+ export declare const relayMessageSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
2792
+ type: z.ZodLiteral<"device.connect">;
2793
+ protocolVersion: z.ZodLiteral<"1.0">;
2794
+ deviceId: z.core.$ZodBranded<z.ZodString, "DeviceId">;
2795
+ pairingToken: z.ZodString;
2796
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2797
+ type: z.ZodLiteral<"runtime.request">;
2798
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
2799
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2800
+ method: z.ZodEnum<{
2801
+ initialize: "initialize";
2802
+ "thread.list": "thread.list";
2803
+ "thread.create": "thread.create";
2804
+ "thread.open": "thread.open";
2805
+ "thread.snapshot": "thread.snapshot";
2806
+ "thread.rename": "thread.rename";
2807
+ "thread.delete": "thread.delete";
2808
+ "thread.detach": "thread.detach";
2809
+ "thread.capabilities": "thread.capabilities";
2810
+ "turn.start": "turn.start";
2811
+ "turn.cancel": "turn.cancel";
2812
+ "approval.respond": "approval.respond";
2813
+ "operation.get": "operation.get";
2814
+ "approval.candidate": "approval.candidate";
2815
+ }>;
2816
+ params: z.ZodJSONSchema;
2817
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2818
+ type: z.ZodLiteral<"runtime.response">;
2819
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
2820
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2821
+ result: z.ZodOptional<z.ZodJSONSchema>;
2822
+ error: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
2823
+ code: z.ZodString;
2824
+ message: z.ZodString;
2825
+ retryable: z.ZodBoolean;
2826
+ }, z.core.$strict>>>;
2827
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2828
+ type: z.ZodLiteral<"runtime.event">;
2829
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2830
+ relaySequence: z.ZodNumber;
2831
+ event: z.ZodReadonly<z.ZodObject<{
2832
+ event: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
2833
+ type: z.ZodLiteral<"turn.started">;
2834
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2835
+ type: z.ZodLiteral<"message.started">;
2836
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
2837
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2838
+ type: z.ZodLiteral<"message.delta">;
2839
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
2840
+ delta: z.ZodString;
2841
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2842
+ type: z.ZodLiteral<"message.completed">;
2843
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
2844
+ text: z.ZodString;
2845
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2846
+ type: z.ZodLiteral<"reasoning.summary.delta">;
2847
+ reasoningId: z.ZodString;
2848
+ delta: z.ZodString;
2849
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2850
+ type: z.ZodLiteral<"tool.started">;
2851
+ toolCallId: z.ZodString;
2852
+ agentName: z.ZodString;
2853
+ toolName: z.ZodString;
2854
+ input: z.ZodJSONSchema;
2855
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2856
+ type: z.ZodLiteral<"tool.output">;
2857
+ toolCallId: z.ZodString;
2858
+ agentName: z.ZodString;
2859
+ toolName: z.ZodString;
2860
+ stream: z.ZodEnum<{
2861
+ stdout: "stdout";
2862
+ stderr: "stderr";
2863
+ }>;
2864
+ delta: z.ZodString;
2865
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2866
+ type: z.ZodLiteral<"tool.completed">;
2867
+ toolCallId: z.ZodString;
2868
+ agentName: z.ZodString;
2869
+ toolName: z.ZodString;
2870
+ operationId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "OperationId">>;
2871
+ outcome: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
2872
+ kind: z.ZodEnum<{
2873
+ success: "success";
2874
+ user_rejected: "user_rejected";
2875
+ policy_denied: "policy_denied";
2876
+ invalid_input: "invalid_input";
2877
+ cancelled: "cancelled";
2878
+ tool_failed: "tool_failed";
2879
+ }>;
2880
+ reason: z.ZodOptional<z.ZodString>;
2881
+ }, z.core.$strict>>>;
2882
+ display: z.ZodJSONSchema;
2883
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2884
+ type: z.ZodLiteral<"approval.required">;
2885
+ approval: z.ZodReadonly<z.ZodObject<{
2886
+ id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
2887
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
2888
+ agentName: z.ZodString;
2889
+ toolName: z.ZodString;
2890
+ preview: z.ZodJSONSchema;
2891
+ reason: z.ZodOptional<z.ZodString>;
2892
+ }, z.core.$strict>>;
2893
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2894
+ type: z.ZodLiteral<"approval.resolved">;
2895
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
2896
+ resolution: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
2897
+ status: z.ZodLiteral<"resolved">;
2898
+ decision: z.ZodLiteral<"approve">;
2899
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
589
2900
  status: z.ZodLiteral<"resolved">;
590
2901
  decision: z.ZodLiteral<"reject">;
591
2902
  reason: z.ZodOptional<z.ZodString>;
@@ -613,25 +2924,27 @@ export declare const relayRuntimeEventSchema: z.ZodReadonly<z.ZodObject<{
613
2924
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
614
2925
  type: z.ZodLiteral<"capabilities.changed">;
615
2926
  }, z.core.$strict>>]>;
2927
+ runtimeInstanceId: z.core.$ZodBranded<z.ZodString, "RuntimeInstanceId">;
2928
+ sequence: z.ZodNumber;
2929
+ timestamp: z.ZodString;
2930
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
2931
+ turnId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TurnId">>;
2932
+ protocolVersion: z.ZodEnum<{
2933
+ 1.1: "1.1";
2934
+ "1.0": "1.0";
2935
+ }>;
616
2936
  }, z.core.$strict>>;
617
- }, z.core.$strict>>;
618
- export declare const relayAckSchema: z.ZodReadonly<z.ZodObject<{
2937
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
619
2938
  type: z.ZodLiteral<"runtime.ack">;
620
2939
  workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
621
2940
  throughRelaySequence: z.ZodNumber;
622
- }, z.core.$strict>>;
623
- export declare const relayGapSchema: z.ZodReadonly<z.ZodObject<{
624
- type: z.ZodLiteral<"runtime.gap">;
625
- workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
626
- fromRelaySequence: z.ZodNumber;
627
- throughRelaySequence: z.ZodNumber;
628
- recovery: z.ZodLiteral<"thread.snapshot">;
629
- }, z.core.$strict>>;
630
- /**
631
- * This preserves the pre-freeze v1.0 metadata shape. Payload-kind-specific required
632
- * fields must be introduced under a later Relay Wire version.
633
- */
634
- export declare const relayEncryptedMessageSchema: z.ZodReadonly<z.ZodObject<{
2941
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
2942
+ type: z.ZodLiteral<"runtime.gap">;
2943
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
2944
+ fromRelaySequence: z.ZodNumber;
2945
+ throughRelaySequence: z.ZodNumber;
2946
+ recovery: z.ZodLiteral<"thread.snapshot">;
2947
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
635
2948
  type: z.ZodLiteral<"runtime.encrypted">;
636
2949
  workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
637
2950
  envelopeId: z.ZodString;
@@ -645,11 +2958,11 @@ export declare const relayEncryptedMessageSchema: z.ZodReadonly<z.ZodObject<{
645
2958
  algorithm: z.ZodString;
646
2959
  nonce: z.ZodString;
647
2960
  ciphertext: z.ZodString;
648
- }, z.core.$strict>>;
649
- export declare const relayMessageSchemas: {
2961
+ }, z.core.$strict>>]>;
2962
+ export declare const relayMessageSchemasV11: {
650
2963
  readonly "device.connect": z.ZodReadonly<z.ZodObject<{
651
2964
  type: z.ZodLiteral<"device.connect">;
652
- protocolVersion: z.ZodLiteral<"1.0">;
2965
+ protocolVersion: z.ZodLiteral<"1.1">;
653
2966
  deviceId: z.core.$ZodBranded<z.ZodString, "DeviceId">;
654
2967
  pairingToken: z.ZodString;
655
2968
  }, z.core.$strict>>;
@@ -669,9 +2982,8 @@ export declare const relayMessageSchemas: {
669
2982
  "thread.capabilities": "thread.capabilities";
670
2983
  "turn.start": "turn.start";
671
2984
  "turn.cancel": "turn.cancel";
672
- "approval.respond": "approval.respond";
673
2985
  "operation.get": "operation.get";
674
- "approval.candidate": "approval.candidate";
2986
+ "interaction.candidate": "interaction.candidate";
675
2987
  }>;
676
2988
  params: z.ZodJSONSchema;
677
2989
  }, z.core.$strict>>;
@@ -722,23 +3034,11 @@ export declare const relayMessageSchemas: {
722
3034
  toolCallId: z.ZodString;
723
3035
  agentName: z.ZodString;
724
3036
  toolName: z.ZodString;
725
- input: z.ZodJSONSchema;
726
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
727
- type: z.ZodLiteral<"tool.output">;
728
- toolCallId: z.ZodString;
729
- agentName: z.ZodString;
730
- toolName: z.ZodString;
731
- stream: z.ZodEnum<{
732
- stdout: "stdout";
733
- stderr: "stderr";
734
- }>;
735
- delta: z.ZodString;
736
3037
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
737
3038
  type: z.ZodLiteral<"tool.completed">;
738
3039
  toolCallId: z.ZodString;
739
3040
  agentName: z.ZodString;
740
3041
  toolName: z.ZodString;
741
- operationId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "OperationId">>;
742
3042
  outcome: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
743
3043
  kind: z.ZodEnum<{
744
3044
  success: "success";
@@ -748,42 +3048,33 @@ export declare const relayMessageSchemas: {
748
3048
  cancelled: "cancelled";
749
3049
  tool_failed: "tool_failed";
750
3050
  }>;
751
- reason: z.ZodOptional<z.ZodString>;
752
3051
  }, z.core.$strict>>>;
753
- display: z.ZodJSONSchema;
754
3052
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
755
3053
  type: z.ZodLiteral<"approval.required">;
756
3054
  approval: z.ZodReadonly<z.ZodObject<{
757
- id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
758
- turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
3055
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
759
3056
  agentName: z.ZodString;
760
3057
  toolName: z.ZodString;
761
- preview: z.ZodJSONSchema;
762
- reason: z.ZodOptional<z.ZodString>;
3058
+ explanation: z.ZodOptional<z.ZodString>;
763
3059
  }, z.core.$strict>>;
764
3060
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
765
3061
  type: z.ZodLiteral<"approval.resolved">;
766
3062
  approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
767
- resolution: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
768
- status: z.ZodLiteral<"resolved">;
769
- decision: z.ZodLiteral<"approve">;
770
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3063
+ resolution: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
771
3064
  status: z.ZodLiteral<"resolved">;
772
- decision: z.ZodLiteral<"reject">;
773
- reason: z.ZodOptional<z.ZodString>;
3065
+ decision: z.ZodEnum<{
3066
+ approve: "approve";
3067
+ reject: "reject";
3068
+ }>;
774
3069
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
775
3070
  status: z.ZodLiteral<"cancelled">;
776
- reason: z.ZodString;
777
3071
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
778
3072
  status: z.ZodLiteral<"expired">;
779
- reason: z.ZodOptional<z.ZodString>;
780
3073
  }, z.core.$strict>>]>;
781
3074
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
782
3075
  type: z.ZodLiteral<"turn.completed">;
783
3076
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
784
3077
  type: z.ZodLiteral<"turn.cancelled">;
785
- reason: z.ZodString;
786
- message: z.ZodString;
787
3078
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
788
3079
  type: z.ZodLiteral<"turn.failed">;
789
3080
  stage: z.ZodEnum<{
@@ -791,7 +3082,6 @@ export declare const relayMessageSchemas: {
791
3082
  plan: "plan";
792
3083
  execute: "execute";
793
3084
  }>;
794
- message: z.ZodString;
795
3085
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
796
3086
  type: z.ZodLiteral<"capabilities.changed">;
797
3087
  }, z.core.$strict>>]>;
@@ -817,6 +3107,7 @@ export declare const relayMessageSchemas: {
817
3107
  event: "event";
818
3108
  request: "request";
819
3109
  response: "response";
3110
+ interaction: "interaction";
820
3111
  }>;
821
3112
  requestId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "RelayRequestId">>;
822
3113
  relaySequence: z.ZodOptional<z.ZodNumber>;
@@ -824,10 +3115,111 @@ export declare const relayMessageSchemas: {
824
3115
  nonce: z.ZodString;
825
3116
  ciphertext: z.ZodString;
826
3117
  }, z.core.$strict>>;
3118
+ readonly "interaction.request": z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
3119
+ method: z.ZodLiteral<"approval.request">;
3120
+ projection: z.ZodReadonly<z.ZodObject<{
3121
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
3122
+ agentName: z.ZodString;
3123
+ toolName: z.ZodString;
3124
+ explanation: z.ZodOptional<z.ZodString>;
3125
+ }, z.core.$strict>>;
3126
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3127
+ relaySequence: z.ZodNumber;
3128
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
3129
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3130
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
3131
+ expiresAt: z.ZodString;
3132
+ sensitivity: z.ZodLiteral<"normal">;
3133
+ type: z.ZodLiteral<"interaction.request">;
3134
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3135
+ method: z.ZodLiteral<"userInput.request">;
3136
+ projection: z.ZodReadonly<z.ZodObject<{
3137
+ title: z.ZodOptional<z.ZodString>;
3138
+ description: z.ZodOptional<z.ZodString>;
3139
+ controls: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
3140
+ minLength: z.ZodOptional<z.ZodNumber>;
3141
+ maxLength: z.ZodOptional<z.ZodNumber>;
3142
+ id: z.ZodString;
3143
+ label: z.ZodString;
3144
+ description: z.ZodOptional<z.ZodString>;
3145
+ required: z.ZodBoolean;
3146
+ type: z.ZodLiteral<"text">;
3147
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3148
+ minLength: z.ZodOptional<z.ZodNumber>;
3149
+ maxLength: z.ZodOptional<z.ZodNumber>;
3150
+ id: z.ZodString;
3151
+ label: z.ZodString;
3152
+ description: z.ZodOptional<z.ZodString>;
3153
+ required: z.ZodBoolean;
3154
+ type: z.ZodLiteral<"multiline">;
3155
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3156
+ min: z.ZodOptional<z.ZodNumber>;
3157
+ max: z.ZodOptional<z.ZodNumber>;
3158
+ integer: z.ZodOptional<z.ZodBoolean>;
3159
+ id: z.ZodString;
3160
+ label: z.ZodString;
3161
+ description: z.ZodOptional<z.ZodString>;
3162
+ required: z.ZodBoolean;
3163
+ type: z.ZodLiteral<"number">;
3164
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3165
+ id: z.ZodString;
3166
+ label: z.ZodString;
3167
+ description: z.ZodOptional<z.ZodString>;
3168
+ required: z.ZodBoolean;
3169
+ type: z.ZodLiteral<"boolean">;
3170
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3171
+ multiple: z.ZodBoolean;
3172
+ options: z.ZodArray<z.ZodReadonly<z.ZodObject<{
3173
+ id: z.ZodString;
3174
+ label: z.ZodString;
3175
+ description: z.ZodOptional<z.ZodString>;
3176
+ }, z.core.$strict>>>;
3177
+ minSelections: z.ZodOptional<z.ZodNumber>;
3178
+ maxSelections: z.ZodOptional<z.ZodNumber>;
3179
+ id: z.ZodString;
3180
+ label: z.ZodString;
3181
+ description: z.ZodOptional<z.ZodString>;
3182
+ required: z.ZodBoolean;
3183
+ type: z.ZodLiteral<"choice">;
3184
+ }, z.core.$strict>>]>>;
3185
+ }, z.core.$strict>>;
3186
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3187
+ relaySequence: z.ZodNumber;
3188
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
3189
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3190
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
3191
+ expiresAt: z.ZodString;
3192
+ sensitivity: z.ZodLiteral<"normal">;
3193
+ type: z.ZodLiteral<"interaction.request">;
3194
+ }, z.core.$strict>>]>;
3195
+ readonly "interaction.resolved": z.ZodReadonly<z.ZodObject<{
3196
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3197
+ relaySequence: z.ZodNumber;
3198
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
3199
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3200
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
3201
+ method: z.ZodEnum<{
3202
+ "approval.request": "approval.request";
3203
+ "userInput.request": "userInput.request";
3204
+ }>;
3205
+ type: z.ZodLiteral<"interaction.resolved">;
3206
+ }, z.core.$strict>>;
3207
+ readonly "interaction.cancelled": z.ZodReadonly<z.ZodObject<{
3208
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3209
+ relaySequence: z.ZodNumber;
3210
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
3211
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3212
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
3213
+ method: z.ZodEnum<{
3214
+ "approval.request": "approval.request";
3215
+ "userInput.request": "userInput.request";
3216
+ }>;
3217
+ type: z.ZodLiteral<"interaction.cancelled">;
3218
+ }, z.core.$strict>>;
827
3219
  };
828
- export declare const relayMessageSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
3220
+ export declare const relayMessageSchemaV11: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
829
3221
  type: z.ZodLiteral<"device.connect">;
830
- protocolVersion: z.ZodLiteral<"1.0">;
3222
+ protocolVersion: z.ZodLiteral<"1.1">;
831
3223
  deviceId: z.core.$ZodBranded<z.ZodString, "DeviceId">;
832
3224
  pairingToken: z.ZodString;
833
3225
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
@@ -846,9 +3238,8 @@ export declare const relayMessageSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<
846
3238
  "thread.capabilities": "thread.capabilities";
847
3239
  "turn.start": "turn.start";
848
3240
  "turn.cancel": "turn.cancel";
849
- "approval.respond": "approval.respond";
850
3241
  "operation.get": "operation.get";
851
- "approval.candidate": "approval.candidate";
3242
+ "interaction.candidate": "interaction.candidate";
852
3243
  }>;
853
3244
  params: z.ZodJSONSchema;
854
3245
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
@@ -897,120 +3288,1372 @@ export declare const relayMessageSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<
897
3288
  toolCallId: z.ZodString;
898
3289
  agentName: z.ZodString;
899
3290
  toolName: z.ZodString;
900
- input: z.ZodJSONSchema;
901
3291
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
902
- type: z.ZodLiteral<"tool.output">;
903
- toolCallId: z.ZodString;
904
- agentName: z.ZodString;
905
- toolName: z.ZodString;
906
- stream: z.ZodEnum<{
907
- stdout: "stdout";
908
- stderr: "stderr";
3292
+ type: z.ZodLiteral<"tool.completed">;
3293
+ toolCallId: z.ZodString;
3294
+ agentName: z.ZodString;
3295
+ toolName: z.ZodString;
3296
+ outcome: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
3297
+ kind: z.ZodEnum<{
3298
+ success: "success";
3299
+ user_rejected: "user_rejected";
3300
+ policy_denied: "policy_denied";
3301
+ invalid_input: "invalid_input";
3302
+ cancelled: "cancelled";
3303
+ tool_failed: "tool_failed";
3304
+ }>;
3305
+ }, z.core.$strict>>>;
3306
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3307
+ type: z.ZodLiteral<"approval.required">;
3308
+ approval: z.ZodReadonly<z.ZodObject<{
3309
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
3310
+ agentName: z.ZodString;
3311
+ toolName: z.ZodString;
3312
+ explanation: z.ZodOptional<z.ZodString>;
3313
+ }, z.core.$strict>>;
3314
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3315
+ type: z.ZodLiteral<"approval.resolved">;
3316
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
3317
+ resolution: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
3318
+ status: z.ZodLiteral<"resolved">;
3319
+ decision: z.ZodEnum<{
3320
+ approve: "approve";
3321
+ reject: "reject";
3322
+ }>;
3323
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3324
+ status: z.ZodLiteral<"cancelled">;
3325
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3326
+ status: z.ZodLiteral<"expired">;
3327
+ }, z.core.$strict>>]>;
3328
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3329
+ type: z.ZodLiteral<"turn.completed">;
3330
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3331
+ type: z.ZodLiteral<"turn.cancelled">;
3332
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3333
+ type: z.ZodLiteral<"turn.failed">;
3334
+ stage: z.ZodEnum<{
3335
+ bootstrap: "bootstrap";
3336
+ plan: "plan";
3337
+ execute: "execute";
3338
+ }>;
3339
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3340
+ type: z.ZodLiteral<"capabilities.changed">;
3341
+ }, z.core.$strict>>]>;
3342
+ }, z.core.$strict>>;
3343
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3344
+ type: z.ZodLiteral<"runtime.ack">;
3345
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3346
+ throughRelaySequence: z.ZodNumber;
3347
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3348
+ type: z.ZodLiteral<"runtime.gap">;
3349
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3350
+ fromRelaySequence: z.ZodNumber;
3351
+ throughRelaySequence: z.ZodNumber;
3352
+ recovery: z.ZodLiteral<"thread.snapshot">;
3353
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3354
+ type: z.ZodLiteral<"runtime.encrypted">;
3355
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3356
+ envelopeId: z.ZodString;
3357
+ payloadKind: z.ZodEnum<{
3358
+ event: "event";
3359
+ request: "request";
3360
+ response: "response";
3361
+ interaction: "interaction";
3362
+ }>;
3363
+ requestId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "RelayRequestId">>;
3364
+ relaySequence: z.ZodOptional<z.ZodNumber>;
3365
+ algorithm: z.ZodString;
3366
+ nonce: z.ZodString;
3367
+ ciphertext: z.ZodString;
3368
+ }, z.core.$strict>>, z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
3369
+ method: z.ZodLiteral<"approval.request">;
3370
+ projection: z.ZodReadonly<z.ZodObject<{
3371
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
3372
+ agentName: z.ZodString;
3373
+ toolName: z.ZodString;
3374
+ explanation: z.ZodOptional<z.ZodString>;
3375
+ }, z.core.$strict>>;
3376
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3377
+ relaySequence: z.ZodNumber;
3378
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
3379
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3380
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
3381
+ expiresAt: z.ZodString;
3382
+ sensitivity: z.ZodLiteral<"normal">;
3383
+ type: z.ZodLiteral<"interaction.request">;
3384
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3385
+ method: z.ZodLiteral<"userInput.request">;
3386
+ projection: z.ZodReadonly<z.ZodObject<{
3387
+ title: z.ZodOptional<z.ZodString>;
3388
+ description: z.ZodOptional<z.ZodString>;
3389
+ controls: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
3390
+ minLength: z.ZodOptional<z.ZodNumber>;
3391
+ maxLength: z.ZodOptional<z.ZodNumber>;
3392
+ id: z.ZodString;
3393
+ label: z.ZodString;
3394
+ description: z.ZodOptional<z.ZodString>;
3395
+ required: z.ZodBoolean;
3396
+ type: z.ZodLiteral<"text">;
3397
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3398
+ minLength: z.ZodOptional<z.ZodNumber>;
3399
+ maxLength: z.ZodOptional<z.ZodNumber>;
3400
+ id: z.ZodString;
3401
+ label: z.ZodString;
3402
+ description: z.ZodOptional<z.ZodString>;
3403
+ required: z.ZodBoolean;
3404
+ type: z.ZodLiteral<"multiline">;
3405
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3406
+ min: z.ZodOptional<z.ZodNumber>;
3407
+ max: z.ZodOptional<z.ZodNumber>;
3408
+ integer: z.ZodOptional<z.ZodBoolean>;
3409
+ id: z.ZodString;
3410
+ label: z.ZodString;
3411
+ description: z.ZodOptional<z.ZodString>;
3412
+ required: z.ZodBoolean;
3413
+ type: z.ZodLiteral<"number">;
3414
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3415
+ id: z.ZodString;
3416
+ label: z.ZodString;
3417
+ description: z.ZodOptional<z.ZodString>;
3418
+ required: z.ZodBoolean;
3419
+ type: z.ZodLiteral<"boolean">;
3420
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3421
+ multiple: z.ZodBoolean;
3422
+ options: z.ZodArray<z.ZodReadonly<z.ZodObject<{
3423
+ id: z.ZodString;
3424
+ label: z.ZodString;
3425
+ description: z.ZodOptional<z.ZodString>;
3426
+ }, z.core.$strict>>>;
3427
+ minSelections: z.ZodOptional<z.ZodNumber>;
3428
+ maxSelections: z.ZodOptional<z.ZodNumber>;
3429
+ id: z.ZodString;
3430
+ label: z.ZodString;
3431
+ description: z.ZodOptional<z.ZodString>;
3432
+ required: z.ZodBoolean;
3433
+ type: z.ZodLiteral<"choice">;
3434
+ }, z.core.$strict>>]>>;
3435
+ }, z.core.$strict>>;
3436
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3437
+ relaySequence: z.ZodNumber;
3438
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
3439
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3440
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
3441
+ expiresAt: z.ZodString;
3442
+ sensitivity: z.ZodLiteral<"normal">;
3443
+ type: z.ZodLiteral<"interaction.request">;
3444
+ }, z.core.$strict>>]>, z.ZodReadonly<z.ZodObject<{
3445
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3446
+ relaySequence: z.ZodNumber;
3447
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
3448
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3449
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
3450
+ method: z.ZodEnum<{
3451
+ "approval.request": "approval.request";
3452
+ "userInput.request": "userInput.request";
3453
+ }>;
3454
+ type: z.ZodLiteral<"interaction.resolved">;
3455
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3456
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3457
+ relaySequence: z.ZodNumber;
3458
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
3459
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3460
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
3461
+ method: z.ZodEnum<{
3462
+ "approval.request": "approval.request";
3463
+ "userInput.request": "userInput.request";
3464
+ }>;
3465
+ type: z.ZodLiteral<"interaction.cancelled">;
3466
+ }, z.core.$strict>>]>;
3467
+ export interface RelayProtocolRegistry {
3468
+ readonly messageTypes: readonly string[];
3469
+ readonly messageSchema: z.ZodType;
3470
+ readonly requestMethods: readonly string[];
3471
+ readonly requestMethodSchemas: Readonly<Record<string, {
3472
+ readonly params: z.ZodType;
3473
+ readonly result: z.ZodType;
3474
+ }>>;
3475
+ readonly requestMethodDispositions: Readonly<Record<string, "query" | "mutation" | "local-only">>;
3476
+ readonly mutationMethods: readonly string[];
3477
+ readonly localOnlyMethods: readonly string[];
3478
+ }
3479
+ export declare const RELAY_PROTOCOL_REGISTRY: {
3480
+ readonly "1.1": {
3481
+ readonly messageTypes: readonly ["device.connect", "runtime.request", "runtime.response", "runtime.event", "runtime.ack", "runtime.gap", "runtime.encrypted", "interaction.request", "interaction.resolved", "interaction.cancelled"];
3482
+ readonly messageSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
3483
+ type: z.ZodLiteral<"device.connect">;
3484
+ protocolVersion: z.ZodLiteral<"1.1">;
3485
+ deviceId: z.core.$ZodBranded<z.ZodString, "DeviceId">;
3486
+ pairingToken: z.ZodString;
3487
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3488
+ type: z.ZodLiteral<"runtime.request">;
3489
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
3490
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3491
+ method: z.ZodEnum<{
3492
+ initialize: "initialize";
3493
+ "thread.list": "thread.list";
3494
+ "thread.create": "thread.create";
3495
+ "thread.open": "thread.open";
3496
+ "thread.snapshot": "thread.snapshot";
3497
+ "thread.rename": "thread.rename";
3498
+ "thread.delete": "thread.delete";
3499
+ "thread.detach": "thread.detach";
3500
+ "thread.capabilities": "thread.capabilities";
3501
+ "turn.start": "turn.start";
3502
+ "turn.cancel": "turn.cancel";
3503
+ "operation.get": "operation.get";
3504
+ "interaction.candidate": "interaction.candidate";
3505
+ }>;
3506
+ params: z.ZodJSONSchema;
3507
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3508
+ type: z.ZodLiteral<"runtime.response">;
3509
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
3510
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3511
+ result: z.ZodOptional<z.ZodJSONSchema>;
3512
+ error: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
3513
+ code: z.ZodString;
3514
+ message: z.ZodString;
3515
+ retryable: z.ZodBoolean;
3516
+ }, z.core.$strict>>>;
3517
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3518
+ type: z.ZodLiteral<"runtime.event">;
3519
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3520
+ relaySequence: z.ZodNumber;
3521
+ event: z.ZodReadonly<z.ZodObject<{
3522
+ protocolVersion: z.ZodEnum<{
3523
+ 1.1: "1.1";
3524
+ "1.0": "1.0";
3525
+ }>;
3526
+ runtimeInstanceId: z.core.$ZodBranded<z.ZodString, "RuntimeInstanceId">;
3527
+ sequence: z.ZodNumber;
3528
+ timestamp: z.ZodString;
3529
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3530
+ turnId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TurnId">>;
3531
+ event: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
3532
+ type: z.ZodLiteral<"turn.started">;
3533
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3534
+ type: z.ZodLiteral<"message.started">;
3535
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
3536
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3537
+ type: z.ZodLiteral<"message.delta">;
3538
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
3539
+ delta: z.ZodString;
3540
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3541
+ type: z.ZodLiteral<"message.completed">;
3542
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
3543
+ text: z.ZodString;
3544
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3545
+ type: z.ZodLiteral<"reasoning.summary.delta">;
3546
+ reasoningId: z.ZodString;
3547
+ delta: z.ZodString;
3548
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3549
+ type: z.ZodLiteral<"tool.started">;
3550
+ toolCallId: z.ZodString;
3551
+ agentName: z.ZodString;
3552
+ toolName: z.ZodString;
3553
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3554
+ type: z.ZodLiteral<"tool.completed">;
3555
+ toolCallId: z.ZodString;
3556
+ agentName: z.ZodString;
3557
+ toolName: z.ZodString;
3558
+ outcome: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
3559
+ kind: z.ZodEnum<{
3560
+ success: "success";
3561
+ user_rejected: "user_rejected";
3562
+ policy_denied: "policy_denied";
3563
+ invalid_input: "invalid_input";
3564
+ cancelled: "cancelled";
3565
+ tool_failed: "tool_failed";
3566
+ }>;
3567
+ }, z.core.$strict>>>;
3568
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3569
+ type: z.ZodLiteral<"approval.required">;
3570
+ approval: z.ZodReadonly<z.ZodObject<{
3571
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
3572
+ agentName: z.ZodString;
3573
+ toolName: z.ZodString;
3574
+ explanation: z.ZodOptional<z.ZodString>;
3575
+ }, z.core.$strict>>;
3576
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3577
+ type: z.ZodLiteral<"approval.resolved">;
3578
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
3579
+ resolution: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
3580
+ status: z.ZodLiteral<"resolved">;
3581
+ decision: z.ZodEnum<{
3582
+ approve: "approve";
3583
+ reject: "reject";
3584
+ }>;
3585
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3586
+ status: z.ZodLiteral<"cancelled">;
3587
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3588
+ status: z.ZodLiteral<"expired">;
3589
+ }, z.core.$strict>>]>;
3590
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3591
+ type: z.ZodLiteral<"turn.completed">;
3592
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3593
+ type: z.ZodLiteral<"turn.cancelled">;
3594
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3595
+ type: z.ZodLiteral<"turn.failed">;
3596
+ stage: z.ZodEnum<{
3597
+ bootstrap: "bootstrap";
3598
+ plan: "plan";
3599
+ execute: "execute";
3600
+ }>;
3601
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3602
+ type: z.ZodLiteral<"capabilities.changed">;
3603
+ }, z.core.$strict>>]>;
3604
+ }, z.core.$strict>>;
3605
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3606
+ type: z.ZodLiteral<"runtime.ack">;
3607
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3608
+ throughRelaySequence: z.ZodNumber;
3609
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3610
+ type: z.ZodLiteral<"runtime.gap">;
3611
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3612
+ fromRelaySequence: z.ZodNumber;
3613
+ throughRelaySequence: z.ZodNumber;
3614
+ recovery: z.ZodLiteral<"thread.snapshot">;
3615
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3616
+ type: z.ZodLiteral<"runtime.encrypted">;
3617
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3618
+ envelopeId: z.ZodString;
3619
+ payloadKind: z.ZodEnum<{
3620
+ event: "event";
3621
+ request: "request";
3622
+ response: "response";
3623
+ interaction: "interaction";
3624
+ }>;
3625
+ requestId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "RelayRequestId">>;
3626
+ relaySequence: z.ZodOptional<z.ZodNumber>;
3627
+ algorithm: z.ZodString;
3628
+ nonce: z.ZodString;
3629
+ ciphertext: z.ZodString;
3630
+ }, z.core.$strict>>, z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
3631
+ method: z.ZodLiteral<"approval.request">;
3632
+ projection: z.ZodReadonly<z.ZodObject<{
3633
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
3634
+ agentName: z.ZodString;
3635
+ toolName: z.ZodString;
3636
+ explanation: z.ZodOptional<z.ZodString>;
3637
+ }, z.core.$strict>>;
3638
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3639
+ relaySequence: z.ZodNumber;
3640
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
3641
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3642
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
3643
+ expiresAt: z.ZodString;
3644
+ sensitivity: z.ZodLiteral<"normal">;
3645
+ type: z.ZodLiteral<"interaction.request">;
3646
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3647
+ method: z.ZodLiteral<"userInput.request">;
3648
+ projection: z.ZodReadonly<z.ZodObject<{
3649
+ title: z.ZodOptional<z.ZodString>;
3650
+ description: z.ZodOptional<z.ZodString>;
3651
+ controls: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
3652
+ minLength: z.ZodOptional<z.ZodNumber>;
3653
+ maxLength: z.ZodOptional<z.ZodNumber>;
3654
+ id: z.ZodString;
3655
+ label: z.ZodString;
3656
+ description: z.ZodOptional<z.ZodString>;
3657
+ required: z.ZodBoolean;
3658
+ type: z.ZodLiteral<"text">;
3659
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3660
+ minLength: z.ZodOptional<z.ZodNumber>;
3661
+ maxLength: z.ZodOptional<z.ZodNumber>;
3662
+ id: z.ZodString;
3663
+ label: z.ZodString;
3664
+ description: z.ZodOptional<z.ZodString>;
3665
+ required: z.ZodBoolean;
3666
+ type: z.ZodLiteral<"multiline">;
3667
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3668
+ min: z.ZodOptional<z.ZodNumber>;
3669
+ max: z.ZodOptional<z.ZodNumber>;
3670
+ integer: z.ZodOptional<z.ZodBoolean>;
3671
+ id: z.ZodString;
3672
+ label: z.ZodString;
3673
+ description: z.ZodOptional<z.ZodString>;
3674
+ required: z.ZodBoolean;
3675
+ type: z.ZodLiteral<"number">;
3676
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3677
+ id: z.ZodString;
3678
+ label: z.ZodString;
3679
+ description: z.ZodOptional<z.ZodString>;
3680
+ required: z.ZodBoolean;
3681
+ type: z.ZodLiteral<"boolean">;
3682
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3683
+ multiple: z.ZodBoolean;
3684
+ options: z.ZodArray<z.ZodReadonly<z.ZodObject<{
3685
+ id: z.ZodString;
3686
+ label: z.ZodString;
3687
+ description: z.ZodOptional<z.ZodString>;
3688
+ }, z.core.$strict>>>;
3689
+ minSelections: z.ZodOptional<z.ZodNumber>;
3690
+ maxSelections: z.ZodOptional<z.ZodNumber>;
3691
+ id: z.ZodString;
3692
+ label: z.ZodString;
3693
+ description: z.ZodOptional<z.ZodString>;
3694
+ required: z.ZodBoolean;
3695
+ type: z.ZodLiteral<"choice">;
3696
+ }, z.core.$strict>>]>>;
3697
+ }, z.core.$strict>>;
3698
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3699
+ relaySequence: z.ZodNumber;
3700
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
3701
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3702
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
3703
+ expiresAt: z.ZodString;
3704
+ sensitivity: z.ZodLiteral<"normal">;
3705
+ type: z.ZodLiteral<"interaction.request">;
3706
+ }, z.core.$strict>>]>, z.ZodReadonly<z.ZodObject<{
3707
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3708
+ relaySequence: z.ZodNumber;
3709
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
3710
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3711
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
3712
+ method: z.ZodEnum<{
3713
+ "approval.request": "approval.request";
3714
+ "userInput.request": "userInput.request";
3715
+ }>;
3716
+ type: z.ZodLiteral<"interaction.resolved">;
3717
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
3718
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
3719
+ relaySequence: z.ZodNumber;
3720
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
3721
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3722
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
3723
+ method: z.ZodEnum<{
3724
+ "approval.request": "approval.request";
3725
+ "userInput.request": "userInput.request";
3726
+ }>;
3727
+ type: z.ZodLiteral<"interaction.cancelled">;
3728
+ }, z.core.$strict>>]>;
3729
+ readonly requestMethods: readonly ["initialize", "thread.list", "thread.create", "thread.open", "thread.snapshot", "thread.rename", "thread.delete", "thread.detach", "thread.capabilities", "turn.start", "turn.cancel", "operation.get", "interaction.candidate"];
3730
+ readonly requestMethodSchemas: {
3731
+ readonly initialize: {
3732
+ readonly params: z.ZodReadonly<z.ZodObject<{
3733
+ protocolVersions: z.ZodArray<z.ZodString>;
3734
+ client: z.ZodReadonly<z.ZodObject<{
3735
+ name: z.ZodString;
3736
+ version: z.ZodString;
3737
+ }, z.core.$strict>>;
3738
+ }, z.core.$strict>>;
3739
+ readonly result: z.ZodReadonly<z.ZodObject<{
3740
+ limits: z.ZodReadonly<z.ZodObject<{
3741
+ maxFrameBytes: z.ZodNumber;
3742
+ maxPageSize: z.ZodNumber;
3743
+ eventReplay: z.ZodLiteral<false>;
3744
+ idempotencyCacheEntries: z.ZodNumber;
3745
+ }, z.core.$strict>>;
3746
+ runtimeInstanceId: z.core.$ZodBranded<z.ZodString, "RuntimeInstanceId">;
3747
+ server: z.ZodReadonly<z.ZodObject<{
3748
+ runtimeVersion: z.ZodString;
3749
+ name: z.ZodString;
3750
+ version: z.ZodString;
3751
+ }, z.core.$strict>>;
3752
+ features: z.ZodArray<z.ZodEnum<{
3753
+ "thread-management": "thread-management";
3754
+ snapshots: "snapshots";
3755
+ turns: "turns";
3756
+ approvals: "approvals";
3757
+ "tool-streaming": "tool-streaming";
3758
+ "reasoning-summary": "reasoning-summary";
3759
+ "operation-projection": "operation-projection";
3760
+ "process-local-sequence": "process-local-sequence";
3761
+ }>>;
3762
+ protocolVersion: z.ZodEnum<{
3763
+ 1.1: "1.1";
3764
+ "1.0": "1.0";
3765
+ }>;
3766
+ }, z.core.$strict>>;
3767
+ };
3768
+ readonly "thread.list": {
3769
+ readonly params: z.ZodReadonly<z.ZodObject<{
3770
+ cursor: z.ZodOptional<z.ZodString>;
3771
+ limit: z.ZodDefault<z.ZodNumber>;
3772
+ }, z.core.$strict>>;
3773
+ readonly result: z.ZodReadonly<z.ZodObject<{
3774
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
3775
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3776
+ title: z.ZodOptional<z.ZodString>;
3777
+ model: z.ZodOptional<z.ZodString>;
3778
+ createdAt: z.ZodString;
3779
+ updatedAt: z.ZodString;
3780
+ messageCount: z.ZodNumber;
3781
+ }, z.core.$strict>>>;
3782
+ nextCursor: z.ZodNullable<z.ZodString>;
3783
+ }, z.core.$strict>>;
3784
+ };
3785
+ readonly "thread.create": {
3786
+ readonly params: z.ZodReadonly<z.ZodObject<{
3787
+ title: z.ZodOptional<z.ZodString>;
3788
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
3789
+ }, z.core.$strict>>;
3790
+ readonly result: z.ZodReadonly<z.ZodObject<{
3791
+ thread: z.ZodReadonly<z.ZodObject<{
3792
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3793
+ title: z.ZodOptional<z.ZodString>;
3794
+ model: z.ZodOptional<z.ZodString>;
3795
+ createdAt: z.ZodString;
3796
+ updatedAt: z.ZodString;
3797
+ messageCount: z.ZodNumber;
3798
+ }, z.core.$strict>>;
3799
+ }, z.core.$strict>>;
3800
+ };
3801
+ readonly "thread.open": {
3802
+ readonly params: z.ZodReadonly<z.ZodObject<{
3803
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3804
+ }, z.core.$strict>>;
3805
+ readonly result: z.ZodReadonly<z.ZodObject<{
3806
+ thread: z.ZodReadonly<z.ZodObject<{
3807
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3808
+ title: z.ZodOptional<z.ZodString>;
3809
+ model: z.ZodOptional<z.ZodString>;
3810
+ createdAt: z.ZodString;
3811
+ updatedAt: z.ZodString;
3812
+ messageCount: z.ZodNumber;
3813
+ }, z.core.$strict>>;
3814
+ messages: z.ZodReadonly<z.ZodObject<{
3815
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
3816
+ sequence: z.ZodNumber;
3817
+ role: z.ZodEnum<{
3818
+ user: "user";
3819
+ assistant: "assistant";
3820
+ }>;
3821
+ createdAt: z.ZodString;
3822
+ parts: z.ZodArray<z.ZodReadonly<z.ZodObject<{
3823
+ type: z.ZodLiteral<"text">;
3824
+ text: z.ZodString;
3825
+ }, z.core.$strict>>>;
3826
+ }, z.core.$strict>>>;
3827
+ nextBeforeSequence: z.ZodNullable<z.ZodNumber>;
3828
+ }, z.core.$strict>>;
3829
+ operations: z.ZodReadonly<z.ZodObject<{
3830
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
3831
+ id: z.core.$ZodBranded<z.ZodString, "OperationId">;
3832
+ sequence: z.ZodNumber;
3833
+ toolCallId: z.ZodString;
3834
+ agentName: z.ZodString;
3835
+ toolName: z.ZodString;
3836
+ createdAt: z.ZodString;
3837
+ outcome: z.ZodReadonly<z.ZodObject<{
3838
+ kind: z.ZodEnum<{
3839
+ success: "success";
3840
+ user_rejected: "user_rejected";
3841
+ policy_denied: "policy_denied";
3842
+ invalid_input: "invalid_input";
3843
+ cancelled: "cancelled";
3844
+ tool_failed: "tool_failed";
3845
+ }>;
3846
+ reason: z.ZodOptional<z.ZodString>;
3847
+ }, z.core.$strict>>;
3848
+ display: z.ZodJSONSchema;
3849
+ }, z.core.$strict>>>;
3850
+ nextBeforeSequence: z.ZodNullable<z.ZodNumber>;
3851
+ }, z.core.$strict>>;
3852
+ activeTurn: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
3853
+ id: z.core.$ZodBranded<z.ZodString, "TurnId">;
3854
+ status: z.ZodEnum<{
3855
+ running: "running";
3856
+ cancelling: "cancelling";
3857
+ }>;
3858
+ startedAt: z.ZodString;
3859
+ }, z.core.$strict>>>;
3860
+ pendingApprovals: z.ZodArray<z.ZodReadonly<z.ZodObject<{
3861
+ id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
3862
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
3863
+ agentName: z.ZodString;
3864
+ toolName: z.ZodString;
3865
+ preview: z.ZodJSONSchema;
3866
+ reason: z.ZodOptional<z.ZodString>;
3867
+ }, z.core.$strict>>>;
3868
+ transcriptCompleteness: z.ZodEnum<{
3869
+ complete: "complete";
3870
+ legacy_snapshot: "legacy_snapshot";
3871
+ }>;
3872
+ }, z.core.$strict>>;
3873
+ };
3874
+ readonly "thread.snapshot": {
3875
+ readonly params: z.ZodReadonly<z.ZodObject<{
3876
+ messageBeforeSequence: z.ZodOptional<z.ZodNumber>;
3877
+ operationBeforeSequence: z.ZodOptional<z.ZodNumber>;
3878
+ limit: z.ZodDefault<z.ZodNumber>;
3879
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3880
+ }, z.core.$strict>>;
3881
+ readonly result: z.ZodReadonly<z.ZodObject<{
3882
+ thread: z.ZodReadonly<z.ZodObject<{
3883
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3884
+ title: z.ZodOptional<z.ZodString>;
3885
+ model: z.ZodOptional<z.ZodString>;
3886
+ createdAt: z.ZodString;
3887
+ updatedAt: z.ZodString;
3888
+ messageCount: z.ZodNumber;
3889
+ }, z.core.$strict>>;
3890
+ messages: z.ZodReadonly<z.ZodObject<{
3891
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
3892
+ sequence: z.ZodNumber;
3893
+ role: z.ZodEnum<{
3894
+ user: "user";
3895
+ assistant: "assistant";
3896
+ }>;
3897
+ createdAt: z.ZodString;
3898
+ parts: z.ZodArray<z.ZodReadonly<z.ZodObject<{
3899
+ type: z.ZodLiteral<"text">;
3900
+ text: z.ZodString;
3901
+ }, z.core.$strict>>>;
3902
+ }, z.core.$strict>>>;
3903
+ nextBeforeSequence: z.ZodNullable<z.ZodNumber>;
3904
+ }, z.core.$strict>>;
3905
+ operations: z.ZodReadonly<z.ZodObject<{
3906
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
3907
+ id: z.core.$ZodBranded<z.ZodString, "OperationId">;
3908
+ sequence: z.ZodNumber;
3909
+ toolCallId: z.ZodString;
3910
+ agentName: z.ZodString;
3911
+ toolName: z.ZodString;
3912
+ createdAt: z.ZodString;
3913
+ outcome: z.ZodReadonly<z.ZodObject<{
3914
+ kind: z.ZodEnum<{
3915
+ success: "success";
3916
+ user_rejected: "user_rejected";
3917
+ policy_denied: "policy_denied";
3918
+ invalid_input: "invalid_input";
3919
+ cancelled: "cancelled";
3920
+ tool_failed: "tool_failed";
3921
+ }>;
3922
+ reason: z.ZodOptional<z.ZodString>;
3923
+ }, z.core.$strict>>;
3924
+ display: z.ZodJSONSchema;
3925
+ }, z.core.$strict>>>;
3926
+ nextBeforeSequence: z.ZodNullable<z.ZodNumber>;
3927
+ }, z.core.$strict>>;
3928
+ activeTurn: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
3929
+ id: z.core.$ZodBranded<z.ZodString, "TurnId">;
3930
+ status: z.ZodEnum<{
3931
+ running: "running";
3932
+ cancelling: "cancelling";
3933
+ }>;
3934
+ startedAt: z.ZodString;
3935
+ }, z.core.$strict>>>;
3936
+ pendingApprovals: z.ZodArray<z.ZodReadonly<z.ZodObject<{
3937
+ id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
3938
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
3939
+ agentName: z.ZodString;
3940
+ toolName: z.ZodString;
3941
+ preview: z.ZodJSONSchema;
3942
+ reason: z.ZodOptional<z.ZodString>;
3943
+ }, z.core.$strict>>>;
3944
+ transcriptCompleteness: z.ZodEnum<{
3945
+ complete: "complete";
3946
+ legacy_snapshot: "legacy_snapshot";
3947
+ }>;
3948
+ }, z.core.$strict>>;
3949
+ };
3950
+ readonly "thread.rename": {
3951
+ readonly params: z.ZodReadonly<z.ZodObject<{
3952
+ title: z.ZodString;
3953
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3954
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
3955
+ }, z.core.$strict>>;
3956
+ readonly result: z.ZodReadonly<z.ZodObject<{
3957
+ thread: z.ZodReadonly<z.ZodObject<{
3958
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3959
+ title: z.ZodOptional<z.ZodString>;
3960
+ model: z.ZodOptional<z.ZodString>;
3961
+ createdAt: z.ZodString;
3962
+ updatedAt: z.ZodString;
3963
+ messageCount: z.ZodNumber;
3964
+ }, z.core.$strict>>;
3965
+ }, z.core.$strict>>;
3966
+ };
3967
+ readonly "thread.delete": {
3968
+ readonly params: z.ZodReadonly<z.ZodObject<{
3969
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3970
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
3971
+ }, z.core.$strict>>;
3972
+ readonly result: z.ZodReadonly<z.ZodObject<{
3973
+ deleted: z.ZodLiteral<true>;
3974
+ }, z.core.$strict>>;
3975
+ };
3976
+ readonly "thread.detach": {
3977
+ readonly params: z.ZodReadonly<z.ZodObject<{
3978
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3979
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
3980
+ }, z.core.$strict>>;
3981
+ readonly result: z.ZodReadonly<z.ZodObject<{
3982
+ detached: z.ZodBoolean;
3983
+ }, z.core.$strict>>;
3984
+ };
3985
+ readonly "thread.capabilities": {
3986
+ readonly params: z.ZodReadonly<z.ZodObject<{
3987
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
3988
+ }, z.core.$strict>>;
3989
+ readonly result: z.ZodReadonly<z.ZodObject<{
3990
+ manifest: z.ZodJSONSchema;
3991
+ }, z.core.$strict>>;
3992
+ };
3993
+ readonly "turn.start": {
3994
+ readonly params: z.ZodReadonly<z.ZodObject<{
3995
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
3996
+ input: z.ZodReadonly<z.ZodObject<{
3997
+ text: z.ZodString;
3998
+ }, z.core.$strict>>;
3999
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4000
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
4001
+ }, z.core.$strict>>;
4002
+ readonly result: z.ZodReadonly<z.ZodObject<{
4003
+ accepted: z.ZodLiteral<true>;
4004
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
4005
+ }, z.core.$strict>>;
4006
+ };
4007
+ readonly "turn.cancel": {
4008
+ readonly params: z.ZodReadonly<z.ZodObject<{
4009
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
4010
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4011
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
4012
+ }, z.core.$strict>>;
4013
+ readonly result: z.ZodReadonly<z.ZodObject<{
4014
+ cancelling: z.ZodBoolean;
4015
+ }, z.core.$strict>>;
4016
+ };
4017
+ readonly "operation.get": {
4018
+ readonly params: z.ZodReadonly<z.ZodObject<{
4019
+ operationId: z.core.$ZodBranded<z.ZodString, "OperationId">;
4020
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4021
+ }, z.core.$strict>>;
4022
+ readonly result: z.ZodReadonly<z.ZodObject<{
4023
+ operation: z.ZodNullable<z.ZodReadonly<z.ZodObject<{
4024
+ id: z.core.$ZodBranded<z.ZodString, "OperationId">;
4025
+ sequence: z.ZodNumber;
4026
+ toolCallId: z.ZodString;
4027
+ agentName: z.ZodString;
4028
+ toolName: z.ZodString;
4029
+ createdAt: z.ZodString;
4030
+ outcome: z.ZodReadonly<z.ZodObject<{
4031
+ kind: z.ZodEnum<{
4032
+ success: "success";
4033
+ user_rejected: "user_rejected";
4034
+ policy_denied: "policy_denied";
4035
+ invalid_input: "invalid_input";
4036
+ cancelled: "cancelled";
4037
+ tool_failed: "tool_failed";
4038
+ }>;
4039
+ reason: z.ZodOptional<z.ZodString>;
4040
+ }, z.core.$strict>>;
4041
+ display: z.ZodJSONSchema;
4042
+ }, z.core.$strict>>>;
4043
+ }, z.core.$strict>>;
4044
+ };
4045
+ readonly "interaction.candidate": {
4046
+ readonly params: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
4047
+ method: z.ZodLiteral<"approval.request">;
4048
+ candidate: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
4049
+ decision: z.ZodLiteral<"approve">;
4050
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4051
+ decision: z.ZodLiteral<"reject">;
4052
+ reason: z.ZodOptional<z.ZodString>;
4053
+ }, z.core.$strict>>]>;
4054
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
4055
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4056
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
4057
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4058
+ method: z.ZodLiteral<"userInput.request">;
4059
+ candidate: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
4060
+ status: z.ZodLiteral<"submitted">;
4061
+ values: z.ZodArray<z.ZodReadonly<z.ZodObject<{
4062
+ id: z.ZodString;
4063
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>;
4064
+ }, z.core.$strict>>>;
4065
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4066
+ status: z.ZodLiteral<"cancelled">;
4067
+ reason: z.ZodOptional<z.ZodString>;
4068
+ }, z.core.$strict>>]>;
4069
+ interactionId: z.core.$ZodBranded<z.ZodString, "InteractionId">;
4070
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4071
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
4072
+ }, z.core.$strict>>]>;
4073
+ readonly result: z.ZodReadonly<z.ZodObject<{
4074
+ accepted: z.ZodLiteral<true>;
4075
+ }, z.core.$strict>>;
4076
+ };
4077
+ };
4078
+ readonly requestMethodDispositions: {
4079
+ readonly initialize: "local-only";
4080
+ readonly "thread.list": "query";
4081
+ readonly "thread.create": "mutation";
4082
+ readonly "thread.open": "query";
4083
+ readonly "thread.snapshot": "query";
4084
+ readonly "thread.rename": "mutation";
4085
+ readonly "thread.delete": "mutation";
4086
+ readonly "thread.detach": "mutation";
4087
+ readonly "thread.capabilities": "query";
4088
+ readonly "turn.start": "mutation";
4089
+ readonly "turn.cancel": "mutation";
4090
+ readonly "operation.get": "query";
4091
+ readonly "interaction.candidate": "mutation";
4092
+ };
4093
+ readonly mutationMethods: readonly ["thread.create", "thread.rename", "thread.delete", "thread.detach", "turn.start", "turn.cancel", "interaction.candidate"];
4094
+ readonly localOnlyMethods: readonly ["initialize"];
4095
+ };
4096
+ readonly "1.0": {
4097
+ readonly messageTypes: readonly ["device.connect", "runtime.request", "runtime.response", "runtime.event", "runtime.ack", "runtime.gap", "runtime.encrypted"];
4098
+ readonly messageSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
4099
+ type: z.ZodLiteral<"device.connect">;
4100
+ protocolVersion: z.ZodLiteral<"1.0">;
4101
+ deviceId: z.core.$ZodBranded<z.ZodString, "DeviceId">;
4102
+ pairingToken: z.ZodString;
4103
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4104
+ type: z.ZodLiteral<"runtime.request">;
4105
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
4106
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
4107
+ method: z.ZodEnum<{
4108
+ initialize: "initialize";
4109
+ "thread.list": "thread.list";
4110
+ "thread.create": "thread.create";
4111
+ "thread.open": "thread.open";
4112
+ "thread.snapshot": "thread.snapshot";
4113
+ "thread.rename": "thread.rename";
4114
+ "thread.delete": "thread.delete";
4115
+ "thread.detach": "thread.detach";
4116
+ "thread.capabilities": "thread.capabilities";
4117
+ "turn.start": "turn.start";
4118
+ "turn.cancel": "turn.cancel";
4119
+ "approval.respond": "approval.respond";
4120
+ "operation.get": "operation.get";
4121
+ "approval.candidate": "approval.candidate";
909
4122
  }>;
910
- delta: z.ZodString;
4123
+ params: z.ZodJSONSchema;
911
4124
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
912
- type: z.ZodLiteral<"tool.completed">;
913
- toolCallId: z.ZodString;
914
- agentName: z.ZodString;
915
- toolName: z.ZodString;
916
- operationId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "OperationId">>;
917
- outcome: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
918
- kind: z.ZodEnum<{
919
- success: "success";
920
- user_rejected: "user_rejected";
921
- policy_denied: "policy_denied";
922
- invalid_input: "invalid_input";
923
- cancelled: "cancelled";
924
- tool_failed: "tool_failed";
925
- }>;
926
- reason: z.ZodOptional<z.ZodString>;
4125
+ type: z.ZodLiteral<"runtime.response">;
4126
+ requestId: z.core.$ZodBranded<z.ZodString, "RelayRequestId">;
4127
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
4128
+ result: z.ZodOptional<z.ZodJSONSchema>;
4129
+ error: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
4130
+ code: z.ZodString;
4131
+ message: z.ZodString;
4132
+ retryable: z.ZodBoolean;
927
4133
  }, z.core.$strict>>>;
928
- display: z.ZodJSONSchema;
929
4134
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
930
- type: z.ZodLiteral<"approval.required">;
931
- approval: z.ZodReadonly<z.ZodObject<{
932
- id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
933
- turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
934
- agentName: z.ZodString;
935
- toolName: z.ZodString;
936
- preview: z.ZodJSONSchema;
937
- reason: z.ZodOptional<z.ZodString>;
4135
+ type: z.ZodLiteral<"runtime.event">;
4136
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
4137
+ relaySequence: z.ZodNumber;
4138
+ event: z.ZodReadonly<z.ZodObject<{
4139
+ event: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
4140
+ type: z.ZodLiteral<"turn.started">;
4141
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4142
+ type: z.ZodLiteral<"message.started">;
4143
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
4144
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4145
+ type: z.ZodLiteral<"message.delta">;
4146
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
4147
+ delta: z.ZodString;
4148
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4149
+ type: z.ZodLiteral<"message.completed">;
4150
+ streamId: z.core.$ZodBranded<z.ZodString, "StreamId">;
4151
+ text: z.ZodString;
4152
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4153
+ type: z.ZodLiteral<"reasoning.summary.delta">;
4154
+ reasoningId: z.ZodString;
4155
+ delta: z.ZodString;
4156
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4157
+ type: z.ZodLiteral<"tool.started">;
4158
+ toolCallId: z.ZodString;
4159
+ agentName: z.ZodString;
4160
+ toolName: z.ZodString;
4161
+ input: z.ZodJSONSchema;
4162
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4163
+ type: z.ZodLiteral<"tool.output">;
4164
+ toolCallId: z.ZodString;
4165
+ agentName: z.ZodString;
4166
+ toolName: z.ZodString;
4167
+ stream: z.ZodEnum<{
4168
+ stdout: "stdout";
4169
+ stderr: "stderr";
4170
+ }>;
4171
+ delta: z.ZodString;
4172
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4173
+ type: z.ZodLiteral<"tool.completed">;
4174
+ toolCallId: z.ZodString;
4175
+ agentName: z.ZodString;
4176
+ toolName: z.ZodString;
4177
+ operationId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "OperationId">>;
4178
+ outcome: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
4179
+ kind: z.ZodEnum<{
4180
+ success: "success";
4181
+ user_rejected: "user_rejected";
4182
+ policy_denied: "policy_denied";
4183
+ invalid_input: "invalid_input";
4184
+ cancelled: "cancelled";
4185
+ tool_failed: "tool_failed";
4186
+ }>;
4187
+ reason: z.ZodOptional<z.ZodString>;
4188
+ }, z.core.$strict>>>;
4189
+ display: z.ZodJSONSchema;
4190
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4191
+ type: z.ZodLiteral<"approval.required">;
4192
+ approval: z.ZodReadonly<z.ZodObject<{
4193
+ id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
4194
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
4195
+ agentName: z.ZodString;
4196
+ toolName: z.ZodString;
4197
+ preview: z.ZodJSONSchema;
4198
+ reason: z.ZodOptional<z.ZodString>;
4199
+ }, z.core.$strict>>;
4200
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4201
+ type: z.ZodLiteral<"approval.resolved">;
4202
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
4203
+ resolution: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
4204
+ status: z.ZodLiteral<"resolved">;
4205
+ decision: z.ZodLiteral<"approve">;
4206
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4207
+ status: z.ZodLiteral<"resolved">;
4208
+ decision: z.ZodLiteral<"reject">;
4209
+ reason: z.ZodOptional<z.ZodString>;
4210
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4211
+ status: z.ZodLiteral<"cancelled">;
4212
+ reason: z.ZodString;
4213
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4214
+ status: z.ZodLiteral<"expired">;
4215
+ reason: z.ZodOptional<z.ZodString>;
4216
+ }, z.core.$strict>>]>;
4217
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4218
+ type: z.ZodLiteral<"turn.completed">;
4219
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4220
+ type: z.ZodLiteral<"turn.cancelled">;
4221
+ reason: z.ZodString;
4222
+ message: z.ZodString;
4223
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4224
+ type: z.ZodLiteral<"turn.failed">;
4225
+ stage: z.ZodEnum<{
4226
+ bootstrap: "bootstrap";
4227
+ plan: "plan";
4228
+ execute: "execute";
4229
+ }>;
4230
+ message: z.ZodString;
4231
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
4232
+ type: z.ZodLiteral<"capabilities.changed">;
4233
+ }, z.core.$strict>>]>;
4234
+ runtimeInstanceId: z.core.$ZodBranded<z.ZodString, "RuntimeInstanceId">;
4235
+ sequence: z.ZodNumber;
4236
+ timestamp: z.ZodString;
4237
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4238
+ turnId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TurnId">>;
4239
+ protocolVersion: z.ZodEnum<{
4240
+ 1.1: "1.1";
4241
+ "1.0": "1.0";
4242
+ }>;
938
4243
  }, z.core.$strict>>;
939
4244
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
940
- type: z.ZodLiteral<"approval.resolved">;
941
- approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
942
- resolution: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
943
- status: z.ZodLiteral<"resolved">;
944
- decision: z.ZodLiteral<"approve">;
945
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
946
- status: z.ZodLiteral<"resolved">;
947
- decision: z.ZodLiteral<"reject">;
948
- reason: z.ZodOptional<z.ZodString>;
949
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
950
- status: z.ZodLiteral<"cancelled">;
951
- reason: z.ZodString;
952
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
953
- status: z.ZodLiteral<"expired">;
954
- reason: z.ZodOptional<z.ZodString>;
955
- }, z.core.$strict>>]>;
956
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
957
- type: z.ZodLiteral<"turn.completed">;
4245
+ type: z.ZodLiteral<"runtime.ack">;
4246
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
4247
+ throughRelaySequence: z.ZodNumber;
958
4248
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
959
- type: z.ZodLiteral<"turn.cancelled">;
960
- reason: z.ZodString;
961
- message: z.ZodString;
4249
+ type: z.ZodLiteral<"runtime.gap">;
4250
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
4251
+ fromRelaySequence: z.ZodNumber;
4252
+ throughRelaySequence: z.ZodNumber;
4253
+ recovery: z.ZodLiteral<"thread.snapshot">;
962
4254
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
963
- type: z.ZodLiteral<"turn.failed">;
964
- stage: z.ZodEnum<{
965
- bootstrap: "bootstrap";
966
- plan: "plan";
967
- execute: "execute";
4255
+ type: z.ZodLiteral<"runtime.encrypted">;
4256
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
4257
+ envelopeId: z.ZodString;
4258
+ payloadKind: z.ZodEnum<{
4259
+ event: "event";
4260
+ request: "request";
4261
+ response: "response";
968
4262
  }>;
969
- message: z.ZodString;
970
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
971
- type: z.ZodLiteral<"capabilities.changed">;
4263
+ requestId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "RelayRequestId">>;
4264
+ relaySequence: z.ZodOptional<z.ZodNumber>;
4265
+ algorithm: z.ZodString;
4266
+ nonce: z.ZodString;
4267
+ ciphertext: z.ZodString;
972
4268
  }, z.core.$strict>>]>;
973
- }, z.core.$strict>>;
974
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
975
- type: z.ZodLiteral<"runtime.ack">;
976
- workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
977
- throughRelaySequence: z.ZodNumber;
978
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
979
- type: z.ZodLiteral<"runtime.gap">;
980
- workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
981
- fromRelaySequence: z.ZodNumber;
982
- throughRelaySequence: z.ZodNumber;
983
- recovery: z.ZodLiteral<"thread.snapshot">;
984
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
985
- type: z.ZodLiteral<"runtime.encrypted">;
986
- workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId">;
987
- envelopeId: z.ZodString;
988
- payloadKind: z.ZodEnum<{
989
- event: "event";
990
- request: "request";
991
- response: "response";
992
- }>;
993
- requestId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "RelayRequestId">>;
994
- relaySequence: z.ZodOptional<z.ZodNumber>;
995
- algorithm: z.ZodString;
996
- nonce: z.ZodString;
997
- ciphertext: z.ZodString;
998
- }, z.core.$strict>>]>;
999
- export interface RelayProtocolRegistry {
1000
- readonly messageTypes: readonly (typeof RELAY_MESSAGE_TYPE_VALUES)[number][];
1001
- readonly requestMethods: readonly RelayRequestMethod[];
1002
- readonly mutationMethods: readonly RelayRequestMethod[];
1003
- readonly localOnlyMethods: readonly RelayRequestMethod[];
1004
- }
1005
- export declare const RELAY_PROTOCOL_REGISTRY: {
1006
- readonly "1.0": {
1007
- readonly messageTypes: readonly ["device.connect", "runtime.request", "runtime.response", "runtime.event", "runtime.ack", "runtime.gap", "runtime.encrypted"];
1008
4269
  readonly requestMethods: readonly ["initialize", "thread.list", "thread.create", "thread.open", "thread.snapshot", "thread.rename", "thread.delete", "thread.detach", "thread.capabilities", "turn.start", "turn.cancel", "approval.respond", "operation.get", "approval.candidate"];
4270
+ readonly requestMethodSchemas: {
4271
+ readonly initialize: {
4272
+ readonly params: z.ZodReadonly<z.ZodObject<{
4273
+ protocolVersions: z.ZodArray<z.ZodString>;
4274
+ client: z.ZodReadonly<z.ZodObject<{
4275
+ name: z.ZodString;
4276
+ version: z.ZodString;
4277
+ }, z.core.$strict>>;
4278
+ }, z.core.$strict>>;
4279
+ readonly result: z.ZodReadonly<z.ZodObject<{
4280
+ limits: z.ZodReadonly<z.ZodObject<{
4281
+ maxFrameBytes: z.ZodNumber;
4282
+ maxPageSize: z.ZodNumber;
4283
+ eventReplay: z.ZodLiteral<false>;
4284
+ idempotencyCacheEntries: z.ZodNumber;
4285
+ }, z.core.$strict>>;
4286
+ runtimeInstanceId: z.core.$ZodBranded<z.ZodString, "RuntimeInstanceId">;
4287
+ server: z.ZodReadonly<z.ZodObject<{
4288
+ runtimeVersion: z.ZodString;
4289
+ name: z.ZodString;
4290
+ version: z.ZodString;
4291
+ }, z.core.$strict>>;
4292
+ features: z.ZodArray<z.ZodEnum<{
4293
+ "thread-management": "thread-management";
4294
+ snapshots: "snapshots";
4295
+ turns: "turns";
4296
+ approvals: "approvals";
4297
+ "tool-streaming": "tool-streaming";
4298
+ "reasoning-summary": "reasoning-summary";
4299
+ "operation-projection": "operation-projection";
4300
+ "process-local-sequence": "process-local-sequence";
4301
+ }>>;
4302
+ protocolVersion: z.ZodEnum<{
4303
+ 1.1: "1.1";
4304
+ "1.0": "1.0";
4305
+ }>;
4306
+ }, z.core.$strict>>;
4307
+ };
4308
+ readonly "thread.list": {
4309
+ readonly params: z.ZodReadonly<z.ZodObject<{
4310
+ cursor: z.ZodOptional<z.ZodString>;
4311
+ limit: z.ZodDefault<z.ZodNumber>;
4312
+ }, z.core.$strict>>;
4313
+ readonly result: z.ZodReadonly<z.ZodObject<{
4314
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
4315
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4316
+ title: z.ZodOptional<z.ZodString>;
4317
+ model: z.ZodOptional<z.ZodString>;
4318
+ createdAt: z.ZodString;
4319
+ updatedAt: z.ZodString;
4320
+ messageCount: z.ZodNumber;
4321
+ }, z.core.$strict>>>;
4322
+ nextCursor: z.ZodNullable<z.ZodString>;
4323
+ }, z.core.$strict>>;
4324
+ };
4325
+ readonly "thread.create": {
4326
+ readonly params: z.ZodReadonly<z.ZodObject<{
4327
+ title: z.ZodOptional<z.ZodString>;
4328
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
4329
+ }, z.core.$strict>>;
4330
+ readonly result: z.ZodReadonly<z.ZodObject<{
4331
+ thread: z.ZodReadonly<z.ZodObject<{
4332
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4333
+ title: z.ZodOptional<z.ZodString>;
4334
+ model: z.ZodOptional<z.ZodString>;
4335
+ createdAt: z.ZodString;
4336
+ updatedAt: z.ZodString;
4337
+ messageCount: z.ZodNumber;
4338
+ }, z.core.$strict>>;
4339
+ }, z.core.$strict>>;
4340
+ };
4341
+ readonly "thread.open": {
4342
+ readonly params: z.ZodReadonly<z.ZodObject<{
4343
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4344
+ }, z.core.$strict>>;
4345
+ readonly result: z.ZodReadonly<z.ZodObject<{
4346
+ thread: z.ZodReadonly<z.ZodObject<{
4347
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4348
+ title: z.ZodOptional<z.ZodString>;
4349
+ model: z.ZodOptional<z.ZodString>;
4350
+ createdAt: z.ZodString;
4351
+ updatedAt: z.ZodString;
4352
+ messageCount: z.ZodNumber;
4353
+ }, z.core.$strict>>;
4354
+ messages: z.ZodReadonly<z.ZodObject<{
4355
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
4356
+ sequence: z.ZodNumber;
4357
+ role: z.ZodEnum<{
4358
+ user: "user";
4359
+ assistant: "assistant";
4360
+ }>;
4361
+ createdAt: z.ZodString;
4362
+ parts: z.ZodArray<z.ZodReadonly<z.ZodObject<{
4363
+ type: z.ZodLiteral<"text">;
4364
+ text: z.ZodString;
4365
+ }, z.core.$strict>>>;
4366
+ }, z.core.$strict>>>;
4367
+ nextBeforeSequence: z.ZodNullable<z.ZodNumber>;
4368
+ }, z.core.$strict>>;
4369
+ operations: z.ZodReadonly<z.ZodObject<{
4370
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
4371
+ id: z.core.$ZodBranded<z.ZodString, "OperationId">;
4372
+ sequence: z.ZodNumber;
4373
+ toolCallId: z.ZodString;
4374
+ agentName: z.ZodString;
4375
+ toolName: z.ZodString;
4376
+ createdAt: z.ZodString;
4377
+ outcome: z.ZodReadonly<z.ZodObject<{
4378
+ kind: z.ZodEnum<{
4379
+ success: "success";
4380
+ user_rejected: "user_rejected";
4381
+ policy_denied: "policy_denied";
4382
+ invalid_input: "invalid_input";
4383
+ cancelled: "cancelled";
4384
+ tool_failed: "tool_failed";
4385
+ }>;
4386
+ reason: z.ZodOptional<z.ZodString>;
4387
+ }, z.core.$strict>>;
4388
+ display: z.ZodJSONSchema;
4389
+ }, z.core.$strict>>>;
4390
+ nextBeforeSequence: z.ZodNullable<z.ZodNumber>;
4391
+ }, z.core.$strict>>;
4392
+ activeTurn: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
4393
+ id: z.core.$ZodBranded<z.ZodString, "TurnId">;
4394
+ status: z.ZodEnum<{
4395
+ running: "running";
4396
+ cancelling: "cancelling";
4397
+ }>;
4398
+ startedAt: z.ZodString;
4399
+ }, z.core.$strict>>>;
4400
+ pendingApprovals: z.ZodArray<z.ZodReadonly<z.ZodObject<{
4401
+ id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
4402
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
4403
+ agentName: z.ZodString;
4404
+ toolName: z.ZodString;
4405
+ preview: z.ZodJSONSchema;
4406
+ reason: z.ZodOptional<z.ZodString>;
4407
+ }, z.core.$strict>>>;
4408
+ transcriptCompleteness: z.ZodEnum<{
4409
+ complete: "complete";
4410
+ legacy_snapshot: "legacy_snapshot";
4411
+ }>;
4412
+ }, z.core.$strict>>;
4413
+ };
4414
+ readonly "thread.snapshot": {
4415
+ readonly params: z.ZodReadonly<z.ZodObject<{
4416
+ messageBeforeSequence: z.ZodOptional<z.ZodNumber>;
4417
+ operationBeforeSequence: z.ZodOptional<z.ZodNumber>;
4418
+ limit: z.ZodDefault<z.ZodNumber>;
4419
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4420
+ }, z.core.$strict>>;
4421
+ readonly result: z.ZodReadonly<z.ZodObject<{
4422
+ thread: z.ZodReadonly<z.ZodObject<{
4423
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4424
+ title: z.ZodOptional<z.ZodString>;
4425
+ model: z.ZodOptional<z.ZodString>;
4426
+ createdAt: z.ZodString;
4427
+ updatedAt: z.ZodString;
4428
+ messageCount: z.ZodNumber;
4429
+ }, z.core.$strict>>;
4430
+ messages: z.ZodReadonly<z.ZodObject<{
4431
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
4432
+ sequence: z.ZodNumber;
4433
+ role: z.ZodEnum<{
4434
+ user: "user";
4435
+ assistant: "assistant";
4436
+ }>;
4437
+ createdAt: z.ZodString;
4438
+ parts: z.ZodArray<z.ZodReadonly<z.ZodObject<{
4439
+ type: z.ZodLiteral<"text">;
4440
+ text: z.ZodString;
4441
+ }, z.core.$strict>>>;
4442
+ }, z.core.$strict>>>;
4443
+ nextBeforeSequence: z.ZodNullable<z.ZodNumber>;
4444
+ }, z.core.$strict>>;
4445
+ operations: z.ZodReadonly<z.ZodObject<{
4446
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
4447
+ id: z.core.$ZodBranded<z.ZodString, "OperationId">;
4448
+ sequence: z.ZodNumber;
4449
+ toolCallId: z.ZodString;
4450
+ agentName: z.ZodString;
4451
+ toolName: z.ZodString;
4452
+ createdAt: z.ZodString;
4453
+ outcome: z.ZodReadonly<z.ZodObject<{
4454
+ kind: z.ZodEnum<{
4455
+ success: "success";
4456
+ user_rejected: "user_rejected";
4457
+ policy_denied: "policy_denied";
4458
+ invalid_input: "invalid_input";
4459
+ cancelled: "cancelled";
4460
+ tool_failed: "tool_failed";
4461
+ }>;
4462
+ reason: z.ZodOptional<z.ZodString>;
4463
+ }, z.core.$strict>>;
4464
+ display: z.ZodJSONSchema;
4465
+ }, z.core.$strict>>>;
4466
+ nextBeforeSequence: z.ZodNullable<z.ZodNumber>;
4467
+ }, z.core.$strict>>;
4468
+ activeTurn: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
4469
+ id: z.core.$ZodBranded<z.ZodString, "TurnId">;
4470
+ status: z.ZodEnum<{
4471
+ running: "running";
4472
+ cancelling: "cancelling";
4473
+ }>;
4474
+ startedAt: z.ZodString;
4475
+ }, z.core.$strict>>>;
4476
+ pendingApprovals: z.ZodArray<z.ZodReadonly<z.ZodObject<{
4477
+ id: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
4478
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
4479
+ agentName: z.ZodString;
4480
+ toolName: z.ZodString;
4481
+ preview: z.ZodJSONSchema;
4482
+ reason: z.ZodOptional<z.ZodString>;
4483
+ }, z.core.$strict>>>;
4484
+ transcriptCompleteness: z.ZodEnum<{
4485
+ complete: "complete";
4486
+ legacy_snapshot: "legacy_snapshot";
4487
+ }>;
4488
+ }, z.core.$strict>>;
4489
+ };
4490
+ readonly "thread.rename": {
4491
+ readonly params: z.ZodReadonly<z.ZodObject<{
4492
+ title: z.ZodString;
4493
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4494
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
4495
+ }, z.core.$strict>>;
4496
+ readonly result: z.ZodReadonly<z.ZodObject<{
4497
+ thread: z.ZodReadonly<z.ZodObject<{
4498
+ id: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4499
+ title: z.ZodOptional<z.ZodString>;
4500
+ model: z.ZodOptional<z.ZodString>;
4501
+ createdAt: z.ZodString;
4502
+ updatedAt: z.ZodString;
4503
+ messageCount: z.ZodNumber;
4504
+ }, z.core.$strict>>;
4505
+ }, z.core.$strict>>;
4506
+ };
4507
+ readonly "thread.delete": {
4508
+ readonly params: z.ZodReadonly<z.ZodObject<{
4509
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4510
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
4511
+ }, z.core.$strict>>;
4512
+ readonly result: z.ZodReadonly<z.ZodObject<{
4513
+ deleted: z.ZodLiteral<true>;
4514
+ }, z.core.$strict>>;
4515
+ };
4516
+ readonly "thread.detach": {
4517
+ readonly params: z.ZodReadonly<z.ZodObject<{
4518
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4519
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
4520
+ }, z.core.$strict>>;
4521
+ readonly result: z.ZodReadonly<z.ZodObject<{
4522
+ detached: z.ZodBoolean;
4523
+ }, z.core.$strict>>;
4524
+ };
4525
+ readonly "thread.capabilities": {
4526
+ readonly params: z.ZodReadonly<z.ZodObject<{
4527
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4528
+ }, z.core.$strict>>;
4529
+ readonly result: z.ZodReadonly<z.ZodObject<{
4530
+ manifest: z.ZodJSONSchema;
4531
+ }, z.core.$strict>>;
4532
+ };
4533
+ readonly "turn.start": {
4534
+ readonly params: z.ZodReadonly<z.ZodObject<{
4535
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
4536
+ input: z.ZodReadonly<z.ZodObject<{
4537
+ text: z.ZodString;
4538
+ }, z.core.$strict>>;
4539
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4540
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
4541
+ }, z.core.$strict>>;
4542
+ readonly result: z.ZodReadonly<z.ZodObject<{
4543
+ accepted: z.ZodLiteral<true>;
4544
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
4545
+ }, z.core.$strict>>;
4546
+ };
4547
+ readonly "turn.cancel": {
4548
+ readonly params: z.ZodReadonly<z.ZodObject<{
4549
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
4550
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4551
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
4552
+ }, z.core.$strict>>;
4553
+ readonly result: z.ZodReadonly<z.ZodObject<{
4554
+ cancelling: z.ZodBoolean;
4555
+ }, z.core.$strict>>;
4556
+ };
4557
+ readonly "approval.respond": {
4558
+ readonly params: z.ZodReadonly<z.ZodObject<{
4559
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
4560
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
4561
+ decision: z.ZodEnum<{
4562
+ approve: "approve";
4563
+ reject: "reject";
4564
+ }>;
4565
+ reason: z.ZodOptional<z.ZodString>;
4566
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4567
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId">;
4568
+ }, z.core.$strict>>;
4569
+ readonly result: z.ZodReadonly<z.ZodObject<{
4570
+ resolved: z.ZodLiteral<true>;
4571
+ }, z.core.$strict>>;
4572
+ };
4573
+ readonly "operation.get": {
4574
+ readonly params: z.ZodReadonly<z.ZodObject<{
4575
+ operationId: z.core.$ZodBranded<z.ZodString, "OperationId">;
4576
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4577
+ }, z.core.$strict>>;
4578
+ readonly result: z.ZodReadonly<z.ZodObject<{
4579
+ operation: z.ZodNullable<z.ZodReadonly<z.ZodObject<{
4580
+ id: z.core.$ZodBranded<z.ZodString, "OperationId">;
4581
+ sequence: z.ZodNumber;
4582
+ toolCallId: z.ZodString;
4583
+ agentName: z.ZodString;
4584
+ toolName: z.ZodString;
4585
+ createdAt: z.ZodString;
4586
+ outcome: z.ZodReadonly<z.ZodObject<{
4587
+ kind: z.ZodEnum<{
4588
+ success: "success";
4589
+ user_rejected: "user_rejected";
4590
+ policy_denied: "policy_denied";
4591
+ invalid_input: "invalid_input";
4592
+ cancelled: "cancelled";
4593
+ tool_failed: "tool_failed";
4594
+ }>;
4595
+ reason: z.ZodOptional<z.ZodString>;
4596
+ }, z.core.$strict>>;
4597
+ display: z.ZodJSONSchema;
4598
+ }, z.core.$strict>>>;
4599
+ }, z.core.$strict>>;
4600
+ };
4601
+ readonly "approval.candidate": {
4602
+ readonly params: z.ZodReadonly<z.ZodObject<{
4603
+ threadId: z.core.$ZodBranded<z.ZodString, "ThreadId">;
4604
+ turnId: z.core.$ZodBranded<z.ZodString, "TurnId">;
4605
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId">;
4606
+ decision: z.ZodEnum<{
4607
+ approve: "approve";
4608
+ reject: "reject";
4609
+ }>;
4610
+ reason: z.ZodOptional<z.ZodString>;
4611
+ }, z.core.$strict>>;
4612
+ readonly result: z.ZodReadonly<z.ZodObject<{
4613
+ accepted: z.ZodLiteral<true>;
4614
+ }, z.core.$strict>>;
4615
+ };
4616
+ };
4617
+ readonly requestMethodDispositions: {
4618
+ readonly initialize: "local-only";
4619
+ readonly "thread.list": "query";
4620
+ readonly "thread.create": "mutation";
4621
+ readonly "thread.open": "query";
4622
+ readonly "thread.snapshot": "query";
4623
+ readonly "thread.rename": "mutation";
4624
+ readonly "thread.delete": "mutation";
4625
+ readonly "thread.detach": "mutation";
4626
+ readonly "thread.capabilities": "query";
4627
+ readonly "turn.start": "mutation";
4628
+ readonly "turn.cancel": "mutation";
4629
+ readonly "approval.respond": "mutation";
4630
+ readonly "operation.get": "query";
4631
+ readonly "approval.candidate": "mutation";
4632
+ };
1009
4633
  readonly mutationMethods: readonly ["thread.create", "thread.rename", "thread.delete", "thread.detach", "turn.start", "turn.cancel", "approval.respond", "approval.candidate"];
1010
4634
  readonly localOnlyMethods: readonly ["initialize"];
1011
4635
  };
1012
4636
  };
1013
- export declare function getRelayProtocolRegistry(version: RelayProtocolVersion): RelayProtocolRegistry;
4637
+ type RelayProtocolRegistryMap = typeof RELAY_PROTOCOL_REGISTRY;
4638
+ type RelaySchemaParams<TDefinition> = TDefinition extends {
4639
+ readonly params: infer TSchema extends z.ZodType;
4640
+ } ? TSchema : never;
4641
+ type RelaySchemaResult<TDefinition> = TDefinition extends {
4642
+ readonly result: infer TSchema extends z.ZodType;
4643
+ } ? TSchema : never;
4644
+ export type RelayMessageForVersion<TVersion extends RelayProtocolVersion> = z.output<RelayProtocolRegistryMap[TVersion]["messageSchema"]>;
4645
+ export type RelayRequestMethodForVersion<TVersion extends RelayProtocolVersion> = Extract<keyof RelayProtocolRegistryMap[TVersion]["requestMethodSchemas"], string>;
4646
+ type RelayRequestMethodDefinitionForVersion<TVersion extends RelayProtocolVersion, TMethod extends RelayRequestMethodForVersion<TVersion>> = TMethod extends keyof RelayProtocolRegistryMap[TVersion]["requestMethodSchemas"] ? RelayProtocolRegistryMap[TVersion]["requestMethodSchemas"][TMethod] : never;
4647
+ export type RelayRequestParamsForVersion<TVersion extends RelayProtocolVersion, TMethod extends RelayRequestMethodForVersion<TVersion>> = z.output<RelaySchemaParams<RelayRequestMethodDefinitionForVersion<TVersion, TMethod>>>;
4648
+ export type RelayRequestResultForVersion<TVersion extends RelayProtocolVersion, TMethod extends RelayRequestMethodForVersion<TVersion>> = z.output<RelaySchemaResult<RelayRequestMethodDefinitionForVersion<TVersion, TMethod>>>;
4649
+ export type RelayRequestMethodDispositionForVersion<TVersion extends RelayProtocolVersion> = RelayProtocolRegistryMap[TVersion]["requestMethodDispositions"][keyof RelayProtocolRegistryMap[TVersion]["requestMethodDispositions"]];
4650
+ export declare function getRelayProtocolRegistry<TVersion extends RelayProtocolVersion>(version: TVersion): RelayProtocolRegistryMap[TVersion];
4651
+ export declare function parseRelayMessageForVersion<TVersion extends RelayProtocolVersion>(version: TVersion, value: unknown): RelayMessageForVersion<TVersion>;
4652
+ export declare function isRelayRequestMethodForVersion<TVersion extends RelayProtocolVersion>(version: TVersion, value: string): value is RelayRequestMethodForVersion<TVersion>;
4653
+ export declare function getRelayRequestMethodDispositionForVersion<TVersion extends RelayProtocolVersion>(version: TVersion, value: string): RelayRequestMethodDispositionForVersion<TVersion> | undefined;
4654
+ export declare function parseRelayRequestParamsForVersion<TVersion extends RelayProtocolVersion, TMethod extends RelayRequestMethodForVersion<TVersion>>(version: TVersion, method: TMethod, value: unknown): RelayRequestParamsForVersion<TVersion, TMethod>;
4655
+ export declare function parseRelayRequestResultForVersion<TVersion extends RelayProtocolVersion, TMethod extends RelayRequestMethodForVersion<TVersion>>(version: TVersion, method: TMethod, value: unknown): RelayRequestResultForVersion<TVersion, TMethod>;
4656
+ export declare function parseRelayInteractionCandidateForRequestV11(request: RelayInteractionRequestV11, candidate: unknown): RelayInteractionCandidateParamsV11;
1014
4657
  export declare function negotiateRelayProtocolVersion(peerVersions: readonly string[]): RelayProtocolVersion | undefined;
1015
4658
  export declare function canonicalizeRelayJson(value: JsonValue): string;
1016
4659
  export declare const RELAY_REQUEST_REPLAY_DISPOSITIONS: {
@@ -1025,7 +4668,13 @@ export type RelayRequestReplayClassification = {
1025
4668
  readonly disposition: typeof RELAY_REQUEST_REPLAY_DISPOSITIONS.conflict;
1026
4669
  readonly errorCode: typeof RELAY_ERROR_CODES.requestIdConflict;
1027
4670
  };
1028
- export declare function classifyRelayRequestReplay(existing: RelayRuntimeRequest, candidate: RelayRuntimeRequest): RelayRequestReplayClassification;
4671
+ export interface RelayReplayableRuntimeRequest {
4672
+ readonly requestId: RelayRequestId;
4673
+ readonly workspaceId: WorkspaceId;
4674
+ readonly method: string;
4675
+ readonly params: JsonValue;
4676
+ }
4677
+ export declare function classifyRelayRequestReplay(existing: RelayReplayableRuntimeRequest, candidate: RelayReplayableRuntimeRequest): RelayRequestReplayClassification;
1029
4678
  export interface RelayAckState {
1030
4679
  readonly acknowledgedThrough: number;
1031
4680
  /** Highest sequence the caller has proved was delivered without a preceding send hole. */
@@ -1038,13 +4687,38 @@ export type DeviceId = z.infer<typeof deviceIdSchema>;
1038
4687
  export type WorkspaceId = z.infer<typeof workspaceIdSchema>;
1039
4688
  export type RelayRequestId = z.infer<typeof relayRequestIdSchema>;
1040
4689
  export type RelayEnvelopeId = z.infer<typeof relayEnvelopeIdSchema>;
4690
+ export type InteractionId = z.output<typeof relayInteractionIdSchema>;
1041
4691
  export type RelayApprovalCandidateInput = z.input<typeof relayApprovalCandidateParamsSchema>;
1042
4692
  export type RelayApprovalCandidateParams = z.infer<typeof relayApprovalCandidateParamsSchema>;
1043
4693
  export type RelayApprovalCandidateResult = z.infer<typeof relayApprovalCandidateResultSchema>;
1044
4694
  export type RelayError = z.infer<typeof relayErrorSchema>;
4695
+ export type RelayInteractionMethodV11 = (typeof RELAY_INTERACTION_METHOD_VALUES_V11)[number];
4696
+ export type RelayApprovalInteractionProjectionV11 = z.output<typeof relayApprovalInteractionProjectionSchemaV11>;
4697
+ export type RelayUserInputInteractionProjectionV11 = z.output<typeof relayUserInputInteractionProjectionSchemaV11>;
4698
+ export type RelayInteractionCandidateParamsV11 = z.output<typeof relayInteractionCandidateParamsSchemaV11>;
4699
+ export type RelayInteractionCandidateResultV11 = z.output<typeof relayInteractionCandidateResultSchemaV11>;
4700
+ export type RelayInteractionRequestV11 = z.output<typeof relayInteractionRequestSchemaV11>;
4701
+ export type RelayInteractionResolvedV11 = z.output<typeof relayInteractionResolvedSchemaV11>;
4702
+ export type RelayInteractionCancelledV11 = z.output<typeof relayInteractionCancelledSchemaV11>;
4703
+ export type RelayTimelineEventV11 = z.output<typeof relayTimelineEventSchemaV11>;
4704
+ export type RelayRuntimeEventEnvelopeV11 = z.output<typeof relayRuntimeEventEnvelopeSchemaV11>;
4705
+ export type RelayMessageV10 = z.output<typeof relayMessageSchemaV10>;
4706
+ export type RelayMessageV11 = z.output<typeof relayMessageSchemaV11>;
4707
+ export type RelayRuntimeRequestV10 = z.output<typeof relayRuntimeRequestSchemaV10>;
4708
+ export type RelayRuntimeRequestV11 = z.output<typeof relayRuntimeRequestSchemaV11>;
4709
+ export type RelayRuntimeEventV10 = z.output<typeof relayRuntimeEventSchemaV10>;
4710
+ export type RelayRuntimeEventV11 = z.output<typeof relayRuntimeEventSchemaV11>;
4711
+ export type RelayEncryptedMessageV10 = z.output<typeof relayEncryptedMessageSchemaV10>;
4712
+ export type RelayEncryptedMessageV11 = z.output<typeof relayEncryptedMessageSchemaV11>;
4713
+ /** @deprecated Legacy generic Relay types remain pinned to Wire 1.0. */
1045
4714
  export type RelayMessage = z.infer<typeof relayMessageSchema>;
4715
+ /** @deprecated Legacy generic Relay types remain pinned to Wire 1.0. */
1046
4716
  export type RelayRuntimeRequest = z.infer<typeof relayRuntimeRequestSchema>;
4717
+ /** @deprecated Legacy generic Relay types remain pinned to Wire 1.0. */
1047
4718
  export type RelayRuntimeResponse = z.infer<typeof relayRuntimeResponseSchema>;
4719
+ /** @deprecated Legacy generic Relay types remain pinned to Wire 1.0. */
1048
4720
  export type RelayRuntimeEvent = z.infer<typeof relayRuntimeEventSchema>;
1049
4721
  export type RelayGap = z.infer<typeof relayGapSchema>;
4722
+ /** @deprecated Legacy generic Relay types remain pinned to Wire 1.0. */
1050
4723
  export type RelayEncryptedMessage = z.infer<typeof relayEncryptedMessageSchema>;
4724
+ export {};