@opencode/client 2.0.25 → 2.0.27

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 (61) hide show
  1. package/dist/chunks/{service-probe-1y4a697q.js → contract-1y4a697q.js} +1 -1
  2. package/dist/chunks/{service-probe-2ny4vxct.js → contract-2ny4vxct.js} +2 -2
  3. package/dist/chunks/{service-probe-y2etg5bs.js → contract-7f0py9js.js} +2 -2
  4. package/dist/chunks/{service-probe-vnspkrex.js → contract-9swsjjg0.js} +14 -14
  5. package/dist/chunks/{service-probe-trz7kcxd.js → contract-9vdz0zwn.js} +3 -2
  6. package/dist/chunks/contract-csw6v8a4.js +30 -0
  7. package/dist/chunks/{service-probe-frbwqjmf.js → contract-frbwqjmf.js} +1 -1
  8. package/dist/chunks/{service-probe-1thtawyv.js → contract-j4tgja9b.js} +1 -1
  9. package/dist/chunks/{service-probe-nwcpakzx.js → contract-js54wxgp.js} +2 -2
  10. package/dist/chunks/{service-probe-9h52wrcy.js → contract-qfk0hgz0.js} +27 -20
  11. package/dist/chunks/{service-probe-t1xa31vm.js → contract-t1xa31vm.js} +1 -1
  12. package/dist/chunks/{service-probe-65kht65h.js → contract-w1w809zr.js} +5 -5
  13. package/dist/chunks/{service-probe-y99g37y2.js → contract-ww92gbf0.js} +18 -18
  14. package/dist/contract.js +1 -1
  15. package/dist/effect/api/api.d.ts +71 -64
  16. package/dist/effect/client.d.ts +154 -153
  17. package/dist/effect/client.js +12 -12
  18. package/dist/effect/generated/client-error.js +3 -3
  19. package/dist/effect/generated/client.d.ts +20 -19
  20. package/dist/effect/generated/client.js +5 -5
  21. package/dist/effect/generated/index.js +8 -8
  22. package/dist/effect/index.js +12 -12
  23. package/dist/effect/rpc.js +4 -4
  24. package/dist/effect/service.js +6 -6
  25. package/dist/promise/client.d.ts +3 -3
  26. package/dist/promise/client.js +11 -11
  27. package/dist/promise/generated/client-error.js +3 -3
  28. package/dist/promise/generated/client.d.ts +4 -4
  29. package/dist/promise/generated/client.js +4 -4
  30. package/dist/promise/generated/index.js +10 -10
  31. package/dist/promise/generated/types.d.ts +1685 -1628
  32. package/dist/promise/generated/types.js +1 -1
  33. package/dist/promise/index.js +13 -13
  34. package/dist/promise/rpc.js +2 -2
  35. package/dist/promise/service.js +6 -6
  36. package/dist/pty-handoff.js +1 -1
  37. package/dist/rpc-runtime.js +1 -1
  38. package/dist/service-contender.js +1 -1
  39. package/dist/service-probe.js +3 -3
  40. package/dist/service-timing.js +1 -1
  41. package/dist/service-version.js +1 -1
  42. package/dist/service.js +1 -1
  43. package/dist/shared-events.js +1 -1
  44. package/dist/solid/connection.js +1 -1
  45. package/dist/solid/data.js +9 -9
  46. package/dist/solid/index.js +11 -11
  47. package/dist/solid/pty.js +1 -1
  48. package/package.json +7 -7
  49. package/dist/chunks/service-probe-z1hcmzxa.js +0 -30
  50. /package/dist/chunks/{service-probe-6mptkzbc.js → contract-6mptkzbc.js} +0 -0
  51. /package/dist/chunks/{service-probe-9rqn6x4v.js → contract-9rqn6x4v.js} +0 -0
  52. /package/dist/chunks/{service-probe-gne7h7mq.js → contract-gne7h7mq.js} +0 -0
  53. /package/dist/chunks/{service-probe-m2eywc8w.js → contract-m2eywc8w.js} +0 -0
  54. /package/dist/chunks/{service-probe-qav6mfdz.js → contract-qav6mfdz.js} +0 -0
  55. /package/dist/chunks/{service-probe-sxt88q69.js → contract-sxt88q69.js} +0 -0
  56. /package/dist/chunks/{service-probe-ve4aws36.js → contract-ve4aws36.js} +0 -0
  57. /package/dist/chunks/{service-probe-vmytr4q8.js → contract-vmytr4q8.js} +0 -0
  58. /package/dist/chunks/{service-probe-vt9jbch8.js → contract-vt9jbch8.js} +0 -0
  59. /package/dist/chunks/{service-probe-vyas3vgt.js → contract-vyas3vgt.js} +0 -0
  60. /package/dist/chunks/{service-probe-xgnj2w4v.js → contract-xgnj2w4v.js} +0 -0
  61. /package/dist/chunks/{service-probe-ydhz1zrh.js → contract-ydhz1zrh.js} +0 -0
