@hopper-agent/protocol 0.1.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.
@@ -0,0 +1,521 @@
1
+ import { z } from 'zod';
2
+ export declare const UserPromptEvent: z.ZodObject<{
3
+ type: z.ZodLiteral<"user-prompt">;
4
+ id: z.ZodString;
5
+ text: z.ZodString;
6
+ cwd: z.ZodString;
7
+ timestamp: z.ZodNumber;
8
+ }, "strip", z.ZodTypeAny, {
9
+ type: "user-prompt";
10
+ id: string;
11
+ text: string;
12
+ cwd: string;
13
+ timestamp: number;
14
+ }, {
15
+ type: "user-prompt";
16
+ id: string;
17
+ text: string;
18
+ cwd: string;
19
+ timestamp: number;
20
+ }>;
21
+ export declare const AssistantDeltaEvent: z.ZodObject<{
22
+ type: z.ZodLiteral<"assistant-delta">;
23
+ id: z.ZodString;
24
+ text: z.ZodString;
25
+ timestamp: z.ZodNumber;
26
+ }, "strip", z.ZodTypeAny, {
27
+ type: "assistant-delta";
28
+ id: string;
29
+ text: string;
30
+ timestamp: number;
31
+ }, {
32
+ type: "assistant-delta";
33
+ id: string;
34
+ text: string;
35
+ timestamp: number;
36
+ }>;
37
+ export declare const AssistantStopEvent: z.ZodObject<{
38
+ type: z.ZodLiteral<"assistant-stop">;
39
+ id: z.ZodString;
40
+ timestamp: z.ZodNumber;
41
+ }, "strip", z.ZodTypeAny, {
42
+ type: "assistant-stop";
43
+ id: string;
44
+ timestamp: number;
45
+ }, {
46
+ type: "assistant-stop";
47
+ id: string;
48
+ timestamp: number;
49
+ }>;
50
+ export declare const ToolCallEvent: z.ZodObject<{
51
+ type: z.ZodLiteral<"tool-call">;
52
+ id: z.ZodString;
53
+ toolCallId: z.ZodString;
54
+ name: z.ZodString;
55
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
56
+ timestamp: z.ZodNumber;
57
+ }, "strip", z.ZodTypeAny, {
58
+ type: "tool-call";
59
+ id: string;
60
+ timestamp: number;
61
+ toolCallId: string;
62
+ name: string;
63
+ input: Record<string, unknown>;
64
+ }, {
65
+ type: "tool-call";
66
+ id: string;
67
+ timestamp: number;
68
+ toolCallId: string;
69
+ name: string;
70
+ input: Record<string, unknown>;
71
+ }>;
72
+ export declare const ToolResultEvent: z.ZodObject<{
73
+ type: z.ZodLiteral<"tool-result">;
74
+ id: z.ZodString;
75
+ toolCallId: z.ZodString;
76
+ output: z.ZodUnknown;
77
+ error: z.ZodOptional<z.ZodString>;
78
+ timestamp: z.ZodNumber;
79
+ }, "strip", z.ZodTypeAny, {
80
+ type: "tool-result";
81
+ id: string;
82
+ timestamp: number;
83
+ toolCallId: string;
84
+ output?: unknown;
85
+ error?: string | undefined;
86
+ }, {
87
+ type: "tool-result";
88
+ id: string;
89
+ timestamp: number;
90
+ toolCallId: string;
91
+ output?: unknown;
92
+ error?: string | undefined;
93
+ }>;
94
+ export declare const ApprovalRequestEvent: z.ZodObject<{
95
+ type: z.ZodLiteral<"approval-request">;
96
+ id: z.ZodString;
97
+ toolCallId: z.ZodString;
98
+ name: z.ZodString;
99
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
100
+ decision: z.ZodOptional<z.ZodEnum<["allow", "deny", "ask"]>>;
101
+ timestamp: z.ZodNumber;
102
+ }, "strip", z.ZodTypeAny, {
103
+ type: "approval-request";
104
+ id: string;
105
+ timestamp: number;
106
+ toolCallId: string;
107
+ name: string;
108
+ input: Record<string, unknown>;
109
+ decision?: "allow" | "deny" | "ask" | undefined;
110
+ }, {
111
+ type: "approval-request";
112
+ id: string;
113
+ timestamp: number;
114
+ toolCallId: string;
115
+ name: string;
116
+ input: Record<string, unknown>;
117
+ decision?: "allow" | "deny" | "ask" | undefined;
118
+ }>;
119
+ export declare const ApprovalDecisionEvent: z.ZodObject<{
120
+ type: z.ZodLiteral<"approval-decision">;
121
+ id: z.ZodString;
122
+ toolCallId: z.ZodString;
123
+ decision: z.ZodEnum<["allow", "deny"]>;
124
+ by: z.ZodOptional<z.ZodString>;
125
+ timestamp: z.ZodNumber;
126
+ }, "strip", z.ZodTypeAny, {
127
+ type: "approval-decision";
128
+ id: string;
129
+ timestamp: number;
130
+ toolCallId: string;
131
+ decision: "allow" | "deny";
132
+ by?: string | undefined;
133
+ }, {
134
+ type: "approval-decision";
135
+ id: string;
136
+ timestamp: number;
137
+ toolCallId: string;
138
+ decision: "allow" | "deny";
139
+ by?: string | undefined;
140
+ }>;
141
+ export declare const UsageEvent: z.ZodObject<{
142
+ type: z.ZodLiteral<"usage">;
143
+ id: z.ZodString;
144
+ inputTokens: z.ZodNumber;
145
+ outputTokens: z.ZodNumber;
146
+ cacheReadTokens: z.ZodOptional<z.ZodNumber>;
147
+ cacheWriteTokens: z.ZodOptional<z.ZodNumber>;
148
+ timestamp: z.ZodNumber;
149
+ }, "strip", z.ZodTypeAny, {
150
+ type: "usage";
151
+ id: string;
152
+ timestamp: number;
153
+ inputTokens: number;
154
+ outputTokens: number;
155
+ cacheReadTokens?: number | undefined;
156
+ cacheWriteTokens?: number | undefined;
157
+ }, {
158
+ type: "usage";
159
+ id: string;
160
+ timestamp: number;
161
+ inputTokens: number;
162
+ outputTokens: number;
163
+ cacheReadTokens?: number | undefined;
164
+ cacheWriteTokens?: number | undefined;
165
+ }>;
166
+ export declare const ErrorEvent: z.ZodObject<{
167
+ type: z.ZodLiteral<"error">;
168
+ id: z.ZodString;
169
+ message: z.ZodString;
170
+ code: z.ZodOptional<z.ZodString>;
171
+ timestamp: z.ZodNumber;
172
+ }, "strip", z.ZodTypeAny, {
173
+ type: "error";
174
+ message: string;
175
+ id: string;
176
+ timestamp: number;
177
+ code?: string | undefined;
178
+ }, {
179
+ type: "error";
180
+ message: string;
181
+ id: string;
182
+ timestamp: number;
183
+ code?: string | undefined;
184
+ }>;
185
+ export declare const SessionStartEvent: z.ZodObject<{
186
+ type: z.ZodLiteral<"session-start">;
187
+ id: z.ZodString;
188
+ model: z.ZodString;
189
+ provider: z.ZodString;
190
+ cwd: z.ZodString;
191
+ timestamp: z.ZodNumber;
192
+ }, "strip", z.ZodTypeAny, {
193
+ type: "session-start";
194
+ id: string;
195
+ cwd: string;
196
+ timestamp: number;
197
+ model: string;
198
+ provider: string;
199
+ }, {
200
+ type: "session-start";
201
+ id: string;
202
+ cwd: string;
203
+ timestamp: number;
204
+ model: string;
205
+ provider: string;
206
+ }>;
207
+ export declare const SessionStopEvent: z.ZodObject<{
208
+ type: z.ZodLiteral<"session-stop">;
209
+ id: z.ZodString;
210
+ reason: z.ZodString;
211
+ timestamp: z.ZodNumber;
212
+ }, "strip", z.ZodTypeAny, {
213
+ type: "session-stop";
214
+ id: string;
215
+ timestamp: number;
216
+ reason: string;
217
+ }, {
218
+ type: "session-stop";
219
+ id: string;
220
+ timestamp: number;
221
+ reason: string;
222
+ }>;
223
+ export declare const HookEvent: z.ZodObject<{
224
+ type: z.ZodLiteral<"hook">;
225
+ id: z.ZodString;
226
+ phase: z.ZodString;
227
+ name: z.ZodString;
228
+ result: z.ZodOptional<z.ZodString>;
229
+ error: z.ZodOptional<z.ZodString>;
230
+ timestamp: z.ZodNumber;
231
+ }, "strip", z.ZodTypeAny, {
232
+ type: "hook";
233
+ id: string;
234
+ timestamp: number;
235
+ name: string;
236
+ phase: string;
237
+ error?: string | undefined;
238
+ result?: string | undefined;
239
+ }, {
240
+ type: "hook";
241
+ id: string;
242
+ timestamp: number;
243
+ name: string;
244
+ phase: string;
245
+ error?: string | undefined;
246
+ result?: string | undefined;
247
+ }>;
248
+ export declare const StatusEvent: z.ZodObject<{
249
+ type: z.ZodLiteral<"status">;
250
+ id: z.ZodString;
251
+ message: z.ZodString;
252
+ spinner: z.ZodOptional<z.ZodBoolean>;
253
+ timestamp: z.ZodNumber;
254
+ }, "strip", z.ZodTypeAny, {
255
+ type: "status";
256
+ message: string;
257
+ id: string;
258
+ timestamp: number;
259
+ spinner?: boolean | undefined;
260
+ }, {
261
+ type: "status";
262
+ message: string;
263
+ id: string;
264
+ timestamp: number;
265
+ spinner?: boolean | undefined;
266
+ }>;
267
+ export declare const EventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
268
+ type: z.ZodLiteral<"user-prompt">;
269
+ id: z.ZodString;
270
+ text: z.ZodString;
271
+ cwd: z.ZodString;
272
+ timestamp: z.ZodNumber;
273
+ }, "strip", z.ZodTypeAny, {
274
+ type: "user-prompt";
275
+ id: string;
276
+ text: string;
277
+ cwd: string;
278
+ timestamp: number;
279
+ }, {
280
+ type: "user-prompt";
281
+ id: string;
282
+ text: string;
283
+ cwd: string;
284
+ timestamp: number;
285
+ }>, z.ZodObject<{
286
+ type: z.ZodLiteral<"assistant-delta">;
287
+ id: z.ZodString;
288
+ text: z.ZodString;
289
+ timestamp: z.ZodNumber;
290
+ }, "strip", z.ZodTypeAny, {
291
+ type: "assistant-delta";
292
+ id: string;
293
+ text: string;
294
+ timestamp: number;
295
+ }, {
296
+ type: "assistant-delta";
297
+ id: string;
298
+ text: string;
299
+ timestamp: number;
300
+ }>, z.ZodObject<{
301
+ type: z.ZodLiteral<"assistant-stop">;
302
+ id: z.ZodString;
303
+ timestamp: z.ZodNumber;
304
+ }, "strip", z.ZodTypeAny, {
305
+ type: "assistant-stop";
306
+ id: string;
307
+ timestamp: number;
308
+ }, {
309
+ type: "assistant-stop";
310
+ id: string;
311
+ timestamp: number;
312
+ }>, z.ZodObject<{
313
+ type: z.ZodLiteral<"tool-call">;
314
+ id: z.ZodString;
315
+ toolCallId: z.ZodString;
316
+ name: z.ZodString;
317
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
318
+ timestamp: z.ZodNumber;
319
+ }, "strip", z.ZodTypeAny, {
320
+ type: "tool-call";
321
+ id: string;
322
+ timestamp: number;
323
+ toolCallId: string;
324
+ name: string;
325
+ input: Record<string, unknown>;
326
+ }, {
327
+ type: "tool-call";
328
+ id: string;
329
+ timestamp: number;
330
+ toolCallId: string;
331
+ name: string;
332
+ input: Record<string, unknown>;
333
+ }>, z.ZodObject<{
334
+ type: z.ZodLiteral<"tool-result">;
335
+ id: z.ZodString;
336
+ toolCallId: z.ZodString;
337
+ output: z.ZodUnknown;
338
+ error: z.ZodOptional<z.ZodString>;
339
+ timestamp: z.ZodNumber;
340
+ }, "strip", z.ZodTypeAny, {
341
+ type: "tool-result";
342
+ id: string;
343
+ timestamp: number;
344
+ toolCallId: string;
345
+ output?: unknown;
346
+ error?: string | undefined;
347
+ }, {
348
+ type: "tool-result";
349
+ id: string;
350
+ timestamp: number;
351
+ toolCallId: string;
352
+ output?: unknown;
353
+ error?: string | undefined;
354
+ }>, z.ZodObject<{
355
+ type: z.ZodLiteral<"approval-request">;
356
+ id: z.ZodString;
357
+ toolCallId: z.ZodString;
358
+ name: z.ZodString;
359
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
360
+ decision: z.ZodOptional<z.ZodEnum<["allow", "deny", "ask"]>>;
361
+ timestamp: z.ZodNumber;
362
+ }, "strip", z.ZodTypeAny, {
363
+ type: "approval-request";
364
+ id: string;
365
+ timestamp: number;
366
+ toolCallId: string;
367
+ name: string;
368
+ input: Record<string, unknown>;
369
+ decision?: "allow" | "deny" | "ask" | undefined;
370
+ }, {
371
+ type: "approval-request";
372
+ id: string;
373
+ timestamp: number;
374
+ toolCallId: string;
375
+ name: string;
376
+ input: Record<string, unknown>;
377
+ decision?: "allow" | "deny" | "ask" | undefined;
378
+ }>, z.ZodObject<{
379
+ type: z.ZodLiteral<"approval-decision">;
380
+ id: z.ZodString;
381
+ toolCallId: z.ZodString;
382
+ decision: z.ZodEnum<["allow", "deny"]>;
383
+ by: z.ZodOptional<z.ZodString>;
384
+ timestamp: z.ZodNumber;
385
+ }, "strip", z.ZodTypeAny, {
386
+ type: "approval-decision";
387
+ id: string;
388
+ timestamp: number;
389
+ toolCallId: string;
390
+ decision: "allow" | "deny";
391
+ by?: string | undefined;
392
+ }, {
393
+ type: "approval-decision";
394
+ id: string;
395
+ timestamp: number;
396
+ toolCallId: string;
397
+ decision: "allow" | "deny";
398
+ by?: string | undefined;
399
+ }>, z.ZodObject<{
400
+ type: z.ZodLiteral<"usage">;
401
+ id: z.ZodString;
402
+ inputTokens: z.ZodNumber;
403
+ outputTokens: z.ZodNumber;
404
+ cacheReadTokens: z.ZodOptional<z.ZodNumber>;
405
+ cacheWriteTokens: z.ZodOptional<z.ZodNumber>;
406
+ timestamp: z.ZodNumber;
407
+ }, "strip", z.ZodTypeAny, {
408
+ type: "usage";
409
+ id: string;
410
+ timestamp: number;
411
+ inputTokens: number;
412
+ outputTokens: number;
413
+ cacheReadTokens?: number | undefined;
414
+ cacheWriteTokens?: number | undefined;
415
+ }, {
416
+ type: "usage";
417
+ id: string;
418
+ timestamp: number;
419
+ inputTokens: number;
420
+ outputTokens: number;
421
+ cacheReadTokens?: number | undefined;
422
+ cacheWriteTokens?: number | undefined;
423
+ }>, z.ZodObject<{
424
+ type: z.ZodLiteral<"error">;
425
+ id: z.ZodString;
426
+ message: z.ZodString;
427
+ code: z.ZodOptional<z.ZodString>;
428
+ timestamp: z.ZodNumber;
429
+ }, "strip", z.ZodTypeAny, {
430
+ type: "error";
431
+ message: string;
432
+ id: string;
433
+ timestamp: number;
434
+ code?: string | undefined;
435
+ }, {
436
+ type: "error";
437
+ message: string;
438
+ id: string;
439
+ timestamp: number;
440
+ code?: string | undefined;
441
+ }>, z.ZodObject<{
442
+ type: z.ZodLiteral<"session-start">;
443
+ id: z.ZodString;
444
+ model: z.ZodString;
445
+ provider: z.ZodString;
446
+ cwd: z.ZodString;
447
+ timestamp: z.ZodNumber;
448
+ }, "strip", z.ZodTypeAny, {
449
+ type: "session-start";
450
+ id: string;
451
+ cwd: string;
452
+ timestamp: number;
453
+ model: string;
454
+ provider: string;
455
+ }, {
456
+ type: "session-start";
457
+ id: string;
458
+ cwd: string;
459
+ timestamp: number;
460
+ model: string;
461
+ provider: string;
462
+ }>, z.ZodObject<{
463
+ type: z.ZodLiteral<"session-stop">;
464
+ id: z.ZodString;
465
+ reason: z.ZodString;
466
+ timestamp: z.ZodNumber;
467
+ }, "strip", z.ZodTypeAny, {
468
+ type: "session-stop";
469
+ id: string;
470
+ timestamp: number;
471
+ reason: string;
472
+ }, {
473
+ type: "session-stop";
474
+ id: string;
475
+ timestamp: number;
476
+ reason: string;
477
+ }>, z.ZodObject<{
478
+ type: z.ZodLiteral<"hook">;
479
+ id: z.ZodString;
480
+ phase: z.ZodString;
481
+ name: z.ZodString;
482
+ result: z.ZodOptional<z.ZodString>;
483
+ error: z.ZodOptional<z.ZodString>;
484
+ timestamp: z.ZodNumber;
485
+ }, "strip", z.ZodTypeAny, {
486
+ type: "hook";
487
+ id: string;
488
+ timestamp: number;
489
+ name: string;
490
+ phase: string;
491
+ error?: string | undefined;
492
+ result?: string | undefined;
493
+ }, {
494
+ type: "hook";
495
+ id: string;
496
+ timestamp: number;
497
+ name: string;
498
+ phase: string;
499
+ error?: string | undefined;
500
+ result?: string | undefined;
501
+ }>, z.ZodObject<{
502
+ type: z.ZodLiteral<"status">;
503
+ id: z.ZodString;
504
+ message: z.ZodString;
505
+ spinner: z.ZodOptional<z.ZodBoolean>;
506
+ timestamp: z.ZodNumber;
507
+ }, "strip", z.ZodTypeAny, {
508
+ type: "status";
509
+ message: string;
510
+ id: string;
511
+ timestamp: number;
512
+ spinner?: boolean | undefined;
513
+ }, {
514
+ type: "status";
515
+ message: string;
516
+ id: string;
517
+ timestamp: number;
518
+ spinner?: boolean | undefined;
519
+ }>]>;
520
+ export type Event = z.infer<typeof EventSchema>;
521
+ //# sourceMappingURL=event-schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-schemas.d.ts","sourceRoot":"","sources":["../../src/event-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;EAM1B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;EAK9B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAI7B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;EAOxB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;EAO1B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;EAQ/B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;EAOhC,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;EAQrB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;EAMrB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;EAO5B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAK3B,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;EAQpB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;EAMtB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IActB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -0,0 +1,114 @@
1
+ import { z } from 'zod';
2
+ export const UserPromptEvent = z.object({
3
+ type: z.literal('user-prompt'),
4
+ id: z.string(),
5
+ text: z.string(),
6
+ cwd: z.string(),
7
+ timestamp: z.number(),
8
+ });
9
+ export const AssistantDeltaEvent = z.object({
10
+ type: z.literal('assistant-delta'),
11
+ id: z.string(),
12
+ text: z.string(),
13
+ timestamp: z.number(),
14
+ });
15
+ export const AssistantStopEvent = z.object({
16
+ type: z.literal('assistant-stop'),
17
+ id: z.string(),
18
+ timestamp: z.number(),
19
+ });
20
+ export const ToolCallEvent = z.object({
21
+ type: z.literal('tool-call'),
22
+ id: z.string(),
23
+ toolCallId: z.string(),
24
+ name: z.string(),
25
+ input: z.record(z.string(), z.unknown()),
26
+ timestamp: z.number(),
27
+ });
28
+ export const ToolResultEvent = z.object({
29
+ type: z.literal('tool-result'),
30
+ id: z.string(),
31
+ toolCallId: z.string(),
32
+ output: z.unknown(),
33
+ error: z.string().optional(),
34
+ timestamp: z.number(),
35
+ });
36
+ export const ApprovalRequestEvent = z.object({
37
+ type: z.literal('approval-request'),
38
+ id: z.string(),
39
+ toolCallId: z.string(),
40
+ name: z.string(),
41
+ input: z.record(z.string(), z.unknown()),
42
+ decision: z.enum(['allow', 'deny', 'ask']).optional(),
43
+ timestamp: z.number(),
44
+ });
45
+ export const ApprovalDecisionEvent = z.object({
46
+ type: z.literal('approval-decision'),
47
+ id: z.string(),
48
+ toolCallId: z.string(),
49
+ decision: z.enum(['allow', 'deny']),
50
+ by: z.string().optional(),
51
+ timestamp: z.number(),
52
+ });
53
+ export const UsageEvent = z.object({
54
+ type: z.literal('usage'),
55
+ id: z.string(),
56
+ inputTokens: z.number(),
57
+ outputTokens: z.number(),
58
+ cacheReadTokens: z.number().optional(),
59
+ cacheWriteTokens: z.number().optional(),
60
+ timestamp: z.number(),
61
+ });
62
+ export const ErrorEvent = z.object({
63
+ type: z.literal('error'),
64
+ id: z.string(),
65
+ message: z.string(),
66
+ code: z.string().optional(),
67
+ timestamp: z.number(),
68
+ });
69
+ export const SessionStartEvent = z.object({
70
+ type: z.literal('session-start'),
71
+ id: z.string(),
72
+ model: z.string(),
73
+ provider: z.string(),
74
+ cwd: z.string(),
75
+ timestamp: z.number(),
76
+ });
77
+ export const SessionStopEvent = z.object({
78
+ type: z.literal('session-stop'),
79
+ id: z.string(),
80
+ reason: z.string(),
81
+ timestamp: z.number(),
82
+ });
83
+ export const HookEvent = z.object({
84
+ type: z.literal('hook'),
85
+ id: z.string(),
86
+ phase: z.string(),
87
+ name: z.string(),
88
+ result: z.string().optional(),
89
+ error: z.string().optional(),
90
+ timestamp: z.number(),
91
+ });
92
+ export const StatusEvent = z.object({
93
+ type: z.literal('status'),
94
+ id: z.string(),
95
+ message: z.string(),
96
+ spinner: z.boolean().optional(),
97
+ timestamp: z.number(),
98
+ });
99
+ export const EventSchema = z.discriminatedUnion('type', [
100
+ UserPromptEvent,
101
+ AssistantDeltaEvent,
102
+ AssistantStopEvent,
103
+ ToolCallEvent,
104
+ ToolResultEvent,
105
+ ApprovalRequestEvent,
106
+ ApprovalDecisionEvent,
107
+ UsageEvent,
108
+ ErrorEvent,
109
+ SessionStartEvent,
110
+ SessionStopEvent,
111
+ HookEvent,
112
+ StatusEvent,
113
+ ]);
114
+ //# sourceMappingURL=event-schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-schemas.js","sourceRoot":"","sources":["../../src/event-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC9B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC;IAClC,EAAE,EAAE,CAAC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AE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACzB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACtD,eAAe;IACf,mBAAmB;IACnB,kBAAkB;IAClB,aAAa;IACb,eAAe;IACf,oBAAoB;IACpB,qBAAqB;IACrB,UAAU;IACV,UAAU;IACV,iBAAiB;IACjB,gBAAgB;IAChB,SAAS;IACT,WAAW;CACZ,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { PROTOCOL_VERSION, JSONRPC_VERSION } from './constants.js';
2
+ export { EventSchema, UserPromptEvent, AssistantDeltaEvent, AssistantStopEvent, ToolCallEvent, ToolResultEvent, ApprovalRequestEvent, ApprovalDecisionEvent, UsageEvent, ErrorEvent, SessionStartEvent, SessionStopEvent, HookEvent, StatusEvent, } from './event-schemas.js';
3
+ export type { Event } from './event-schemas.js';
4
+ export { JsonRpcRequestSchema, JsonRpcNotificationSchema, JsonRpcResponseSchema, JsonRpcErrorSchema, JsonRpcMessageSchema, JsonRpcErrorCode, } from './json-rpc.js';
5
+ export type { JsonRpcRequest, JsonRpcNotification, JsonRpcResponse, JsonRpcError, JsonRpcMessage, } from './json-rpc.js';
6
+ export { Method, SessionListSchema, SessionGetSchema, SessionSendSchema, SessionCancelSchema, SessionResumeSchema, OrchestraPanesSchema, OrchestraBroadcastSchema, WikiQuerySchema, WikiPageGetSchema, ApprovalPendingSchema, ApprovalDecideSchema, ToolRegistrySchema, ProviderListSchema, ConfigGetSchema, ConfigSetSchema, } from './methods.js';
7
+ export { ToolDefinitionSchema, ToolCallSchema, ToolResultSchema, ToolSchemaSchema, } from './tool-schemas.js';
8
+ export type { ToolDefinition, ToolCall, ToolResult } from './tool-schemas.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EACL,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,cAAc,GACf,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,eAAe,GAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { PROTOCOL_VERSION, JSONRPC_VERSION } from './constants.js';
2
+ export { EventSchema, UserPromptEvent, AssistantDeltaEvent, AssistantStopEvent, ToolCallEvent, ToolResultEvent, ApprovalRequestEvent, ApprovalDecisionEvent, UsageEvent, ErrorEvent, SessionStartEvent, SessionStopEvent, HookEvent, StatusEvent, } from './event-schemas.js';
3
+ export { JsonRpcRequestSchema, JsonRpcNotificationSchema, JsonRpcResponseSchema, JsonRpcErrorSchema, JsonRpcMessageSchema, JsonRpcErrorCode, } from './json-rpc.js';
4
+ export { Method, SessionListSchema, SessionGetSchema, SessionSendSchema, SessionCancelSchema, SessionResumeSchema, OrchestraPanesSchema, OrchestraBroadcastSchema, WikiQuerySchema, WikiPageGetSchema, ApprovalPendingSchema, ApprovalDecideSchema, ToolRegistrySchema, ProviderListSchema, ConfigGetSchema, ConfigSetSchema, } from './methods.js';
5
+ export { ToolDefinitionSchema, ToolCallSchema, ToolResultSchema, ToolSchemaSchema, } from './tool-schemas.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EACL,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AASvB,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,eAAe,GAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC"}