@earendil-works/pi-server 0.84.3 → 0.85.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 (79) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/README.md +66 -37
  3. package/dist/connection.d.ts +9 -5
  4. package/dist/connection.d.ts.map +1 -1
  5. package/dist/connection.js.map +1 -1
  6. package/dist/errors.d.ts +16 -18
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/errors.js +23 -27
  9. package/dist/errors.js.map +1 -1
  10. package/dist/index.d.ts +0 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +0 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/listener.d.ts +1 -3
  15. package/dist/listener.d.ts.map +1 -1
  16. package/dist/listener.js.map +1 -1
  17. package/dist/server.d.ts +16 -6
  18. package/dist/server.d.ts.map +1 -1
  19. package/dist/server.js +268 -86
  20. package/dist/server.js.map +1 -1
  21. package/dist/session-router.d.ts +40 -0
  22. package/dist/session-router.d.ts.map +1 -0
  23. package/dist/session-router.js +264 -0
  24. package/dist/session-router.js.map +1 -0
  25. package/dist/testing/client.d.ts +6 -2
  26. package/dist/testing/client.d.ts.map +1 -1
  27. package/dist/testing/client.js +23 -3
  28. package/dist/testing/client.js.map +1 -1
  29. package/dist/testing/host.d.ts +57 -0
  30. package/dist/testing/host.d.ts.map +1 -0
  31. package/dist/testing/host.js +189 -0
  32. package/dist/testing/host.js.map +1 -0
  33. package/dist/testing/index.d.ts +1 -1
  34. package/dist/testing/index.d.ts.map +1 -1
  35. package/dist/testing/index.js +1 -1
  36. package/dist/testing/index.js.map +1 -1
  37. package/dist/testing/server.d.ts +8 -7
  38. package/dist/testing/server.d.ts.map +1 -1
  39. package/dist/testing/server.js +7 -7
  40. package/dist/testing/server.js.map +1 -1
  41. package/dist/transports/unix/address.d.ts +3 -0
  42. package/dist/transports/unix/address.d.ts.map +1 -0
  43. package/dist/transports/unix/address.js +9 -0
  44. package/dist/transports/unix/address.js.map +1 -0
  45. package/dist/transports/unix/index.d.ts +1 -0
  46. package/dist/transports/unix/index.d.ts.map +1 -1
  47. package/dist/transports/unix/index.js +1 -0
  48. package/dist/transports/unix/index.js.map +1 -1
  49. package/dist/transports/unix/listener.d.ts +2 -3
  50. package/dist/transports/unix/listener.d.ts.map +1 -1
  51. package/dist/transports/unix/listener.js +13 -24
  52. package/dist/transports/unix/listener.js.map +1 -1
  53. package/dist/transports/unix/preset.d.ts +5 -4
  54. package/dist/transports/unix/preset.d.ts.map +1 -1
  55. package/dist/transports/unix/preset.js +5 -4
  56. package/dist/transports/unix/preset.js.map +1 -1
  57. package/dist/transports/unix/types.d.ts +2 -2
  58. package/dist/transports/unix/types.d.ts.map +1 -1
  59. package/dist/transports/unix/types.js.map +1 -1
  60. package/dist/types.d.ts +40 -47
  61. package/dist/types.d.ts.map +1 -1
  62. package/dist/types.js.map +1 -1
  63. package/package.json +4 -3
  64. package/dist/protocol.d.ts +0 -22
  65. package/dist/protocol.d.ts.map +0 -1
  66. package/dist/protocol.js +0 -266
  67. package/dist/protocol.js.map +0 -1
  68. package/dist/sessions.d.ts +0 -2174
  69. package/dist/sessions.d.ts.map +0 -1
  70. package/dist/sessions.js +0 -305
  71. package/dist/sessions.js.map +0 -1
  72. package/dist/snapshots.d.ts +0 -24
  73. package/dist/snapshots.d.ts.map +0 -1
  74. package/dist/snapshots.js +0 -39
  75. package/dist/snapshots.js.map +0 -1
  76. package/dist/testing/service.d.ts +0 -59
  77. package/dist/testing/service.d.ts.map +0 -1
  78. package/dist/testing/service.js +0 -240
  79. package/dist/testing/service.js.map +0 -1
