@opencode-ai/sdk 1.17.11 → 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.
@@ -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
  } | {
@@ -799,11 +791,7 @@ export type GlobalEvent = {
799
791
  sessionID: string;
800
792
  assistantMessageID: string;
801
793
  reasoningID: string;
802
- providerMetadata?: {
803
- [key: string]: {
804
- [key: string]: unknown;
805
- };
806
- };
794
+ providerMetadata?: LlmProviderMetadata;
807
795
  };
808
796
  } | {
809
797
  id: string;
@@ -824,11 +812,7 @@ export type GlobalEvent = {
824
812
  assistantMessageID: string;
825
813
  reasoningID: string;
826
814
  text: string;
827
- providerMetadata?: {
828
- [key: string]: {
829
- [key: string]: unknown;
830
- };
831
- };
815
+ providerMetadata?: LlmProviderMetadata;
832
816
  };
833
817
  } | {
834
818
  id: string;
@@ -874,11 +858,7 @@ export type GlobalEvent = {
874
858
  };
875
859
  provider: {
876
860
  executed: boolean;
877
- metadata?: {
878
- [key: string]: {
879
- [key: string]: unknown;
880
- };
881
- };
861
+ metadata?: LlmProviderMetadata;
882
862
  };
883
863
  };
884
864
  } | {
@@ -892,7 +872,7 @@ export type GlobalEvent = {
892
872
  structured: {
893
873
  [key: string]: unknown;
894
874
  };
895
- content: Array<ToolTextContent | ToolFileContent>;
875
+ content: Array<LlmToolContent>;
896
876
  };
897
877
  } | {
898
878
  id: string;
@@ -905,16 +885,12 @@ export type GlobalEvent = {
905
885
  structured: {
906
886
  [key: string]: unknown;
907
887
  };
908
- content: Array<ToolTextContent | ToolFileContent>;
888
+ content: Array<LlmToolContent>;
909
889
  outputPaths?: Array<string>;
910
890
  result?: unknown;
911
891
  provider: {
912
892
  executed: boolean;
913
- metadata?: {
914
- [key: string]: {
915
- [key: string]: unknown;
916
- };
917
- };
893
+ metadata?: LlmProviderMetadata;
918
894
  };
919
895
  };
920
896
  } | {
@@ -929,11 +905,7 @@ export type GlobalEvent = {
929
905
  result?: unknown;
930
906
  provider: {
931
907
  executed: boolean;
932
- metadata?: {
933
- [key: string]: {
934
- [key: string]: unknown;
935
- };
936
- };
908
+ metadata?: LlmProviderMetadata;
937
909
  };
938
910
  };
939
911
  } | {
@@ -980,13 +952,7 @@ export type GlobalEvent = {
980
952
  properties: {
981
953
  timestamp: number;
982
954
  sessionID: string;
983
- revert: {
984
- messageID: string;
985
- partID?: string;
986
- snapshot?: string;
987
- diff?: string;
988
- files?: Array<FileDiff>;
989
- };
955
+ revert: RevertState;
990
956
  };
991
957
  } | {
992
958
  id: string;
@@ -1240,24 +1206,11 @@ export type GlobalEvent = {
1240
1206
  properties: {
1241
1207
  id: string;
1242
1208
  worktree: string;
1243
- vcs?: "git";
1209
+ vcs?: ProjectVcs;
1244
1210
  name?: string;
1245
- icon?: {
1246
- url?: string;
1247
- override?: string;
1248
- color?: string;
1249
- };
1250
- commands?: {
1251
- /**
1252
- * Startup script to run when creating a new workspace (worktree)
1253
- */
1254
- start?: string;
1255
- };
1256
- time: {
1257
- created: number;
1258
- updated: number;
1259
- initialized?: number;
1260
- };
1211
+ icon?: ProjectIcon;
1212
+ commands?: ProjectCommands;
1213
+ time: ProjectTime;
1261
1214
  sandboxes: Array<string>;
1262
1215
  };
1263
1216
  } | {
@@ -2037,24 +1990,11 @@ export type McpServerNotFoundError = {
2037
1990
  export type Project = {
2038
1991
  id: string;
2039
1992
  worktree: string;
2040
- vcs?: "git";
1993
+ vcs?: ProjectVcs;
2041
1994
  name?: string;
2042
- icon?: {
2043
- url?: string;
2044
- override?: string;
2045
- color?: string;
2046
- };
2047
- commands?: {
2048
- /**
2049
- * Startup script to run when creating a new workspace (worktree)
2050
- */
2051
- start?: string;
2052
- };
2053
- time: {
2054
- created: number;
2055
- updated: number;
2056
- initialized?: number;
2057
- };
1995
+ icon?: ProjectIcon;
1996
+ commands?: ProjectCommands;
1997
+ time: ProjectTime;
2058
1998
  sandboxes: Array<string>;
2059
1999
  };
2060
2000
  export type ProjectNotFoundError = {
@@ -2269,11 +2209,19 @@ export type InvalidCursorError = {
2269
2209
  _tag: "InvalidCursorError";
2270
2210
  message: string;
2271
2211
  };
2212
+ export type SessionActive = {
2213
+ type: "running";
2214
+ };
2272
2215
  export type SessionNotFoundError = {
2273
2216
  _tag: "SessionNotFoundError";
2274
2217
  sessionID: string;
2275
2218
  message: string;
2276
2219
  };
2220
+ export type PromptInput = {
2221
+ text: string;
2222
+ files?: Array<PromptInputFileAttachment>;
2223
+ agents?: Array<PromptAgentAttachment>;
2224
+ };
2277
2225
  export type ConflictError = {
2278
2226
  _tag: "ConflictError";
2279
2227
  message: string;
@@ -2295,6 +2243,12 @@ export type UnknownError1 = {
2295
2243
  message: string;
2296
2244
  ref?: string;
2297
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;
2298
2252
  export type SessionMessagesResponse = {
2299
2253
  data: Array<SessionMessage>;
2300
2254
  cursor: {
@@ -2307,7 +2261,67 @@ export type ProviderNotFoundError = {
2307
2261
  providerID: string;
2308
2262
  message: string;
2309
2263
  };
2310
- 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 | V2EventSessionNextRevertStaged | V2EventSessionNextRevertCleared | V2EventSessionNextRevertCommitted | 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;
2311
2325
  export type ForbiddenError = {
2312
2326
  _tag: "ForbiddenError";
2313
2327
  message: string;
@@ -2369,6 +2383,11 @@ export type SkillV2Source = SkillV2DirectorySource | SkillV2UrlSource | SkillV2E
2369
2383
  export type MoveSessionDestination = {
2370
2384
  directory: string;
2371
2385
  };
2386
+ export type ModelRef = {
2387
+ id: string;
2388
+ providerID: string;
2389
+ variant?: string;
2390
+ };
2372
2391
  export type LocationRef = {
2373
2392
  directory: string;
2374
2393
  workspaceID?: string;
@@ -2393,6 +2412,11 @@ export type SessionErrorUnknown = {
2393
2412
  type: "unknown";
2394
2413
  message: string;
2395
2414
  };
2415
+ export type LlmProviderMetadata = {
2416
+ [key: string]: {
2417
+ [key: string]: unknown;
2418
+ };
2419
+ };
2396
2420
  export type ToolTextContent = {
2397
2421
  type: "text";
2398
2422
  text: string;
@@ -2403,6 +2427,7 @@ export type ToolFileContent = {
2403
2427
  mime: string;
2404
2428
  name?: string;
2405
2429
  };
2430
+ export type LlmToolContent = ToolTextContent | ToolFileContent;
2406
2431
  export type SessionNextRetryError = {
2407
2432
  message: string;
2408
2433
  statusCode?: number;
@@ -2422,6 +2447,13 @@ export type FileDiff = {
2422
2447
  deletions: number;
2423
2448
  patch: string;
2424
2449
  };
2450
+ export type RevertState = {
2451
+ messageID: string;
2452
+ partID?: string;
2453
+ snapshot?: string;
2454
+ diff?: string;
2455
+ files?: Array<FileDiff>;
2456
+ };
2425
2457
  export type PermissionV2Source = {
2426
2458
  type: "tool";
2427
2459
  messageID: string;
@@ -2459,6 +2491,23 @@ export type QuestionV2Tool = {
2459
2491
  callID: string;
2460
2492
  };
2461
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
+ };
2462
2511
  export type EventServerInstanceDisposed = {
2463
2512
  id: string;
2464
2513
  type: "server.instance.disposed";
@@ -2594,11 +2643,7 @@ export type SyncEventSessionNextModelSwitched = {
2594
2643
  timestamp: number;
2595
2644
  sessionID: string;
2596
2645
  messageID: string;
2597
- model: {
2598
- id: string;
2599
- providerID: string;
2600
- variant?: string;
2601
- };
2646
+ model: ModelRef;
2602
2647
  };
2603
2648
  };
2604
2649
  };
@@ -2730,11 +2775,7 @@ export type SyncEventSessionNextStepStarted = {
2730
2775
  sessionID: string;
2731
2776
  assistantMessageID: string;
2732
2777
  agent: string;
2733
- model: {
2734
- id: string;
2735
- providerID: string;
2736
- variant?: string;
2737
- };
2778
+ model: ModelRef;
2738
2779
  snapshot?: string;
2739
2780
  };
2740
2781
  };
@@ -2829,11 +2870,7 @@ export type SyncEventSessionNextReasoningStarted = {
2829
2870
  sessionID: string;
2830
2871
  assistantMessageID: string;
2831
2872
  reasoningID: string;
2832
- providerMetadata?: {
2833
- [key: string]: {
2834
- [key: string]: unknown;
2835
- };
2836
- };
2873
+ providerMetadata?: LlmProviderMetadata;
2837
2874
  };
2838
2875
  };
2839
2876
  };
@@ -2851,11 +2888,7 @@ export type SyncEventSessionNextReasoningEnded = {
2851
2888
  assistantMessageID: string;
2852
2889
  reasoningID: string;
2853
2890
  text: string;
2854
- providerMetadata?: {
2855
- [key: string]: {
2856
- [key: string]: unknown;
2857
- };
2858
- };
2891
+ providerMetadata?: LlmProviderMetadata;
2859
2892
  };
2860
2893
  };
2861
2894
  };
@@ -2912,11 +2945,7 @@ export type SyncEventSessionNextToolCalled = {
2912
2945
  };
2913
2946
  provider: {
2914
2947
  executed: boolean;
2915
- metadata?: {
2916
- [key: string]: {
2917
- [key: string]: unknown;
2918
- };
2919
- };
2948
+ metadata?: LlmProviderMetadata;
2920
2949
  };
2921
2950
  };
2922
2951
  };
@@ -2937,7 +2966,7 @@ export type SyncEventSessionNextToolProgress = {
2937
2966
  structured: {
2938
2967
  [key: string]: unknown;
2939
2968
  };
2940
- content: Array<ToolTextContent | ToolFileContent>;
2969
+ content: Array<LlmToolContent>;
2941
2970
  };
2942
2971
  };
2943
2972
  };
@@ -2957,16 +2986,12 @@ export type SyncEventSessionNextToolSuccess = {
2957
2986
  structured: {
2958
2987
  [key: string]: unknown;
2959
2988
  };
2960
- content: Array<ToolTextContent | ToolFileContent>;
2989
+ content: Array<LlmToolContent>;
2961
2990
  outputPaths?: Array<string>;
2962
2991
  result?: unknown;
2963
2992
  provider: {
2964
2993
  executed: boolean;
2965
- metadata?: {
2966
- [key: string]: {
2967
- [key: string]: unknown;
2968
- };
2969
- };
2994
+ metadata?: LlmProviderMetadata;
2970
2995
  };
2971
2996
  };
2972
2997
  };
@@ -2988,11 +3013,7 @@ export type SyncEventSessionNextToolFailed = {
2988
3013
  result?: unknown;
2989
3014
  provider: {
2990
3015
  executed: boolean;
2991
- metadata?: {
2992
- [key: string]: {
2993
- [key: string]: unknown;
2994
- };
2995
- };
3016
+ metadata?: LlmProviderMetadata;
2996
3017
  };
2997
3018
  };
2998
3019
  };
@@ -3058,13 +3079,7 @@ export type SyncEventSessionNextRevertStaged = {
3058
3079
  data: {
3059
3080
  timestamp: number;
3060
3081
  sessionID: string;
3061
- revert: {
3062
- messageID: string;
3063
- partID?: string;
3064
- snapshot?: string;
3065
- diff?: string;
3066
- files?: Array<FileDiff>;
3067
- };
3082
+ revert: RevertState;
3068
3083
  };
3069
3084
  };
3070
3085
  };
