@opencode-ai/sdk 1.17.10 → 1.17.12

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.
@@ -1,7 +1,7 @@
1
1
  export type ClientOptions = {
2
2
  baseUrl: `${string}://${string}` | (string & {});
3
3
  };
4
- export type Event = EventModelsDevRefreshed | EventIntegrationUpdated | EventIntegrationConnectionUpdated | EventCatalogUpdated | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventSessionNextAgentSwitched | EventSessionNextModelSwitched | EventSessionNextMoved | EventSessionNextPrompted | EventSessionNextPromptAdmitted | EventSessionNextContextUpdated | EventSessionNextSynthetic | EventSessionNextShellStarted | EventSessionNextShellEnded | EventSessionNextStepStarted | EventSessionNextStepEnded | EventSessionNextStepFailed | EventSessionNextTextStarted | EventSessionNextTextDelta | EventSessionNextTextEnded | EventSessionNextReasoningStarted | EventSessionNextReasoningDelta | EventSessionNextReasoningEnded | EventSessionNextToolInputStarted | EventSessionNextToolInputDelta | EventSessionNextToolInputEnded | EventSessionNextToolCalled | EventSessionNextToolProgress | EventSessionNextToolSuccess | EventSessionNextToolFailed | EventSessionNextRetried | EventSessionNextCompactionStarted | EventSessionNextCompactionDelta | EventSessionNextCompactionEnded | EventMessagePartDelta | EventSessionDiff | EventSessionError | EventInstallationUpdated | EventInstallationUpdateAvailable | EventFileEdited | EventReferenceUpdated | EventPermissionV2Asked | EventPermissionV2Replied | EventPluginAdded | EventProjectDirectoriesUpdated | EventFileWatcherUpdated | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventQuestionV2Asked | EventQuestionV2Replied | EventQuestionV2Rejected | EventTodoUpdated | EventLspUpdated | EventPermissionAsked | EventPermissionReplied | EventTuiPromptAppend2 | EventTuiCommandExecute2 | EventTuiToastShow2 | EventTuiSessionSelect2 | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventCommandExecuted | EventProjectUpdated | EventSessionStatus | EventSessionIdle | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventSessionCompacted | EventVcsBranchUpdated | EventWorkspaceReady | EventWorkspaceFailed | EventWorkspaceStatus | EventWorktreeReady | EventWorktreeFailed | EventServerConnected | EventGlobalDisposed | EventServerInstanceDisposed;
4
+ export type Event = EventModelsDevRefreshed | EventIntegrationUpdated | EventIntegrationConnectionUpdated | EventCatalogUpdated | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventSessionNextAgentSwitched | EventSessionNextModelSwitched | EventSessionNextMoved | EventSessionNextPrompted | EventSessionNextPromptAdmitted | EventSessionNextContextUpdated | EventSessionNextSynthetic | EventSessionNextShellStarted | EventSessionNextShellEnded | EventSessionNextStepStarted | EventSessionNextStepEnded | EventSessionNextStepFailed | EventSessionNextTextStarted | EventSessionNextTextDelta | EventSessionNextTextEnded | EventSessionNextReasoningStarted | EventSessionNextReasoningDelta | EventSessionNextReasoningEnded | EventSessionNextToolInputStarted | EventSessionNextToolInputDelta | EventSessionNextToolInputEnded | EventSessionNextToolCalled | EventSessionNextToolProgress | EventSessionNextToolSuccess | EventSessionNextToolFailed | EventSessionNextRetried | EventSessionNextCompactionStarted | EventSessionNextCompactionDelta | EventSessionNextCompactionEnded | EventSessionNextRevertStaged | EventSessionNextRevertCleared | EventSessionNextRevertCommitted | EventMessagePartDelta | EventSessionDiff | EventSessionError | EventInstallationUpdated | EventInstallationUpdateAvailable | EventFileEdited | EventReferenceUpdated | EventPermissionV2Asked | EventPermissionV2Replied | EventPluginAdded | EventProjectDirectoriesUpdated | EventFileWatcherUpdated | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventQuestionV2Asked | EventQuestionV2Replied | EventQuestionV2Rejected | EventTodoUpdated | EventLspUpdated | EventPermissionAsked | EventPermissionReplied | EventTuiPromptAppend2 | EventTuiCommandExecute2 | EventTuiToastShow2 | EventTuiSessionSelect2 | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventCommandExecuted | EventProjectUpdated | EventSessionStatus | EventSessionIdle | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventSessionCompacted | EventVcsBranchUpdated | EventWorkspaceReady | EventWorkspaceFailed | EventWorkspaceStatus | EventWorktreeReady | EventWorktreeFailed | EventServerConnected | EventGlobalDisposed | EventServerInstanceDisposed;
5
5
  export type QuestionReplied = {
6
6
  sessionID: string;
7
7
  requestID: string;
@@ -645,11 +645,7 @@ export type GlobalEvent = {
645
645
  timestamp: number;
646
646
  sessionID: string;
647
647
  messageID: string;
648
- model: {
649
- id: string;
650
- providerID: string;
651
- variant?: string;
652
- };
648
+ model: ModelRef;
653
649
  };
654
650
  } | {
655
651
  id: string;
@@ -725,11 +721,7 @@ export type GlobalEvent = {
725
721
  sessionID: string;
726
722
  assistantMessageID: string;
727
723
  agent: string;
728
- model: {
729
- id: string;
730
- providerID: string;
731
- variant?: string;
732
- };
724
+ model: ModelRef;
733
725
  snapshot?: string;
734
726
  };
735
727
  } | {
@@ -751,6 +743,7 @@ export type GlobalEvent = {
751
743
  };
752
744
  };
753
745
  snapshot?: string;
746
+ files?: Array<string>;
754
747
  };
755
748
  } | {
756
749
  id: string;
@@ -798,11 +791,7 @@ export type GlobalEvent = {
798
791
  sessionID: string;
799
792
  assistantMessageID: string;
800
793
  reasoningID: string;
801
- providerMetadata?: {
802
- [key: string]: {
803
- [key: string]: unknown;
804
- };
805
- };
794
+ providerMetadata?: LlmProviderMetadata;
806
795
  };
807
796
  } | {
808
797
  id: string;
@@ -823,11 +812,7 @@ export type GlobalEvent = {
823
812
  assistantMessageID: string;
824
813
  reasoningID: string;
825
814
  text: string;
826
- providerMetadata?: {
827
- [key: string]: {
828
- [key: string]: unknown;
829
- };
830
- };
815
+ providerMetadata?: LlmProviderMetadata;
831
816
  };
832
817
  } | {
833
818
  id: string;
@@ -873,11 +858,7 @@ export type GlobalEvent = {
873
858
  };
874
859
  provider: {
875
860
  executed: boolean;
876
- metadata?: {
877
- [key: string]: {
878
- [key: string]: unknown;
879
- };
880
- };
861
+ metadata?: LlmProviderMetadata;
881
862
  };
882
863
  };
883
864
  } | {
@@ -891,7 +872,7 @@ export type GlobalEvent = {
891
872
  structured: {
892
873
  [key: string]: unknown;
893
874
  };
894
- content: Array<ToolTextContent | ToolFileContent>;
875
+ content: Array<LlmToolContent>;
895
876
  };
896
877
  } | {
897
878
  id: string;
@@ -904,16 +885,12 @@ export type GlobalEvent = {
904
885
  structured: {
905
886
  [key: string]: unknown;
906
887
  };
907
- content: Array<ToolTextContent | ToolFileContent>;
888
+ content: Array<LlmToolContent>;
908
889
  outputPaths?: Array<string>;
909
890
  result?: unknown;
910
891
  provider: {
911
892
  executed: boolean;
912
- metadata?: {
913
- [key: string]: {
914
- [key: string]: unknown;
915
- };
916
- };
893
+ metadata?: LlmProviderMetadata;
917
894
  };
918
895
  };
919
896
  } | {
@@ -928,11 +905,7 @@ export type GlobalEvent = {
928
905
  result?: unknown;
929
906
  provider: {
930
907
  executed: boolean;
931
- metadata?: {
932
- [key: string]: {
933
- [key: string]: unknown;
934
- };
935
- };
908
+ metadata?: LlmProviderMetadata;
936
909
  };
937
910
  };
938
911
  } | {
@@ -973,6 +946,29 @@ export type GlobalEvent = {
973
946
  text: string;
974
947
  recent: string;
975
948
  };
949
+ } | {
950
+ id: string;
951
+ type: "session.next.revert.staged";
952
+ properties: {
953
+ timestamp: number;
954
+ sessionID: string;
955
+ revert: RevertState;
956
+ };
957
+ } | {
958
+ id: string;
959
+ type: "session.next.revert.cleared";
960
+ properties: {
961
+ timestamp: number;
962
+ sessionID: string;
963
+ };
964
+ } | {
965
+ id: string;
966
+ type: "session.next.revert.committed";
967
+ properties: {
968
+ timestamp: number;
969
+ sessionID: string;
970
+ messageID: string;
971
+ };
976
972
  } | {
977
973
  id: string;
978
974
  type: "message.part.delta";
@@ -1210,24 +1206,11 @@ export type GlobalEvent = {
1210
1206
  properties: {
1211
1207
  id: string;
1212
1208
  worktree: string;
1213
- vcs?: "git";
1209
+ vcs?: ProjectVcs;
1214
1210
  name?: string;
1215
- icon?: {
1216
- url?: string;
1217
- override?: string;
1218
- color?: string;
1219
- };
1220
- commands?: {
1221
- /**
1222
- * Startup script to run when creating a new workspace (worktree)
1223
- */
1224
- start?: string;
1225
- };
1226
- time: {
1227
- created: number;
1228
- updated: number;
1229
- initialized?: number;
1230
- };
1211
+ icon?: ProjectIcon;
1212
+ commands?: ProjectCommands;
1213
+ time: ProjectTime;
1231
1214
  sandboxes: Array<string>;
1232
1215
  };
1233
1216
  } | {
@@ -1326,7 +1309,7 @@ export type GlobalEvent = {
1326
1309
  properties: {
1327
1310
  [key: string]: unknown;
1328
1311
  };
1329
- } | EventServerInstanceDisposed | SyncEventSessionCreated | SyncEventSessionUpdated | SyncEventSessionDeleted | SyncEventMessageUpdated | SyncEventMessageRemoved | SyncEventMessagePartUpdated | SyncEventMessagePartRemoved | SyncEventSessionNextAgentSwitched | SyncEventSessionNextModelSwitched | SyncEventSessionNextMoved | SyncEventSessionNextPrompted | SyncEventSessionNextPromptAdmitted | SyncEventSessionNextContextUpdated | SyncEventSessionNextSynthetic | SyncEventSessionNextShellStarted | SyncEventSessionNextShellEnded | SyncEventSessionNextStepStarted | SyncEventSessionNextStepEnded | SyncEventSessionNextStepFailed | SyncEventSessionNextTextStarted | SyncEventSessionNextTextEnded | SyncEventSessionNextReasoningStarted | SyncEventSessionNextReasoningEnded | SyncEventSessionNextToolInputStarted | SyncEventSessionNextToolInputEnded | SyncEventSessionNextToolCalled | SyncEventSessionNextToolProgress | SyncEventSessionNextToolSuccess | SyncEventSessionNextToolFailed | SyncEventSessionNextRetried | SyncEventSessionNextCompactionStarted | SyncEventSessionNextCompactionEnded;
1312
+ } | EventServerInstanceDisposed | SyncEventSessionCreated | SyncEventSessionUpdated | SyncEventSessionDeleted | SyncEventMessageUpdated | SyncEventMessageRemoved | SyncEventMessagePartUpdated | SyncEventMessagePartRemoved | SyncEventSessionNextAgentSwitched | SyncEventSessionNextModelSwitched | SyncEventSessionNextMoved | SyncEventSessionNextPrompted | SyncEventSessionNextPromptAdmitted | SyncEventSessionNextContextUpdated | SyncEventSessionNextSynthetic | SyncEventSessionNextShellStarted | SyncEventSessionNextShellEnded | SyncEventSessionNextStepStarted | SyncEventSessionNextStepEnded | SyncEventSessionNextStepFailed | SyncEventSessionNextTextStarted | SyncEventSessionNextTextEnded | SyncEventSessionNextReasoningStarted | SyncEventSessionNextReasoningEnded | SyncEventSessionNextToolInputStarted | SyncEventSessionNextToolInputEnded | SyncEventSessionNextToolCalled | SyncEventSessionNextToolProgress | SyncEventSessionNextToolSuccess | SyncEventSessionNextToolFailed | SyncEventSessionNextRetried | SyncEventSessionNextCompactionStarted | SyncEventSessionNextCompactionEnded | SyncEventSessionNextRevertStaged | SyncEventSessionNextRevertCleared | SyncEventSessionNextRevertCommitted;
1330
1313
  };
1331
1314
  /**
1332
1315
  * Log level
@@ -2007,24 +1990,11 @@ export type McpServerNotFoundError = {
2007
1990
  export type Project = {
2008
1991
  id: string;
2009
1992
  worktree: string;
2010
- vcs?: "git";
1993
+ vcs?: ProjectVcs;
2011
1994
  name?: string;
2012
- icon?: {
2013
- url?: string;
2014
- override?: string;
2015
- color?: string;
2016
- };
2017
- commands?: {
2018
- /**
2019
- * Startup script to run when creating a new workspace (worktree)
2020
- */
2021
- start?: string;
2022
- };
2023
- time: {
2024
- created: number;
2025
- updated: number;
2026
- initialized?: number;
2027
- };
1995
+ icon?: ProjectIcon;
1996
+ commands?: ProjectCommands;
1997
+ time: ProjectTime;
2028
1998
  sandboxes: Array<string>;
2029
1999
  };
