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