@opencode-ai/sdk 0.0.0-opentui-202510311907 → 0.0.0-otui-diffs-202511281600

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,573 @@
1
+ export type EventInstallationUpdated = {
2
+ type: "installation.updated";
3
+ properties: {
4
+ version: string;
5
+ };
6
+ };
7
+ export type EventInstallationUpdateAvailable = {
8
+ type: "installation.update-available";
9
+ properties: {
10
+ version: string;
11
+ };
12
+ };
13
+ export type EventLspClientDiagnostics = {
14
+ type: "lsp.client.diagnostics";
15
+ properties: {
16
+ serverID: string;
17
+ path: string;
18
+ };
19
+ };
20
+ export type EventLspUpdated = {
21
+ type: "lsp.updated";
22
+ properties: {
23
+ [key: string]: unknown;
24
+ };
25
+ };
26
+ export type FileDiff = {
27
+ file: string;
28
+ before: string;
29
+ after: string;
30
+ additions: number;
31
+ deletions: number;
32
+ };
33
+ export type UserMessage = {
34
+ id: string;
35
+ sessionID: string;
36
+ role: "user";
37
+ time: {
38
+ created: number;
39
+ };
40
+ summary?: {
41
+ title?: string;
42
+ body?: string;
43
+ diffs: Array<FileDiff>;
44
+ };
45
+ agent: string;
46
+ model: {
47
+ providerID: string;
48
+ modelID: string;
49
+ };
50
+ system?: string;
51
+ tools?: {
52
+ [key: string]: boolean;
53
+ };
54
+ };
55
+ export type ProviderAuthError = {
56
+ name: "ProviderAuthError";
57
+ data: {
58
+ providerID: string;
59
+ message: string;
60
+ };
61
+ };
62
+ export type UnknownError = {
63
+ name: "UnknownError";
64
+ data: {
65
+ message: string;
66
+ };
67
+ };
68
+ export type MessageOutputLengthError = {
69
+ name: "MessageOutputLengthError";
70
+ data: {
71
+ [key: string]: unknown;
72
+ };
73
+ };
74
+ export type MessageAbortedError = {
75
+ name: "MessageAbortedError";
76
+ data: {
77
+ message: string;
78
+ };
79
+ };
80
+ export type ApiError = {
81
+ name: "APIError";
82
+ data: {
83
+ message: string;
84
+ statusCode?: number;
85
+ isRetryable: boolean;
86
+ responseHeaders?: {
87
+ [key: string]: string;
88
+ };
89
+ responseBody?: string;
90
+ };
91
+ };
92
+ export type AssistantMessage = {
93
+ id: string;
94
+ sessionID: string;
95
+ role: "assistant";
96
+ time: {
97
+ created: number;
98
+ completed?: number;
99
+ };
100
+ error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | ApiError;
101
+ parentID: string;
102
+ modelID: string;
103
+ providerID: string;
104
+ mode: string;
105
+ path: {
106
+ cwd: string;
107
+ root: string;
108
+ };
109
+ summary?: boolean;
110
+ cost: number;
111
+ tokens: {
112
+ input: number;
113
+ output: number;
114
+ reasoning: number;
115
+ cache: {
116
+ read: number;
117
+ write: number;
118
+ };
119
+ };
120
+ finish?: string;
121
+ };
122
+ export type Message = UserMessage | AssistantMessage;
123
+ export type EventMessageUpdated = {
124
+ type: "message.updated";
125
+ properties: {
126
+ info: Message;
127
+ };
128
+ };
129
+ export type EventMessageRemoved = {
130
+ type: "message.removed";
131
+ properties: {
132
+ sessionID: string;
133
+ messageID: string;
134
+ };
135
+ };
136
+ export type TextPart = {
137
+ id: string;
138
+ sessionID: string;
139
+ messageID: string;
140
+ type: "text";
141
+ text: string;
142
+ synthetic?: boolean;
143
+ ignored?: boolean;
144
+ time?: {
145
+ start: number;
146
+ end?: number;
147
+ };
148
+ metadata?: {
149
+ [key: string]: unknown;
150
+ };
151
+ };
152
+ export type ReasoningPart = {
153
+ id: string;
154
+ sessionID: string;
155
+ messageID: string;
156
+ type: "reasoning";
157
+ text: string;
158
+ metadata?: {
159
+ [key: string]: unknown;
160
+ };
161
+ time: {
162
+ start: number;
163
+ end?: number;
164
+ };
165
+ };
166
+ export type FilePartSourceText = {
167
+ value: string;
168
+ start: number;
169
+ end: number;
170
+ };
171
+ export type FileSource = {
172
+ text: FilePartSourceText;
173
+ type: "file";
174
+ path: string;
175
+ };
176
+ export type Range = {
177
+ start: {
178
+ line: number;
179
+ character: number;
180
+ };
181
+ end: {
182
+ line: number;
183
+ character: number;
184
+ };
185
+ };
186
+ export type SymbolSource = {
187
+ text: FilePartSourceText;
188
+ type: "symbol";
189
+ path: string;
190
+ range: Range;
191
+ name: string;
192
+ kind: number;
193
+ };
194
+ export type FilePartSource = FileSource | SymbolSource;
195
+ export type FilePart = {
196
+ id: string;
197
+ sessionID: string;
198
+ messageID: string;
199
+ type: "file";
200
+ mime: string;
201
+ filename?: string;
202
+ url: string;
203
+ source?: FilePartSource;
204
+ };
205
+ export type ToolStatePending = {
206
+ status: "pending";
207
+ input: {
208
+ [key: string]: unknown;
209
+ };
210
+ raw: string;
211
+ };
212
+ export type ToolStateRunning = {
213
+ status: "running";
214
+ input: {
215
+ [key: string]: unknown;
216
+ };
217
+ title?: string;
218
+ metadata?: {
219
+ [key: string]: unknown;
220
+ };
221
+ time: {
222
+ start: number;
223
+ };
224
+ };
225
+ export type ToolStateCompleted = {
226
+ status: "completed";
227
+ input: {
228
+ [key: string]: unknown;
229
+ };
230
+ output: string;
231
+ title: string;
232
+ metadata: {
233
+ [key: string]: unknown;
234
+ };
235
+ time: {
236
+ start: number;
237
+ end: number;
238
+ compacted?: number;
239
+ };
240
+ attachments?: Array<FilePart>;
241
+ };
242
+ export type ToolStateError = {
243
+ status: "error";
244
+ input: {
245
+ [key: string]: unknown;
246
+ };
247
+ error: string;
248
+ metadata?: {
249
+ [key: string]: unknown;
250
+ };
251
+ time: {
252
+ start: number;
253
+ end: number;
254
+ };
255
+ };
256
+ export type ToolState = ToolStatePending | ToolStateRunning | ToolStateCompleted | ToolStateError;
257
+ export type ToolPart = {
258
+ id: string;
259
+ sessionID: string;
260
+ messageID: string;
261
+ type: "tool";
262
+ callID: string;
263
+ tool: string;
264
+ state: ToolState;
265
+ metadata?: {
266
+ [key: string]: unknown;
267
+ };
268
+ };
269
+ export type StepStartPart = {
270
+ id: string;
271
+ sessionID: string;
272
+ messageID: string;
273
+ type: "step-start";
274
+ snapshot?: string;
275
+ };
276
+ export type StepFinishPart = {
277
+ id: string;
278
+ sessionID: string;
279
+ messageID: string;
280
+ type: "step-finish";
281
+ reason: string;
282
+ snapshot?: string;
283
+ cost: number;
284
+ tokens: {
285
+ input: number;
286
+ output: number;
287
+ reasoning: number;
288
+ cache: {
289
+ read: number;
290
+ write: number;
291
+ };
292
+ };
293
+ };
294
+ export type SnapshotPart = {
295
+ id: string;
296
+ sessionID: string;
297
+ messageID: string;
298
+ type: "snapshot";
299
+ snapshot: string;
300
+ };
301
+ export type PatchPart = {
302
+ id: string;
303
+ sessionID: string;
304
+ messageID: string;
305
+ type: "patch";
306
+ hash: string;
307
+ files: Array<string>;
308
+ };
309
+ export type AgentPart = {
310
+ id: string;
311
+ sessionID: string;
312
+ messageID: string;
313
+ type: "agent";
314
+ name: string;
315
+ source?: {
316
+ value: string;
317
+ start: number;
318
+ end: number;
319
+ };
320
+ };
321
+ export type RetryPart = {
322
+ id: string;
323
+ sessionID: string;
324
+ messageID: string;
325
+ type: "retry";
326
+ attempt: number;
327
+ error: ApiError;
328
+ time: {
329
+ created: number;
330
+ };
331
+ };
332
+ export type CompactionPart = {
333
+ id: string;
334
+ sessionID: string;
335
+ messageID: string;
336
+ type: "compaction";
337
+ auto: boolean;
338
+ };
339
+ export type Part = TextPart | {
340
+ id: string;
341
+ sessionID: string;
342
+ messageID: string;
343
+ type: "subtask";
344
+ prompt: string;
345
+ description: string;
346
+ agent: string;
347
+ } | ReasoningPart | FilePart | ToolPart | StepStartPart | StepFinishPart | SnapshotPart | PatchPart | AgentPart | RetryPart | CompactionPart;
348
+ export type EventMessagePartUpdated = {
349
+ type: "message.part.updated";
350
+ properties: {
351
+ part: Part;
352
+ delta?: string;
353
+ };
354
+ };
355
+ export type EventMessagePartRemoved = {
356
+ type: "message.part.removed";
357
+ properties: {
358
+ sessionID: string;
359
+ messageID: string;
360
+ partID: string;
361
+ };
362
+ };
363
+ export type Permission = {
364
+ id: string;
365
+ type: string;
366
+ pattern?: string | Array<string>;
367
+ sessionID: string;
368
+ messageID: string;
369
+ callID?: string;
370
+ title: string;
371
+ metadata: {
372
+ [key: string]: unknown;
373
+ };
374
+ time: {
375
+ created: number;
376
+ };
377
+ };
378
+ export type EventPermissionUpdated = {
379
+ type: "permission.updated";
380
+ properties: Permission;
381
+ };
382
+ export type EventPermissionReplied = {
383
+ type: "permission.replied";
384
+ properties: {
385
+ sessionID: string;
386
+ permissionID: string;
387
+ response: string;
388
+ };
389
+ };
390
+ export type SessionStatus = {
391
+ type: "idle";
392
+ } | {
393
+ type: "retry";
394
+ attempt: number;
395
+ message: string;
396
+ next: number;
397
+ } | {
398
+ type: "busy";
399
+ };
400
+ export type EventSessionStatus = {
401
+ type: "session.status";
402
+ properties: {
403
+ sessionID: string;
404
+ status: SessionStatus;
405
+ };
406
+ };
407
+ export type EventSessionIdle = {
408
+ type: "session.idle";
409
+ properties: {
410
+ sessionID: string;
411
+ };
412
+ };
413
+ export type EventSessionCompacted = {
414
+ type: "session.compacted";
415
+ properties: {
416
+ sessionID: string;
417
+ };
418
+ };
419
+ export type EventFileEdited = {
420
+ type: "file.edited";
421
+ properties: {
422
+ file: string;
423
+ };
424
+ };
425
+ export type Todo = {
426
+ /**
427
+ * Brief description of the task
428
+ */
429
+ content: string;
430
+ /**
431
+ * Current status of the task: pending, in_progress, completed, cancelled
432
+ */
433
+ status: string;
434
+ /**
435
+ * Priority level of the task: high, medium, low
436
+ */
437
+ priority: string;
438
+ /**
439
+ * Unique identifier for the todo item
440
+ */
441
+ id: string;
442
+ };
443
+ export type EventTodoUpdated = {
444
+ type: "todo.updated";
445
+ properties: {
446
+ sessionID: string;
447
+ todos: Array<Todo>;
448
+ };
449
+ };
450
+ export type EventCommandExecuted = {
451
+ type: "command.executed";
452
+ properties: {
453
+ name: string;
454
+ sessionID: string;
455
+ arguments: string;
456
+ messageID: string;
457
+ };
458
+ };
459
+ export type Session = {
460
+ id: string;
461
+ projectID: string;
462
+ directory: string;
463
+ parentID?: string;
464
+ summary?: {
465
+ additions: number;
466
+ deletions: number;
467
+ files: number;
468
+ diffs?: Array<FileDiff>;
469
+ };
470
+ share?: {
471
+ url: string;
472
+ };
473
+ title: string;
474
+ version: string;
475
+ time: {
476
+ created: number;
477
+ updated: number;
478
+ compacting?: number;
479
+ };
480
+ revert?: {
481
+ messageID: string;
482
+ partID?: string;
483
+ snapshot?: string;
484
+ diff?: string;
485
+ };
486
+ };
487
+ export type EventSessionCreated = {
488
+ type: "session.created";
489
+ properties: {
490
+ info: Session;
491
+ };
492
+ };
493
+ export type EventSessionUpdated = {
494
+ type: "session.updated";
495
+ properties: {
496
+ info: Session;
497
+ };
498
+ };
499
+ export type EventSessionDeleted = {
500
+ type: "session.deleted";
501
+ properties: {
502
+ info: Session;
503
+ };
504
+ };
505
+ export type EventSessionDiff = {
506
+ type: "session.diff";
507
+ properties: {
508
+ sessionID: string;
509
+ diff: Array<FileDiff>;
510
+ };
511
+ };
512
+ export type EventSessionError = {
513
+ type: "session.error";
514
+ properties: {
515
+ sessionID?: string;
516
+ error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | ApiError;
517
+ };
518
+ };
519
+ export type EventFileWatcherUpdated = {
520
+ type: "file.watcher.updated";
521
+ properties: {
522
+ file: string;
523
+ event: "add" | "change" | "unlink";
524
+ };
525
+ };
526
+ export type EventVcsBranchUpdated = {
527
+ type: "vcs.branch.updated";
528
+ properties: {
529
+ branch?: string;
530
+ };
531
+ };
532
+ export type EventTuiPromptAppend = {
533
+ type: "tui.prompt.append";
534
+ properties: {
535
+ text: string;
536
+ };
537
+ };
538
+ export type EventTuiCommandExecute = {
539
+ type: "tui.command.execute";
540
+ properties: {
541
+ command: ("session.list" | "session.new" | "session.share" | "session.interrupt" | "session.compact" | "session.page.up" | "session.page.down" | "session.half.page.up" | "session.half.page.down" | "session.first" | "session.last" | "prompt.clear" | "prompt.submit" | "agent.cycle") | string;
542
+ };
543
+ };
544
+ export type EventTuiToastShow = {
545
+ type: "tui.toast.show";
546
+ properties: {
547
+ title?: string;
548
+ message: string;
549
+ variant: "info" | "success" | "warning" | "error";
550
+ /**
551
+ * Duration in milliseconds
552
+ */
553
+ duration?: number;
554
+ };
555
+ };
556
+ export type EventServerConnected = {
557
+ type: "server.connected";
558
+ properties: {
559
+ [key: string]: unknown;
560
+ };
561
+ };
562
+ export type Event = EventInstallationUpdated | EventInstallationUpdateAvailable | EventLspClientDiagnostics | EventLspUpdated | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventPermissionUpdated | EventPermissionReplied | EventSessionStatus | EventSessionIdle | EventSessionCompacted | EventFileEdited | EventTodoUpdated | EventCommandExecuted | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventSessionDiff | EventSessionError | EventFileWatcherUpdated | EventVcsBranchUpdated | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventServerConnected;
563
+ export type GlobalEvent = {
564
+ directory: string;
565
+ payload: Event;
566
+ };
1
567
  export type Project = {
2
568
  id: string;
3
569
  worktree: string;
570
+ vcsDir?: string;
4
571
  vcs?: "git";
5
572
  time: {
6
573
  created: number;
@@ -111,6 +678,14 @@ export type KeybindsConfig = {
111
678
  * List available models
112
679
  */
113
680
  model_list?: string;
681
+ /**
682
+ * Next recently used model
683
+ */
684
+ model_cycle_recent?: string;
685
+ /**
686
+ * Previous recently used model
687
+ */
688
+ model_cycle_recent_reverse?: string;
114
689
  /**
115
690
  * List available commands
116
691
  */
@@ -131,6 +706,10 @@ export type KeybindsConfig = {
131
706
  * Clear input field
132
707
  */
133
708
  input_clear?: string;
709
+ /**
710
+ * Forward delete
711
+ */
712
+ input_forward_delete?: string;
134
713
  /**
135
714
  * Paste from clipboard
136
715
  */
@@ -143,656 +722,406 @@ export type KeybindsConfig = {
143
722
  * Insert newline in input
144
723
  */
145
724
  input_newline?: string;
146
- };
147
- export type AgentConfig = {
148
- model?: string;
149
- temperature?: number;
150
- top_p?: number;
151
- prompt?: string;
152
- tools?: {
153
- [key: string]: boolean;
154
- };
155
- disable?: boolean;
156
- /**
157
- * Description of when to use the agent
158
- */
159
- description?: string;
160
- mode?: "subagent" | "primary" | "all";
161
- permission?: {
162
- edit?: "ask" | "allow" | "deny";
163
- bash?: ("ask" | "allow" | "deny") | {
164
- [key: string]: "ask" | "allow" | "deny";
165
- };
166
- webfetch?: "ask" | "allow" | "deny";
167
- };
168
- [key: string]: unknown | string | number | {
169
- [key: string]: boolean;
170
- } | boolean | ("subagent" | "primary" | "all") | {
171
- edit?: "ask" | "allow" | "deny";
172
- bash?: ("ask" | "allow" | "deny") | {
173
- [key: string]: "ask" | "allow" | "deny";
174
- };
175
- webfetch?: "ask" | "allow" | "deny";
176
- } | undefined;
177
- };
178
- export type McpLocalConfig = {
179
- /**
180
- * Type of MCP server connection
181
- */
182
- type: "local";
183
- /**
184
- * Command and arguments to run the MCP server
185
- */
186
- command: Array<string>;
187
- /**
188
- * Environment variables to set when running the MCP server
189
- */
190
- environment?: {
191
- [key: string]: string;
192
- };
193
- /**
194
- * Enable or disable the MCP server on startup
195
- */
196
- enabled?: boolean;
197
- /**
198
- * Timeout in ms for fetching tools from the MCP server. Defaults to 5000 (5 seconds) if not specified.
199
- */
200
- timeout?: number;
201
- };
202
- export type McpRemoteConfig = {
203
725
  /**
204
- * Type of MCP server connection
726
+ * Previous history item
205
727
  */
206
- type: "remote";
728
+ history_previous?: string;
207
729
  /**
208
- * URL of the remote MCP server
730
+ * Next history item
209
731
  */
210
- url: string;
732
+ history_next?: string;
211
733
  /**
212
- * Enable or disable the MCP server on startup
734
+ * Next child session
213
735
  */
214
- enabled?: boolean;
736
+ session_child_cycle?: string;
215
737
  /**
216
- * Headers to send with the request
738
+ * Previous child session
217
739
  */
218
- headers?: {
219
- [key: string]: string;
220
- };
740
+ session_child_cycle_reverse?: string;
221
741
  /**
222
- * Timeout in ms for fetching tools from the MCP server. Defaults to 5000 (5 seconds) if not specified.
742
+ * Suspend terminal
223
743
  */
224
- timeout?: number;
744
+ terminal_suspend?: string;
225
745
  };
226
- /**
227
- * @deprecated Always uses stretch layout.
228
- */
229
- export type LayoutConfig = "auto" | "stretch";
230
- export type Config = {
231
- /**
232
- * JSON schema reference for configuration validation
233
- */
234
- $schema?: string;
235
- /**
236
- * Theme name to use for the interface
237
- */
238
- theme?: string;
239
- keybinds?: KeybindsConfig;
240
- /**
241
- * TUI specific settings
242
- */
243
- tui?: {
244
- /**
245
- * TUI scroll speed
246
- */
247
- scroll_speed?: number;
248
- };
249
- /**
250
- * Command configuration, see https://opencode.ai/docs/commands
251
- */
252
- command?: {
253
- [key: string]: {
254
- template: string;
255
- description?: string;
256
- agent?: string;
257
- model?: string;
258
- subtask?: boolean;
259
- };
260
- };
261
- watcher?: {
262
- ignore?: Array<string>;
263
- };
264
- plugin?: Array<string>;
265
- snapshot?: boolean;
266
- /**
267
- * Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing
268
- */
269
- share?: "manual" | "auto" | "disabled";
270
- /**
271
- * @deprecated Use 'share' field instead. Share newly created sessions automatically
272
- */
273
- autoshare?: boolean;
274
- /**
275
- * Automatically update to the latest version
276
- */
277
- autoupdate?: boolean;
278
- /**
279
- * Disable providers that are loaded automatically
280
- */
281
- disabled_providers?: Array<string>;
282
- /**
283
- * Model to use in the format of provider/model, eg anthropic/claude-2
284
- */
746
+ export type AgentConfig = {
285
747
  model?: string;
286
- /**
287
- * Small model to use for tasks like title generation in the format of provider/model
288
- */
289
- small_model?: string;
290
- /**
291
- * Custom username to display in conversations instead of system username
292
- */
293
- username?: string;
294
- /**
295
- * @deprecated Use `agent` field instead.
296
- */
297
- mode?: {
298
- build?: AgentConfig;
299
- plan?: AgentConfig;
300
- [key: string]: AgentConfig | undefined;
301
- };
302
- /**
303
- * Agent configuration, see https://opencode.ai/docs/agent
304
- */
305
- agent?: {
306
- plan?: AgentConfig;
307
- build?: AgentConfig;
308
- general?: AgentConfig;
309
- [key: string]: AgentConfig | undefined;
310
- };
311
- /**
312
- * Custom provider configurations and model overrides
313
- */
314
- provider?: {
315
- [key: string]: {
316
- api?: string;
317
- name?: string;
318
- env?: Array<string>;
319
- id?: string;
320
- npm?: string;
321
- models?: {
322
- [key: string]: {
323
- id?: string;
324
- name?: string;
325
- release_date?: string;
326
- attachment?: boolean;
327
- reasoning?: boolean;
328
- temperature?: boolean;
329
- tool_call?: boolean;
330
- cost?: {
331
- input: number;
332
- output: number;
333
- cache_read?: number;
334
- cache_write?: number;
335
- };
336
- limit?: {
337
- context: number;
338
- output: number;
339
- };
340
- modalities?: {
341
- input: Array<"text" | "audio" | "image" | "video" | "pdf">;
342
- output: Array<"text" | "audio" | "image" | "video" | "pdf">;
343
- };
344
- experimental?: boolean;
345
- status?: "alpha" | "beta" | "deprecated";
346
- options?: {
347
- [key: string]: unknown;
348
- };
349
- headers?: {
350
- [key: string]: string;
351
- };
352
- provider?: {
353
- npm: string;
354
- };
355
- };
356
- };
357
- options?: {
358
- apiKey?: string;
359
- baseURL?: string;
360
- /**
361
- * Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.
362
- */
363
- timeout?: number | false;
364
- [key: string]: unknown | string | (number | false) | undefined;
365
- };
366
- };
367
- };
368
- /**
369
- * MCP (Model Context Protocol) server configurations
370
- */
371
- mcp?: {
372
- [key: string]: McpLocalConfig | McpRemoteConfig;
373
- };
374
- formatter?: {
375
- [key: string]: {
376
- disabled?: boolean;
377
- command?: Array<string>;
378
- environment?: {
379
- [key: string]: string;
380
- };
381
- extensions?: Array<string>;
382
- };
383
- };
384
- lsp?: {
385
- [key: string]: {
386
- disabled: true;
387
- } | {
388
- command: Array<string>;
389
- extensions?: Array<string>;
390
- disabled?: boolean;
391
- env?: {
392
- [key: string]: string;
393
- };
394
- initialization?: {
395
- [key: string]: unknown;
396
- };
397
- };
748
+ temperature?: number;
749
+ top_p?: number;
750
+ prompt?: string;
751
+ tools?: {
752
+ [key: string]: boolean;
398
753
  };
754
+ disable?: boolean;
399
755
  /**
400
- * Additional instruction files or patterns to include
756
+ * Description of when to use the agent
401
757
  */
402
- instructions?: Array<string>;
403
- layout?: LayoutConfig;
758
+ description?: string;
759
+ mode?: "subagent" | "primary" | "all";
760
+ /**
761
+ * Hex color code for the agent (e.g., #FF5733)
762
+ */
763
+ color?: string;
404
764
  permission?: {
405
765
  edit?: "ask" | "allow" | "deny";
406
766
  bash?: ("ask" | "allow" | "deny") | {
407
767
  [key: string]: "ask" | "allow" | "deny";
408
768
  };
409
769
  webfetch?: "ask" | "allow" | "deny";
770
+ doom_loop?: "ask" | "allow" | "deny";
771
+ external_directory?: "ask" | "allow" | "deny";
410
772
  };
411
- tools?: {
773
+ [key: string]: unknown | string | number | {
412
774
  [key: string]: boolean;
413
- };
414
- experimental?: {
415
- hook?: {
416
- file_edited?: {
417
- [key: string]: Array<{
418
- command: Array<string>;
419
- environment?: {
420
- [key: string]: string;
421
- };
422
- }>;
423
- };
424
- session_completed?: Array<{
425
- command: Array<string>;
426
- environment?: {
427
- [key: string]: string;
428
- };
429
- }>;
775
+ } | boolean | ("subagent" | "primary" | "all") | {
776
+ edit?: "ask" | "allow" | "deny";
777
+ bash?: ("ask" | "allow" | "deny") | {
778
+ [key: string]: "ask" | "allow" | "deny";
430
779
  };
431
- /**
432
- * Number of retries for chat completions on failure
433
- */
434
- chatMaxRetries?: number;
435
- disable_paste_summary?: boolean;
436
- };
437
- };
438
- export type BadRequestError = {
439
- data: unknown | null;
440
- errors: Array<{
441
- [key: string]: unknown;
442
- }>;
443
- success: false;
444
- };
445
- export type ToolIds = Array<string>;
446
- export type ToolListItem = {
447
- id: string;
448
- description: string;
449
- parameters: unknown;
450
- };
451
- export type ToolList = Array<ToolListItem>;
452
- export type Path = {
453
- state: string;
454
- config: string;
455
- worktree: string;
456
- directory: string;
457
- };
458
- export type FileDiff = {
459
- file: string;
460
- before: string;
461
- after: string;
462
- additions: number;
463
- deletions: number;
464
- };
465
- export type Session = {
466
- id: string;
467
- projectID: string;
468
- directory: string;
469
- parentID?: string;
470
- summary?: {
471
- diffs: Array<FileDiff>;
472
- };
473
- share?: {
474
- url: string;
475
- };
476
- title: string;
477
- version: string;
478
- time: {
479
- created: number;
480
- updated: number;
481
- compacting?: number;
482
- };
483
- revert?: {
484
- messageID: string;
485
- partID?: string;
486
- snapshot?: string;
487
- diff?: string;
488
- };
489
- };
490
- export type NotFoundError = {
491
- name: "NotFoundError";
492
- data: {
493
- message: string;
494
- };
780
+ webfetch?: "ask" | "allow" | "deny";
781
+ doom_loop?: "ask" | "allow" | "deny";
782
+ external_directory?: "ask" | "allow" | "deny";
783
+ } | undefined;
495
784
  };
496
- export type Todo = {
785
+ export type McpLocalConfig = {
497
786
  /**
498
- * Brief description of the task
787
+ * Type of MCP server connection
499
788
  */
500
- content: string;
789
+ type: "local";
501
790
  /**
502
- * Current status of the task: pending, in_progress, completed, cancelled
791
+ * Command and arguments to run the MCP server
503
792
  */
504
- status: string;
793
+ command: Array<string>;
505
794
  /**
506
- * Priority level of the task: high, medium, low
795
+ * Environment variables to set when running the MCP server
507
796
  */
508
- priority: string;
797
+ environment?: {
798
+ [key: string]: string;
799
+ };
509
800
  /**
510
- * Unique identifier for the todo item
801
+ * Enable or disable the MCP server on startup
511
802
  */
512
- id: string;
513
- };
514
- export type UserMessage = {
515
- id: string;
516
- sessionID: string;
517
- role: "user";
518
- time: {
519
- created: number;
520
- };
521
- summary?: {
522
- title?: string;
523
- body?: string;
524
- diffs: Array<FileDiff>;
525
- };
526
- };
527
- export type ProviderAuthError = {
528
- name: "ProviderAuthError";
529
- data: {
530
- providerID: string;
531
- message: string;
532
- };
533
- };
534
- export type UnknownError = {
535
- name: "UnknownError";
536
- data: {
537
- message: string;
538
- };
539
- };
540
- export type MessageOutputLengthError = {
541
- name: "MessageOutputLengthError";
542
- data: {
543
- [key: string]: unknown;
544
- };
545
- };
546
- export type MessageAbortedError = {
547
- name: "MessageAbortedError";
548
- data: {
549
- message: string;
550
- };
551
- };
552
- export type ApiError = {
553
- name: "APIError";
554
- data: {
555
- message: string;
556
- statusCode?: number;
557
- isRetryable: boolean;
558
- responseHeaders?: {
559
- [key: string]: string;
560
- };
561
- responseBody?: string;
562
- };
563
- };
564
- export type AssistantMessage = {
565
- id: string;
566
- sessionID: string;
567
- role: "assistant";
568
- time: {
569
- created: number;
570
- completed?: number;
571
- };
572
- error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | ApiError;
573
- system: Array<string>;
574
- parentID: string;
575
- modelID: string;
576
- providerID: string;
577
- mode: string;
578
- path: {
579
- cwd: string;
580
- root: string;
581
- };
582
- summary?: boolean;
583
- cost: number;
584
- tokens: {
585
- input: number;
586
- output: number;
587
- reasoning: number;
588
- cache: {
589
- read: number;
590
- write: number;
591
- };
592
- };
593
- };
594
- export type Message = UserMessage | AssistantMessage;
595
- export type TextPart = {
596
- id: string;
597
- sessionID: string;
598
- messageID: string;
599
- type: "text";
600
- text: string;
601
- synthetic?: boolean;
602
- time?: {
603
- start: number;
604
- end?: number;
605
- };
606
- metadata?: {
607
- [key: string]: unknown;
608
- };
609
- };
610
- export type ReasoningPart = {
611
- id: string;
612
- sessionID: string;
613
- messageID: string;
614
- type: "reasoning";
615
- text: string;
616
- metadata?: {
617
- [key: string]: unknown;
618
- };
619
- time: {
620
- start: number;
621
- end?: number;
622
- };
623
- };
624
- export type FilePartSourceText = {
625
- value: string;
626
- start: number;
627
- end: number;
628
- };
629
- export type FileSource = {
630
- text: FilePartSourceText;
631
- type: "file";
632
- path: string;
633
- };
634
- export type Range = {
635
- start: {
636
- line: number;
637
- character: number;
638
- };
639
- end: {
640
- line: number;
641
- character: number;
642
- };
643
- };
644
- export type SymbolSource = {
645
- text: FilePartSourceText;
646
- type: "symbol";
647
- path: string;
648
- range: Range;
649
- name: string;
650
- kind: number;
803
+ enabled?: boolean;
804
+ /**
805
+ * Timeout in ms for fetching tools from the MCP server. Defaults to 5000 (5 seconds) if not specified.
806
+ */
807
+ timeout?: number;
651
808
  };
652
- export type FilePartSource = FileSource | SymbolSource;
653
- export type FilePart = {
654
- id: string;
655
- sessionID: string;
656
- messageID: string;
657
- type: "file";
658
- mime: string;
659
- filename?: string;
809
+ export type McpRemoteConfig = {
810
+ /**
811
+ * Type of MCP server connection
812
+ */
813
+ type: "remote";
814
+ /**
815
+ * URL of the remote MCP server
816
+ */
660
817
  url: string;
661
- source?: FilePartSource;
662
- };
663
- export type ToolStatePending = {
664
- status: "pending";
665
- input: {
666
- [key: string]: unknown;
818
+ /**
819
+ * Enable or disable the MCP server on startup
820
+ */
821
+ enabled?: boolean;
822
+ /**
823
+ * Headers to send with the request
824
+ */
825
+ headers?: {
826
+ [key: string]: string;
667
827
  };
668
- raw: string;
828
+ /**
829
+ * Timeout in ms for fetching tools from the MCP server. Defaults to 5000 (5 seconds) if not specified.
830
+ */
831
+ timeout?: number;
669
832
  };
670
- export type ToolStateRunning = {
671
- status: "running";
672
- input: {
673
- [key: string]: unknown;
833
+ /**
834
+ * @deprecated Always uses stretch layout.
835
+ */
836
+ export type LayoutConfig = "auto" | "stretch";
837
+ export type Config = {
838
+ /**
839
+ * JSON schema reference for configuration validation
840
+ */
841
+ $schema?: string;
842
+ /**
843
+ * Theme name to use for the interface
844
+ */
845
+ theme?: string;
846
+ keybinds?: KeybindsConfig;
847
+ /**
848
+ * TUI specific settings
849
+ */
850
+ tui?: {
851
+ /**
852
+ * TUI scroll speed
853
+ */
854
+ scroll_speed?: number;
855
+ /**
856
+ * Scroll acceleration settings
857
+ */
858
+ scroll_acceleration?: {
859
+ /**
860
+ * Enable scroll acceleration
861
+ */
862
+ enabled: boolean;
863
+ };
864
+ /**
865
+ * Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column
866
+ */
867
+ diff_style?: "auto" | "stacked";
674
868
  };
675
- title?: string;
676
- metadata?: {
677
- [key: string]: unknown;
869
+ /**
870
+ * Command configuration, see https://opencode.ai/docs/commands
871
+ */
872
+ command?: {
873
+ [key: string]: {
874
+ template: string;
875
+ description?: string;
876
+ agent?: string;
877
+ model?: string;
878
+ subtask?: boolean;
879
+ };
678
880
  };
679
- time: {
680
- start: number;
881
+ watcher?: {
882
+ ignore?: Array<string>;
681
883
  };
682
- };
683
- export type ToolStateCompleted = {
684
- status: "completed";
685
- input: {
686
- [key: string]: unknown;
884
+ plugin?: Array<string>;
885
+ snapshot?: boolean;
886
+ /**
887
+ * Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing
888
+ */
889
+ share?: "manual" | "auto" | "disabled";
890
+ /**
891
+ * @deprecated Use 'share' field instead. Share newly created sessions automatically
892
+ */
893
+ autoshare?: boolean;
894
+ /**
895
+ * Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications
896
+ */
897
+ autoupdate?: boolean | "notify";
898
+ /**
899
+ * Disable providers that are loaded automatically
900
+ */
901
+ disabled_providers?: Array<string>;
902
+ /**
903
+ * When set, ONLY these providers will be enabled. All other providers will be ignored
904
+ */
905
+ enabled_providers?: Array<string>;
906
+ /**
907
+ * Model to use in the format of provider/model, eg anthropic/claude-2
908
+ */
909
+ model?: string;
910
+ /**
911
+ * Small model to use for tasks like title generation in the format of provider/model
912
+ */
913
+ small_model?: string;
914
+ /**
915
+ * Custom username to display in conversations instead of system username
916
+ */
917
+ username?: string;
918
+ /**
919
+ * @deprecated Use `agent` field instead.
920
+ */
921
+ mode?: {
922
+ build?: AgentConfig;
923
+ plan?: AgentConfig;
924
+ [key: string]: AgentConfig | undefined;
687
925
  };
688
- output: string;
689
- title: string;
690
- metadata: {
691
- [key: string]: unknown;
926
+ /**
927
+ * Agent configuration, see https://opencode.ai/docs/agent
928
+ */
929
+ agent?: {
930
+ plan?: AgentConfig;
931
+ build?: AgentConfig;
932
+ general?: AgentConfig;
933
+ [key: string]: AgentConfig | undefined;
692
934
  };
693
- time: {
694
- start: number;
695
- end: number;
696
- compacted?: number;
935
+ /**
936
+ * Custom provider configurations and model overrides
937
+ */
938
+ provider?: {
939
+ [key: string]: {
940
+ api?: string;
941
+ name?: string;
942
+ env?: Array<string>;
943
+ id?: string;
944
+ npm?: string;
945
+ models?: {
946
+ [key: string]: {
947
+ id?: string;
948
+ name?: string;
949
+ release_date?: string;
950
+ attachment?: boolean;
951
+ reasoning?: boolean;
952
+ temperature?: boolean;
953
+ tool_call?: boolean;
954
+ cost?: {
955
+ input: number;
956
+ output: number;
957
+ cache_read?: number;
958
+ cache_write?: number;
959
+ context_over_200k?: {
960
+ input: number;
961
+ output: number;
962
+ cache_read?: number;
963
+ cache_write?: number;
964
+ };
965
+ };
966
+ limit?: {
967
+ context: number;
968
+ output: number;
969
+ };
970
+ modalities?: {
971
+ input: Array<"text" | "audio" | "image" | "video" | "pdf">;
972
+ output: Array<"text" | "audio" | "image" | "video" | "pdf">;
973
+ };
974
+ experimental?: boolean;
975
+ status?: "alpha" | "beta" | "deprecated";
976
+ options?: {
977
+ [key: string]: unknown;
978
+ };
979
+ headers?: {
980
+ [key: string]: string;
981
+ };
982
+ provider?: {
983
+ npm: string;
984
+ };
985
+ };
986
+ };
987
+ whitelist?: Array<string>;
988
+ blacklist?: Array<string>;
989
+ options?: {
990
+ apiKey?: string;
991
+ baseURL?: string;
992
+ /**
993
+ * GitHub Enterprise URL for copilot authentication
994
+ */
995
+ enterpriseUrl?: string;
996
+ /**
997
+ * Enable promptCacheKey for this provider (default false)
998
+ */
999
+ setCacheKey?: boolean;
1000
+ /**
1001
+ * Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.
1002
+ */
1003
+ timeout?: number | false;
1004
+ [key: string]: unknown | string | boolean | (number | false) | undefined;
1005
+ };
1006
+ };
697
1007
  };
698
- attachments?: Array<FilePart>;
699
- };
700
- export type ToolStateError = {
701
- status: "error";
702
- input: {
703
- [key: string]: unknown;
1008
+ /**
1009
+ * MCP (Model Context Protocol) server configurations
1010
+ */
1011
+ mcp?: {
1012
+ [key: string]: McpLocalConfig | McpRemoteConfig;
704
1013
  };
705
- error: string;
706
- metadata?: {
707
- [key: string]: unknown;
1014
+ formatter?: false | {
1015
+ [key: string]: {
1016
+ disabled?: boolean;
1017
+ command?: Array<string>;
1018
+ environment?: {
1019
+ [key: string]: string;
1020
+ };
1021
+ extensions?: Array<string>;
1022
+ };
708
1023
  };
709
- time: {
710
- start: number;
711
- end: number;
1024
+ lsp?: false | {
1025
+ [key: string]: {
1026
+ disabled: true;
1027
+ } | {
1028
+ command: Array<string>;
1029
+ extensions?: Array<string>;
1030
+ disabled?: boolean;
1031
+ env?: {
1032
+ [key: string]: string;
1033
+ };
1034
+ initialization?: {
1035
+ [key: string]: unknown;
1036
+ };
1037
+ };
1038
+ };
1039
+ /**
1040
+ * Additional instruction files or patterns to include
1041
+ */
1042
+ instructions?: Array<string>;
1043
+ layout?: LayoutConfig;
1044
+ permission?: {
1045
+ edit?: "ask" | "allow" | "deny";
1046
+ bash?: ("ask" | "allow" | "deny") | {
1047
+ [key: string]: "ask" | "allow" | "deny";
1048
+ };
1049
+ webfetch?: "ask" | "allow" | "deny";
1050
+ doom_loop?: "ask" | "allow" | "deny";
1051
+ external_directory?: "ask" | "allow" | "deny";
1052
+ };
1053
+ tools?: {
1054
+ [key: string]: boolean;
712
1055
  };
713
- };
714
- export type ToolState = ToolStatePending | ToolStateRunning | ToolStateCompleted | ToolStateError;
715
- export type ToolPart = {
716
- id: string;
717
- sessionID: string;
718
- messageID: string;
719
- type: "tool";
720
- callID: string;
721
- tool: string;
722
- state: ToolState;
723
- metadata?: {
724
- [key: string]: unknown;
1056
+ enterprise?: {
1057
+ /**
1058
+ * Enterprise URL
1059
+ */
1060
+ url?: string;
725
1061
  };
726
- };
727
- export type StepStartPart = {
728
- id: string;
729
- sessionID: string;
730
- messageID: string;
731
- type: "step-start";
732
- snapshot?: string;
733
- };
734
- export type StepFinishPart = {
735
- id: string;
736
- sessionID: string;
737
- messageID: string;
738
- type: "step-finish";
739
- reason: string;
740
- snapshot?: string;
741
- cost: number;
742
- tokens: {
743
- input: number;
744
- output: number;
745
- reasoning: number;
746
- cache: {
747
- read: number;
748
- write: number;
1062
+ experimental?: {
1063
+ hook?: {
1064
+ file_edited?: {
1065
+ [key: string]: Array<{
1066
+ command: Array<string>;
1067
+ environment?: {
1068
+ [key: string]: string;
1069
+ };
1070
+ }>;
1071
+ };
1072
+ session_completed?: Array<{
1073
+ command: Array<string>;
1074
+ environment?: {
1075
+ [key: string]: string;
1076
+ };
1077
+ }>;
749
1078
  };
1079
+ /**
1080
+ * Number of retries for chat completions on failure
1081
+ */
1082
+ chatMaxRetries?: number;
1083
+ disable_paste_summary?: boolean;
1084
+ /**
1085
+ * Enable the batch tool
1086
+ */
1087
+ batch_tool?: boolean;
750
1088
  };
751
1089
  };
752
- export type SnapshotPart = {
753
- id: string;
754
- sessionID: string;
755
- messageID: string;
756
- type: "snapshot";
757
- snapshot: string;
1090
+ export type BadRequestError = {
1091
+ data: unknown;
1092
+ errors: Array<{
1093
+ [key: string]: unknown;
1094
+ }>;
1095
+ success: false;
758
1096
  };
759
- export type PatchPart = {
1097
+ export type ToolIds = Array<string>;
1098
+ export type ToolListItem = {
760
1099
  id: string;
761
- sessionID: string;
762
- messageID: string;
763
- type: "patch";
764
- hash: string;
765
- files: Array<string>;
1100
+ description: string;
1101
+ parameters: unknown;
766
1102
  };
767
- export type AgentPart = {
768
- id: string;
769
- sessionID: string;
770
- messageID: string;
771
- type: "agent";
772
- name: string;
773
- source?: {
774
- value: string;
775
- start: number;
776
- end: number;
777
- };
1103
+ export type ToolList = Array<ToolListItem>;
1104
+ export type Path = {
1105
+ state: string;
1106
+ config: string;
1107
+ worktree: string;
1108
+ directory: string;
778
1109
  };
779
- export type RetryPart = {
780
- id: string;
781
- sessionID: string;
782
- messageID: string;
783
- type: "retry";
784
- attempt: number;
785
- error: ApiError;
786
- time: {
787
- created: number;
1110
+ export type VcsInfo = {
1111
+ branch: string;
1112
+ };
1113
+ export type NotFoundError = {
1114
+ name: "NotFoundError";
1115
+ data: {
1116
+ message: string;
788
1117
  };
789
1118
  };
790
- export type Part = TextPart | ReasoningPart | FilePart | ToolPart | StepStartPart | StepFinishPart | SnapshotPart | PatchPart | AgentPart | RetryPart;
791
1119
  export type TextPartInput = {
792
1120
  id?: string;
793
1121
  type: "text";
794
1122
  text: string;
795
1123
  synthetic?: boolean;
1124
+ ignored?: boolean;
796
1125
  time?: {
797
1126
  start: number;
798
1127
  end?: number;
@@ -819,6 +1148,13 @@ export type AgentPartInput = {
819
1148
  end: number;
820
1149
  };
821
1150
  };
1151
+ export type SubtaskPartInput = {
1152
+ id?: string;
1153
+ type: "subtask";
1154
+ prompt: string;
1155
+ description: string;
1156
+ agent: string;
1157
+ };
822
1158
  export type Command = {
823
1159
  name: string;
824
1160
  description?: string;
@@ -840,6 +1176,12 @@ export type Model = {
840
1176
  output: number;
841
1177
  cache_read?: number;
842
1178
  cache_write?: number;
1179
+ context_over_200k?: {
1180
+ input: number;
1181
+ output: number;
1182
+ cache_read?: number;
1183
+ cache_write?: number;
1184
+ };
843
1185
  };
844
1186
  limit: {
845
1187
  context: number;
@@ -871,6 +1213,15 @@ export type Provider = {
871
1213
  [key: string]: Model;
872
1214
  };
873
1215
  };
1216
+ export type ProviderAuthMethod = {
1217
+ type: "oauth" | "api";
1218
+ label: string;
1219
+ };
1220
+ export type ProviderAuthAuthorization = {
1221
+ url: string;
1222
+ method: "auto" | "code";
1223
+ instructions: string;
1224
+ };
874
1225
  export type Symbol = {
875
1226
  name: string;
876
1227
  kind: number;
@@ -920,12 +1271,15 @@ export type Agent = {
920
1271
  builtIn: boolean;
921
1272
  topP?: number;
922
1273
  temperature?: number;
1274
+ color?: string;
923
1275
  permission: {
924
1276
  edit: "ask" | "allow" | "deny";
925
1277
  bash: {
926
1278
  [key: string]: "ask" | "allow" | "deny";
927
1279
  };
928
1280
  webfetch?: "ask" | "allow" | "deny";
1281
+ doom_loop?: "ask" | "allow" | "deny";
1282
+ external_directory?: "ask" | "allow" | "deny";
929
1283
  };
930
1284
  model?: {
931
1285
  modelID: string;
@@ -945,195 +1299,52 @@ export type McpStatusConnected = {
945
1299
  export type McpStatusDisabled = {
946
1300
  status: "disabled";
947
1301
  };
948
- export type McpStatusFailed = {
949
- status: "failed";
950
- error: string;
951
- };
952
- export type McpStatus = McpStatusConnected | McpStatusDisabled | McpStatusFailed;
953
- export type LspStatus = {
954
- id: string;
955
- name: string;
956
- root: string;
957
- status: "connected" | "error";
958
- };
959
- export type EventTuiPromptAppend = {
960
- type: "tui.prompt.append";
961
- properties: {
962
- text: string;
963
- };
964
- };
965
- export type EventTuiCommandExecute = {
966
- type: "tui.command.execute";
967
- properties: {
968
- command: ("session.list" | "session.new" | "session.share" | "session.interrupt" | "session.compact" | "session.page.up" | "session.page.down" | "session.half.page.up" | "session.half.page.down" | "session.first" | "session.last" | "prompt.clear" | "prompt.submit" | "agent.cycle") | string;
969
- };
970
- };
971
- export type EventTuiToastShow = {
972
- type: "tui.toast.show";
973
- properties: {
974
- title?: string;
975
- message: string;
976
- variant: "info" | "success" | "warning" | "error";
977
- /**
978
- * Duration in milliseconds
979
- */
980
- duration?: number;
981
- };
982
- };
983
- export type OAuth = {
984
- type: "oauth";
985
- refresh: string;
986
- access: string;
987
- expires: number;
988
- };
989
- export type ApiAuth = {
990
- type: "api";
991
- key: string;
992
- };
993
- export type WellKnownAuth = {
994
- type: "wellknown";
995
- key: string;
996
- token: string;
997
- };
998
- export type Auth = OAuth | ApiAuth | WellKnownAuth;
999
- export type EventInstallationUpdated = {
1000
- type: "installation.updated";
1001
- properties: {
1002
- version: string;
1003
- };
1004
- };
1005
- export type EventLspClientDiagnostics = {
1006
- type: "lsp.client.diagnostics";
1007
- properties: {
1008
- serverID: string;
1009
- path: string;
1010
- };
1011
- };
1012
- export type EventLspUpdated = {
1013
- type: "lsp.updated";
1014
- properties: {
1015
- [key: string]: unknown;
1016
- };
1017
- };
1018
- export type EventMessageUpdated = {
1019
- type: "message.updated";
1020
- properties: {
1021
- info: Message;
1022
- };
1023
- };
1024
- export type EventMessageRemoved = {
1025
- type: "message.removed";
1026
- properties: {
1027
- sessionID: string;
1028
- messageID: string;
1029
- };
1030
- };
1031
- export type EventMessagePartUpdated = {
1032
- type: "message.part.updated";
1033
- properties: {
1034
- part: Part;
1035
- delta?: string;
1036
- };
1037
- };
1038
- export type EventMessagePartRemoved = {
1039
- type: "message.part.removed";
1040
- properties: {
1041
- sessionID: string;
1042
- messageID: string;
1043
- partID: string;
1044
- };
1045
- };
1046
- export type EventSessionCompacted = {
1047
- type: "session.compacted";
1048
- properties: {
1049
- sessionID: string;
1050
- };
1051
- };
1052
- export type Permission = {
1053
- id: string;
1054
- type: string;
1055
- pattern?: string | Array<string>;
1056
- sessionID: string;
1057
- messageID: string;
1058
- callID?: string;
1059
- title: string;
1060
- metadata: {
1061
- [key: string]: unknown;
1062
- };
1063
- time: {
1064
- created: number;
1065
- };
1066
- };
1067
- export type EventPermissionUpdated = {
1068
- type: "permission.updated";
1069
- properties: Permission;
1070
- };
1071
- export type EventPermissionReplied = {
1072
- type: "permission.replied";
1073
- properties: {
1074
- sessionID: string;
1075
- permissionID: string;
1076
- response: string;
1077
- };
1078
- };
1079
- export type EventFileEdited = {
1080
- type: "file.edited";
1081
- properties: {
1082
- file: string;
1083
- };
1084
- };
1085
- export type EventFileWatcherUpdated = {
1086
- type: "file.watcher.updated";
1087
- properties: {
1088
- file: string;
1089
- event: "add" | "change" | "unlink";
1090
- };
1302
+ export type McpStatusFailed = {
1303
+ status: "failed";
1304
+ error: string;
1091
1305
  };
1092
- export type EventTodoUpdated = {
1093
- type: "todo.updated";
1094
- properties: {
1095
- sessionID: string;
1096
- todos: Array<Todo>;
1097
- };
1306
+ export type McpStatus = McpStatusConnected | McpStatusDisabled | McpStatusFailed;
1307
+ export type LspStatus = {
1308
+ id: string;
1309
+ name: string;
1310
+ root: string;
1311
+ status: "connected" | "error";
1098
1312
  };
1099
- export type EventSessionIdle = {
1100
- type: "session.idle";
1101
- properties: {
1102
- sessionID: string;
1103
- };
1313
+ export type FormatterStatus = {
1314
+ name: string;
1315
+ extensions: Array<string>;
1316
+ enabled: boolean;
1104
1317
  };
1105
- export type EventSessionCreated = {
1106
- type: "session.created";
1107
- properties: {
1108
- info: Session;
1109
- };
1318
+ export type OAuth = {
1319
+ type: "oauth";
1320
+ refresh: string;
1321
+ access: string;
1322
+ expires: number;
1323
+ enterpriseUrl?: string;
1110
1324
  };
1111
- export type EventSessionUpdated = {
1112
- type: "session.updated";
1113
- properties: {
1114
- info: Session;
1115
- };
1325
+ export type ApiAuth = {
1326
+ type: "api";
1327
+ key: string;
1116
1328
  };
1117
- export type EventSessionDeleted = {
1118
- type: "session.deleted";
1119
- properties: {
1120
- info: Session;
1121
- };
1329
+ export type WellKnownAuth = {
1330
+ type: "wellknown";
1331
+ key: string;
1332
+ token: string;
1122
1333
  };
1123
- export type EventSessionError = {
1124
- type: "session.error";
1125
- properties: {
1126
- sessionID?: string;
1127
- error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | ApiError;
1128
- };
1334
+ export type Auth = OAuth | ApiAuth | WellKnownAuth;
1335
+ export type GlobalEventData = {
1336
+ body?: never;
1337
+ path?: never;
1338
+ query?: never;
1339
+ url: "/global/event";
1129
1340
  };
1130
- export type EventServerConnected = {
1131
- type: "server.connected";
1132
- properties: {
1133
- [key: string]: unknown;
1134
- };
1341
+ export type GlobalEventResponses = {
1342
+ /**
1343
+ * Event stream
1344
+ */
1345
+ 200: GlobalEvent;
1135
1346
  };
1136
- export type Event = EventInstallationUpdated | EventLspClientDiagnostics | EventLspUpdated | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventSessionCompacted | EventPermissionUpdated | EventPermissionReplied | EventFileEdited | EventFileWatcherUpdated | EventTodoUpdated | EventSessionIdle | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventSessionError | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventServerConnected;
1347
+ export type GlobalEventResponse = GlobalEventResponses[keyof GlobalEventResponses];
1137
1348
  export type ProjectListData = {
1138
1349
  body?: never;
1139
1350
  path?: never;
@@ -1247,6 +1458,21 @@ export type ToolListResponses = {
1247
1458
  200: ToolList;
1248
1459
  };
1249
1460
  export type ToolListResponse = ToolListResponses[keyof ToolListResponses];
1461
+ export type InstanceDisposeData = {
1462
+ body?: never;
1463
+ path?: never;
1464
+ query?: {
1465
+ directory?: string;
1466
+ };
1467
+ url: "/instance/dispose";
1468
+ };
1469
+ export type InstanceDisposeResponses = {
1470
+ /**
1471
+ * Instance disposed
1472
+ */
1473
+ 200: boolean;
1474
+ };
1475
+ export type InstanceDisposeResponse = InstanceDisposeResponses[keyof InstanceDisposeResponses];
1250
1476
  export type PathGetData = {
1251
1477
  body?: never;
1252
1478
  path?: never;
@@ -1262,6 +1488,21 @@ export type PathGetResponses = {
1262
1488
  200: Path;
1263
1489
  };
1264
1490
  export type PathGetResponse = PathGetResponses[keyof PathGetResponses];
1491
+ export type VcsGetData = {
1492
+ body?: never;
1493
+ path?: never;
1494
+ query?: {
1495
+ directory?: string;
1496
+ };
1497
+ url: "/vcs";
1498
+ };
1499
+ export type VcsGetResponses = {
1500
+ /**
1501
+ * VCS info
1502
+ */
1503
+ 200: VcsInfo;
1504
+ };
1505
+ export type VcsGetResponse = VcsGetResponses[keyof VcsGetResponses];
1265
1506
  export type SessionListData = {
1266
1507
  body?: never;
1267
1508
  path?: never;
@@ -1302,6 +1543,30 @@ export type SessionCreateResponses = {
1302
1543
  200: Session;
1303
1544
  };
1304
1545
  export type SessionCreateResponse = SessionCreateResponses[keyof SessionCreateResponses];
1546
+ export type SessionStatusData = {
1547
+ body?: never;
1548
+ path?: never;
1549
+ query?: {
1550
+ directory?: string;
1551
+ };
1552
+ url: "/session/status";
1553
+ };
1554
+ export type SessionStatusErrors = {
1555
+ /**
1556
+ * Bad request
1557
+ */
1558
+ 400: BadRequestError;
1559
+ };
1560
+ export type SessionStatusError = SessionStatusErrors[keyof SessionStatusErrors];
1561
+ export type SessionStatusResponses = {
1562
+ /**
1563
+ * Get session status
1564
+ */
1565
+ 200: {
1566
+ [key: string]: SessionStatus;
1567
+ };
1568
+ };
1569
+ export type SessionStatusResponse = SessionStatusResponses[keyof SessionStatusResponses];
1305
1570
  export type SessionDeleteData = {
1306
1571
  body?: never;
1307
1572
  path: {
@@ -1588,6 +1853,9 @@ export type SessionShareResponse = SessionShareResponses[keyof SessionShareRespo
1588
1853
  export type SessionDiffData = {
1589
1854
  body?: never;
1590
1855
  path: {
1856
+ /**
1857
+ * Session ID
1858
+ */
1591
1859
  id: string;
1592
1860
  };
1593
1861
  query?: {
@@ -1596,9 +1864,20 @@ export type SessionDiffData = {
1596
1864
  };
1597
1865
  url: "/session/{id}/diff";
1598
1866
  };
1867
+ export type SessionDiffErrors = {
1868
+ /**
1869
+ * Bad request
1870
+ */
1871
+ 400: BadRequestError;
1872
+ /**
1873
+ * Not found
1874
+ */
1875
+ 404: NotFoundError;
1876
+ };
1877
+ export type SessionDiffError = SessionDiffErrors[keyof SessionDiffErrors];
1599
1878
  export type SessionDiffResponses = {
1600
1879
  /**
1601
- * Successfully retrieved diff
1880
+ * List of diffs
1602
1881
  */
1603
1882
  200: Array<FileDiff>;
1604
1883
  };
@@ -1647,6 +1926,7 @@ export type SessionMessagesData = {
1647
1926
  };
1648
1927
  query?: {
1649
1928
  directory?: string;
1929
+ limit?: number;
1650
1930
  };
1651
1931
  url: "/session/{id}/message";
1652
1932
  };
@@ -1684,7 +1964,7 @@ export type SessionPromptData = {
1684
1964
  tools?: {
1685
1965
  [key: string]: boolean;
1686
1966
  };
1687
- parts: Array<TextPartInput | FilePartInput | AgentPartInput>;
1967
+ parts: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>;
1688
1968
  };
1689
1969
  path: {
1690
1970
  /**
@@ -1756,6 +2036,50 @@ export type SessionMessageResponses = {
1756
2036
  };
1757
2037
  };
1758
2038
  export type SessionMessageResponse = SessionMessageResponses[keyof SessionMessageResponses];
2039
+ export type SessionPromptAsyncData = {
2040
+ body?: {
2041
+ messageID?: string;
2042
+ model?: {
2043
+ providerID: string;
2044
+ modelID: string;
2045
+ };
2046
+ agent?: string;
2047
+ noReply?: boolean;
2048
+ system?: string;
2049
+ tools?: {
2050
+ [key: string]: boolean;
2051
+ };
2052
+ parts: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>;
2053
+ };
2054
+ path: {
2055
+ /**
2056
+ * Session ID
2057
+ */
2058
+ id: string;
2059
+ };
2060
+ query?: {
2061
+ directory?: string;
2062
+ };
2063
+ url: "/session/{id}/prompt_async";
2064
+ };
2065
+ export type SessionPromptAsyncErrors = {
2066
+ /**
2067
+ * Bad request
2068
+ */
2069
+ 400: BadRequestError;
2070
+ /**
2071
+ * Not found
2072
+ */
2073
+ 404: NotFoundError;
2074
+ };
2075
+ export type SessionPromptAsyncError = SessionPromptAsyncErrors[keyof SessionPromptAsyncErrors];
2076
+ export type SessionPromptAsyncResponses = {
2077
+ /**
2078
+ * Prompt accepted
2079
+ */
2080
+ 204: void;
2081
+ };
2082
+ export type SessionPromptAsyncResponse = SessionPromptAsyncResponses[keyof SessionPromptAsyncResponses];
1759
2083
  export type SessionCommandData = {
1760
2084
  body?: {
1761
2085
  messageID?: string;
@@ -1799,6 +2123,10 @@ export type SessionCommandResponse = SessionCommandResponses[keyof SessionComman
1799
2123
  export type SessionShellData = {
1800
2124
  body?: {
1801
2125
  agent: string;
2126
+ model?: {
2127
+ providerID: string;
2128
+ modelID: string;
2129
+ };
1802
2130
  command: string;
1803
2131
  };
1804
2132
  path: {
@@ -1955,6 +2283,112 @@ export type ConfigProvidersResponses = {
1955
2283
  };
1956
2284
  };
1957
2285
  export type ConfigProvidersResponse = ConfigProvidersResponses[keyof ConfigProvidersResponses];
2286
+ export type ProviderListData = {
2287
+ body?: never;
2288
+ path?: never;
2289
+ query?: {
2290
+ directory?: string;
2291
+ };
2292
+ url: "/provider";
2293
+ };
2294
+ export type ProviderListResponses = {
2295
+ /**
2296
+ * List of providers
2297
+ */
2298
+ 200: {
2299
+ all: Array<Provider>;
2300
+ default: {
2301
+ [key: string]: string;
2302
+ };
2303
+ connected: Array<string>;
2304
+ };
2305
+ };
2306
+ export type ProviderListResponse = ProviderListResponses[keyof ProviderListResponses];
2307
+ export type ProviderAuthData = {
2308
+ body?: never;
2309
+ path?: never;
2310
+ query?: {
2311
+ directory?: string;
2312
+ };
2313
+ url: "/provider/auth";
2314
+ };
2315
+ export type ProviderAuthResponses = {
2316
+ /**
2317
+ * Provider auth methods
2318
+ */
2319
+ 200: {
2320
+ [key: string]: Array<ProviderAuthMethod>;
2321
+ };
2322
+ };
2323
+ export type ProviderAuthResponse = ProviderAuthResponses[keyof ProviderAuthResponses];
2324
+ export type ProviderOauthAuthorizeData = {
2325
+ body?: {
2326
+ /**
2327
+ * Auth method index
2328
+ */
2329
+ method: number;
2330
+ };
2331
+ path: {
2332
+ /**
2333
+ * Provider ID
2334
+ */
2335
+ id: string;
2336
+ };
2337
+ query?: {
2338
+ directory?: string;
2339
+ };
2340
+ url: "/provider/{id}/oauth/authorize";
2341
+ };
2342
+ export type ProviderOauthAuthorizeErrors = {
2343
+ /**
2344
+ * Bad request
2345
+ */
2346
+ 400: BadRequestError;
2347
+ };
2348
+ export type ProviderOauthAuthorizeError = ProviderOauthAuthorizeErrors[keyof ProviderOauthAuthorizeErrors];
2349
+ export type ProviderOauthAuthorizeResponses = {
2350
+ /**
2351
+ * Authorization URL and method
2352
+ */
2353
+ 200: ProviderAuthAuthorization;
2354
+ };
2355
+ export type ProviderOauthAuthorizeResponse = ProviderOauthAuthorizeResponses[keyof ProviderOauthAuthorizeResponses];
2356
+ export type ProviderOauthCallbackData = {
2357
+ body?: {
2358
+ /**
2359
+ * Auth method index
2360
+ */
2361
+ method: number;
2362
+ /**
2363
+ * OAuth authorization code
2364
+ */
2365
+ code?: string;
2366
+ };
2367
+ path: {
2368
+ /**
2369
+ * Provider ID
2370
+ */
2371
+ id: string;
2372
+ };
2373
+ query?: {
2374
+ directory?: string;
2375
+ };
2376
+ url: "/provider/{id}/oauth/callback";
2377
+ };
2378
+ export type ProviderOauthCallbackErrors = {
2379
+ /**
2380
+ * Bad request
2381
+ */
2382
+ 400: BadRequestError;
2383
+ };
2384
+ export type ProviderOauthCallbackError = ProviderOauthCallbackErrors[keyof ProviderOauthCallbackErrors];
2385
+ export type ProviderOauthCallbackResponses = {
2386
+ /**
2387
+ * OAuth callback processed successfully
2388
+ */
2389
+ 200: boolean;
2390
+ };
2391
+ export type ProviderOauthCallbackResponse = ProviderOauthCallbackResponses[keyof ProviderOauthCallbackResponses];
1958
2392
  export type FindTextData = {
1959
2393
  body?: never;
1960
2394
  path?: never;
@@ -1993,6 +2427,7 @@ export type FindFilesData = {
1993
2427
  query: {
1994
2428
  directory?: string;
1995
2429
  query: string;
2430
+ dirs?: "true" | "false";
1996
2431
  };
1997
2432
  url: "/find/file";
1998
2433
  };
@@ -2139,6 +2574,33 @@ export type McpStatusResponses = {
2139
2574
  };
2140
2575
  };
2141
2576
  export type McpStatusResponse = McpStatusResponses[keyof McpStatusResponses];
2577
+ export type McpAddData = {
2578
+ body?: {
2579
+ name: string;
2580
+ config: McpLocalConfig | McpRemoteConfig;
2581
+ };
2582
+ path?: never;
2583
+ query?: {
2584
+ directory?: string;
2585
+ };
2586
+ url: "/mcp";
2587
+ };
2588
+ export type McpAddErrors = {
2589
+ /**
2590
+ * Bad request
2591
+ */
2592
+ 400: BadRequestError;
2593
+ };
2594
+ export type McpAddError = McpAddErrors[keyof McpAddErrors];
2595
+ export type McpAddResponses = {
2596
+ /**
2597
+ * MCP server added successfully
2598
+ */
2599
+ 200: {
2600
+ [key: string]: McpStatus;
2601
+ };
2602
+ };
2603
+ export type McpAddResponse = McpAddResponses[keyof McpAddResponses];
2142
2604
  export type LspStatusData = {
2143
2605
  body?: never;
2144
2606
  path?: never;
@@ -2154,6 +2616,21 @@ export type LspStatusResponses = {
2154
2616
  200: Array<LspStatus>;
2155
2617
  };
2156
2618
  export type LspStatusResponse = LspStatusResponses[keyof LspStatusResponses];
2619
+ export type FormatterStatusData = {
2620
+ body?: never;
2621
+ path?: never;
2622
+ query?: {
2623
+ directory?: string;
2624
+ };
2625
+ url: "/formatter";
2626
+ };
2627
+ export type FormatterStatusResponses = {
2628
+ /**
2629
+ * Formatter status
2630
+ */
2631
+ 200: Array<FormatterStatus>;
2632
+ };
2633
+ export type FormatterStatusResponse = FormatterStatusResponses[keyof FormatterStatusResponses];
2157
2634
  export type TuiAppendPromptData = {
2158
2635
  body?: {
2159
2636
  text: string;