2030
2000
  export type ProjectNotFoundError = {
@@ -2239,11 +2209,19 @@ export type InvalidCursorError = {
2239
2209
  _tag: "InvalidCursorError";
2240
2210
  message: string;
2241
2211
  };
2212
+ export type SessionActive = {
2213
+ type: "running";
2214
+ };
2242
2215
  export type SessionNotFoundError = {
2243
2216
  _tag: "SessionNotFoundError";
2244
2217
  sessionID: string;
2245
2218
  message: string;
2246
2219
  };
2220
+ export type PromptInput = {
2221
+ text: string;
2222
+ files?: Array<PromptInputFileAttachment>;
2223
+ agents?: Array<PromptAgentAttachment>;
2224
+ };
2247
2225
  export type ConflictError = {
2248
2226
  _tag: "ConflictError";
2249
2227
  message: string;
@@ -2254,11 +2232,23 @@ export type ServiceUnavailableError = {
2254
2232
  message: string;
2255
2233
  service?: string;
2256
2234
  };
2235
+ export type MessageNotFoundError = {
2236
+ _tag: "MessageNotFoundError";
2237
+ sessionID: string;
2238
+ messageID: string;
2239
+ message: string;
2240
+ };
2257
2241
  export type UnknownError1 = {
2258
2242
  _tag: "UnknownError";
2259
2243
  message: string;
2260
2244
  ref?: string;
2261
2245
  };
2246
+ export type SessionDurableEvent = SessionNextAgentSwitched | SessionNextModelSwitched | SessionNextMoved | SessionNextPrompted | SessionNextPromptAdmitted | SessionNextContextUpdated | SessionNextSynthetic | SessionNextShellStarted | SessionNextShellEnded | SessionNextStepStarted | SessionNextStepEnded | SessionNextStepFailed | SessionNextTextStarted | SessionNextTextEnded | SessionNextToolInputStarted | SessionNextToolInputEnded | SessionNextToolCalled | SessionNextToolProgress | SessionNextToolSuccess | SessionNextToolFailed | SessionNextReasoningStarted | SessionNextReasoningEnded | SessionNextRetried | SessionNextCompactionStarted | SessionNextCompactionEnded | SessionNextRevertStaged | SessionNextRevertCleared | SessionNextRevertCommitted;
2247
+ export type SessionHistory = {
2248
+ data: Array<SessionDurableEvent>;
2249
+ hasMore: boolean;
2250
+ };
2251
+ export type SessionDurableEventStream = string;
2262
2252
  export type SessionMessagesResponse = {
2263
2253
  data: Array<SessionMessage>;
2264
2254
  cursor: {
@@ -2271,7 +2261,67 @@ export type ProviderNotFoundError = {
2271
2261
  providerID: string;
2272
2262
  message: string;
2273
2263
  };
2274
- export type V2Event = V2EventModelsDevRefreshed | V2EventIntegrationUpdated | V2EventIntegrationConnectionUpdated | V2EventCatalogUpdated | V2EventSessionCreated | V2EventSessionUpdated | V2EventSessionDeleted | V2EventMessageUpdated | V2EventMessageRemoved | V2EventMessagePartUpdated | V2EventMessagePartRemoved | V2EventSessionNextAgentSwitched | V2EventSessionNextModelSwitched | V2EventSessionNextMoved | V2EventSessionNextPrompted | V2EventSessionNextPromptAdmitted | V2EventSessionNextContextUpdated | V2EventSessionNextSynthetic | V2EventSessionNextShellStarted | V2EventSessionNextShellEnded | V2EventSessionNextStepStarted | V2EventSessionNextStepEnded | V2EventSessionNextStepFailed | V2EventSessionNextTextStarted | V2EventSessionNextTextDelta | V2EventSessionNextTextEnded | V2EventSessionNextReasoningStarted | V2EventSessionNextReasoningDelta | V2EventSessionNextReasoningEnded | V2EventSessionNextToolInputStarted | V2EventSessionNextToolInputDelta | V2EventSessionNextToolInputEnded | V2EventSessionNextToolCalled | V2EventSessionNextToolProgress | V2EventSessionNextToolSuccess | V2EventSessionNextToolFailed | V2EventSessionNextRetried | V2EventSessionNextCompactionStarted | V2EventSessionNextCompactionDelta | V2EventSessionNextCompactionEnded | V2EventMessagePartDelta | V2EventSessionDiff | V2EventSessionError | V2EventInstallationUpdated | V2EventInstallationUpdateAvailable | V2EventFileEdited | V2EventReferenceUpdated | V2EventPermissionV2Asked | V2EventPermissionV2Replied | V2EventPluginAdded | V2EventProjectDirectoriesUpdated | V2EventFileWatcherUpdated | V2EventPtyCreated | V2EventPtyUpdated | V2EventPtyExited | V2EventPtyDeleted | V2EventQuestionV2Asked | V2EventQuestionV2Replied | V2EventQuestionV2Rejected | V2EventTodoUpdated | V2EventLspUpdated | V2EventPermissionAsked | V2EventPermissionReplied | V2EventTuiPromptAppend | V2EventTuiCommandExecute | V2EventTuiToastShow | V2EventTuiSessionSelect | V2EventMcpToolsChanged | V2EventMcpBrowserOpenFailed | V2EventCommandExecuted | V2EventProjectUpdated | V2EventSessionStatus | V2EventSessionIdle | V2EventQuestionAsked | V2EventQuestionReplied | V2EventQuestionRejected | V2EventSessionCompacted | V2EventVcsBranchUpdated | V2EventWorkspaceReady | V2EventWorkspaceFailed | V2EventWorkspaceStatus | V2EventWorktreeReady | V2EventWorktreeFailed | V2EventServerConnected | V2EventGlobalDisposed;
2264
+ export type OutputFormat1 = {
2265
+ type: "text";
2266
+ } | {
2267
+ type: "json_schema";
2268
+ schema: JsonSchema;
2269
+ retryCount?: number;
2270
+ };
2271
+ export type SessionStatus2 = {
2272
+ id: string;
2273
+ metadata?: {
2274
+ [key: string]: unknown;
2275
+ };
2276
+ type: "session.status";
2277
+ durable?: {
2278
+ aggregateID: string;
2279
+ seq: number;
2280
+ version: number;
2281
+ };
2282
+ location?: LocationRef;
2283
+ data: {
2284
+ sessionID: string;
2285
+ status: SessionStatus;
2286
+ };
2287
+ };
2288
+ export type QuestionReplied2 = {
2289
+ id: string;
2290
+ metadata?: {
2291
+ [key: string]: unknown;
2292
+ };
2293
+ type: "question.replied";
2294
+ durable?: {
2295
+ aggregateID: string;
2296
+ seq: number;
2297
+ version: number;
2298
+ };
2299
+ location?: LocationRef;
2300
+ data: {
2301
+ sessionID: string;
2302
+ requestID: string;
2303
+ answers: Array<QuestionAnswer>;
2304
+ };
2305
+ };
2306
+ export type QuestionRejected2 = {
2307
+ id: string;
2308
+ metadata?: {
2309
+ [key: string]: unknown;
2310
+ };
2311
+ type: "question.rejected";
2312
+ durable?: {
2313
+ aggregateID: string;
2314
+ seq: number;
2315
+ version: number;
2316
+ };
2317
+ location?: LocationRef;
2318
+ data: {
2319
+ sessionID: string;
2320
+ requestID: string;
2321
+ };
2322
+ };
2323
+ export type V2Event = ModelsDevRefreshed | IntegrationUpdated | IntegrationConnectionUpdated | CatalogUpdated | SessionCreated | SessionUpdated | SessionDeleted | MessageUpdated | MessageRemoved | MessagePartUpdated | MessagePartRemoved | SessionNextAgentSwitched | SessionNextModelSwitched | SessionNextMoved | SessionNextPrompted | SessionNextPromptAdmitted | SessionNextContextUpdated | SessionNextSynthetic | SessionNextShellStarted | SessionNextShellEnded | SessionNextStepStarted | SessionNextStepEnded | SessionNextStepFailed | SessionNextTextStarted | SessionNextTextDelta | SessionNextTextEnded | SessionNextReasoningStarted | SessionNextReasoningDelta | SessionNextReasoningEnded | SessionNextToolInputStarted | SessionNextToolInputDelta | SessionNextToolInputEnded | SessionNextToolCalled | SessionNextToolProgress | SessionNextToolSuccess | SessionNextToolFailed | SessionNextRetried | SessionNextCompactionStarted | SessionNextCompactionDelta | SessionNextCompactionEnded | SessionNextRevertStaged | SessionNextRevertCleared | SessionNextRevertCommitted | MessagePartDelta | SessionDiff | SessionError | InstallationUpdated | InstallationUpdateAvailable | FileEdited | ReferenceUpdated | PermissionV2Asked | PermissionV2Replied | PluginAdded | ProjectDirectoriesUpdated | FileWatcherUpdated | PtyCreated | PtyUpdated | PtyExited | PtyDeleted | QuestionV2Asked | QuestionV2Replied | QuestionV2Rejected | TodoUpdated | LspUpdated | PermissionAsked | PermissionReplied | TuiPromptAppend | TuiCommandExecute | TuiToastShow | TuiSessionSelect | McpToolsChanged | McpBrowserOpenFailed | CommandExecuted | ProjectUpdated | SessionStatus2 | SessionIdle | QuestionAsked | QuestionReplied2 | QuestionRejected2 | SessionCompacted | VcsBranchUpdated | WorkspaceReady | WorkspaceFailed | WorkspaceStatus | WorktreeReady | WorktreeFailed | ServerConnected | GlobalDisposed;
2324
+ export type V2EventStream = string;
2275
2325
  export type ForbiddenError = {
2276
2326
  _tag: "ForbiddenError";
2277
2327
  message: string;
@@ -2333,6 +2383,11 @@ export type SkillV2Source = SkillV2DirectorySource | SkillV2UrlSource | SkillV2E
2333
2383
  export type MoveSessionDestination = {
2334
2384
  directory: string;
2335
2385
  };
2386
+ export type ModelRef = {
2387
+ id: string;
2388
+ providerID: string;
2389
+ variant?: string;
2390
+ };
2336
2391
  export type LocationRef = {
2337
2392
  directory: string;
2338
2393
  workspaceID?: string;
@@ -2357,6 +2412,11 @@ export type SessionErrorUnknown = {
2357
2412
  type: "unknown";
2358
2413
  message: string;
2359
2414
  };
2415
+ export type LlmProviderMetadata = {
2416
+ [key: string]: {
2417
+ [key: string]: unknown;
2418
+ };
2419
+ };
2360
2420
  export type ToolTextContent = {
2361
2421
  type: "text";
2362
2422
  text: string;
@@ -2367,6 +2427,7 @@ export type ToolFileContent = {
2367
2427
  mime: string;
2368
2428
  name?: string;
2369
2429
  };
2430
+ export type LlmToolContent = ToolTextContent | ToolFileContent;
2370
2431
  export type SessionNextRetryError = {
2371
2432
  message: string;
2372
2433
  statusCode?: number;
@@ -2379,6 +2440,20 @@ export type SessionNextRetryError = {
2379
2440
  [key: string]: string;
2380
2441
  };
2381
2442
  };
2443
+ export type FileDiff = {
2444
+ path: string;
2445
+ status: "added" | "modified" | "deleted";
2446
+ additions: number;
2447
+ deletions: number;
2448
+ patch: string;
2449
+ };
2450
+ export type RevertState = {
2451
+ messageID: string;
2452
+ partID?: string;
2453
+ snapshot?: string;
2454
+ diff?: string;
2455
+ files?: Array<FileDiff>;
2456
+ };
2382
2457
  export type PermissionV2Source = {
2383
2458
  type: "tool";
2384
2459
  messageID: string;
@@ -2416,6 +2491,23 @@ export type QuestionV2Tool = {
2416
2491
  callID: string;
2417
2492
  };
2418
2493
  export type QuestionV2Answer = Array<string>;
2494
+ export type ProjectVcs = "git";
2495
+ export type ProjectIcon = {
2496
+ url?: string;
2497
+ override?: string;
2498
+ color?: string;
2499
+ };
2500
+ export type ProjectCommands = {
2501
+ /**
2502
+ * Startup script to run when creating a new workspace (worktree)
2503
+ */
2504
+ start?: string;
2505
+ };
2506
+ export type ProjectTime = {
2507
+ created: number;
2508
+ updated: number;
2509
+ initialized?: number;
2510
+ };
2419
2511
  export type EventServerInstanceDisposed = {
2420
2512
  id: string;
2421
2513
  type: "server.instance.disposed";
@@ -2551,11 +2643,7 @@ export type SyncEventSessionNextModelSwitched = {
2551
2643
  timestamp: number;
2552
2644
  sessionID: string;
2553
2645
  messageID: string;
2554
- model: {
2555
- id: string;
2556
- providerID: string;
2557
- variant?: string;
2558
- };
2646
+ model: ModelRef;
2559
2647
  };
2560
2648
  };
2561
2649
  };
@@ -2687,11 +2775,7 @@ export type SyncEventSessionNextStepStarted = {
2687
2775
  sessionID: string;
2688
2776
  assistantMessageID: string;
2689
2777
  agent: string;
2690
- model: {
2691
- id: string;
2692
- providerID: string;
2693
- variant?: string;
2694
- };
2778
+ model: ModelRef;
2695
2779
  snapshot?: string;
2696
2780
  };
2697
2781
  };
@@ -2720,6 +2804,7 @@ export type SyncEventSessionNextStepEnded = {
2720
2804
  };
2721
2805
  };
2722
2806
  snapshot?: string;
2807
+ files?: Array<string>;
2723
2808
  };
2724
2809
  };
2725
2810
  };
@@ -2785,11 +2870,7 @@ export type SyncEventSessionNextReasoningStarted = {
2785
2870
  sessionID: string;
2786
2871
  assistantMessageID: string;
2787
2872
  reasoningID: string;
2788
- providerMetadata?: {
2789
- [key: string]: {
2790
- [key: string]: unknown;
2791
- };
2792
- };
2873
+ providerMetadata?: LlmProviderMetadata;
2793
2874
  };
2794
2875
  };
2795
2876
  };
@@ -2807,11 +2888,7 @@ export type SyncEventSessionNextReasoningEnded = {
2807
2888
  assistantMessageID: string;
2808
2889
  reasoningID: string;
2809
2890
  text: string;
2810
- providerMetadata?: {
2811
- [key: string]: {
2812
- [key: string]: unknown;
2813
- };
2814
- };
2891
+ providerMetadata?: LlmProviderMetadata;
2815
2892
  };
2816
2893
  };
2817
2894
  };
@@ -2868,11 +2945,7 @@ export type SyncEventSessionNextToolCalled = {
2868
2945
  };
2869
2946
  provider: {
2870
2947
  executed: boolean;
2871
- metadata?: {
2872
- [key: string]: {
2873
- [key: string]: unknown;
2874
- };
2875
- };
2948
+ metadata?: LlmProviderMetadata;
2876
2949
  };
2877
2950
  };
2878
2951
  };
@@ -2893,7 +2966,7 @@ export type SyncEventSessionNextToolProgress = {
2893
2966
  structured: {
2894
2967
  [key: string]: unknown;
2895
2968
  };
2896
- content: Array<ToolTextContent | ToolFileContent>;
2969
+ content: Array<LlmToolContent>;
2897
2970
  };
2898
2971
  };
2899
2972
  };
@@ -2913,16 +2986,12 @@ export type SyncEventSessionNextToolSuccess = {
2913
2986
  structured: {
2914
2987
  [key: string]: unknown;
2915
2988
  };
2916
- content: Array<ToolTextContent | ToolFileContent>;
2989
+ content: Array<LlmToolContent>;
2917
2990
  outputPaths?: Array<string>;
2918
2991
  result?: unknown;
2919
2992
  provider: {
2920
2993
  executed: boolean;
2921
- metadata?: {
2922
- [key: string]: {
2923
- [key: string]: unknown;
2924
- };
2925
- };
2994
+ metadata?: LlmProviderMetadata;
2926
2995
  };
2927
2996
  };
2928
2997
  };
@@ -2944,11 +3013,7 @@ export type SyncEventSessionNextToolFailed = {
2944
3013
  result?: unknown;
2945
3014
  provider: {
2946
3015
  executed: boolean;
2947
- metadata?: {
2948
- [key: string]: {
2949
- [key: string]: unknown;
2950
- };
2951
- };
3016
+ metadata?: LlmProviderMetadata;
2952
3017
  };
2953
3018
  };
2954
3019
  };
@@ -3003,6 +3068,50 @@ export type SyncEventSessionNextCompactionEnded = {
3003
3068
  };
3004
3069
  };
3005
3070
  };