@@ -1,2174 +0,0 @@
1
- import type { Command, EventEnvelope, SessionMetadata } from "@earendil-works/pi-protocol";
2
- import type { ByteConnection, ConnectionState } from "./connection.ts";
3
- import type { PiServerService } from "./types.ts";
4
- interface LiveSessionManagerOptions {
5
- service: PiServerService;
6
- isClosing: () => boolean;
7
- sendMessage: (connection: ConnectionState, message: EventEnvelope) => Promise<boolean>;
8
- closeConnection: (connection: ByteConnection) => Promise<void>;
9
- disconnect: (connection: ConnectionState) => Promise<void>;
10
- broadcastServerSnapshot: () => void;
11
- reportError: (error: unknown) => void;
12
- }
13
- export declare class LiveSessionManager {
14
- private readonly options;
15
- private readonly liveSessions;
16
- private readonly openingSessions;
17
- constructor(options: LiveSessionManagerOptions);
18
- executeCommand(connection: ConnectionState, command: Command): Promise<{
19
- command: "list";
20
- sessions: {
21
- readonly id: string;
22
- readonly createdAt: number;
23
- readonly updatedAt?: number | undefined;
24
- readonly parentSessionId?: string | undefined;
25
- readonly sessionName?: string | undefined;
26
- readonly cwd?: string | undefined;
27
- }[];
28
- sessionId?: undefined;
29
- session?: undefined;
30
- } | {
31
- sessions?: undefined;
32
- command: "create";
33
- session: {
34
- readonly id: string;
35
- readonly name?: string | undefined;
36
- readonly cwd: string;
37
- readonly createdAt: number;
38
- readonly updatedAt: number;
39
- readonly phase: "branch_summary" | "compaction" | "idle" | "retry" | "turn";
40
- readonly model: {
41
- readonly provider: string;
42
- readonly id: string;
43
- };
44
- readonly thinkingLevel: "high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh";
45
- readonly attached: boolean;
46
- readonly locked: boolean;
47
- readonly revision: number;
48
- readonly transcript: ({
49
- readonly id: string;
50
- readonly role: "user";
51
- readonly content: ({
52
- readonly type: "text";
53
- readonly text: string;
54
- } | {
55
- readonly type: "image";
56
- readonly data: string;
57
- readonly mimeType: string;
58
- })[];
59
- readonly timestamp: number;
60
- } | {
61
- readonly id: string;
62
- readonly role: "assistant";
63
- readonly content: ({
64
- readonly type: "text";
65
- readonly text: string;
66
- } | {
67
- readonly type: "thinking";
68
- readonly thinking: string;
69
- readonly redacted?: boolean | undefined;
70
- } | {
71
- readonly type: "toolCall";
72
- readonly toolCallId: string;
73
- readonly toolName: string;
74
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
75
- })[];
76
- readonly model: {
77
- readonly provider: string;
78
- readonly id: string;
79
- };
80
- readonly responseModel?: string | undefined;
81
- readonly usage?: {
82
- readonly input: number;
83
- readonly output: number;
84
- readonly cacheRead: number;
85
- readonly cacheWrite: number;
86
- readonly reasoning?: number | undefined;
87
- readonly totalTokens: number;
88
- readonly cost: {
89
- readonly input: number;
90
- readonly output: number;
91
- readonly cacheRead: number;
92
- readonly cacheWrite: number;
93
- readonly total: number;
94
- };
95
- } | undefined;
96
- readonly timestamp: number;
97
- readonly status: "streaming";
98
- } | {
99
- readonly id: string;
100
- readonly role: "assistant";
101
- readonly content: ({
102
- readonly type: "text";
103
- readonly text: string;
104
- } | {
105
- readonly type: "thinking";
106
- readonly thinking: string;
107
- readonly redacted?: boolean | undefined;
108
- } | {
109
- readonly type: "toolCall";
110
- readonly toolCallId: string;
111
- readonly toolName: string;
112
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
113
- })[];
114
- readonly model: {
115
- readonly provider: string;
116
- readonly id: string;
117
- };
118
- readonly responseModel?: string | undefined;
119
- readonly usage?: {
120
- readonly input: number;
121
- readonly output: number;
122
- readonly cacheRead: number;
123
- readonly cacheWrite: number;
124
- readonly reasoning?: number | undefined;
125
- readonly totalTokens: number;
126
- readonly cost: {
127
- readonly input: number;
128
- readonly output: number;
129
- readonly cacheRead: number;
130
- readonly cacheWrite: number;
131
- readonly total: number;
132
- };
133
- } | undefined;
134
- readonly timestamp: number;
135
- readonly status: "complete";
136
- readonly stopReason: "length" | "stop" | "toolUse";
137
- } | {
138
- readonly id: string;
139
- readonly role: "assistant";
140
- readonly content: ({
141
- readonly type: "text";
142
- readonly text: string;
143
- } | {
144
- readonly type: "thinking";
145
- readonly thinking: string;
146
- readonly redacted?: boolean | undefined;
147
- } | {
148
- readonly type: "toolCall";
149
- readonly toolCallId: string;
150
- readonly toolName: string;
151
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
152
- })[];
153
- readonly model: {
154
- readonly provider: string;
155
- readonly id: string;
156
- };
157
- readonly responseModel?: string | undefined;
158
- readonly usage?: {
159
- readonly input: number;
160
- readonly output: number;
161
- readonly cacheRead: number;
162
- readonly cacheWrite: number;
163
- readonly reasoning?: number | undefined;
164
- readonly totalTokens: number;
165
- readonly cost: {
166
- readonly input: number;
167
- readonly output: number;
168
- readonly cacheRead: number;
169
- readonly cacheWrite: number;
170
- readonly total: number;
171
- };
172
- } | undefined;
173
- readonly timestamp: number;
174
- readonly status: "error";
175
- readonly stopReason: "error";
176
- readonly errorMessage?: string | undefined;
177
- } | {
178
- readonly id: string;
179
- readonly role: "assistant";
180
- readonly content: ({
181
- readonly type: "text";
182
- readonly text: string;
183
- } | {
184
- readonly type: "thinking";
185
- readonly thinking: string;
186
- readonly redacted?: boolean | undefined;
187
- } | {
188
- readonly type: "toolCall";
189
- readonly toolCallId: string;
190
- readonly toolName: string;
191
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
192
- })[];
193
- readonly model: {
194
- readonly provider: string;
195
- readonly id: string;
196
- };
197
- readonly responseModel?: string | undefined;
198
- readonly usage?: {
199
- readonly input: number;
200
- readonly output: number;
201
- readonly cacheRead: number;
202
- readonly cacheWrite: number;
203
- readonly reasoning?: number | undefined;
204
- readonly totalTokens: number;
205
- readonly cost: {
206
- readonly input: number;
207
- readonly output: number;
208
- readonly cacheRead: number;
209
- readonly cacheWrite: number;
210
- readonly total: number;
211
- };
212
- } | undefined;
213
- readonly timestamp: number;
214
- readonly status: "aborted";
215
- readonly stopReason: "aborted";
216
- readonly errorMessage?: string | undefined;
217
- } | {
218
- readonly id: string;
219
- readonly role: "tool";
220
- readonly toolCallId: string;
221
- readonly toolName: string;
222
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
223
- readonly content: ({
224
- readonly type: "text";
225
- readonly text: string;
226
- } | {
227
- readonly type: "image";
228
- readonly data: string;
229
- readonly mimeType: string;
230
- })[];
231
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
232
- readonly usage?: {
233
- readonly input: number;
234
- readonly output: number;
235
- readonly cacheRead: number;
236
- readonly cacheWrite: number;
237
- readonly reasoning?: number | undefined;
238
- readonly totalTokens: number;
239
- readonly cost: {
240
- readonly input: number;
241
- readonly output: number;
242
- readonly cacheRead: number;
243
- readonly cacheWrite: number;
244
- readonly total: number;
245
- };
246
- } | undefined;
247
- readonly timestamp: number;
248
- readonly status: "running";
249
- readonly isError: false;
250
- } | {
251
- readonly id: string;
252
- readonly role: "tool";
253
- readonly toolCallId: string;
254
- readonly toolName: string;
255
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
256
- readonly content: ({
257
- readonly type: "text";
258
- readonly text: string;
259
- } | {
260
- readonly type: "image";
261
- readonly data: string;
262
- readonly mimeType: string;
263
- })[];
264
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
265
- readonly usage?: {
266
- readonly input: number;
267
- readonly output: number;
268
- readonly cacheRead: number;
269
- readonly cacheWrite: number;
270
- readonly reasoning?: number | undefined;
271
- readonly totalTokens: number;
272
- readonly cost: {
273
- readonly input: number;
274
- readonly output: number;
275
- readonly cacheRead: number;
276
- readonly cacheWrite: number;
277
- readonly total: number;
278
- };
279
- } | undefined;
280
- readonly timestamp: number;
281
- readonly status: "complete";
282
- readonly isError: false;
283
- } | {
284
- readonly id: string;
285
- readonly role: "tool";
286
- readonly toolCallId: string;
287
- readonly toolName: string;
288
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
289
- readonly content: ({
290
- readonly type: "text";
291
- readonly text: string;
292
- } | {
293
- readonly type: "image";
294
- readonly data: string;
295
- readonly mimeType: string;
296
- })[];
297
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
298
- readonly usage?: {
299
- readonly input: number;
300
- readonly output: number;
301
- readonly cacheRead: number;
302
- readonly cacheWrite: number;
303
- readonly reasoning?: number | undefined;
304
- readonly totalTokens: number;
305
- readonly cost: {
306
- readonly input: number;
307
- readonly output: number;
308
- readonly cacheRead: number;
309
- readonly cacheWrite: number;
310
- readonly total: number;
311
- };
312
- } | undefined;
313
- readonly timestamp: number;
314
- readonly status: "error";
315
- readonly isError: true;
316
- })[];
317
- readonly queuedSteer: {
318
- readonly id: string;
319
- readonly role: "user";
320
- readonly content: ({
321
- readonly type: "text";
322
- readonly text: string;
323
- } | {
324
- readonly type: "image";
325
- readonly data: string;
326
- readonly mimeType: string;
327
- })[];
328
- readonly timestamp: number;
329
- }[];
330
- readonly queuedSteerCount: number;
331
- };
332
- sessionId?: undefined;
333
- } | {
334
- sessions?: undefined;
335
- command: "attach";
336
- session: {
337
- readonly id: string;
338
- readonly name?: string | undefined;
339
- readonly cwd: string;
340
- readonly createdAt: number;
341
- readonly updatedAt: number;
342
- readonly phase: "branch_summary" | "compaction" | "idle" | "retry" | "turn";
343
- readonly model: {
344
- readonly provider: string;
345
- readonly id: string;
346
- };
347
- readonly thinkingLevel: "high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh";
348
- readonly attached: boolean;
349
- readonly locked: boolean;
350
- readonly revision: number;
351
- readonly transcript: ({
352
- readonly id: string;
353
- readonly role: "user";
354
- readonly content: ({
355
- readonly type: "text";
356
- readonly text: string;
357
- } | {
358
- readonly type: "image";
359
- readonly data: string;
360
- readonly mimeType: string;
361
- })[];
362
- readonly timestamp: number;
363
- } | {
364
- readonly id: string;
365
- readonly role: "assistant";
366
- readonly content: ({
367
- readonly type: "text";
368
- readonly text: string;
369
- } | {
370
- readonly type: "thinking";
371
- readonly thinking: string;
372
- readonly redacted?: boolean | undefined;
373
- } | {
374
- readonly type: "toolCall";
375
- readonly toolCallId: string;
376
- readonly toolName: string;
377
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
378
- })[];
379
- readonly model: {
380
- readonly provider: string;
381
- readonly id: string;
382
- };
383
- readonly responseModel?: string | undefined;
384
- readonly usage?: {
385
- readonly input: number;
386
- readonly output: number;
387
- readonly cacheRead: number;
388
- readonly cacheWrite: number;
389
- readonly reasoning?: number | undefined;
390
- readonly totalTokens: number;
391
- readonly cost: {
392
- readonly input: number;
393
- readonly output: number;
394
- readonly cacheRead: number;
395
- readonly cacheWrite: number;
396
- readonly total: number;
397
- };
398
- } | undefined;
399
- readonly timestamp: number;
400
- readonly status: "streaming";
401
- } | {
402
- readonly id: string;
403
- readonly role: "assistant";
404
- readonly content: ({
405
- readonly type: "text";
406
- readonly text: string;
407
- } | {
408
- readonly type: "thinking";
409
- readonly thinking: string;
410
- readonly redacted?: boolean | undefined;
411
- } | {
412
- readonly type: "toolCall";
413
- readonly toolCallId: string;
414
- readonly toolName: string;
415
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
416
- })[];
417
- readonly model: {
418
- readonly provider: string;
419
- readonly id: string;
420
- };
421
- readonly responseModel?: string | undefined;
422
- readonly usage?: {
423
- readonly input: number;
424
- readonly output: number;
425
- readonly cacheRead: number;
426
- readonly cacheWrite: number;
427
- readonly reasoning?: number | undefined;
428
- readonly totalTokens: number;
429
- readonly cost: {
430
- readonly input: number;
431
- readonly output: number;
432
- readonly cacheRead: number;
433
- readonly cacheWrite: number;
434
- readonly total: number;
435
- };
436
- } | undefined;
437
- readonly timestamp: number;
438
- readonly status: "complete";
439
- readonly stopReason: "length" | "stop" | "toolUse";
440
- } | {
441
- readonly id: string;
442
- readonly role: "assistant";
443
- readonly content: ({
444
- readonly type: "text";
445
- readonly text: string;
446
- } | {
447
- readonly type: "thinking";
448
- readonly thinking: string;
449
- readonly redacted?: boolean | undefined;
450
- } | {
451
- readonly type: "toolCall";
452
- readonly toolCallId: string;
453
- readonly toolName: string;
454
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
455
- })[];
456
- readonly model: {
457
- readonly provider: string;
458
- readonly id: string;
459
- };
460
- readonly responseModel?: string | undefined;
461
- readonly usage?: {
462
- readonly input: number;
463
- readonly output: number;
464
- readonly cacheRead: number;
465
- readonly cacheWrite: number;
466
- readonly reasoning?: number | undefined;
467
- readonly totalTokens: number;
468
- readonly cost: {
469
- readonly input: number;
470
- readonly output: number;
471
- readonly cacheRead: number;
472
- readonly cacheWrite: number;
473
- readonly total: number;
474
- };
475
- } | undefined;
476
- readonly timestamp: number;
477
- readonly status: "error";
478
- readonly stopReason: "error";
479
- readonly errorMessage?: string | undefined;
480
- } | {
481
- readonly id: string;
482
- readonly role: "assistant";
483
- readonly content: ({
484
- readonly type: "text";
485
- readonly text: string;
486
- } | {
487
- readonly type: "thinking";
488
- readonly thinking: string;
489
- readonly redacted?: boolean | undefined;
490
- } | {
491
- readonly type: "toolCall";
492
- readonly toolCallId: string;
493
- readonly toolName: string;
494
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
495
- })[];
496
- readonly model: {
497
- readonly provider: string;
498
- readonly id: string;
499
- };
500
- readonly responseModel?: string | undefined;
501
- readonly usage?: {
502
- readonly input: number;
503
- readonly output: number;
504
- readonly cacheRead: number;
505
- readonly cacheWrite: number;
506
- readonly reasoning?: number | undefined;
507
- readonly totalTokens: number;
508
- readonly cost: {
509
- readonly input: number;
510
- readonly output: number;
511
- readonly cacheRead: number;
512
- readonly cacheWrite: number;
513
- readonly total: number;
514
- };
515
- } | undefined;
516
- readonly timestamp: number;
517
- readonly status: "aborted";
518
- readonly stopReason: "aborted";
519
- readonly errorMessage?: string | undefined;
520
- } | {
521
- readonly id: string;
522
- readonly role: "tool";
523
- readonly toolCallId: string;
524
- readonly toolName: string;
525
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
526
- readonly content: ({
527
- readonly type: "text";
528
- readonly text: string;
529
- } | {
530
- readonly type: "image";
531
- readonly data: string;
532
- readonly mimeType: string;
533
- })[];
534
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
535
- readonly usage?: {
536
- readonly input: number;
537
- readonly output: number;
538
- readonly cacheRead: number;
539
- readonly cacheWrite: number;
540
- readonly reasoning?: number | undefined;
541
- readonly totalTokens: number;
542
- readonly cost: {
543
- readonly input: number;
544
- readonly output: number;
545
- readonly cacheRead: number;
546
- readonly cacheWrite: number;
547
- readonly total: number;
548
- };
549
- } | undefined;
550
- readonly timestamp: number;
551
- readonly status: "running";
552
- readonly isError: false;
553
- } | {
554
- readonly id: string;
555
- readonly role: "tool";
556
- readonly toolCallId: string;
557
- readonly toolName: string;
558
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
559
- readonly content: ({
560
- readonly type: "text";
561
- readonly text: string;
562
- } | {
563
- readonly type: "image";
564
- readonly data: string;
565
- readonly mimeType: string;
566
- })[];
567
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
568
- readonly usage?: {
569
- readonly input: number;
570
- readonly output: number;
571
- readonly cacheRead: number;
572
- readonly cacheWrite: number;
573
- readonly reasoning?: number | undefined;
574
- readonly totalTokens: number;
575
- readonly cost: {
576
- readonly input: number;
577
- readonly output: number;
578
- readonly cacheRead: number;
579
- readonly cacheWrite: number;
580
- readonly total: number;
581
- };
582
- } | undefined;
583
- readonly timestamp: number;
584
- readonly status: "complete";
585
- readonly isError: false;
586
- } | {
587
- readonly id: string;
588
- readonly role: "tool";
589
- readonly toolCallId: string;
590
- readonly toolName: string;
591
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
592
- readonly content: ({
593
- readonly type: "text";
594
- readonly text: string;
595
- } | {
596
- readonly type: "image";
597
- readonly data: string;
598
- readonly mimeType: string;
599
- })[];
600
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
601
- readonly usage?: {
602
- readonly input: number;
603
- readonly output: number;
604
- readonly cacheRead: number;
605
- readonly cacheWrite: number;
606
- readonly reasoning?: number | undefined;
607
- readonly totalTokens: number;
608
- readonly cost: {
609
- readonly input: number;
610
- readonly output: number;
611
- readonly cacheRead: number;
612
- readonly cacheWrite: number;
613
- readonly total: number;
614
- };
615
- } | undefined;
616
- readonly timestamp: number;
617
- readonly status: "error";
618
- readonly isError: true;
619
- })[];
620
- readonly queuedSteer: {
621
- readonly id: string;
622
- readonly role: "user";
623
- readonly content: ({
624
- readonly type: "text";
625
- readonly text: string;
626
- } | {
627
- readonly type: "image";
628
- readonly data: string;
629
- readonly mimeType: string;
630
- })[];
631
- readonly timestamp: number;
632
- }[];
633
- readonly queuedSteerCount: number;
634
- };
635
- sessionId?: undefined;
636
- } | {
637
- sessions?: undefined;
638
- command: "detach";
639
- sessionId: string;
640
- session?: undefined;
641
- } | {
642
- sessions?: undefined;
643
- sessionId?: undefined;
644
- command: "prompt";
645
- session: {
646
- readonly id: string;
647
- readonly name?: string | undefined;
648
- readonly cwd: string;
649
- readonly createdAt: number;
650
- readonly updatedAt: number;
651
- readonly phase: "branch_summary" | "compaction" | "idle" | "retry" | "turn";
652
- readonly model: {
653
- readonly provider: string;
654
- readonly id: string;
655
- };
656
- readonly thinkingLevel: "high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh";
657
- readonly attached: boolean;
658
- readonly locked: boolean;
659
- readonly revision: number;
660
- readonly transcript: ({
661
- readonly id: string;
662
- readonly role: "user";
663
- readonly content: ({
664
- readonly type: "text";
665
- readonly text: string;
666
- } | {
667
- readonly type: "image";
668
- readonly data: string;
669
- readonly mimeType: string;
670
- })[];
671
- readonly timestamp: number;
672
- } | {
673
- readonly id: string;
674
- readonly role: "assistant";
675
- readonly content: ({
676
- readonly type: "text";
677
- readonly text: string;
678
- } | {
679
- readonly type: "thinking";
680
- readonly thinking: string;
681
- readonly redacted?: boolean | undefined;
682
- } | {
683
- readonly type: "toolCall";
684
- readonly toolCallId: string;
685
- readonly toolName: string;
686
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
687
- })[];
688
- readonly model: {
689
- readonly provider: string;
690
- readonly id: string;
691
- };
692
- readonly responseModel?: string | undefined;
693
- readonly usage?: {
694
- readonly input: number;
695
- readonly output: number;
696
- readonly cacheRead: number;
697
- readonly cacheWrite: number;
698
- readonly reasoning?: number | undefined;
699
- readonly totalTokens: number;
700
- readonly cost: {
701
- readonly input: number;
702
- readonly output: number;
703
- readonly cacheRead: number;
704
- readonly cacheWrite: number;
705
- readonly total: number;
706
- };
707
- } | undefined;
708
- readonly timestamp: number;
709
- readonly status: "streaming";
710
- } | {
711
- readonly id: string;
712
- readonly role: "assistant";
713
- readonly content: ({
714
- readonly type: "text";
715
- readonly text: string;
716
- } | {
717
- readonly type: "thinking";
718
- readonly thinking: string;
719
- readonly redacted?: boolean | undefined;
720
- } | {
721
- readonly type: "toolCall";
722
- readonly toolCallId: string;
723
- readonly toolName: string;
724
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
725
- })[];
726
- readonly model: {
727
- readonly provider: string;
728
- readonly id: string;
729
- };
730
- readonly responseModel?: string | undefined;
731
- readonly usage?: {
732
- readonly input: number;
733
- readonly output: number;
734
- readonly cacheRead: number;
735
- readonly cacheWrite: number;
736
- readonly reasoning?: number | undefined;
737
- readonly totalTokens: number;
738
- readonly cost: {
739
- readonly input: number;
740
- readonly output: number;
741
- readonly cacheRead: number;
742
- readonly cacheWrite: number;
743
- readonly total: number;
744
- };
745
- } | undefined;
746
- readonly timestamp: number;
747
- readonly status: "complete";
748
- readonly stopReason: "length" | "stop" | "toolUse";
749
- } | {
750
- readonly id: string;
751
- readonly role: "assistant";
752
- readonly content: ({
753
- readonly type: "text";
754
- readonly text: string;
755
- } | {
756
- readonly type: "thinking";
757
- readonly thinking: string;
758
- readonly redacted?: boolean | undefined;
759
- } | {
760
- readonly type: "toolCall";
761
- readonly toolCallId: string;
762
- readonly toolName: string;
763
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
764
- })[];
765
- readonly model: {
766
- readonly provider: string;
767
- readonly id: string;
768
- };
769
- readonly responseModel?: string | undefined;
770
- readonly usage?: {
771
- readonly input: number;
772
- readonly output: number;
773
- readonly cacheRead: number;
774
- readonly cacheWrite: number;
775
- readonly reasoning?: number | undefined;
776
- readonly totalTokens: number;
777
- readonly cost: {
778
- readonly input: number;
779
- readonly output: number;
780
- readonly cacheRead: number;
781
- readonly cacheWrite: number;
782
- readonly total: number;
783
- };
784
- } | undefined;
785
- readonly timestamp: number;
786
- readonly status: "error";
787
- readonly stopReason: "error";
788
- readonly errorMessage?: string | undefined;
789
- } | {
790
- readonly id: string;
791
- readonly role: "assistant";
792
- readonly content: ({
793
- readonly type: "text";
794
- readonly text: string;
795
- } | {
796
- readonly type: "thinking";
797
- readonly thinking: string;
798
- readonly redacted?: boolean | undefined;
799
- } | {
800
- readonly type: "toolCall";
801
- readonly toolCallId: string;
802
- readonly toolName: string;
803
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
804
- })[];
805
- readonly model: {
806
- readonly provider: string;
807
- readonly id: string;
808
- };
809
- readonly responseModel?: string | undefined;
810
- readonly usage?: {
811
- readonly input: number;
812
- readonly output: number;
813
- readonly cacheRead: number;
814
- readonly cacheWrite: number;
815
- readonly reasoning?: number | undefined;
816
- readonly totalTokens: number;
817
- readonly cost: {
818
- readonly input: number;
819
- readonly output: number;
820
- readonly cacheRead: number;
821
- readonly cacheWrite: number;
822
- readonly total: number;
823
- };
824
- } | undefined;
825
- readonly timestamp: number;
826
- readonly status: "aborted";
827
- readonly stopReason: "aborted";
828
- readonly errorMessage?: string | undefined;
829
- } | {
830
- readonly id: string;
831
- readonly role: "tool";
832
- readonly toolCallId: string;
833
- readonly toolName: string;
834
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
835
- readonly content: ({
836
- readonly type: "text";
837
- readonly text: string;
838
- } | {
839
- readonly type: "image";
840
- readonly data: string;
841
- readonly mimeType: string;
842
- })[];
843
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
844
- readonly usage?: {
845
- readonly input: number;
846
- readonly output: number;
847
- readonly cacheRead: number;
848
- readonly cacheWrite: number;
849
- readonly reasoning?: number | undefined;
850
- readonly totalTokens: number;
851
- readonly cost: {
852
- readonly input: number;
853
- readonly output: number;
854
- readonly cacheRead: number;
855
- readonly cacheWrite: number;
856
- readonly total: number;
857
- };
858
- } | undefined;
859
- readonly timestamp: number;
860
- readonly status: "running";
861
- readonly isError: false;
862
- } | {
863
- readonly id: string;
864
- readonly role: "tool";
865
- readonly toolCallId: string;
866
- readonly toolName: string;
867
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
868
- readonly content: ({
869
- readonly type: "text";
870
- readonly text: string;
871
- } | {
872
- readonly type: "image";
873
- readonly data: string;
874
- readonly mimeType: string;
875
- })[];
876
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
877
- readonly usage?: {
878
- readonly input: number;
879
- readonly output: number;
880
- readonly cacheRead: number;
881
- readonly cacheWrite: number;
882
- readonly reasoning?: number | undefined;
883
- readonly totalTokens: number;
884
- readonly cost: {
885
- readonly input: number;
886
- readonly output: number;
887
- readonly cacheRead: number;
888
- readonly cacheWrite: number;
889
- readonly total: number;
890
- };
891
- } | undefined;
892
- readonly timestamp: number;
893
- readonly status: "complete";
894
- readonly isError: false;
895
- } | {
896
- readonly id: string;
897
- readonly role: "tool";
898
- readonly toolCallId: string;
899
- readonly toolName: string;
900
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
901
- readonly content: ({
902
- readonly type: "text";
903
- readonly text: string;
904
- } | {
905
- readonly type: "image";
906
- readonly data: string;
907
- readonly mimeType: string;
908
- })[];
909
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
910
- readonly usage?: {
911
- readonly input: number;
912
- readonly output: number;
913
- readonly cacheRead: number;
914
- readonly cacheWrite: number;
915
- readonly reasoning?: number | undefined;
916
- readonly totalTokens: number;
917
- readonly cost: {
918
- readonly input: number;
919
- readonly output: number;
920
- readonly cacheRead: number;
921
- readonly cacheWrite: number;
922
- readonly total: number;
923
- };
924
- } | undefined;
925
- readonly timestamp: number;
926
- readonly status: "error";
927
- readonly isError: true;
928
- })[];
929
- readonly queuedSteer: {
930
- readonly id: string;
931
- readonly role: "user";
932
- readonly content: ({
933
- readonly type: "text";
934
- readonly text: string;
935
- } | {
936
- readonly type: "image";
937
- readonly data: string;
938
- readonly mimeType: string;
939
- })[];
940
- readonly timestamp: number;
941
- }[];
942
- readonly queuedSteerCount: number;
943
- };
944
- } | {
945
- sessions?: undefined;
946
- sessionId?: undefined;
947
- command: "steer";
948
- session: {
949
- readonly id: string;
950
- readonly name?: string | undefined;
951
- readonly cwd: string;
952
- readonly createdAt: number;
953
- readonly updatedAt: number;
954
- readonly phase: "branch_summary" | "compaction" | "idle" | "retry" | "turn";
955
- readonly model: {
956
- readonly provider: string;
957
- readonly id: string;
958
- };
959
- readonly thinkingLevel: "high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh";
960
- readonly attached: boolean;
961
- readonly locked: boolean;
962
- readonly revision: number;
963
- readonly transcript: ({
964
- readonly id: string;
965
- readonly role: "user";
966
- readonly content: ({
967
- readonly type: "text";
968
- readonly text: string;
969
- } | {
970
- readonly type: "image";
971
- readonly data: string;
972
- readonly mimeType: string;
973
- })[];
974
- readonly timestamp: number;
975
- } | {
976
- readonly id: string;
977
- readonly role: "assistant";
978
- readonly content: ({
979
- readonly type: "text";
980
- readonly text: string;
981
- } | {
982
- readonly type: "thinking";
983
- readonly thinking: string;
984
- readonly redacted?: boolean | undefined;
985
- } | {
986
- readonly type: "toolCall";
987
- readonly toolCallId: string;
988
- readonly toolName: string;
989
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
990
- })[];
991
- readonly model: {
992
- readonly provider: string;
993
- readonly id: string;
994
- };
995
- readonly responseModel?: string | undefined;
996
- readonly usage?: {
997
- readonly input: number;
998
- readonly output: number;
999
- readonly cacheRead: number;
1000
- readonly cacheWrite: number;
1001
- readonly reasoning?: number | undefined;
1002
- readonly totalTokens: number;
1003
- readonly cost: {
1004
- readonly input: number;
1005
- readonly output: number;
1006
- readonly cacheRead: number;
1007
- readonly cacheWrite: number;
1008
- readonly total: number;
1009
- };
1010
- } | undefined;
1011
- readonly timestamp: number;
1012
- readonly status: "streaming";
1013
- } | {
1014
- readonly id: string;
1015
- readonly role: "assistant";
1016
- readonly content: ({
1017
- readonly type: "text";
1018
- readonly text: string;
1019
- } | {
1020
- readonly type: "thinking";
1021
- readonly thinking: string;
1022
- readonly redacted?: boolean | undefined;
1023
- } | {
1024
- readonly type: "toolCall";
1025
- readonly toolCallId: string;
1026
- readonly toolName: string;
1027
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1028
- })[];
1029
- readonly model: {
1030
- readonly provider: string;
1031
- readonly id: string;
1032
- };
1033
- readonly responseModel?: string | undefined;
1034
- readonly usage?: {
1035
- readonly input: number;
1036
- readonly output: number;
1037
- readonly cacheRead: number;
1038
- readonly cacheWrite: number;
1039
- readonly reasoning?: number | undefined;
1040
- readonly totalTokens: number;
1041
- readonly cost: {
1042
- readonly input: number;
1043
- readonly output: number;
1044
- readonly cacheRead: number;
1045
- readonly cacheWrite: number;
1046
- readonly total: number;
1047
- };
1048
- } | undefined;
1049
- readonly timestamp: number;
1050
- readonly status: "complete";
1051
- readonly stopReason: "length" | "stop" | "toolUse";
1052
- } | {
1053
- readonly id: string;
1054
- readonly role: "assistant";
1055
- readonly content: ({
1056
- readonly type: "text";
1057
- readonly text: string;
1058
- } | {
1059
- readonly type: "thinking";
1060
- readonly thinking: string;
1061
- readonly redacted?: boolean | undefined;
1062
- } | {
1063
- readonly type: "toolCall";
1064
- readonly toolCallId: string;
1065
- readonly toolName: string;
1066
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1067
- })[];
1068
- readonly model: {
1069
- readonly provider: string;
1070
- readonly id: string;
1071
- };
1072
- readonly responseModel?: string | undefined;
1073
- readonly usage?: {
1074
- readonly input: number;
1075
- readonly output: number;
1076
- readonly cacheRead: number;
1077
- readonly cacheWrite: number;
1078
- readonly reasoning?: number | undefined;
1079
- readonly totalTokens: number;
1080
- readonly cost: {
1081
- readonly input: number;
1082
- readonly output: number;
1083
- readonly cacheRead: number;
1084
- readonly cacheWrite: number;
1085
- readonly total: number;
1086
- };
1087
- } | undefined;
1088
- readonly timestamp: number;
1089
- readonly status: "error";
1090
- readonly stopReason: "error";
1091
- readonly errorMessage?: string | undefined;
1092
- } | {
1093
- readonly id: string;
1094
- readonly role: "assistant";
1095
- readonly content: ({
1096
- readonly type: "text";
1097
- readonly text: string;
1098
- } | {
1099
- readonly type: "thinking";
1100
- readonly thinking: string;
1101
- readonly redacted?: boolean | undefined;
1102
- } | {
1103
- readonly type: "toolCall";
1104
- readonly toolCallId: string;
1105
- readonly toolName: string;
1106
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1107
- })[];
1108
- readonly model: {
1109
- readonly provider: string;
1110
- readonly id: string;
1111
- };
1112
- readonly responseModel?: string | undefined;
1113
- readonly usage?: {
1114
- readonly input: number;
1115
- readonly output: number;
1116
- readonly cacheRead: number;
1117
- readonly cacheWrite: number;
1118
- readonly reasoning?: number | undefined;
1119
- readonly totalTokens: number;
1120
- readonly cost: {
1121
- readonly input: number;
1122
- readonly output: number;
1123
- readonly cacheRead: number;
1124
- readonly cacheWrite: number;
1125
- readonly total: number;
1126
- };
1127
- } | undefined;
1128
- readonly timestamp: number;
1129
- readonly status: "aborted";
1130
- readonly stopReason: "aborted";
1131
- readonly errorMessage?: string | undefined;
1132
- } | {
1133
- readonly id: string;
1134
- readonly role: "tool";
1135
- readonly toolCallId: string;
1136
- readonly toolName: string;
1137
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1138
- readonly content: ({
1139
- readonly type: "text";
1140
- readonly text: string;
1141
- } | {
1142
- readonly type: "image";
1143
- readonly data: string;
1144
- readonly mimeType: string;
1145
- })[];
1146
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
1147
- readonly usage?: {
1148
- readonly input: number;
1149
- readonly output: number;
1150
- readonly cacheRead: number;
1151
- readonly cacheWrite: number;
1152
- readonly reasoning?: number | undefined;
1153
- readonly totalTokens: number;
1154
- readonly cost: {
1155
- readonly input: number;
1156
- readonly output: number;
1157
- readonly cacheRead: number;
1158
- readonly cacheWrite: number;
1159
- readonly total: number;
1160
- };
1161
- } | undefined;
1162
- readonly timestamp: number;
1163
- readonly status: "running";
1164
- readonly isError: false;
1165
- } | {
1166
- readonly id: string;
1167
- readonly role: "tool";
1168
- readonly toolCallId: string;
1169
- readonly toolName: string;
1170
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1171
- readonly content: ({
1172
- readonly type: "text";
1173
- readonly text: string;
1174
- } | {
1175
- readonly type: "image";
1176
- readonly data: string;
1177
- readonly mimeType: string;
1178
- })[];
1179
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
1180
- readonly usage?: {
1181
- readonly input: number;
1182
- readonly output: number;
1183
- readonly cacheRead: number;
1184
- readonly cacheWrite: number;
1185
- readonly reasoning?: number | undefined;
1186
- readonly totalTokens: number;
1187
- readonly cost: {
1188
- readonly input: number;
1189
- readonly output: number;
1190
- readonly cacheRead: number;
1191
- readonly cacheWrite: number;
1192
- readonly total: number;
1193
- };
1194
- } | undefined;
1195
- readonly timestamp: number;
1196
- readonly status: "complete";
1197
- readonly isError: false;
1198
- } | {
1199
- readonly id: string;
1200
- readonly role: "tool";
1201
- readonly toolCallId: string;
1202
- readonly toolName: string;
1203
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1204
- readonly content: ({
1205
- readonly type: "text";
1206
- readonly text: string;
1207
- } | {
1208
- readonly type: "image";
1209
- readonly data: string;
1210
- readonly mimeType: string;
1211
- })[];
1212
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
1213
- readonly usage?: {
1214
- readonly input: number;
1215
- readonly output: number;
1216
- readonly cacheRead: number;
1217
- readonly cacheWrite: number;
1218
- readonly reasoning?: number | undefined;
1219
- readonly totalTokens: number;
1220
- readonly cost: {
1221
- readonly input: number;
1222
- readonly output: number;
1223
- readonly cacheRead: number;
1224
- readonly cacheWrite: number;
1225
- readonly total: number;
1226
- };
1227
- } | undefined;
1228
- readonly timestamp: number;
1229
- readonly status: "error";
1230
- readonly isError: true;
1231
- })[];
1232
- readonly queuedSteer: {
1233
- readonly id: string;
1234
- readonly role: "user";
1235
- readonly content: ({
1236
- readonly type: "text";
1237
- readonly text: string;
1238
- } | {
1239
- readonly type: "image";
1240
- readonly data: string;
1241
- readonly mimeType: string;
1242
- })[];
1243
- readonly timestamp: number;
1244
- }[];
1245
- readonly queuedSteerCount: number;
1246
- };
1247
- } | {
1248
- sessions?: undefined;
1249
- sessionId?: undefined;
1250
- command: "abort";
1251
- session: {
1252
- readonly id: string;
1253
- readonly name?: string | undefined;
1254
- readonly cwd: string;
1255
- readonly createdAt: number;
1256
- readonly updatedAt: number;
1257
- readonly phase: "branch_summary" | "compaction" | "idle" | "retry" | "turn";
1258
- readonly model: {
1259
- readonly provider: string;
1260
- readonly id: string;
1261
- };
1262
- readonly thinkingLevel: "high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh";
1263
- readonly attached: boolean;
1264
- readonly locked: boolean;
1265
- readonly revision: number;
1266
- readonly transcript: ({
1267
- readonly id: string;
1268
- readonly role: "user";
1269
- readonly content: ({
1270
- readonly type: "text";
1271
- readonly text: string;
1272
- } | {
1273
- readonly type: "image";
1274
- readonly data: string;
1275
- readonly mimeType: string;
1276
- })[];
1277
- readonly timestamp: number;
1278
- } | {
1279
- readonly id: string;
1280
- readonly role: "assistant";
1281
- readonly content: ({
1282
- readonly type: "text";
1283
- readonly text: string;
1284
- } | {
1285
- readonly type: "thinking";
1286
- readonly thinking: string;
1287
- readonly redacted?: boolean | undefined;
1288
- } | {
1289
- readonly type: "toolCall";
1290
- readonly toolCallId: string;
1291
- readonly toolName: string;
1292
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1293
- })[];
1294
- readonly model: {
1295
- readonly provider: string;
1296
- readonly id: string;
1297
- };
1298
- readonly responseModel?: string | undefined;
1299
- readonly usage?: {
1300
- readonly input: number;
1301
- readonly output: number;
1302
- readonly cacheRead: number;
1303
- readonly cacheWrite: number;
1304
- readonly reasoning?: number | undefined;
1305
- readonly totalTokens: number;
1306
- readonly cost: {
1307
- readonly input: number;
1308
- readonly output: number;
1309
- readonly cacheRead: number;
1310
- readonly cacheWrite: number;
1311
- readonly total: number;
1312
- };
1313
- } | undefined;
1314
- readonly timestamp: number;
1315
- readonly status: "streaming";
1316
- } | {
1317
- readonly id: string;
1318
- readonly role: "assistant";
1319
- readonly content: ({
1320
- readonly type: "text";
1321
- readonly text: string;
1322
- } | {
1323
- readonly type: "thinking";
1324
- readonly thinking: string;
1325
- readonly redacted?: boolean | undefined;
1326
- } | {
1327
- readonly type: "toolCall";
1328
- readonly toolCallId: string;
1329
- readonly toolName: string;
1330
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1331
- })[];
1332
- readonly model: {
1333
- readonly provider: string;
1334
- readonly id: string;
1335
- };
1336
- readonly responseModel?: string | undefined;
1337
- readonly usage?: {
1338
- readonly input: number;
1339
- readonly output: number;
1340
- readonly cacheRead: number;
1341
- readonly cacheWrite: number;
1342
- readonly reasoning?: number | undefined;
1343
- readonly totalTokens: number;
1344
- readonly cost: {
1345
- readonly input: number;
1346
- readonly output: number;
1347
- readonly cacheRead: number;
1348
- readonly cacheWrite: number;
1349
- readonly total: number;
1350
- };
1351
- } | undefined;
1352
- readonly timestamp: number;
1353
- readonly status: "complete";
1354
- readonly stopReason: "length" | "stop" | "toolUse";
1355
- } | {
1356
- readonly id: string;
1357
- readonly role: "assistant";
1358
- readonly content: ({
1359
- readonly type: "text";
1360
- readonly text: string;
1361
- } | {
1362
- readonly type: "thinking";
1363
- readonly thinking: string;
1364
- readonly redacted?: boolean | undefined;
1365
- } | {
1366
- readonly type: "toolCall";
1367
- readonly toolCallId: string;
1368
- readonly toolName: string;
1369
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1370
- })[];
1371
- readonly model: {
1372
- readonly provider: string;
1373
- readonly id: string;
1374
- };
1375
- readonly responseModel?: string | undefined;
1376
- readonly usage?: {
1377
- readonly input: number;
1378
- readonly output: number;
1379
- readonly cacheRead: number;
1380
- readonly cacheWrite: number;
1381
- readonly reasoning?: number | undefined;
1382
- readonly totalTokens: number;
1383
- readonly cost: {
1384
- readonly input: number;
1385
- readonly output: number;
1386
- readonly cacheRead: number;
1387
- readonly cacheWrite: number;
1388
- readonly total: number;
1389
- };
1390
- } | undefined;
1391
- readonly timestamp: number;
1392
- readonly status: "error";
1393
- readonly stopReason: "error";
1394
- readonly errorMessage?: string | undefined;
1395
- } | {
1396
- readonly id: string;
1397
- readonly role: "assistant";
1398
- readonly content: ({
1399
- readonly type: "text";
1400
- readonly text: string;
1401
- } | {
1402
- readonly type: "thinking";
1403
- readonly thinking: string;
1404
- readonly redacted?: boolean | undefined;
1405
- } | {
1406
- readonly type: "toolCall";
1407
- readonly toolCallId: string;
1408
- readonly toolName: string;
1409
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1410
- })[];
1411
- readonly model: {
1412
- readonly provider: string;
1413
- readonly id: string;
1414
- };
1415
- readonly responseModel?: string | undefined;
1416
- readonly usage?: {
1417
- readonly input: number;
1418
- readonly output: number;
1419
- readonly cacheRead: number;
1420
- readonly cacheWrite: number;
1421
- readonly reasoning?: number | undefined;
1422
- readonly totalTokens: number;
1423
- readonly cost: {
1424
- readonly input: number;
1425
- readonly output: number;
1426
- readonly cacheRead: number;
1427
- readonly cacheWrite: number;
1428
- readonly total: number;
1429
- };
1430
- } | undefined;
1431
- readonly timestamp: number;
1432
- readonly status: "aborted";
1433
- readonly stopReason: "aborted";
1434
- readonly errorMessage?: string | undefined;
1435
- } | {
1436
- readonly id: string;
1437
- readonly role: "tool";
1438
- readonly toolCallId: string;
1439
- readonly toolName: string;
1440
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1441
- readonly content: ({
1442
- readonly type: "text";
1443
- readonly text: string;
1444
- } | {
1445
- readonly type: "image";
1446
- readonly data: string;
1447
- readonly mimeType: string;
1448
- })[];
1449
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
1450
- readonly usage?: {
1451
- readonly input: number;
1452
- readonly output: number;
1453
- readonly cacheRead: number;
1454
- readonly cacheWrite: number;
1455
- readonly reasoning?: number | undefined;
1456
- readonly totalTokens: number;
1457
- readonly cost: {
1458
- readonly input: number;
1459
- readonly output: number;
1460
- readonly cacheRead: number;
1461
- readonly cacheWrite: number;
1462
- readonly total: number;
1463
- };
1464
- } | undefined;
1465
- readonly timestamp: number;
1466
- readonly status: "running";
1467
- readonly isError: false;
1468
- } | {
1469
- readonly id: string;
1470
- readonly role: "tool";
1471
- readonly toolCallId: string;
1472
- readonly toolName: string;
1473
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1474
- readonly content: ({
1475
- readonly type: "text";
1476
- readonly text: string;
1477
- } | {
1478
- readonly type: "image";
1479
- readonly data: string;
1480
- readonly mimeType: string;
1481
- })[];
1482
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
1483
- readonly usage?: {
1484
- readonly input: number;
1485
- readonly output: number;
1486
- readonly cacheRead: number;
1487
- readonly cacheWrite: number;
1488
- readonly reasoning?: number | undefined;
1489
- readonly totalTokens: number;
1490
- readonly cost: {
1491
- readonly input: number;
1492
- readonly output: number;
1493
- readonly cacheRead: number;
1494
- readonly cacheWrite: number;
1495
- readonly total: number;
1496
- };
1497
- } | undefined;
1498
- readonly timestamp: number;
1499
- readonly status: "complete";
1500
- readonly isError: false;
1501
- } | {
1502
- readonly id: string;
1503
- readonly role: "tool";
1504
- readonly toolCallId: string;
1505
- readonly toolName: string;
1506
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1507
- readonly content: ({
1508
- readonly type: "text";
1509
- readonly text: string;
1510
- } | {
1511
- readonly type: "image";
1512
- readonly data: string;
1513
- readonly mimeType: string;
1514
- })[];
1515
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
1516
- readonly usage?: {
1517
- readonly input: number;
1518
- readonly output: number;
1519
- readonly cacheRead: number;
1520
- readonly cacheWrite: number;
1521
- readonly reasoning?: number | undefined;
1522
- readonly totalTokens: number;
1523
- readonly cost: {
1524
- readonly input: number;
1525
- readonly output: number;
1526
- readonly cacheRead: number;
1527
- readonly cacheWrite: number;
1528
- readonly total: number;
1529
- };
1530
- } | undefined;
1531
- readonly timestamp: number;
1532
- readonly status: "error";
1533
- readonly isError: true;
1534
- })[];
1535
- readonly queuedSteer: {
1536
- readonly id: string;
1537
- readonly role: "user";
1538
- readonly content: ({
1539
- readonly type: "text";
1540
- readonly text: string;
1541
- } | {
1542
- readonly type: "image";
1543
- readonly data: string;
1544
- readonly mimeType: string;
1545
- })[];
1546
- readonly timestamp: number;
1547
- }[];
1548
- readonly queuedSteerCount: number;
1549
- };
1550
- } | {
1551
- sessions?: undefined;
1552
- sessionId?: undefined;
1553
- command: "set_model";
1554
- session: {
1555
- readonly id: string;
1556
- readonly name?: string | undefined;
1557
- readonly cwd: string;
1558
- readonly createdAt: number;
1559
- readonly updatedAt: number;
1560
- readonly phase: "branch_summary" | "compaction" | "idle" | "retry" | "turn";
1561
- readonly model: {
1562
- readonly provider: string;
1563
- readonly id: string;
1564
- };
1565
- readonly thinkingLevel: "high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh";
1566
- readonly attached: boolean;
1567
- readonly locked: boolean;
1568
- readonly revision: number;
1569
- readonly transcript: ({
1570
- readonly id: string;
1571
- readonly role: "user";
1572
- readonly content: ({
1573
- readonly type: "text";
1574
- readonly text: string;
1575
- } | {
1576
- readonly type: "image";
1577
- readonly data: string;
1578
- readonly mimeType: string;
1579
- })[];
1580
- readonly timestamp: number;
1581
- } | {
1582
- readonly id: string;
1583
- readonly role: "assistant";
1584
- readonly content: ({
1585
- readonly type: "text";
1586
- readonly text: string;
1587
- } | {
1588
- readonly type: "thinking";
1589
- readonly thinking: string;
1590
- readonly redacted?: boolean | undefined;
1591
- } | {
1592
- readonly type: "toolCall";
1593
- readonly toolCallId: string;
1594
- readonly toolName: string;
1595
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1596
- })[];
1597
- readonly model: {
1598
- readonly provider: string;
1599
- readonly id: string;
1600
- };
1601
- readonly responseModel?: string | undefined;
1602
- readonly usage?: {
1603
- readonly input: number;
1604
- readonly output: number;
1605
- readonly cacheRead: number;
1606
- readonly cacheWrite: number;
1607
- readonly reasoning?: number | undefined;
1608
- readonly totalTokens: number;
1609
- readonly cost: {
1610
- readonly input: number;
1611
- readonly output: number;
1612
- readonly cacheRead: number;
1613
- readonly cacheWrite: number;
1614
- readonly total: number;
1615
- };
1616
- } | undefined;
1617
- readonly timestamp: number;
1618
- readonly status: "streaming";
1619
- } | {
1620
- readonly id: string;
1621
- readonly role: "assistant";
1622
- readonly content: ({
1623
- readonly type: "text";
1624
- readonly text: string;
1625
- } | {
1626
- readonly type: "thinking";
1627
- readonly thinking: string;
1628
- readonly redacted?: boolean | undefined;
1629
- } | {
1630
- readonly type: "toolCall";
1631
- readonly toolCallId: string;
1632
- readonly toolName: string;
1633
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1634
- })[];
1635
- readonly model: {
1636
- readonly provider: string;
1637
- readonly id: string;
1638
- };
1639
- readonly responseModel?: string | undefined;
1640
- readonly usage?: {
1641
- readonly input: number;
1642
- readonly output: number;
1643
- readonly cacheRead: number;
1644
- readonly cacheWrite: number;
1645
- readonly reasoning?: number | undefined;
1646
- readonly totalTokens: number;
1647
- readonly cost: {
1648
- readonly input: number;
1649
- readonly output: number;
1650
- readonly cacheRead: number;
1651
- readonly cacheWrite: number;
1652
- readonly total: number;
1653
- };
1654
- } | undefined;
1655
- readonly timestamp: number;
1656
- readonly status: "complete";
1657
- readonly stopReason: "length" | "stop" | "toolUse";
1658
- } | {
1659
- readonly id: string;
1660
- readonly role: "assistant";
1661
- readonly content: ({
1662
- readonly type: "text";
1663
- readonly text: string;
1664
- } | {
1665
- readonly type: "thinking";
1666
- readonly thinking: string;
1667
- readonly redacted?: boolean | undefined;
1668
- } | {
1669
- readonly type: "toolCall";
1670
- readonly toolCallId: string;
1671
- readonly toolName: string;
1672
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1673
- })[];
1674
- readonly model: {
1675
- readonly provider: string;
1676
- readonly id: string;
1677
- };
1678
- readonly responseModel?: string | undefined;
1679
- readonly usage?: {
1680
- readonly input: number;
1681
- readonly output: number;
1682
- readonly cacheRead: number;
1683
- readonly cacheWrite: number;
1684
- readonly reasoning?: number | undefined;
1685
- readonly totalTokens: number;
1686
- readonly cost: {
1687
- readonly input: number;
1688
- readonly output: number;
1689
- readonly cacheRead: number;
1690
- readonly cacheWrite: number;
1691
- readonly total: number;
1692
- };
1693
- } | undefined;
1694
- readonly timestamp: number;
1695
- readonly status: "error";
1696
- readonly stopReason: "error";
1697
- readonly errorMessage?: string | undefined;
1698
- } | {
1699
- readonly id: string;
1700
- readonly role: "assistant";
1701
- readonly content: ({
1702
- readonly type: "text";
1703
- readonly text: string;
1704
- } | {
1705
- readonly type: "thinking";
1706
- readonly thinking: string;
1707
- readonly redacted?: boolean | undefined;
1708
- } | {
1709
- readonly type: "toolCall";
1710
- readonly toolCallId: string;
1711
- readonly toolName: string;
1712
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1713
- })[];
1714
- readonly model: {
1715
- readonly provider: string;
1716
- readonly id: string;
1717
- };
1718
- readonly responseModel?: string | undefined;
1719
- readonly usage?: {
1720
- readonly input: number;
1721
- readonly output: number;
1722
- readonly cacheRead: number;
1723
- readonly cacheWrite: number;
1724
- readonly reasoning?: number | undefined;
1725
- readonly totalTokens: number;
1726
- readonly cost: {
1727
- readonly input: number;
1728
- readonly output: number;
1729
- readonly cacheRead: number;
1730
- readonly cacheWrite: number;
1731
- readonly total: number;
1732
- };
1733
- } | undefined;
1734
- readonly timestamp: number;
1735
- readonly status: "aborted";
1736
- readonly stopReason: "aborted";
1737
- readonly errorMessage?: string | undefined;
1738
- } | {
1739
- readonly id: string;
1740
- readonly role: "tool";
1741
- readonly toolCallId: string;
1742
- readonly toolName: string;
1743
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1744
- readonly content: ({
1745
- readonly type: "text";
1746
- readonly text: string;
1747
- } | {
1748
- readonly type: "image";
1749
- readonly data: string;
1750
- readonly mimeType: string;
1751
- })[];
1752
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
1753
- readonly usage?: {
1754
- readonly input: number;
1755
- readonly output: number;
1756
- readonly cacheRead: number;
1757
- readonly cacheWrite: number;
1758
- readonly reasoning?: number | undefined;
1759
- readonly totalTokens: number;
1760
- readonly cost: {
1761
- readonly input: number;
1762
- readonly output: number;
1763
- readonly cacheRead: number;
1764
- readonly cacheWrite: number;
1765
- readonly total: number;
1766
- };
1767
- } | undefined;
1768
- readonly timestamp: number;
1769
- readonly status: "running";
1770
- readonly isError: false;
1771
- } | {
1772
- readonly id: string;
1773
- readonly role: "tool";
1774
- readonly toolCallId: string;
1775
- readonly toolName: string;
1776
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1777
- readonly content: ({
1778
- readonly type: "text";
1779
- readonly text: string;
1780
- } | {
1781
- readonly type: "image";
1782
- readonly data: string;
1783
- readonly mimeType: string;
1784
- })[];
1785
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
1786
- readonly usage?: {
1787
- readonly input: number;
1788
- readonly output: number;
1789
- readonly cacheRead: number;
1790
- readonly cacheWrite: number;
1791
- readonly reasoning?: number | undefined;
1792
- readonly totalTokens: number;
1793
- readonly cost: {
1794
- readonly input: number;
1795
- readonly output: number;
1796
- readonly cacheRead: number;
1797
- readonly cacheWrite: number;
1798
- readonly total: number;
1799
- };
1800
- } | undefined;
1801
- readonly timestamp: number;
1802
- readonly status: "complete";
1803
- readonly isError: false;
1804
- } | {
1805
- readonly id: string;
1806
- readonly role: "tool";
1807
- readonly toolCallId: string;
1808
- readonly toolName: string;
1809
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1810
- readonly content: ({
1811
- readonly type: "text";
1812
- readonly text: string;
1813
- } | {
1814
- readonly type: "image";
1815
- readonly data: string;
1816
- readonly mimeType: string;
1817
- })[];
1818
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
1819
- readonly usage?: {
1820
- readonly input: number;
1821
- readonly output: number;
1822
- readonly cacheRead: number;
1823
- readonly cacheWrite: number;
1824
- readonly reasoning?: number | undefined;
1825
- readonly totalTokens: number;
1826
- readonly cost: {
1827
- readonly input: number;
1828
- readonly output: number;
1829
- readonly cacheRead: number;
1830
- readonly cacheWrite: number;
1831
- readonly total: number;
1832
- };
1833
- } | undefined;
1834
- readonly timestamp: number;
1835
- readonly status: "error";
1836
- readonly isError: true;
1837
- })[];
1838
- readonly queuedSteer: {
1839
- readonly id: string;
1840
- readonly role: "user";
1841
- readonly content: ({
1842
- readonly type: "text";
1843
- readonly text: string;
1844
- } | {
1845
- readonly type: "image";
1846
- readonly data: string;
1847
- readonly mimeType: string;
1848
- })[];
1849
- readonly timestamp: number;
1850
- }[];
1851
- readonly queuedSteerCount: number;
1852
- };
1853
- } | {
1854
- sessions?: undefined;
1855
- sessionId?: undefined;
1856
- command: "set_thinking";
1857
- session: {
1858
- readonly id: string;
1859
- readonly name?: string | undefined;
1860
- readonly cwd: string;
1861
- readonly createdAt: number;
1862
- readonly updatedAt: number;
1863
- readonly phase: "branch_summary" | "compaction" | "idle" | "retry" | "turn";
1864
- readonly model: {
1865
- readonly provider: string;
1866
- readonly id: string;
1867
- };
1868
- readonly thinkingLevel: "high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh";
1869
- readonly attached: boolean;
1870
- readonly locked: boolean;
1871
- readonly revision: number;
1872
- readonly transcript: ({
1873
- readonly id: string;
1874
- readonly role: "user";
1875
- readonly content: ({
1876
- readonly type: "text";
1877
- readonly text: string;
1878
- } | {
1879
- readonly type: "image";
1880
- readonly data: string;
1881
- readonly mimeType: string;
1882
- })[];
1883
- readonly timestamp: number;
1884
- } | {
1885
- readonly id: string;
1886
- readonly role: "assistant";
1887
- readonly content: ({
1888
- readonly type: "text";
1889
- readonly text: string;
1890
- } | {
1891
- readonly type: "thinking";
1892
- readonly thinking: string;
1893
- readonly redacted?: boolean | undefined;
1894
- } | {
1895
- readonly type: "toolCall";
1896
- readonly toolCallId: string;
1897
- readonly toolName: string;
1898
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1899
- })[];
1900
- readonly model: {
1901
- readonly provider: string;
1902
- readonly id: string;
1903
- };
1904
- readonly responseModel?: string | undefined;
1905
- readonly usage?: {
1906
- readonly input: number;
1907
- readonly output: number;
1908
- readonly cacheRead: number;
1909
- readonly cacheWrite: number;
1910
- readonly reasoning?: number | undefined;
1911
- readonly totalTokens: number;
1912
- readonly cost: {
1913
- readonly input: number;
1914
- readonly output: number;
1915
- readonly cacheRead: number;
1916
- readonly cacheWrite: number;
1917
- readonly total: number;
1918
- };
1919
- } | undefined;
1920
- readonly timestamp: number;
1921
- readonly status: "streaming";
1922
- } | {
1923
- readonly id: string;
1924
- readonly role: "assistant";
1925
- readonly content: ({
1926
- readonly type: "text";
1927
- readonly text: string;
1928
- } | {
1929
- readonly type: "thinking";
1930
- readonly thinking: string;
1931
- readonly redacted?: boolean | undefined;
1932
- } | {
1933
- readonly type: "toolCall";
1934
- readonly toolCallId: string;
1935
- readonly toolName: string;
1936
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1937
- })[];
1938
- readonly model: {
1939
- readonly provider: string;
1940
- readonly id: string;
1941
- };
1942
- readonly responseModel?: string | undefined;
1943
- readonly usage?: {
1944
- readonly input: number;
1945
- readonly output: number;
1946
- readonly cacheRead: number;
1947
- readonly cacheWrite: number;
1948
- readonly reasoning?: number | undefined;
1949
- readonly totalTokens: number;
1950
- readonly cost: {
1951
- readonly input: number;
1952
- readonly output: number;
1953
- readonly cacheRead: number;
1954
- readonly cacheWrite: number;
1955
- readonly total: number;
1956
- };
1957
- } | undefined;
1958
- readonly timestamp: number;
1959
- readonly status: "complete";
1960
- readonly stopReason: "length" | "stop" | "toolUse";
1961
- } | {
1962
- readonly id: string;
1963
- readonly role: "assistant";
1964
- readonly content: ({
1965
- readonly type: "text";
1966
- readonly text: string;
1967
- } | {
1968
- readonly type: "thinking";
1969
- readonly thinking: string;
1970
- readonly redacted?: boolean | undefined;
1971
- } | {
1972
- readonly type: "toolCall";
1973
- readonly toolCallId: string;
1974
- readonly toolName: string;
1975
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
1976
- })[];
1977
- readonly model: {
1978
- readonly provider: string;
1979
- readonly id: string;
1980
- };
1981
- readonly responseModel?: string | undefined;
1982
- readonly usage?: {
1983
- readonly input: number;
1984
- readonly output: number;
1985
- readonly cacheRead: number;
1986
- readonly cacheWrite: number;
1987
- readonly reasoning?: number | undefined;
1988
- readonly totalTokens: number;
1989
- readonly cost: {
1990
- readonly input: number;
1991
- readonly output: number;
1992
- readonly cacheRead: number;
1993
- readonly cacheWrite: number;
1994
- readonly total: number;
1995
- };
1996
- } | undefined;
1997
- readonly timestamp: number;
1998
- readonly status: "error";
1999
- readonly stopReason: "error";
2000
- readonly errorMessage?: string | undefined;
2001
- } | {
2002
- readonly id: string;
2003
- readonly role: "assistant";
2004
- readonly content: ({
2005
- readonly type: "text";
2006
- readonly text: string;
2007
- } | {
2008
- readonly type: "thinking";
2009
- readonly thinking: string;
2010
- readonly redacted?: boolean | undefined;
2011
- } | {
2012
- readonly type: "toolCall";
2013
- readonly toolCallId: string;
2014
- readonly toolName: string;
2015
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
2016
- })[];
2017
- readonly model: {
2018
- readonly provider: string;
2019
- readonly id: string;
2020
- };
2021
- readonly responseModel?: string | undefined;
2022
- readonly usage?: {
2023
- readonly input: number;
2024
- readonly output: number;
2025
- readonly cacheRead: number;
2026
- readonly cacheWrite: number;
2027
- readonly reasoning?: number | undefined;
2028
- readonly totalTokens: number;
2029
- readonly cost: {
2030
- readonly input: number;
2031
- readonly output: number;
2032
- readonly cacheRead: number;
2033
- readonly cacheWrite: number;
2034
- readonly total: number;
2035
- };
2036
- } | undefined;
2037
- readonly timestamp: number;
2038
- readonly status: "aborted";
2039
- readonly stopReason: "aborted";
2040
- readonly errorMessage?: string | undefined;
2041
- } | {
2042
- readonly id: string;
2043
- readonly role: "tool";
2044
- readonly toolCallId: string;
2045
- readonly toolName: string;
2046
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
2047
- readonly content: ({
2048
- readonly type: "text";
2049
- readonly text: string;
2050
- } | {
2051
- readonly type: "image";
2052
- readonly data: string;
2053
- readonly mimeType: string;
2054
- })[];
2055
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
2056
- readonly usage?: {
2057
- readonly input: number;
2058
- readonly output: number;
2059
- readonly cacheRead: number;
2060
- readonly cacheWrite: number;
2061
- readonly reasoning?: number | undefined;
2062
- readonly totalTokens: number;
2063
- readonly cost: {
2064
- readonly input: number;
2065
- readonly output: number;
2066
- readonly cacheRead: number;
2067
- readonly cacheWrite: number;
2068
- readonly total: number;
2069
- };
2070
- } | undefined;
2071
- readonly timestamp: number;
2072
- readonly status: "running";
2073
- readonly isError: false;
2074
- } | {
2075
- readonly id: string;
2076
- readonly role: "tool";
2077
- readonly toolCallId: string;
2078
- readonly toolName: string;
2079
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
2080
- readonly content: ({
2081
- readonly type: "text";
2082
- readonly text: string;
2083
- } | {
2084
- readonly type: "image";
2085
- readonly data: string;
2086
- readonly mimeType: string;
2087
- })[];
2088
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
2089
- readonly usage?: {
2090
- readonly input: number;
2091
- readonly output: number;
2092
- readonly cacheRead: number;
2093
- readonly cacheWrite: number;
2094
- readonly reasoning?: number | undefined;
2095
- readonly totalTokens: number;
2096
- readonly cost: {
2097
- readonly input: number;
2098
- readonly output: number;
2099
- readonly cacheRead: number;
2100
- readonly cacheWrite: number;
2101
- readonly total: number;
2102
- };
2103
- } | undefined;
2104
- readonly timestamp: number;
2105
- readonly status: "complete";
2106
- readonly isError: false;
2107
- } | {
2108
- readonly id: string;
2109
- readonly role: "tool";
2110
- readonly toolCallId: string;
2111
- readonly toolName: string;
2112
- readonly input: import("@earendil-works/pi-protocol").JsonValue;
2113
- readonly content: ({
2114
- readonly type: "text";
2115
- readonly text: string;
2116
- } | {
2117
- readonly type: "image";
2118
- readonly data: string;
2119
- readonly mimeType: string;
2120
- })[];
2121
- readonly details?: import("@earendil-works/pi-protocol").JsonValue | undefined;
2122
- readonly usage?: {
2123
- readonly input: number;
2124
- readonly output: number;
2125
- readonly cacheRead: number;
2126
- readonly cacheWrite: number;
2127
- readonly reasoning?: number | undefined;
2128
- readonly totalTokens: number;
2129
- readonly cost: {
2130
- readonly input: number;
2131
- readonly output: number;
2132
- readonly cacheRead: number;
2133
- readonly cacheWrite: number;
2134
- readonly total: number;
2135
- };
2136
- } | undefined;
2137
- readonly timestamp: number;
2138
- readonly status: "error";
2139
- readonly isError: true;
2140
- })[];
2141
- readonly queuedSteer: {
2142
- readonly id: string;
2143
- readonly role: "user";
2144
- readonly content: ({
2145
- readonly type: "text";
2146
- readonly text: string;
2147
- } | {
2148
- readonly type: "image";
2149
- readonly data: string;
2150
- readonly mimeType: string;
2151
- })[];
2152
- readonly timestamp: number;
2153
- }[];
2154
- readonly queuedSteerCount: number;
2155
- };
2156
- }>;
2157
- disconnect(connection: ConnectionState): Promise<void>;
2158
- listMetadata(): Promise<SessionMetadata[]>;
2159
- close(): Promise<void>;
2160
- private runOperation;
2161
- private acquire;
2162
- private create;
2163
- private handleRuntimeEvent;
2164
- private terminate;
2165
- private normalizedSnapshot;
2166
- private forConnection;
2167
- private broadcastSnapshot;
2168
- private attach;
2169
- private requireAttached;
2170
- private scheduleMaybeDispose;
2171
- private maybeDispose;
2172
- }
2173
- export {};
2174
- //# sourceMappingURL=sessions.d.ts.map