@@ -3118,6 +3133,14 @@ export type ProjectDirectories = Array<{
3118
3133
  directory: string;
3119
3134
  strategy?: string;
3120
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
+ };
3121
3144
  export type LocationInfo = {
3122
3145
  directory: string;
3123
3146
  workspaceID?: string;
@@ -3126,6 +3149,15 @@ export type LocationInfo = {
3126
3149
  directory: string;
3127
3150
  };
3128
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";
3129
3161
  export type PermissionV2Effect = "allow" | "deny" | "ask";
3130
3162
  export type PermissionV2Rule = {
3131
3163
  action: string;
@@ -3135,24 +3167,13 @@ export type PermissionV2Rule = {
3135
3167
  export type PermissionV2Ruleset = Array<PermissionV2Rule>;
3136
3168
  export type AgentV2Info = {
3137
3169
  id: string;
3138
- model?: {
3139
- id: string;
3140
- providerID: string;
3141
- variant?: string;
3142
- };
3143
- request: {
3144
- headers: {
3145
- [key: string]: string;
3146
- };
3147
- body: {
3148
- [key: string]: unknown;
3149
- };
3150
- };
3170
+ model?: ModelRef;
3171
+ request: ProviderRequest;
3151
3172
  system?: string;
3152
3173
  description?: string;
3153
3174
  mode: "subagent" | "primary" | "all";
3154
3175
  hidden: boolean;
3155
- color?: string | "primary" | "secondary" | "accent" | "success" | "warning" | "error" | "info";
3176
+ color?: AgentColor;
3156
3177
  steps?: number;
3157
3178
  permissions: PermissionV2Ruleset;
3158
3179
  };
@@ -3161,11 +3182,7 @@ export type SessionV2Info = {
3161
3182
  parentID?: string;
3162
3183
  projectID: string;
3163
3184
  agent?: string;
3164
- model?: {
3165
- id: string;
3166
- providerID: string;
3167
- variant?: string;
3168
- };
3185
+ model?: ModelRef;
3169
3186
  cost: number;
3170
3187
  tokens: {
3171
3188
  input: number;
@@ -3184,13 +3201,13 @@ export type SessionV2Info = {
3184
3201
  title: string;
3185
3202
  location: LocationRef;
3186
3203
  subpath?: string;
3187
- revert?: {
3188
- messageID: string;
3189
- partID?: string;
3190
- snapshot?: string;
3191
- diff?: string;
3192
- files?: Array<FileDiff>;
3193
- };
3204
+ revert?: RevertState;
3205
+ };
3206
+ export type PromptInputFileAttachment = {
3207
+ uri: string;
3208
+ name?: string;
3209
+ description?: string;
3210
+ source?: PromptSource;
3194
3211
  };
3195
3212
  export type SessionInputAdmitted = {
3196
3213
  admittedSeq: number;
@@ -3221,11 +3238,7 @@ export type SessionMessageModelSwitched = {
3221
3238
  created: number;
3222
3239
  };
3223
3240
  type: "model-switched";
3224
- model: {
3225
- id: string;
3226
- providerID: string;
3227
- variant?: string;
3228
- };
3241
+ model: ModelRef;
3229
3242
  };
3230
3243
  export type SessionMessageUser = {
3231
3244
  id: string;
@@ -3286,10 +3299,10 @@ export type SessionMessageAssistantReasoning = {
3286
3299
  type: "reasoning";
3287
3300
  id: string;
3288
3301
  text: string;
3289
- providerMetadata?: {
3290
- [key: string]: {
3291
- [key: string]: unknown;
3292
- };
3302
+ providerMetadata?: LlmProviderMetadata;
3303
+ time?: {
3304
+ created: number;
3305
+ completed?: number;
3293
3306
  };
3294
3307
  };
3295
3308
  export type SessionMessageToolStatePending = {
@@ -3304,7 +3317,7 @@ export type SessionMessageToolStateRunning = {
3304
3317
  structured: {
3305
3318
  [key: string]: unknown;
3306
3319
  };
3307
- content: Array<ToolTextContent | ToolFileContent>;
3320
+ content: Array<LlmToolContent>;
3308
3321
  };
3309
3322
  export type SessionMessageToolStateCompleted = {
3310
3323
  status: "completed";
@@ -3312,7 +3325,7 @@ export type SessionMessageToolStateCompleted = {
3312
3325
  [key: string]: unknown;
3313
3326
  };
3314
3327
  attachments?: Array<PromptFileAttachment>;
3315
- content: Array<ToolTextContent | ToolFileContent>;
3328
+ content: Array<LlmToolContent>;
3316
3329
  outputPaths?: Array<string>;
3317
3330
  structured: {
3318
3331
  [key: string]: unknown;
@@ -3324,7 +3337,7 @@ export type SessionMessageToolStateError = {
3324
3337
  input: {
3325
3338
  [key: string]: unknown;
3326
3339
  };
3327
- content: Array<ToolTextContent | ToolFileContent>;
3340
+ content: Array<LlmToolContent>;
3328
3341
  structured: {
3329
3342
  [key: string]: unknown;
3330
3343
  };
@@ -3337,16 +3350,8 @@ export type SessionMessageAssistantTool = {
3337
3350
  name: string;
3338
3351
  provider?: {
3339
3352
  executed: boolean;
3340
- metadata?: {
3341
- [key: string]: {
3342
- [key: string]: unknown;
3343
- };
3344
- };
3345
- resultMetadata?: {
3346
- [key: string]: {
3347
- [key: string]: unknown;
3348
- };
3349
- };
3353
+ metadata?: LlmProviderMetadata;
3354
+ resultMetadata?: LlmProviderMetadata;
3350
3355
  };
3351
3356
  state: SessionMessageToolStatePending | SessionMessageToolStateRunning | SessionMessageToolStateCompleted | SessionMessageToolStateError;
3352
3357
  time: {
@@ -3367,11 +3372,7 @@ export type SessionMessageAssistant = {
3367
3372
  };
3368
3373
  type: "assistant";
3369
3374
  agent: string;
3370
- model: {
3371
- id: string;
3372
- providerID: string;
3373
- variant?: string;
3374
- };
3375
+ model: ModelRef;
3375
3376
  content: Array<SessionMessageAssistantText | SessionMessageAssistantReasoning | SessionMessageAssistantTool>;
3376
3377
  snapshot?: {
3377
3378
  start?: string;
@@ -3405,1095 +3406,1082 @@ export type SessionMessageCompaction = {
3405
3406
  };
3406
3407
  };
3407
3408
  export type SessionMessage = SessionMessageAgentSwitched | SessionMessageModelSwitched | SessionMessageUser | SessionMessageSynthetic | SessionMessageSystem | SessionMessageShell | SessionMessageAssistant | SessionMessageCompaction;
3408
- export type ModelV2Info = {
3409
+ export type SessionNextAgentSwitched = {
3409
3410
  id: string;
3410
- providerID: string;
3411
- family?: string;
3412
- name: string;
3413
- api: {
3414
- id: string;
3415
- type: "aisdk";
3416
- package: string;
3417
- url?: string;
3418
- settings?: {
3419
- [key: string]: unknown;
3420
- };
3421
- } | {
3422
- id: string;
3423
- type: "native";
3424
- url?: string;
3425
- settings: {
3426
- [key: string]: unknown;
3427
- };
3411
+ metadata?: {
3412
+ [key: string]: unknown;
3428
3413
  };
3429
- capabilities: {
3430
- tools: boolean;
3431
- input: Array<string>;
3432
- output: Array<string>;
3414
+ type: "session.next.agent.switched";
3415
+ durable?: {
3416
+ aggregateID: string;
3417
+ seq: number;
3418
+ version: number;
3433
3419
  };
3434
- request: {
3435
- headers: {
3436
- [key: string]: string;
3437
- };
3438
- body: {
3439
- [key: string]: unknown;
3440
- };
3441
- variant?: string;
3420
+ location?: LocationRef;
3421
+ data: {
3422
+ timestamp: number;
3423
+ sessionID: string;
3424
+ messageID: string;
3425
+ agent: string;
3442
3426
  };
3443
- variants: Array<{
3444
- id: string;
3445
- headers: {
3446
- [key: string]: string;
3447
- };
3448
- body: {
3449
- [key: string]: unknown;
3450
- };
3451
- }>;
3452
- time: {
3453
- released: number;
3427
+ };
3428
+ export type SessionNextModelSwitched = {
3429
+ id: string;
3430
+ metadata?: {
3431
+ [key: string]: unknown;
3454
3432
  };
3455
- cost: Array<{
3456
- tier?: {
3457
- type: "context";
3458
- size: number;
3459
- };
3460
- input: number;
3461
- output: number;
3462
- cache: {
3463
- read: number;
3464
- write: number;
3465
- };
3466
- }>;
3467
- status: "alpha" | "beta" | "deprecated" | "active";
3468
- enabled: boolean;
3469
- limit: {
3470
- context: number;
3471
- input?: number;
3472
- output: number;
3433
+ type: "session.next.model.switched";
3434
+ durable?: {
3435
+ aggregateID: string;
3436
+ seq: number;
3437
+ version: number;
3438
+ };
3439
+ location?: LocationRef;
3440
+ data: {
3441
+ timestamp: number;
3442
+ sessionID: string;
3443
+ messageID: string;
3444
+ model: ModelRef;
3473
3445
  };
3474
3446
  };
3475
- export type ProviderV2Info = {
3476
- id: string;
3477
- integrationID?: string;
3478
- name: string;
3479
- disabled?: boolean;
3480
- api: {
3481
- type: "aisdk";
3482
- package: string;
3483
- url?: string;
3484
- settings?: {
3485
- [key: string]: unknown;
3486
- };
3487
- } | {
3488
- type: "native";
3489
- url?: string;
3490
- settings: {
3491
- [key: string]: unknown;
3492
- };
3493
- };
3494
- request: {
3495
- headers: {
3496
- [key: string]: string;
3497
- };
3498
- body: {
3499
- [key: string]: unknown;
3500
- };
3501
- };
3502
- };
3503
- export type IntegrationWhen = {
3504
- key: string;
3505
- op: "eq" | "neq";
3506
- value: string;
3507
- };
3508
- export type IntegrationTextPrompt = {
3509
- type: "text";
3510
- key: string;
3511
- message: string;
3512
- placeholder?: string;
3513
- when?: IntegrationWhen;
3514
- };
3515
- export type IntegrationSelectPrompt = {
3516
- type: "select";
3517
- key: string;
3518
- message: string;
3519
- options: Array<{
3520
- label: string;
3521
- value: string;
3522
- hint?: string;
3523
- }>;
3524
- when?: IntegrationWhen;
3525
- };
3526
- export type IntegrationOAuthMethod = {
3527
- id: string;
3528
- type: "oauth";
3529
- label: string;
3530
- prompts?: Array<IntegrationTextPrompt | IntegrationSelectPrompt>;
3531
- };
3532
- export type IntegrationKeyMethod = {
3533
- type: "key";
3534
- label?: string;
3535
- };
3536
- export type IntegrationEnvMethod = {
3537
- type: "env";
3538
- names: Array<string>;
3539
- };
3540
- export type ConnectionCredentialInfo = {
3541
- type: "credential";
3542
- id: string;
3543
- label: string;
3544
- };
3545
- export type ConnectionEnvInfo = {
3546
- type: "env";
3547
- name: string;
3548
- };
3549
- export type ConnectionInfo = ConnectionCredentialInfo | ConnectionEnvInfo;
3550
- export type IntegrationInfo = {
3551
- id: string;
3552
- name: string;
3553
- methods: Array<IntegrationMethod>;
3554
- connections: Array<ConnectionInfo>;
3555
- };
3556
- export type IntegrationAttempt = {
3557
- attemptID: string;
3558
- url: string;
3559
- instructions: string;
3560
- mode: "auto" | "code";
3561
- time: {
3562
- created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
3563
- expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
3564
- };
3565
- };
3566
- export type PermissionV2Request = {
3567
- id: string;
3568
- sessionID: string;
3569
- action: string;
3570
- resources: Array<string>;
3571
- save?: Array<string>;
3572
- metadata?: {
3573
- [key: string]: unknown;
3574
- };
3575
- source?: PermissionV2Source;
3576
- };
3577
- export type PermissionSavedInfo = {
3578
- id: string;
3579
- projectID: string;
3580
- action: string;
3581
- resource: string;
3582
- };
3583
- export type FileSystemEntry = {
3584
- path: string;
3585
- type: "file" | "directory";
3586
- };
3587
- export type CommandV2Info = {
3588
- name: string;
3589
- template: string;
3590
- description?: string;
3591
- agent?: string;
3592
- model?: {
3593
- id: string;
3594
- providerID: string;
3595
- variant?: string;
3596
- };
3597
- subtask?: boolean;
3598
- };
3599
- export type SkillV2Info = {
3600
- name: string;
3601
- description?: string;
3602
- slash?: boolean;
3603
- location: string;
3604
- content: string;
3605
- };
3606
- export type V2EventModelsDevRefreshed = {
3447
+ export type SessionNextMoved = {
3607
3448
  id: string;
3608
3449
  metadata?: {
3609
3450
  [key: string]: unknown;
3610
3451
  };
3452
+ type: "session.next.moved";
3611
3453
  durable?: {
3612
3454
  aggregateID: string;
3613
3455
  seq: number;
3614
3456
  version: number;
3615
3457
  };
3616
3458
  location?: LocationRef;
3617
- type: "models-dev.refreshed";
3618
3459
  data: {
3619
- [key: string]: unknown;
3460
+ timestamp: number;
3461
+ sessionID: string;
3462
+ location: LocationRef;
3463
+ subdirectory?: string;
3620
3464
  };
3621
3465
  };
3622
- export type V2EventIntegrationUpdated = {
3466
+ export type SessionNextPrompted = {
3623
3467
  id: string;
3624
3468
  metadata?: {
3625
3469
  [key: string]: unknown;
3626
3470
  };
3471
+ type: "session.next.prompted";
3627
3472
  durable?: {
3628
3473
  aggregateID: string;
3629
3474
  seq: number;
3630
3475
  version: number;
3631
3476
  };
3632
3477
  location?: LocationRef;
3633
- type: "integration.updated";
3634
3478
  data: {
3635
- [key: string]: unknown;
3479
+ timestamp: number;
3480
+ sessionID: string;
3481
+ messageID: string;
3482
+ prompt: Prompt;
3483
+ delivery: "steer" | "queue";
3636
3484
  };
3637
3485
  };
3638
- export type V2EventIntegrationConnectionUpdated = {
3486
+ export type SessionNextPromptAdmitted = {
3639
3487
  id: string;
3640
3488
  metadata?: {
3641
3489
  [key: string]: unknown;
3642
3490
  };
3491
+ type: "session.next.prompt.admitted";
3643
3492
  durable?: {
3644
3493
  aggregateID: string;
3645
3494
  seq: number;
3646
3495
  version: number;
3647
3496
  };
3648
3497
  location?: LocationRef;
3649
- type: "integration.connection.updated";
3650
3498
  data: {
3651
- integrationID: string;
3499
+ timestamp: number;
3500
+ sessionID: string;
3501
+ messageID: string;
3502
+ prompt: Prompt;
3503
+ delivery: "steer" | "queue";
3652
3504
  };
3653
3505
  };
3654
- export type V2EventCatalogUpdated = {
3506
+ export type SessionNextContextUpdated = {
3655
3507
  id: string;
3656
3508
  metadata?: {
3657
3509
  [key: string]: unknown;
3658
3510
  };
3511
+ type: "session.next.context.updated";
3659
3512
  durable?: {
3660
3513
  aggregateID: string;
3661
3514
  seq: number;
3662
3515
  version: number;
3663
3516
  };
3664
3517
  location?: LocationRef;
3665
- type: "catalog.updated";
3666
3518
  data: {
3667
- [key: string]: unknown;
3519
+ timestamp: number;
3520
+ sessionID: string;
3521
+ messageID: string;
3522
+ text: string;
3668
3523
  };
3669
3524
  };
3670
- export type V2EventSessionCreated = {
3525
+ export type SessionNextSynthetic = {
3671
3526
  id: string;
3672
3527
  metadata?: {
3673
3528
  [key: string]: unknown;
3674
3529
  };
3530
+ type: "session.next.synthetic";
3675
3531
  durable?: {
3676
3532
  aggregateID: string;
3677
3533
  seq: number;
3678
3534
  version: number;
3679
3535
  };
3680
3536
  location?: LocationRef;
3681
- type: "session.created";
3682
3537
  data: {
3538
+ timestamp: number;
3683
3539
  sessionID: string;
3684
- info: Session;
3540
+ messageID: string;
3541
+ text: string;
3685
3542
  };
3686
3543
  };
3687
- export type V2EventSessionUpdated = {
3544
+ export type SessionNextShellStarted = {
3688
3545
  id: string;
3689
3546
  metadata?: {
3690
3547
  [key: string]: unknown;
3691
3548
  };
3549
+ type: "session.next.shell.started";
3692
3550
  durable?: {
3693
3551
  aggregateID: string;
3694
3552
  seq: number;
3695
3553
  version: number;
3696
3554
  };
3697
3555
  location?: LocationRef;
3698
- type: "session.updated";
3699
3556
  data: {
3557
+ timestamp: number;
3700
3558
  sessionID: string;
3701
- info: Session;
3559
+ messageID: string;
3560
+ callID: string;
3561
+ command: string;
3702
3562
  };
3703
3563
  };
3704
- export type V2EventSessionDeleted = {
3564
+ export type SessionNextShellEnded = {
3705
3565
  id: string;
3706
3566
  metadata?: {
3707
3567
  [key: string]: unknown;
3708
3568
  };
3569
+ type: "session.next.shell.ended";
3709
3570
  durable?: {
3710
3571
  aggregateID: string;
3711
3572
  seq: number;
3712
3573
  version: number;
3713
3574
  };
3714
3575
  location?: LocationRef;
3715
- type: "session.deleted";
3716
3576
  data: {
3577
+ timestamp: number;
3717
3578
  sessionID: string;
3718
- info: Session;
3579
+ callID: string;
3580
+ output: string;
3719
3581
  };
3720
3582
  };
3721
- export type V2EventMessageUpdated = {
3583
+ export type SessionNextStepStarted = {
3722
3584
  id: string;
3723
3585
  metadata?: {
3724
3586
  [key: string]: unknown;
3725
3587
  };
3588
+ type: "session.next.step.started";
3726
3589
  durable?: {
3727
3590
  aggregateID: string;
3728
3591
  seq: number;
3729
3592
  version: number;
3730
3593
  };
3731
3594
  location?: LocationRef;
3732
- type: "message.updated";
3733
3595
  data: {
3596
+ timestamp: number;
3734
3597
  sessionID: string;
3735
- info: Message;
3598
+ assistantMessageID: string;
3599
+ agent: string;
3600
+ model: ModelRef;
3601
+ snapshot?: string;
3736
3602
  };
3737
3603
  };
3738
- export type V2EventMessageRemoved = {
3604
+ export type SessionNextStepEnded = {
3739
3605
  id: string;
3740
3606
  metadata?: {
3741
3607
  [key: string]: unknown;
3742
3608
  };
3609
+ type: "session.next.step.ended";
3743
3610
  durable?: {
3744
3611
  aggregateID: string;
3745
3612
  seq: number;
3746
3613
  version: number;
3747
3614
  };
3748
3615
  location?: LocationRef;
3749
- type: "message.removed";
3750
3616
  data: {
3617
+ timestamp: number;
3751
3618
  sessionID: string;
3752
- messageID: string;
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>;
3753
3633
  };
3754
3634
  };
3755
- export type V2EventMessagePartUpdated = {
3635
+ export type SessionNextStepFailed = {
3756
3636
  id: string;
3757
3637
  metadata?: {
3758
3638
  [key: string]: unknown;
3759
3639
  };
3640
+ type: "session.next.step.failed";
3760
3641
  durable?: {
3761
3642
  aggregateID: string;
3762
3643
  seq: number;
3763
3644
  version: number;
3764
3645
  };
3765
3646
  location?: LocationRef;
3766
- type: "message.part.updated";
3767
3647
  data: {
3648
+ timestamp: number;
3768
3649
  sessionID: string;
3769
- part: Part;
3770
- time: number;
3650
+ assistantMessageID: string;
3651
+ error: SessionErrorUnknown;
3771
3652
  };
3772
3653
  };
3773
- export type V2EventMessagePartRemoved = {
3654
+ export type SessionNextTextStarted = {
3774
3655
  id: string;
3775
3656
  metadata?: {
3776
3657
  [key: string]: unknown;
3777
3658
  };
3659
+ type: "session.next.text.started";
3778
3660
  durable?: {
3779
3661
  aggregateID: string;
3780
3662
  seq: number;
3781
3663
  version: number;
3782
3664
  };
3783
3665
  location?: LocationRef;
3784
- type: "message.part.removed";
3785
3666
  data: {
3667
+ timestamp: number;
3786
3668
  sessionID: string;
3787
- messageID: string;
3788
- partID: string;
3669
+ assistantMessageID: string;
3670
+ textID: string;
3789
3671
  };
3790
3672
  };
3791
- export type V2EventSessionNextAgentSwitched = {
3673
+ export type SessionNextTextEnded = {
3792
3674
  id: string;
3793
3675
  metadata?: {
3794
3676
  [key: string]: unknown;
3795
3677
  };
3678
+ type: "session.next.text.ended";
3796
3679
  durable?: {
3797
3680
  aggregateID: string;
3798
3681
  seq: number;
3799
3682
  version: number;
3800
3683
  };
3801
3684
  location?: LocationRef;
3802
- type: "session.next.agent.switched";
3803
3685
  data: {
3804
3686
  timestamp: number;
3805
3687
  sessionID: string;
3806
- messageID: string;
3807
- agent: string;
3688
+ assistantMessageID: string;
3689
+ textID: string;
3690
+ text: string;
3808
3691
  };
3809
3692
  };
3810
- export type V2EventSessionNextModelSwitched = {
3693
+ export type SessionNextToolInputStarted = {
3811
3694
  id: string;
3812
3695
  metadata?: {
3813
3696
  [key: string]: unknown;
3814
3697
  };
3698
+ type: "session.next.tool.input.started";
3815
3699
  durable?: {
3816
3700
  aggregateID: string;
3817
3701
  seq: number;
3818
3702
  version: number;
3819
3703
  };
3820
3704
  location?: LocationRef;
3821
- type: "session.next.model.switched";
3822
3705
  data: {
3823
3706
  timestamp: number;
3824
3707
  sessionID: string;
3825
- messageID: string;
3826
- model: {
3827
- id: string;
3828
- providerID: string;
3829
- variant?: string;
3830
- };
3708
+ assistantMessageID: string;
3709
+ callID: string;
3710
+ name: string;
3831
3711
  };
3832
3712
  };
3833
- export type V2EventSessionNextMoved = {
3713
+ export type SessionNextToolInputEnded = {
3834
3714
  id: string;
3835
3715
  metadata?: {
3836
3716
  [key: string]: unknown;
3837
3717
  };
3718
+ type: "session.next.tool.input.ended";
3838
3719
  durable?: {
3839
3720
  aggregateID: string;
3840
3721
  seq: number;
3841
3722
  version: number;
3842
3723
  };
3843
3724
  location?: LocationRef;
3844
- type: "session.next.moved";
3845
3725
  data: {
3846
3726
  timestamp: number;
3847
3727
  sessionID: string;
3848
- location: LocationRef;
3849
- subdirectory?: string;
3728
+ assistantMessageID: string;
3729
+ callID: string;
3730
+ text: string;
3850
3731
  };
3851
3732
  };
3852
- export type V2EventSessionNextPrompted = {
3733
+ export type SessionNextToolCalled = {
3853
3734
  id: string;
3854
3735
  metadata?: {
3855
3736
  [key: string]: unknown;
3856
3737
  };
3738
+ type: "session.next.tool.called";
3857
3739
  durable?: {
3858
3740
  aggregateID: string;
3859
3741
  seq: number;
3860
3742
  version: number;
3861
3743
  };
3862
3744
  location?: LocationRef;
3863
- type: "session.next.prompted";
3864
3745
  data: {
3865
3746
  timestamp: number;
3866
3747
  sessionID: string;
3867
- messageID: string;
3868
- prompt: Prompt;
3869
- 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
+ };
3870
3758
  };
3871
3759
  };
3872
- export type V2EventSessionNextPromptAdmitted = {
3760
+ export type SessionNextToolProgress = {
3873
3761
  id: string;
3874
3762
  metadata?: {
3875
3763
  [key: string]: unknown;
3876
3764
  };
3765
+ type: "session.next.tool.progress";
3877
3766
  durable?: {
3878
3767
  aggregateID: string;
3879
3768
  seq: number;
3880
3769
  version: number;
3881
3770
  };
3882
3771
  location?: LocationRef;
3883
- type: "session.next.prompt.admitted";
3884
3772
  data: {
3885
3773
  timestamp: number;
3886
3774
  sessionID: string;
3887
- messageID: string;
3888
- prompt: Prompt;
3889
- delivery: "steer" | "queue";
3890
- };
3775
+ assistantMessageID: string;
3776
+ callID: string;
3777
+ structured: {
3778
+ [key: string]: unknown;
3779
+ };
3780
+ content: Array<LlmToolContent>;
3781
+ };
3891
3782
  };
3892
- export type V2EventSessionNextContextUpdated = {
3783
+ export type SessionNextToolSuccess = {
3893
3784
  id: string;
3894
3785
  metadata?: {
3895
3786
  [key: string]: unknown;
3896
3787
  };
3788
+ type: "session.next.tool.success";
3897
3789
  durable?: {
3898
3790
  aggregateID: string;
3899
3791
  seq: number;
3900
3792
  version: number;
3901
3793
  };
3902
3794
  location?: LocationRef;
3903
- type: "session.next.context.updated";
3904
3795
  data: {
3905
3796
  timestamp: number;
3906
3797
  sessionID: string;
3907
- messageID: string;
3908
- 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
+ };
3909
3810
  };
3910
3811
  };
3911
- export type V2EventSessionNextSynthetic = {
3812
+ export type SessionNextToolFailed = {
3912
3813
  id: string;
3913
3814
  metadata?: {
3914
3815
  [key: string]: unknown;
3915
3816
  };
3817
+ type: "session.next.tool.failed";
3916
3818
  durable?: {
3917
3819
  aggregateID: string;
3918
3820
  seq: number;
3919
3821
  version: number;
3920
3822
  };
3921
3823
  location?: LocationRef;
3922
- type: "session.next.synthetic";
3923
3824
  data: {
3924
3825
  timestamp: number;
3925
3826
  sessionID: string;
3926
- messageID: string;
3927
- text: string;
3827
+ assistantMessageID: string;
3828
+ callID: string;
3829
+ error: SessionErrorUnknown;
3830
+ result?: unknown;
3831
+ provider: {
3832
+ executed: boolean;
3833
+ metadata?: LlmProviderMetadata;
3834
+ };
3928
3835
  };
3929
3836
  };
3930
- export type V2EventSessionNextShellStarted = {
3837
+ export type SessionNextReasoningStarted = {
3931
3838
  id: string;
3932
3839
  metadata?: {
3933
3840
  [key: string]: unknown;
3934
3841
  };
3842
+ type: "session.next.reasoning.started";
3935
3843
  durable?: {
3936
3844
  aggregateID: string;
3937
3845
  seq: number;
3938
3846
  version: number;
3939
3847
  };
3940
3848
  location?: LocationRef;
3941
- type: "session.next.shell.started";
3942
3849
  data: {
3943
3850
  timestamp: number;
3944
3851
  sessionID: string;
3945
- messageID: string;
3946
- callID: string;
3947
- command: string;
3852
+ assistantMessageID: string;
3853
+ reasoningID: string;
3854
+ providerMetadata?: LlmProviderMetadata;
3948
3855
  };
3949
3856
  };
3950
- export type V2EventSessionNextShellEnded = {
3857
+ export type SessionNextReasoningEnded = {
3951
3858
  id: string;
3952
3859
  metadata?: {
3953
3860
  [key: string]: unknown;
3954
3861
  };
3862
+ type: "session.next.reasoning.ended";
3955
3863
  durable?: {
3956
3864
  aggregateID: string;
3957
3865
  seq: number;
3958
3866
  version: number;
3959
3867
  };
3960
3868
  location?: LocationRef;
3961
- type: "session.next.shell.ended";
3962
3869
  data: {
3963
3870
  timestamp: number;
3964
3871
  sessionID: string;
3965
- callID: string;
3966
- output: string;
3872
+ assistantMessageID: string;
3873
+ reasoningID: string;
3874
+ text: string;
3875
+ providerMetadata?: LlmProviderMetadata;
3967
3876
  };
3968
3877
  };
3969
- export type V2EventSessionNextStepStarted = {
3878
+ export type SessionNextRetried = {
3970
3879
  id: string;
3971
3880
  metadata?: {
3972
3881
  [key: string]: unknown;
3973
3882
  };
3883
+ type: "session.next.retried";
3974
3884
  durable?: {
3975
3885
  aggregateID: string;
3976
3886
  seq: number;
3977
3887
  version: number;
3978
3888
  };
3979
3889
  location?: LocationRef;
3980
- type: "session.next.step.started";
3981
3890
  data: {
3982
3891
  timestamp: number;
3983
3892
  sessionID: string;
3984
- assistantMessageID: string;
3985
- agent: string;
3986
- model: {
3987
- id: string;
3988
- providerID: string;
3989
- variant?: string;
3990
- };
3991
- snapshot?: string;
3893
+ attempt: number;
3894
+ error: SessionNextRetryError;
3992
3895
  };
3993
3896
  };
3994
- export type V2EventSessionNextStepEnded = {
3897
+ export type SessionNextCompactionStarted = {
3995
3898
  id: string;
3996
3899
  metadata?: {
3997
3900
  [key: string]: unknown;
3998
3901
  };
3902
+ type: "session.next.compaction.started";
3999
3903
  durable?: {
4000
3904
  aggregateID: string;
4001
3905
  seq: number;
4002
3906
  version: number;
4003
3907
  };
4004
3908
  location?: LocationRef;
4005
- type: "session.next.step.ended";
4006
3909
  data: {
4007
3910
  timestamp: number;
4008
3911
  sessionID: string;
4009
- assistantMessageID: string;
4010
- finish: string;
4011
- cost: number;
4012
- tokens: {
4013
- input: number;
4014
- output: number;
4015
- reasoning: number;
4016
- cache: {
4017
- read: number;
4018
- write: number;
4019
- };
4020
- };
4021
- snapshot?: string;
4022
- files?: Array<string>;
3912
+ messageID: string;
3913
+ reason: "auto" | "manual";
4023
3914
  };
4024
3915
  };
4025
- export type V2EventSessionNextStepFailed = {
3916
+ export type SessionNextCompactionEnded = {
4026
3917
  id: string;
4027
3918
  metadata?: {
4028
3919
  [key: string]: unknown;
4029
3920
  };
3921
+ type: "session.next.compaction.ended";
4030
3922
  durable?: {
4031
3923
  aggregateID: string;
4032
3924
  seq: number;
4033
3925
  version: number;
4034
3926
  };
4035
3927
  location?: LocationRef;
4036
- type: "session.next.step.failed";
4037
3928
  data: {
4038
3929
  timestamp: number;
4039
3930
  sessionID: string;
4040
- assistantMessageID: string;
4041
- error: SessionErrorUnknown;
3931
+ messageID: string;
3932
+ reason: "auto" | "manual";
3933
+ text: string;
3934
+ recent: string;
4042
3935
  };
4043
3936
  };
4044
- export type V2EventSessionNextTextStarted = {
3937
+ export type SessionNextRevertStaged = {
4045
3938
  id: string;
4046
3939
  metadata?: {
4047
3940
  [key: string]: unknown;
4048
3941
  };
3942
+ type: "session.next.revert.staged";
4049
3943
  durable?: {
4050
3944
  aggregateID: string;
4051
3945
  seq: number;
4052
3946
  version: number;
4053
3947
  };
4054
3948
  location?: LocationRef;
4055
- type: "session.next.text.started";
4056
3949
  data: {
4057
3950
  timestamp: number;
4058
3951
  sessionID: string;
4059
- assistantMessageID: string;
4060
- textID: string;
3952
+ revert: RevertState;
4061
3953
  };
4062
3954
  };
4063
- export type V2EventSessionNextTextDelta = {
3955
+ export type SessionNextRevertCleared = {
4064
3956
  id: string;
4065
3957
  metadata?: {
4066
3958
  [key: string]: unknown;
4067
3959
  };
3960
+ type: "session.next.revert.cleared";
4068
3961
  durable?: {
4069
3962
  aggregateID: string;
4070
3963
  seq: number;
4071
3964
  version: number;
4072
3965
  };
4073
3966
  location?: LocationRef;
4074
- type: "session.next.text.delta";
4075
3967
  data: {
4076
3968
  timestamp: number;
4077
3969
  sessionID: string;
4078
- assistantMessageID: string;
4079
- textID: string;
4080
- delta: string;
4081
3970
  };
4082
3971
  };
4083
- export type V2EventSessionNextTextEnded = {
3972
+ export type SessionNextRevertCommitted = {
4084
3973
  id: string;
4085
3974
  metadata?: {
4086
3975
  [key: string]: unknown;
4087
3976
  };
3977
+ type: "session.next.revert.committed";
4088
3978
  durable?: {
4089
3979
  aggregateID: string;
4090
3980
  seq: number;
4091
3981
  version: number;
4092
3982
  };
4093
3983
  location?: LocationRef;
4094
- type: "session.next.text.ended";
4095
3984
  data: {
4096
3985
  timestamp: number;
4097
3986
  sessionID: string;
4098
- assistantMessageID: string;
4099
- textID: string;
4100
- text: string;
3987
+ messageID: string;
4101
3988
  };
4102
3989
  };
4103
- export type V2EventSessionNextReasoningStarted = {
3990
+ export type ModelApi = {
4104
3991
  id: string;
4105
- metadata?: {
3992
+ type: "aisdk";
3993
+ package: string;
3994
+ url?: string;
3995
+ settings?: {
4106
3996
  [key: string]: unknown;
4107
3997
  };
4108
- durable?: {
4109
- aggregateID: string;
4110
- seq: number;
4111
- version: number;
3998
+ } | {
3999
+ id: string;
4000
+ type: "native";
4001
+ url?: string;
4002
+ settings: {
4003
+ [key: string]: unknown;
4112
4004
  };
4113
- location?: LocationRef;
4114
- type: "session.next.reasoning.started";
4115
- data: {
4116
- timestamp: number;
4117
- sessionID: string;
4118
- assistantMessageID: string;
4119
- reasoningID: string;
4120
- providerMetadata?: {
4121
- [key: string]: {
4122
- [key: string]: unknown;
4123
- };
4124
- };
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;
4125
4021
  };
4126
4022
  };
4127
- export type V2EventSessionNextReasoningDelta = {
4023
+ export type ModelV2Info = {
4128
4024
  id: string;
4129
- metadata?: {
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;
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?: {
4130
4065
  [key: string]: unknown;
4131
4066
  };
4132
- durable?: {
4133
- aggregateID: string;
4134
- seq: number;
4135
- version: number;
4067
+ };
4068
+ export type ProviderNative = {
4069
+ type: "native";
4070
+ url?: string;
4071
+ settings: {
4072
+ [key: string]: unknown;
4136
4073
  };
4137
- location?: LocationRef;
4138
- type: "session.next.reasoning.delta";
4139
- data: {
4140
- timestamp: number;
4141
- sessionID: string;
4142
- assistantMessageID: string;
4143
- reasoningID: string;
4144
- delta: string;
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
4145
  };
4146
4146
  };
4147
- export type V2EventSessionNextReasoningEnded = {
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 = {
4148
4174
  id: string;
4175
+ sessionID: string;
4176
+ action: string;
4177
+ resources: Array<string>;
4178
+ save?: Array<string>;
4149
4179
  metadata?: {
4150
4180
  [key: string]: unknown;
4151
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";
4152
4215
  durable?: {
4153
4216
  aggregateID: string;
4154
4217
  seq: number;
4155
4218
  version: number;
4156
4219
  };
4157
4220
  location?: LocationRef;
4158
- type: "session.next.reasoning.ended";
4159
4221
  data: {
4160
- timestamp: number;
4161
- sessionID: string;
4162
- assistantMessageID: string;
4163
- reasoningID: string;
4164
- text: string;
4165
- providerMetadata?: {
4166
- [key: string]: {
4167
- [key: string]: unknown;
4168
- };
4169
- };
4222
+ [key: string]: unknown;
4170
4223
  };
4171
4224
  };
4172
- export type V2EventSessionNextToolInputStarted = {
4225
+ export type IntegrationUpdated = {
4173
4226
  id: string;
4174
4227
  metadata?: {
4175
4228
  [key: string]: unknown;
4176
4229
  };
4230
+ type: "integration.updated";
4177
4231
  durable?: {
4178
4232
  aggregateID: string;
4179
4233
  seq: number;
4180
4234
  version: number;
4181
4235
  };
4182
4236
  location?: LocationRef;
4183
- type: "session.next.tool.input.started";
4184
4237
  data: {
4185
- timestamp: number;
4186
- sessionID: string;
4187
- assistantMessageID: string;
4188
- callID: string;
4189
- name: string;
4238
+ [key: string]: unknown;
4190
4239
  };
4191
4240
  };
4192
- export type V2EventSessionNextToolInputDelta = {
4241
+ export type IntegrationConnectionUpdated = {
4193
4242
  id: string;
4194
4243
  metadata?: {
4195
4244
  [key: string]: unknown;
4196
4245
  };
4246
+ type: "integration.connection.updated";
4197
4247
  durable?: {
4198
4248
  aggregateID: string;
4199
4249
  seq: number;
4200
4250
  version: number;
4201
4251
  };
4202
4252
  location?: LocationRef;
4203
- type: "session.next.tool.input.delta";
4204
4253
  data: {
4205
- timestamp: number;
4206
- sessionID: string;
4207
- assistantMessageID: string;
4208
- callID: string;
4209
- delta: string;
4254
+ integrationID: string;
4210
4255
  };
4211
4256
  };
4212
- export type V2EventSessionNextToolInputEnded = {
4257
+ export type CatalogUpdated = {
4213
4258
  id: string;
4214
4259
  metadata?: {
4215
4260
  [key: string]: unknown;
4216
4261
  };
4262
+ type: "catalog.updated";
4217
4263
  durable?: {
4218
4264
  aggregateID: string;
4219
4265
  seq: number;
4220
4266
  version: number;
4221
4267
  };
4222
4268
  location?: LocationRef;
4223
- type: "session.next.tool.input.ended";
4224
4269
  data: {
4225
- timestamp: number;
4226
- sessionID: string;
4227
- assistantMessageID: string;
4228
- callID: string;
4229
- text: string;
4270
+ [key: string]: unknown;
4230
4271
  };
4231
4272
  };
4232
- export type V2EventSessionNextToolCalled = {
4273
+ export type SessionCreated = {
4233
4274
  id: string;
4234
4275
  metadata?: {
4235
4276
  [key: string]: unknown;
4236
4277
  };
4278
+ type: "session.created";
4237
4279
  durable?: {
4238
4280
  aggregateID: string;
4239
4281
  seq: number;
4240
4282
  version: number;
4241
4283
  };
4242
4284
  location?: LocationRef;
4243
- type: "session.next.tool.called";
4244
4285
  data: {
4245
- timestamp: number;
4246
4286
  sessionID: string;
4247
- assistantMessageID: string;
4248
- callID: string;
4249
- tool: string;
4250
- input: {
4251
- [key: string]: unknown;
4252
- };
4253
- provider: {
4254
- executed: boolean;
4255
- metadata?: {
4256
- [key: string]: {
4257
- [key: string]: unknown;
4258
- };
4259
- };
4260
- };
4287
+ info: Session;
4261
4288
  };
4262
4289
  };
4263
- export type V2EventSessionNextToolProgress = {
4290
+ export type SessionUpdated = {
4264
4291
  id: string;
4265
4292
  metadata?: {
4266
4293
  [key: string]: unknown;
4267
4294
  };
4295
+ type: "session.updated";
4268
4296
  durable?: {
4269
4297
  aggregateID: string;
4270
4298
  seq: number;
4271
4299
  version: number;
4272
4300
  };
4273
4301
  location?: LocationRef;
4274
- type: "session.next.tool.progress";
4275
4302
  data: {
4276
- timestamp: number;
4277
4303
  sessionID: string;
4278
- assistantMessageID: string;
4279
- callID: string;
4280
- structured: {
4281
- [key: string]: unknown;
4282
- };
4283
- content: Array<ToolTextContent | ToolFileContent>;
4304
+ info: Session;
4284
4305
  };
4285
4306
  };
4286
- export type V2EventSessionNextToolSuccess = {
4307
+ export type SessionDeleted = {
4287
4308
  id: string;
4288
4309
  metadata?: {
4289
4310
  [key: string]: unknown;
4290
4311
  };
4312
+ type: "session.deleted";
4291
4313
  durable?: {
4292
4314
  aggregateID: string;
4293
4315
  seq: number;
4294
4316
  version: number;
4295
4317
  };
4296
4318
  location?: LocationRef;
4297
- type: "session.next.tool.success";
4298
4319
  data: {
4299
- timestamp: number;
4300
4320
  sessionID: string;
4301
- assistantMessageID: string;
4302
- callID: string;
4303
- structured: {
4304
- [key: string]: unknown;
4305
- };
4306
- content: Array<ToolTextContent | ToolFileContent>;
4307
- outputPaths?: Array<string>;
4308
- result?: unknown;
4309
- provider: {
4310
- executed: boolean;
4311
- metadata?: {
4312
- [key: string]: {
4313
- [key: string]: unknown;
4314
- };
4315
- };
4316
- };
4321
+ info: Session;
4317
4322
  };
4318
4323
  };
4319
- export type V2EventSessionNextToolFailed = {
4324
+ export type MessageUpdated = {
4320
4325
  id: string;
4321
4326
  metadata?: {
4322
4327
  [key: string]: unknown;
4323
4328
  };
4329
+ type: "message.updated";
4324
4330
  durable?: {
4325
4331
  aggregateID: string;
4326
4332
  seq: number;
4327
4333
  version: number;
4328
4334
  };
4329
4335
  location?: LocationRef;
4330
- type: "session.next.tool.failed";
4331
4336
  data: {
4332
- timestamp: number;
4333
4337
  sessionID: string;
4334
- assistantMessageID: string;
4335
- callID: string;
4336
- error: SessionErrorUnknown;
4337
- result?: unknown;
4338
- provider: {
4339
- executed: boolean;
4340
- metadata?: {
4341
- [key: string]: {
4342
- [key: string]: unknown;
4343
- };
4344
- };
4345
- };
4338
+ info: Message;
4346
4339
  };
4347
4340
  };
4348
- export type V2EventSessionNextRetried = {
4341
+ export type MessageRemoved = {
4349
4342
  id: string;
4350
4343
  metadata?: {
4351
4344
  [key: string]: unknown;
4352
4345
  };
4346
+ type: "message.removed";
4353
4347
  durable?: {
4354
4348
  aggregateID: string;
4355
4349
  seq: number;
4356
4350
  version: number;
4357
4351
  };
4358
4352
  location?: LocationRef;
4359
- type: "session.next.retried";
4360
4353
  data: {
4361
- timestamp: number;
4362
4354
  sessionID: string;
4363
- attempt: number;
4364
- error: SessionNextRetryError;
4355
+ messageID: string;
4365
4356
  };
4366
4357
  };
4367
- export type V2EventSessionNextCompactionStarted = {
4358
+ export type MessagePartUpdated = {
4368
4359
  id: string;
4369
4360
  metadata?: {
4370
4361
  [key: string]: unknown;
4371
4362
  };
4363
+ type: "message.part.updated";
4372
4364
  durable?: {
4373
4365
  aggregateID: string;
4374
4366
  seq: number;
4375
4367
  version: number;
4376
4368
  };
4377
4369
  location?: LocationRef;
4378
- type: "session.next.compaction.started";
4379
4370
  data: {
4380
- timestamp: number;
4381
4371
  sessionID: string;
4382
- messageID: string;
4383
- reason: "auto" | "manual";
4372
+ part: Part;
4373
+ time: number;
4384
4374
  };
4385
4375
  };
4386
- export type V2EventSessionNextCompactionDelta = {
4376
+ export type MessagePartRemoved = {
4387
4377
  id: string;
4388
4378
  metadata?: {
4389
4379
  [key: string]: unknown;
4390
4380
  };
4381
+ type: "message.part.removed";
4391
4382
  durable?: {
4392
4383
  aggregateID: string;
4393
4384
  seq: number;
4394
4385
  version: number;
4395
4386
  };
4396
4387
  location?: LocationRef;
4397
- type: "session.next.compaction.delta";
4398
4388
  data: {
4399
- timestamp: number;
4400
4389
  sessionID: string;
4401
4390
  messageID: string;
4402
- text: string;
4391
+ partID: string;
4403
4392
  };
4404
4393
  };
4405
- export type V2EventSessionNextCompactionEnded = {
4394
+ export type SessionNextTextDelta = {
4406
4395
  id: string;
4407
4396
  metadata?: {
4408
4397
  [key: string]: unknown;
4409
4398
  };
4399
+ type: "session.next.text.delta";
4410
4400
  durable?: {
4411
4401
  aggregateID: string;
4412
4402
  seq: number;
4413
4403
  version: number;
4414
4404
  };
4415
4405
  location?: LocationRef;
4416
- type: "session.next.compaction.ended";
4417
4406
  data: {
4418
4407
  timestamp: number;
4419
4408
  sessionID: string;
4420
- messageID: string;
4421
- reason: "auto" | "manual";
4422
- text: string;
4423
- recent: string;
4409
+ assistantMessageID: string;
4410
+ textID: string;
4411
+ delta: string;
4424
4412
  };
4425
4413
  };
4426
- export type V2EventSessionNextRevertStaged = {
4414
+ export type SessionNextReasoningDelta = {
4427
4415
  id: string;
4428
4416
  metadata?: {
4429
4417
  [key: string]: unknown;
4430
4418
  };
4419
+ type: "session.next.reasoning.delta";
4431
4420
  durable?: {
4432
4421
  aggregateID: string;
4433
4422
  seq: number;
4434
4423
  version: number;
4435
4424
  };
4436
4425
  location?: LocationRef;
4437
- type: "session.next.revert.staged";
4438
4426
  data: {
4439
4427
  timestamp: number;
4440
4428
  sessionID: string;
4441
- revert: {
4442
- messageID: string;
4443
- partID?: string;
4444
- snapshot?: string;
4445
- diff?: string;
4446
- files?: Array<FileDiff>;
4447
- };
4429
+ assistantMessageID: string;
4430
+ reasoningID: string;
4431
+ delta: string;
4448
4432
  };
4449
4433
  };
4450
- export type V2EventSessionNextRevertCleared = {
4434
+ export type SessionNextToolInputDelta = {
4451
4435
  id: string;
4452
4436
  metadata?: {
4453
4437
  [key: string]: unknown;
4454
4438
  };
4439
+ type: "session.next.tool.input.delta";
4455
4440
  durable?: {
4456
4441
  aggregateID: string;
4457
4442
  seq: number;
4458
4443
  version: number;
4459
4444
  };
4460
4445
  location?: LocationRef;
4461
- type: "session.next.revert.cleared";
4462
4446
  data: {
4463
4447
  timestamp: number;
4464
4448
  sessionID: string;
4449
+ assistantMessageID: string;
4450
+ callID: string;
4451
+ delta: string;
4465
4452
  };
4466
4453
  };
4467
- export type V2EventSessionNextRevertCommitted = {
4454
+ export type SessionNextCompactionDelta = {
4468
4455
  id: string;
4469
4456
  metadata?: {
4470
4457
  [key: string]: unknown;
4471
4458
  };
4459
+ type: "session.next.compaction.delta";
4472
4460
  durable?: {
4473
4461
  aggregateID: string;
4474
4462
  seq: number;
4475
4463
  version: number;
4476
4464
  };
4477
4465
  location?: LocationRef;
4478
- type: "session.next.revert.committed";
4479
4466
  data: {
4480
4467
  timestamp: number;
4481
4468
  sessionID: string;
4482
4469
  messageID: string;
4470
+ text: string;
4483
4471
  };
4484
4472
  };
4485
- export type V2EventMessagePartDelta = {
4473
+ export type MessagePartDelta = {
4486
4474
  id: string;
4487
4475
  metadata?: {
4488
4476
  [key: string]: unknown;
4489
4477
  };
4478
+ type: "message.part.delta";
4490
4479
  durable?: {
4491
4480
  aggregateID: string;
4492
4481
  seq: number;
4493
4482
  version: number;
4494
4483
  };
4495
4484
  location?: LocationRef;
4496
- type: "message.part.delta";
4497
4485
  data: {
4498
4486
  sessionID: string;
4499
4487
  messageID: string;
@@ -4502,116 +4490,116 @@ export type V2EventMessagePartDelta = {
4502
4490
  delta: string;
4503
4491
  };
4504
4492
  };
4505
- export type V2EventSessionDiff = {
4493
+ export type SessionDiff = {
4506
4494
  id: string;
4507
4495
  metadata?: {
4508
4496
  [key: string]: unknown;
4509
4497
  };
4498
+ type: "session.diff";
4510
4499
  durable?: {
4511
4500
  aggregateID: string;
4512
4501
  seq: number;
4513
4502
  version: number;
4514
4503
  };
4515
4504
  location?: LocationRef;
4516
- type: "session.diff";
4517
4505
  data: {
4518
4506
  sessionID: string;
4519
4507
  diff: Array<SnapshotFileDiff>;
4520
4508
  };
4521
4509
  };
4522
- export type V2EventSessionError = {
4510
+ export type SessionError = {
4523
4511
  id: string;
4524
4512
  metadata?: {
4525
4513
  [key: string]: unknown;
4526
4514
  };
4515
+ type: "session.error";
4527
4516
  durable?: {
4528
4517
  aggregateID: string;
4529
4518
  seq: number;
4530
4519
  version: number;
4531
4520
  };
4532
4521
  location?: LocationRef;
4533
- type: "session.error";
4534
4522
  data: {
4535
4523
  sessionID?: string;
4536
4524
  error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | StructuredOutputError | ContextOverflowError | ContentFilterError | ApiError;
4537
4525
  };
4538
4526
  };
4539
- export type V2EventInstallationUpdated = {
4527
+ export type InstallationUpdated = {
4540
4528
  id: string;
4541
4529
  metadata?: {
4542
4530
  [key: string]: unknown;
4543
4531
  };
4532
+ type: "installation.updated";
4544
4533
  durable?: {
4545
4534
  aggregateID: string;
4546
4535
  seq: number;
4547
4536
  version: number;
4548
4537
  };
4549
4538
  location?: LocationRef;
4550
- type: "installation.updated";
4551
4539
  data: {
4552
4540
  version: string;
4553
4541
  };
4554
4542
  };
4555
- export type V2EventInstallationUpdateAvailable = {
4543
+ export type InstallationUpdateAvailable = {
4556
4544
  id: string;
4557
4545
  metadata?: {
4558
4546
  [key: string]: unknown;
4559
4547
  };
4548
+ type: "installation.update-available";
4560
4549
  durable?: {
4561
4550
  aggregateID: string;
4562
4551
  seq: number;
4563
4552
  version: number;
4564
4553
  };
4565
4554
  location?: LocationRef;
4566
- type: "installation.update-available";
4567
4555
  data: {
4568
4556
  version: string;
4569
4557
  };
4570
4558
  };
4571
- export type V2EventFileEdited = {
4559
+ export type FileEdited = {
4572
4560
  id: string;
4573
4561
  metadata?: {
4574
4562
  [key: string]: unknown;
4575
4563
  };
4564
+ type: "file.edited";
4576
4565
  durable?: {
4577
4566
  aggregateID: string;
4578
4567
  seq: number;
4579
4568
  version: number;
4580
4569
  };
4581
4570
  location?: LocationRef;
4582
- type: "file.edited";
4583
4571
  data: {
4584
4572
  file: string;
4585
4573
  };
4586
4574
  };
4587
- export type V2EventReferenceUpdated = {
4575
+ export type ReferenceUpdated = {
4588
4576
  id: string;
4589
4577
  metadata?: {
4590
4578
  [key: string]: unknown;
4591
4579
  };
4580
+ type: "reference.updated";
4592
4581
  durable?: {
4593
4582
  aggregateID: string;
4594
4583
  seq: number;
4595
4584
  version: number;
4596
4585
  };
4597
4586
  location?: LocationRef;
4598
- type: "reference.updated";
4599
4587
  data: {
4600
4588
  [key: string]: unknown;
4601
4589
  };
4602
4590
  };
4603
- export type V2EventPermissionV2Asked = {
4591
+ export type PermissionV2Asked = {
4604
4592
  id: string;
4605
4593
  metadata?: {
4606
4594
  [key: string]: unknown;
4607
4595
  };
4596
+ type: "permission.v2.asked";
4608
4597
  durable?: {
4609
4598
  aggregateID: string;
4610
4599
  seq: number;
4611
4600
  version: number;
4612
4601
  };
4613
4602
  location?: LocationRef;
4614
- type: "permission.v2.asked";
4615
4603
  data: {
4616
4604
  id: string;
4617
4605
  sessionID: string;
@@ -4624,150 +4612,150 @@ export type V2EventPermissionV2Asked = {
4624
4612
  source?: PermissionV2Source;
4625
4613
  };
4626
4614
  };
4627
- export type V2EventPermissionV2Replied = {
4615
+ export type PermissionV2Replied = {
4628
4616
  id: string;
4629
4617
  metadata?: {
4630
4618
  [key: string]: unknown;
4631
4619
  };
4620
+ type: "permission.v2.replied";
4632
4621
  durable?: {
4633
4622
  aggregateID: string;
4634
4623
  seq: number;
4635
4624
  version: number;
4636
4625
  };
4637
4626
  location?: LocationRef;
4638
- type: "permission.v2.replied";
4639
4627
  data: {
4640
4628
  sessionID: string;
4641
4629
  requestID: string;
4642
4630
  reply: PermissionV2Reply;
4643
4631
  };
4644
4632
  };
4645
- export type V2EventPluginAdded = {
4633
+ export type PluginAdded = {
4646
4634
  id: string;
4647
4635
  metadata?: {
4648
4636
  [key: string]: unknown;
4649
4637
  };
4638
+ type: "plugin.added";
4650
4639
  durable?: {
4651
4640
  aggregateID: string;
4652
4641
  seq: number;
4653
4642
  version: number;
4654
4643
  };
4655
4644
  location?: LocationRef;
4656
- type: "plugin.added";
4657
4645
  data: {
4658
4646
  id: string;
4659
4647
  };
4660
4648
  };
4661
- export type V2EventProjectDirectoriesUpdated = {
4649
+ export type ProjectDirectoriesUpdated = {
4662
4650
  id: string;
4663
4651
  metadata?: {
4664
4652
  [key: string]: unknown;
4665
4653
  };
4654
+ type: "project.directories.updated";
4666
4655
  durable?: {
4667
4656
  aggregateID: string;
4668
4657
  seq: number;
4669
4658
  version: number;
4670
4659
  };
4671
4660
  location?: LocationRef;
4672
- type: "project.directories.updated";
4673
4661
  data: {
4674
4662
  projectID: string;
4675
4663
  };
4676
4664
  };
4677
- export type V2EventFileWatcherUpdated = {
4665
+ export type FileWatcherUpdated = {
4678
4666
  id: string;
4679
4667
  metadata?: {
4680
4668
  [key: string]: unknown;
4681
4669
  };
4670
+ type: "file.watcher.updated";
4682
4671
  durable?: {
4683
4672
  aggregateID: string;
4684
4673
  seq: number;
4685
4674
  version: number;
4686
4675
  };
4687
4676
  location?: LocationRef;
4688
- type: "file.watcher.updated";
4689
4677
  data: {
4690
4678
  file: string;
4691
4679
  event: "add" | "change" | "unlink";
4692
4680
  };
4693
4681
  };
4694
- export type V2EventPtyCreated = {
4682
+ export type PtyCreated = {
4695
4683
  id: string;
4696
4684
  metadata?: {
4697
4685
  [key: string]: unknown;
4698
4686
  };
4687
+ type: "pty.created";
4699
4688
  durable?: {
4700
4689
  aggregateID: string;
4701
4690
  seq: number;
4702
4691
  version: number;
4703
4692
  };
4704
4693
  location?: LocationRef;
4705
- type: "pty.created";
4706
4694
  data: {
4707
4695
  info: Pty;
4708
4696
  };
4709
4697
  };
4710
- export type V2EventPtyUpdated = {
4698
+ export type PtyUpdated = {
4711
4699
  id: string;
4712
4700
  metadata?: {
4713
4701
  [key: string]: unknown;
4714
4702
  };
4703
+ type: "pty.updated";
4715
4704
  durable?: {
4716
4705
  aggregateID: string;
4717
4706
  seq: number;
4718
4707
  version: number;
4719
4708
  };
4720
4709
  location?: LocationRef;
4721
- type: "pty.updated";
4722
4710
  data: {
4723
4711
  info: Pty;
4724
4712
  };
4725
4713
  };
4726
- export type V2EventPtyExited = {
4714
+ export type PtyExited = {
4727
4715
  id: string;
4728
4716
  metadata?: {
4729
4717
  [key: string]: unknown;
4730
4718
  };
4719
+ type: "pty.exited";
4731
4720
  durable?: {
4732
4721
  aggregateID: string;
4733
4722
  seq: number;
4734
4723
  version: number;
4735
4724
  };
4736
4725
  location?: LocationRef;
4737
- type: "pty.exited";
4738
4726
  data: {
4739
4727
  id: string;
4740
4728
  exitCode: number;
4741
4729
  };
4742
4730
  };
4743
- export type V2EventPtyDeleted = {
4731
+ export type PtyDeleted = {
4744
4732
  id: string;
4745
4733
  metadata?: {
4746
4734
  [key: string]: unknown;
4747
4735
  };
4736
+ type: "pty.deleted";
4748
4737
  durable?: {
4749
4738
  aggregateID: string;
4750
4739
  seq: number;
4751
4740
  version: number;
4752
4741
  };
4753
4742
  location?: LocationRef;
4754
- type: "pty.deleted";
4755
4743
  data: {
4756
4744
  id: string;
4757
4745
  };
4758
4746
  };
4759
- export type V2EventQuestionV2Asked = {
4747
+ export type QuestionV2Asked = {
4760
4748
  id: string;
4761
4749
  metadata?: {
4762
4750
  [key: string]: unknown;
4763
4751
  };
4752
+ type: "question.v2.asked";
4764
4753
  durable?: {
4765
4754
  aggregateID: string;
4766
4755
  seq: number;
4767
4756
  version: number;
4768
4757
  };
4769
4758
  location?: LocationRef;
4770
- type: "question.v2.asked";
4771
4759
  data: {
4772
4760
  id: string;
4773
4761
  sessionID: string;
@@ -4778,86 +4766,86 @@ export type V2EventQuestionV2Asked = {
4778
4766
  tool?: QuestionV2Tool;
4779
4767
  };
4780
4768
  };
4781
- export type V2EventQuestionV2Replied = {
4769
+ export type QuestionV2Replied = {
4782
4770
  id: string;
4783
4771
  metadata?: {
4784
4772
  [key: string]: unknown;
4785
4773
  };
4774
+ type: "question.v2.replied";
4786
4775
  durable?: {
4787
4776
  aggregateID: string;
4788
4777
  seq: number;
4789
4778
  version: number;
4790
4779
  };
4791
4780
  location?: LocationRef;
4792
- type: "question.v2.replied";
4793
4781
  data: {
4794
4782
  sessionID: string;
4795
4783
  requestID: string;
4796
4784
  answers: Array<QuestionV2Answer>;
4797
4785
  };
4798
4786
  };
4799
- export type V2EventQuestionV2Rejected = {
4787
+ export type QuestionV2Rejected = {
4800
4788
  id: string;
4801
4789
  metadata?: {
4802
4790
  [key: string]: unknown;
4803
4791
  };
4792
+ type: "question.v2.rejected";
4804
4793
  durable?: {
4805
4794
  aggregateID: string;
4806
4795
  seq: number;
4807
4796
  version: number;
4808
4797
  };
4809
4798
  location?: LocationRef;
4810
- type: "question.v2.rejected";
4811
4799
  data: {
4812
4800
  sessionID: string;
4813
4801
  requestID: string;
4814
4802
  };
4815
4803
  };
4816
- export type V2EventTodoUpdated = {
4804
+ export type TodoUpdated = {
4817
4805
  id: string;
4818
4806
  metadata?: {
4819
4807
  [key: string]: unknown;
4820
4808
  };
4809
+ type: "todo.updated";
4821
4810
  durable?: {
4822
4811
  aggregateID: string;
4823
4812
  seq: number;
4824
4813
  version: number;
4825
4814
  };
4826
4815
  location?: LocationRef;
4827
- type: "todo.updated";
4828
4816
  data: {
4829
4817
  sessionID: string;
4830
4818
  todos: Array<Todo>;
4831
4819
  };
4832
4820
  };
4833
- export type V2EventLspUpdated = {
4821
+ export type LspUpdated = {
4834
4822
  id: string;
4835
4823
  metadata?: {
4836
4824
  [key: string]: unknown;
4837
4825
  };
4826
+ type: "lsp.updated";
4838
4827
  durable?: {
4839
4828
  aggregateID: string;
4840
4829
  seq: number;
4841
4830
  version: number;
4842
4831
  };
4843
4832
  location?: LocationRef;
4844
- type: "lsp.updated";
4845
4833
  data: {
4846
4834
  [key: string]: unknown;
4847
4835
  };
4848
4836
  };
4849
- export type V2EventPermissionAsked = {
4837
+ export type PermissionAsked = {
4850
4838
  id: string;
4851
4839
  metadata?: {
4852
4840
  [key: string]: unknown;
4853
4841
  };
4842
+ type: "permission.asked";
4854
4843
  durable?: {
4855
4844
  aggregateID: string;
4856
4845
  seq: number;
4857
4846
  version: number;
4858
4847
  };
4859
4848
  location?: LocationRef;
4860
- type: "permission.asked";
4861
4849
  data: {
4862
4850
  id: string;
4863
4851
  sessionID: string;
@@ -4873,68 +4861,68 @@ export type V2EventPermissionAsked = {
4873
4861
  };
4874
4862
  };
4875
4863
  };
4876
- export type V2EventPermissionReplied = {
4864
+ export type PermissionReplied = {
4877
4865
  id: string;
4878
4866
  metadata?: {
4879
4867
  [key: string]: unknown;
4880
4868
  };
4869
+ type: "permission.replied";
4881
4870
  durable?: {
4882
4871
  aggregateID: string;
4883
4872
  seq: number;
4884
4873
  version: number;
4885
4874
  };
4886
4875
  location?: LocationRef;
4887
- type: "permission.replied";
4888
4876
  data: {
4889
4877
  sessionID: string;
4890
4878
  requestID: string;
4891
4879
  reply: "once" | "always" | "reject";
4892
4880
  };
4893
4881
  };
4894
- export type V2EventTuiPromptAppend = {
4882
+ export type TuiPromptAppend = {
4895
4883
  id: string;
4896
4884
  metadata?: {
4897
4885
  [key: string]: unknown;
4898
4886
  };
4887
+ type: "tui.prompt.append";
4899
4888
  durable?: {
4900
4889
  aggregateID: string;
4901
4890
  seq: number;
4902
4891
  version: number;
4903
4892
  };
4904
4893
  location?: LocationRef;
4905
- type: "tui.prompt.append";
4906
4894
  data: {
4907
4895
  text: string;
4908
4896
  };
4909
4897
  };
4910
- export type V2EventTuiCommandExecute = {
4898
+ export type TuiCommandExecute = {
4911
4899
  id: string;
4912
4900
  metadata?: {
4913
4901
  [key: string]: unknown;
4914
4902
  };
4903
+ type: "tui.command.execute";
4915
4904
  durable?: {
4916
4905
  aggregateID: string;
4917
4906
  seq: number;
4918
4907
  version: number;
4919
4908
  };
4920
4909
  location?: LocationRef;
4921
- type: "tui.command.execute";
4922
4910
  data: {
4923
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;
4924
4912
  };
4925
4913
  };
4926
- export type V2EventTuiToastShow = {
4914
+ export type TuiToastShow = {
4927
4915
  id: string;
4928
4916
  metadata?: {
4929
4917
  [key: string]: unknown;
4930
4918
  };
4919
+ type: "tui.toast.show";
4931
4920
  durable?: {
4932
4921
  aggregateID: string;
4933
4922
  seq: number;
4934
4923
  version: number;
4935
4924
  };
4936
4925
  location?: LocationRef;
4937
- type: "tui.toast.show";
4938
4926
  data: {
4939
4927
  title?: string;
4940
4928
  message: string;
@@ -4942,18 +4930,18 @@ export type V2EventTuiToastShow = {
4942
4930
  duration?: number;
4943
4931
  };
4944
4932
  };
4945
- export type V2EventTuiSessionSelect = {
4933
+ export type TuiSessionSelect = {
4946
4934
  id: string;
4947
4935
  metadata?: {
4948
4936
  [key: string]: unknown;
4949
4937
  };
4938
+ type: "tui.session.select";
4950
4939
  durable?: {
4951
4940
  aggregateID: string;
4952
4941
  seq: number;
4953
4942
  version: number;
4954
4943
  };
4955
4944
  location?: LocationRef;
4956
- type: "tui.session.select";
4957
4945
  data: {
4958
4946
  /**
4959
4947
  * Session ID to navigate to
@@ -4961,51 +4949,51 @@ export type V2EventTuiSessionSelect = {
4961
4949
  sessionID: string;
4962
4950
  };
4963
4951
  };
4964
- export type V2EventMcpToolsChanged = {
4952
+ export type McpToolsChanged = {
4965
4953
  id: string;
4966
4954
  metadata?: {
4967
4955
  [key: string]: unknown;
4968
4956
  };
4957
+ type: "mcp.tools.changed";
4969
4958
  durable?: {
4970
4959
  aggregateID: string;
4971
4960
  seq: number;
4972
4961
  version: number;
4973
4962
  };
4974
4963
  location?: LocationRef;
4975
- type: "mcp.tools.changed";
4976
4964
  data: {
4977
4965
  server: string;
4978
4966
  };
4979
4967
  };
4980
- export type V2EventMcpBrowserOpenFailed = {
4968
+ export type McpBrowserOpenFailed = {
4981
4969
  id: string;
4982
4970
  metadata?: {
4983
4971
  [key: string]: unknown;
4984
4972
  };
4973
+ type: "mcp.browser.open.failed";
4985
4974
  durable?: {
4986
4975
  aggregateID: string;
4987
4976
  seq: number;
4988
4977
  version: number;
4989
4978
  };
4990
4979
  location?: LocationRef;
4991
- type: "mcp.browser.open.failed";
4992
4980
  data: {
4993
4981
  mcpName: string;
4994
4982
  url: string;
4995
4983
  };
4996
4984
  };
4997
- export type V2EventCommandExecuted = {
4985
+ export type CommandExecuted = {
4998
4986
  id: string;
4999
4987
  metadata?: {
5000
4988
  [key: string]: unknown;
5001
4989
  };
4990
+ type: "command.executed";
5002
4991
  durable?: {
5003
4992
  aggregateID: string;
5004
4993
  seq: number;
5005
4994
  version: number;
5006
4995
  };
5007
4996
  location?: LocationRef;
5008
- type: "command.executed";
5009
4997
  data: {
5010
4998
  name: string;
5011
4999
  sessionID: string;
@@ -5013,87 +5001,57 @@ export type V2EventCommandExecuted = {
5013
5001
  messageID: string;
5014
5002
  };
5015
5003
  };
5016
- export type V2EventProjectUpdated = {
5004
+ export type ProjectUpdated = {
5017
5005
  id: string;
5018
5006
  metadata?: {
5019
5007
  [key: string]: unknown;
5020
5008
  };
5009
+ type: "project.updated";
5021
5010
  durable?: {
5022
5011
  aggregateID: string;
5023
5012
  seq: number;
5024
5013
  version: number;
5025
5014
  };
5026
5015
  location?: LocationRef;
5027
- type: "project.updated";
5028
5016
  data: {
5029
5017
  id: string;
5030
5018
  worktree: string;
5031
- vcs?: "git";
5019
+ vcs?: ProjectVcs;
5032
5020
  name?: string;
5033
- icon?: {
5034
- url?: string;
5035
- override?: string;
5036
- color?: string;
5037
- };
5038
- commands?: {
5039
- /**
5040
- * Startup script to run when creating a new workspace (worktree)
5041
- */
5042
- start?: string;
5043
- };
5044
- time: {
5045
- created: number;
5046
- updated: number;
5047
- initialized?: number;
5048
- };
5021
+ icon?: ProjectIcon;
5022
+ commands?: ProjectCommands;
5023
+ time: ProjectTime;
5049
5024
  sandboxes: Array<string>;
5050
5025
  };
5051
5026
  };
5052
- export type V2EventSessionStatus = {
5053
- id: string;
5054
- metadata?: {
5055
- [key: string]: unknown;
5056
- };
5057
- durable?: {
5058
- aggregateID: string;
5059
- seq: number;
5060
- version: number;
5061
- };
5062
- location?: LocationRef;
5063
- type: "session.status";
5064
- data: {
5065
- sessionID: string;
5066
- status: SessionStatus;
5067
- };
5068
- };
5069
- export type V2EventSessionIdle = {
5027
+ export type SessionIdle = {
5070
5028
  id: string;
5071
5029
  metadata?: {
5072
5030
  [key: string]: unknown;
5073
5031
  };
5032
+ type: "session.idle";
5074
5033
  durable?: {
5075
5034
  aggregateID: string;
5076
5035
  seq: number;
5077
5036
  version: number;
5078
5037
  };
5079
5038
  location?: LocationRef;
5080
- type: "session.idle";
5081
5039
  data: {
5082
5040
  sessionID: string;
5083
5041
  };
5084
5042
  };
5085
- export type V2EventQuestionAsked = {
5043
+ export type QuestionAsked = {
5086
5044
  id: string;
5087
5045
  metadata?: {
5088
5046
  [key: string]: unknown;
5089
5047
  };
5048
+ type: "question.asked";
5090
5049
  durable?: {
5091
5050
  aggregateID: string;
5092
5051
  seq: number;
5093
5052
  version: number;
5094
5053
  };
5095
5054
  location?: LocationRef;
5096
- type: "question.asked";
5097
5055
  data: {
5098
5056
  id: string;
5099
5057
  sessionID: string;
@@ -5104,183 +5062,148 @@ export type V2EventQuestionAsked = {
5104
5062
  tool?: QuestionTool;
5105
5063
  };
5106
5064
  };
5107
- export type V2EventQuestionReplied = {
5108
- id: string;
5109
- metadata?: {
5110
- [key: string]: unknown;
5111
- };
5112
- durable?: {
5113
- aggregateID: string;
5114
- seq: number;
5115
- version: number;
5116
- };
5117
- location?: LocationRef;
5118
- type: "question.replied";
5119
- data: {
5120
- sessionID: string;
5121
- requestID: string;
5122
- answers: Array<QuestionAnswer>;
5123
- };
5124
- };
5125
- export type V2EventQuestionRejected = {
5126
- id: string;
5127
- metadata?: {
5128
- [key: string]: unknown;
5129
- };
5130
- durable?: {
5131
- aggregateID: string;
5132
- seq: number;
5133
- version: number;
5134
- };
5135
- location?: LocationRef;
5136
- type: "question.rejected";
5137
- data: {
5138
- sessionID: string;
5139
- requestID: string;
5140
- };
5141
- };
5142
- export type V2EventSessionCompacted = {
5065
+ export type SessionCompacted = {
5143
5066
  id: string;
5144
5067
  metadata?: {
5145
5068
  [key: string]: unknown;
5146
5069
  };
5070
+ type: "session.compacted";
5147
5071
  durable?: {
5148
5072
  aggregateID: string;
5149
5073
  seq: number;
5150
5074
  version: number;
5151
5075
  };
5152
5076
  location?: LocationRef;
5153
- type: "session.compacted";
5154
5077
  data: {
5155
5078
  sessionID: string;
5156
5079
  };
5157
5080
  };
5158
- export type V2EventVcsBranchUpdated = {
5081
+ export type VcsBranchUpdated = {
5159
5082
  id: string;
5160
5083
  metadata?: {
5161
5084
  [key: string]: unknown;
5162
5085
  };
5086
+ type: "vcs.branch.updated";
5163
5087
  durable?: {
5164
5088
  aggregateID: string;
5165
5089
  seq: number;
5166
5090
  version: number;
5167
5091
  };
5168
5092
  location?: LocationRef;
5169
- type: "vcs.branch.updated";
5170
5093
  data: {
5171
5094
  branch?: string;
5172
5095
  };
5173
5096
  };
5174
- export type V2EventWorkspaceReady = {
5097
+ export type WorkspaceReady = {
5175
5098
  id: string;
5176
5099
  metadata?: {
5177
5100
  [key: string]: unknown;
5178
5101
  };
5102
+ type: "workspace.ready";
5179
5103
  durable?: {
5180
5104
  aggregateID: string;
5181
5105
  seq: number;
5182
5106
  version: number;
5183
5107
  };
5184
5108
  location?: LocationRef;
5185
- type: "workspace.ready";
5186
5109
  data: {
5187
5110
  name: string;
5188
5111
  };
5189
5112
  };
5190
- export type V2EventWorkspaceFailed = {
5113
+ export type WorkspaceFailed = {
5191
5114
  id: string;
5192
5115
  metadata?: {
5193
5116
  [key: string]: unknown;
5194
5117
  };
5118
+ type: "workspace.failed";
5195
5119
  durable?: {
5196
5120
  aggregateID: string;
5197
5121
  seq: number;
5198
5122
  version: number;
5199
5123
  };
5200
5124
  location?: LocationRef;
5201
- type: "workspace.failed";
5202
5125
  data: {
5203
5126
  message: string;
5204
5127
  };
5205
5128
  };
5206
- export type V2EventWorkspaceStatus = {
5129
+ export type WorkspaceStatus = {
5207
5130
  id: string;
5208
5131
  metadata?: {
5209
5132
  [key: string]: unknown;
5210
5133
  };
5134
+ type: "workspace.status";
5211
5135
  durable?: {
5212
5136
  aggregateID: string;
5213
5137
  seq: number;
5214
5138
  version: number;
5215
5139
  };
5216
5140
  location?: LocationRef;
5217
- type: "workspace.status";
5218
5141
  data: {
5219
5142
  workspaceID: string;
5220
5143
  status: "connected" | "connecting" | "disconnected" | "error";
5221
5144
  };
5222
5145
  };
5223
- export type V2EventWorktreeReady = {
5146
+ export type WorktreeReady = {
5224
5147
  id: string;
5225
5148
  metadata?: {
5226
5149
  [key: string]: unknown;
5227
5150
  };
5151
+ type: "worktree.ready";
5228
5152
  durable?: {
5229
5153
  aggregateID: string;
5230
5154
  seq: number;
5231
5155
  version: number;
5232
5156
  };
5233
5157
  location?: LocationRef;
5234
- type: "worktree.ready";
5235
5158
  data: {
5236
5159
  name: string;
5237
5160
  branch?: string;
5238
5161
  };
5239
5162
  };
5240
- export type V2EventWorktreeFailed = {
5163
+ export type WorktreeFailed = {
5241
5164
  id: string;
5242
5165
  metadata?: {
5243
5166
  [key: string]: unknown;
5244
5167
  };
5168
+ type: "worktree.failed";
5245
5169
  durable?: {
5246
5170
  aggregateID: string;
5247
5171
  seq: number;
5248
5172
  version: number;
5249
5173
  };
5250
5174
  location?: LocationRef;
5251
- type: "worktree.failed";
5252
5175
  data: {
5253
5176
  message: string;
5254
5177
  };
5255
5178
  };
5256
- export type V2EventServerConnected = {
5179
+ export type ServerConnected = {
5257
5180
  id: string;
5258
5181
  metadata?: {
5259
5182
  [key: string]: unknown;
5260
5183
  };
5184
+ type: "server.connected";
5261
5185
  durable?: {
5262
5186
  aggregateID: string;
5263
5187
  seq: number;
5264
5188
  version: number;
5265
5189
  };
5266
5190
  location?: LocationRef;
5267
- type: "server.connected";
5268
5191
  data: {
5269
5192
  [key: string]: unknown;
5270
5193
  };
5271
5194
  };
5272
- export type V2EventGlobalDisposed = {
5195
+ export type GlobalDisposed = {
5273
5196
  id: string;
5274
5197
  metadata?: {
5275
5198
  [key: string]: unknown;
5276
5199
  };
5200
+ type: "global.disposed";
5277
5201
  durable?: {
5278
5202
  aggregateID: string;
5279
5203
  seq: number;
5280
5204
  version: number;
5281
5205
  };
5282
5206
  location?: LocationRef;
5283
- type: "global.disposed";
5284
5207
  data: {
5285
5208
  [key: string]: unknown;
5286
5209
  };
@@ -5313,12 +5236,13 @@ export type ReferenceGitSource = {
5313
5236
  description?: string;
5314
5237
  hidden?: boolean;
5315
5238
  };
5239
+ export type ReferenceSource = ReferenceLocalSource | ReferenceGitSource;
5316
5240
  export type ReferenceInfo = {
5317
5241
  name: string;
5318
5242
  path: string;
5319
5243
  description?: string;
5320
5244
  hidden?: boolean;
5321
- source: ReferenceLocalSource | ReferenceGitSource;
5245
+ source: ReferenceSource;
5322
5246
  };
5323
5247
  export type ProjectCopyCopy = {
5324
5248
  directory: string;
@@ -5426,11 +5350,7 @@ export type EventSessionNextModelSwitched = {
5426
5350
  timestamp: number;
5427
5351
  sessionID: string;
5428
5352
  messageID: string;
5429
- model: {
5430
- id: string;
5431
- providerID: string;
5432
- variant?: string;
5433
- };
5353
+ model: ModelRef;
5434
5354
  };
5435
5355
  };
5436
5356
  export type EventSessionNextMoved = {
@@ -5514,11 +5434,7 @@ export type EventSessionNextStepStarted = {
5514
5434
  sessionID: string;
5515
5435
  assistantMessageID: string;
5516
5436
  agent: string;
5517
- model: {
5518
- id: string;
5519
- providerID: string;
5520
- variant?: string;
5521
- };
5437
+ model: ModelRef;
5522
5438
  snapshot?: string;
5523
5439
  };
5524
5440
  };
@@ -5594,11 +5510,7 @@ export type EventSessionNextReasoningStarted = {
5594
5510
  sessionID: string;
5595
5511
  assistantMessageID: string;
5596
5512
  reasoningID: string;
5597
- providerMetadata?: {
5598
- [key: string]: {
5599
- [key: string]: unknown;
5600
- };
5601
- };
5513
+ providerMetadata?: LlmProviderMetadata;
5602
5514
  };
5603
5515
  };
5604
5516
  export type EventSessionNextReasoningDelta = {
@@ -5621,11 +5533,7 @@ export type EventSessionNextReasoningEnded = {
5621
5533
  assistantMessageID: string;
5622
5534
  reasoningID: string;
5623
5535
  text: string;
5624
- providerMetadata?: {
5625
- [key: string]: {
5626
- [key: string]: unknown;
5627
- };
5628
- };
5536
+ providerMetadata?: LlmProviderMetadata;
5629
5537
  };
5630
5538
  };
5631
5539
  export type EventSessionNextToolInputStarted = {
@@ -5675,11 +5583,7 @@ export type EventSessionNextToolCalled = {
5675
5583
  };
5676
5584
  provider: {
5677
5585
  executed: boolean;
5678
- metadata?: {
5679
- [key: string]: {
5680
- [key: string]: unknown;
5681
- };
5682
- };
5586
+ metadata?: LlmProviderMetadata;
5683
5587
  };
5684
5588
  };
5685
5589
  };
@@ -5694,7 +5598,7 @@ export type EventSessionNextToolProgress = {
5694
5598
  structured: {
5695
5599
  [key: string]: unknown;
5696
5600
  };
5697
- content: Array<ToolTextContent | ToolFileContent>;
5601
+ content: Array<LlmToolContent>;
5698
5602
  };
5699
5603
  };
5700
5604
  export type EventSessionNextToolSuccess = {
@@ -5708,16 +5612,12 @@ export type EventSessionNextToolSuccess = {
5708
5612
  structured: {
5709
5613
  [key: string]: unknown;
5710
5614
  };
5711
- content: Array<ToolTextContent | ToolFileContent>;
5615
+ content: Array<LlmToolContent>;
5712
5616
  outputPaths?: Array<string>;
5713
5617
  result?: unknown;
5714
5618
  provider: {
5715
5619
  executed: boolean;
5716
- metadata?: {
5717
- [key: string]: {
5718
- [key: string]: unknown;
5719
- };
5720
- };
5620
+ metadata?: LlmProviderMetadata;
5721
5621
  };
5722
5622
  };
5723
5623
  };
@@ -5733,11 +5633,7 @@ export type EventSessionNextToolFailed = {
5733
5633
  result?: unknown;
5734
5634
  provider: {
5735
5635
  executed: boolean;
5736
- metadata?: {
5737
- [key: string]: {
5738
- [key: string]: unknown;
5739
- };
5740
- };
5636
+ metadata?: LlmProviderMetadata;
5741
5637
  };
5742
5638
  };
5743
5639
  };
@@ -5789,13 +5685,7 @@ export type EventSessionNextRevertStaged = {
5789
5685
  properties: {
5790
5686
  timestamp: number;
5791
5687
  sessionID: string;
5792
- revert: {
5793
- messageID: string;
5794
- partID?: string;
5795
- snapshot?: string;
5796
- diff?: string;
5797
- files?: Array<FileDiff>;
5798
- };
5688
+ revert: RevertState;
5799
5689
  };
5800
5690
  };
5801
5691
  export type EventSessionNextRevertCleared = {
@@ -6048,24 +5938,11 @@ export type EventProjectUpdated = {
6048
5938
  properties: {
6049
5939
  id: string;
6050
5940
  worktree: string;
6051
- vcs?: "git";
5941
+ vcs?: ProjectVcs;
6052
5942
  name?: string;
6053
- icon?: {
6054
- url?: string;
6055
- override?: string;
6056
- color?: string;
6057
- };
6058
- commands?: {
6059
- /**
6060
- * Startup script to run when creating a new workspace (worktree)
6061
- */
6062
- start?: string;
6063
- };
6064
- time: {
6065
- created: number;
6066
- updated: number;
6067
- initialized?: number;
6068
- };
5943
+ icon?: ProjectIcon;
5944
+ commands?: ProjectCommands;
5945
+ time: ProjectTime;
6069
5946
  sandboxes: Array<string>;
6070
5947
  };
6071
5948
  };
@@ -7622,17 +7499,8 @@ export type ProjectInitGitResponse = ProjectInitGitResponses[keyof ProjectInitGi
7622
7499
  export type ProjectUpdateData = {
7623
7500
  body?: {
7624
7501
  name?: string;
7625
- icon?: {
7626
- url?: string;
7627
- override?: string;
7628
- color?: string;
7629
- };
7630
- commands?: {
7631
- /**
7632
- * Startup script to run when creating a new workspace (worktree)
7633
- */
7634
- start?: string;
7635
- };
7502
+ icon?: ProjectIcon;
7503
+ commands?: ProjectCommands;
7636
7504
  };
7637
7505
  path: {
7638
7506
  projectID: string;
@@ -7919,10 +7787,7 @@ export type PtyConnectTokenResponses = {
7919
7787
  /**
7920
7788
  * WebSocket connect token
7921
7789
  */
7922
- 200: {
7923
- ticket: string;
7924
- expires_in: number;
7925
- };
7790
+ 200: PtyTicketConnectToken;
7926
7791
  };
7927
7792
  export type PtyConnectTokenResponse = PtyConnectTokenResponses[keyof PtyConnectTokenResponses];
7928
7793
  export type QuestionListData = {
@@ -9649,10 +9514,7 @@ export type ExperimentalWorkspaceStatusResponses = {
9649
9514
  /**
9650
9515
  * Workspace status
9651
9516
  */
9652
- 200: Array<{
9653
- workspaceID: string;
9654
- status: "connected" | "connecting" | "disconnected" | "error";
9655
- }>;
9517
+ 200: Array<WorkspaceEventConnectionStatus>;
9656
9518
  };
9657
9519
  export type ExperimentalWorkspaceStatusResponse = ExperimentalWorkspaceStatusResponses[keyof ExperimentalWorkspaceStatusResponses];
9658
9520
  export type ExperimentalWorkspaceRemoveData = {
@@ -9838,11 +9700,7 @@ export type V2SessionCreateData = {
9838
9700
  body: {
9839
9701
  id?: string;
9840
9702
  agent?: string;
9841
- model?: {
9842
- id: string;
9843
- providerID: string;
9844
- variant?: string;
9845
- };
9703
+ model?: ModelRef;
9846
9704
  location?: LocationRef;
9847
9705
  };
9848
9706
  path?: never;
@@ -9869,6 +9727,34 @@ export type V2SessionCreateResponses = {
9869
9727
  };
9870
9728
  };
9871
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];
9872
9758
  export type V2SessionGetData = {
9873
9759
  body?: never;
9874
9760
  path: {
@@ -9935,11 +9821,7 @@ export type V2SessionSwitchAgentResponses = {
9935
9821
  export type V2SessionSwitchAgentResponse = V2SessionSwitchAgentResponses[keyof V2SessionSwitchAgentResponses];
9936
9822
  export type V2SessionSwitchModelData = {
9937
9823
  body: {
9938
- model: {
9939
- id: string;
9940
- providerID: string;
9941
- variant?: string;
9942
- };
9824
+ model: ModelRef;
9943
9825
  };
9944
9826
  path: {
9945
9827
  sessionID: string;
@@ -9972,7 +9854,7 @@ export type V2SessionSwitchModelResponse = V2SessionSwitchModelResponses[keyof V
9972
9854
  export type V2SessionPromptData = {
9973
9855
  body: {
9974
9856
  id?: string;
9975
- prompt: Prompt;
9857
+ prompt: PromptInput;
9976
9858
  delivery?: "steer" | "queue";
9977
9859
  resume?: boolean;
9978
9860
  };
@@ -10113,13 +9995,7 @@ export type V2SessionRevertStageResponses = {
10113
9995
  * Success
10114
9996
  */
10115
9997
  200: {
10116
- data: {
10117
- messageID: string;
10118
- partID?: string;
10119
- snapshot?: string;
10120
- diff?: string;
10121
- files?: Array<FileDiff>;
10122
- };
9998
+ data: RevertState;
10123
9999
  };
10124
10000
  };
10125
10001
  export type V2SessionRevertStageResponse = V2SessionRevertStageResponses[keyof V2SessionRevertStageResponses];
@@ -10223,6 +10099,138 @@ export type V2SessionContextResponses = {
10223
10099
  };
10224
10100
  };
10225
10101
  export type V2SessionContextResponse = V2SessionContextResponses[keyof V2SessionContextResponses];
10102
+ export type V2SessionHistoryData = {
10103
+ body?: never;
10104
+ path: {
10105
+ sessionID: string;
10106
+ };
10107
+ query?: {
10108
+ limit?: number;
10109
+ after?: number;
10110
+ };
10111
+ url: "/api/session/{sessionID}/history";
10112
+ };
10113
+ export type V2SessionHistoryErrors = {
10114
+ /**
10115
+ * InvalidRequestError
10116
+ */
10117
+ 400: InvalidRequestError;
10118
+ /**
10119
+ * UnauthorizedError
10120
+ */
10121
+ 401: UnauthorizedError;
10122
+ /**
10123
+ * SessionNotFoundError
10124
+ */
10125
+ 404: SessionNotFoundError;
10126
+ };
10127
+ export type V2SessionHistoryError = V2SessionHistoryErrors[keyof V2SessionHistoryErrors];
10128
+ export type V2SessionHistoryResponses = {
10129
+ /**
10130
+ * SessionHistory
10131
+ */
10132
+ 200: SessionHistory;
10133
+ };
10134
+ export type V2SessionHistoryResponse = V2SessionHistoryResponses[keyof V2SessionHistoryResponses];
10135
+ export type V2SessionEventsData = {
10136
+ body?: never;
10137
+ path: {
10138
+ sessionID: string;
10139
+ };
10140
+ query?: {
10141
+ after?: string;
10142
+ };
10143
+ url: "/api/session/{sessionID}/event";
10144
+ };
10145
+ export type V2SessionEventsErrors = {
10146
+ /**
10147
+ * InvalidRequestError
10148
+ */
10149
+ 400: InvalidRequestError;
10150
+ /**
10151
+ * UnauthorizedError
10152
+ */
10153
+ 401: UnauthorizedError;
10154
+ /**
10155
+ * SessionNotFoundError
10156
+ */
10157
+ 404: SessionNotFoundError;
10158
+ };
10159
+ export type V2SessionEventsError = V2SessionEventsErrors[keyof V2SessionEventsErrors];
10160
+ export type V2SessionEventsResponses = {
10161
+ /**
10162
+ * Success
10163
+ */
10164
+ 200: {
10165
+ id: string;
10166
+ event: string;
10167
+ data: SessionDurableEventStream;
10168
+ };
10169
+ };
10170
+ export type V2SessionEventsResponse = V2SessionEventsResponses[keyof V2SessionEventsResponses];
10171
+ export type V2SessionInterruptData = {
10172
+ body?: never;
10173
+ path: {
10174
+ sessionID: string;
10175
+ };
10176
+ query?: never;
10177
+ url: "/api/session/{sessionID}/interrupt";
10178
+ };
10179
+ export type V2SessionInterruptErrors = {
10180
+ /**
10181
+ * InvalidRequestError
10182
+ */
10183
+ 400: InvalidRequestError;
10184
+ /**
10185
+ * UnauthorizedError
10186
+ */
10187
+ 401: UnauthorizedError;
10188
+ /**
10189
+ * SessionNotFoundError
10190
+ */
10191
+ 404: SessionNotFoundError;
10192
+ };
10193
+ export type V2SessionInterruptError = V2SessionInterruptErrors[keyof V2SessionInterruptErrors];
10194
+ export type V2SessionInterruptResponses = {
10195
+ /**
10196
+ * <No Content>
10197
+ */
10198
+ 204: void;
10199
+ };
10200
+ export type V2SessionInterruptResponse = V2SessionInterruptResponses[keyof V2SessionInterruptResponses];
10201
+ export type V2SessionMessageData = {
10202
+ body?: never;
10203
+ path: {
10204
+ sessionID: string;
10205
+ messageID: string;
10206
+ };
10207
+ query?: never;
10208
+ url: "/api/session/{sessionID}/message/{messageID}";
10209
+ };
10210
+ export type V2SessionMessageErrors = {
10211
+ /**
10212
+ * InvalidRequestError
10213
+ */
10214
+ 400: InvalidRequestError;
10215
+ /**
10216
+ * UnauthorizedError
10217
+ */
10218
+ 401: UnauthorizedError;
10219
+ /**
10220
+ * SessionNotFoundError | MessageNotFoundError
10221
+ */
10222
+ 404: MessageNotFoundError | SessionNotFoundError;
10223
+ };
10224
+ export type V2SessionMessageError = V2SessionMessageErrors[keyof V2SessionMessageErrors];
10225
+ export type V2SessionMessageResponses = {
10226
+ /**
10227
+ * Success
10228
+ */
10229
+ 200: {
10230
+ data: SessionMessage;
10231
+ };
10232
+ };
10233
+ export type V2SessionMessageResponse = V2SessionMessageResponses[keyof V2SessionMessageResponses];
10226
10234
  export type V2SessionMessagesData = {
10227
10235
  body?: never;
10228
10236
  path: {
@@ -10579,32 +10587,7 @@ export type V2IntegrationAttemptStatusResponses = {
10579
10587
  */
10580
10588
  200: {
10581
10589
  location: LocationInfo;
10582
- data: {
10583
- status: "pending";
10584
- time: {
10585
- created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
10586
- expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
10587
- };
10588
- } | {
10589
- status: "complete";
10590
- time: {
10591
- created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
10592
- expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
10593
- };
10594
- } | {
10595
- status: "failed";
10596
- message: string;
10597
- time: {
10598
- created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
10599
- expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
10600
- };
10601
- } | {
10602
- status: "expired";
10603
- time: {
10604
- created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
10605
- expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN";
10606
- };
10607
- };
10590
+ data: IntegrationAttemptStatus;
10608
10591
  };
10609
10592
  };
10610
10593
  export type V2IntegrationAttemptStatusResponse = V2IntegrationAttemptStatusResponses[keyof V2IntegrationAttemptStatusResponses];
@@ -10823,6 +10806,84 @@ export type V2SessionPermissionListResponses = {
10823
10806
  };
10824
10807
  };
10825
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];
10826
10887
  export type V2SessionPermissionReplyData = {
10827
10888
  body: {
10828
10889
  reply: PermissionV2Reply;
@@ -11269,10 +11330,7 @@ export type V2PtyConnectTokenResponses = {
11269
11330
  */
11270
11331
  200: {
11271
11332
  location: LocationInfo;
11272
- data: {
11273
- ticket: string;
11274
- expires_in: number;
11275
- };
11333
+ data: PtyTicketConnectToken;
11276
11334
  };
11277
11335
  };
11278
11336
  export type V2PtyConnectTokenResponse = V2PtyConnectTokenResponses[keyof V2PtyConnectTokenResponses];