3071
+ export type SyncEventSessionNextRevertStaged = {
3072
+ type: "sync";
3073
+ id: string;
3074
+ syncEvent: {
3075
+ type: "session.next.revert.staged.1";
3076
+ id: string;
3077
+ seq: number;
3078
+ aggregateID: string;
3079
+ data: {
3080
+ timestamp: number;
3081
+ sessionID: string;
3082
+ revert: RevertState;
3083
+ };
3084
+ };
3085
+ };
3086
+ export type SyncEventSessionNextRevertCleared = {
3087
+ type: "sync";
3088
+ id: string;
3089
+ syncEvent: {
3090
+ type: "session.next.revert.cleared.1";
3091
+ id: string;
3092
+ seq: number;
3093
+ aggregateID: string;
3094
+ data: {
3095
+ timestamp: number;
3096
+ sessionID: string;
3097
+ };
3098
+ };
3099
+ };
3100
+ export type SyncEventSessionNextRevertCommitted = {
3101
+ type: "sync";
3102
+ id: string;
3103
+ syncEvent: {
3104
+ type: "session.next.revert.committed.1";
3105
+ id: string;
3106
+ seq: number;
3107
+ aggregateID: string;
3108
+ data: {
3109
+ timestamp: number;
3110
+ sessionID: string;
3111
+ messageID: string;
3112
+ };
3113
+ };
3114
+ };
3006
3115
  export type ConfigV2ReferenceGit = {
3007
3116
  repository: string;
3008
3117
  branch?: string;
@@ -3024,6 +3133,14 @@ export type ProjectDirectories = Array<{
3024
3133
  directory: string;
3025
3134
  strategy?: string;
3026
3135
  }>;
3136
+ export type PtyTicketConnectToken = {
3137
+ ticket: string;
3138
+ expires_in: number;
3139
+ };
3140
+ export type WorkspaceEventConnectionStatus = {
3141
+ workspaceID: string;
3142
+ status: "connected" | "connecting" | "disconnected" | "error";
3143
+ };
3027
3144
  export type LocationInfo = {
3028
3145
  directory: string;
3029
3146
  workspaceID?: string;
@@ -3032,6 +3149,15 @@ export type LocationInfo = {
3032
3149
  directory: string;
3033
3150
  };
3034
3151
  };
3152
+ export type ProviderRequest = {
3153
+ headers: {
3154
+ [key: string]: string;
3155
+ };
3156
+ body: {
3157
+ [key: string]: unknown;
3158
+ };
3159
+ };
3160
+ export type AgentColor = string | "primary" | "secondary" | "accent" | "success" | "warning" | "error" | "info";
3035
3161
  export type PermissionV2Effect = "allow" | "deny" | "ask";
3036
3162
  export type PermissionV2Rule = {
3037
3163
  action: string;
@@ -3041,24 +3167,13 @@ export type PermissionV2Rule = {
3041
3167
  export type PermissionV2Ruleset = Array<PermissionV2Rule>;
3042
3168
  export type AgentV2Info = {
3043
3169
  id: string;
3044
- model?: {
3045
- id: string;
3046
- providerID: string;
3047
- variant?: string;
3048
- };
3049
- request: {
3050
- headers: {
3051
- [key: string]: string;
3052
- };
3053
- body: {
3054
- [key: string]: unknown;
3055
- };
3056
- };
3170
+ model?: ModelRef;
3171
+ request: ProviderRequest;
3057
3172
  system?: string;
3058
3173
  description?: string;
3059
3174
  mode: "subagent" | "primary" | "all";
3060
3175
  hidden: boolean;
3061
- color?: string | "primary" | "secondary" | "accent" | "success" | "warning" | "error" | "info";
3176
+ color?: AgentColor;
3062
3177
  steps?: number;
3063
3178
  permissions: PermissionV2Ruleset;
3064
3179
  };
@@ -3067,11 +3182,7 @@ export type SessionV2Info = {
3067
3182
  parentID?: string;
3068
3183
  projectID: string;
3069
3184
  agent?: string;
3070
- model?: {
3071
- id: string;
3072
- providerID: string;
3073
- variant?: string;
3074
- };
3185
+ model?: ModelRef;
3075
3186
  cost: number;
3076
3187
  tokens: {
3077
3188
  input: number;
@@ -3090,6 +3201,13 @@ export type SessionV2Info = {
3090
3201
  title: string;
3091
3202
  location: LocationRef;
3092
3203
  subpath?: string;
3204
+ revert?: RevertState;
3205
+ };
3206
+ export type PromptInputFileAttachment = {
3207
+ uri: string;
3208
+ name?: string;
3209
+ description?: string;
3210
+ source?: PromptSource;
3093
3211
  };
3094
3212
  export type SessionInputAdmitted = {
3095
3213
  admittedSeq: number;
@@ -3120,11 +3238,7 @@ export type SessionMessageModelSwitched = {
3120
3238
  created: number;
3121
3239
  };
3122
3240
  type: "model-switched";
3123
- model: {
3124
- id: string;
3125
- providerID: string;
3126
- variant?: string;
3127
- };
3241
+ model: ModelRef;
3128
3242
  };
3129
3243
  export type SessionMessageUser = {
3130
3244
  id: string;
@@ -3185,10 +3299,10 @@ export type SessionMessageAssistantReasoning = {
3185
3299
  type: "reasoning";
3186
3300
  id: string;
3187
3301
  text: string;
3188
- providerMetadata?: {
3189
- [key: string]: {
3190
- [key: string]: unknown;
3191
- };
3302
+ providerMetadata?: LlmProviderMetadata;
3303
+ time?: {
3304
+ created: number;
3305
+ completed?: number;
3192
3306
  };
3193
3307
  };
3194
3308
  export type SessionMessageToolStatePending = {
@@ -3203,7 +3317,7 @@ export type SessionMessageToolStateRunning = {
3203
3317
  structured: {
3204
3318
  [key: string]: unknown;
3205
3319
  };
3206
- content: Array<ToolTextContent | ToolFileContent>;
3320
+ content: Array<LlmToolContent>;
3207
3321
  };
3208
3322
  export type SessionMessageToolStateCompleted = {
3209
3323
  status: "completed";
@@ -3211,7 +3325,7 @@ export type SessionMessageToolStateCompleted = {
3211
3325
  [key: string]: unknown;
3212
3326
  };
3213
3327
  attachments?: Array<PromptFileAttachment>;
3214
- content: Array<ToolTextContent | ToolFileContent>;
3328
+ content: Array<LlmToolContent>;
3215
3329
  outputPaths?: Array<string>;
3216
3330
  structured: {
3217
3331
  [key: string]: unknown;
@@ -3223,7 +3337,7 @@ export type SessionMessageToolStateError = {
3223
3337
  input: {
3224
3338
  [key: string]: unknown;
3225
3339
  };
3226
- content: Array<ToolTextContent | ToolFileContent>;
3340
+ content: Array<LlmToolContent>;
3227
3341
  structured: {
3228
3342
  [key: string]: unknown;
3229
3343
  };
@@ -3236,16 +3350,8 @@ export type SessionMessageAssistantTool = {
3236
3350
  name: string;
3237
3351
  provider?: {
3238
3352
  executed: boolean;
3239
- metadata?: {
3240
- [key: string]: {
3241
- [key: string]: unknown;
3242
- };
3243
- };
3244
- resultMetadata?: {
3245
- [key: string]: {
3246
- [key: string]: unknown;
3247
- };
3248
- };
3353
+ metadata?: LlmProviderMetadata;
3354
+ resultMetadata?: LlmProviderMetadata;
3249
3355
  };
3250
3356
  state: SessionMessageToolStatePending | SessionMessageToolStateRunning | SessionMessageToolStateCompleted | SessionMessageToolStateError;
3251
3357
  time: {
@@ -3266,15 +3372,12 @@ export type SessionMessageAssistant = {
3266
3372
  };
3267
3373
  type: "assistant";
3268
3374
  agent: string;
3269
- model: {
3270
- id: string;
3271
- providerID: string;
3272
- variant?: string;
3273
- };
3375
+ model: ModelRef;
3274
3376
  content: Array<SessionMessageAssistantText | SessionMessageAssistantReasoning | SessionMessageAssistantTool>;
3275
3377
  snapshot?: {
3276
3378
  start?: string;
3277
3379
  end?: string;
3380
+ files?: Array<string>;
3278
3381
  };
3279
3382
  finish?: string;
3280
3383
  cost?: number;
@@ -3303,1035 +3406,1082 @@ export type SessionMessageCompaction = {
3303
3406
  };
3304
3407
  };
3305
3408
  export type SessionMessage = SessionMessageAgentSwitched | SessionMessageModelSwitched | SessionMessageUser | SessionMessageSynthetic | SessionMessageSystem | SessionMessageShell | SessionMessageAssistant | SessionMessageCompaction;
3306
- export type ModelV2Info = {
3409
+ export type SessionNextAgentSwitched = {
3307
3410
  id: string;
3308
- providerID: string;
3309
- family?: string;
3310
- name: string;
3311
- api: {
3312
- id: string;
3313
- type: "aisdk";
3314
- package: string;
3315
- url?: string;
3316
- settings?: {
3317
- [key: string]: unknown;
3318
- };
3319
- } | {
3320
- id: string;
3321
- type: "native";
3322
- url?: string;
3323
- settings: {
3324
- [key: string]: unknown;
3325
- };
3411
+ metadata?: {
3412
+ [key: string]: unknown;
3326
3413
  };
3327
- capabilities: {
3328
- tools: boolean;
3329
- input: Array<string>;
3330
- output: Array<string>;
3414
+ type: "session.next.agent.switched";
3415
+ durable?: {
3416
+ aggregateID: string;
3417
+ seq: number;
3418
+ version: number;
3331
3419
  };
3332
- request: {
3333
- headers: {
3334
- [key: string]: string;
3335
- };
3336
- body: {
3337
- [key: string]: unknown;
3338
- };
3339
- variant?: string;
3340
- };
3341
- variants: Array<{
3342
- id: string;
3343
- headers: {
3344
- [key: string]: string;
3345
- };
3346
- body: {
3347
- [key: string]: unknown;
3348
- };
3349
- }>;
3350
- time: {
3351
- released: number;
3352
- };
3353
- cost: Array<{
3354
- tier?: {
3355
- type: "context";
3356
- size: number;
3357
- };
3358
- input: number;
3359
- output: number;
3360
- cache: {
3361
- read: number;
3362
- write: number;
3363
- };
3364
- }>;
3365
- status: "alpha" | "beta" | "deprecated" | "active";
3366
- enabled: boolean;
3367
- limit: {
3368
- context: number;
3369
- input?: number;
3370
- output: number;
3371
- };
3372
- };
3373
- export type ProviderV2Info = {
3374
- id: string;
3375
- integrationID?: string;
3376
- name: string;
3377
- disabled?: boolean;
3378
- api: {
3379
- type: "aisdk";
3380
- package: string;
3381
- url?: string;
3382
- settings?: {
3383
- [key: string]: unknown;
3384
- };
3385
- } | {
3386
- type: "native";
3387
- url?: string;
3388
- settings: {
3389
- [key: string]: unknown;
3390
- };
3391
- };
3392
- request: {
3393
- headers: {
3394
- [key: string]: string;
3395
- };
3396
- body: {
3397
- [key: string]: unknown;
3398
- };
3399
- };
3400
- };
3401
- export type IntegrationWhen = {
3402
- key: string;
3403
- op: "eq" | "neq";
3404
- value: string;
3405
- };
3406
- export type IntegrationTextPrompt = {
3407
- type: "text";
3408
- key: string;
3409
- message: string;
3410
- placeholder?: string;
3411
- when?: IntegrationWhen;
3412
- };
3413
- export type IntegrationSelectPrompt = {
3414
- type: "select";
3415
- key: string;
3416
- message: string;
3417
- options: Array<{
3418
- label: string;
3419
- value: string;
3420
- hint?: string;
3421
- }>;
3422
- when?: IntegrationWhen;
3423
- };
3424
- export type IntegrationOAuthMethod = {
3425
- id: string;
3426
- type: "oauth";
3427
- label: string;
3428
- prompts?: Array<IntegrationTextPrompt | IntegrationSelectPrompt>;
3429
- };
3430
- export type IntegrationKeyMethod = {
3431
- type: "key";
3432
- label?: string;
3433
- };
3434
- export type IntegrationEnvMethod = {
3435
- type: "env";
3436
- names: Array<string>;
3437
- };
3438
- export type ConnectionCredentialInfo = {
3439
- type: "credential";
3440
- id: string;
3441
- label: string;
3442
- };
3443
- export type ConnectionEnvInfo = {
3444
- type: "env";
3445
- name: string;
3446
- };
3447
- export type ConnectionInfo = ConnectionCredentialInfo | ConnectionEnvInfo;
3448
- export type IntegrationInfo = {
3449
- id: string;
3450
- name: string;
3451
- methods: Array<IntegrationMethod>;
3452
- connections: Array<ConnectionInfo>;
3453
- };
3454
- export type IntegrationAttempt = {
3455
- attemptID: string;
3456
- url: string;
3457
- instructions: string;
3458
- mode: "auto" | "code";
3459
- time: {
3460
- created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
3461
- expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
3462
- };
3463
- };
3464
- export type PermissionV2Request = {
3465
- id: string;
3466
- sessionID: string;
3467
- action: string;
3468
- resources: Array<string>;
3469
- save?: Array<string>;
3470
- metadata?: {
3471
- [key: string]: unknown;
3472
- };
3473
- source?: PermissionV2Source;
3474
- };
3475
- export type PermissionSavedInfo = {
3476
- id: string;
3477
- projectID: string;
3478
- action: string;
3479
- resource: string;
3480
- };
3481
- export type FileSystemEntry = {
3482
- path: string;
3483
- type: "file" | "directory";
3484
- };
3485
- export type CommandV2Info = {
3486
- name: string;
3487
- template: string;
3488
- description?: string;
3489
- agent?: string;
3490
- model?: {
3491
- id: string;
3492
- providerID: string;
3493
- variant?: string;
3420
+ location?: LocationRef;
3421
+ data: {
3422
+ timestamp: number;
3423
+ sessionID: string;
3424
+ messageID: string;
3425
+ agent: string;
3494
3426
  };
3495
- subtask?: boolean;
3496
- };
3497
- export type SkillV2Info = {
3498
- name: string;
3499
- description?: string;
3500
- slash?: boolean;
3501
- location: string;
3502
- content: string;
3503
3427
  };
3504
- export type V2EventModelsDevRefreshed = {
3428
+ export type SessionNextModelSwitched = {
3505
3429
  id: string;
3506
3430
  metadata?: {
3507
3431
  [key: string]: unknown;
3508
3432
  };
3433
+ type: "session.next.model.switched";
3509
3434
  durable?: {
3510
3435
  aggregateID: string;
3511
3436
  seq: number;
3512
3437
  version: number;
3513
3438
  };
3514
3439
  location?: LocationRef;
3515
- type: "models-dev.refreshed";
3516
3440
  data: {
3517
- [key: string]: unknown;
3441
+ timestamp: number;
3442
+ sessionID: string;
3443
+ messageID: string;
3444
+ model: ModelRef;
3518
3445
  };
3519
3446
  };
3520
- export type V2EventIntegrationUpdated = {
3447
+ export type SessionNextMoved = {
3521
3448
  id: string;
3522
3449
  metadata?: {
3523
3450
  [key: string]: unknown;
3524
3451
  };
3452
+ type: "session.next.moved";
3525
3453
  durable?: {
3526
3454
  aggregateID: string;
3527
3455
  seq: number;
3528
3456
  version: number;
3529
3457
  };
3530
3458
  location?: LocationRef;
3531
- type: "integration.updated";
3532
3459
  data: {
3533
- [key: string]: unknown;
3460
+ timestamp: number;
3461
+ sessionID: string;
3462
+ location: LocationRef;
3463
+ subdirectory?: string;
3534
3464
  };
3535
3465
  };
3536
- export type V2EventIntegrationConnectionUpdated = {
3466
+ export type SessionNextPrompted = {
3537
3467
  id: string;
3538
3468
  metadata?: {
3539
3469
  [key: string]: unknown;
3540
3470
  };
3471
+ type: "session.next.prompted";
3541
3472
  durable?: {
3542
3473
  aggregateID: string;
3543
3474
  seq: number;
3544
3475
  version: number;
3545
3476
  };
3546
3477
  location?: LocationRef;
3547
- type: "integration.connection.updated";
3548
3478
  data: {
3549
- integrationID: string;
3479
+ timestamp: number;
3480
+ sessionID: string;
3481
+ messageID: string;
3482
+ prompt: Prompt;
3483
+ delivery: "steer" | "queue";
3550
3484
  };
3551
3485
  };
3552
- export type V2EventCatalogUpdated = {
3486
+ export type SessionNextPromptAdmitted = {
3553
3487
  id: string;
3554
3488
  metadata?: {
3555
3489
  [key: string]: unknown;
3556
3490
  };
3491
+ type: "session.next.prompt.admitted";
3557
3492
  durable?: {
3558
3493
  aggregateID: string;
3559
3494
  seq: number;
3560
3495
  version: number;
3561
3496
  };
3562
3497
  location?: LocationRef;
3563
- type: "catalog.updated";
3564
3498
  data: {
3565
- [key: string]: unknown;
3499
+ timestamp: number;
3500
+ sessionID: string;
3501
+ messageID: string;
3502
+ prompt: Prompt;
3503
+ delivery: "steer" | "queue";
3566
3504
  };
3567
3505
  };
3568
- export type V2EventSessionCreated = {
3506
+ export type SessionNextContextUpdated = {
3569
3507
  id: string;
3570
3508
  metadata?: {
3571
3509
  [key: string]: unknown;
3572
3510
  };
3511
+ type: "session.next.context.updated";
3573
3512
  durable?: {
3574
3513
  aggregateID: string;
3575
3514
  seq: number;
3576
3515
  version: number;
3577
3516
  };
3578
3517
  location?: LocationRef;
3579
- type: "session.created";
3580
3518
  data: {
3519
+ timestamp: number;
3581
3520
  sessionID: string;
3582
- info: Session;
3521
+ messageID: string;
3522
+ text: string;
3583
3523
  };
3584
3524
  };
3585
- export type V2EventSessionUpdated = {
3525
+ export type SessionNextSynthetic = {
3586
3526
  id: string;
3587
3527
  metadata?: {
3588
3528
  [key: string]: unknown;
3589
3529
  };
3530
+ type: "session.next.synthetic";
3590
3531
  durable?: {
3591
3532
  aggregateID: string;
3592
3533
  seq: number;
3593
3534
  version: number;
3594
3535
  };
3595
3536
  location?: LocationRef;
3596
- type: "session.updated";
3597
3537
  data: {
3538
+ timestamp: number;
3598
3539
  sessionID: string;
3599
- info: Session;
3540
+ messageID: string;
3541
+ text: string;
3600
3542
  };
3601
3543
  };
3602
- export type V2EventSessionDeleted = {
3544
+ export type SessionNextShellStarted = {
3603
3545
  id: string;
3604
3546
  metadata?: {
3605
3547
  [key: string]: unknown;
3606
3548
  };
3549
+ type: "session.next.shell.started";
3607
3550
  durable?: {
3608
3551
  aggregateID: string;
3609
3552
  seq: number;
3610
3553
  version: number;
3611
3554
  };
3612
3555
  location?: LocationRef;
3613
- type: "session.deleted";
3614
3556
  data: {
3557
+ timestamp: number;
3615
3558
  sessionID: string;
3616
- info: Session;
3559
+ messageID: string;
3560
+ callID: string;
3561
+ command: string;
3617
3562
  };
3618
3563
  };
3619
- export type V2EventMessageUpdated = {
3564
+ export type SessionNextShellEnded = {
3620
3565
  id: string;
3621
3566
  metadata?: {
3622
3567
  [key: string]: unknown;
3623
3568
  };
3569
+ type: "session.next.shell.ended";
3624
3570
  durable?: {
3625
3571
  aggregateID: string;
3626
3572
  seq: number;
3627
3573
  version: number;
3628
3574
  };
3629
3575
  location?: LocationRef;
3630
- type: "message.updated";
3631
3576
  data: {
3577
+ timestamp: number;
3632
3578
  sessionID: string;
3633
- info: Message;
3579
+ callID: string;
3580
+ output: string;
3634
3581
  };
3635
3582
  };
3636
- export type V2EventMessageRemoved = {
3583
+ export type SessionNextStepStarted = {
3637
3584
  id: string;
3638
3585
  metadata?: {
3639
3586
  [key: string]: unknown;
3640
3587
  };
3588
+ type: "session.next.step.started";
3641
3589
  durable?: {
3642
3590
  aggregateID: string;
3643
3591
  seq: number;
3644
3592
  version: number;
3645
3593
  };
3646
3594
  location?: LocationRef;
3647
- type: "message.removed";
3648
3595
  data: {
3596
+ timestamp: number;
3649
3597
  sessionID: string;
3650
- messageID: string;
3598
+ assistantMessageID: string;
3599
+ agent: string;
3600
+ model: ModelRef;
3601
+ snapshot?: string;
3651
3602
  };
3652
3603
  };
3653
- export type V2EventMessagePartUpdated = {
3604
+ export type SessionNextStepEnded = {
3654
3605
  id: string;
3655
3606
  metadata?: {
3656
3607
  [key: string]: unknown;
3657
3608
  };
3609
+ type: "session.next.step.ended";
3658
3610
  durable?: {
3659
3611
  aggregateID: string;
3660
3612
  seq: number;
3661
3613
  version: number;
3662
3614
  };
3663
3615
  location?: LocationRef;
3664
- type: "message.part.updated";
3665
3616
  data: {
3617
+ timestamp: number;
3666
3618
  sessionID: string;
3667
- part: Part;
3668
- time: number;
3619
+ assistantMessageID: string;
3620
+ finish: string;
3621
+ cost: number;
3622
+ tokens: {
3623
+ input: number;
3624
+ output: number;
3625
+ reasoning: number;
3626
+ cache: {
3627
+ read: number;
3628
+ write: number;
3629
+ };
3630
+ };
3631
+ snapshot?: string;
3632
+ files?: Array<string>;
3669
3633
  };
3670
3634
  };
3671
- export type V2EventMessagePartRemoved = {
3635
+ export type SessionNextStepFailed = {
3672
3636
  id: string;
3673
3637
  metadata?: {
3674
3638
  [key: string]: unknown;
3675
3639
  };
3640
+ type: "session.next.step.failed";
3676
3641
  durable?: {
3677
3642
  aggregateID: string;
3678
3643
  seq: number;
3679
3644
  version: number;
3680
3645
  };
3681
3646
  location?: LocationRef;
3682
- type: "message.part.removed";
3683
3647
  data: {
3648
+ timestamp: number;
3684
3649
  sessionID: string;
3685
- messageID: string;
3686
- partID: string;
3650
+ assistantMessageID: string;
3651
+ error: SessionErrorUnknown;
3687
3652
  };
3688
3653
  };
3689
- export type V2EventSessionNextAgentSwitched = {
3654
+ export type SessionNextTextStarted = {
3690
3655
  id: string;
3691
3656
  metadata?: {
3692
3657
  [key: string]: unknown;
3693
3658
  };
3659
+ type: "session.next.text.started";
3694
3660
  durable?: {
3695
3661
  aggregateID: string;
3696
3662
  seq: number;
3697
3663
  version: number;
3698
3664
  };
3699
3665
  location?: LocationRef;
3700
- type: "session.next.agent.switched";
3701
3666
  data: {
3702
3667
  timestamp: number;
3703
3668
  sessionID: string;
3704
- messageID: string;
3705
- agent: string;
3706
- };
3669
+ assistantMessageID: string;
3670
+ textID: string;
3671
+ };
3707
3672
  };
3708
- export type V2EventSessionNextModelSwitched = {
3673
+ export type SessionNextTextEnded = {
3709
3674
  id: string;
3710
3675
  metadata?: {
3711
3676
  [key: string]: unknown;
3712
3677
  };
3678
+ type: "session.next.text.ended";
3713
3679
  durable?: {
3714
3680
  aggregateID: string;
3715
3681
  seq: number;
3716
3682
  version: number;
3717
3683
  };
3718
3684
  location?: LocationRef;
3719
- type: "session.next.model.switched";
3720
3685
  data: {
3721
3686
  timestamp: number;
3722
3687
  sessionID: string;
3723
- messageID: string;
3724
- model: {
3725
- id: string;
3726
- providerID: string;
3727
- variant?: string;
3728
- };
3688
+ assistantMessageID: string;
3689
+ textID: string;
3690
+ text: string;
3729
3691
  };
3730
3692
  };
3731
- export type V2EventSessionNextMoved = {
3693
+ export type SessionNextToolInputStarted = {
3732
3694
  id: string;
3733
3695
  metadata?: {
3734
3696
  [key: string]: unknown;
3735
3697
  };
3698
+ type: "session.next.tool.input.started";
3736
3699
  durable?: {
3737
3700
  aggregateID: string;
3738
3701
  seq: number;
3739
3702
  version: number;
3740
3703
  };
3741
3704
  location?: LocationRef;
3742
- type: "session.next.moved";
3743
3705
  data: {
3744
3706
  timestamp: number;
3745
3707
  sessionID: string;
3746
- location: LocationRef;
3747
- subdirectory?: string;
3708
+ assistantMessageID: string;
3709
+ callID: string;
3710
+ name: string;
3748
3711
  };
3749
3712
  };
3750
- export type V2EventSessionNextPrompted = {
3713
+ export type SessionNextToolInputEnded = {
3751
3714
  id: string;
3752
3715
  metadata?: {
3753
3716
  [key: string]: unknown;
3754
3717
  };
3718
+ type: "session.next.tool.input.ended";
3755
3719
  durable?: {
3756
3720
  aggregateID: string;
3757
3721
  seq: number;
3758
3722
  version: number;
3759
3723
  };
3760
3724
  location?: LocationRef;
3761
- type: "session.next.prompted";
3762
3725
  data: {
3763
3726
  timestamp: number;
3764
3727
  sessionID: string;
3765
- messageID: string;
3766
- prompt: Prompt;
3767
- delivery: "steer" | "queue";
3728
+ assistantMessageID: string;
3729
+ callID: string;
3730
+ text: string;
3768
3731
  };
3769
3732
  };
3770
- export type V2EventSessionNextPromptAdmitted = {
3733
+ export type SessionNextToolCalled = {
3771
3734
  id: string;
3772
3735
  metadata?: {
3773
3736
  [key: string]: unknown;
3774
3737
  };
3738
+ type: "session.next.tool.called";
3775
3739
  durable?: {
3776
3740
  aggregateID: string;
3777
3741
  seq: number;
3778
3742
  version: number;
3779
3743
  };
3780
3744
  location?: LocationRef;
3781
- type: "session.next.prompt.admitted";
3782
3745
  data: {
3783
3746
  timestamp: number;
3784
3747
  sessionID: string;
3785
- messageID: string;
3786
- prompt: Prompt;
3787
- delivery: "steer" | "queue";
3748
+ assistantMessageID: string;
3749
+ callID: string;
3750
+ tool: string;
3751
+ input: {
3752
+ [key: string]: unknown;
3753
+ };
3754
+ provider: {
3755
+ executed: boolean;
3756
+ metadata?: LlmProviderMetadata;
3757
+ };
3788
3758
  };
3789
3759
  };
3790
- export type V2EventSessionNextContextUpdated = {
3760
+ export type SessionNextToolProgress = {
3791
3761
  id: string;
3792
3762
  metadata?: {
3793
3763
  [key: string]: unknown;
3794
3764
  };
3765
+ type: "session.next.tool.progress";
3795
3766
  durable?: {
3796
3767
  aggregateID: string;
3797
3768
  seq: number;
3798
3769
  version: number;
3799
3770
  };
3800
3771
  location?: LocationRef;
3801
- type: "session.next.context.updated";
3802
3772
  data: {
3803
3773
  timestamp: number;
3804
3774
  sessionID: string;
3805
- messageID: string;
3806
- text: string;
3775
+ assistantMessageID: string;
3776
+ callID: string;
3777
+ structured: {
3778
+ [key: string]: unknown;
3779
+ };
3780
+ content: Array<LlmToolContent>;
3807
3781
  };
3808
3782
  };
3809
- export type V2EventSessionNextSynthetic = {
3783
+ export type SessionNextToolSuccess = {
3810
3784
  id: string;
3811
3785
  metadata?: {
3812
3786
  [key: string]: unknown;
3813
3787
  };
3788
+ type: "session.next.tool.success";
3814
3789
  durable?: {
3815
3790
  aggregateID: string;
3816
3791
  seq: number;
3817
3792
  version: number;
3818
3793
  };
3819
3794
  location?: LocationRef;
3820
- type: "session.next.synthetic";
3821
3795
  data: {
3822
3796
  timestamp: number;
3823
3797
  sessionID: string;
3824
- messageID: string;
3825
- text: string;
3798
+ assistantMessageID: string;
3799
+ callID: string;
3800
+ structured: {
3801
+ [key: string]: unknown;
3802
+ };
3803
+ content: Array<LlmToolContent>;
3804
+ outputPaths?: Array<string>;
3805
+ result?: unknown;
3806
+ provider: {
3807
+ executed: boolean;
3808
+ metadata?: LlmProviderMetadata;
3809
+ };
3826
3810
  };
3827
3811
  };
3828
- export type V2EventSessionNextShellStarted = {
3812
+ export type SessionNextToolFailed = {
3829
3813
  id: string;
3830
3814
  metadata?: {
3831
3815
  [key: string]: unknown;
3832
3816
  };
3817
+ type: "session.next.tool.failed";
3833
3818
  durable?: {
3834
3819
  aggregateID: string;
3835
3820
  seq: number;
3836
3821
  version: number;
3837
3822
  };
3838
3823
  location?: LocationRef;
3839
- type: "session.next.shell.started";
3840
3824
  data: {
3841
3825
  timestamp: number;
3842
3826
  sessionID: string;
3843
- messageID: string;
3827
+ assistantMessageID: string;
3844
3828
  callID: string;
3845
- command: string;
3829
+ error: SessionErrorUnknown;
3830
+ result?: unknown;
3831
+ provider: {
3832
+ executed: boolean;
3833
+ metadata?: LlmProviderMetadata;
3834
+ };
3846
3835
  };
3847
3836
  };
3848
- export type V2EventSessionNextShellEnded = {
3837
+ export type SessionNextReasoningStarted = {
3849
3838
  id: string;
3850
3839
  metadata?: {
3851
3840
  [key: string]: unknown;
3852
3841
  };
3842
+ type: "session.next.reasoning.started";
3853
3843
  durable?: {
3854
3844
  aggregateID: string;
3855
3845
  seq: number;
3856
3846
  version: number;
3857
3847
  };
3858
3848
  location?: LocationRef;
3859
- type: "session.next.shell.ended";
3860
3849
  data: {
3861
3850
  timestamp: number;
3862
3851
  sessionID: string;
3863
- callID: string;
3864
- output: string;
3852
+ assistantMessageID: string;
3853
+ reasoningID: string;
3854
+ providerMetadata?: LlmProviderMetadata;
3865
3855
  };
3866
3856
  };
3867
- export type V2EventSessionNextStepStarted = {
3857
+ export type SessionNextReasoningEnded = {
3868
3858
  id: string;
3869
3859
  metadata?: {
3870
3860
  [key: string]: unknown;
3871
3861
  };
3862
+ type: "session.next.reasoning.ended";
3872
3863
  durable?: {
3873
3864
  aggregateID: string;
3874
3865
  seq: number;
3875
3866
  version: number;
3876
3867
  };
3877
3868
  location?: LocationRef;
3878
- type: "session.next.step.started";
3879
3869
  data: {
3880
3870
  timestamp: number;
3881
3871
  sessionID: string;
3882
3872
  assistantMessageID: string;
3883
- agent: string;
3884
- model: {
3885
- id: string;
3886
- providerID: string;
3887
- variant?: string;
3888
- };
3889
- snapshot?: string;
3873
+ reasoningID: string;
3874
+ text: string;
3875
+ providerMetadata?: LlmProviderMetadata;
3890
3876
  };
3891
3877
  };
3892
- export type V2EventSessionNextStepEnded = {
3878
+ export type SessionNextRetried = {
3893
3879
  id: string;
3894
3880
  metadata?: {
3895
3881
  [key: string]: unknown;
3896
3882
  };
3883
+ type: "session.next.retried";
3897
3884
  durable?: {
3898
3885
  aggregateID: string;
3899
3886
  seq: number;
3900
3887
  version: number;
3901
3888
  };
3902
3889
  location?: LocationRef;
3903
- type: "session.next.step.ended";
3904
3890
  data: {
3905
3891
  timestamp: number;
3906
3892
  sessionID: string;
3907
- assistantMessageID: string;
3908
- finish: string;
3909
- cost: number;
3910
- tokens: {
3911
- input: number;
3912
- output: number;
3913
- reasoning: number;
3914
- cache: {
3915
- read: number;
3916
- write: number;
3917
- };
3918
- };
3919
- snapshot?: string;
3893
+ attempt: number;
3894
+ error: SessionNextRetryError;
3920
3895
  };
3921
3896
  };
3922
- export type V2EventSessionNextStepFailed = {
3897
+ export type SessionNextCompactionStarted = {
3923
3898
  id: string;
3924
3899
  metadata?: {
3925
3900
  [key: string]: unknown;
3926
3901
  };
3902
+ type: "session.next.compaction.started";
3927
3903
  durable?: {
3928
3904
  aggregateID: string;
3929
3905
  seq: number;
3930
3906
  version: number;
3931
3907
  };
3932
3908
  location?: LocationRef;
3933
- type: "session.next.step.failed";
3934
3909
  data: {
3935
3910
  timestamp: number;
3936
3911
  sessionID: string;
3937
- assistantMessageID: string;
3938
- error: SessionErrorUnknown;
3912
+ messageID: string;
3913
+ reason: "auto" | "manual";
3939
3914
  };
3940
3915
  };
3941
- export type V2EventSessionNextTextStarted = {
3916
+ export type SessionNextCompactionEnded = {
3942
3917
  id: string;
3943
3918
  metadata?: {
3944
3919
  [key: string]: unknown;
3945
3920
  };
3921
+ type: "session.next.compaction.ended";
3946
3922
  durable?: {
3947
3923
  aggregateID: string;
3948
3924
  seq: number;
3949
3925
  version: number;
3950
3926
  };
3951
3927
  location?: LocationRef;
3952
- type: "session.next.text.started";
3953
3928
  data: {
3954
3929
  timestamp: number;
3955
3930
  sessionID: string;
3956
- assistantMessageID: string;
3957
- textID: string;
3931
+ messageID: string;
3932
+ reason: "auto" | "manual";
3933
+ text: string;
3934
+ recent: string;
3958
3935
  };
3959
3936
  };
3960
- export type V2EventSessionNextTextDelta = {
3937
+ export type SessionNextRevertStaged = {
3961
3938
  id: string;
3962
3939
  metadata?: {
3963
3940
  [key: string]: unknown;
3964
3941
  };
3942
+ type: "session.next.revert.staged";
3965
3943
  durable?: {
3966
3944
  aggregateID: string;
3967
3945
  seq: number;
3968
3946
  version: number;
3969
3947
  };
3970
3948
  location?: LocationRef;
3971
- type: "session.next.text.delta";
3972
3949
  data: {
3973
3950
  timestamp: number;
3974
3951
  sessionID: string;
3975
- assistantMessageID: string;
3976
- textID: string;
3977
- delta: string;
3952
+ revert: RevertState;
3978
3953
  };
3979
3954
  };
3980
- export type V2EventSessionNextTextEnded = {
3955
+ export type SessionNextRevertCleared = {
3981
3956
  id: string;
3982
3957
  metadata?: {
3983
3958
  [key: string]: unknown;
3984
3959
  };
3960
+ type: "session.next.revert.cleared";
3985
3961
  durable?: {
3986
3962
  aggregateID: string;
3987
3963
  seq: number;
3988
3964
  version: number;
3989
3965
  };
3990
3966
  location?: LocationRef;
3991
- type: "session.next.text.ended";
3992
3967
  data: {
3993
3968
  timestamp: number;
3994
3969
  sessionID: string;
3995
- assistantMessageID: string;
3996
- textID: string;
3997
- text: string;
3998
3970
  };
3999
3971
  };
4000
- export type V2EventSessionNextReasoningStarted = {
3972
+ export type SessionNextRevertCommitted = {
4001
3973
  id: string;
4002
3974
  metadata?: {
4003
3975
  [key: string]: unknown;
4004
3976
  };
3977
+ type: "session.next.revert.committed";
4005
3978
  durable?: {
4006
3979
  aggregateID: string;
4007
3980
  seq: number;
4008
3981
  version: number;
4009
3982
  };
4010
3983
  location?: LocationRef;
4011
- type: "session.next.reasoning.started";
4012
3984
  data: {
4013
3985
  timestamp: number;
4014
3986
  sessionID: string;
4015
- assistantMessageID: string;
4016
- reasoningID: string;
4017
- providerMetadata?: {
4018
- [key: string]: {
4019
- [key: string]: unknown;
4020
- };
3987
+ messageID: string;
3988
+ };
3989
+ };
3990
+ export type ModelApi = {
3991
+ id: string;
3992
+ type: "aisdk";
3993
+ package: string;
3994
+ url?: string;
3995
+ settings?: {
3996
+ [key: string]: unknown;
3997
+ };
3998
+ } | {
3999
+ id: string;
4000
+ type: "native";
4001
+ url?: string;
4002
+ settings: {
4003
+ [key: string]: unknown;
4004
+ };
4005
+ };
4006
+ export type ModelCapabilities = {
4007
+ tools: boolean;
4008
+ input: Array<string>;
4009
+ output: Array<string>;
4010
+ };
4011
+ export type ModelCost = {
4012
+ tier?: {
4013
+ type: "context";
4014
+ size: number;
4015
+ };
4016
+ input: number;
4017
+ output: number;
4018
+ cache: {
4019
+ read: number;
4020
+ write: number;
4021
+ };
4022
+ };
4023
+ export type ModelV2Info = {
4024
+ id: string;
4025
+ providerID: string;
4026
+ family?: string;
4027
+ name: string;
4028
+ api: ModelApi;
4029
+ capabilities: ModelCapabilities;
4030
+ request: {
4031
+ headers: {
4032
+ [key: string]: string;
4033
+ };
4034
+ body: {
4035
+ [key: string]: unknown;
4036
+ };
4037
+ variant?: string;
4038
+ };
4039
+ variants: Array<{
4040
+ id: string;
4041
+ headers: {
4042
+ [key: string]: string;
4021
4043
  };
4044
+ body: {
4045
+ [key: string]: unknown;
4046
+ };
4047
+ }>;
4048
+ time: {
4049
+ released: number;
4050
+ };
4051
+ cost: Array<ModelCost>;
4052
+ status: "alpha" | "beta" | "deprecated" | "active";
4053
+ enabled: boolean;
4054
+ limit: {
4055
+ context: number;
4056
+ input?: number;
4057
+ output: number;
4058
+ };
4059
+ };
4060
+ export type ProviderAisdk = {
4061
+ type: "aisdk";
4062
+ package: string;
4063
+ url?: string;
4064
+ settings?: {
4065
+ [key: string]: unknown;
4066
+ };
4067
+ };
4068
+ export type ProviderNative = {
4069
+ type: "native";
4070
+ url?: string;
4071
+ settings: {
4072
+ [key: string]: unknown;
4073
+ };
4074
+ };
4075
+ export type ProviderApi = ProviderAisdk | ProviderNative;
4076
+ export type ProviderV2Info = {
4077
+ id: string;
4078
+ integrationID?: string;
4079
+ name: string;
4080
+ disabled?: boolean;
4081
+ api: ProviderApi;
4082
+ request: ProviderRequest;
4083
+ };
4084
+ export type IntegrationWhen = {
4085
+ key: string;
4086
+ op: "eq" | "neq";
4087
+ value: string;
4088
+ };
4089
+ export type IntegrationTextPrompt = {
4090
+ type: "text";
4091
+ key: string;
4092
+ message: string;
4093
+ placeholder?: string;
4094
+ when?: IntegrationWhen;
4095
+ };
4096
+ export type IntegrationSelectPrompt = {
4097
+ type: "select";
4098
+ key: string;
4099
+ message: string;
4100
+ options: Array<{
4101
+ label: string;
4102
+ value: string;
4103
+ hint?: string;
4104
+ }>;
4105
+ when?: IntegrationWhen;
4106
+ };
4107
+ export type IntegrationOAuthMethod = {
4108
+ id: string;
4109
+ type: "oauth";
4110
+ label: string;
4111
+ prompts?: Array<IntegrationTextPrompt | IntegrationSelectPrompt>;
4112
+ };
4113
+ export type IntegrationKeyMethod = {
4114
+ type: "key";
4115
+ label?: string;
4116
+ };
4117
+ export type IntegrationEnvMethod = {
4118
+ type: "env";
4119
+ names: Array<string>;
4120
+ };
4121
+ export type ConnectionCredentialInfo = {
4122
+ type: "credential";
4123
+ id: string;
4124
+ label: string;
4125
+ };
4126
+ export type ConnectionEnvInfo = {
4127
+ type: "env";
4128
+ name: string;
4129
+ };
4130
+ export type ConnectionInfo = ConnectionCredentialInfo | ConnectionEnvInfo;
4131
+ export type IntegrationInfo = {
4132
+ id: string;
4133
+ name: string;
4134
+ methods: Array<IntegrationMethod>;
4135
+ connections: Array<ConnectionInfo>;
4136
+ };
4137
+ export type IntegrationAttempt = {
4138
+ attemptID: string;
4139
+ url: string;
4140
+ instructions: string;
4141
+ mode: "auto" | "code";
4142
+ time: {
4143
+ created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
4144
+ expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
4145
+ };
4146
+ };
4147
+ export type IntegrationAttemptStatus = {
4148
+ status: "pending";
4149
+ time: {
4150
+ created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
4151
+ expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
4152
+ };
4153
+ } | {
4154
+ status: "complete";
4155
+ time: {
4156
+ created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
4157
+ expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
4158
+ };
4159
+ } | {
4160
+ status: "failed";
4161
+ message: string;
4162
+ time: {
4163
+ created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
4164
+ expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
4165
+ };
4166
+ } | {
4167
+ status: "expired";
4168
+ time: {
4169
+ created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
4170
+ expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
4171
+ };
4172
+ };
4173
+ export type PermissionV2Request = {
4174
+ id: string;
4175
+ sessionID: string;
4176
+ action: string;
4177
+ resources: Array<string>;
4178
+ save?: Array<string>;
4179
+ metadata?: {
4180
+ [key: string]: unknown;
4181
+ };
4182
+ source?: PermissionV2Source;
4183
+ };
4184
+ export type PermissionSavedInfo = {
4185
+ id: string;
4186
+ projectID: string;
4187
+ action: string;
4188
+ resource: string;
4189
+ };
4190
+ export type FileSystemEntry = {
4191
+ path: string;
4192
+ type: "file" | "directory";
4193
+ };
4194
+ export type CommandV2Info = {
4195
+ name: string;
4196
+ template: string;
4197
+ description?: string;
4198
+ agent?: string;
4199
+ model?: ModelRef;
4200
+ subtask?: boolean;
4201
+ };
4202
+ export type SkillV2Info = {
4203
+ name: string;
4204
+ description?: string;
4205
+ slash?: boolean;
4206
+ location: string;
4207
+ content: string;
4208
+ };
4209
+ export type ModelsDevRefreshed = {
4210
+ id: string;
4211
+ metadata?: {
4212
+ [key: string]: unknown;
4213
+ };
4214
+ type: "models-dev.refreshed";
4215
+ durable?: {
4216
+ aggregateID: string;
4217
+ seq: number;
4218
+ version: number;
4219
+ };
4220
+ location?: LocationRef;
4221
+ data: {
4222
+ [key: string]: unknown;
4022
4223
  };
4023
4224
  };
4024
- export type V2EventSessionNextReasoningDelta = {
4225
+ export type IntegrationUpdated = {
4025
4226
  id: string;
4026
4227
  metadata?: {
4027
4228
  [key: string]: unknown;
4028
4229
  };
4230
+ type: "integration.updated";
4029
4231
  durable?: {
4030
4232
  aggregateID: string;
4031
4233
  seq: number;
4032
4234
  version: number;
4033
4235
  };
4034
4236
  location?: LocationRef;
4035
- type: "session.next.reasoning.delta";
4036
4237
  data: {
4037
- timestamp: number;
4038
- sessionID: string;
4039
- assistantMessageID: string;
4040
- reasoningID: string;
4041
- delta: string;
4238
+ [key: string]: unknown;
4042
4239
  };
4043
4240
  };
4044
- export type V2EventSessionNextReasoningEnded = {
4241
+ export type IntegrationConnectionUpdated = {
4045
4242
  id: string;
4046
4243
  metadata?: {
4047
4244
  [key: string]: unknown;
4048
4245
  };
4246
+ type: "integration.connection.updated";
4049
4247
  durable?: {
4050
4248
  aggregateID: string;
4051
4249
  seq: number;
4052
4250
  version: number;
4053
4251
  };
4054
4252
  location?: LocationRef;
4055
- type: "session.next.reasoning.ended";
4056
4253
  data: {
4057
- timestamp: number;
4058
- sessionID: string;
4059
- assistantMessageID: string;
4060
- reasoningID: string;
4061
- text: string;
4062
- providerMetadata?: {
4063
- [key: string]: {
4064
- [key: string]: unknown;
4065
- };
4066
- };
4254
+ integrationID: string;
4067
4255
  };
4068
4256
  };
4069
- export type V2EventSessionNextToolInputStarted = {
4257
+ export type CatalogUpdated = {
4070
4258
  id: string;
4071
4259
  metadata?: {
4072
4260
  [key: string]: unknown;
4073
4261
  };
4262
+ type: "catalog.updated";
4074
4263
  durable?: {
4075
4264
  aggregateID: string;
4076
4265
  seq: number;
4077
4266
  version: number;
4078
4267
  };
4079
4268
  location?: LocationRef;
4080
- type: "session.next.tool.input.started";
4081
4269
  data: {
4082
- timestamp: number;
4083
- sessionID: string;
4084
- assistantMessageID: string;
4085
- callID: string;
4086
- name: string;
4270
+ [key: string]: unknown;
4087
4271
  };
4088
4272
  };
4089
- export type V2EventSessionNextToolInputDelta = {
4273
+ export type SessionCreated = {
4090
4274
  id: string;
4091
4275
  metadata?: {
4092
4276
  [key: string]: unknown;
4093
4277
  };
4278
+ type: "session.created";
4094
4279
  durable?: {
4095
4280
  aggregateID: string;
4096
4281
  seq: number;
4097
4282
  version: number;
4098
4283
  };
4099
4284
  location?: LocationRef;
4100
- type: "session.next.tool.input.delta";
4101
4285
  data: {
4102
- timestamp: number;
4103
4286
  sessionID: string;
4104
- assistantMessageID: string;
4105
- callID: string;
4106
- delta: string;
4287
+ info: Session;
4107
4288
  };
4108
4289
  };
4109
- export type V2EventSessionNextToolInputEnded = {
4290
+ export type SessionUpdated = {
4110
4291
  id: string;
4111
4292
  metadata?: {
4112
4293
  [key: string]: unknown;
4113
4294
  };
4295
+ type: "session.updated";
4114
4296
  durable?: {
4115
4297
  aggregateID: string;
4116
4298
  seq: number;
4117
4299
  version: number;
4118
4300
  };
4119
4301
  location?: LocationRef;
4120
- type: "session.next.tool.input.ended";
4121
4302
  data: {
4122
- timestamp: number;
4123
4303
  sessionID: string;
4124
- assistantMessageID: string;
4125
- callID: string;
4126
- text: string;
4304
+ info: Session;
4127
4305
  };
4128
4306
  };
4129
- export type V2EventSessionNextToolCalled = {
4307
+ export type SessionDeleted = {
4130
4308
  id: string;
4131
4309
  metadata?: {
4132
4310
  [key: string]: unknown;
4133
4311
  };
4312
+ type: "session.deleted";
4134
4313
  durable?: {
4135
4314
  aggregateID: string;
4136
4315
  seq: number;
4137
4316
  version: number;
4138
4317
  };
4139
4318
  location?: LocationRef;
4140
- type: "session.next.tool.called";
4141
4319
  data: {
4142
- timestamp: number;
4143
4320
  sessionID: string;
4144
- assistantMessageID: string;
4145
- callID: string;
4146
- tool: string;
4147
- input: {
4148
- [key: string]: unknown;
4149
- };
4150
- provider: {
4151
- executed: boolean;
4152
- metadata?: {
4153
- [key: string]: {
4154
- [key: string]: unknown;
4155
- };
4156
- };
4157
- };
4321
+ info: Session;
4158
4322
  };
4159
4323
  };
4160
- export type V2EventSessionNextToolProgress = {
4324
+ export type MessageUpdated = {
4161
4325
  id: string;
4162
4326
  metadata?: {
4163
4327
  [key: string]: unknown;
4164
4328
  };
4329
+ type: "message.updated";
4165
4330
  durable?: {
4166
4331
  aggregateID: string;
4167
4332
  seq: number;
4168
4333
  version: number;
4169
4334
  };
4170
4335
  location?: LocationRef;
4171
- type: "session.next.tool.progress";
4172
4336
  data: {
4173
- timestamp: number;
4174
4337
  sessionID: string;
4175
- assistantMessageID: string;
4176
- callID: string;
4177
- structured: {
4178
- [key: string]: unknown;
4179
- };
4180
- content: Array<ToolTextContent | ToolFileContent>;
4338
+ info: Message;
4339
+ };
4340
+ };
4341
+ export type MessageRemoved = {
4342
+ id: string;
4343
+ metadata?: {
4344
+ [key: string]: unknown;
4345
+ };
4346
+ type: "message.removed";
4347
+ durable?: {
4348
+ aggregateID: string;
4349
+ seq: number;
4350
+ version: number;
4351
+ };
4352
+ location?: LocationRef;
4353
+ data: {
4354
+ sessionID: string;
4355
+ messageID: string;
4181
4356
  };
4182
4357
  };
4183
- export type V2EventSessionNextToolSuccess = {
4358
+ export type MessagePartUpdated = {
4184
4359
  id: string;
4185
4360
  metadata?: {
4186
4361
  [key: string]: unknown;
4187
4362
  };
4363
+ type: "message.part.updated";
4188
4364
  durable?: {
4189
4365
  aggregateID: string;
4190
4366
  seq: number;
4191
4367
  version: number;
4192
4368
  };
4193
4369
  location?: LocationRef;
4194
- type: "session.next.tool.success";
4195
4370
  data: {
4196
- timestamp: number;
4197
4371
  sessionID: string;
4198
- assistantMessageID: string;
4199
- callID: string;
4200
- structured: {
4201
- [key: string]: unknown;
4202
- };
4203
- content: Array<ToolTextContent | ToolFileContent>;
4204
- outputPaths?: Array<string>;
4205
- result?: unknown;
4206
- provider: {
4207
- executed: boolean;
4208
- metadata?: {
4209
- [key: string]: {
4210
- [key: string]: unknown;
4211
- };
4212
- };
4213
- };
4372
+ part: Part;
4373
+ time: number;
4214
4374
  };
4215
4375
  };
4216
- export type V2EventSessionNextToolFailed = {
4376
+ export type MessagePartRemoved = {
4217
4377
  id: string;
4218
4378
  metadata?: {
4219
4379
  [key: string]: unknown;
4220
4380
  };
4381
+ type: "message.part.removed";
4221
4382
  durable?: {
4222
4383
  aggregateID: string;
4223
4384
  seq: number;
4224
4385
  version: number;
4225
4386
  };
4226
4387
  location?: LocationRef;
4227
- type: "session.next.tool.failed";
4228
4388
  data: {
4229
- timestamp: number;
4230
4389
  sessionID: string;
4231
- assistantMessageID: string;
4232
- callID: string;
4233
- error: SessionErrorUnknown;
4234
- result?: unknown;
4235
- provider: {
4236
- executed: boolean;
4237
- metadata?: {
4238
- [key: string]: {
4239
- [key: string]: unknown;
4240
- };
4241
- };
4242
- };
4390
+ messageID: string;
4391
+ partID: string;
4243
4392
  };
4244
4393
  };
4245
- export type V2EventSessionNextRetried = {
4394
+ export type SessionNextTextDelta = {
4246
4395
  id: string;
4247
4396
  metadata?: {
4248
4397
  [key: string]: unknown;
4249
4398
  };
4399
+ type: "session.next.text.delta";
4250
4400
  durable?: {
4251
4401
  aggregateID: string;
4252
4402
  seq: number;
4253
4403
  version: number;
4254
4404
  };
4255
4405
  location?: LocationRef;
4256
- type: "session.next.retried";
4257
4406
  data: {
4258
4407
  timestamp: number;
4259
4408
  sessionID: string;
4260
- attempt: number;
4261
- error: SessionNextRetryError;
4409
+ assistantMessageID: string;
4410
+ textID: string;
4411
+ delta: string;
4262
4412
  };
4263
4413
  };
4264
- export type V2EventSessionNextCompactionStarted = {
4414
+ export type SessionNextReasoningDelta = {
4265
4415
  id: string;
4266
4416
  metadata?: {
4267
4417
  [key: string]: unknown;
4268
4418
  };
4419
+ type: "session.next.reasoning.delta";
4269
4420
  durable?: {
4270
4421
  aggregateID: string;
4271
4422
  seq: number;
4272
4423
  version: number;
4273
4424
  };
4274
4425
  location?: LocationRef;
4275
- type: "session.next.compaction.started";
4276
4426
  data: {
4277
4427
  timestamp: number;
4278
4428
  sessionID: string;
4279
- messageID: string;
4280
- reason: "auto" | "manual";
4429
+ assistantMessageID: string;
4430
+ reasoningID: string;
4431
+ delta: string;
4281
4432
  };
4282
4433
  };
4283
- export type V2EventSessionNextCompactionDelta = {
4434
+ export type SessionNextToolInputDelta = {
4284
4435
  id: string;
4285
4436
  metadata?: {
4286
4437
  [key: string]: unknown;
4287
4438
  };
4439
+ type: "session.next.tool.input.delta";
4288
4440
  durable?: {
4289
4441
  aggregateID: string;
4290
4442
  seq: number;
4291
4443
  version: number;
4292
4444
  };
4293
4445
  location?: LocationRef;
4294
- type: "session.next.compaction.delta";
4295
4446
  data: {
4296
4447
  timestamp: number;
4297
4448
  sessionID: string;
4298
- messageID: string;
4299
- text: string;
4449
+ assistantMessageID: string;
4450
+ callID: string;
4451
+ delta: string;
4300
4452
  };
4301
4453
  };
4302
- export type V2EventSessionNextCompactionEnded = {
4454
+ export type SessionNextCompactionDelta = {
4303
4455
  id: string;
4304
4456
  metadata?: {
4305
4457
  [key: string]: unknown;
4306
4458
  };
4459
+ type: "session.next.compaction.delta";
4307
4460
  durable?: {
4308
4461
  aggregateID: string;
4309
4462
  seq: number;
4310
4463
  version: number;
4311
4464
  };
4312
4465
  location?: LocationRef;
4313
- type: "session.next.compaction.ended";
4314
4466
  data: {
4315
4467
  timestamp: number;
4316
4468
  sessionID: string;
4317
4469
  messageID: string;
4318
- reason: "auto" | "manual";
4319
4470
  text: string;
4320
- recent: string;
4321
4471
  };
4322
4472
  };
4323
- export type V2EventMessagePartDelta = {
4473
+ export type MessagePartDelta = {
4324
4474
  id: string;
4325
4475
  metadata?: {
4326
4476
  [key: string]: unknown;
4327
4477
  };
4478
+ type: "message.part.delta";
4328
4479
  durable?: {
4329
4480
  aggregateID: string;
4330
4481
  seq: number;
4331
4482
  version: number;
4332
4483
  };
4333
4484
  location?: LocationRef;
4334
- type: "message.part.delta";
4335
4485
  data: {
4336
4486
  sessionID: string;
4337
4487
  messageID: string;
@@ -4340,116 +4490,116 @@ export type V2EventMessagePartDelta = {
4340
4490
  delta: string;
4341
4491
  };
4342
4492
  };
4343
- export type V2EventSessionDiff = {
4493
+ export type SessionDiff = {
4344
4494
  id: string;
4345
4495
  metadata?: {
4346
4496
  [key: string]: unknown;
4347
4497
  };
4498
+ type: "session.diff";
4348
4499
  durable?: {
4349
4500
  aggregateID: string;
4350
4501
  seq: number;
4351
4502
  version: number;
4352
4503
  };
4353
4504
  location?: LocationRef;
4354
- type: "session.diff";
4355
4505
  data: {
4356
4506
  sessionID: string;
4357
4507
  diff: Array<SnapshotFileDiff>;
4358
4508
  };
4359
4509
  };
4360
- export type V2EventSessionError = {
4510
+ export type SessionError = {
4361
4511
  id: string;
4362
4512
  metadata?: {
4363
4513
  [key: string]: unknown;
4364
4514
  };
4515
+ type: "session.error";
4365
4516
  durable?: {
4366
4517
  aggregateID: string;
4367
4518
  seq: number;
4368
4519
  version: number;
4369
4520
  };
4370
4521
  location?: LocationRef;
4371
- type: "session.error";
4372
4522
  data: {
4373
4523
  sessionID?: string;
4374
4524
  error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | StructuredOutputError | ContextOverflowError | ContentFilterError | ApiError;
4375
4525
  };
4376
4526
  };
4377
- export type V2EventInstallationUpdated = {
4527
+ export type InstallationUpdated = {
4378
4528
  id: string;
4379
4529
  metadata?: {
4380
4530
  [key: string]: unknown;
4381
4531
  };
4532
+ type: "installation.updated";
4382
4533
  durable?: {
4383
4534
  aggregateID: string;
4384
4535
  seq: number;
4385
4536
  version: number;
4386
4537
  };
4387
4538
  location?: LocationRef;
4388
- type: "installation.updated";
4389
4539
  data: {
4390
4540
  version: string;
4391
4541
  };
4392
4542
  };
4393
- export type V2EventInstallationUpdateAvailable = {
4543
+ export type InstallationUpdateAvailable = {
4394
4544
  id: string;
4395
4545
  metadata?: {
4396
4546
  [key: string]: unknown;
4397
4547
  };
4548
+ type: "installation.update-available";
4398
4549
  durable?: {
4399
4550
  aggregateID: string;
4400
4551
  seq: number;
4401
4552
  version: number;
4402
4553
  };
4403
4554
  location?: LocationRef;
4404
- type: "installation.update-available";
4405
4555
  data: {
4406
4556
  version: string;
4407
4557
  };
4408
4558
  };
4409
- export type V2EventFileEdited = {
4559
+ export type FileEdited = {
4410
4560
  id: string;
4411
4561
  metadata?: {
4412
4562
  [key: string]: unknown;
4413
4563
  };
4564
+ type: "file.edited";
4414
4565
  durable?: {
4415
4566
  aggregateID: string;
4416
4567
  seq: number;
4417
4568
  version: number;
4418
4569
  };
4419
4570
  location?: LocationRef;
4420
- type: "file.edited";
4421
4571
  data: {
4422
4572
  file: string;
4423
4573
  };
4424
4574
  };
4425
- export type V2EventReferenceUpdated = {
4575
+ export type ReferenceUpdated = {
4426
4576
  id: string;
4427
4577
  metadata?: {
4428
4578
  [key: string]: unknown;
4429
4579
  };
4580
+ type: "reference.updated";
4430
4581
  durable?: {
4431
4582
  aggregateID: string;
4432
4583
  seq: number;
4433
4584
  version: number;
4434
4585
  };
4435
4586
  location?: LocationRef;
4436
- type: "reference.updated";
4437
4587
  data: {
4438
4588
  [key: string]: unknown;
4439
4589
  };
4440
4590
  };
4441
- export type V2EventPermissionV2Asked = {
4591
+ export type PermissionV2Asked = {
4442
4592
  id: string;
4443
4593
  metadata?: {
4444
4594
  [key: string]: unknown;
4445
4595
  };
4596
+ type: "permission.v2.asked";
4446
4597
  durable?: {
4447
4598
  aggregateID: string;
4448
4599
  seq: number;
4449
4600
  version: number;
4450
4601
  };
4451
4602
  location?: LocationRef;
4452
- type: "permission.v2.asked";
4453
4603
  data: {
4454
4604
  id: string;
4455
4605
  sessionID: string;
@@ -4462,150 +4612,150 @@ export type V2EventPermissionV2Asked = {
4462
4612
  source?: PermissionV2Source;
4463
4613
  };
4464
4614
  };
4465
- export type V2EventPermissionV2Replied = {
4615
+ export type PermissionV2Replied = {
4466
4616
  id: string;
4467
4617
  metadata?: {
4468
4618
  [key: string]: unknown;
4469
4619
  };
4620
+ type: "permission.v2.replied";
4470
4621
  durable?: {
4471
4622
  aggregateID: string;
4472
4623
  seq: number;
4473
4624
  version: number;
4474
4625
  };
4475
4626
  location?: LocationRef;
4476
- type: "permission.v2.replied";
4477
4627
  data: {
4478
4628
  sessionID: string;
4479
4629
  requestID: string;
4480
4630
  reply: PermissionV2Reply;
4481
4631
  };
4482
4632
  };
4483
- export type V2EventPluginAdded = {
4633
+ export type PluginAdded = {
4484
4634
  id: string;
4485
4635
  metadata?: {
4486
4636
  [key: string]: unknown;
4487
4637
  };
4638
+ type: "plugin.added";
4488
4639
  durable?: {
4489
4640
  aggregateID: string;
4490
4641
  seq: number;
4491
4642
  version: number;
4492
4643
  };
4493
4644
  location?: LocationRef;
4494
- type: "plugin.added";
4495
4645
  data: {
4496
4646
  id: string;
4497
4647
  };
4498
4648
  };
4499
- export type V2EventProjectDirectoriesUpdated = {
4649
+ export type ProjectDirectoriesUpdated = {
4500
4650
  id: string;
4501
4651
  metadata?: {
4502
4652
  [key: string]: unknown;
4503
4653
  };
4654
+ type: "project.directories.updated";
4504
4655
  durable?: {
4505
4656
  aggregateID: string;
4506
4657
  seq: number;
4507
4658
  version: number;
4508
4659
  };
4509
4660
  location?: LocationRef;
4510
- type: "project.directories.updated";
4511
4661
  data: {
4512
4662
  projectID: string;
4513
4663
  };
4514
4664
  };
4515
- export type V2EventFileWatcherUpdated = {
4665
+ export type FileWatcherUpdated = {
4516
4666
  id: string;
4517
4667
  metadata?: {
4518
4668
  [key: string]: unknown;
4519
4669
  };
4670
+ type: "file.watcher.updated";
4520
4671
  durable?: {
4521
4672
  aggregateID: string;
4522
4673
  seq: number;
4523
4674
  version: number;
4524
4675
  };
4525
4676
  location?: LocationRef;
4526
- type: "file.watcher.updated";
4527
4677
  data: {
4528
4678
  file: string;
4529
4679
  event: "add" | "change" | "unlink";
4530
4680
  };
4531
4681
  };
4532
- export type V2EventPtyCreated = {
4682
+ export type PtyCreated = {
4533
4683
  id: string;
4534
4684
  metadata?: {
4535
4685
  [key: string]: unknown;
4536
4686
  };
4687
+ type: "pty.created";
4537
4688
  durable?: {
4538
4689
  aggregateID: string;
4539
4690
  seq: number;
4540
4691
  version: number;
4541
4692
  };
4542
4693
  location?: LocationRef;
4543
- type: "pty.created";
4544
4694
  data: {
4545
4695
  info: Pty;
4546
4696
  };
4547
4697
  };
4548
- export type V2EventPtyUpdated = {
4698
+ export type PtyUpdated = {
4549
4699
  id: string;
4550
4700
  metadata?: {
4551
4701
  [key: string]: unknown;
4552
4702
  };
4703
+ type: "pty.updated";
4553
4704
  durable?: {
4554
4705
  aggregateID: string;
4555
4706
  seq: number;
4556
4707
  version: number;
4557
4708
  };
4558
4709
  location?: LocationRef;
4559
- type: "pty.updated";
4560
4710
  data: {
4561
4711
  info: Pty;
4562
4712
  };
4563
4713
  };
4564
- export type V2EventPtyExited = {
4714
+ export type PtyExited = {
4565
4715
  id: string;
4566
4716
  metadata?: {
4567
4717
  [key: string]: unknown;
4568
4718
  };
4719
+ type: "pty.exited";
4569
4720
  durable?: {
4570
4721
  aggregateID: string;
4571
4722
  seq: number;
4572
4723
  version: number;
4573
4724
  };
4574
4725
  location?: LocationRef;
4575
- type: "pty.exited";
4576
4726
  data: {
4577
4727
  id: string;
4578
4728
  exitCode: number;
4579
4729
  };
4580
4730
  };
4581
- export type V2EventPtyDeleted = {
4731
+ export type PtyDeleted = {
4582
4732
  id: string;
4583
4733
  metadata?: {
4584
4734
  [key: string]: unknown;
4585
4735
  };
4736
+ type: "pty.deleted";
4586
4737
  durable?: {
4587
4738
  aggregateID: string;
4588
4739
  seq: number;
4589
4740
  version: number;
4590
4741
  };
4591
4742
  location?: LocationRef;
4592
- type: "pty.deleted";
4593
4743
  data: {
4594
4744
  id: string;
4595
4745
  };
4596
4746
  };
4597
- export type V2EventQuestionV2Asked = {
4747
+ export type QuestionV2Asked = {
4598
4748
  id: string;
4599
4749
  metadata?: {
4600
4750
  [key: string]: unknown;
4601
4751
  };
4752
+ type: "question.v2.asked";
4602
4753
  durable?: {
4603
4754
  aggregateID: string;
4604
4755
  seq: number;
4605
4756
  version: number;
4606
4757
  };
4607
4758
  location?: LocationRef;
4608
- type: "question.v2.asked";
4609
4759
  data: {
4610
4760
  id: string;
4611
4761
  sessionID: string;
@@ -4616,86 +4766,86 @@ export type V2EventQuestionV2Asked = {
4616
4766
  tool?: QuestionV2Tool;
4617
4767
  };
4618
4768
  };
4619
- export type V2EventQuestionV2Replied = {
4769
+ export type QuestionV2Replied = {
4620
4770
  id: string;
4621
4771
  metadata?: {
4622
4772
  [key: string]: unknown;
4623
4773
  };
4774
+ type: "question.v2.replied";
4624
4775
  durable?: {
4625
4776
  aggregateID: string;
4626
4777
  seq: number;
4627
4778
  version: number;
4628
4779
  };
4629
4780
  location?: LocationRef;
4630
- type: "question.v2.replied";
4631
4781
  data: {
4632
4782
  sessionID: string;
4633
4783
  requestID: string;
4634
4784
  answers: Array<QuestionV2Answer>;
4635
4785
  };
4636
4786
  };
4637
- export type V2EventQuestionV2Rejected = {
4787
+ export type QuestionV2Rejected = {
4638
4788
  id: string;
4639
4789
  metadata?: {
4640
4790
  [key: string]: unknown;
4641
4791
  };
4792
+ type: "question.v2.rejected";
4642
4793
  durable?: {
4643
4794
  aggregateID: string;
4644
4795
  seq: number;
4645
4796
  version: number;
4646
4797
  };
4647
4798
  location?: LocationRef;
4648
- type: "question.v2.rejected";
4649
4799
  data: {
4650
4800
  sessionID: string;
4651
4801
  requestID: string;
4652
4802
  };
4653
4803
  };
4654
- export type V2EventTodoUpdated = {
4804
+ export type TodoUpdated = {
4655
4805
  id: string;
4656
4806
  metadata?: {
4657
4807
  [key: string]: unknown;
4658
4808
  };
4809
+ type: "todo.updated";
4659
4810
  durable?: {
4660
4811
  aggregateID: string;
4661
4812
  seq: number;
4662
4813
  version: number;
4663
4814
  };
4664
4815
  location?: LocationRef;
4665
- type: "todo.updated";
4666
4816
  data: {
4667
4817
  sessionID: string;
4668
4818
  todos: Array<Todo>;
4669
4819
  };
4670
4820
  };
4671
- export type V2EventLspUpdated = {
4821
+ export type LspUpdated = {
4672
4822
  id: string;
4673
4823
  metadata?: {
4674
4824
  [key: string]: unknown;
4675
4825
  };
4826
+ type: "lsp.updated";
4676
4827
  durable?: {
4677
4828
  aggregateID: string;
4678
4829
  seq: number;
4679
4830
  version: number;
4680
4831
  };
4681
4832
  location?: LocationRef;
4682
- type: "lsp.updated";
4683
4833
  data: {
4684
4834
  [key: string]: unknown;
4685
4835
  };
4686
4836
  };
4687
- export type V2EventPermissionAsked = {
4837
+ export type PermissionAsked = {
4688
4838
  id: string;
4689
4839
  metadata?: {
4690
4840
  [key: string]: unknown;
4691
4841
  };
4842
+ type: "permission.asked";
4692
4843
  durable?: {
4693
4844
  aggregateID: string;
4694
4845
  seq: number;
4695
4846
  version: number;
4696
4847
  };
4697
4848
  location?: LocationRef;
4698
- type: "permission.asked";
4699
4849
  data: {
4700
4850
  id: string;
4701
4851
  sessionID: string;
@@ -4711,68 +4861,68 @@ export type V2EventPermissionAsked = {
4711
4861
  };
4712
4862
  };
4713
4863
  };
4714
- export type V2EventPermissionReplied = {
4864
+ export type PermissionReplied = {
4715
4865
  id: string;
4716
4866
  metadata?: {
4717
4867
  [key: string]: unknown;
4718
4868
  };
4869
+ type: "permission.replied";
4719
4870
  durable?: {
4720
4871
  aggregateID: string;
4721
4872
  seq: number;
4722
4873
  version: number;
4723
4874
  };
4724
4875
  location?: LocationRef;
4725
- type: "permission.replied";
4726
4876
  data: {
4727
4877
  sessionID: string;
4728
4878
  requestID: string;
4729
4879
  reply: "once" | "always" | "reject";
4730
4880
  };
4731
4881
  };
4732
- export type V2EventTuiPromptAppend = {
4882
+ export type TuiPromptAppend = {
4733
4883
  id: string;
4734
4884
  metadata?: {
4735
4885
  [key: string]: unknown;
4736
4886
  };
4887
+ type: "tui.prompt.append";
4737
4888
  durable?: {
4738
4889
  aggregateID: string;
4739
4890
  seq: number;
4740
4891
  version: number;
4741
4892
  };
4742
4893
  location?: LocationRef;
4743
- type: "tui.prompt.append";
4744
4894
  data: {
4745
4895
  text: string;
4746
4896
  };
4747
4897
  };
4748
- export type V2EventTuiCommandExecute = {
4898
+ export type TuiCommandExecute = {
4749
4899
  id: string;
4750
4900
  metadata?: {
4751
4901
  [key: string]: unknown;
4752
4902
  };
4903
+ type: "tui.command.execute";
4753
4904
  durable?: {
4754
4905
  aggregateID: string;
4755
4906
  seq: number;
4756
4907
  version: number;
4757
4908
  };
4758
4909
  location?: LocationRef;
4759
- type: "tui.command.execute";
4760
4910
  data: {
4761
4911
  command: "session.list" | "session.new" | "session.share" | "session.interrupt" | "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;
4762
4912
  };
4763
4913
  };
4764
- export type V2EventTuiToastShow = {
4914
+ export type TuiToastShow = {
4765
4915
  id: string;
4766
4916
  metadata?: {
4767
4917
  [key: string]: unknown;
4768
4918
  };
4919
+ type: "tui.toast.show";
4769
4920
  durable?: {
4770
4921
  aggregateID: string;
4771
4922
  seq: number;
4772
4923
  version: number;
4773
4924
  };
4774
4925
  location?: LocationRef;
4775
- type: "tui.toast.show";
4776
4926
  data: {
4777
4927
  title?: string;
4778
4928
  message: string;
@@ -4780,18 +4930,18 @@ export type V2EventTuiToastShow = {
4780
4930
  duration?: number;
4781
4931
  };
4782
4932
  };
4783
- export type V2EventTuiSessionSelect = {
4933
+ export type TuiSessionSelect = {
4784
4934
  id: string;
4785
4935
  metadata?: {
4786
4936
  [key: string]: unknown;
4787
4937
  };
4938
+ type: "tui.session.select";
4788
4939
  durable?: {
4789
4940
  aggregateID: string;
4790
4941
  seq: number;
4791
4942
  version: number;
4792
4943
  };
4793
4944
  location?: LocationRef;
4794
- type: "tui.session.select";
4795
4945
  data: {
4796
4946
  /**
4797
4947
  * Session ID to navigate to
@@ -4799,51 +4949,51 @@ export type V2EventTuiSessionSelect = {
4799
4949
  sessionID: string;
4800
4950
  };
4801
4951
  };
4802
- export type V2EventMcpToolsChanged = {
4952
+ export type McpToolsChanged = {
4803
4953
  id: string;
4804
4954
  metadata?: {
4805
4955
  [key: string]: unknown;
4806
4956
  };
4957
+ type: "mcp.tools.changed";
4807
4958
  durable?: {
4808
4959
  aggregateID: string;
4809
4960
  seq: number;
4810
4961
  version: number;
4811
4962
  };
4812
4963
  location?: LocationRef;
4813
- type: "mcp.tools.changed";
4814
4964
  data: {
4815
4965
  server: string;
4816
4966
  };
4817
4967
  };
4818
- export type V2EventMcpBrowserOpenFailed = {
4968
+ export type McpBrowserOpenFailed = {
4819
4969
  id: string;
4820
4970
  metadata?: {
4821
4971
  [key: string]: unknown;
4822
4972
  };
4973
+ type: "mcp.browser.open.failed";
4823
4974
  durable?: {
4824
4975
  aggregateID: string;
4825
4976
  seq: number;
4826
4977
  version: number;
4827
4978
  };
4828
4979
  location?: LocationRef;
4829
- type: "mcp.browser.open.failed";
4830
4980
  data: {
4831
4981
  mcpName: string;
4832
4982
  url: string;
4833
4983
  };
4834
4984
  };
4835
- export type V2EventCommandExecuted = {
4985
+ export type CommandExecuted = {
4836
4986
  id: string;
4837
4987
  metadata?: {
4838
4988
  [key: string]: unknown;
4839
4989
  };
4990
+ type: "command.executed";
4840
4991
  durable?: {
4841
4992
  aggregateID: string;
4842
4993
  seq: number;
4843
4994
  version: number;
4844
4995
  };
4845
4996
  location?: LocationRef;
4846
- type: "command.executed";
4847
4997
  data: {
4848
4998
  name: string;
4849
4999
  sessionID: string;
@@ -4851,87 +5001,57 @@ export type V2EventCommandExecuted = {
4851
5001
  messageID: string;
4852
5002
  };
4853
5003
  };
4854
- export type V2EventProjectUpdated = {
5004
+ export type ProjectUpdated = {
4855
5005
  id: string;
4856
5006
  metadata?: {
4857
5007
  [key: string]: unknown;
4858
5008
  };
5009
+ type: "project.updated";
4859
5010
  durable?: {
4860
5011
  aggregateID: string;
4861
5012
  seq: number;
4862
5013
  version: number;
4863
5014
  };
4864
5015
  location?: LocationRef;
4865
- type: "project.updated";
4866
5016
  data: {
4867
5017
  id: string;
4868
5018
  worktree: string;
4869
- vcs?: "git";
5019
+ vcs?: ProjectVcs;
4870
5020
  name?: string;
4871
- icon?: {
4872
- url?: string;
4873
- override?: string;
4874
- color?: string;
4875
- };
4876
- commands?: {
4877
- /**
4878
- * Startup script to run when creating a new workspace (worktree)
4879
- */
4880
- start?: string;
4881
- };
4882
- time: {
4883
- created: number;
4884
- updated: number;
4885
- initialized?: number;
4886
- };
5021
+ icon?: ProjectIcon;
5022
+ commands?: ProjectCommands;
5023
+ time: ProjectTime;
4887
5024
  sandboxes: Array<string>;
4888
5025
  };
4889
5026
  };
4890
- export type V2EventSessionStatus = {
4891
- id: string;
4892
- metadata?: {
4893
- [key: string]: unknown;
4894
- };
4895
- durable?: {
4896
- aggregateID: string;
4897
- seq: number;
4898
- version: number;
4899
- };
4900
- location?: LocationRef;
4901
- type: "session.status";
4902
- data: {
4903
- sessionID: string;
4904
- status: SessionStatus;
4905
- };
4906
- };
4907
- export type V2EventSessionIdle = {
5027
+ export type SessionIdle = {
4908
5028
  id: string;
4909
5029
  metadata?: {
4910
5030
  [key: string]: unknown;
4911
5031
  };
5032
+ type: "session.idle";
4912
5033
  durable?: {
4913
5034
  aggregateID: string;
4914
5035
  seq: number;
4915
5036
  version: number;
4916
5037
  };
4917
5038
  location?: LocationRef;
4918
- type: "session.idle";
4919
5039
  data: {
4920
5040
  sessionID: string;
4921
5041
  };
4922
5042
  };
4923
- export type V2EventQuestionAsked = {
5043
+ export type QuestionAsked = {
4924
5044
  id: string;
4925
5045
  metadata?: {
4926
5046
  [key: string]: unknown;
4927
5047
  };
5048
+ type: "question.asked";
4928
5049
  durable?: {
4929
5050
  aggregateID: string;
4930
5051
  seq: number;
4931
5052
  version: number;
4932
5053
  };
4933
5054
  location?: LocationRef;
4934
- type: "question.asked";
4935
5055
  data: {
4936
5056
  id: string;
4937
5057
  sessionID: string;
@@ -4942,183 +5062,148 @@ export type V2EventQuestionAsked = {
4942
5062
  tool?: QuestionTool;
4943
5063
  };
4944
5064
  };
4945
- export type V2EventQuestionReplied = {
4946
- id: string;
4947
- metadata?: {
4948
- [key: string]: unknown;
4949
- };
4950
- durable?: {
4951
- aggregateID: string;
4952
- seq: number;
4953
- version: number;
4954
- };
4955
- location?: LocationRef;
4956
- type: "question.replied";
4957
- data: {
4958
- sessionID: string;
4959
- requestID: string;
4960
- answers: Array<QuestionAnswer>;
4961
- };
4962
- };
4963
- export type V2EventQuestionRejected = {
4964
- id: string;
4965
- metadata?: {
4966
- [key: string]: unknown;
4967
- };
4968
- durable?: {
4969
- aggregateID: string;
4970
- seq: number;
4971
- version: number;
4972
- };
4973
- location?: LocationRef;
4974
- type: "question.rejected";
4975
- data: {
4976
- sessionID: string;
4977
- requestID: string;
4978
- };
4979
- };
4980
- export type V2EventSessionCompacted = {
5065
+ export type SessionCompacted = {
4981
5066
  id: string;
4982
5067
  metadata?: {
4983
5068
  [key: string]: unknown;
4984
5069
  };
5070
+ type: "session.compacted";
4985
5071
  durable?: {
4986
5072
  aggregateID: string;
4987
5073
  seq: number;
4988
5074
  version: number;
4989
5075
  };
4990
5076
  location?: LocationRef;
4991
- type: "session.compacted";
4992
5077
  data: {
4993
5078
  sessionID: string;
4994
5079
  };
4995
5080
  };
4996
- export type V2EventVcsBranchUpdated = {
5081
+ export type VcsBranchUpdated = {
4997
5082
  id: string;
4998
5083
  metadata?: {
4999
5084
  [key: string]: unknown;
5000
5085
  };
5086
+ type: "vcs.branch.updated";
5001
5087
  durable?: {
5002
5088
  aggregateID: string;
5003
5089
  seq: number;
5004
5090
  version: number;
5005
5091
  };
5006
5092
  location?: LocationRef;
5007
- type: "vcs.branch.updated";
5008
5093
  data: {
5009
5094
  branch?: string;
5010
5095
  };
5011
5096
  };
5012
- export type V2EventWorkspaceReady = {
5097
+ export type WorkspaceReady = {
5013
5098
  id: string;
5014
5099
  metadata?: {
5015
5100
  [key: string]: unknown;
5016
5101
  };
5102
+ type: "workspace.ready";
5017
5103
  durable?: {
5018
5104
  aggregateID: string;
5019
5105
  seq: number;
5020
5106
  version: number;
5021
5107
  };
5022
5108
  location?: LocationRef;
5023
- type: "workspace.ready";
5024
5109
  data: {
5025
5110
  name: string;
5026
5111
  };
5027
5112
  };
5028
- export type V2EventWorkspaceFailed = {
5113
+ export type WorkspaceFailed = {
5029
5114
  id: string;
5030
5115
  metadata?: {
5031
5116
  [key: string]: unknown;
5032
5117
  };
5118
+ type: "workspace.failed";
5033
5119
  durable?: {
5034
5120
  aggregateID: string;
5035
5121
  seq: number;
5036
5122
  version: number;
5037
5123
  };
5038
5124
  location?: LocationRef;
5039
- type: "workspace.failed";
5040
5125
  data: {
5041
5126
  message: string;
5042
5127
  };
5043
5128
  };
5044
- export type V2EventWorkspaceStatus = {
5129
+ export type WorkspaceStatus = {
5045
5130
  id: string;
5046
5131
  metadata?: {
5047
5132
  [key: string]: unknown;
5048
5133
  };
5134
+ type: "workspace.status";
5049
5135
  durable?: {
5050
5136
  aggregateID: string;
5051
5137
  seq: number;
5052
5138
  version: number;
5053
5139
  };
5054
5140
  location?: LocationRef;
5055
- type: "workspace.status";
5056
5141
  data: {
5057
5142
  workspaceID: string;
5058
5143
  status: "connected" | "connecting" | "disconnected" | "error";
5059
5144
  };
5060
5145
  };
5061
- export type V2EventWorktreeReady = {
5146
+ export type WorktreeReady = {
5062
5147
  id: string;
5063
5148
  metadata?: {
5064
5149
  [key: string]: unknown;
5065
5150
  };
5151
+ type: "worktree.ready";
5066
5152
  durable?: {
5067
5153
  aggregateID: string;
5068
5154
  seq: number;
5069
5155
  version: number;
5070
5156
  };
5071
5157
  location?: LocationRef;
5072
- type: "worktree.ready";
5073
5158
  data: {
5074
5159
  name: string;
5075
5160
  branch?: string;
5076
5161
  };
5077
5162
  };
5078
- export type V2EventWorktreeFailed = {
5163
+ export type WorktreeFailed = {
5079
5164
  id: string;
5080
5165
  metadata?: {
5081
5166
  [key: string]: unknown;
5082
5167
  };
5168
+ type: "worktree.failed";
5083
5169
  durable?: {
5084
5170
  aggregateID: string;
5085
5171
  seq: number;
5086
5172
  version: number;
5087
5173
  };
5088
5174
  location?: LocationRef;
5089
- type: "worktree.failed";
5090
5175
  data: {
5091
5176
  message: string;
5092
5177
  };
5093
5178
  };
5094
- export type V2EventServerConnected = {
5179
+ export type ServerConnected = {
5095
5180
  id: string;
5096
5181
  metadata?: {
5097
5182
  [key: string]: unknown;
5098
5183
  };
5184
+ type: "server.connected";
5099
5185
  durable?: {
5100
5186
  aggregateID: string;
5101
5187
  seq: number;
5102
5188
  version: number;
5103
5189
  };
5104
5190
  location?: LocationRef;
5105
- type: "server.connected";
5106
5191
  data: {
5107
5192
  [key: string]: unknown;
5108
5193
  };
5109
5194
  };
5110
- export type V2EventGlobalDisposed = {
5195
+ export type GlobalDisposed = {
5111
5196
  id: string;
5112
5197
  metadata?: {
5113
5198
  [key: string]: unknown;
5114
5199
  };
5200
+ type: "global.disposed";
5115
5201
  durable?: {
5116
5202
  aggregateID: string;
5117
5203
  seq: number;
5118
5204
  version: number;
5119
5205
  };
5120
5206
  location?: LocationRef;
5121
- type: "global.disposed";
5122
5207
  data: {
5123
5208
  [key: string]: unknown;
5124
5209
  };
@@ -5151,12 +5236,13 @@ export type ReferenceGitSource = {
5151
5236
  description?: string;
5152
5237
  hidden?: boolean;
5153
5238
  };
5239
+ export type ReferenceSource = ReferenceLocalSource | ReferenceGitSource;
5154
5240
  export type ReferenceInfo = {
5155
5241
  name: string;
5156
5242
  path: string;
5157
5243
  description?: string;
5158
5244
  hidden?: boolean;
5159
- source: ReferenceLocalSource | ReferenceGitSource;
5245
+ source: ReferenceSource;
5160
5246
  };
5161
5247
  export type ProjectCopyCopy = {
5162
5248
  directory: string;
@@ -5264,11 +5350,7 @@ export type EventSessionNextModelSwitched = {
5264
5350
  timestamp: number;
5265
5351
  sessionID: string;
5266
5352
  messageID: string;
5267
- model: {
5268
- id: string;
5269
- providerID: string;
5270
- variant?: string;
5271
- };
5353
+ model: ModelRef;
5272
5354
  };
5273
5355
  };
5274
5356
  export type EventSessionNextMoved = {
@@ -5352,11 +5434,7 @@ export type EventSessionNextStepStarted = {
5352
5434
  sessionID: string;
5353
5435
  assistantMessageID: string;
5354
5436
  agent: string;
5355
- model: {
5356
- id: string;
5357
- providerID: string;
5358
- variant?: string;
5359
- };
5437
+ model: ModelRef;
5360
5438
  snapshot?: string;
5361
5439
  };
5362
5440
  };
@@ -5379,6 +5457,7 @@ export type EventSessionNextStepEnded = {
5379
5457
  };
5380
5458
  };
5381
5459
  snapshot?: string;
5460
+ files?: Array<string>;
5382
5461
  };
5383
5462
  };
5384
5463
  export type EventSessionNextStepFailed = {
@@ -5431,11 +5510,7 @@ export type EventSessionNextReasoningStarted = {
5431
5510
  sessionID: string;
5432
5511
  assistantMessageID: string;
5433
5512
  reasoningID: string;
5434
- providerMetadata?: {
5435
- [key: string]: {
5436
- [key: string]: unknown;
5437
- };
5438
- };
5513
+ providerMetadata?: LlmProviderMetadata;
5439
5514
  };
5440
5515
  };
5441
5516
  export type EventSessionNextReasoningDelta = {
@@ -5458,11 +5533,7 @@ export type EventSessionNextReasoningEnded = {
5458
5533
  assistantMessageID: string;
5459
5534
  reasoningID: string;
5460
5535
  text: string;
5461
- providerMetadata?: {
5462
- [key: string]: {
5463
- [key: string]: unknown;
5464
- };
5465
- };
5536
+ providerMetadata?: LlmProviderMetadata;
5466
5537
  };
5467
5538
  };
5468
5539
  export type EventSessionNextToolInputStarted = {
@@ -5512,11 +5583,7 @@ export type EventSessionNextToolCalled = {
5512
5583
  };
5513
5584
  provider: {
5514
5585
  executed: boolean;
5515
- metadata?: {
5516
- [key: string]: {
5517
- [key: string]: unknown;
5518
- };
5519
- };
5586
+ metadata?: LlmProviderMetadata;
5520
5587
  };
5521
5588
  };
5522
5589
  };
@@ -5531,7 +5598,7 @@ export type EventSessionNextToolProgress = {
5531
5598
  structured: {
5532
5599
  [key: string]: unknown;
5533
5600
  };
5534
- content: Array<ToolTextContent | ToolFileContent>;
5601
+ content: Array<LlmToolContent>;
5535
5602
  };
5536
5603
  };
5537
5604
  export type EventSessionNextToolSuccess = {
@@ -5545,16 +5612,12 @@ export type EventSessionNextToolSuccess = {
5545
5612
  structured: {
5546
5613
  [key: string]: unknown;
5547
5614
  };
5548
- content: Array<ToolTextContent | ToolFileContent>;
5615
+ content: Array<LlmToolContent>;
5549
5616
  outputPaths?: Array<string>;
5550
5617
  result?: unknown;
5551
5618
  provider: {
5552
5619
  executed: boolean;
5553
- metadata?: {
5554
- [key: string]: {
5555
- [key: string]: unknown;
5556
- };
5557
- };
5620
+ metadata?: LlmProviderMetadata;
5558
5621
  };
5559
5622
  };
5560
5623
  };
@@ -5570,11 +5633,7 @@ export type EventSessionNextToolFailed = {
5570
5633
  result?: unknown;
5571
5634
  provider: {
5572
5635
  executed: boolean;
5573
- metadata?: {
5574
- [key: string]: {
5575
- [key: string]: unknown;
5576
- };
5577
- };
5636
+ metadata?: LlmProviderMetadata;
5578
5637
  };
5579
5638
  };
5580
5639
  };
@@ -5620,6 +5679,32 @@ export type EventSessionNextCompactionEnded = {
5620
5679
  recent: string;
5621
5680
  };
5622
5681
  };
5682
+ export type EventSessionNextRevertStaged = {
5683
+ id: string;
5684
+ type: "session.next.revert.staged";
5685
+ properties: {
5686
+ timestamp: number;
5687
+ sessionID: string;
5688
+ revert: RevertState;
5689
+ };
5690
+ };
5691
+ export type EventSessionNextRevertCleared = {
5692
+ id: string;
5693
+ type: "session.next.revert.cleared";
5694
+ properties: {
5695
+ timestamp: number;
5696
+ sessionID: string;
5697
+ };
5698
+ };
5699
+ export type EventSessionNextRevertCommitted = {
5700
+ id: string;
5701
+ type: "session.next.revert.committed";
5702
+ properties: {
5703
+ timestamp: number;
5704
+ sessionID: string;
5705
+ messageID: string;
5706
+ };
5707
+ };
5623
5708
  export type EventMessagePartDelta = {
5624
5709
  id: string;
5625
5710
  type: "message.part.delta";
@@ -5850,27 +5935,14 @@ export type EventCommandExecuted = {
5850
5935
  export type EventProjectUpdated = {
5851
5936
  id: string;
5852
5937
  type: "project.updated";
5853
- properties: {
5854
- id: string;
5855
- worktree: string;
5856
- vcs?: "git";
5857
- name?: string;
5858
- icon?: {
5859
- url?: string;
5860
- override?: string;
5861
- color?: string;
5862
- };
5863
- commands?: {
5864
- /**
5865
- * Startup script to run when creating a new workspace (worktree)
5866
- */
5867
- start?: string;
5868
- };
5869
- time: {
5870
- created: number;
5871
- updated: number;
5872
- initialized?: number;
5873
- };
5938
+ properties: {
5939
+ id: string;
5940
+ worktree: string;
5941
+ vcs?: ProjectVcs;
5942
+ name?: string;
5943
+ icon?: ProjectIcon;
5944
+ commands?: ProjectCommands;
5945
+ time: ProjectTime;
5874
5946
  sandboxes: Array<string>;
5875
5947
  };
5876
5948
  };
@@ -7427,17 +7499,8 @@ export type ProjectInitGitResponse = ProjectInitGitResponses[keyof ProjectInitGi
7427
7499
  export type ProjectUpdateData = {
7428
7500
  body?: {
7429
7501
  name?: string;
7430
- icon?: {
7431
- url?: string;
7432
- override?: string;
7433
- color?: string;
7434
- };
7435
- commands?: {
7436
- /**
7437
- * Startup script to run when creating a new workspace (worktree)
7438
- */
7439
- start?: string;
7440
- };
7502
+ icon?: ProjectIcon;
7503
+ commands?: ProjectCommands;
7441
7504
  };
7442
7505
  path: {
7443
7506
  projectID: string;
@@ -7724,10 +7787,7 @@ export type PtyConnectTokenResponses = {
7724
7787
  /**
7725
7788
  * WebSocket connect token
7726
7789
  */
7727
- 200: {
7728
- ticket: string;
7729
- expires_in: number;
7730
- };
7790
+ 200: PtyTicketConnectToken;
7731
7791
  };
7732
7792
  export type PtyConnectTokenResponse = PtyConnectTokenResponses[keyof PtyConnectTokenResponses];
7733
7793
  export type QuestionListData = {
@@ -9454,10 +9514,7 @@ export type ExperimentalWorkspaceStatusResponses = {
9454
9514
  /**
9455
9515
  * Workspace status
9456
9516
  */
9457
- 200: Array<{
9458
- workspaceID: string;
9459
- status: "connected" | "connecting" | "disconnected" | "error";
9460
- }>;
9517
+ 200: Array<WorkspaceEventConnectionStatus>;
9461
9518
  };
9462
9519
  export type ExperimentalWorkspaceStatusResponse = ExperimentalWorkspaceStatusResponses[keyof ExperimentalWorkspaceStatusResponses];
9463
9520
  export type ExperimentalWorkspaceRemoveData = {
@@ -9619,42 +9676,302 @@ export type V2SessionListData = {
9619
9676
  */
9620
9677
  cursor?: string;
9621
9678
  };
9622
- url: "/api/session";
9679
+ url: "/api/session";
9680
+ };
9681
+ export type V2SessionListErrors = {
9682
+ /**
9683
+ * InvalidCursorError | InvalidRequestError
9684
+ */
9685
+ 400: InvalidCursorError | InvalidRequestError;
9686
+ /**
9687
+ * UnauthorizedError
9688
+ */
9689
+ 401: UnauthorizedError;
9690
+ };
9691
+ export type V2SessionListError = V2SessionListErrors[keyof V2SessionListErrors];
9692
+ export type V2SessionListResponses = {
9693
+ /**
9694
+ * SessionsResponse
9695
+ */
9696
+ 200: SessionsResponse;
9697
+ };
9698
+ export type V2SessionListResponse = V2SessionListResponses[keyof V2SessionListResponses];
9699
+ export type V2SessionCreateData = {
9700
+ body: {
9701
+ id?: string;
9702
+ agent?: string;
9703
+ model?: ModelRef;
9704
+ location?: LocationRef;
9705
+ };
9706
+ path?: never;
9707
+ query?: never;
9708
+ url: "/api/session";
9709
+ };
9710
+ export type V2SessionCreateErrors = {
9711
+ /**
9712
+ * InvalidRequestError
9713
+ */
9714
+ 400: InvalidRequestError;
9715
+ /**
9716
+ * UnauthorizedError
9717
+ */
9718
+ 401: UnauthorizedError;
9719
+ };
9720
+ export type V2SessionCreateError = V2SessionCreateErrors[keyof V2SessionCreateErrors];
9721
+ export type V2SessionCreateResponses = {
9722
+ /**
9723
+ * Success
9724
+ */
9725
+ 200: {
9726
+ data: SessionV2Info;
9727
+ };
9728
+ };
9729
+ export type V2SessionCreateResponse = V2SessionCreateResponses[keyof V2SessionCreateResponses];
9730
+ export type V2SessionActiveData = {
9731
+ body?: never;
9732
+ path?: never;
9733
+ query?: never;
9734
+ url: "/api/session/active";
9735
+ };
9736
+ export type V2SessionActiveErrors = {
9737
+ /**
9738
+ * InvalidRequestError
9739
+ */
9740
+ 400: InvalidRequestError;
9741
+ /**
9742
+ * UnauthorizedError
9743
+ */
9744
+ 401: UnauthorizedError;
9745
+ };
9746
+ export type V2SessionActiveError = V2SessionActiveErrors[keyof V2SessionActiveErrors];
9747
+ export type V2SessionActiveResponses = {
9748
+ /**
9749
+ * Success
9750
+ */
9751
+ 200: {
9752
+ data: {
9753
+ [key: string]: unknown | SessionActive;
9754
+ };
9755
+ };
9756
+ };
9757
+ export type V2SessionActiveResponse = V2SessionActiveResponses[keyof V2SessionActiveResponses];
9758
+ export type V2SessionGetData = {
9759
+ body?: never;
9760
+ path: {
9761
+ sessionID: string;
9762
+ };
9763
+ query?: never;
9764
+ url: "/api/session/{sessionID}";
9765
+ };
9766
+ export type V2SessionGetErrors = {
9767
+ /**
9768
+ * InvalidRequestError
9769
+ */
9770
+ 400: InvalidRequestError;
9771
+ /**
9772
+ * UnauthorizedError
9773
+ */
9774
+ 401: UnauthorizedError;
9775
+ /**
9776
+ * SessionNotFoundError
9777
+ */
9778
+ 404: SessionNotFoundError;
9779
+ };
9780
+ export type V2SessionGetError = V2SessionGetErrors[keyof V2SessionGetErrors];
9781
+ export type V2SessionGetResponses = {
9782
+ /**
9783
+ * Success
9784
+ */
9785
+ 200: {
9786
+ data: SessionV2Info;
9787
+ };
9788
+ };
9789
+ export type V2SessionGetResponse = V2SessionGetResponses[keyof V2SessionGetResponses];
9790
+ export type V2SessionSwitchAgentData = {
9791
+ body: {
9792
+ agent: string;
9793
+ };
9794
+ path: {
9795
+ sessionID: string;
9796
+ };
9797
+ query?: never;
9798
+ url: "/api/session/{sessionID}/agent";
9799
+ };
9800
+ export type V2SessionSwitchAgentErrors = {
9801
+ /**
9802
+ * InvalidRequestError
9803
+ */
9804
+ 400: InvalidRequestError;
9805
+ /**
9806
+ * UnauthorizedError
9807
+ */
9808
+ 401: UnauthorizedError;
9809
+ /**
9810
+ * SessionNotFoundError
9811
+ */
9812
+ 404: SessionNotFoundError;
9813
+ };
9814
+ export type V2SessionSwitchAgentError = V2SessionSwitchAgentErrors[keyof V2SessionSwitchAgentErrors];
9815
+ export type V2SessionSwitchAgentResponses = {
9816
+ /**
9817
+ * <No Content>
9818
+ */
9819
+ 204: void;
9820
+ };
9821
+ export type V2SessionSwitchAgentResponse = V2SessionSwitchAgentResponses[keyof V2SessionSwitchAgentResponses];
9822
+ export type V2SessionSwitchModelData = {
9823
+ body: {
9824
+ model: ModelRef;
9825
+ };
9826
+ path: {
9827
+ sessionID: string;
9828
+ };
9829
+ query?: never;
9830
+ url: "/api/session/{sessionID}/model";
9831
+ };
9832
+ export type V2SessionSwitchModelErrors = {
9833
+ /**
9834
+ * InvalidRequestError
9835
+ */
9836
+ 400: InvalidRequestError;
9837
+ /**
9838
+ * UnauthorizedError
9839
+ */
9840
+ 401: UnauthorizedError;
9841
+ /**
9842
+ * SessionNotFoundError
9843
+ */
9844
+ 404: SessionNotFoundError;
9845
+ };
9846
+ export type V2SessionSwitchModelError = V2SessionSwitchModelErrors[keyof V2SessionSwitchModelErrors];
9847
+ export type V2SessionSwitchModelResponses = {
9848
+ /**
9849
+ * <No Content>
9850
+ */
9851
+ 204: void;
9852
+ };
9853
+ export type V2SessionSwitchModelResponse = V2SessionSwitchModelResponses[keyof V2SessionSwitchModelResponses];
9854
+ export type V2SessionPromptData = {
9855
+ body: {
9856
+ id?: string;
9857
+ prompt: PromptInput;
9858
+ delivery?: "steer" | "queue";
9859
+ resume?: boolean;
9860
+ };
9861
+ path: {
9862
+ sessionID: string;
9863
+ };
9864
+ query?: never;
9865
+ url: "/api/session/{sessionID}/prompt";
9866
+ };
9867
+ export type V2SessionPromptErrors = {
9868
+ /**
9869
+ * InvalidRequestError
9870
+ */
9871
+ 400: InvalidRequestError;
9872
+ /**
9873
+ * UnauthorizedError
9874
+ */
9875
+ 401: UnauthorizedError;
9876
+ /**
9877
+ * SessionNotFoundError
9878
+ */
9879
+ 404: SessionNotFoundError;
9880
+ /**
9881
+ * ConflictError
9882
+ */
9883
+ 409: ConflictError;
9884
+ };
9885
+ export type V2SessionPromptError = V2SessionPromptErrors[keyof V2SessionPromptErrors];
9886
+ export type V2SessionPromptResponses = {
9887
+ /**
9888
+ * Success
9889
+ */
9890
+ 200: {
9891
+ data: SessionInputAdmitted;
9892
+ };
9893
+ };
9894
+ export type V2SessionPromptResponse = V2SessionPromptResponses[keyof V2SessionPromptResponses];
9895
+ export type V2SessionCompactData = {
9896
+ body?: never;
9897
+ path: {
9898
+ sessionID: string;
9899
+ };
9900
+ query?: never;
9901
+ url: "/api/session/{sessionID}/compact";
9902
+ };
9903
+ export type V2SessionCompactErrors = {
9904
+ /**
9905
+ * InvalidRequestError
9906
+ */
9907
+ 400: InvalidRequestError;
9908
+ /**
9909
+ * UnauthorizedError
9910
+ */
9911
+ 401: UnauthorizedError;
9912
+ /**
9913
+ * SessionNotFoundError
9914
+ */
9915
+ 404: SessionNotFoundError;
9916
+ /**
9917
+ * ServiceUnavailableError
9918
+ */
9919
+ 503: ServiceUnavailableError;
9920
+ };
9921
+ export type V2SessionCompactError = V2SessionCompactErrors[keyof V2SessionCompactErrors];
9922
+ export type V2SessionCompactResponses = {
9923
+ /**
9924
+ * <No Content>
9925
+ */
9926
+ 204: void;
9927
+ };
9928
+ export type V2SessionCompactResponse = V2SessionCompactResponses[keyof V2SessionCompactResponses];
9929
+ export type V2SessionWaitData = {
9930
+ body?: never;
9931
+ path: {
9932
+ sessionID: string;
9933
+ };
9934
+ query?: never;
9935
+ url: "/api/session/{sessionID}/wait";
9623
9936
  };
9624
- export type V2SessionListErrors = {
9937
+ export type V2SessionWaitErrors = {
9625
9938
  /**
9626
- * InvalidCursorError | InvalidRequestError
9939
+ * InvalidRequestError
9627
9940
  */
9628
- 400: InvalidCursorError | InvalidRequestError;
9941
+ 400: InvalidRequestError;
9629
9942
  /**
9630
9943
  * UnauthorizedError
9631
9944
  */
9632
9945
  401: UnauthorizedError;
9946
+ /**
9947
+ * SessionNotFoundError
9948
+ */
9949
+ 404: SessionNotFoundError;
9950
+ /**
9951
+ * ServiceUnavailableError
9952
+ */
9953
+ 503: ServiceUnavailableError;
9633
9954
  };
9634
- export type V2SessionListError = V2SessionListErrors[keyof V2SessionListErrors];
9635
- export type V2SessionListResponses = {
9955
+ export type V2SessionWaitError = V2SessionWaitErrors[keyof V2SessionWaitErrors];
9956
+ export type V2SessionWaitResponses = {
9636
9957
  /**
9637
- * SessionsResponse
9958
+ * <No Content>
9638
9959
  */
9639
- 200: SessionsResponse;
9960
+ 204: void;
9640
9961
  };
9641
- export type V2SessionListResponse = V2SessionListResponses[keyof V2SessionListResponses];
9642
- export type V2SessionCreateData = {
9962
+ export type V2SessionWaitResponse = V2SessionWaitResponses[keyof V2SessionWaitResponses];
9963
+ export type V2SessionRevertStageData = {
9643
9964
  body: {
9644
- id?: string;
9645
- agent?: string;
9646
- model?: {
9647
- id: string;
9648
- providerID: string;
9649
- variant?: string;
9650
- };
9651
- location?: LocationRef;
9965
+ messageID: string;
9966
+ files?: boolean;
9967
+ };
9968
+ path: {
9969
+ sessionID: string;
9652
9970
  };
9653
- path?: never;
9654
9971
  query?: never;
9655
- url: "/api/session";
9972
+ url: "/api/session/{sessionID}/revert/stage";
9656
9973
  };
9657
- export type V2SessionCreateErrors = {
9974
+ export type V2SessionRevertStageErrors = {
9658
9975
  /**
9659
9976
  * InvalidRequestError
9660
9977
  */
@@ -9663,26 +9980,34 @@ export type V2SessionCreateErrors = {
9663
9980
  * UnauthorizedError
9664
9981
  */
9665
9982
  401: UnauthorizedError;
9983
+ /**
9984
+ * MessageNotFoundError | SessionNotFoundError
9985
+ */
9986
+ 404: MessageNotFoundError | SessionNotFoundError;
9987
+ /**
9988
+ * UnknownError
9989
+ */
9990
+ 500: UnknownError1;
9666
9991
  };
9667
- export type V2SessionCreateError = V2SessionCreateErrors[keyof V2SessionCreateErrors];
9668
- export type V2SessionCreateResponses = {
9992
+ export type V2SessionRevertStageError = V2SessionRevertStageErrors[keyof V2SessionRevertStageErrors];
9993
+ export type V2SessionRevertStageResponses = {
9669
9994
  /**
9670
9995
  * Success
9671
9996
  */
9672
9997
  200: {
9673
- data: SessionV2Info;
9998
+ data: RevertState;
9674
9999
  };
9675
10000
  };
9676
- export type V2SessionCreateResponse = V2SessionCreateResponses[keyof V2SessionCreateResponses];
9677
- export type V2SessionGetData = {
10001
+ export type V2SessionRevertStageResponse = V2SessionRevertStageResponses[keyof V2SessionRevertStageResponses];
10002
+ export type V2SessionRevertClearData = {
9678
10003
  body?: never;
9679
10004
  path: {
9680
10005
  sessionID: string;
9681
10006
  };
9682
10007
  query?: never;
9683
- url: "/api/session/{sessionID}";
10008
+ url: "/api/session/{sessionID}/revert/clear";
9684
10009
  };
9685
- export type V2SessionGetErrors = {
10010
+ export type V2SessionRevertClearErrors = {
9686
10011
  /**
9687
10012
  * InvalidRequestError
9688
10013
  */
@@ -9695,28 +10020,28 @@ export type V2SessionGetErrors = {
9695
10020
  * SessionNotFoundError
9696
10021
  */
9697
10022
  404: SessionNotFoundError;
10023
+ /**
10024
+ * UnknownError
10025
+ */
10026
+ 500: UnknownError1;
9698
10027
  };
9699
- export type V2SessionGetError = V2SessionGetErrors[keyof V2SessionGetErrors];
9700
- export type V2SessionGetResponses = {
10028
+ export type V2SessionRevertClearError = V2SessionRevertClearErrors[keyof V2SessionRevertClearErrors];
10029
+ export type V2SessionRevertClearResponses = {
9701
10030
  /**
9702
- * Success
10031
+ * <No Content>
9703
10032
  */
9704
- 200: {
9705
- data: SessionV2Info;
9706
- };
10033
+ 204: void;
9707
10034
  };
9708
- export type V2SessionGetResponse = V2SessionGetResponses[keyof V2SessionGetResponses];
9709
- export type V2SessionSwitchAgentData = {
9710
- body: {
9711
- agent: string;
9712
- };
10035
+ export type V2SessionRevertClearResponse = V2SessionRevertClearResponses[keyof V2SessionRevertClearResponses];
10036
+ export type V2SessionRevertCommitData = {
10037
+ body?: never;
9713
10038
  path: {
9714
10039
  sessionID: string;
9715
10040
  };
9716
10041
  query?: never;
9717
- url: "/api/session/{sessionID}/agent";
10042
+ url: "/api/session/{sessionID}/revert/commit";
9718
10043
  };
9719
- export type V2SessionSwitchAgentErrors = {
10044
+ export type V2SessionRevertCommitErrors = {
9720
10045
  /**
9721
10046
  * InvalidRequestError
9722
10047
  */
@@ -9730,29 +10055,23 @@ export type V2SessionSwitchAgentErrors = {
9730
10055
  */
9731
10056
  404: SessionNotFoundError;
9732
10057
  };
9733
- export type V2SessionSwitchAgentError = V2SessionSwitchAgentErrors[keyof V2SessionSwitchAgentErrors];
9734
- export type V2SessionSwitchAgentResponses = {
10058
+ export type V2SessionRevertCommitError = V2SessionRevertCommitErrors[keyof V2SessionRevertCommitErrors];
10059
+ export type V2SessionRevertCommitResponses = {
9735
10060
  /**
9736
10061
  * <No Content>
9737
10062
  */
9738
10063
  204: void;
9739
10064
  };
9740
- export type V2SessionSwitchAgentResponse = V2SessionSwitchAgentResponses[keyof V2SessionSwitchAgentResponses];
9741
- export type V2SessionSwitchModelData = {
9742
- body: {
9743
- model: {
9744
- id: string;
9745
- providerID: string;
9746
- variant?: string;
9747
- };
9748
- };
10065
+ export type V2SessionRevertCommitResponse = V2SessionRevertCommitResponses[keyof V2SessionRevertCommitResponses];
10066
+ export type V2SessionContextData = {
10067
+ body?: never;
9749
10068
  path: {
9750
10069
  sessionID: string;
9751
10070
  };
9752
10071
  query?: never;
9753
- url: "/api/session/{sessionID}/model";
10072
+ url: "/api/session/{sessionID}/context";
9754
10073
  };
9755
- export type V2SessionSwitchModelErrors = {
10074
+ export type V2SessionContextErrors = {
9756
10075
  /**
9757
10076
  * InvalidRequestError
9758
10077
  */
@@ -9765,29 +10084,33 @@ export type V2SessionSwitchModelErrors = {
9765
10084
  * SessionNotFoundError
9766
10085
  */
9767
10086
  404: SessionNotFoundError;
9768
- };
9769
- export type V2SessionSwitchModelError = V2SessionSwitchModelErrors[keyof V2SessionSwitchModelErrors];
9770
- export type V2SessionSwitchModelResponses = {
9771
10087
  /**
9772
- * <No Content>
10088
+ * UnknownError
9773
10089
  */
9774
- 204: void;
10090
+ 500: UnknownError1;
9775
10091
  };
9776
- export type V2SessionSwitchModelResponse = V2SessionSwitchModelResponses[keyof V2SessionSwitchModelResponses];
9777
- export type V2SessionPromptData = {
9778
- body: {
9779
- id?: string;
9780
- prompt: Prompt;
9781
- delivery?: "steer" | "queue";
9782
- resume?: boolean;
10092
+ export type V2SessionContextError = V2SessionContextErrors[keyof V2SessionContextErrors];
10093
+ export type V2SessionContextResponses = {
10094
+ /**
10095
+ * Success
10096
+ */
10097
+ 200: {
10098
+ data: Array<SessionMessage>;
9783
10099
  };
10100
+ };
10101
+ export type V2SessionContextResponse = V2SessionContextResponses[keyof V2SessionContextResponses];
10102
+ export type V2SessionHistoryData = {
10103
+ body?: never;
9784
10104
  path: {
9785
10105
  sessionID: string;
9786
10106
  };
9787
- query?: never;
9788
- url: "/api/session/{sessionID}/prompt";
10107
+ query?: {
10108
+ limit?: number;
10109
+ after?: number;
10110
+ };
10111
+ url: "/api/session/{sessionID}/history";
9789
10112
  };
9790
- export type V2SessionPromptErrors = {
10113
+ export type V2SessionHistoryErrors = {
9791
10114
  /**
9792
10115
  * InvalidRequestError
9793
10116
  */
@@ -9800,30 +10123,26 @@ export type V2SessionPromptErrors = {
9800
10123
  * SessionNotFoundError
9801
10124
  */
9802
10125
  404: SessionNotFoundError;
9803
- /**
9804
- * ConflictError
9805
- */
9806
- 409: ConflictError;
9807
10126
  };
9808
- export type V2SessionPromptError = V2SessionPromptErrors[keyof V2SessionPromptErrors];
9809
- export type V2SessionPromptResponses = {
10127
+ export type V2SessionHistoryError = V2SessionHistoryErrors[keyof V2SessionHistoryErrors];
10128
+ export type V2SessionHistoryResponses = {
9810
10129
  /**
9811
- * Success
10130
+ * SessionHistory
9812
10131
  */
9813
- 200: {
9814
- data: SessionInputAdmitted;
9815
- };
10132
+ 200: SessionHistory;
9816
10133
  };
9817
- export type V2SessionPromptResponse = V2SessionPromptResponses[keyof V2SessionPromptResponses];
9818
- export type V2SessionCompactData = {
10134
+ export type V2SessionHistoryResponse = V2SessionHistoryResponses[keyof V2SessionHistoryResponses];
10135
+ export type V2SessionEventsData = {
9819
10136
  body?: never;
9820
10137
  path: {
9821
10138
  sessionID: string;
9822
10139
  };
9823
- query?: never;
9824
- url: "/api/session/{sessionID}/compact";
10140
+ query?: {
10141
+ after?: string;
10142
+ };
10143
+ url: "/api/session/{sessionID}/event";
9825
10144
  };
9826
- export type V2SessionCompactErrors = {
10145
+ export type V2SessionEventsErrors = {
9827
10146
  /**
9828
10147
  * InvalidRequestError
9829
10148
  */
@@ -9836,28 +10155,28 @@ export type V2SessionCompactErrors = {
9836
10155
  * SessionNotFoundError
9837
10156
  */
9838
10157
  404: SessionNotFoundError;
9839
- /**
9840
- * ServiceUnavailableError
9841
- */
9842
- 503: ServiceUnavailableError;
9843
10158
  };
9844
- export type V2SessionCompactError = V2SessionCompactErrors[keyof V2SessionCompactErrors];
9845
- export type V2SessionCompactResponses = {
10159
+ export type V2SessionEventsError = V2SessionEventsErrors[keyof V2SessionEventsErrors];
10160
+ export type V2SessionEventsResponses = {
9846
10161
  /**
9847
- * <No Content>
10162
+ * Success
9848
10163
  */
9849
- 204: void;
10164
+ 200: {
10165
+ id: string;
10166
+ event: string;
10167
+ data: SessionDurableEventStream;
10168
+ };
9850
10169
  };
9851
- export type V2SessionCompactResponse = V2SessionCompactResponses[keyof V2SessionCompactResponses];
9852
- export type V2SessionWaitData = {
10170
+ export type V2SessionEventsResponse = V2SessionEventsResponses[keyof V2SessionEventsResponses];
10171
+ export type V2SessionInterruptData = {
9853
10172
  body?: never;
9854
10173
  path: {
9855
10174
  sessionID: string;
9856
10175
  };
9857
10176
  query?: never;
9858
- url: "/api/session/{sessionID}/wait";
10177
+ url: "/api/session/{sessionID}/interrupt";
9859
10178
  };
9860
- export type V2SessionWaitErrors = {
10179
+ export type V2SessionInterruptErrors = {
9861
10180
  /**
9862
10181
  * InvalidRequestError
9863
10182
  */
@@ -9870,28 +10189,25 @@ export type V2SessionWaitErrors = {
9870
10189
  * SessionNotFoundError
9871
10190
  */
9872
10191
  404: SessionNotFoundError;
9873
- /**
9874
- * ServiceUnavailableError
9875
- */
9876
- 503: ServiceUnavailableError;
9877
10192
  };
9878
- export type V2SessionWaitError = V2SessionWaitErrors[keyof V2SessionWaitErrors];
9879
- export type V2SessionWaitResponses = {
10193
+ export type V2SessionInterruptError = V2SessionInterruptErrors[keyof V2SessionInterruptErrors];
10194
+ export type V2SessionInterruptResponses = {
9880
10195
  /**
9881
10196
  * <No Content>
9882
10197
  */
9883
10198
  204: void;
9884
10199
  };
9885
- export type V2SessionWaitResponse = V2SessionWaitResponses[keyof V2SessionWaitResponses];
9886
- export type V2SessionContextData = {
10200
+ export type V2SessionInterruptResponse = V2SessionInterruptResponses[keyof V2SessionInterruptResponses];
10201
+ export type V2SessionMessageData = {
9887
10202
  body?: never;
9888
10203
  path: {
9889
10204
  sessionID: string;
10205
+ messageID: string;
9890
10206
  };
9891
10207
  query?: never;
9892
- url: "/api/session/{sessionID}/context";
10208
+ url: "/api/session/{sessionID}/message/{messageID}";
9893
10209
  };
9894
- export type V2SessionContextErrors = {
10210
+ export type V2SessionMessageErrors = {
9895
10211
  /**
9896
10212
  * InvalidRequestError
9897
10213
  */
@@ -9901,24 +10217,20 @@ export type V2SessionContextErrors = {
9901
10217
  */
9902
10218
  401: UnauthorizedError;
9903
10219
  /**
9904
- * SessionNotFoundError
9905
- */
9906
- 404: SessionNotFoundError;
9907
- /**
9908
- * UnknownError
10220
+ * SessionNotFoundError | MessageNotFoundError
9909
10221
  */
9910
- 500: UnknownError1;
10222
+ 404: MessageNotFoundError | SessionNotFoundError;
9911
10223
  };
9912
- export type V2SessionContextError = V2SessionContextErrors[keyof V2SessionContextErrors];
9913
- export type V2SessionContextResponses = {
10224
+ export type V2SessionMessageError = V2SessionMessageErrors[keyof V2SessionMessageErrors];
10225
+ export type V2SessionMessageResponses = {
9914
10226
  /**
9915
10227
  * Success
9916
10228
  */
9917
10229
  200: {
9918
- data: Array<SessionMessage>;
10230
+ data: SessionMessage;
9919
10231
  };
9920
10232
  };
9921
- export type V2SessionContextResponse = V2SessionContextResponses[keyof V2SessionContextResponses];
10233
+ export type V2SessionMessageResponse = V2SessionMessageResponses[keyof V2SessionMessageResponses];
9922
10234
  export type V2SessionMessagesData = {
9923
10235
  body?: never;
9924
10236
  path: {
@@ -10275,32 +10587,7 @@ export type V2IntegrationAttemptStatusResponses = {
10275
10587
  */
10276
10588
  200: {
10277
10589
  location: LocationInfo;
10278
- data: {
10279
- status: "pending";
10280
- time: {
10281
- created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
10282
- expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
10283
- };
10284
- } | {
10285
- status: "complete";
10286
- time: {
10287
- created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
10288
- expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
10289
- };
10290
- } | {
10291
- status: "failed";
10292
- message: string;
10293
- time: {
10294
- created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
10295
- expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
10296
- };
10297
- } | {
10298
- status: "expired";
10299
- time: {
10300
- created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
10301
- expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
10302
- };
10303
- };
10590
+ data: IntegrationAttemptStatus;
10304
10591
  };
10305
10592
  };
10306
10593
  export type V2IntegrationAttemptStatusResponse = V2IntegrationAttemptStatusResponses[keyof V2IntegrationAttemptStatusResponses];
@@ -10519,6 +10806,84 @@ export type V2SessionPermissionListResponses = {
10519
10806
  };
10520
10807
  };
10521
10808
  export type V2SessionPermissionListResponse = V2SessionPermissionListResponses[keyof V2SessionPermissionListResponses];
10809
+ export type V2SessionPermissionCreateData = {
10810
+ body: {
10811
+ id?: string;
10812
+ action: string;
10813
+ resources: Array<string>;
10814
+ save?: Array<string>;
10815
+ metadata?: {
10816
+ [key: string]: unknown;
10817
+ };
10818
+ source?: PermissionV2Source;
10819
+ agent?: string;
10820
+ };
10821
+ path: {
10822
+ sessionID: string;
10823
+ };
10824
+ query?: never;
10825
+ url: "/api/session/{sessionID}/permission";
10826
+ };
10827
+ export type V2SessionPermissionCreateErrors = {
10828
+ /**
10829
+ * InvalidRequestError
10830
+ */
10831
+ 400: InvalidRequestError;
10832
+ /**
10833
+ * UnauthorizedError
10834
+ */
10835
+ 401: UnauthorizedError;
10836
+ /**
10837
+ * SessionNotFoundError
10838
+ */
10839
+ 404: SessionNotFoundError;
10840
+ };
10841
+ export type V2SessionPermissionCreateError = V2SessionPermissionCreateErrors[keyof V2SessionPermissionCreateErrors];
10842
+ export type V2SessionPermissionCreateResponses = {
10843
+ /**
10844
+ * Success
10845
+ */
10846
+ 200: {
10847
+ data: {
10848
+ id: string;
10849
+ effect: PermissionV2Effect;
10850
+ };
10851
+ };
10852
+ };
10853
+ export type V2SessionPermissionCreateResponse = V2SessionPermissionCreateResponses[keyof V2SessionPermissionCreateResponses];
10854
+ export type V2SessionPermissionGetData = {
10855
+ body?: never;
10856
+ path: {
10857
+ sessionID: string;
10858
+ requestID: string;
10859
+ };
10860
+ query?: never;
10861
+ url: "/api/session/{sessionID}/permission/{requestID}";
10862
+ };
10863
+ export type V2SessionPermissionGetErrors = {
10864
+ /**
10865
+ * InvalidRequestError
10866
+ */
10867
+ 400: InvalidRequestError;
10868
+ /**
10869
+ * UnauthorizedError
10870
+ */
10871
+ 401: UnauthorizedError;
10872
+ /**
10873
+ * SessionNotFoundError | PermissionNotFoundError
10874
+ */
10875
+ 404: PermissionNotFoundError | SessionNotFoundError;
10876
+ };
10877
+ export type V2SessionPermissionGetError = V2SessionPermissionGetErrors[keyof V2SessionPermissionGetErrors];
10878
+ export type V2SessionPermissionGetResponses = {
10879
+ /**
10880
+ * Success
10881
+ */
10882
+ 200: {
10883
+ data: PermissionV2Request;
10884
+ };
10885
+ };
10886
+ export type V2SessionPermissionGetResponse = V2SessionPermissionGetResponses[keyof V2SessionPermissionGetResponses];
10522
10887
  export type V2SessionPermissionReplyData = {
10523
10888
  body: {
10524
10889
  reply: PermissionV2Reply;
@@ -10965,10 +11330,7 @@ export type V2PtyConnectTokenResponses = {
10965
11330
  */
10966
11331
  200: {
10967
11332
  location: LocationInfo;
10968
- data: {
10969
- ticket: string;
10970
- expires_in: number;
10971
- };
11333
+ data: PtyTicketConnectToken;
10972
11334
  };
10973
11335
  };
10974
11336
  export type V2PtyConnectTokenResponse = V2PtyConnectTokenResponses[keyof V2PtyConnectTokenResponses];