@ravi-os/sdk 0.260724.1 → 0.260725.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,801 @@
1
+ import { z } from "zod";
2
+ export declare const CHANNEL_RUNTIME_EVENTS_PROTOCOL: "ravi.channel.runtime-events";
3
+ export declare const CHANNEL_RUNTIME_EVENTS_SCHEMA_VERSION: 1;
4
+ export declare const ChannelRuntimeCorrelationSchema: z.ZodObject<{
5
+ correlationId: z.ZodString;
6
+ causationId: z.ZodOptional<z.ZodString>;
7
+ ingressRequestId: z.ZodString;
8
+ binding: z.ZodObject<{
9
+ channelInstanceId: z.ZodString;
10
+ agentId: z.ZodString;
11
+ chatId: z.ZodString;
12
+ messageId: z.ZodString;
13
+ sessionId: z.ZodString;
14
+ turnId: z.ZodString;
15
+ }, z.core.$strip>;
16
+ }, z.core.$strip>;
17
+ export declare const ChannelTurnStateSchema: z.ZodEnum<{
18
+ accepted: "accepted";
19
+ running: "running";
20
+ waiting_approval: "waiting_approval";
21
+ completed: "completed";
22
+ failed: "failed";
23
+ interrupted: "interrupted";
24
+ }>;
25
+ export declare const ChannelTurnStateChangedPayloadSchema: z.ZodObject<{
26
+ state: z.ZodEnum<{
27
+ accepted: "accepted";
28
+ running: "running";
29
+ waiting_approval: "waiting_approval";
30
+ completed: "completed";
31
+ failed: "failed";
32
+ interrupted: "interrupted";
33
+ }>;
34
+ error: z.ZodOptional<z.ZodObject<{
35
+ code: z.ZodEnum<{
36
+ INVALID_REQUEST: "INVALID_REQUEST";
37
+ IDEMPOTENCY_CONFLICT: "IDEMPOTENCY_CONFLICT";
38
+ UNAUTHENTICATED: "UNAUTHENTICATED";
39
+ PERMISSION_DENIED: "PERMISSION_DENIED";
40
+ LOCAL_PERMISSION_DENIED: "LOCAL_PERMISSION_DENIED";
41
+ NOT_FOUND: "NOT_FOUND";
42
+ RATE_LIMITED: "RATE_LIMITED";
43
+ OVERLOADED: "OVERLOADED";
44
+ UNAVAILABLE: "UNAVAILABLE";
45
+ INTERNAL: "INTERNAL";
46
+ }>;
47
+ category: z.ZodEnum<{
48
+ validation: "validation";
49
+ authentication: "authentication";
50
+ authorization: "authorization";
51
+ capacity: "capacity";
52
+ availability: "availability";
53
+ internal: "internal";
54
+ }>;
55
+ retryable: z.ZodBoolean;
56
+ correlationId: z.ZodOptional<z.ZodString>;
57
+ retryAfterMs: z.ZodOptional<z.ZodNumber>;
58
+ }, z.core.$strip>>;
59
+ }, z.core.$strip>;
60
+ export declare const ChannelAssistantDeltaPayloadSchema: z.ZodObject<{
61
+ blockIndex: z.ZodNumber;
62
+ deltaSequence: z.ZodNumber;
63
+ text: z.ZodString;
64
+ }, z.core.$strip>;
65
+ export declare const ChannelTerminalOutputPayloadSchema: z.ZodObject<{
66
+ state: z.ZodEnum<{
67
+ completed: "completed";
68
+ failed: "failed";
69
+ interrupted: "interrupted";
70
+ }>;
71
+ assistantMessageId: z.ZodOptional<z.ZodString>;
72
+ content: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
73
+ type: z.ZodLiteral<"text">;
74
+ text: z.ZodString;
75
+ }, z.core.$strip>, z.ZodObject<{
76
+ type: z.ZodLiteral<"artifact">;
77
+ artifactId: z.ZodString;
78
+ name: z.ZodOptional<z.ZodString>;
79
+ mediaType: z.ZodOptional<z.ZodString>;
80
+ sizeBytes: z.ZodOptional<z.ZodNumber>;
81
+ }, z.core.$strip>], "type">>>;
82
+ error: z.ZodOptional<z.ZodObject<{
83
+ code: z.ZodEnum<{
84
+ INVALID_REQUEST: "INVALID_REQUEST";
85
+ IDEMPOTENCY_CONFLICT: "IDEMPOTENCY_CONFLICT";
86
+ UNAUTHENTICATED: "UNAUTHENTICATED";
87
+ PERMISSION_DENIED: "PERMISSION_DENIED";
88
+ LOCAL_PERMISSION_DENIED: "LOCAL_PERMISSION_DENIED";
89
+ NOT_FOUND: "NOT_FOUND";
90
+ RATE_LIMITED: "RATE_LIMITED";
91
+ OVERLOADED: "OVERLOADED";
92
+ UNAVAILABLE: "UNAVAILABLE";
93
+ INTERNAL: "INTERNAL";
94
+ }>;
95
+ category: z.ZodEnum<{
96
+ validation: "validation";
97
+ authentication: "authentication";
98
+ authorization: "authorization";
99
+ capacity: "capacity";
100
+ availability: "availability";
101
+ internal: "internal";
102
+ }>;
103
+ retryable: z.ZodBoolean;
104
+ correlationId: z.ZodOptional<z.ZodString>;
105
+ retryAfterMs: z.ZodOptional<z.ZodNumber>;
106
+ }, z.core.$strip>>;
107
+ }, z.core.$strip>;
108
+ export declare const ChannelToolSummaryPayloadSchema: z.ZodObject<{
109
+ toolCallId: z.ZodString;
110
+ toolName: z.ZodString;
111
+ phase: z.ZodEnum<{
112
+ running: "running";
113
+ completed: "completed";
114
+ failed: "failed";
115
+ requested: "requested";
116
+ denied: "denied";
117
+ }>;
118
+ error: z.ZodOptional<z.ZodObject<{
119
+ code: z.ZodEnum<{
120
+ INVALID_REQUEST: "INVALID_REQUEST";
121
+ IDEMPOTENCY_CONFLICT: "IDEMPOTENCY_CONFLICT";
122
+ UNAUTHENTICATED: "UNAUTHENTICATED";
123
+ PERMISSION_DENIED: "PERMISSION_DENIED";
124
+ LOCAL_PERMISSION_DENIED: "LOCAL_PERMISSION_DENIED";
125
+ NOT_FOUND: "NOT_FOUND";
126
+ RATE_LIMITED: "RATE_LIMITED";
127
+ OVERLOADED: "OVERLOADED";
128
+ UNAVAILABLE: "UNAVAILABLE";
129
+ INTERNAL: "INTERNAL";
130
+ }>;
131
+ category: z.ZodEnum<{
132
+ validation: "validation";
133
+ authentication: "authentication";
134
+ authorization: "authorization";
135
+ capacity: "capacity";
136
+ availability: "availability";
137
+ internal: "internal";
138
+ }>;
139
+ retryable: z.ZodBoolean;
140
+ correlationId: z.ZodOptional<z.ZodString>;
141
+ retryAfterMs: z.ZodOptional<z.ZodNumber>;
142
+ }, z.core.$strip>>;
143
+ }, z.core.$strip>;
144
+ export declare const ChannelApprovalRequestedPayloadSchema: z.ZodObject<{
145
+ approvalId: z.ZodString;
146
+ action: z.ZodString;
147
+ risk: z.ZodOptional<z.ZodEnum<{
148
+ low: "low";
149
+ medium: "medium";
150
+ high: "high";
151
+ }>>;
152
+ expiresAt: z.ZodOptional<z.ZodString>;
153
+ }, z.core.$strip>;
154
+ export declare const ChannelApprovalResolvedPayloadSchema: z.ZodObject<{
155
+ approvalId: z.ZodString;
156
+ decision: z.ZodEnum<{
157
+ denied: "denied";
158
+ approved: "approved";
159
+ cancelled: "cancelled";
160
+ expired: "expired";
161
+ }>;
162
+ }, z.core.$strip>;
163
+ export declare const ChannelTurnStateChangedEventSchema: z.ZodObject<{
164
+ protocol: z.ZodLiteral<"ravi.channel.runtime-events">;
165
+ schemaVersion: z.ZodLiteral<1>;
166
+ eventId: z.ZodString;
167
+ occurredAt: z.ZodString;
168
+ sequence: z.ZodNumber;
169
+ correlation: z.ZodObject<{
170
+ correlationId: z.ZodString;
171
+ causationId: z.ZodOptional<z.ZodString>;
172
+ ingressRequestId: z.ZodString;
173
+ binding: z.ZodObject<{
174
+ channelInstanceId: z.ZodString;
175
+ agentId: z.ZodString;
176
+ chatId: z.ZodString;
177
+ messageId: z.ZodString;
178
+ sessionId: z.ZodString;
179
+ turnId: z.ZodString;
180
+ }, z.core.$strip>;
181
+ }, z.core.$strip>;
182
+ kind: z.ZodLiteral<"turn.state_changed">;
183
+ payload: z.ZodObject<{
184
+ state: z.ZodEnum<{
185
+ accepted: "accepted";
186
+ running: "running";
187
+ waiting_approval: "waiting_approval";
188
+ completed: "completed";
189
+ failed: "failed";
190
+ interrupted: "interrupted";
191
+ }>;
192
+ error: z.ZodOptional<z.ZodObject<{
193
+ code: z.ZodEnum<{
194
+ INVALID_REQUEST: "INVALID_REQUEST";
195
+ IDEMPOTENCY_CONFLICT: "IDEMPOTENCY_CONFLICT";
196
+ UNAUTHENTICATED: "UNAUTHENTICATED";
197
+ PERMISSION_DENIED: "PERMISSION_DENIED";
198
+ LOCAL_PERMISSION_DENIED: "LOCAL_PERMISSION_DENIED";
199
+ NOT_FOUND: "NOT_FOUND";
200
+ RATE_LIMITED: "RATE_LIMITED";
201
+ OVERLOADED: "OVERLOADED";
202
+ UNAVAILABLE: "UNAVAILABLE";
203
+ INTERNAL: "INTERNAL";
204
+ }>;
205
+ category: z.ZodEnum<{
206
+ validation: "validation";
207
+ authentication: "authentication";
208
+ authorization: "authorization";
209
+ capacity: "capacity";
210
+ availability: "availability";
211
+ internal: "internal";
212
+ }>;
213
+ retryable: z.ZodBoolean;
214
+ correlationId: z.ZodOptional<z.ZodString>;
215
+ retryAfterMs: z.ZodOptional<z.ZodNumber>;
216
+ }, z.core.$strip>>;
217
+ }, z.core.$strip>;
218
+ }, z.core.$strip>;
219
+ export declare const ChannelAssistantDeltaEventSchema: z.ZodObject<{
220
+ protocol: z.ZodLiteral<"ravi.channel.runtime-events">;
221
+ schemaVersion: z.ZodLiteral<1>;
222
+ eventId: z.ZodString;
223
+ occurredAt: z.ZodString;
224
+ sequence: z.ZodNumber;
225
+ correlation: z.ZodObject<{
226
+ correlationId: z.ZodString;
227
+ causationId: z.ZodOptional<z.ZodString>;
228
+ ingressRequestId: z.ZodString;
229
+ binding: z.ZodObject<{
230
+ channelInstanceId: z.ZodString;
231
+ agentId: z.ZodString;
232
+ chatId: z.ZodString;
233
+ messageId: z.ZodString;
234
+ sessionId: z.ZodString;
235
+ turnId: z.ZodString;
236
+ }, z.core.$strip>;
237
+ }, z.core.$strip>;
238
+ kind: z.ZodLiteral<"turn.assistant_delta">;
239
+ payload: z.ZodObject<{
240
+ blockIndex: z.ZodNumber;
241
+ deltaSequence: z.ZodNumber;
242
+ text: z.ZodString;
243
+ }, z.core.$strip>;
244
+ }, z.core.$strip>;
245
+ export declare const ChannelTerminalOutputEventSchema: z.ZodObject<{
246
+ protocol: z.ZodLiteral<"ravi.channel.runtime-events">;
247
+ schemaVersion: z.ZodLiteral<1>;
248
+ eventId: z.ZodString;
249
+ occurredAt: z.ZodString;
250
+ sequence: z.ZodNumber;
251
+ correlation: z.ZodObject<{
252
+ correlationId: z.ZodString;
253
+ causationId: z.ZodOptional<z.ZodString>;
254
+ ingressRequestId: z.ZodString;
255
+ binding: z.ZodObject<{
256
+ channelInstanceId: z.ZodString;
257
+ agentId: z.ZodString;
258
+ chatId: z.ZodString;
259
+ messageId: z.ZodString;
260
+ sessionId: z.ZodString;
261
+ turnId: z.ZodString;
262
+ }, z.core.$strip>;
263
+ }, z.core.$strip>;
264
+ kind: z.ZodLiteral<"turn.terminal_output">;
265
+ payload: z.ZodObject<{
266
+ state: z.ZodEnum<{
267
+ completed: "completed";
268
+ failed: "failed";
269
+ interrupted: "interrupted";
270
+ }>;
271
+ assistantMessageId: z.ZodOptional<z.ZodString>;
272
+ content: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
273
+ type: z.ZodLiteral<"text">;
274
+ text: z.ZodString;
275
+ }, z.core.$strip>, z.ZodObject<{
276
+ type: z.ZodLiteral<"artifact">;
277
+ artifactId: z.ZodString;
278
+ name: z.ZodOptional<z.ZodString>;
279
+ mediaType: z.ZodOptional<z.ZodString>;
280
+ sizeBytes: z.ZodOptional<z.ZodNumber>;
281
+ }, z.core.$strip>], "type">>>;
282
+ error: z.ZodOptional<z.ZodObject<{
283
+ code: z.ZodEnum<{
284
+ INVALID_REQUEST: "INVALID_REQUEST";
285
+ IDEMPOTENCY_CONFLICT: "IDEMPOTENCY_CONFLICT";
286
+ UNAUTHENTICATED: "UNAUTHENTICATED";
287
+ PERMISSION_DENIED: "PERMISSION_DENIED";
288
+ LOCAL_PERMISSION_DENIED: "LOCAL_PERMISSION_DENIED";
289
+ NOT_FOUND: "NOT_FOUND";
290
+ RATE_LIMITED: "RATE_LIMITED";
291
+ OVERLOADED: "OVERLOADED";
292
+ UNAVAILABLE: "UNAVAILABLE";
293
+ INTERNAL: "INTERNAL";
294
+ }>;
295
+ category: z.ZodEnum<{
296
+ validation: "validation";
297
+ authentication: "authentication";
298
+ authorization: "authorization";
299
+ capacity: "capacity";
300
+ availability: "availability";
301
+ internal: "internal";
302
+ }>;
303
+ retryable: z.ZodBoolean;
304
+ correlationId: z.ZodOptional<z.ZodString>;
305
+ retryAfterMs: z.ZodOptional<z.ZodNumber>;
306
+ }, z.core.$strip>>;
307
+ }, z.core.$strip>;
308
+ }, z.core.$strip>;
309
+ export declare const ChannelToolSummaryEventSchema: z.ZodObject<{
310
+ protocol: z.ZodLiteral<"ravi.channel.runtime-events">;
311
+ schemaVersion: z.ZodLiteral<1>;
312
+ eventId: z.ZodString;
313
+ occurredAt: z.ZodString;
314
+ sequence: z.ZodNumber;
315
+ correlation: z.ZodObject<{
316
+ correlationId: z.ZodString;
317
+ causationId: z.ZodOptional<z.ZodString>;
318
+ ingressRequestId: z.ZodString;
319
+ binding: z.ZodObject<{
320
+ channelInstanceId: z.ZodString;
321
+ agentId: z.ZodString;
322
+ chatId: z.ZodString;
323
+ messageId: z.ZodString;
324
+ sessionId: z.ZodString;
325
+ turnId: z.ZodString;
326
+ }, z.core.$strip>;
327
+ }, z.core.$strip>;
328
+ kind: z.ZodLiteral<"turn.tool_summary">;
329
+ payload: z.ZodObject<{
330
+ toolCallId: z.ZodString;
331
+ toolName: z.ZodString;
332
+ phase: z.ZodEnum<{
333
+ running: "running";
334
+ completed: "completed";
335
+ failed: "failed";
336
+ requested: "requested";
337
+ denied: "denied";
338
+ }>;
339
+ error: z.ZodOptional<z.ZodObject<{
340
+ code: z.ZodEnum<{
341
+ INVALID_REQUEST: "INVALID_REQUEST";
342
+ IDEMPOTENCY_CONFLICT: "IDEMPOTENCY_CONFLICT";
343
+ UNAUTHENTICATED: "UNAUTHENTICATED";
344
+ PERMISSION_DENIED: "PERMISSION_DENIED";
345
+ LOCAL_PERMISSION_DENIED: "LOCAL_PERMISSION_DENIED";
346
+ NOT_FOUND: "NOT_FOUND";
347
+ RATE_LIMITED: "RATE_LIMITED";
348
+ OVERLOADED: "OVERLOADED";
349
+ UNAVAILABLE: "UNAVAILABLE";
350
+ INTERNAL: "INTERNAL";
351
+ }>;
352
+ category: z.ZodEnum<{
353
+ validation: "validation";
354
+ authentication: "authentication";
355
+ authorization: "authorization";
356
+ capacity: "capacity";
357
+ availability: "availability";
358
+ internal: "internal";
359
+ }>;
360
+ retryable: z.ZodBoolean;
361
+ correlationId: z.ZodOptional<z.ZodString>;
362
+ retryAfterMs: z.ZodOptional<z.ZodNumber>;
363
+ }, z.core.$strip>>;
364
+ }, z.core.$strip>;
365
+ }, z.core.$strip>;
366
+ export declare const ChannelApprovalRequestedEventSchema: z.ZodObject<{
367
+ protocol: z.ZodLiteral<"ravi.channel.runtime-events">;
368
+ schemaVersion: z.ZodLiteral<1>;
369
+ eventId: z.ZodString;
370
+ occurredAt: z.ZodString;
371
+ sequence: z.ZodNumber;
372
+ correlation: z.ZodObject<{
373
+ correlationId: z.ZodString;
374
+ causationId: z.ZodOptional<z.ZodString>;
375
+ ingressRequestId: z.ZodString;
376
+ binding: z.ZodObject<{
377
+ channelInstanceId: z.ZodString;
378
+ agentId: z.ZodString;
379
+ chatId: z.ZodString;
380
+ messageId: z.ZodString;
381
+ sessionId: z.ZodString;
382
+ turnId: z.ZodString;
383
+ }, z.core.$strip>;
384
+ }, z.core.$strip>;
385
+ kind: z.ZodLiteral<"turn.approval_requested">;
386
+ payload: z.ZodObject<{
387
+ approvalId: z.ZodString;
388
+ action: z.ZodString;
389
+ risk: z.ZodOptional<z.ZodEnum<{
390
+ low: "low";
391
+ medium: "medium";
392
+ high: "high";
393
+ }>>;
394
+ expiresAt: z.ZodOptional<z.ZodString>;
395
+ }, z.core.$strip>;
396
+ }, z.core.$strip>;
397
+ export declare const ChannelApprovalResolvedEventSchema: z.ZodObject<{
398
+ protocol: z.ZodLiteral<"ravi.channel.runtime-events">;
399
+ schemaVersion: z.ZodLiteral<1>;
400
+ eventId: z.ZodString;
401
+ occurredAt: z.ZodString;
402
+ sequence: z.ZodNumber;
403
+ correlation: z.ZodObject<{
404
+ correlationId: z.ZodString;
405
+ causationId: z.ZodOptional<z.ZodString>;
406
+ ingressRequestId: z.ZodString;
407
+ binding: z.ZodObject<{
408
+ channelInstanceId: z.ZodString;
409
+ agentId: z.ZodString;
410
+ chatId: z.ZodString;
411
+ messageId: z.ZodString;
412
+ sessionId: z.ZodString;
413
+ turnId: z.ZodString;
414
+ }, z.core.$strip>;
415
+ }, z.core.$strip>;
416
+ kind: z.ZodLiteral<"turn.approval_resolved">;
417
+ payload: z.ZodObject<{
418
+ approvalId: z.ZodString;
419
+ decision: z.ZodEnum<{
420
+ denied: "denied";
421
+ approved: "approved";
422
+ cancelled: "cancelled";
423
+ expired: "expired";
424
+ }>;
425
+ }, z.core.$strip>;
426
+ }, z.core.$strip>;
427
+ export declare const KnownChannelRuntimeEventSchema: z.ZodUnion<readonly [z.ZodObject<{
428
+ protocol: z.ZodLiteral<"ravi.channel.runtime-events">;
429
+ schemaVersion: z.ZodLiteral<1>;
430
+ eventId: z.ZodString;
431
+ occurredAt: z.ZodString;
432
+ sequence: z.ZodNumber;
433
+ correlation: z.ZodObject<{
434
+ correlationId: z.ZodString;
435
+ causationId: z.ZodOptional<z.ZodString>;
436
+ ingressRequestId: z.ZodString;
437
+ binding: z.ZodObject<{
438
+ channelInstanceId: z.ZodString;
439
+ agentId: z.ZodString;
440
+ chatId: z.ZodString;
441
+ messageId: z.ZodString;
442
+ sessionId: z.ZodString;
443
+ turnId: z.ZodString;
444
+ }, z.core.$strip>;
445
+ }, z.core.$strip>;
446
+ kind: z.ZodLiteral<"turn.state_changed">;
447
+ payload: z.ZodObject<{
448
+ state: z.ZodEnum<{
449
+ accepted: "accepted";
450
+ running: "running";
451
+ waiting_approval: "waiting_approval";
452
+ completed: "completed";
453
+ failed: "failed";
454
+ interrupted: "interrupted";
455
+ }>;
456
+ error: z.ZodOptional<z.ZodObject<{
457
+ code: z.ZodEnum<{
458
+ INVALID_REQUEST: "INVALID_REQUEST";
459
+ IDEMPOTENCY_CONFLICT: "IDEMPOTENCY_CONFLICT";
460
+ UNAUTHENTICATED: "UNAUTHENTICATED";
461
+ PERMISSION_DENIED: "PERMISSION_DENIED";
462
+ LOCAL_PERMISSION_DENIED: "LOCAL_PERMISSION_DENIED";
463
+ NOT_FOUND: "NOT_FOUND";
464
+ RATE_LIMITED: "RATE_LIMITED";
465
+ OVERLOADED: "OVERLOADED";
466
+ UNAVAILABLE: "UNAVAILABLE";
467
+ INTERNAL: "INTERNAL";
468
+ }>;
469
+ category: z.ZodEnum<{
470
+ validation: "validation";
471
+ authentication: "authentication";
472
+ authorization: "authorization";
473
+ capacity: "capacity";
474
+ availability: "availability";
475
+ internal: "internal";
476
+ }>;
477
+ retryable: z.ZodBoolean;
478
+ correlationId: z.ZodOptional<z.ZodString>;
479
+ retryAfterMs: z.ZodOptional<z.ZodNumber>;
480
+ }, z.core.$strip>>;
481
+ }, z.core.$strip>;
482
+ }, z.core.$strip>, z.ZodObject<{
483
+ protocol: z.ZodLiteral<"ravi.channel.runtime-events">;
484
+ schemaVersion: z.ZodLiteral<1>;
485
+ eventId: z.ZodString;
486
+ occurredAt: z.ZodString;
487
+ sequence: z.ZodNumber;
488
+ correlation: z.ZodObject<{
489
+ correlationId: z.ZodString;
490
+ causationId: z.ZodOptional<z.ZodString>;
491
+ ingressRequestId: z.ZodString;
492
+ binding: z.ZodObject<{
493
+ channelInstanceId: z.ZodString;
494
+ agentId: z.ZodString;
495
+ chatId: z.ZodString;
496
+ messageId: z.ZodString;
497
+ sessionId: z.ZodString;
498
+ turnId: z.ZodString;
499
+ }, z.core.$strip>;
500
+ }, z.core.$strip>;
501
+ kind: z.ZodLiteral<"turn.assistant_delta">;
502
+ payload: z.ZodObject<{
503
+ blockIndex: z.ZodNumber;
504
+ deltaSequence: z.ZodNumber;
505
+ text: z.ZodString;
506
+ }, z.core.$strip>;
507
+ }, z.core.$strip>, z.ZodObject<{
508
+ protocol: z.ZodLiteral<"ravi.channel.runtime-events">;
509
+ schemaVersion: z.ZodLiteral<1>;
510
+ eventId: z.ZodString;
511
+ occurredAt: z.ZodString;
512
+ sequence: z.ZodNumber;
513
+ correlation: z.ZodObject<{
514
+ correlationId: z.ZodString;
515
+ causationId: z.ZodOptional<z.ZodString>;
516
+ ingressRequestId: z.ZodString;
517
+ binding: z.ZodObject<{
518
+ channelInstanceId: z.ZodString;
519
+ agentId: z.ZodString;
520
+ chatId: z.ZodString;
521
+ messageId: z.ZodString;
522
+ sessionId: z.ZodString;
523
+ turnId: z.ZodString;
524
+ }, z.core.$strip>;
525
+ }, z.core.$strip>;
526
+ kind: z.ZodLiteral<"turn.terminal_output">;
527
+ payload: z.ZodObject<{
528
+ state: z.ZodEnum<{
529
+ completed: "completed";
530
+ failed: "failed";
531
+ interrupted: "interrupted";
532
+ }>;
533
+ assistantMessageId: z.ZodOptional<z.ZodString>;
534
+ content: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
535
+ type: z.ZodLiteral<"text">;
536
+ text: z.ZodString;
537
+ }, z.core.$strip>, z.ZodObject<{
538
+ type: z.ZodLiteral<"artifact">;
539
+ artifactId: z.ZodString;
540
+ name: z.ZodOptional<z.ZodString>;
541
+ mediaType: z.ZodOptional<z.ZodString>;
542
+ sizeBytes: z.ZodOptional<z.ZodNumber>;
543
+ }, z.core.$strip>], "type">>>;
544
+ error: z.ZodOptional<z.ZodObject<{
545
+ code: z.ZodEnum<{
546
+ INVALID_REQUEST: "INVALID_REQUEST";
547
+ IDEMPOTENCY_CONFLICT: "IDEMPOTENCY_CONFLICT";
548
+ UNAUTHENTICATED: "UNAUTHENTICATED";
549
+ PERMISSION_DENIED: "PERMISSION_DENIED";
550
+ LOCAL_PERMISSION_DENIED: "LOCAL_PERMISSION_DENIED";
551
+ NOT_FOUND: "NOT_FOUND";
552
+ RATE_LIMITED: "RATE_LIMITED";
553
+ OVERLOADED: "OVERLOADED";
554
+ UNAVAILABLE: "UNAVAILABLE";
555
+ INTERNAL: "INTERNAL";
556
+ }>;
557
+ category: z.ZodEnum<{
558
+ validation: "validation";
559
+ authentication: "authentication";
560
+ authorization: "authorization";
561
+ capacity: "capacity";
562
+ availability: "availability";
563
+ internal: "internal";
564
+ }>;
565
+ retryable: z.ZodBoolean;
566
+ correlationId: z.ZodOptional<z.ZodString>;
567
+ retryAfterMs: z.ZodOptional<z.ZodNumber>;
568
+ }, z.core.$strip>>;
569
+ }, z.core.$strip>;
570
+ }, z.core.$strip>, z.ZodObject<{
571
+ protocol: z.ZodLiteral<"ravi.channel.runtime-events">;
572
+ schemaVersion: z.ZodLiteral<1>;
573
+ eventId: z.ZodString;
574
+ occurredAt: z.ZodString;
575
+ sequence: z.ZodNumber;
576
+ correlation: z.ZodObject<{
577
+ correlationId: z.ZodString;
578
+ causationId: z.ZodOptional<z.ZodString>;
579
+ ingressRequestId: z.ZodString;
580
+ binding: z.ZodObject<{
581
+ channelInstanceId: z.ZodString;
582
+ agentId: z.ZodString;
583
+ chatId: z.ZodString;
584
+ messageId: z.ZodString;
585
+ sessionId: z.ZodString;
586
+ turnId: z.ZodString;
587
+ }, z.core.$strip>;
588
+ }, z.core.$strip>;
589
+ kind: z.ZodLiteral<"turn.tool_summary">;
590
+ payload: z.ZodObject<{
591
+ toolCallId: z.ZodString;
592
+ toolName: z.ZodString;
593
+ phase: z.ZodEnum<{
594
+ running: "running";
595
+ completed: "completed";
596
+ failed: "failed";
597
+ requested: "requested";
598
+ denied: "denied";
599
+ }>;
600
+ error: z.ZodOptional<z.ZodObject<{
601
+ code: z.ZodEnum<{
602
+ INVALID_REQUEST: "INVALID_REQUEST";
603
+ IDEMPOTENCY_CONFLICT: "IDEMPOTENCY_CONFLICT";
604
+ UNAUTHENTICATED: "UNAUTHENTICATED";
605
+ PERMISSION_DENIED: "PERMISSION_DENIED";
606
+ LOCAL_PERMISSION_DENIED: "LOCAL_PERMISSION_DENIED";
607
+ NOT_FOUND: "NOT_FOUND";
608
+ RATE_LIMITED: "RATE_LIMITED";
609
+ OVERLOADED: "OVERLOADED";
610
+ UNAVAILABLE: "UNAVAILABLE";
611
+ INTERNAL: "INTERNAL";
612
+ }>;
613
+ category: z.ZodEnum<{
614
+ validation: "validation";
615
+ authentication: "authentication";
616
+ authorization: "authorization";
617
+ capacity: "capacity";
618
+ availability: "availability";
619
+ internal: "internal";
620
+ }>;
621
+ retryable: z.ZodBoolean;
622
+ correlationId: z.ZodOptional<z.ZodString>;
623
+ retryAfterMs: z.ZodOptional<z.ZodNumber>;
624
+ }, z.core.$strip>>;
625
+ }, z.core.$strip>;
626
+ }, z.core.$strip>, z.ZodObject<{
627
+ protocol: z.ZodLiteral<"ravi.channel.runtime-events">;
628
+ schemaVersion: z.ZodLiteral<1>;
629
+ eventId: z.ZodString;
630
+ occurredAt: z.ZodString;
631
+ sequence: z.ZodNumber;
632
+ correlation: z.ZodObject<{
633
+ correlationId: z.ZodString;
634
+ causationId: z.ZodOptional<z.ZodString>;
635
+ ingressRequestId: z.ZodString;
636
+ binding: z.ZodObject<{
637
+ channelInstanceId: z.ZodString;
638
+ agentId: z.ZodString;
639
+ chatId: z.ZodString;
640
+ messageId: z.ZodString;
641
+ sessionId: z.ZodString;
642
+ turnId: z.ZodString;
643
+ }, z.core.$strip>;
644
+ }, z.core.$strip>;
645
+ kind: z.ZodLiteral<"turn.approval_requested">;
646
+ payload: z.ZodObject<{
647
+ approvalId: z.ZodString;
648
+ action: z.ZodString;
649
+ risk: z.ZodOptional<z.ZodEnum<{
650
+ low: "low";
651
+ medium: "medium";
652
+ high: "high";
653
+ }>>;
654
+ expiresAt: z.ZodOptional<z.ZodString>;
655
+ }, z.core.$strip>;
656
+ }, z.core.$strip>, z.ZodObject<{
657
+ protocol: z.ZodLiteral<"ravi.channel.runtime-events">;
658
+ schemaVersion: z.ZodLiteral<1>;
659
+ eventId: z.ZodString;
660
+ occurredAt: z.ZodString;
661
+ sequence: z.ZodNumber;
662
+ correlation: z.ZodObject<{
663
+ correlationId: z.ZodString;
664
+ causationId: z.ZodOptional<z.ZodString>;
665
+ ingressRequestId: z.ZodString;
666
+ binding: z.ZodObject<{
667
+ channelInstanceId: z.ZodString;
668
+ agentId: z.ZodString;
669
+ chatId: z.ZodString;
670
+ messageId: z.ZodString;
671
+ sessionId: z.ZodString;
672
+ turnId: z.ZodString;
673
+ }, z.core.$strip>;
674
+ }, z.core.$strip>;
675
+ kind: z.ZodLiteral<"turn.approval_resolved">;
676
+ payload: z.ZodObject<{
677
+ approvalId: z.ZodString;
678
+ decision: z.ZodEnum<{
679
+ denied: "denied";
680
+ approved: "approved";
681
+ cancelled: "cancelled";
682
+ expired: "expired";
683
+ }>;
684
+ }, z.core.$strip>;
685
+ }, z.core.$strip>]>;
686
+ export declare const ChannelInterruptRequestSchema: z.ZodObject<{
687
+ protocol: z.ZodLiteral<"ravi.channel.runtime-events">;
688
+ schemaVersion: z.ZodLiteral<1>;
689
+ requestId: z.ZodString;
690
+ idempotencyKey: z.ZodString;
691
+ binding: z.ZodObject<{
692
+ channelInstanceId: z.ZodString;
693
+ agentId: z.ZodString;
694
+ chatId: z.ZodString;
695
+ messageId: z.ZodString;
696
+ sessionId: z.ZodString;
697
+ turnId: z.ZodString;
698
+ }, z.core.$strip>;
699
+ requestedAt: z.ZodString;
700
+ }, z.core.$strip>;
701
+ export declare const ChannelInterruptResultSchema: z.ZodObject<{
702
+ protocol: z.ZodLiteral<"ravi.channel.runtime-events">;
703
+ schemaVersion: z.ZodLiteral<1>;
704
+ requestId: z.ZodString;
705
+ disposition: z.ZodEnum<{
706
+ duplicate: "duplicate";
707
+ rejected: "rejected";
708
+ requested: "requested";
709
+ }>;
710
+ error: z.ZodOptional<z.ZodObject<{
711
+ code: z.ZodEnum<{
712
+ INVALID_REQUEST: "INVALID_REQUEST";
713
+ IDEMPOTENCY_CONFLICT: "IDEMPOTENCY_CONFLICT";
714
+ UNAUTHENTICATED: "UNAUTHENTICATED";
715
+ PERMISSION_DENIED: "PERMISSION_DENIED";
716
+ LOCAL_PERMISSION_DENIED: "LOCAL_PERMISSION_DENIED";
717
+ NOT_FOUND: "NOT_FOUND";
718
+ RATE_LIMITED: "RATE_LIMITED";
719
+ OVERLOADED: "OVERLOADED";
720
+ UNAVAILABLE: "UNAVAILABLE";
721
+ INTERNAL: "INTERNAL";
722
+ }>;
723
+ category: z.ZodEnum<{
724
+ validation: "validation";
725
+ authentication: "authentication";
726
+ authorization: "authorization";
727
+ capacity: "capacity";
728
+ availability: "availability";
729
+ internal: "internal";
730
+ }>;
731
+ retryable: z.ZodBoolean;
732
+ correlationId: z.ZodOptional<z.ZodString>;
733
+ retryAfterMs: z.ZodOptional<z.ZodNumber>;
734
+ }, z.core.$strip>>;
735
+ acceptedAt: z.ZodString;
736
+ }, z.core.$strip>;
737
+ export declare const ChannelRuntimeReadbackRequestSchema: z.ZodObject<{
738
+ protocol: z.ZodLiteral<"ravi.channel.runtime-events">;
739
+ schemaVersion: z.ZodLiteral<1>;
740
+ requestId: z.ZodString;
741
+ binding: z.ZodObject<{
742
+ channelInstanceId: z.ZodString;
743
+ agentId: z.ZodString;
744
+ chatId: z.ZodString;
745
+ messageId: z.ZodString;
746
+ sessionId: z.ZodString;
747
+ turnId: z.ZodString;
748
+ }, z.core.$strip>;
749
+ }, z.core.$strip>;
750
+ export declare const ChannelRuntimeReadbackResultSchema: z.ZodObject<{
751
+ protocol: z.ZodLiteral<"ravi.channel.runtime-events">;
752
+ schemaVersion: z.ZodLiteral<1>;
753
+ requestId: z.ZodString;
754
+ binding: z.ZodObject<{
755
+ channelInstanceId: z.ZodString;
756
+ agentId: z.ZodString;
757
+ chatId: z.ZodString;
758
+ messageId: z.ZodString;
759
+ sessionId: z.ZodString;
760
+ turnId: z.ZodString;
761
+ }, z.core.$strip>;
762
+ state: z.ZodEnum<{
763
+ accepted: "accepted";
764
+ running: "running";
765
+ waiting_approval: "waiting_approval";
766
+ completed: "completed";
767
+ failed: "failed";
768
+ interrupted: "interrupted";
769
+ }>;
770
+ lastSequence: z.ZodNumber;
771
+ assistantMessageId: z.ZodOptional<z.ZodString>;
772
+ observedAt: z.ZodString;
773
+ }, z.core.$strip>;
774
+ export type ChannelRuntimeCorrelation = z.infer<typeof ChannelRuntimeCorrelationSchema>;
775
+ export type ChannelTurnState = z.infer<typeof ChannelTurnStateSchema>;
776
+ export type KnownChannelRuntimeEvent = z.infer<typeof KnownChannelRuntimeEventSchema>;
777
+ export type ChannelInterruptRequest = z.infer<typeof ChannelInterruptRequestSchema>;
778
+ export type ChannelInterruptResult = z.infer<typeof ChannelInterruptResultSchema>;
779
+ export type ChannelRuntimeReadbackRequest = z.infer<typeof ChannelRuntimeReadbackRequestSchema>;
780
+ export type ChannelRuntimeReadbackResult = z.infer<typeof ChannelRuntimeReadbackResultSchema>;
781
+ export interface ChannelRuntimeCommandClient {
782
+ readonly channels: {
783
+ readonly backend: {
784
+ readonly runtime: {
785
+ interrupt(agentId: string, request: ChannelInterruptRequest): Promise<unknown>;
786
+ readback(agentId: string, request: ChannelRuntimeReadbackRequest): Promise<unknown>;
787
+ };
788
+ };
789
+ };
790
+ }
791
+ export declare class RaviChannelRuntimeClient {
792
+ private readonly client;
793
+ constructor(client: ChannelRuntimeCommandClient);
794
+ interrupt(input: ChannelInterruptRequest): Promise<ChannelInterruptResult>;
795
+ readback(input: ChannelRuntimeReadbackRequest): Promise<ChannelRuntimeReadbackResult>;
796
+ }
797
+ export declare function createChannelRuntimeClient(client: ChannelRuntimeCommandClient): RaviChannelRuntimeClient;
798
+ export interface ChannelRuntimeEventSink {
799
+ emit(event: KnownChannelRuntimeEvent): Promise<void>;
800
+ }
801
+ //# sourceMappingURL=channel-runtime-events.d.ts.map