@@ -19,22 +19,10 @@ export type PairingCode = {
19
19
  export type PairingSession = {
20
20
  token: string;
21
21
  };
22
- export type LocationPublicInfo = {
23
- directory: string;
24
- project: {
25
- id: string;
26
- directory: string;
27
- canonical: string;
28
- };
29
- };
30
- export type LocationPublicRef = {
31
- directory: string;
32
- };
33
- export type ModelRef = {
34
- id: string;
35
- providerID: string;
36
- variant?: string;
37
- };
22
+ export type AbsolutePath = string;
23
+ export type ProjectID = string;
24
+ export type AgentID = string;
25
+ export type ProviderID = string;
38
26
  export type ProviderCompaction = {
39
27
  type: "summary";
40
28
  } | {
@@ -69,13 +57,8 @@ export type PluginState = {
69
57
  error: string;
70
58
  ref?: string;
71
59
  };
72
- export type SessionForkBoundary = {
73
- type: "before";
74
- messageID: string;
75
- } | {
76
- type: "through";
77
- messageID: string;
78
- };
60
+ export type SessionID = string;
61
+ export type SessionMessageID = string;
79
62
  export type MoneyUSD = number;
80
63
  export type TokenUsageInfo = {
81
64
  input: number;
@@ -86,9 +69,11 @@ export type TokenUsageInfo = {
86
69
  write: number;
87
70
  };
88
71
  };
72
+ export type RelativePath = string;
89
73
  export type SessionMetadata = {
90
74
  [x: string]: JsonValue;
91
75
  };
76
+ export type SnapshotID = string;
92
77
  export type FileDiffInfo = {
93
78
  file: string;
94
79
  patch: string;
@@ -96,6 +81,7 @@ export type FileDiffInfo = {
96
81
  deletions: number;
97
82
  status: "added" | "deleted" | "modified";
98
83
  };
84
+ export type SessionsCursor = string;
99
85
  export type SessionStatsToolTotals = {
100
86
  calls: number;
101
87
  succeeded: number;
@@ -114,18 +100,6 @@ export type SessionStatsActivity = {
114
100
  date: string;
115
101
  steps: number;
116
102
  };
117
- export type SessionMessageAgentSelected = {
118
- id: string;
119
- metadata?: {
120
- [x: string]: JsonValue;
121
- };
122
- time: {
123
- created: number;
124
- };
125
- type: "agent-switched";
126
- agent: string;
127
- previous?: string;
128
- };
129
103
  export type PromptBase64 = string;
130
104
  export type PromptFileSource = {
131
105
  type: "inline";
@@ -138,64 +112,9 @@ export type PromptMention = {
138
112
  end: number;
139
113
  text: string;
140
114
  };
141
- export type SessionMessageSynthetic = {
142
- id: string;
143
- metadata?: {
144
- [x: string]: JsonValue;
145
- };
146
- time: {
147
- created: number;
148
- };
149
- text: string;
150
- description?: string;
151
- type: "synthetic";
152
- };
153
- export type SessionMessageSystem = {
154
- id: string;
155
- metadata?: {
156
- [x: string]: JsonValue;
157
- };
158
- time: {
159
- created: number;
160
- };
161
- type: "system";
162
- text: string;
163
- description?: string;
164
- };
165
- export type SessionMessageSkill = {
166
- id: string;
167
- metadata?: {
168
- [x: string]: JsonValue;
169
- };
170
- time: {
171
- created: number;
172
- };
173
- type: "skill";
174
- skill: string;
175
- name: string;
176
- text: string;
177
- };
178
- export type SessionMessageShell = {
179
- id: string;
180
- metadata?: {
181
- [x: string]: JsonValue;
182
- };
183
- time: {
184
- created: number;
185
- completed?: number;
186
- };
187
- type: "shell";
188
- shellID: string;
189
- command: string;
190
- status: "running" | "exited" | "timeout" | "killed";
191
- exit?: number | "Infinity" | "-Infinity" | "NaN";
192
- output?: {
193
- output: string;
194
- cursor: number;
195
- size: number;
196
- truncated: boolean;
197
- };
198
- };
115
+ export type SkillID = string;
116
+ export type SkillName = string;
117
+ export type ShellID = string;
199
118
  export type SessionMessageProviderState = {
200
119
  [x: string]: JsonValue;
201
120
  };
@@ -230,39 +149,6 @@ export type SessionStructuredError = {
230
149
  body: string;
231
150
  };
232
151
  };
233
- export type SessionMessageCompactionRunning = {
234
- type: "compaction";
235
- id: string;
236
- metadata?: {
237
- [x: string]: JsonValue;
238
- };
239
- time: {
240
- created: number;
241
- };
242
- status: "running";
243
- reason: "auto" | "manual";
244
- summary: string;
245
- recent: string;
246
- };
247
- export type SessionProviderContextProvenance = {
248
- providerID: string;
249
- provider: string;
250
- modelID: string;
251
- route: string;
252
- protocol: string;
253
- endpoint: string;
254
- };
255
- export type SessionMessageIdle = {
256
- id: string;
257
- metadata?: {
258
- [x: string]: JsonValue;
259
- };
260
- time: {
261
- created: number;
262
- };
263
- type: "idle";
264
- outcome: "succeeded" | "failed" | "interrupted";
265
- };
266
152
  export type SessionActive = {
267
153
  type: "running";
268
154
  };
@@ -281,10 +167,11 @@ export type SessionGenerateResponse = {
281
167
  text: string;
282
168
  };
283
169
  };
284
- export type LocationRef = {
285
- directory: string;
286
- workspaceID?: string;
287
- };
170
+ export type EventID = string;
171
+ export type EventSeq = number;
172
+ export type WorkspaceID = string;
173
+ export type InstructionKey = string;
174
+ export type InstructionHash = string;
288
175
  export type SessionInboxSyntheticPayload1 = {
289
176
  text: string;
290
177
  description?: string;
@@ -292,24 +179,6 @@ export type SessionInboxSyntheticPayload1 = {
292
179
  [x: string]: any;
293
180
  };
294
181
  };
295
- export type ShellInfo = {
296
- id: string;
297
- status: "running" | "exited" | "timeout" | "killed";
298
- command: string;
299
- cwd: string;
300
- shell: string;
301
- file: string;
302
- pid?: number;
303
- exit?: number;
304
- signal?: string;
305
- metadata: {
306
- [x: string]: any;
307
- };
308
- time: {
309
- started: number;
310
- completed?: number;
311
- };
312
- };
313
182
  export type SessionMessageProviderState1 = {
314
183
  [x: string]: any;
315
184
  };
@@ -328,14 +197,10 @@ export type SessionMessageToolStateRunning1 = {
328
197
  [x: string]: JsonValue;
329
198
  };
330
199
  };
331
- export type EventLogSynced = {
332
- type: "log.synced";
333
- aggregateID: string;
334
- seq?: number;
335
- };
336
200
  export type SessionInterruptResponse = {
337
201
  interrupted: boolean;
338
202
  };
203
+ export type FormID = string;
339
204
  export type FormMetadata = {
340
205
  [x: string]: JsonValue;
341
206
  };
@@ -370,31 +235,19 @@ export type GenerateTextResponse = {
370
235
  text: string;
371
236
  };
372
237
  };
373
- export type IntegrationCommandMethod = {
374
- id: string;
375
- type: "command";
376
- label: string;
377
- command: Array<string>;
378
- };
238
+ export type IntegrationID = string;
239
+ export type IntegrationMethodID = string;
379
240
  export type IntegrationEnvMethod = {
380
241
  type: "env";
381
242
  names: Array<string>;
382
243
  };
244
+ export type CredentialID = string;
383
245
  export type ConnectionStatus = {
384
246
  status: "needs_auth";
385
247
  message: string;
386
248
  url?: string;
387
249
  };
388
- export type IntegrationAttempt = {
389
- attemptID: string;
390
- url: string;
391
- instructions: string;
392
- mode: "auto" | "code";
393
- time: {
394
- created: number;
395
- expires: number;
396
- };
397
- };
250
+ export type IntegrationAttemptID = string;
398
251
  export type IntegrationAttemptStatus = {
399
252
  status: "pending";
400
253
  time: {
@@ -421,13 +274,6 @@ export type IntegrationAttemptStatus = {
421
274
  expires: number;
422
275
  };
423
276
  };
424
- export type IntegrationCommandAttempt = {
425
- attemptID: string;
426
- time: {
427
- created: number;
428
- expires: number;
429
- };
430
- };
431
277
  export type IntegrationCommandAttemptStatus = {
432
278
  status: "pending";
433
279
  message?: string;
@@ -486,23 +332,6 @@ export type McpResourceTemplate = {
486
332
  description?: string;
487
333
  mimeType?: string;
488
334
  };
489
- export type CredentialOAuth = {
490
- type: "oauth";
491
- methodID: string;
492
- refresh: string;
493
- access: string;
494
- expires: number;
495
- metadata?: {
496
- [x: string]: JsonValue;
497
- };
498
- };
499
- export type CredentialExternal = {
500
- type: "external";
501
- methodID: string;
502
- metadata?: {
503
- [x: string]: JsonValue;
504
- };
505
- };
506
335
  export type ProjectVcs = string;
507
336
  export type ProjectIcon = {
508
337
  url?: string;
@@ -516,75 +345,24 @@ export type ProjectTime = {
516
345
  created: number;
517
346
  updated: number;
518
347
  active: number;
348
+ archived?: number;
519
349
  };
350
+ export type PermissionID = string;
520
351
  export type PermissionSource = {
521
352
  type: "tool";
522
353
  messageID: string;
523
354
  id: string;
524
355
  };
525
- export type PermissionSavedInfo = {
526
- id: string;
527
- projectID: string;
528
- action: string;
529
- resource: string;
530
- time: {
531
- created: number;
532
- updated: number;
533
- };
534
- };
535
- export type FileSystemEntry = {
536
- path: string;
537
- type: "file" | "directory";
538
- };
539
- export type FileSystemWrite = {
540
- path: string;
541
- };
356
+ export type PermissionSavedID = string;
542
357
  export type CommandInfo = {
543
358
  name: string;
544
359
  description?: string;
545
360
  };
546
- export type SkillInfo = {
547
- id: string;
548
- name: string;
549
- description?: string;
550
- autoinvoke?: boolean;
551
- path: string;
552
- content: string;
553
- };
554
361
  export type RpcOutput = {
555
362
  output?: any;
556
363
  };
557
364
  export type PermissionReply = "once" | "always" | "reject";
558
- export type Pty = {
559
- id: string;
560
- title: string;
561
- command: string;
562
- args: Array<string>;
563
- cwd: string;
564
- status: "running" | "exited";
565
- pid: number;
566
- exitCode?: number;
567
- };
568
- export type PersistentPtyInfo = {
569
- id: string;
570
- title: string;
571
- command: string;
572
- args: Array<string>;
573
- cwd: string;
574
- status: "running" | "exited";
575
- pid: number;
576
- exitCode?: number;
577
- sessionID: string;
578
- foregroundProcess: string | null;
579
- size: {
580
- cols: number;
581
- rows: number;
582
- };
583
- output: {
584
- head: number;
585
- tail: number;
586
- };
587
- };
365
+ export type PtyID = string;
588
366
  export type FormMetadata1 = {
589
367
  [x: string]: any;
590
368
  };
@@ -616,61 +394,17 @@ export type PtyTicketConnectToken = {
616
394
  ticket: string;
617
395
  expires_in: number;
618
396
  };
619
- export type PersistentPtyReadResult = {
620
- ptyID: string;
621
- title: string;
622
- cwd: string;
623
- foregroundProcess: string | null;
624
- screen: {
625
- text: string;
626
- cols: number;
627
- rows: number;
628
- cursor: {
629
- x: number;
630
- y: number;
631
- };
632
- };
633
- };
634
397
  export type PersistentPtyHandoff = {
635
398
  directory: string;
636
399
  instanceID: string;
637
400
  ticket: string;
638
401
  expiresAt: number;
639
402
  };
640
- export type ShellInfo1 = {
641
- id: string;
642
- status: "running" | "exited" | "timeout" | "killed";
643
- command: string;
644
- cwd: string;
645
- shell: string;
646
- file: string;
647
- pid?: number;
648
- exit?: number;
649
- signal?: string;
650
- metadata: {
651
- [x: string]: JsonValue;
652
- };
653
- time: {
654
- started: number;
655
- completed?: number;
656
- };
657
- };
658
- export type ReferenceLocalSource = {
659
- type: "local";
660
- path: string;
661
- };
662
403
  export type ReferenceGitSource = {
663
404
  type: "git";
664
405
  repository: string;
665
406
  branch?: string;
666
407
  };
667
- export type WorktreeDirectory = {
668
- directory: string;
669
- strategy?: string;
670
- };
671
- export type WorktreeInfo = {
672
- directory: string;
673
- };
674
408
  export type VcsBranch = {
675
409
  current?: string;
676
410
  default?: string;
@@ -687,10 +421,7 @@ export type VcsFileStatus = {
687
421
  status: "added" | "deleted" | "modified";
688
422
  };
689
423
  export type VcsBranchList = Array<string>;
690
- export type WebSearchProvider = {
691
- id: string;
692
- name: string;
693
- };
424
+ export type WebSearchID = string;
694
425
  export type WebSearchResult = {
695
426
  url: string;
696
427
  title?: string;
@@ -713,49 +444,43 @@ export type ConfigShellOption = {
713
444
  name: string;
714
445
  acceptable: boolean;
715
446
  };
716
- export type SessionMessageLocationSwitched = {
717
- id: string;
718
- metadata?: {
719
- [x: string]: JsonValue;
720
- };
721
- time: {
722
- created: number;
723
- };
724
- type: "location-switched";
725
- projectID?: string;
726
- subpath?: string;
727
- location: LocationPublicRef;
728
- previous?: {
729
- location: LocationPublicRef;
730
- projectID?: string;
731
- subpath?: string;
732
- } | null;
447
+ export type LocationPublicRef = {
448
+ directory: AbsolutePath;
733
449
  };
734
- export type SessionInboxMovePayload = {
735
- projectID: string;
736
- subpath?: string;
737
- location: LocationPublicRef;
450
+ export type FileSystemWrite = {
451
+ path: AbsolutePath;
738
452
  };
739
- export type V2EventRpc = {
740
- id: string;
741
- created: number;
742
- metadata?: {
743
- [x: string]: any;
744
- } | undefined;
745
- type: `${"rpc."}${string}`;
746
- location: LocationPublicRef;
747
- data: {
748
- [x: string]: any;
453
+ export type ReferenceLocalSource = {
454
+ type: "local";
455
+ path: AbsolutePath;
456
+ };
457
+ export type WorktreeDirectory = {
458
+ directory: AbsolutePath;
459
+ strategy?: string;
460
+ };
461
+ export type WorktreeInfo = {
462
+ directory: AbsolutePath;
463
+ };
464
+ export type LocationPublicInfo = {
465
+ directory: AbsolutePath;
466
+ project: {
467
+ id: ProjectID;
468
+ directory: AbsolutePath;
469
+ canonical: AbsolutePath;
749
470
  };
750
471
  };
751
- export type V2EventServerConnected = {
472
+ export type ModelRef = {
752
473
  id: string;
753
- metadata?: {
754
- [x: string]: any;
755
- } | undefined;
756
- location?: LocationPublicRef | undefined;
757
- type: "server.connected";
758
- data: {};
474
+ providerID: ProviderID;
475
+ variant?: string;
476
+ };
477
+ export type SessionProviderContextProvenance = {
478
+ providerID: ProviderID;
479
+ provider: string;
480
+ modelID: string;
481
+ route: string;
482
+ protocol: string;
483
+ endpoint: string;
759
484
  };
760
485
  export type ModelSettings = {
761
486
  compaction?: ProviderCompaction;
@@ -796,10 +521,71 @@ export type PluginInfo = {
796
521
  features: PluginFeatures;
797
522
  state: PluginState;
798
523
  };
524
+ export type SessionForkBoundary = {
525
+ type: "before";
526
+ messageID: SessionMessageID;
527
+ } | {
528
+ type: "through";
529
+ messageID: SessionMessageID;
530
+ };
531
+ export type SessionMessageAgentSelected = {
532
+ id: SessionMessageID;
533
+ metadata?: {
534
+ [x: string]: JsonValue;
535
+ };
536
+ time: {
537
+ created: number;
538
+ };
539
+ type: "agent-switched";
540
+ agent: AgentID;
541
+ previous?: AgentID;
542
+ };
543
+ export type SessionMessageSynthetic = {
544
+ id: SessionMessageID;
545
+ metadata?: {
546
+ [x: string]: JsonValue;
547
+ };
548
+ time: {
549
+ created: number;
550
+ };
551
+ text: string;
552
+ description?: string;
553
+ type: "synthetic";
554
+ };
555
+ export type SessionMessageSystem = {
556
+ id: SessionMessageID;
557
+ metadata?: {
558
+ [x: string]: JsonValue;
559
+ };
560
+ time: {
561
+ created: number;
562
+ };
563
+ type: "system";
564
+ text: string;
565
+ description?: string;
566
+ };
567
+ export type SessionMessageCompactionRunning = {
568
+ type: "compaction";
569
+ id: SessionMessageID;
570
+ metadata?: {
571
+ [x: string]: JsonValue;
572
+ };
573
+ time: {
574
+ created: number;
575
+ };
576
+ status: "running";
577
+ reason: "auto" | "manual";
578
+ summary: string;
579
+ recent: string;
580
+ };
581
+ export type FileSystemEntry = {
582
+ path: RelativePath;
583
+ type: "file" | "directory";
584
+ };
799
585
  export type SessionRevert = {
800
- messageID: string;
586
+ messageID: SessionMessageID;
801
587
  partID?: string;
802
- snapshot?: string;
588
+ snapshot?: SnapshotID;
803
589
  files?: Array<FileDiffInfo>;
804
590
  };
805
591
  export type SessionStatsTools = {
@@ -812,24 +598,6 @@ export type SessionStatsTools = {
812
598
  totals: SessionStatsToolTotals;
813
599
  usage: Array<SessionStatsToolUsage>;
814
600
  };
815
- export type SessionStatsModelUsage = {
816
- model: ModelRef;
817
- steps: number;
818
- tokens: TokenUsageInfo;
819
- cost: MoneyUSD;
820
- };
821
- export type SessionMessageModelSelected = {
822
- id: string;
823
- metadata?: {
824
- [x: string]: JsonValue;
825
- };
826
- time: {
827
- created: number;
828
- };
829
- type: "model-switched";
830
- model: ModelRef;
831
- previous?: ModelRef;
832
- };
833
601
  export type PromptFileAttachment = {
834
602
  data: PromptBase64;
835
603
  mime: string;
@@ -843,11 +611,89 @@ export type PromptAgentAttachment = {
843
611
  mention?: PromptMention;
844
612
  };
845
613
  export type PromptSkillAttachment = {
846
- id: string;
847
- name: string;
614
+ id: SkillID;
615
+ name: SkillName;
848
616
  text?: string;
849
617
  mention?: PromptMention;
850
618
  };
619
+ export type SessionMessageSkill = {
620
+ id: SessionMessageID;
621
+ metadata?: {
622
+ [x: string]: JsonValue;
623
+ };
624
+ time: {
625
+ created: number;
626
+ };
627
+ type: "skill";
628
+ skill: SkillID;
629
+ name: SkillName;
630
+ text: string;
631
+ };
632
+ export type SkillInfo = {
633
+ id: SkillID;
634
+ name: SkillName;
635
+ description?: string;
636
+ autoinvoke?: boolean;
637
+ path: AbsolutePath;
638
+ content: string;
639
+ };
640
+ export type SessionMessageShell = {
641
+ id: SessionMessageID;
642
+ metadata?: {
643
+ [x: string]: JsonValue;
644
+ };
645
+ time: {
646
+ created: number;
647
+ completed?: number;
648
+ };
649
+ type: "shell";
650
+ shellID: ShellID;
651
+ command: string;
652
+ status: "running" | "exited" | "timeout" | "killed";
653
+ exit?: number | "Infinity" | "-Infinity" | "NaN";
654
+ output?: {
655
+ output: string;
656
+ cursor: number;
657
+ size: number;
658
+ truncated: boolean;
659
+ };
660
+ };
661
+ export type ShellInfo = {
662
+ id: ShellID;
663
+ status: "running" | "exited" | "timeout" | "killed";
664
+ command: string;
665
+ cwd: string;
666
+ shell: string;
667
+ file: string;
668
+ pid?: number;
669
+ exit?: number;
670
+ signal?: string;
671
+ metadata: {
672
+ [x: string]: any;
673
+ };
674
+ time: {
675
+ started: number;
676
+ completed?: number;
677
+ };
678
+ };
679
+ export type ShellInfo1 = {
680
+ id: ShellID;
681
+ status: "running" | "exited" | "timeout" | "killed";
682
+ command: string;
683
+ cwd: string;
684
+ shell: string;
685
+ file: string;
686
+ pid?: number;
687
+ exit?: number;
688
+ signal?: string;
689
+ metadata: {
690
+ [x: string]: JsonValue;
691
+ };
692
+ time: {
693
+ started: number;
694
+ completed?: number;
695
+ };
696
+ };
851
697
  export type SessionMessageAssistantText = {
852
698
  type: "text";
853
699
  text: string;
@@ -870,7 +716,7 @@ export type SessionMessageAssistantRetry = {
870
716
  };
871
717
  export type SessionMessageCompactionFailed = {
872
718
  type: "compaction";
873
- id: string;
719
+ id: SessionMessageID;
874
720
  metadata?: {
875
721
  [x: string]: JsonValue;
876
722
  };
@@ -883,14 +729,21 @@ export type SessionMessageCompactionFailed = {
883
729
  cost?: MoneyUSD;
884
730
  tokens?: TokenUsageInfo;
885
731
  };
886
- export type SessionProviderContext = {
887
- version: 1;
888
- provenance: SessionProviderContextProvenance;
889
- messages: JsonValue;
732
+ export type SessionMessageIdle = {
733
+ id: SessionMessageID;
734
+ metadata?: {
735
+ [x: string]: JsonValue;
736
+ };
737
+ time: {
738
+ created: number;
739
+ };
740
+ type: "idle";
741
+ outcome: "succeeded" | "failed" | "interrupted";
742
+ error?: SessionStructuredError;
890
743
  };
891
744
  export type SessionInboxSynthetic = {
892
- id: string;
893
- sessionID: string;
745
+ id: SessionMessageID;
746
+ sessionID: SessionID;
894
747
  time: {
895
748
  created: number;
896
749
  };
@@ -899,8 +752,8 @@ export type SessionInboxSynthetic = {
899
752
  delivery: SessionInboxDelivery;
900
753
  };
901
754
  export type SessionInboxCompaction = {
902
- id: string;
903
- sessionID: string;
755
+ id: SessionMessageID;
756
+ sessionID: SessionID;
904
757
  time: {
905
758
  created: number;
906
759
  };
@@ -917,1382 +770,1447 @@ export type InstructionEntrySnapshot = Array<{
917
770
  value: JsonValue;
918
771
  removed: boolean;
919
772
  }>;
920
- export type SessionAgentSelected = {
921
- id: string;
922
- created: number;
923
- metadata?: {
924
- [x: string]: any;
925
- };
926
- type: "session.agent.selected";
927
- durable: {
928
- aggregateID: string;
929
- seq: number;
930
- version: 1;
931
- };
932
- location?: LocationRef;
933
- data: {
934
- sessionID: string;
935
- agent: string;
936
- previous?: string;
937
- };
773
+ export type EventLogSynced = {
774
+ type: "log.synced";
775
+ aggregateID: string;
776
+ seq?: EventSeq;
938
777
  };
939
- export type SessionModelSelected = {
940
- id: string;
941
- created: number;
942
- metadata?: {
943
- [x: string]: any;
944
- };
945
- type: "session.model.selected";
946
- durable: {
947
- aggregateID: string;
948
- seq: number;
949
- version: 1;
950
- };
951
- location?: LocationRef;
952
- data: {
953
- sessionID: string;
954
- model: ModelRef;
955
- previous?: ModelRef;
956
- };
778
+ export type LocationRef = {
779
+ directory: AbsolutePath;
780
+ workspaceID?: WorkspaceID;
957
781
  };
958
- export type SessionRenamed = {
959
- id: string;
960
- created: number;
961
- metadata?: {
962
- [x: string]: any;
963
- };
964
- type: "session.renamed";
965
- durable: {
966
- aggregateID: string;
967
- seq: number;
968
- version: 1;
969
- };
970
- location?: LocationRef;
971
- data: {
972
- sessionID: string;
973
- title: string;
974
- };
782
+ export type SessionMessageAssistantText1 = {
783
+ type: "text";
784
+ text: string;
785
+ state?: SessionMessageProviderState1;
975
786
  };
976
- export type SessionViewed = {
977
- id: string;
978
- created: number;
979
- metadata?: {
980
- [x: string]: any;
981
- };
982
- type: "session.viewed";
983
- durable: {
984
- aggregateID: string;
985
- seq: number;
986
- version: 1;
987
- };
988
- location?: LocationRef;
989
- data: {
990
- sessionID: string;
991
- idle: number;
787
+ export type SessionMessageAssistantReasoning1 = {
788
+ type: "reasoning";
789
+ text: string;
790
+ state?: SessionMessageProviderState1;
791
+ time?: {
792
+ created: number;
793
+ completed?: number;
992
794
  };
993
795
  };
994
- export type SessionDeleted = {
995
- id: string;
996
- created: number;
997
- metadata?: {
998
- [x: string]: any;
999
- };
1000
- type: "session.deleted";
1001
- durable: {
1002
- aggregateID: string;
1003
- seq: number;
1004
- version: 2;
1005
- };
1006
- location?: LocationRef;
1007
- data: {
1008
- sessionID: string;
1009
- };
796
+ export type ToolContent1 = ToolTextContent | ToolFileContent1;
797
+ export type FormNumberField = {
798
+ key: string;
799
+ title?: string;
800
+ description?: string;
801
+ required?: boolean;
802
+ hidden?: boolean;
803
+ when?: Array<FormWhen>;
804
+ type: "number";
805
+ minimum?: number | "Infinity" | "-Infinity" | "NaN";
806
+ maximum?: number | "Infinity" | "-Infinity" | "NaN";
807
+ default?: number | "Infinity" | "-Infinity" | "NaN";
1010
808
  };
1011
- export type SessionInboxDelivered = {
1012
- id: string;
1013
- created: number;
1014
- metadata?: {
1015
- [x: string]: any;
1016
- };
1017
- type: "session.inbox.delivered";
1018
- durable: {
1019
- aggregateID: string;
1020
- seq: number;
1021
- version: 1;
1022
- };
1023
- location?: LocationRef;
1024
- data: {
1025
- sessionID: string;
1026
- inboxID: string;
1027
- };
809
+ export type FormIntegerField = {
810
+ key: string;
811
+ title?: string;
812
+ description?: string;
813
+ required?: boolean;
814
+ hidden?: boolean;
815
+ when?: Array<FormWhen>;
816
+ type: "integer";
817
+ minimum?: number | "Infinity" | "-Infinity" | "NaN";
818
+ maximum?: number | "Infinity" | "-Infinity" | "NaN";
819
+ default?: number | "Infinity" | "-Infinity" | "NaN";
1028
820
  };
1029
- export type SessionInboxCancelled = {
1030
- id: string;
1031
- created: number;
1032
- metadata?: {
1033
- [x: string]: any;
1034
- };
1035
- type: "session.inbox.cancelled";
1036
- durable: {
1037
- aggregateID: string;
1038
- seq: number;
1039
- version: 1;
1040
- };
1041
- location?: LocationRef;
1042
- data: {
1043
- sessionID: string;
1044
- inboxID: string;
1045
- };
821
+ export type FormBooleanField = {
822
+ key: string;
823
+ title?: string;
824
+ description?: string;
825
+ required?: boolean;
826
+ hidden?: boolean;
827
+ when?: Array<FormWhen>;
828
+ type: "boolean";
829
+ default?: boolean;
1046
830
  };
1047
- export type SessionInboxDeliveryChanged = {
1048
- id: string;
1049
- created: number;
1050
- metadata?: {
1051
- [x: string]: any;
1052
- };
1053
- type: "session.inbox.delivery.changed";
1054
- durable: {
1055
- aggregateID: string;
1056
- seq: number;
1057
- version: 1;
1058
- };
1059
- location?: LocationRef;
1060
- data: {
1061
- sessionID: string;
1062
- inboxID: string;
1063
- delivery: SessionInboxDelivery;
1064
- };
831
+ export type FormStringField = {
832
+ key: string;
833
+ title?: string;
834
+ description?: string;
835
+ required?: boolean;
836
+ hidden?: boolean;
837
+ when?: Array<FormWhen>;
838
+ type: "string";
839
+ format?: "email" | "uri" | "date" | "date-time";
840
+ minLength?: number;
841
+ maxLength?: number;
842
+ pattern?: string;
843
+ placeholder?: string;
844
+ default?: string;
845
+ options?: Array<FormOption>;
846
+ custom?: boolean;
1065
847
  };
1066
- export type SessionExecutionStarted = {
1067
- id: string;
1068
- created: number;
1069
- metadata?: {
1070
- [x: string]: any;
1071
- };
1072
- type: "session.execution.started";
1073
- durable: {
1074
- aggregateID: string;
1075
- seq: number;
1076
- version: 1;
1077
- };
1078
- location?: LocationRef;
1079
- data: {
1080
- sessionID: string;
1081
- };
848
+ export type FormMultiselectField = {
849
+ key: string;
850
+ title?: string;
851
+ description?: string;
852
+ required?: boolean;
853
+ hidden?: boolean;
854
+ when?: Array<FormWhen>;
855
+ type: "multiselect";
856
+ options: Array<FormOption>;
857
+ minItems?: number;
858
+ maxItems?: number;
859
+ custom?: boolean;
860
+ default?: Array<string>;
1082
861
  };
1083
- export type SessionExecutionSucceeded = {
1084
- id: string;
1085
- created: number;
1086
- metadata?: {
1087
- [x: string]: any;
1088
- };
1089
- type: "session.execution.succeeded";
1090
- durable: {
1091
- aggregateID: string;
1092
- seq: number;
1093
- version: 1;
862
+ export type FormAnswer = {
863
+ [x: string]: FormValue;
864
+ };
865
+ export type ModelCompatibility = {
866
+ reasoningField?: ModelReasoningField;
867
+ requireReasoning?: boolean;
868
+ maxTokensField?: ModelMaxTokensField;
869
+ requireFinishReason?: boolean;
870
+ requireAssistantAfterTool?: boolean;
871
+ supportsPromptCacheKey?: boolean;
872
+ supportsThinkingBlockBinding?: boolean;
873
+ supportsEffortUpdates?: boolean;
874
+ };
875
+ export type ModelCost = {
876
+ tier?: {
877
+ type: "context";
878
+ size: number;
1094
879
  };
1095
- location?: LocationRef;
1096
- data: {
1097
- sessionID: string;
880
+ input: MoneyUSDPerMillionTokens;
881
+ output: MoneyUSDPerMillionTokens;
882
+ cache: {
883
+ read: MoneyUSDPerMillionTokens;
884
+ write: MoneyUSDPerMillionTokens;
1098
885
  };
1099
886
  };
1100
- export type SessionExecutionFailed = {
1101
- id: string;
1102
- created: number;
887
+ export type IntegrationCommandMethod = {
888
+ id: IntegrationMethodID;
889
+ type: "command";
890
+ label: string;
891
+ command: Array<string>;
892
+ };
893
+ export type CredentialOAuth = {
894
+ type: "oauth";
895
+ methodID: IntegrationMethodID;
896
+ refresh: string;
897
+ access: string;
898
+ expires: number;
1103
899
  metadata?: {
1104
- [x: string]: any;
1105
- };
1106
- type: "session.execution.failed";
1107
- durable: {
1108
- aggregateID: string;
1109
- seq: number;
1110
- version: 1;
1111
- };
1112
- location?: LocationRef;
1113
- data: {
1114
- sessionID: string;
1115
- error: SessionStructuredError;
900
+ [x: string]: JsonValue;
1116
901
  };
1117
902
  };
1118
- export type SessionExecutionInterrupted = {
1119
- id: string;
1120
- created: number;
903
+ export type CredentialExternal = {
904
+ type: "external";
905
+ methodID: IntegrationMethodID;
1121
906
  metadata?: {
1122
- [x: string]: any;
907
+ [x: string]: JsonValue;
1123
908
  };
1124
- type: "session.execution.interrupted";
1125
- durable: {
1126
- aggregateID: string;
1127
- seq: number;
1128
- version: 1;
909
+ };
910
+ export type ConnectionCredentialInfo = {
911
+ type: "credential";
912
+ id: CredentialID;
913
+ label: string;
914
+ method: "key" | "oauth" | "external";
915
+ status?: ConnectionStatus;
916
+ };
917
+ export type ConnectionEnvInfo = {
918
+ type: "env";
919
+ name: string;
920
+ status?: ConnectionStatus;
921
+ };
922
+ export type IntegrationAttempt = {
923
+ attemptID: IntegrationAttemptID;
924
+ url: string;
925
+ instructions: string;
926
+ mode: "auto" | "code";
927
+ time: {
928
+ created: number;
929
+ expires: number;
1129
930
  };
1130
- location?: LocationRef;
1131
- data: {
1132
- sessionID: string;
1133
- reason: "user" | "shutdown" | "superseded" | "inactivity";
931
+ };
932
+ export type IntegrationCommandAttempt = {
933
+ attemptID: IntegrationAttemptID;
934
+ time: {
935
+ created: number;
936
+ expires: number;
1134
937
  };
1135
938
  };
1136
- export type SessionInstructionsUpdated = {
1137
- id: string;
1138
- created: number;
939
+ export type McpServer = {
940
+ name: string;
941
+ status: McpStatusConnected | McpStatusPending | McpStatusDisabled | McpStatusFailed | McpStatusNeedsAuth;
942
+ integrationID?: IntegrationID;
943
+ };
944
+ export type McpResourceCatalog = {
945
+ resources: Array<McpResource>;
946
+ templates: Array<McpResourceTemplate>;
947
+ };
948
+ export type Project = {
949
+ id: ProjectID;
950
+ canonical: AbsolutePath;
951
+ vcs?: ProjectVcs;
952
+ name?: string;
953
+ icon?: ProjectIcon;
954
+ commands?: ProjectCommands;
955
+ time: ProjectTime;
956
+ sandboxes: Array<string>;
957
+ };
958
+ export type PermissionRequest = {
959
+ id: PermissionID;
960
+ sessionID: SessionID;
961
+ action: string;
962
+ resources: Array<string>;
963
+ save?: Array<string>;
1139
964
  metadata?: {
1140
- [x: string]: any;
1141
- };
1142
- type: "session.instructions.updated";
1143
- durable: {
1144
- aggregateID: string;
1145
- seq: number;
1146
- version: 2;
965
+ [x: string]: JsonValue;
1147
966
  };
1148
- location?: LocationRef;
1149
- data: {
1150
- sessionID: string;
1151
- delta: {
1152
- [x: string]: string | "removed";
1153
- };
1154
- text?: string;
967
+ source?: PermissionSource;
968
+ message?: string;
969
+ };
970
+ export type PermissionSavedInfo = {
971
+ id: PermissionSavedID;
972
+ projectID: ProjectID;
973
+ action: string;
974
+ resource: string;
975
+ time: {
976
+ created: number;
977
+ updated: number;
1155
978
  };
1156
979
  };
1157
- export type SessionSynthetic = {
1158
- id: string;
1159
- created: number;
1160
- metadata?: {
1161
- [x: string]: any;
980
+ export type Pty = {
981
+ id: PtyID;
982
+ title: string;
983
+ command: string;
984
+ args: Array<string>;
985
+ cwd: string;
986
+ status: "running" | "exited";
987
+ pid: number;
988
+ exitCode?: number;
989
+ };
990
+ export type PersistentPtyInfo = {
991
+ id: PtyID;
992
+ title: string;
993
+ command: string;
994
+ args: Array<string>;
995
+ cwd: string;
996
+ status: "running" | "exited";
997
+ pid: number;
998
+ exitCode?: number;
999
+ sessionID: SessionID;
1000
+ foregroundProcess: string | null;
1001
+ size: {
1002
+ cols: number;
1003
+ rows: number;
1162
1004
  };
1163
- type: "session.synthetic";
1164
- durable: {
1165
- aggregateID: string;
1166
- seq: number;
1167
- version: 1;
1005
+ output: {
1006
+ head: number;
1007
+ tail: number;
1168
1008
  };
1169
- location?: LocationRef;
1170
- data: {
1171
- sessionID: string;
1009
+ };
1010
+ export type PersistentPtyReadResult = {
1011
+ ptyID: PtyID;
1012
+ title: string;
1013
+ cwd: string;
1014
+ foregroundProcess: string | null;
1015
+ screen: {
1172
1016
  text: string;
1173
- description?: string;
1174
- metadata?: {
1175
- [x: string]: any;
1017
+ cols: number;
1018
+ rows: number;
1019
+ cursor: {
1020
+ x: number;
1021
+ y: number;
1176
1022
  };
1177
1023
  };
1178
1024
  };
1179
- export type SessionSkillActivated = {
1180
- id: string;
1181
- created: number;
1182
- metadata?: {
1183
- [x: string]: any;
1184
- };
1185
- type: "session.skill.activated";
1186
- durable: {
1187
- aggregateID: string;
1188
- seq: number;
1189
- version: 1;
1190
- };
1191
- location?: LocationRef;
1192
- data: {
1193
- sessionID: string;
1194
- id: string;
1195
- name: string;
1196
- text: string;
1197
- };
1025
+ export type FormStringField1 = {
1026
+ key: string;
1027
+ title?: string;
1028
+ description?: string;
1029
+ required?: boolean;
1030
+ hidden?: boolean;
1031
+ when?: Array<FormWhen1>;
1032
+ type: "string";
1033
+ format?: "email" | "uri" | "date" | "date-time";
1034
+ minLength?: number;
1035
+ maxLength?: number;
1036
+ pattern?: string;
1037
+ placeholder?: string;
1038
+ default?: string;
1039
+ options?: Array<FormOption>;
1040
+ custom?: boolean;
1041
+ };
1042
+ export type FormNumberField1 = {
1043
+ key: string;
1044
+ title?: string;
1045
+ description?: string;
1046
+ required?: boolean;
1047
+ hidden?: boolean;
1048
+ when?: Array<FormWhen1>;
1049
+ type: "number";
1050
+ minimum?: number;
1051
+ maximum?: number;
1052
+ default?: number;
1053
+ };
1054
+ export type FormIntegerField1 = {
1055
+ key: string;
1056
+ title?: string;
1057
+ description?: string;
1058
+ required?: boolean;
1059
+ hidden?: boolean;
1060
+ when?: Array<FormWhen1>;
1061
+ type: "integer";
1062
+ minimum?: number;
1063
+ maximum?: number;
1064
+ default?: number;
1065
+ };
1066
+ export type FormBooleanField1 = {
1067
+ key: string;
1068
+ title?: string;
1069
+ description?: string;
1070
+ required?: boolean;
1071
+ hidden?: boolean;
1072
+ when?: Array<FormWhen1>;
1073
+ type: "boolean";
1074
+ default?: boolean;
1075
+ };
1076
+ export type FormMultiselectField1 = {
1077
+ key: string;
1078
+ title?: string;
1079
+ description?: string;
1080
+ required?: boolean;
1081
+ hidden?: boolean;
1082
+ when?: Array<FormWhen1>;
1083
+ type: "multiselect";
1084
+ options: Array<FormOption>;
1085
+ minItems?: number;
1086
+ maxItems?: number;
1087
+ custom?: boolean;
1088
+ default?: Array<string>;
1089
+ };
1090
+ export type FormAnswer2 = {
1091
+ [x: string]: FormValue1;
1092
+ };
1093
+ export type VcsInfo = {
1094
+ provider?: string;
1095
+ branch: VcsBranch;
1096
+ };
1097
+ export type WebSearchProvider = {
1098
+ id: WebSearchID;
1099
+ name: string;
1198
1100
  };
1199
- export type SessionStepStarted = {
1200
- id: string;
1201
- created: number;
1101
+ export type SessionMessageLocationSwitched = {
1102
+ id: SessionMessageID;
1202
1103
  metadata?: {
1203
- [x: string]: any;
1204
- };
1205
- type: "session.step.started";
1206
- durable: {
1207
- aggregateID: string;
1208
- seq: number;
1209
- version: 1;
1104
+ [x: string]: JsonValue;
1210
1105
  };
1211
- location?: LocationRef;
1212
- data: {
1213
- sessionID: string;
1214
- assistantMessageID: string;
1215
- agent: string;
1216
- model: ModelRef;
1217
- snapshot?: string;
1218
- started: number;
1106
+ time: {
1107
+ created: number;
1219
1108
  };
1109
+ type: "location-switched";
1110
+ projectID?: ProjectID;
1111
+ subpath?: RelativePath;
1112
+ location: LocationPublicRef;
1113
+ previous?: {
1114
+ location: LocationPublicRef;
1115
+ projectID?: ProjectID;
1116
+ subpath?: RelativePath;
1117
+ } | null;
1220
1118
  };
1221
- export type SessionStepStreamed = {
1222
- id: string;
1223
- created: number;
1224
- metadata?: {
1225
- [x: string]: any;
1226
- };
1227
- type: "session.step.streamed";
1228
- durable: {
1229
- aggregateID: string;
1230
- seq: number;
1231
- version: 1;
1232
- };
1233
- location?: LocationRef;
1234
- data: {
1235
- sessionID: string;
1236
- assistantMessageID: string;
1237
- };
1119
+ export type SessionInboxMovePayload = {
1120
+ projectID: ProjectID;
1121
+ subpath?: RelativePath;
1122
+ location: LocationPublicRef;
1238
1123
  };
1239
- export type SessionTextStarted = {
1240
- id: string;
1124
+ export type V2EventRpc = {
1125
+ id: EventID;
1241
1126
  created: number;
1242
1127
  metadata?: {
1243
1128
  [x: string]: any;
1244
- };
1245
- type: "session.text.started";
1246
- durable: {
1247
- aggregateID: string;
1248
- seq: number;
1249
- version: 1;
1250
- };
1251
- location?: LocationRef;
1129
+ } | undefined;
1130
+ type: `${"rpc."}${string}`;
1131
+ location: LocationPublicRef;
1252
1132
  data: {
1253
- sessionID: string;
1254
- assistantMessageID: string;
1255
- ordinal: number;
1256
- };
1257
- };
1258
- export type SessionToolInputStarted = {
1259
- id: string;
1260
- created: number;
1261
- metadata?: {
1262
1133
  [x: string]: any;
1263
1134
  };
1264
- type: "session.tool.input.started";
1265
- durable: {
1266
- aggregateID: string;
1267
- seq: number;
1268
- version: 1;
1269
- };
1270
- location?: LocationRef;
1271
- data: {
1272
- sessionID: string;
1273
- assistantMessageID: string;
1274
- id: string;
1275
- name: string;
1276
- };
1277
1135
  };
1278
- export type SessionToolInputEnded = {
1279
- id: string;
1280
- created: number;
1136
+ export type V2EventServerConnected = {
1137
+ id: EventID;
1281
1138
  metadata?: {
1282
1139
  [x: string]: any;
1283
- };
1284
- type: "session.tool.input.ended";
1285
- durable: {
1286
- aggregateID: string;
1287
- seq: number;
1288
- version: 1;
1289
- };
1290
- location?: LocationRef;
1291
- data: {
1292
- sessionID: string;
1293
- assistantMessageID: string;
1294
- id: string;
1295
- text: string;
1296
- };
1140
+ } | undefined;
1141
+ location?: LocationPublicRef | undefined;
1142
+ type: "server.connected";
1143
+ data: {};
1297
1144
  };
1298
- export type SessionRetryScheduled = {
1299
- id: string;
1300
- created: number;
1301
- metadata?: {
1302
- [x: string]: any;
1303
- };
1304
- type: "session.retry.scheduled";
1305
- durable: {
1306
- aggregateID: string;
1307
- seq: number;
1308
- version: 1;
1309
- };
1310
- location?: LocationRef;
1311
- data: {
1312
- sessionID: string;
1313
- assistantMessageID: string;
1314
- attempt: number;
1315
- at: number;
1316
- error: SessionStructuredError;
1317
- };
1145
+ export type ReferenceSource = ReferenceLocalSource | ReferenceGitSource;
1146
+ export type WorktreeList = Array<WorktreeDirectory>;
1147
+ export type SessionStatsModelUsage = {
1148
+ model: ModelRef;
1149
+ steps: number;
1150
+ tokens: TokenUsageInfo;
1151
+ cost: MoneyUSD;
1318
1152
  };
1319
- export type SessionCompactionStarted = {
1320
- id: string;
1321
- created: number;
1153
+ export type SessionMessageModelSelected = {
1154
+ id: SessionMessageID;
1322
1155
  metadata?: {
1323
- [x: string]: any;
1324
- };
1325
- type: "session.compaction.started";
1326
- durable: {
1327
- aggregateID: string;
1328
- seq: number;
1329
- version: 1;
1156
+ [x: string]: JsonValue;
1330
1157
  };
1331
- location?: LocationRef;
1332
- data: {
1333
- sessionID: string;
1334
- reason: "auto" | "manual";
1335
- recent: string;
1336
- inputID?: string;
1158
+ time: {
1159
+ created: number;
1337
1160
  };
1161
+ type: "model-switched";
1162
+ model: ModelRef;
1163
+ previous?: ModelRef;
1338
1164
  };
1339
- export type SessionCompactionFailed = {
1340
- id: string;
1341
- created: number;
1342
- metadata?: {
1343
- [x: string]: any;
1344
- };
1345
- type: "session.compaction.failed";
1346
- durable: {
1347
- aggregateID: string;
1348
- seq: number;
1349
- version: 1;
1350
- };
1351
- location?: LocationRef;
1352
- data: {
1353
- sessionID: string;
1354
- reason: "auto" | "manual";
1355
- error: SessionStructuredError;
1356
- inputID?: string;
1357
- cost?: MoneyUSD;
1358
- tokens?: TokenUsageInfo;
1359
- };
1165
+ export type SessionProviderContext = {
1166
+ version: 1;
1167
+ provenance: SessionProviderContextProvenance;
1168
+ messages: JsonValue;
1360
1169
  };
1361
- export type SessionRevertCleared = {
1170
+ export type ModelVariant = {
1362
1171
  id: string;
1363
- created: number;
1364
- metadata?: {
1365
- [x: string]: any;
1366
- };
1367
- type: "session.revert.cleared";
1368
- durable: {
1369
- aggregateID: string;
1370
- seq: number;
1371
- version: 1;
1372
- };
1373
- location?: LocationRef;
1374
- data: {
1375
- sessionID: string;
1172
+ settings?: ModelSettings;
1173
+ headers?: {
1174
+ [x: string]: string;
1376
1175
  };
1377
- };
1378
- export type SessionRevertCommitted = {
1379
- id: string;
1380
- created: number;
1381
- metadata?: {
1176
+ body?: {
1382
1177
  [x: string]: any;
1383
1178
  };
1384
- type: "session.revert.committed";
1385
- durable: {
1386
- aggregateID: string;
1387
- seq: number;
1388
- version: 1;
1389
- };
1390
- location?: LocationRef;
1391
- data: {
1392
- sessionID: string;
1393
- to: string;
1394
- };
1395
1179
  };
1396
- export type SessionUsageRecorded = {
1397
- id: string;
1398
- created: number;
1399
- metadata?: {
1400
- [x: string]: any;
1401
- };
1402
- type: "session.usage.recorded";
1403
- durable: {
1404
- aggregateID: string;
1405
- seq: number;
1406
- version: 1;
1407
- };
1408
- location?: LocationRef;
1409
- data: {
1410
- sessionID: string;
1411
- source: "title" | "compaction";
1412
- cost: MoneyUSD;
1413
- tokens: TokenUsageInfo;
1180
+ export type ProviderRequest = {
1181
+ settings: ProviderSettings;
1182
+ headers: {
1183
+ [x: string]: string;
1414
1184
  };
1415
- };
1416
- export type LocationShutdown = {
1417
- id: string;
1418
- created: number;
1419
- metadata?: {
1185
+ body: {
1420
1186
  [x: string]: any;
1421
1187
  };
1422
- type: "location.shutdown";
1423
- location?: LocationRef;
1424
- data: {};
1425
1188
  };
1426
- export type ModelsDevRefreshed = {
1427
- id: string;
1428
- created: number;
1429
- metadata?: {
1430
- [x: string]: any;
1189
+ export type ProviderInfo = {
1190
+ id: ProviderID;
1191
+ canonical?: ProviderID;
1192
+ integrationID?: IntegrationID;
1193
+ name: string;
1194
+ activation: "auto" | "enabled" | "disabled";
1195
+ package: string;
1196
+ settings?: ProviderSettings;
1197
+ headers?: {
1198
+ [x: string]: string;
1431
1199
  };
1432
- type: "models-dev.refreshed";
1433
- location?: LocationRef;
1434
- data: {};
1435
- };
1436
- export type CredentialUpdated = {
1437
- id: string;
1438
- created: number;
1439
- metadata?: {
1200
+ body?: {
1440
1201
  [x: string]: any;
1441
1202
  };
1442
- type: "credential.updated";
1443
- location?: LocationRef;
1444
- data: {};
1445
1203
  };
1446
- export type CredentialSwitched = {
1447
- id: string;
1448
- created: number;
1204
+ export type PermissionRuleset = Array<PermissionRule>;
1205
+ export type SessionMessageUser = {
1206
+ id: SessionMessageID;
1449
1207
  metadata?: {
1450
- [x: string]: any;
1208
+ [x: string]: JsonValue;
1451
1209
  };
1452
- type: "credential.switched";
1453
- location?: LocationRef;
1454
- data: {
1455
- integrationID: string;
1456
- credentialID: string | null;
1210
+ time: {
1211
+ created: number;
1457
1212
  };
1213
+ text: string;
1214
+ files?: Array<PromptFileAttachment>;
1215
+ agents?: Array<PromptAgentAttachment>;
1216
+ skills?: Array<PromptSkillAttachment>;
1217
+ type: "user";
1458
1218
  };
1459
- export type IntegrationUpdated = {
1460
- id: string;
1461
- created: number;
1219
+ export type SessionInboxUserPayload = {
1220
+ text: string;
1221
+ files?: Array<PromptFileAttachment>;
1222
+ agents?: Array<PromptAgentAttachment>;
1223
+ skills?: Array<PromptSkillAttachment>;
1462
1224
  metadata?: {
1463
- [x: string]: any;
1225
+ [x: string]: JsonValue;
1464
1226
  };
1465
- type: "integration.updated";
1466
- location?: LocationRef;
1467
- data: {};
1468
1227
  };
1469
- export type ProviderUpdated = {
1470
- id: string;
1471
- created: number;
1228
+ export type SessionInboxUserPayload1 = {
1229
+ text: string;
1230
+ files?: Array<PromptFileAttachment>;
1231
+ agents?: Array<PromptAgentAttachment>;
1232
+ skills?: Array<PromptSkillAttachment>;
1472
1233
  metadata?: {
1473
1234
  [x: string]: any;
1474
1235
  };
1475
- type: "provider.updated";
1476
- location?: LocationRef;
1477
- data: {};
1478
1236
  };
1479
- export type ModelUpdated = {
1480
- id: string;
1481
- created: number;
1237
+ export type SessionMessageToolStateCompleted = {
1238
+ status: "completed";
1239
+ input: {
1240
+ [x: string]: JsonValue;
1241
+ };
1242
+ content: [ToolContent, ...Array<ToolContent>];
1482
1243
  metadata?: {
1483
- [x: string]: any;
1244
+ [x: string]: JsonValue;
1484
1245
  };
1485
- type: "model.updated";
1486
- location?: LocationRef;
1487
- data: {};
1488
1246
  };
1489
- export type AgentUpdated = {
1490
- id: string;
1491
- created: number;
1247
+ export type SessionMessageToolStateError = {
1248
+ status: "error";
1249
+ input: {
1250
+ [x: string]: JsonValue;
1251
+ };
1252
+ error: SessionStructuredError;
1253
+ content?: [ToolContent, ...Array<ToolContent>];
1492
1254
  metadata?: {
1493
- [x: string]: any;
1255
+ [x: string]: JsonValue;
1494
1256
  };
1495
- type: "agent.updated";
1496
- location?: LocationRef;
1497
- data: {};
1498
1257
  };
1499
- export type SessionUsageUpdated = {
1500
- id: string;
1258
+ export type SessionAgentSelected = {
1259
+ id: EventID;
1501
1260
  created: number;
1502
1261
  metadata?: {
1503
1262
  [x: string]: any;
1504
1263
  };
1505
- type: "session.usage.updated";
1264
+ type: "session.agent.selected";
1265
+ durable: {
1266
+ aggregateID: string;
1267
+ seq: EventSeq;
1268
+ version: 1;
1269
+ };
1506
1270
  location?: LocationRef;
1507
1271
  data: {
1508
- sessionID: string;
1509
- cost: MoneyUSD;
1510
- tokens: TokenUsageInfo;
1272
+ sessionID: SessionID;
1273
+ agent: AgentID;
1274
+ previous?: AgentID;
1511
1275
  };
1512
1276
  };
1513
- export type SessionTextDelta = {
1514
- id: string;
1277
+ export type SessionModelSelected = {
1278
+ id: EventID;
1515
1279
  created: number;
1516
1280
  metadata?: {
1517
1281
  [x: string]: any;
1518
1282
  };
1519
- type: "session.text.delta";
1283
+ type: "session.model.selected";
1284
+ durable: {
1285
+ aggregateID: string;
1286
+ seq: EventSeq;
1287
+ version: 1;
1288
+ };
1520
1289
  location?: LocationRef;
1521
1290
  data: {
1522
- sessionID: string;
1523
- assistantMessageID: string;
1524
- ordinal: number;
1525
- delta: string;
1291
+ sessionID: SessionID;
1292
+ model: ModelRef;
1293
+ previous?: ModelRef;
1526
1294
  };
1527
1295
  };
1528
- export type SessionReasoningDelta = {
1529
- id: string;
1296
+ export type SessionMoved = {
1297
+ id: EventID;
1530
1298
  created: number;
1531
1299
  metadata?: {
1532
1300
  [x: string]: any;
1533
1301
  };
1534
- type: "session.reasoning.delta";
1302
+ type: "session.moved";
1303
+ durable: {
1304
+ aggregateID: string;
1305
+ seq: EventSeq;
1306
+ version: 1;
1307
+ };
1535
1308
  location?: LocationRef;
1536
1309
  data: {
1537
- sessionID: string;
1538
- assistantMessageID: string;
1539
- ordinal: number;
1540
- delta: string;
1310
+ sessionID: SessionID;
1311
+ location: LocationRef;
1312
+ projectID: ProjectID;
1313
+ subpath?: RelativePath;
1541
1314
  };
1542
1315
  };
1543
- export type SessionToolInputDelta = {
1544
- id: string;
1316
+ export type SessionRenamed = {
1317
+ id: EventID;
1545
1318
  created: number;
1546
1319
  metadata?: {
1547
1320
  [x: string]: any;
1548
1321
  };
1549
- type: "session.tool.input.delta";
1322
+ type: "session.renamed";
1323
+ durable: {
1324
+ aggregateID: string;
1325
+ seq: EventSeq;
1326
+ version: 1;
1327
+ };
1550
1328
  location?: LocationRef;
1551
1329
  data: {
1552
- sessionID: string;
1553
- assistantMessageID: string;
1554
- id: string;
1555
- delta: string;
1330
+ sessionID: SessionID;
1331
+ title: string;
1556
1332
  };
1557
1333
  };
1558
- export type SessionToolProgress = {
1559
- id: string;
1334
+ export type SessionMetadataUpdated = {
1335
+ id: EventID;
1560
1336
  created: number;
1561
1337
  metadata?: {
1562
1338
  [x: string]: any;
1563
1339
  };
1564
- type: "session.tool.progress";
1340
+ type: "session.metadata.updated";
1341
+ durable: {
1342
+ aggregateID: string;
1343
+ seq: EventSeq;
1344
+ version: 1;
1345
+ };
1565
1346
  location?: LocationRef;
1566
1347
  data: {
1567
- sessionID: string;
1568
- assistantMessageID: string;
1569
- id: string;
1570
- metadata: {
1571
- [x: string]: JsonValue;
1572
- };
1348
+ sessionID: SessionID;
1349
+ metadata: SessionMetadata;
1573
1350
  };
1574
1351
  };
1575
- export type SessionCompactionDelta = {
1576
- id: string;
1352
+ export type SessionViewed = {
1353
+ id: EventID;
1577
1354
  created: number;
1578
1355
  metadata?: {
1579
1356
  [x: string]: any;
1580
1357
  };
1581
- type: "session.compaction.delta";
1358
+ type: "session.viewed";
1359
+ durable: {
1360
+ aggregateID: string;
1361
+ seq: EventSeq;
1362
+ version: 1;
1363
+ };
1582
1364
  location?: LocationRef;
1583
1365
  data: {
1584
- sessionID: string;
1585
- text: string;
1366
+ sessionID: SessionID;
1367
+ idle: number;
1586
1368
  };
1587
1369
  };
1588
- export type FilesystemChanged = {
1589
- id: string;
1370
+ export type SessionDeleted = {
1371
+ id: EventID;
1590
1372
  created: number;
1591
1373
  metadata?: {
1592
1374
  [x: string]: any;
1593
1375
  };
1594
- type: "filesystem.changed";
1376
+ type: "session.deleted";
1377
+ durable: {
1378
+ aggregateID: string;
1379
+ seq: EventSeq;
1380
+ version: 2;
1381
+ };
1595
1382
  location?: LocationRef;
1596
1383
  data: {
1597
- file: string;
1598
- event: "add" | "change" | "unlink";
1599
- };
1600
- };
1601
- export type ReferenceUpdated = {
1602
- id: string;
1603
- created: number;
1604
- metadata?: {
1605
- [x: string]: any;
1384
+ sessionID: SessionID;
1606
1385
  };
1607
- type: "reference.updated";
1608
- location?: LocationRef;
1609
- data: {};
1610
1386
  };
1611
- export type PluginUpdated = {
1612
- id: string;
1387
+ export type SessionForked = {
1388
+ id: EventID;
1613
1389
  created: number;
1614
1390
  metadata?: {
1615
1391
  [x: string]: any;
1616
1392
  };
1617
- type: "plugin.updated";
1618
- location?: LocationRef;
1619
- data: {};
1620
- };
1621
- export type WorktreeUpdated = {
1622
- id: string;
1623
- created: number;
1624
- metadata?: {
1625
- [x: string]: any;
1393
+ type: "session.forked";
1394
+ durable: {
1395
+ aggregateID: string;
1396
+ seq: EventSeq;
1397
+ version: 2;
1626
1398
  };
1627
- type: "worktree.updated";
1628
1399
  location?: LocationRef;
1629
1400
  data: {
1630
- projectID: string;
1401
+ sessionID: SessionID;
1402
+ parentID: SessionID;
1403
+ boundary: SessionForkBoundary;
1404
+ instructions?: {
1405
+ [x: InstructionKey]: InstructionHash;
1406
+ };
1407
+ instructionEntries?: InstructionEntrySnapshot;
1631
1408
  };
1632
1409
  };
1633
- export type WorktreeResolved = {
1634
- id: string;
1410
+ export type SessionInboxDelivered = {
1411
+ id: EventID;
1635
1412
  created: number;
1636
1413
  metadata?: {
1637
1414
  [x: string]: any;
1638
1415
  };
1639
- type: "worktree.resolved";
1416
+ type: "session.inbox.delivered";
1640
1417
  durable: {
1641
1418
  aggregateID: string;
1642
- seq: number;
1419
+ seq: EventSeq;
1643
1420
  version: 1;
1644
1421
  };
1645
1422
  location?: LocationRef;
1646
1423
  data: {
1647
- projectID: string;
1648
- directory: string;
1649
- previous: string;
1650
- adopted?: Array<string>;
1424
+ sessionID: SessionID;
1425
+ inboxID: SessionMessageID;
1651
1426
  };
1652
1427
  };
1653
- export type CommandUpdated = {
1654
- id: string;
1655
- created: number;
1656
- metadata?: {
1657
- [x: string]: any;
1658
- };
1659
- type: "command.updated";
1660
- location?: LocationRef;
1661
- data: {};
1428
+ export type SessionInboxMovePayload1 = {
1429
+ location: LocationRef;
1430
+ projectID: ProjectID;
1431
+ subpath?: RelativePath;
1662
1432
  };
1663
- export type ConfigUpdated = {
1664
- id: string;
1433
+ export type SessionInboxCancelled = {
1434
+ id: EventID;
1665
1435
  created: number;
1666
1436
  metadata?: {
1667
1437
  [x: string]: any;
1668
1438
  };
1669
- type: "config.updated";
1670
- location?: LocationRef;
1671
- data: {};
1672
- };
1673
- export type SkillUpdated = {
1674
- id: string;
1675
- created: number;
1676
- metadata?: {
1677
- [x: string]: any;
1439
+ type: "session.inbox.cancelled";
1440
+ durable: {
1441
+ aggregateID: string;
1442
+ seq: EventSeq;
1443
+ version: 1;
1678
1444
  };
1679
- type: "skill.updated";
1680
1445
  location?: LocationRef;
1681
- data: {};
1446
+ data: {
1447
+ sessionID: SessionID;
1448
+ inboxID: SessionMessageID;
1449
+ };
1682
1450
  };
1683
- export type PtyExited = {
1684
- id: string;
1451
+ export type SessionInboxDeliveryChanged = {
1452
+ id: EventID;
1685
1453
  created: number;
1686
1454
  metadata?: {
1687
1455
  [x: string]: any;
1688
1456
  };
1689
- type: "pty.exited";
1457
+ type: "session.inbox.delivery.changed";
1458
+ durable: {
1459
+ aggregateID: string;
1460
+ seq: EventSeq;
1461
+ version: 1;
1462
+ };
1690
1463
  location?: LocationRef;
1691
1464
  data: {
1692
- id: string;
1693
- exitCode: number;
1465
+ sessionID: SessionID;
1466
+ inboxID: SessionMessageID;
1467
+ delivery: SessionInboxDelivery;
1694
1468
  };
1695
- };
1696
- export type PtyDeleted = {
1697
- id: string;
1469
+ };
1470
+ export type SessionExecutionStarted = {
1471
+ id: EventID;
1698
1472
  created: number;
1699
1473
  metadata?: {
1700
1474
  [x: string]: any;
1701
1475
  };
1702
- type: "pty.deleted";
1476
+ type: "session.execution.started";
1477
+ durable: {
1478
+ aggregateID: string;
1479
+ seq: EventSeq;
1480
+ version: 1;
1481
+ };
1703
1482
  location?: LocationRef;
1704
1483
  data: {
1705
- id: string;
1484
+ sessionID: SessionID;
1706
1485
  };
1707
1486
  };
1708
- export type PersistentPtyRemoved = {
1709
- id: string;
1487
+ export type SessionExecutionSucceeded = {
1488
+ id: EventID;
1710
1489
  created: number;
1711
1490
  metadata?: {
1712
1491
  [x: string]: any;
1713
1492
  };
1714
- type: "persistent-pty.removed";
1493
+ type: "session.execution.succeeded";
1494
+ durable: {
1495
+ aggregateID: string;
1496
+ seq: EventSeq;
1497
+ version: 1;
1498
+ };
1715
1499
  location?: LocationRef;
1716
1500
  data: {
1717
- sessionID: string;
1718
- ptyID: string;
1501
+ sessionID: SessionID;
1719
1502
  };
1720
1503
  };
1721
- export type ShellExited = {
1722
- id: string;
1504
+ export type SessionExecutionFailed = {
1505
+ id: EventID;
1723
1506
  created: number;
1724
1507
  metadata?: {
1725
1508
  [x: string]: any;
1726
1509
  };
1727
- type: "shell.exited";
1510
+ type: "session.execution.failed";
1511
+ durable: {
1512
+ aggregateID: string;
1513
+ seq: EventSeq;
1514
+ version: 1;
1515
+ };
1728
1516
  location?: LocationRef;
1729
1517
  data: {
1730
- id: string;
1731
- exit?: number;
1732
- status: "running" | "exited" | "timeout" | "killed";
1518
+ sessionID: SessionID;
1519
+ error: SessionStructuredError;
1733
1520
  };
1734
1521
  };
1735
- export type ShellDeleted = {
1736
- id: string;
1522
+ export type SessionExecutionInterrupted = {
1523
+ id: EventID;
1737
1524
  created: number;
1738
1525
  metadata?: {
1739
1526
  [x: string]: any;
1740
1527
  };
1741
- type: "shell.deleted";
1528
+ type: "session.execution.interrupted";
1529
+ durable: {
1530
+ aggregateID: string;
1531
+ seq: EventSeq;
1532
+ version: 1;
1533
+ };
1742
1534
  location?: LocationRef;
1743
1535
  data: {
1744
- id: string;
1536
+ sessionID: SessionID;
1537
+ reason: "user" | "shutdown" | "superseded" | "inactivity";
1745
1538
  };
1746
1539
  };
1747
- export type FormCancelled = {
1748
- id: string;
1540
+ export type SessionInstructionsUpdated = {
1541
+ id: EventID;
1749
1542
  created: number;
1750
1543
  metadata?: {
1751
1544
  [x: string]: any;
1752
1545
  };
1753
- type: "form.cancelled";
1546
+ type: "session.instructions.updated";
1547
+ durable: {
1548
+ aggregateID: string;
1549
+ seq: EventSeq;
1550
+ version: 2;
1551
+ };
1754
1552
  location?: LocationRef;
1755
1553
  data: {
1756
- id: string;
1757
- sessionID: string;
1554
+ sessionID: SessionID;
1555
+ delta: {
1556
+ [x: string]: InstructionHash | "removed";
1557
+ };
1558
+ text?: string;
1758
1559
  };
1759
1560
  };
1760
- export type WebsearchUpdated = {
1761
- id: string;
1561
+ export type SessionSynthetic = {
1562
+ id: EventID;
1762
1563
  created: number;
1763
1564
  metadata?: {
1764
1565
  [x: string]: any;
1765
1566
  };
1766
- type: "websearch.updated";
1567
+ type: "session.synthetic";
1568
+ durable: {
1569
+ aggregateID: string;
1570
+ seq: EventSeq;
1571
+ version: 1;
1572
+ };
1767
1573
  location?: LocationRef;
1768
- data: {};
1574
+ data: {
1575
+ sessionID: SessionID;
1576
+ text: string;
1577
+ description?: string;
1578
+ metadata?: {
1579
+ [x: string]: any;
1580
+ };
1581
+ };
1769
1582
  };
1770
- export type SessionIdle = {
1771
- id: string;
1583
+ export type SessionSkillActivated = {
1584
+ id: EventID;
1772
1585
  created: number;
1773
1586
  metadata?: {
1774
1587
  [x: string]: any;
1775
1588
  };
1776
- type: "session.idle";
1589
+ type: "session.skill.activated";
1590
+ durable: {
1591
+ aggregateID: string;
1592
+ seq: EventSeq;
1593
+ version: 1;
1594
+ };
1777
1595
  location?: LocationRef;
1778
1596
  data: {
1779
- sessionID: string;
1597
+ sessionID: SessionID;
1598
+ id: SkillID;
1599
+ name: SkillName;
1600
+ text: string;
1780
1601
  };
1781
1602
  };
1782
- export type TuiPromptAppend = {
1783
- id: string;
1603
+ export type SessionShellStarted = {
1604
+ id: EventID;
1784
1605
  created: number;
1785
1606
  metadata?: {
1786
1607
  [x: string]: any;
1787
1608
  };
1788
- type: "tui.prompt.append";
1609
+ type: "session.shell.started";
1610
+ durable: {
1611
+ aggregateID: string;
1612
+ seq: EventSeq;
1613
+ version: 1;
1614
+ };
1789
1615
  location?: LocationRef;
1790
1616
  data: {
1791
- text: string;
1617
+ sessionID: SessionID;
1618
+ shell: ShellInfo;
1792
1619
  };
1793
1620
  };
1794
- export type TuiCommandExecute = {
1795
- id: string;
1621
+ export type SessionShellEnded = {
1622
+ id: EventID;
1796
1623
  created: number;
1797
1624
  metadata?: {
1798
1625
  [x: string]: any;
1799
1626
  };
1800
- type: "tui.command.execute";
1627
+ type: "session.shell.ended";
1628
+ durable: {
1629
+ aggregateID: string;
1630
+ seq: EventSeq;
1631
+ version: 1;
1632
+ };
1801
1633
  location?: LocationRef;
1802
1634
  data: {
1803
- command: "session.list" | "session.new" | "session.share" | "session.interrupt" | "session.background" | "session.compact" | "session.page.up" | "session.page.down" | "session.line.up" | "session.line.down" | "session.half.page.up" | "session.half.page.down" | "session.first" | "session.last" | "prompt.clear" | "prompt.submit" | "agent.cycle" | (string & {});
1635
+ sessionID: SessionID;
1636
+ shell: ShellInfo;
1637
+ output: {
1638
+ output: string;
1639
+ cursor: number;
1640
+ size: number;
1641
+ truncated: boolean;
1642
+ };
1804
1643
  };
1805
1644
  };
1806
- export type TuiToastShow = {
1807
- id: string;
1645
+ export type SessionStepStarted = {
1646
+ id: EventID;
1808
1647
  created: number;
1809
1648
  metadata?: {
1810
1649
  [x: string]: any;
1811
1650
  };
1812
- type: "tui.toast.show";
1651
+ type: "session.step.started";
1652
+ durable: {
1653
+ aggregateID: string;
1654
+ seq: EventSeq;
1655
+ version: 1;
1656
+ };
1813
1657
  location?: LocationRef;
1814
1658
  data: {
1815
- title?: string;
1816
- message: string;
1817
- variant: "info" | "success" | "warning" | "error";
1818
- duration?: number | undefined;
1659
+ sessionID: SessionID;
1660
+ assistantMessageID: SessionMessageID;
1661
+ agent: AgentID;
1662
+ model: ModelRef;
1663
+ snapshot?: SnapshotID;
1664
+ started: number;
1819
1665
  };
1820
1666
  };
1821
- export type TuiSessionSelect = {
1822
- id: string;
1667
+ export type SessionStepStreamed = {
1668
+ id: EventID;
1823
1669
  created: number;
1824
1670
  metadata?: {
1825
1671
  [x: string]: any;
1826
1672
  };
1827
- type: "tui.session.select";
1673
+ type: "session.step.streamed";
1674
+ durable: {
1675
+ aggregateID: string;
1676
+ seq: EventSeq;
1677
+ version: 1;
1678
+ };
1828
1679
  location?: LocationRef;
1829
1680
  data: {
1830
- sessionID: string;
1681
+ sessionID: SessionID;
1682
+ assistantMessageID: SessionMessageID;
1831
1683
  };
1832
1684
  };
1833
- export type InstallationUpdated = {
1834
- id: string;
1685
+ export type SessionStepEnded = {
1686
+ id: EventID;
1835
1687
  created: number;
1836
1688
  metadata?: {
1837
1689
  [x: string]: any;
1838
1690
  };
1839
- type: "installation.updated";
1691
+ type: "session.step.ended";
1692
+ durable: {
1693
+ aggregateID: string;
1694
+ seq: EventSeq;
1695
+ version: 1;
1696
+ };
1840
1697
  location?: LocationRef;
1841
1698
  data: {
1842
- version: string;
1699
+ sessionID: SessionID;
1700
+ assistantMessageID: SessionMessageID;
1701
+ finish: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown";
1702
+ rawFinish?: string;
1703
+ providerState?: SessionMessageProviderState1;
1704
+ cost: MoneyUSD;
1705
+ tokens: TokenUsageInfo;
1706
+ snapshot?: SnapshotID;
1707
+ files?: Array<RelativePath>;
1843
1708
  };
1844
1709
  };
1845
- export type InstallationUpdateAvailable = {
1846
- id: string;
1710
+ export type SessionStepFailed = {
1711
+ id: EventID;
1847
1712
  created: number;
1848
1713
  metadata?: {
1849
1714
  [x: string]: any;
1850
1715
  };
1851
- type: "installation.update-available";
1716
+ type: "session.step.failed";
1717
+ durable: {
1718
+ aggregateID: string;
1719
+ seq: EventSeq;
1720
+ version: 1;
1721
+ };
1852
1722
  location?: LocationRef;
1853
1723
  data: {
1854
- version: string;
1724
+ sessionID: SessionID;
1725
+ assistantMessageID: SessionMessageID;
1726
+ error: SessionStructuredError;
1727
+ finish?: "content-filter";
1728
+ rawFinish?: string;
1729
+ providerState?: SessionMessageProviderState1;
1730
+ cost?: MoneyUSD;
1731
+ tokens?: TokenUsageInfo;
1732
+ snapshot?: SnapshotID;
1733
+ files?: Array<RelativePath>;
1855
1734
  };
1856
1735
  };
1857
- export type VcsBranchUpdated = {
1858
- id: string;
1736
+ export type SessionTextStarted = {
1737
+ id: EventID;
1859
1738
  created: number;
1860
1739
  metadata?: {
1861
1740
  [x: string]: any;
1862
1741
  };
1863
- type: "vcs.branch.updated";
1742
+ type: "session.text.started";
1743
+ durable: {
1744
+ aggregateID: string;
1745
+ seq: EventSeq;
1746
+ version: 1;
1747
+ };
1864
1748
  location?: LocationRef;
1865
1749
  data: {
1866
- branch?: string;
1750
+ sessionID: SessionID;
1751
+ assistantMessageID: SessionMessageID;
1752
+ ordinal: number;
1867
1753
  };
1868
1754
  };
1869
- export type McpStatusChanged = {
1870
- id: string;
1755
+ export type SessionTextEnded = {
1756
+ id: EventID;
1871
1757
  created: number;
1872
1758
  metadata?: {
1873
1759
  [x: string]: any;
1874
1760
  };
1875
- type: "mcp.status.changed";
1761
+ type: "session.text.ended";
1762
+ durable: {
1763
+ aggregateID: string;
1764
+ seq: EventSeq;
1765
+ version: 1;
1766
+ };
1876
1767
  location?: LocationRef;
1877
1768
  data: {
1878
- server: string;
1769
+ sessionID: SessionID;
1770
+ assistantMessageID: SessionMessageID;
1771
+ ordinal: number;
1772
+ text: string;
1773
+ state?: SessionMessageProviderState1;
1879
1774
  };
1880
1775
  };
1881
- export type McpResourcesChanged = {
1882
- id: string;
1776
+ export type SessionReasoningStarted = {
1777
+ id: EventID;
1883
1778
  created: number;
1884
1779
  metadata?: {
1885
1780
  [x: string]: any;
1886
1781
  };
1887
- type: "mcp.resources.changed";
1782
+ type: "session.reasoning.started";
1783
+ durable: {
1784
+ aggregateID: string;
1785
+ seq: EventSeq;
1786
+ version: 1;
1787
+ };
1888
1788
  location?: LocationRef;
1889
1789
  data: {
1890
- server: string;
1790
+ sessionID: SessionID;
1791
+ assistantMessageID: SessionMessageID;
1792
+ ordinal: number;
1793
+ state?: SessionMessageProviderState1;
1891
1794
  };
1892
1795
  };
1893
- export type SessionMoved = {
1894
- id: string;
1796
+ export type SessionReasoningEnded = {
1797
+ id: EventID;
1895
1798
  created: number;
1896
1799
  metadata?: {
1897
1800
  [x: string]: any;
1898
1801
  };
1899
- type: "session.moved";
1802
+ type: "session.reasoning.ended";
1900
1803
  durable: {
1901
1804
  aggregateID: string;
1902
- seq: number;
1805
+ seq: EventSeq;
1903
1806
  version: 1;
1904
1807
  };
1905
1808
  location?: LocationRef;
1906
1809
  data: {
1907
- sessionID: string;
1908
- location: LocationRef;
1909
- projectID: string;
1910
- subpath?: string;
1810
+ sessionID: SessionID;
1811
+ assistantMessageID: SessionMessageID;
1812
+ ordinal: number;
1813
+ text: string;
1814
+ state?: SessionMessageProviderState1;
1911
1815
  };
1912
1816
  };
1913
- export type SessionInboxMovePayload1 = {
1914
- location: LocationRef;
1915
- projectID: string;
1916
- subpath?: string;
1917
- };
1918
- export type SessionMetadataUpdated = {
1919
- id: string;
1817
+ export type SessionToolInputStarted = {
1818
+ id: EventID;
1920
1819
  created: number;
1921
1820
  metadata?: {
1922
1821
  [x: string]: any;
1923
1822
  };
1924
- type: "session.metadata.updated";
1823
+ type: "session.tool.input.started";
1925
1824
  durable: {
1926
1825
  aggregateID: string;
1927
- seq: number;
1826
+ seq: EventSeq;
1928
1827
  version: 1;
1929
1828
  };
1930
1829
  location?: LocationRef;
1931
1830
  data: {
1932
- sessionID: string;
1933
- metadata: SessionMetadata;
1831
+ sessionID: SessionID;
1832
+ assistantMessageID: SessionMessageID;
1833
+ id: string;
1834
+ name: string;
1934
1835
  };
1935
1836
  };
1936
- export type SessionShellStarted = {
1937
- id: string;
1837
+ export type SessionToolInputEnded = {
1838
+ id: EventID;
1938
1839
  created: number;
1939
1840
  metadata?: {
1940
1841
  [x: string]: any;
1941
1842
  };
1942
- type: "session.shell.started";
1843
+ type: "session.tool.input.ended";
1943
1844
  durable: {
1944
1845
  aggregateID: string;
1945
- seq: number;
1846
+ seq: EventSeq;
1946
1847
  version: 1;
1947
1848
  };
1948
1849
  location?: LocationRef;
1949
1850
  data: {
1950
- sessionID: string;
1951
- shell: ShellInfo;
1851
+ sessionID: SessionID;
1852
+ assistantMessageID: SessionMessageID;
1853
+ id: string;
1854
+ text: string;
1952
1855
  };
1953
1856
  };
1954
- export type SessionShellEnded = {
1955
- id: string;
1857
+ export type SessionToolCalled = {
1858
+ id: EventID;
1956
1859
  created: number;
1957
1860
  metadata?: {
1958
1861
  [x: string]: any;
1959
1862
  };
1960
- type: "session.shell.ended";
1863
+ type: "session.tool.called";
1961
1864
  durable: {
1962
1865
  aggregateID: string;
1963
- seq: number;
1866
+ seq: EventSeq;
1964
1867
  version: 1;
1965
1868
  };
1966
1869
  location?: LocationRef;
1967
1870
  data: {
1968
- sessionID: string;
1969
- shell: ShellInfo;
1970
- output: {
1971
- output: string;
1972
- cursor: number;
1973
- size: number;
1974
- truncated: boolean;
1871
+ sessionID: SessionID;
1872
+ assistantMessageID: SessionMessageID;
1873
+ id: string;
1874
+ input: {
1875
+ [x: string]: any;
1975
1876
  };
1877
+ executed: boolean;
1878
+ state?: SessionMessageProviderState1;
1976
1879
  };
1977
- };
1978
- export type ShellCreated = {
1979
- id: string;
1880
+ };
1881
+ export type SessionRetryScheduled = {
1882
+ id: EventID;
1980
1883
  created: number;
1981
1884
  metadata?: {
1982
1885
  [x: string]: any;
1983
1886
  };
1984
- type: "shell.created";
1887
+ type: "session.retry.scheduled";
1888
+ durable: {
1889
+ aggregateID: string;
1890
+ seq: EventSeq;
1891
+ version: 1;
1892
+ };
1985
1893
  location?: LocationRef;
1986
1894
  data: {
1987
- info: ShellInfo;
1895
+ sessionID: SessionID;
1896
+ assistantMessageID: SessionMessageID;
1897
+ attempt: number;
1898
+ at: number;
1899
+ error: SessionStructuredError;
1988
1900
  };
1989
1901
  };
1990
- export type SessionStepEnded = {
1991
- id: string;
1902
+ export type SessionCompactionStarted = {
1903
+ id: EventID;
1992
1904
  created: number;
1993
1905
  metadata?: {
1994
1906
  [x: string]: any;
1995
1907
  };
1996
- type: "session.step.ended";
1908
+ type: "session.compaction.started";
1997
1909
  durable: {
1998
1910
  aggregateID: string;
1999
- seq: number;
1911
+ seq: EventSeq;
2000
1912
  version: 1;
2001
1913
  };
2002
1914
  location?: LocationRef;
2003
1915
  data: {
2004
- sessionID: string;
2005
- assistantMessageID: string;
2006
- finish: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown";
2007
- rawFinish?: string;
2008
- providerState?: SessionMessageProviderState1;
2009
- cost: MoneyUSD;
2010
- tokens: TokenUsageInfo;
2011
- snapshot?: string;
2012
- files?: Array<string>;
1916
+ sessionID: SessionID;
1917
+ reason: "auto" | "manual";
1918
+ recent: string;
1919
+ inputID?: SessionMessageID;
2013
1920
  };
2014
1921
  };
2015
- export type SessionStepFailed = {
2016
- id: string;
1922
+ export type SessionCompactionFailed = {
1923
+ id: EventID;
2017
1924
  created: number;
2018
1925
  metadata?: {
2019
1926
  [x: string]: any;
2020
1927
  };
2021
- type: "session.step.failed";
1928
+ type: "session.compaction.failed";
2022
1929
  durable: {
2023
1930
  aggregateID: string;
2024
- seq: number;
1931
+ seq: EventSeq;
2025
1932
  version: 1;
2026
1933
  };
2027
1934
  location?: LocationRef;
2028
1935
  data: {
2029
- sessionID: string;
2030
- assistantMessageID: string;
1936
+ sessionID: SessionID;
1937
+ reason: "auto" | "manual";
2031
1938
  error: SessionStructuredError;
2032
- finish?: "content-filter";
2033
- rawFinish?: string;
2034
- providerState?: SessionMessageProviderState1;
1939
+ inputID?: SessionMessageID;
2035
1940
  cost?: MoneyUSD;
2036
1941
  tokens?: TokenUsageInfo;
2037
- snapshot?: string;
2038
- files?: Array<string>;
2039
1942
  };
2040
1943
  };
2041
- export type SessionTextEnded = {
2042
- id: string;
1944
+ export type SessionRevertStaged = {
1945
+ id: EventID;
2043
1946
  created: number;
2044
1947
  metadata?: {
2045
1948
  [x: string]: any;
2046
1949
  };
2047
- type: "session.text.ended";
1950
+ type: "session.revert.staged";
2048
1951
  durable: {
2049
1952
  aggregateID: string;
2050
- seq: number;
1953
+ seq: EventSeq;
2051
1954
  version: 1;
2052
1955
  };
2053
1956
  location?: LocationRef;
2054
1957
  data: {
2055
- sessionID: string;
2056
- assistantMessageID: string;
2057
- ordinal: number;
2058
- text: string;
2059
- state?: SessionMessageProviderState1;
1958
+ sessionID: SessionID;
1959
+ revert: SessionRevert;
2060
1960
  };
2061
1961
  };
2062
- export type SessionReasoningStarted = {
2063
- id: string;
1962
+ export type SessionRevertCleared = {
1963
+ id: EventID;
2064
1964
  created: number;
2065
1965
  metadata?: {
2066
1966
  [x: string]: any;
2067
1967
  };
2068
- type: "session.reasoning.started";
1968
+ type: "session.revert.cleared";
2069
1969
  durable: {
2070
1970
  aggregateID: string;
2071
- seq: number;
1971
+ seq: EventSeq;
2072
1972
  version: 1;
2073
1973
  };
2074
1974
  location?: LocationRef;
2075
1975
  data: {
2076
- sessionID: string;
2077
- assistantMessageID: string;
2078
- ordinal: number;
2079
- state?: SessionMessageProviderState1;
1976
+ sessionID: SessionID;
2080
1977
  };
2081
1978
  };
2082
- export type SessionReasoningEnded = {
2083
- id: string;
1979
+ export type SessionRevertCommitted = {
1980
+ id: EventID;
2084
1981
  created: number;
2085
1982
  metadata?: {
2086
1983
  [x: string]: any;
2087
1984
  };
2088
- type: "session.reasoning.ended";
1985
+ type: "session.revert.committed";
2089
1986
  durable: {
2090
1987
  aggregateID: string;
2091
- seq: number;
1988
+ seq: EventSeq;
2092
1989
  version: 1;
2093
1990
  };
2094
1991
  location?: LocationRef;
2095
1992
  data: {
2096
- sessionID: string;
2097
- assistantMessageID: string;
2098
- ordinal: number;
2099
- text: string;
2100
- state?: SessionMessageProviderState1;
1993
+ sessionID: SessionID;
1994
+ to: SessionMessageID;
2101
1995
  };
2102
1996
  };
2103
- export type SessionToolCalled = {
2104
- id: string;
1997
+ export type SessionUsageRecorded = {
1998
+ id: EventID;
2105
1999
  created: number;
2106
2000
  metadata?: {
2107
2001
  [x: string]: any;
2108
2002
  };
2109
- type: "session.tool.called";
2003
+ type: "session.usage.recorded";
2110
2004
  durable: {
2111
2005
  aggregateID: string;
2112
- seq: number;
2006
+ seq: EventSeq;
2113
2007
  version: 1;
2114
2008
  };
2115
2009
  location?: LocationRef;
2116
2010
  data: {
2117
- sessionID: string;
2118
- assistantMessageID: string;
2119
- id: string;
2120
- input: {
2121
- [x: string]: any;
2122
- };
2123
- executed: boolean;
2124
- state?: SessionMessageProviderState1;
2011
+ sessionID: SessionID;
2012
+ source: "title" | "compaction";
2013
+ cost: MoneyUSD;
2014
+ tokens: TokenUsageInfo;
2125
2015
  };
2126
2016
  };
2127
- export type SessionMessageAssistantText1 = {
2128
- type: "text";
2129
- text: string;
2130
- state?: SessionMessageProviderState1;
2131
- };
2132
- export type SessionMessageAssistantReasoning1 = {
2133
- type: "reasoning";
2134
- text: string;
2135
- state?: SessionMessageProviderState1;
2136
- time?: {
2137
- created: number;
2138
- completed?: number;
2017
+ export type LocationShutdown = {
2018
+ id: EventID;
2019
+ created: number;
2020
+ metadata?: {
2021
+ [x: string]: any;
2139
2022
  };
2023
+ type: "location.shutdown";
2024
+ location?: LocationRef;
2025
+ data: {};
2140
2026
  };
2141
- export type ToolContent1 = ToolTextContent | ToolFileContent1;
2142
- export type FormNumberField = {
2143
- key: string;
2144
- title?: string;
2145
- description?: string;
2146
- required?: boolean;
2147
- hidden?: boolean;
2148
- when?: Array<FormWhen>;
2149
- type: "number";
2150
- minimum?: number | "Infinity" | "-Infinity" | "NaN";
2151
- maximum?: number | "Infinity" | "-Infinity" | "NaN";
2152
- default?: number | "Infinity" | "-Infinity" | "NaN";
2027
+ export type ModelsDevRefreshed = {
2028
+ id: EventID;
2029
+ created: number;
2030
+ metadata?: {
2031
+ [x: string]: any;
2032
+ };
2033
+ type: "models-dev.refreshed";
2034
+ location?: LocationRef;
2035
+ data: {};
2153
2036
  };
2154
- export type FormIntegerField = {
2155
- key: string;
2156
- title?: string;
2157
- description?: string;
2158
- required?: boolean;
2159
- hidden?: boolean;
2160
- when?: Array<FormWhen>;
2161
- type: "integer";
2162
- minimum?: number | "Infinity" | "-Infinity" | "NaN";
2163
- maximum?: number | "Infinity" | "-Infinity" | "NaN";
2164
- default?: number | "Infinity" | "-Infinity" | "NaN";
2037
+ export type CredentialUpdated = {
2038
+ id: EventID;
2039
+ created: number;
2040
+ metadata?: {
2041
+ [x: string]: any;
2042
+ };
2043
+ type: "credential.updated";
2044
+ location?: LocationRef;
2045
+ data: {};
2165
2046
  };
2166
- export type FormBooleanField = {
2167
- key: string;
2168
- title?: string;
2169
- description?: string;
2170
- required?: boolean;
2171
- hidden?: boolean;
2172
- when?: Array<FormWhen>;
2173
- type: "boolean";
2174
- default?: boolean;
2047
+ export type CredentialSwitched = {
2048
+ id: EventID;
2049
+ created: number;
2050
+ metadata?: {
2051
+ [x: string]: any;
2052
+ };
2053
+ type: "credential.switched";
2054
+ location?: LocationRef;
2055
+ data: {
2056
+ integrationID: IntegrationID;
2057
+ credentialID: CredentialID | null;
2058
+ };
2175
2059
  };
2176
- export type FormStringField = {
2177
- key: string;
2178
- title?: string;
2179
- description?: string;
2180
- required?: boolean;
2181
- hidden?: boolean;
2182
- when?: Array<FormWhen>;
2183
- type: "string";
2184
- format?: "email" | "uri" | "date" | "date-time";
2185
- minLength?: number;
2186
- maxLength?: number;
2187
- pattern?: string;
2188
- placeholder?: string;
2189
- default?: string;
2190
- options?: Array<FormOption>;
2191
- custom?: boolean;
2060
+ export type IntegrationUpdated = {
2061
+ id: EventID;
2062
+ created: number;
2063
+ metadata?: {
2064
+ [x: string]: any;
2065
+ };
2066
+ type: "integration.updated";
2067
+ location?: LocationRef;
2068
+ data: {};
2192
2069
  };
2193
- export type FormMultiselectField = {
2194
- key: string;
2195
- title?: string;
2196
- description?: string;
2197
- required?: boolean;
2198
- hidden?: boolean;
2199
- when?: Array<FormWhen>;
2200
- type: "multiselect";
2201
- options: Array<FormOption>;
2202
- minItems?: number;
2203
- maxItems?: number;
2204
- custom?: boolean;
2205
- default?: Array<string>;
2070
+ export type ProviderUpdated = {
2071
+ id: EventID;
2072
+ created: number;
2073
+ metadata?: {
2074
+ [x: string]: any;
2075
+ };
2076
+ type: "provider.updated";
2077
+ location?: LocationRef;
2078
+ data: {};
2206
2079
  };
2207
- export type FormAnswer = {
2208
- [x: string]: FormValue;
2080
+ export type ModelUpdated = {
2081
+ id: EventID;
2082
+ created: number;
2083
+ metadata?: {
2084
+ [x: string]: any;
2085
+ };
2086
+ type: "model.updated";
2087
+ location?: LocationRef;
2088
+ data: {};
2209
2089
  };
2210
- export type ModelCompatibility = {
2211
- reasoningField?: ModelReasoningField;
2212
- requireReasoning?: boolean;
2213
- maxTokensField?: ModelMaxTokensField;
2214
- requireFinishReason?: boolean;
2215
- requireAssistantAfterTool?: boolean;
2216
- supportsPromptCacheKey?: boolean;
2217
- supportsThinkingBlockBinding?: boolean;
2218
- supportsEffortUpdates?: boolean;
2090
+ export type AgentUpdated = {
2091
+ id: EventID;
2092
+ created: number;
2093
+ metadata?: {
2094
+ [x: string]: any;
2095
+ };
2096
+ type: "agent.updated";
2097
+ location?: LocationRef;
2098
+ data: {};
2219
2099
  };
2220
- export type ModelCost = {
2221
- tier?: {
2222
- type: "context";
2223
- size: number;
2100
+ export type SessionUsageUpdated = {
2101
+ id: EventID;
2102
+ created: number;
2103
+ metadata?: {
2104
+ [x: string]: any;
2224
2105
  };
2225
- input: MoneyUSDPerMillionTokens;
2226
- output: MoneyUSDPerMillionTokens;
2227
- cache: {
2228
- read: MoneyUSDPerMillionTokens;
2229
- write: MoneyUSDPerMillionTokens;
2106
+ type: "session.usage.updated";
2107
+ location?: LocationRef;
2108
+ data: {
2109
+ sessionID: SessionID;
2110
+ cost: MoneyUSD;
2111
+ tokens: TokenUsageInfo;
2230
2112
  };
2231
2113
  };
2232
- export type ConnectionCredentialInfo = {
2233
- type: "credential";
2234
- id: string;
2235
- label: string;
2236
- method: "key" | "oauth" | "external";
2237
- status?: ConnectionStatus;
2114
+ export type SessionTextDelta = {
2115
+ id: EventID;
2116
+ created: number;
2117
+ metadata?: {
2118
+ [x: string]: any;
2119
+ };
2120
+ type: "session.text.delta";
2121
+ location?: LocationRef;
2122
+ data: {
2123
+ sessionID: SessionID;
2124
+ assistantMessageID: SessionMessageID;
2125
+ ordinal: number;
2126
+ delta: string;
2127
+ };
2238
2128
  };
2239
- export type ConnectionEnvInfo = {
2240
- type: "env";
2241
- name: string;
2242
- status?: ConnectionStatus;
2129
+ export type SessionReasoningDelta = {
2130
+ id: EventID;
2131
+ created: number;
2132
+ metadata?: {
2133
+ [x: string]: any;
2134
+ };
2135
+ type: "session.reasoning.delta";
2136
+ location?: LocationRef;
2137
+ data: {
2138
+ sessionID: SessionID;
2139
+ assistantMessageID: SessionMessageID;
2140
+ ordinal: number;
2141
+ delta: string;
2142
+ };
2243
2143
  };
2244
- export type McpServer = {
2245
- name: string;
2246
- status: McpStatusConnected | McpStatusPending | McpStatusDisabled | McpStatusFailed | McpStatusNeedsAuth;
2247
- integrationID?: string;
2144
+ export type SessionToolInputDelta = {
2145
+ id: EventID;
2146
+ created: number;
2147
+ metadata?: {
2148
+ [x: string]: any;
2149
+ };
2150
+ type: "session.tool.input.delta";
2151
+ location?: LocationRef;
2152
+ data: {
2153
+ sessionID: SessionID;
2154
+ assistantMessageID: SessionMessageID;
2155
+ id: string;
2156
+ delta: string;
2157
+ };
2248
2158
  };
2249
- export type McpResourceCatalog = {
2250
- resources: Array<McpResource>;
2251
- templates: Array<McpResourceTemplate>;
2159
+ export type SessionToolProgress = {
2160
+ id: EventID;
2161
+ created: number;
2162
+ metadata?: {
2163
+ [x: string]: any;
2164
+ };
2165
+ type: "session.tool.progress";
2166
+ location?: LocationRef;
2167
+ data: {
2168
+ sessionID: SessionID;
2169
+ assistantMessageID: SessionMessageID;
2170
+ id: string;
2171
+ metadata: {
2172
+ [x: string]: JsonValue;
2173
+ };
2174
+ };
2252
2175
  };
2253
- export type Project = {
2254
- id: string;
2255
- canonical: string;
2256
- vcs?: ProjectVcs;
2257
- name?: string;
2258
- icon?: ProjectIcon;
2259
- commands?: ProjectCommands;
2260
- time: ProjectTime;
2261
- sandboxes: Array<string>;
2176
+ export type SessionCompactionDelta = {
2177
+ id: EventID;
2178
+ created: number;
2179
+ metadata?: {
2180
+ [x: string]: any;
2181
+ };
2182
+ type: "session.compaction.delta";
2183
+ location?: LocationRef;
2184
+ data: {
2185
+ sessionID: SessionID;
2186
+ text: string;
2187
+ };
2262
2188
  };
2263
- export type ProjectUpdated = {
2264
- id: string;
2189
+ export type FilesystemChanged = {
2190
+ id: EventID;
2265
2191
  created: number;
2266
2192
  metadata?: {
2267
2193
  [x: string]: any;
2268
2194
  };
2269
- type: "project.updated";
2195
+ type: "filesystem.changed";
2270
2196
  location?: LocationRef;
2271
2197
  data: {
2272
- id: string;
2273
- canonical: string;
2274
- vcs?: ProjectVcs;
2275
- name?: string;
2276
- icon?: ProjectIcon;
2277
- commands?: ProjectCommands;
2278
- time: ProjectTime;
2279
- sandboxes: Array<string>;
2198
+ file: string;
2199
+ event: "add" | "change" | "unlink";
2280
2200
  };
2281
2201
  };
2282
- export type PermissionRequest = {
2283
- id: string;
2284
- sessionID: string;
2285
- action: string;
2286
- resources: Array<string>;
2287
- save?: Array<string>;
2202
+ export type ReferenceUpdated = {
2203
+ id: EventID;
2204
+ created: number;
2288
2205
  metadata?: {
2289
- [x: string]: JsonValue;
2206
+ [x: string]: any;
2290
2207
  };
2291
- source?: PermissionSource;
2292
- message?: string;
2208
+ type: "reference.updated";
2209
+ location?: LocationRef;
2210
+ data: {};
2293
2211
  };
2294
2212
  export type PermissionAsked = {
2295
- id: string;
2213
+ id: EventID;
2296
2214
  created: number;
2297
2215
  metadata?: {
2298
2216
  [x: string]: any;
@@ -2300,8 +2218,8 @@ export type PermissionAsked = {
2300
2218
  type: "permission.asked";
2301
2219
  location?: LocationRef;
2302
2220
  data: {
2303
- id: string;
2304
- sessionID: string;
2221
+ id: PermissionID;
2222
+ sessionID: SessionID;
2305
2223
  action: string;
2306
2224
  resources: Array<string>;
2307
2225
  save?: Array<string>;
@@ -2313,7 +2231,7 @@ export type PermissionAsked = {
2313
2231
  };
2314
2232
  };
2315
2233
  export type PermissionReplied = {
2316
- id: string;
2234
+ id: EventID;
2317
2235
  created: number;
2318
2236
  metadata?: {
2319
2237
  [x: string]: any;
@@ -2321,346 +2239,339 @@ export type PermissionReplied = {
2321
2239
  type: "permission.replied";
2322
2240
  location?: LocationRef;
2323
2241
  data: {
2324
- sessionID: string;
2325
- requestID: string;
2242
+ sessionID: SessionID;
2243
+ requestID: PermissionID;
2326
2244
  reply: PermissionReply;
2327
2245
  };
2328
2246
  };
2329
- export type PtyCreated = {
2330
- id: string;
2247
+ export type PluginUpdated = {
2248
+ id: EventID;
2331
2249
  created: number;
2332
2250
  metadata?: {
2333
2251
  [x: string]: any;
2334
2252
  };
2335
- type: "pty.created";
2253
+ type: "plugin.updated";
2254
+ location?: LocationRef;
2255
+ data: {};
2256
+ };
2257
+ export type ProjectUpdated = {
2258
+ id: EventID;
2259
+ created: number;
2260
+ metadata?: {
2261
+ [x: string]: any;
2262
+ };
2263
+ type: "project.updated";
2336
2264
  location?: LocationRef;
2337
2265
  data: {
2338
- info: Pty;
2266
+ id: ProjectID;
2267
+ canonical: AbsolutePath;
2268
+ vcs?: ProjectVcs;
2269
+ name?: string;
2270
+ icon?: ProjectIcon;
2271
+ commands?: ProjectCommands;
2272
+ time: ProjectTime;
2273
+ sandboxes: Array<string>;
2339
2274
  };
2340
2275
  };
2341
- export type PtyUpdated = {
2342
- id: string;
2276
+ export type WorktreeUpdated = {
2277
+ id: EventID;
2343
2278
  created: number;
2344
2279
  metadata?: {
2345
2280
  [x: string]: any;
2346
2281
  };
2347
- type: "pty.updated";
2282
+ type: "worktree.updated";
2348
2283
  location?: LocationRef;
2349
2284
  data: {
2350
- info: Pty;
2285
+ projectID: ProjectID;
2351
2286
  };
2352
2287
  };
2353
- export type PersistentPtyAdded = {
2354
- id: string;
2288
+ export type WorktreeResolved = {
2289
+ id: EventID;
2355
2290
  created: number;
2356
2291
  metadata?: {
2357
2292
  [x: string]: any;
2358
2293
  };
2359
- type: "persistent-pty.added";
2294
+ type: "worktree.resolved";
2295
+ durable: {
2296
+ aggregateID: string;
2297
+ seq: EventSeq;
2298
+ version: 1;
2299
+ };
2360
2300
  location?: LocationRef;
2361
2301
  data: {
2362
- sessionID: string;
2363
- terminal: PersistentPtyInfo;
2302
+ projectID: ProjectID;
2303
+ directory: AbsolutePath;
2304
+ previous: ProjectID;
2305
+ adopted?: Array<ProjectID>;
2364
2306
  };
2365
2307
  };
2366
- export type PersistentPtySnapshot = {
2367
- info: PersistentPtyInfo;
2368
- text: string;
2369
- checkpoint: string;
2370
- cursor: {
2371
- x: number;
2372
- y: number;
2308
+ export type CommandUpdated = {
2309
+ id: EventID;
2310
+ created: number;
2311
+ metadata?: {
2312
+ [x: string]: any;
2373
2313
  };
2314
+ type: "command.updated";
2315
+ location?: LocationRef;
2316
+ data: {};
2374
2317
  };
2375
- export type FormStringField1 = {
2376
- key: string;
2377
- title?: string;
2378
- description?: string;
2379
- required?: boolean;
2380
- hidden?: boolean;
2381
- when?: Array<FormWhen1>;
2382
- type: "string";
2383
- format?: "email" | "uri" | "date" | "date-time";
2384
- minLength?: number;
2385
- maxLength?: number;
2386
- pattern?: string;
2387
- placeholder?: string;
2388
- default?: string;
2389
- options?: Array<FormOption>;
2390
- custom?: boolean;
2391
- };
2392
- export type FormNumberField1 = {
2393
- key: string;
2394
- title?: string;
2395
- description?: string;
2396
- required?: boolean;
2397
- hidden?: boolean;
2398
- when?: Array<FormWhen1>;
2399
- type: "number";
2400
- minimum?: number;
2401
- maximum?: number;
2402
- default?: number;
2318
+ export type ConfigUpdated = {
2319
+ id: EventID;
2320
+ created: number;
2321
+ metadata?: {
2322
+ [x: string]: any;
2323
+ };
2324
+ type: "config.updated";
2325
+ location?: LocationRef;
2326
+ data: {};
2403
2327
  };
2404
- export type FormIntegerField1 = {
2405
- key: string;
2406
- title?: string;
2407
- description?: string;
2408
- required?: boolean;
2409
- hidden?: boolean;
2410
- when?: Array<FormWhen1>;
2411
- type: "integer";
2412
- minimum?: number;
2413
- maximum?: number;
2414
- default?: number;
2328
+ export type SkillUpdated = {
2329
+ id: EventID;
2330
+ created: number;
2331
+ metadata?: {
2332
+ [x: string]: any;
2333
+ };
2334
+ type: "skill.updated";
2335
+ location?: LocationRef;
2336
+ data: {};
2415
2337
  };
2416
- export type FormBooleanField1 = {
2417
- key: string;
2418
- title?: string;
2419
- description?: string;
2420
- required?: boolean;
2421
- hidden?: boolean;
2422
- when?: Array<FormWhen1>;
2423
- type: "boolean";
2424
- default?: boolean;
2338
+ export type PtyExited = {
2339
+ id: EventID;
2340
+ created: number;
2341
+ metadata?: {
2342
+ [x: string]: any;
2343
+ };
2344
+ type: "pty.exited";
2345
+ location?: LocationRef;
2346
+ data: {
2347
+ id: PtyID;
2348
+ exitCode: number;
2349
+ };
2425
2350
  };
2426
- export type FormMultiselectField1 = {
2427
- key: string;
2428
- title?: string;
2429
- description?: string;
2430
- required?: boolean;
2431
- hidden?: boolean;
2432
- when?: Array<FormWhen1>;
2433
- type: "multiselect";
2434
- options: Array<FormOption>;
2435
- minItems?: number;
2436
- maxItems?: number;
2437
- custom?: boolean;
2438
- default?: Array<string>;
2351
+ export type PtyDeleted = {
2352
+ id: EventID;
2353
+ created: number;
2354
+ metadata?: {
2355
+ [x: string]: any;
2356
+ };
2357
+ type: "pty.deleted";
2358
+ location?: LocationRef;
2359
+ data: {
2360
+ id: PtyID;
2361
+ };
2439
2362
  };
2440
- export type FormAnswer2 = {
2441
- [x: string]: FormValue1;
2363
+ export type PersistentPtyRemoved = {
2364
+ id: EventID;
2365
+ created: number;
2366
+ metadata?: {
2367
+ [x: string]: any;
2368
+ };
2369
+ type: "persistent-pty.removed";
2370
+ location?: LocationRef;
2371
+ data: {
2372
+ sessionID: SessionID;
2373
+ ptyID: PtyID;
2374
+ };
2442
2375
  };
2443
- export type SessionStatusUpdated = {
2444
- id: string;
2376
+ export type ShellCreated = {
2377
+ id: EventID;
2445
2378
  created: number;
2446
2379
  metadata?: {
2447
2380
  [x: string]: any;
2448
2381
  };
2449
- type: "session.status";
2382
+ type: "shell.created";
2450
2383
  location?: LocationRef;
2451
2384
  data: {
2452
- sessionID: string;
2453
- status: SessionStatus;
2385
+ info: ShellInfo;
2454
2386
  };
2455
2387
  };
2456
- export type ReferenceSource = ReferenceLocalSource | ReferenceGitSource;
2457
- export type WorktreeList = Array<WorktreeDirectory>;
2458
- export type VcsInfo = {
2459
- provider?: string;
2460
- branch: VcsBranch;
2461
- };
2462
- export type SessionInboxMove = {
2463
- id: string;
2464
- sessionID: string;
2465
- time: {
2466
- created: number;
2388
+ export type ShellExited = {
2389
+ id: EventID;
2390
+ created: number;
2391
+ metadata?: {
2392
+ [x: string]: any;
2467
2393
  };
2468
- type: "move";
2469
- delivery: SessionInboxDelivery;
2470
- payload: SessionInboxMovePayload;
2471
- };
2472
- export type ModelVariant = {
2473
- id: string;
2474
- settings?: ModelSettings;
2475
- headers?: {
2476
- [x: string]: string;
2394
+ type: "shell.exited";
2395
+ location?: LocationRef;
2396
+ data: {
2397
+ id: ShellID;
2398
+ exit?: number;
2399
+ status: "running" | "exited" | "timeout" | "killed";
2477
2400
  };
2478
- body?: {
2401
+ };
2402
+ export type ShellDeleted = {
2403
+ id: EventID;
2404
+ created: number;
2405
+ metadata?: {
2479
2406
  [x: string]: any;
2480
2407
  };
2481
- };
2482
- export type ProviderRequest = {
2483
- settings: ProviderSettings;
2484
- headers: {
2485
- [x: string]: string;
2408
+ type: "shell.deleted";
2409
+ location?: LocationRef;
2410
+ data: {
2411
+ id: ShellID;
2486
2412
  };
2487
- body: {
2413
+ };
2414
+ export type FormCancelled = {
2415
+ id: EventID;
2416
+ created: number;
2417
+ metadata?: {
2488
2418
  [x: string]: any;
2489
2419
  };
2490
- };
2491
- export type ProviderInfo = {
2492
- id: string;
2493
- canonical?: string;
2494
- integrationID?: string;
2495
- name: string;
2496
- activation: "auto" | "enabled" | "disabled";
2497
- package: string;
2498
- settings?: ProviderSettings;
2499
- headers?: {
2500
- [x: string]: string;
2420
+ type: "form.cancelled";
2421
+ location?: LocationRef;
2422
+ data: {
2423
+ id: FormID;
2424
+ sessionID: string;
2501
2425
  };
2502
- body?: {
2426
+ };
2427
+ export type WebsearchUpdated = {
2428
+ id: EventID;
2429
+ created: number;
2430
+ metadata?: {
2503
2431
  [x: string]: any;
2504
2432
  };
2433
+ type: "websearch.updated";
2434
+ location?: LocationRef;
2435
+ data: {};
2505
2436
  };
2506
- export type PermissionRuleset = Array<PermissionRule>;
2507
- export type SessionRevertStaged = {
2508
- id: string;
2437
+ export type SessionStatusUpdated = {
2438
+ id: EventID;
2509
2439
  created: number;
2510
2440
  metadata?: {
2511
2441
  [x: string]: any;
2512
2442
  };
2513
- type: "session.revert.staged";
2514
- durable: {
2515
- aggregateID: string;
2516
- seq: number;
2517
- version: 1;
2518
- };
2443
+ type: "session.status";
2519
2444
  location?: LocationRef;
2520
2445
  data: {
2521
- sessionID: string;
2522
- revert: SessionRevert;
2446
+ sessionID: SessionID;
2447
+ status: SessionStatus;
2523
2448
  };
2524
2449
  };
2525
- export type SessionStatsInfo = {
2526
- range: {
2527
- from: number;
2528
- to: number;
2450
+ export type SessionIdle = {
2451
+ id: EventID;
2452
+ created: number;
2453
+ metadata?: {
2454
+ [x: string]: any;
2455
+ };
2456
+ type: "session.idle";
2457
+ location?: LocationRef;
2458
+ data: {
2459
+ sessionID: SessionID;
2529
2460
  };
2530
- sessions: number;
2531
- subagents: number;
2532
- prompts: number;
2533
- steps: number;
2534
- tokens: TokenUsageInfo;
2535
- cost: MoneyUSD;
2536
- tools: SessionStatsTools;
2537
- activeDays: number;
2538
- streak: number;
2539
- activity: Array<SessionStatsActivity>;
2540
- models: Array<SessionStatsModelUsage>;
2541
2461
  };
2542
- export type SessionMessageUser = {
2543
- id: string;
2462
+ export type TuiPromptAppend = {
2463
+ id: EventID;
2464
+ created: number;
2544
2465
  metadata?: {
2545
- [x: string]: JsonValue;
2466
+ [x: string]: any;
2546
2467
  };
2547
- time: {
2548
- created: number;
2468
+ type: "tui.prompt.append";
2469
+ location?: LocationRef;
2470
+ data: {
2471
+ text: string;
2549
2472
  };
2550
- text: string;
2551
- files?: Array<PromptFileAttachment>;
2552
- agents?: Array<PromptAgentAttachment>;
2553
- skills?: Array<PromptSkillAttachment>;
2554
- type: "user";
2555
2473
  };
2556
- export type SessionInboxUserPayload = {
2557
- text: string;
2558
- files?: Array<PromptFileAttachment>;
2559
- agents?: Array<PromptAgentAttachment>;
2560
- skills?: Array<PromptSkillAttachment>;
2474
+ export type TuiCommandExecute = {
2475
+ id: EventID;
2476
+ created: number;
2561
2477
  metadata?: {
2562
- [x: string]: JsonValue;
2478
+ [x: string]: any;
2479
+ };
2480
+ type: "tui.command.execute";
2481
+ location?: LocationRef;
2482
+ data: {
2483
+ command: "session.list" | "session.new" | "session.share" | "session.interrupt" | "session.background" | "session.compact" | "session.page.up" | "session.page.down" | "session.line.up" | "session.line.down" | "session.half.page.up" | "session.half.page.down" | "session.first" | "session.last" | "prompt.clear" | "prompt.submit" | "agent.cycle" | (string & {});
2563
2484
  };
2564
2485
  };
2565
- export type SessionInboxUserPayload1 = {
2566
- text: string;
2567
- files?: Array<PromptFileAttachment>;
2568
- agents?: Array<PromptAgentAttachment>;
2569
- skills?: Array<PromptSkillAttachment>;
2486
+ export type TuiToastShow = {
2487
+ id: EventID;
2488
+ created: number;
2570
2489
  metadata?: {
2571
2490
  [x: string]: any;
2572
2491
  };
2573
- };
2574
- export type SessionMessageToolStateCompleted = {
2575
- status: "completed";
2576
- input: {
2577
- [x: string]: JsonValue;
2492
+ type: "tui.toast.show";
2493
+ location?: LocationRef;
2494
+ data: {
2495
+ title?: string;
2496
+ message: string;
2497
+ variant: "info" | "success" | "warning" | "error";
2498
+ duration?: number | undefined;
2578
2499
  };
2579
- content: [ToolContent, ...Array<ToolContent>];
2500
+ };
2501
+ export type TuiSessionSelect = {
2502
+ id: EventID;
2503
+ created: number;
2580
2504
  metadata?: {
2581
- [x: string]: JsonValue;
2505
+ [x: string]: any;
2582
2506
  };
2583
- };
2584
- export type SessionMessageToolStateError = {
2585
- status: "error";
2586
- input: {
2587
- [x: string]: JsonValue;
2507
+ type: "tui.session.select";
2508
+ location?: LocationRef;
2509
+ data: {
2510
+ sessionID: SessionID;
2588
2511
  };
2589
- error: SessionStructuredError;
2590
- content?: [ToolContent, ...Array<ToolContent>];
2512
+ };
2513
+ export type InstallationUpdated = {
2514
+ id: EventID;
2515
+ created: number;
2591
2516
  metadata?: {
2592
- [x: string]: JsonValue;
2517
+ [x: string]: any;
2518
+ };
2519
+ type: "installation.updated";
2520
+ location?: LocationRef;
2521
+ data: {
2522
+ version: string;
2593
2523
  };
2594
2524
  };
2595
- export type SessionMessageCompactionCompleted = {
2596
- type: "compaction";
2597
- id: string;
2525
+ export type InstallationUpdateAvailable = {
2526
+ id: EventID;
2527
+ created: number;
2598
2528
  metadata?: {
2599
- [x: string]: JsonValue;
2529
+ [x: string]: any;
2600
2530
  };
2601
- time: {
2602
- created: number;
2531
+ type: "installation.update-available";
2532
+ location?: LocationRef;
2533
+ data: {
2534
+ version: string;
2603
2535
  };
2604
- status: "completed";
2605
- reason: "auto" | "manual";
2606
- model?: ModelRef;
2607
- providerState?: SessionMessageProviderState;
2608
- summary: string;
2609
- recent: string;
2610
- providerContext?: SessionProviderContext;
2611
- cost?: MoneyUSD;
2612
- tokens?: TokenUsageInfo;
2613
2536
  };
2614
- export type SessionCompactionEnded = {
2615
- id: string;
2537
+ export type VcsBranchUpdated = {
2538
+ id: EventID;
2616
2539
  created: number;
2617
2540
  metadata?: {
2618
2541
  [x: string]: any;
2619
2542
  };
2620
- type: "session.compaction.ended";
2621
- durable: {
2622
- aggregateID: string;
2623
- seq: number;
2624
- version: 1;
2625
- };
2543
+ type: "vcs.branch.updated";
2626
2544
  location?: LocationRef;
2627
2545
  data: {
2628
- sessionID: string;
2629
- reason: "auto" | "manual";
2630
- model?: ModelRef;
2631
- providerState?: SessionMessageProviderState1;
2632
- providerContext?: SessionProviderContext;
2633
- text: string;
2634
- recent: string;
2635
- cost?: MoneyUSD;
2636
- tokens?: TokenUsageInfo;
2546
+ branch?: string;
2637
2547
  };
2638
2548
  };
2639
- export type SessionForked = {
2640
- id: string;
2549
+ export type McpStatusChanged = {
2550
+ id: EventID;
2641
2551
  created: number;
2642
2552
  metadata?: {
2643
2553
  [x: string]: any;
2644
2554
  };
2645
- type: "session.forked";
2646
- durable: {
2647
- aggregateID: string;
2648
- seq: number;
2649
- version: 2;
2555
+ type: "mcp.status.changed";
2556
+ location?: LocationRef;
2557
+ data: {
2558
+ server: string;
2559
+ };
2560
+ };
2561
+ export type McpResourcesChanged = {
2562
+ id: EventID;
2563
+ created: number;
2564
+ metadata?: {
2565
+ [x: string]: any;
2650
2566
  };
2567
+ type: "mcp.resources.changed";
2651
2568
  location?: LocationRef;
2652
2569
  data: {
2653
- sessionID: string;
2654
- parentID: string;
2655
- boundary: SessionForkBoundary;
2656
- instructions?: {
2657
- [x: string]: string;
2658
- };
2659
- instructionEntries?: InstructionEntrySnapshot;
2570
+ server: string;
2660
2571
  };
2661
2572
  };
2662
2573
  export type SessionToolSuccess = {
2663
- id: string;
2574
+ id: EventID;
2664
2575
  created: number;
2665
2576
  metadata?: {
2666
2577
  [x: string]: any;
@@ -2668,13 +2579,13 @@ export type SessionToolSuccess = {
2668
2579
  type: "session.tool.success";
2669
2580
  durable: {
2670
2581
  aggregateID: string;
2671
- seq: number;
2582
+ seq: EventSeq;
2672
2583
  version: 2;
2673
2584
  };
2674
2585
  location?: LocationRef;
2675
2586
  data: {
2676
- sessionID: string;
2677
- assistantMessageID: string;
2587
+ sessionID: SessionID;
2588
+ assistantMessageID: SessionMessageID;
2678
2589
  id: string;
2679
2590
  content: [ToolContent1, ...Array<ToolContent1>];
2680
2591
  metadata?: {
@@ -2685,7 +2596,7 @@ export type SessionToolSuccess = {
2685
2596
  };
2686
2597
  };
2687
2598
  export type SessionToolFailed = {
2688
- id: string;
2599
+ id: EventID;
2689
2600
  created: number;
2690
2601
  metadata?: {
2691
2602
  [x: string]: any;
@@ -2693,13 +2604,13 @@ export type SessionToolFailed = {
2693
2604
  type: "session.tool.failed";
2694
2605
  durable: {
2695
2606
  aggregateID: string;
2696
- seq: number;
2607
+ seq: EventSeq;
2697
2608
  version: 2;
2698
2609
  };
2699
2610
  location?: LocationRef;
2700
2611
  data: {
2701
- sessionID: string;
2702
- assistantMessageID: string;
2612
+ sessionID: SessionID;
2613
+ assistantMessageID: SessionMessageID;
2703
2614
  id: string;
2704
2615
  error: SessionStructuredError;
2705
2616
  content?: [ToolContent1, ...Array<ToolContent1>];
@@ -2750,9 +2661,55 @@ export type CredentialKey = {
2750
2661
  configuration?: FormAnswer;
2751
2662
  };
2752
2663
  export type ConnectionInfo = ConnectionCredentialInfo | ConnectionEnvInfo;
2664
+ export type PtyCreated = {
2665
+ id: EventID;
2666
+ created: number;
2667
+ metadata?: {
2668
+ [x: string]: any;
2669
+ };
2670
+ type: "pty.created";
2671
+ location?: LocationRef;
2672
+ data: {
2673
+ info: Pty;
2674
+ };
2675
+ };
2676
+ export type PtyUpdated = {
2677
+ id: EventID;
2678
+ created: number;
2679
+ metadata?: {
2680
+ [x: string]: any;
2681
+ };
2682
+ type: "pty.updated";
2683
+ location?: LocationRef;
2684
+ data: {
2685
+ info: Pty;
2686
+ };
2687
+ };
2688
+ export type PersistentPtyAdded = {
2689
+ id: EventID;
2690
+ created: number;
2691
+ metadata?: {
2692
+ [x: string]: any;
2693
+ };
2694
+ type: "persistent-pty.added";
2695
+ location?: LocationRef;
2696
+ data: {
2697
+ sessionID: SessionID;
2698
+ terminal: PersistentPtyInfo;
2699
+ };
2700
+ };
2701
+ export type PersistentPtySnapshot = {
2702
+ info: PersistentPtyInfo;
2703
+ text: string;
2704
+ checkpoint: string;
2705
+ cursor: {
2706
+ x: number;
2707
+ y: number;
2708
+ };
2709
+ };
2753
2710
  export type FormField1 = FormStringField1 | FormNumberField1 | FormIntegerField1 | FormBooleanField1 | FormMultiselectField1 | FormExternalField;
2754
2711
  export type FormReplied = {
2755
- id: string;
2712
+ id: EventID;
2756
2713
  created: number;
2757
2714
  metadata?: {
2758
2715
  [x: string]: any;
@@ -2760,23 +2717,94 @@ export type FormReplied = {
2760
2717
  type: "form.replied";
2761
2718
  location?: LocationRef;
2762
2719
  data: {
2763
- id: string;
2720
+ id: FormID;
2764
2721
  sessionID: string;
2765
2722
  answer: FormAnswer2;
2766
2723
  };
2767
2724
  };
2725
+ export type SessionInboxMove = {
2726
+ id: SessionMessageID;
2727
+ sessionID: SessionID;
2728
+ time: {
2729
+ created: number;
2730
+ };
2731
+ type: "move";
2732
+ delivery: SessionInboxDelivery;
2733
+ payload: SessionInboxMovePayload;
2734
+ };
2768
2735
  export type ReferenceInfo = {
2769
2736
  name: string;
2770
- path: string;
2737
+ path: AbsolutePath;
2771
2738
  description?: string;
2772
2739
  hidden?: boolean;
2773
2740
  source: ReferenceSource;
2774
2741
  };
2742
+ export type SessionStatsInfo = {
2743
+ range: {
2744
+ from: number;
2745
+ to: number;
2746
+ };
2747
+ sessions: number;
2748
+ subagents: number;
2749
+ prompts: number;
2750
+ steps: number;
2751
+ tokens: TokenUsageInfo;
2752
+ cost: MoneyUSD;
2753
+ tools: SessionStatsTools;
2754
+ activeDays: number;
2755
+ streak: number;
2756
+ activity: Array<SessionStatsActivity>;
2757
+ models: Array<SessionStatsModelUsage>;
2758
+ };
2759
+ export type SessionMessageCompactionCompleted = {
2760
+ type: "compaction";
2761
+ id: SessionMessageID;
2762
+ metadata?: {
2763
+ [x: string]: JsonValue;
2764
+ };
2765
+ time: {
2766
+ created: number;
2767
+ };
2768
+ status: "completed";
2769
+ reason: "auto" | "manual";
2770
+ model?: ModelRef;
2771
+ providerState?: SessionMessageProviderState;
2772
+ summary: string;
2773
+ recent: string;
2774
+ providerContext?: SessionProviderContext;
2775
+ cost?: MoneyUSD;
2776
+ tokens?: TokenUsageInfo;
2777
+ };
2778
+ export type SessionCompactionEnded = {
2779
+ id: EventID;
2780
+ created: number;
2781
+ metadata?: {
2782
+ [x: string]: any;
2783
+ };
2784
+ type: "session.compaction.ended";
2785
+ durable: {
2786
+ aggregateID: string;
2787
+ seq: EventSeq;
2788
+ version: 1;
2789
+ };
2790
+ location?: LocationRef;
2791
+ data: {
2792
+ sessionID: SessionID;
2793
+ reason: "auto" | "manual";
2794
+ model?: ModelRef;
2795
+ providerState?: SessionMessageProviderState1;
2796
+ providerContext?: SessionProviderContext;
2797
+ text: string;
2798
+ recent: string;
2799
+ cost?: MoneyUSD;
2800
+ tokens?: TokenUsageInfo;
2801
+ };
2802
+ };
2775
2803
  export type ModelInfo = {
2776
2804
  id: string;
2777
2805
  modelID: string;
2778
- providerID: string;
2779
- canonical?: string;
2806
+ providerID: ProviderID;
2807
+ canonical?: ProviderID;
2780
2808
  family?: string;
2781
2809
  name: string;
2782
2810
  compatibility?: ModelCompatibility;
@@ -2803,7 +2831,7 @@ export type ModelInfo = {
2803
2831
  };
2804
2832
  };
2805
2833
  export type AgentInfo = {
2806
- id: string;
2834
+ id: AgentID;
2807
2835
  name: string;
2808
2836
  model?: ModelRef;
2809
2837
  request: ProviderRequest;
@@ -2815,33 +2843,15 @@ export type AgentInfo = {
2815
2843
  steps?: number;
2816
2844
  permissions: PermissionRuleset;
2817
2845
  };
2818
- export type SessionPermissions = {
2819
- id: string;
2820
- created: number;
2821
- metadata?: {
2822
- [x: string]: any;
2823
- };
2824
- type: "session.permissions";
2825
- durable: {
2826
- aggregateID: string;
2827
- seq: number;
2828
- version: 1;
2829
- };
2830
- location?: LocationRef;
2831
- data: {
2832
- sessionID: string;
2833
- permissions: PermissionRuleset;
2834
- };
2835
- };
2836
2846
  export type SessionInfo = {
2837
- id: string;
2838
- parentID?: string;
2847
+ id: SessionID;
2848
+ parentID?: SessionID;
2839
2849
  fork?: {
2840
- sessionID: string;
2850
+ sessionID: SessionID;
2841
2851
  boundary: SessionForkBoundary;
2842
2852
  };
2843
- projectID: string;
2844
- agent?: string;
2853
+ projectID: ProjectID;
2854
+ agent?: AgentID;
2845
2855
  model?: ModelRef;
2846
2856
  cost: MoneyUSD;
2847
2857
  tokens: TokenUsageInfo;
@@ -2854,14 +2864,14 @@ export type SessionInfo = {
2854
2864
  archived?: number;
2855
2865
  };
2856
2866
  title?: string;
2857
- subpath?: string;
2867
+ subpath?: RelativePath;
2858
2868
  metadata?: SessionMetadata;
2859
2869
  permissions?: PermissionRuleset;
2860
2870
  revert?: SessionRevert;
2861
2871
  location: LocationPublicRef;
2862
2872
  };
2863
2873
  export type SessionCreated = {
2864
- id: string;
2874
+ id: EventID;
2865
2875
  created: number;
2866
2876
  metadata?: {
2867
2877
  [x: string]: any;
@@ -2869,28 +2879,46 @@ export type SessionCreated = {
2869
2879
  type: "session.created";
2870
2880
  durable: {
2871
2881
  aggregateID: string;
2872
- seq: number;
2882
+ seq: EventSeq;
2873
2883
  version: 1;
2874
2884
  };
2875
2885
  location?: LocationRef;
2876
2886
  data: {
2877
- sessionID: string;
2878
- projectID: string;
2887
+ sessionID: SessionID;
2888
+ projectID: ProjectID;
2879
2889
  location: LocationRef;
2880
- subpath?: string;
2881
- parentID?: string;
2890
+ subpath?: RelativePath;
2891
+ parentID?: SessionID;
2882
2892
  slug: string;
2883
2893
  title?: string;
2884
- agent?: string;
2894
+ agent?: AgentID;
2885
2895
  model?: ModelRef;
2886
2896
  metadata?: SessionMetadata;
2887
2897
  permissions?: PermissionRuleset;
2888
2898
  version: string;
2889
2899
  };
2890
2900
  };
2901
+ export type SessionPermissions = {
2902
+ id: EventID;
2903
+ created: number;
2904
+ metadata?: {
2905
+ [x: string]: any;
2906
+ };
2907
+ type: "session.permissions";
2908
+ durable: {
2909
+ aggregateID: string;
2910
+ seq: EventSeq;
2911
+ version: 1;
2912
+ };
2913
+ location?: LocationRef;
2914
+ data: {
2915
+ sessionID: SessionID;
2916
+ permissions: PermissionRuleset;
2917
+ };
2918
+ };
2891
2919
  export type ConfigEntry = {
2892
2920
  type: "document";
2893
- path?: string;
2921
+ path?: AbsolutePath;
2894
2922
  info: {
2895
2923
  $schema?: string;
2896
2924
  shell?: string;
@@ -3056,7 +3084,7 @@ export type ConfigEntry = {
3056
3084
  };
3057
3085
  };
3058
3086
  websearch?: false | {
3059
- provider: "random" | (string & {});
3087
+ provider: "random" | WebSearchID;
3060
3088
  };
3061
3089
  plugins?: Array<string | {
3062
3090
  package: string;
@@ -3072,7 +3100,7 @@ export type ConfigEntry = {
3072
3100
  };
3073
3101
  providers?: {
3074
3102
  [x: string]: {
3075
- canonical?: string;
3103
+ canonical?: ProviderID;
3076
3104
  name?: string;
3077
3105
  env?: Array<string>;
3078
3106
  package?: string;
@@ -3153,11 +3181,11 @@ export type ConfigEntry = {
3153
3181
  };
3154
3182
  } | {
3155
3183
  type: "directory";
3156
- path: string;
3184
+ path: AbsolutePath;
3157
3185
  };
3158
3186
  export type SessionInboxUser = {
3159
- id: string;
3160
- sessionID: string;
3187
+ id: SessionMessageID;
3188
+ sessionID: SessionID;
3161
3189
  time: {
3162
3190
  created: number;
3163
3191
  };
@@ -3165,6 +3193,20 @@ export type SessionInboxUser = {
3165
3193
  payload: SessionInboxUserPayload;
3166
3194
  delivery: SessionInboxDelivery;
3167
3195
  };
3196
+ export type SessionMessageAssistantTool = {
3197
+ type: "tool";
3198
+ id: string;
3199
+ name: string;
3200
+ executed?: boolean;
3201
+ providerState?: SessionMessageProviderState;
3202
+ providerResultState?: SessionMessageProviderState;
3203
+ state: SessionMessageToolStateStreaming | SessionMessageToolStateRunning | SessionMessageToolStateCompleted | SessionMessageToolStateError;
3204
+ time: {
3205
+ created: number;
3206
+ ran?: number;
3207
+ completed?: number;
3208
+ };
3209
+ };
3168
3210
  export type SessionInboxItem = {
3169
3211
  type: "user";
3170
3212
  payload: SessionInboxUserPayload1;
@@ -3182,21 +3224,6 @@ export type SessionInboxItem = {
3182
3224
  payload: SessionInboxMovePayload1;
3183
3225
  delivery: SessionInboxDelivery;
3184
3226
  };
3185
- export type SessionMessageAssistantTool = {
3186
- type: "tool";
3187
- id: string;
3188
- name: string;
3189
- executed?: boolean;
3190
- providerState?: SessionMessageProviderState;
3191
- providerResultState?: SessionMessageProviderState;
3192
- state: SessionMessageToolStateStreaming | SessionMessageToolStateRunning | SessionMessageToolStateCompleted | SessionMessageToolStateError;
3193
- time: {
3194
- created: number;
3195
- ran?: number;
3196
- completed?: number;
3197
- };
3198
- };
3199
- export type SessionMessageCompaction = SessionMessageCompactionRunning | SessionMessageCompactionCompleted | SessionMessageCompactionFailed;
3200
3227
  export type SessionMessageAssistantTool1 = {
3201
3228
  type: "tool";
3202
3229
  id: string;
@@ -3214,35 +3241,17 @@ export type SessionMessageAssistantTool1 = {
3214
3241
  export type FormFields = [FormField, ...Array<FormField>];
3215
3242
  export type CredentialValue = CredentialOAuth | CredentialKey | CredentialExternal;
3216
3243
  export type FormFields2 = [FormField1, ...Array<FormField1>];
3244
+ export type SessionMessageCompaction = SessionMessageCompactionRunning | SessionMessageCompactionCompleted | SessionMessageCompactionFailed;
3217
3245
  export type SessionsResponse = {
3218
3246
  data: Array<SessionInfo>;
3219
3247
  cursor: {
3220
- previous?: string | null;
3221
- next?: string | null;
3248
+ previous?: SessionsCursor | null;
3249
+ next?: SessionsCursor | null;
3222
3250
  };
3223
3251
  };
3224
3252
  export type SessionInboxInfo = SessionInboxUser | SessionInboxSynthetic | SessionInboxCompaction | SessionInboxMove;
3225
- export type SessionInboxEnqueued = {
3226
- id: string;
3227
- created: number;
3228
- metadata?: {
3229
- [x: string]: any;
3230
- };
3231
- type: "session.inbox.enqueued";
3232
- durable: {
3233
- aggregateID: string;
3234
- seq: number;
3235
- version: 1;
3236
- };
3237
- location?: LocationRef;
3238
- data: {
3239
- sessionID: string;
3240
- inboxID: string;
3241
- item: SessionInboxItem;
3242
- };
3243
- };
3244
3253
  export type SessionMessageAssistant = {
3245
- id: string;
3254
+ id: SessionMessageID;
3246
3255
  metadata?: {
3247
3256
  [x: string]: JsonValue;
3248
3257
  };
@@ -3252,13 +3261,13 @@ export type SessionMessageAssistant = {
3252
3261
  completed?: number;
3253
3262
  };
3254
3263
  type: "assistant";
3255
- agent: string;
3264
+ agent: AgentID;
3256
3265
  model: ModelRef;
3257
3266
  content: Array<SessionMessageAssistantText | SessionMessageAssistantReasoning | SessionMessageAssistantTool>;
3258
3267
  snapshot?: {
3259
- start?: string;
3260
- end?: string;
3261
- files?: Array<string>;
3268
+ start?: SnapshotID;
3269
+ end?: SnapshotID;
3270
+ files?: Array<RelativePath>;
3262
3271
  };
3263
3272
  finish?: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown";
3264
3273
  rawFinish?: string;
@@ -3268,16 +3277,35 @@ export type SessionMessageAssistant = {
3268
3277
  error?: SessionStructuredError;
3269
3278
  retry?: SessionMessageAssistantRetry;
3270
3279
  };
3280
+ export type SessionInboxEnqueued = {
3281
+ id: EventID;
3282
+ created: number;
3283
+ metadata?: {
3284
+ [x: string]: any;
3285
+ };
3286
+ type: "session.inbox.enqueued";
3287
+ durable: {
3288
+ aggregateID: string;
3289
+ seq: EventSeq;
3290
+ version: 1;
3291
+ };
3292
+ location?: LocationRef;
3293
+ data: {
3294
+ sessionID: SessionID;
3295
+ inboxID: SessionMessageID;
3296
+ item: SessionInboxItem;
3297
+ };
3298
+ };
3271
3299
  export type SessionMessageAssistantContentEncoded = SessionMessageAssistantText1 | SessionMessageAssistantReasoning1 | SessionMessageAssistantTool1;
3272
3300
  export type FormInfo = {
3273
- id: string;
3301
+ id: FormID;
3274
3302
  sessionID: string;
3275
3303
  title: string;
3276
3304
  metadata?: FormMetadata;
3277
3305
  fields: FormFields;
3278
3306
  };
3279
3307
  export type FormDetail = {
3280
- id: string;
3308
+ id: FormID;
3281
3309
  sessionID: string;
3282
3310
  title: string;
3283
3311
  metadata?: FormMetadata;
@@ -3285,7 +3313,7 @@ export type FormDetail = {
3285
3313
  state: FormState;
3286
3314
  };
3287
3315
  export type IntegrationOAuthMethod = {
3288
- id: string;
3316
+ id: IntegrationMethodID;
3289
3317
  type: "oauth";
3290
3318
  label: string;
3291
3319
  form?: FormFields;
@@ -3296,20 +3324,20 @@ export type IntegrationKeyMethod = {
3296
3324
  form?: FormFields;
3297
3325
  };
3298
3326
  export type IntegrationExternalMethod = {
3299
- id: string;
3327
+ id: IntegrationMethodID;
3300
3328
  type: "external";
3301
3329
  label: string;
3302
3330
  form?: FormFields;
3303
3331
  };
3304
3332
  export type CredentialEntry = {
3305
- id: string;
3306
- integrationID: string;
3333
+ id: CredentialID;
3334
+ integrationID: IntegrationID;
3307
3335
  label: string;
3308
3336
  active: boolean;
3309
3337
  value: CredentialValue;
3310
3338
  };
3311
3339
  export type FormInfo1 = {
3312
- id: string;
3340
+ id: FormID;
3313
3341
  sessionID: string;
3314
3342
  title: string;
3315
3343
  metadata?: FormMetadata1;
@@ -3317,7 +3345,7 @@ export type FormInfo1 = {
3317
3345
  };
3318
3346
  export type SessionMessageInfo = SessionMessageAgentSelected | SessionMessageModelSelected | SessionMessageLocationSwitched | SessionMessageUser | SessionMessageSynthetic | SessionMessageSystem | SessionMessageSkill | SessionMessageShell | SessionMessageAssistant | SessionMessageCompaction | SessionMessageIdle;
3319
3347
  export type SessionMessageContentUpdated = {
3320
- id: string;
3348
+ id: EventID;
3321
3349
  created: number;
3322
3350
  metadata?: {
3323
3351
  [x: string]: any;
@@ -3325,19 +3353,19 @@ export type SessionMessageContentUpdated = {
3325
3353
  type: "session.message.content.updated";
3326
3354
  durable: {
3327
3355
  aggregateID: string;
3328
- seq: number;
3356
+ seq: EventSeq;
3329
3357
  version: 1;
3330
3358
  };
3331
3359
  location?: LocationRef;
3332
3360
  data: {
3333
- sessionID: string;
3334
- messageID: string;
3361
+ sessionID: SessionID;
3362
+ messageID: SessionMessageID;
3335
3363
  content: Array<SessionMessageAssistantContentEncoded>;
3336
3364
  };
3337
3365
  };
3338
3366
  export type IntegrationMethod = IntegrationOAuthMethod | IntegrationCommandMethod | IntegrationKeyMethod | IntegrationExternalMethod | IntegrationEnvMethod;
3339
3367
  export type FormCreated = {
3340
- id: string;
3368
+ id: EventID;
3341
3369
  created: number;
3342
3370
  metadata?: {
3343
3371
  [x: string]: any;
@@ -3361,7 +3389,7 @@ export type SessionMessagesResponse = {
3361
3389
  };
3362
3390
  export type SessionEventDurable = SessionCreated | SessionAgentSelected | SessionModelSelected | SessionMoved | SessionRenamed | SessionMetadataUpdated | SessionPermissions | SessionViewed | SessionDeleted | SessionForked | SessionInboxDelivered | SessionInboxEnqueued | SessionInboxCancelled | SessionInboxDeliveryChanged | SessionExecutionStarted | SessionExecutionSucceeded | SessionExecutionFailed | SessionExecutionInterrupted | SessionInstructionsUpdated | SessionSynthetic | SessionSkillActivated | SessionShellStarted | SessionShellEnded | SessionStepStarted | SessionStepStreamed | SessionStepEnded | SessionStepFailed | SessionTextStarted | SessionTextEnded | SessionReasoningStarted | SessionReasoningEnded | SessionToolInputStarted | SessionToolInputEnded | SessionToolCalled | SessionToolSuccess | SessionToolFailed | SessionRetryScheduled | SessionCompactionStarted | SessionCompactionEnded | SessionCompactionFailed | SessionRevertStaged | SessionRevertCleared | SessionRevertCommitted | SessionUsageRecorded | SessionMessageContentUpdated;
3363
3391
  export type IntegrationInfo = {
3364
- id: string;
3392
+ id: IntegrationID;
3365
3393
  name: string;
3366
3394
  metadata?: {
3367
3395
  [x: string]: any;
@@ -4437,6 +4465,14 @@ export type SessionImportInput = {
4437
4465
  };
4438
4466
  readonly type: "idle";
4439
4467
  readonly outcome: "succeeded" | "failed" | "interrupted";
4468
+ readonly error?: {
4469
+ readonly type: string;
4470
+ readonly message: string;
4471
+ readonly status?: number;
4472
+ readonly response?: {
4473
+ readonly body: string;
4474
+ };
4475
+ };
4440
4476
  }>;
4441
4477
  readonly location?: {
4442
4478
  readonly directory: string;
@@ -4918,6 +4954,14 @@ export type SessionImportInput = {
4918
4954
  };
4919
4955
  readonly type: "idle";
4920
4956
  readonly outcome: "succeeded" | "failed" | "interrupted";
4957
+ readonly error?: {
4958
+ readonly type: string;
4959
+ readonly message: string;
4960
+ readonly status?: number;
4961
+ readonly response?: {
4962
+ readonly body: string;
4963
+ };
4964
+ };
4921
4965
  }>;
4922
4966
  readonly location?: {
4923
4967
  readonly directory: string;
@@ -5399,6 +5443,14 @@ export type SessionImportInput = {
5399
5443
  };
5400
5444
  readonly type: "idle";
5401
5445
  readonly outcome: "succeeded" | "failed" | "interrupted";
5446
+ readonly error?: {
5447
+ readonly type: string;
5448
+ readonly message: string;
5449
+ readonly status?: number;
5450
+ readonly response?: {
5451
+ readonly body: string;
5452
+ };
5453
+ };
5402
5454
  }>;
5403
5455
  readonly location?: {
5404
5456
  readonly directory: string;
@@ -5421,7 +5473,7 @@ export type SessionExportOutput = {
5421
5473
  }["data"];
5422
5474
  export type SessionActiveOutput = {
5423
5475
  data: {
5424
- [x: string]: SessionActive;
5476
+ [x: SessionID]: SessionActive;
5425
5477
  };
5426
5478
  }["data"];
5427
5479
  export type SessionGetInput = {
@@ -7805,6 +7857,11 @@ export type CredentialRemoveInput = {
7805
7857
  }["credentialID"];
7806
7858
  };
7807
7859
  export type CredentialRemoveOutput = void;
7860
+ export type ProjectListInput = {
7861
+ readonly archived?: {
7862
+ readonly archived?: boolean | undefined;
7863
+ }["archived"];
7864
+ };
7808
7865
  export type ProjectListOutput = Array<Project>;
7809
7866
  export type ProjectUpdateInput = {
7810
7867
  readonly projectID: {
@@ -8008,7 +8065,7 @@ export type PermissionCreateInput = {
8008
8065
  };
8009
8066
  export type PermissionCreateOutput = {
8010
8067
  data: {
8011
- id: string;
8068
+ id: PermissionID;
8012
8069
  effect: PermissionEffect;
8013
8070
  };
8014
8071
  }["data"];
@@ -8836,7 +8893,7 @@ export type WebsearchQueryInput = {
8836
8893
  export type WebsearchQueryOutput = {
8837
8894
  location: LocationPublicRef;
8838
8895
  data: {
8839
- providerID: string;
8896
+ providerID: WebSearchID;
8840
8897
  results: Array<WebSearchResult>;
8841
8898
  };
8842
8899
  };