@opencode-ai/sdk 1.3.2 → 1.3.4
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.
- package/dist/client.js +26 -0
- package/dist/v2/client.js +40 -3
- package/dist/v2/gen/sdk.gen.d.ts +48 -38
- package/dist/v2/gen/sdk.gen.js +92 -75
- package/dist/v2/gen/types.gen.d.ts +531 -416
- package/package.json +1 -1
|
@@ -71,24 +71,224 @@ export type EventLspUpdated = {
|
|
|
71
71
|
[key: string]: unknown;
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
|
+
export type EventMessagePartDelta = {
|
|
75
|
+
type: "message.part.delta";
|
|
76
|
+
properties: {
|
|
77
|
+
sessionID: string;
|
|
78
|
+
messageID: string;
|
|
79
|
+
partID: string;
|
|
80
|
+
field: string;
|
|
81
|
+
delta: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
export type PermissionRequest = {
|
|
85
|
+
id: string;
|
|
86
|
+
sessionID: string;
|
|
87
|
+
permission: string;
|
|
88
|
+
patterns: Array<string>;
|
|
89
|
+
metadata: {
|
|
90
|
+
[key: string]: unknown;
|
|
91
|
+
};
|
|
92
|
+
always: Array<string>;
|
|
93
|
+
tool?: {
|
|
94
|
+
messageID: string;
|
|
95
|
+
callID: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export type EventPermissionAsked = {
|
|
99
|
+
type: "permission.asked";
|
|
100
|
+
properties: PermissionRequest;
|
|
101
|
+
};
|
|
102
|
+
export type EventPermissionReplied = {
|
|
103
|
+
type: "permission.replied";
|
|
104
|
+
properties: {
|
|
105
|
+
sessionID: string;
|
|
106
|
+
requestID: string;
|
|
107
|
+
reply: "once" | "always" | "reject";
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
export type SessionStatus = {
|
|
111
|
+
type: "idle";
|
|
112
|
+
} | {
|
|
113
|
+
type: "retry";
|
|
114
|
+
attempt: number;
|
|
115
|
+
message: string;
|
|
116
|
+
next: number;
|
|
117
|
+
} | {
|
|
118
|
+
type: "busy";
|
|
119
|
+
};
|
|
120
|
+
export type EventSessionStatus = {
|
|
121
|
+
type: "session.status";
|
|
122
|
+
properties: {
|
|
123
|
+
sessionID: string;
|
|
124
|
+
status: SessionStatus;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
export type EventSessionIdle = {
|
|
128
|
+
type: "session.idle";
|
|
129
|
+
properties: {
|
|
130
|
+
sessionID: string;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
export type QuestionOption = {
|
|
134
|
+
/**
|
|
135
|
+
* Display text (1-5 words, concise)
|
|
136
|
+
*/
|
|
137
|
+
label: string;
|
|
138
|
+
/**
|
|
139
|
+
* Explanation of choice
|
|
140
|
+
*/
|
|
141
|
+
description: string;
|
|
142
|
+
};
|
|
143
|
+
export type QuestionInfo = {
|
|
144
|
+
/**
|
|
145
|
+
* Complete question
|
|
146
|
+
*/
|
|
147
|
+
question: string;
|
|
148
|
+
/**
|
|
149
|
+
* Very short label (max 30 chars)
|
|
150
|
+
*/
|
|
151
|
+
header: string;
|
|
152
|
+
/**
|
|
153
|
+
* Available choices
|
|
154
|
+
*/
|
|
155
|
+
options: Array<QuestionOption>;
|
|
156
|
+
/**
|
|
157
|
+
* Allow selecting multiple choices
|
|
158
|
+
*/
|
|
159
|
+
multiple?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Allow typing a custom answer (default: true)
|
|
162
|
+
*/
|
|
163
|
+
custom?: boolean;
|
|
164
|
+
};
|
|
165
|
+
export type QuestionRequest = {
|
|
166
|
+
id: string;
|
|
167
|
+
sessionID: string;
|
|
168
|
+
/**
|
|
169
|
+
* Questions to ask
|
|
170
|
+
*/
|
|
171
|
+
questions: Array<QuestionInfo>;
|
|
172
|
+
tool?: {
|
|
173
|
+
messageID: string;
|
|
174
|
+
callID: string;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
export type EventQuestionAsked = {
|
|
178
|
+
type: "question.asked";
|
|
179
|
+
properties: QuestionRequest;
|
|
180
|
+
};
|
|
181
|
+
export type QuestionAnswer = Array<string>;
|
|
182
|
+
export type EventQuestionReplied = {
|
|
183
|
+
type: "question.replied";
|
|
184
|
+
properties: {
|
|
185
|
+
sessionID: string;
|
|
186
|
+
requestID: string;
|
|
187
|
+
answers: Array<QuestionAnswer>;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
export type EventQuestionRejected = {
|
|
191
|
+
type: "question.rejected";
|
|
192
|
+
properties: {
|
|
193
|
+
sessionID: string;
|
|
194
|
+
requestID: string;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
export type EventSessionCompacted = {
|
|
198
|
+
type: "session.compacted";
|
|
199
|
+
properties: {
|
|
200
|
+
sessionID: string;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
74
203
|
export type EventFileEdited = {
|
|
75
204
|
type: "file.edited";
|
|
76
205
|
properties: {
|
|
77
206
|
file: string;
|
|
78
207
|
};
|
|
79
208
|
};
|
|
80
|
-
export type
|
|
81
|
-
type: "
|
|
209
|
+
export type EventFileWatcherUpdated = {
|
|
210
|
+
type: "file.watcher.updated";
|
|
211
|
+
properties: {
|
|
212
|
+
file: string;
|
|
213
|
+
event: "add" | "change" | "unlink";
|
|
214
|
+
};
|
|
82
215
|
};
|
|
83
|
-
export type
|
|
84
|
-
|
|
216
|
+
export type Todo = {
|
|
217
|
+
/**
|
|
218
|
+
* Brief description of the task
|
|
219
|
+
*/
|
|
220
|
+
content: string;
|
|
221
|
+
/**
|
|
222
|
+
* Current status of the task: pending, in_progress, completed, cancelled
|
|
223
|
+
*/
|
|
224
|
+
status: string;
|
|
225
|
+
/**
|
|
226
|
+
* Priority level of the task: high, medium, low
|
|
227
|
+
*/
|
|
228
|
+
priority: string;
|
|
85
229
|
};
|
|
86
|
-
export type
|
|
87
|
-
type: "
|
|
88
|
-
|
|
89
|
-
|
|
230
|
+
export type EventTodoUpdated = {
|
|
231
|
+
type: "todo.updated";
|
|
232
|
+
properties: {
|
|
233
|
+
sessionID: string;
|
|
234
|
+
todos: Array<Todo>;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
export type EventTuiPromptAppend = {
|
|
238
|
+
type: "tui.prompt.append";
|
|
239
|
+
properties: {
|
|
240
|
+
text: string;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
export type EventTuiCommandExecute = {
|
|
244
|
+
type: "tui.command.execute";
|
|
245
|
+
properties: {
|
|
246
|
+
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;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
export type EventTuiToastShow = {
|
|
250
|
+
type: "tui.toast.show";
|
|
251
|
+
properties: {
|
|
252
|
+
title?: string;
|
|
253
|
+
message: string;
|
|
254
|
+
variant: "info" | "success" | "warning" | "error";
|
|
255
|
+
/**
|
|
256
|
+
* Duration in milliseconds
|
|
257
|
+
*/
|
|
258
|
+
duration?: number;
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
export type EventTuiSessionSelect = {
|
|
262
|
+
type: "tui.session.select";
|
|
263
|
+
properties: {
|
|
264
|
+
/**
|
|
265
|
+
* Session ID to navigate to
|
|
266
|
+
*/
|
|
267
|
+
sessionID: string;
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
export type EventMcpToolsChanged = {
|
|
271
|
+
type: "mcp.tools.changed";
|
|
272
|
+
properties: {
|
|
273
|
+
server: string;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
export type EventMcpBrowserOpenFailed = {
|
|
277
|
+
type: "mcp.browser.open.failed";
|
|
278
|
+
properties: {
|
|
279
|
+
mcpName: string;
|
|
280
|
+
url: string;
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
export type EventCommandExecuted = {
|
|
284
|
+
type: "command.executed";
|
|
285
|
+
properties: {
|
|
286
|
+
name: string;
|
|
287
|
+
sessionID: string;
|
|
288
|
+
arguments: string;
|
|
289
|
+
messageID: string;
|
|
290
|
+
};
|
|
90
291
|
};
|
|
91
|
-
export type OutputFormat = OutputFormatText | OutputFormatJsonSchema;
|
|
92
292
|
export type FileDiff = {
|
|
93
293
|
file: string;
|
|
94
294
|
before: string;
|
|
@@ -97,29 +297,12 @@ export type FileDiff = {
|
|
|
97
297
|
deletions: number;
|
|
98
298
|
status?: "added" | "deleted" | "modified";
|
|
99
299
|
};
|
|
100
|
-
export type
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
created: number;
|
|
106
|
-
};
|
|
107
|
-
format?: OutputFormat;
|
|
108
|
-
summary?: {
|
|
109
|
-
title?: string;
|
|
110
|
-
body?: string;
|
|
111
|
-
diffs: Array<FileDiff>;
|
|
112
|
-
};
|
|
113
|
-
agent: string;
|
|
114
|
-
model: {
|
|
115
|
-
providerID: string;
|
|
116
|
-
modelID: string;
|
|
117
|
-
};
|
|
118
|
-
system?: string;
|
|
119
|
-
tools?: {
|
|
120
|
-
[key: string]: boolean;
|
|
300
|
+
export type EventSessionDiff = {
|
|
301
|
+
type: "session.diff";
|
|
302
|
+
properties: {
|
|
303
|
+
sessionID: string;
|
|
304
|
+
diff: Array<FileDiff>;
|
|
121
305
|
};
|
|
122
|
-
variant?: string;
|
|
123
306
|
};
|
|
124
307
|
export type ProviderAuthError = {
|
|
125
308
|
name: "ProviderAuthError";
|
|
@@ -145,35 +328,143 @@ export type MessageAbortedError = {
|
|
|
145
328
|
data: {
|
|
146
329
|
message: string;
|
|
147
330
|
};
|
|
148
|
-
};
|
|
149
|
-
export type StructuredOutputError = {
|
|
150
|
-
name: "StructuredOutputError";
|
|
151
|
-
data: {
|
|
152
|
-
message: string;
|
|
153
|
-
retries: number;
|
|
331
|
+
};
|
|
332
|
+
export type StructuredOutputError = {
|
|
333
|
+
name: "StructuredOutputError";
|
|
334
|
+
data: {
|
|
335
|
+
message: string;
|
|
336
|
+
retries: number;
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
export type ContextOverflowError = {
|
|
340
|
+
name: "ContextOverflowError";
|
|
341
|
+
data: {
|
|
342
|
+
message: string;
|
|
343
|
+
responseBody?: string;
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
export type ApiError = {
|
|
347
|
+
name: "APIError";
|
|
348
|
+
data: {
|
|
349
|
+
message: string;
|
|
350
|
+
statusCode?: number;
|
|
351
|
+
isRetryable: boolean;
|
|
352
|
+
responseHeaders?: {
|
|
353
|
+
[key: string]: string;
|
|
354
|
+
};
|
|
355
|
+
responseBody?: string;
|
|
356
|
+
metadata?: {
|
|
357
|
+
[key: string]: string;
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
export type EventSessionError = {
|
|
362
|
+
type: "session.error";
|
|
363
|
+
properties: {
|
|
364
|
+
sessionID?: string;
|
|
365
|
+
error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | StructuredOutputError | ContextOverflowError | ApiError;
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
export type EventVcsBranchUpdated = {
|
|
369
|
+
type: "vcs.branch.updated";
|
|
370
|
+
properties: {
|
|
371
|
+
branch?: string;
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
export type EventWorkspaceReady = {
|
|
375
|
+
type: "workspace.ready";
|
|
376
|
+
properties: {
|
|
377
|
+
name: string;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
export type EventWorkspaceFailed = {
|
|
381
|
+
type: "workspace.failed";
|
|
382
|
+
properties: {
|
|
383
|
+
message: string;
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
export type Pty = {
|
|
387
|
+
id: string;
|
|
388
|
+
title: string;
|
|
389
|
+
command: string;
|
|
390
|
+
args: Array<string>;
|
|
391
|
+
cwd: string;
|
|
392
|
+
status: "running" | "exited";
|
|
393
|
+
pid: number;
|
|
394
|
+
};
|
|
395
|
+
export type EventPtyCreated = {
|
|
396
|
+
type: "pty.created";
|
|
397
|
+
properties: {
|
|
398
|
+
info: Pty;
|
|
399
|
+
};
|
|
400
|
+
};
|
|
401
|
+
export type EventPtyUpdated = {
|
|
402
|
+
type: "pty.updated";
|
|
403
|
+
properties: {
|
|
404
|
+
info: Pty;
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
export type EventPtyExited = {
|
|
408
|
+
type: "pty.exited";
|
|
409
|
+
properties: {
|
|
410
|
+
id: string;
|
|
411
|
+
exitCode: number;
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
export type EventPtyDeleted = {
|
|
415
|
+
type: "pty.deleted";
|
|
416
|
+
properties: {
|
|
417
|
+
id: string;
|
|
418
|
+
};
|
|
419
|
+
};
|
|
420
|
+
export type EventWorktreeReady = {
|
|
421
|
+
type: "worktree.ready";
|
|
422
|
+
properties: {
|
|
423
|
+
name: string;
|
|
424
|
+
branch: string;
|
|
425
|
+
};
|
|
426
|
+
};
|
|
427
|
+
export type EventWorktreeFailed = {
|
|
428
|
+
type: "worktree.failed";
|
|
429
|
+
properties: {
|
|
430
|
+
message: string;
|
|
431
|
+
};
|
|
432
|
+
};
|
|
433
|
+
export type OutputFormatText = {
|
|
434
|
+
type: "text";
|
|
435
|
+
};
|
|
436
|
+
export type JsonSchema = {
|
|
437
|
+
[key: string]: unknown;
|
|
438
|
+
};
|
|
439
|
+
export type OutputFormatJsonSchema = {
|
|
440
|
+
type: "json_schema";
|
|
441
|
+
schema: JsonSchema;
|
|
442
|
+
retryCount?: number;
|
|
443
|
+
};
|
|
444
|
+
export type OutputFormat = OutputFormatText | OutputFormatJsonSchema;
|
|
445
|
+
export type UserMessage = {
|
|
446
|
+
id: string;
|
|
447
|
+
sessionID: string;
|
|
448
|
+
role: "user";
|
|
449
|
+
time: {
|
|
450
|
+
created: number;
|
|
451
|
+
};
|
|
452
|
+
format?: OutputFormat;
|
|
453
|
+
summary?: {
|
|
454
|
+
title?: string;
|
|
455
|
+
body?: string;
|
|
456
|
+
diffs: Array<FileDiff>;
|
|
154
457
|
};
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
message: string;
|
|
160
|
-
responseBody?: string;
|
|
458
|
+
agent: string;
|
|
459
|
+
model: {
|
|
460
|
+
providerID: string;
|
|
461
|
+
modelID: string;
|
|
161
462
|
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
data: {
|
|
166
|
-
message: string;
|
|
167
|
-
statusCode?: number;
|
|
168
|
-
isRetryable: boolean;
|
|
169
|
-
responseHeaders?: {
|
|
170
|
-
[key: string]: string;
|
|
171
|
-
};
|
|
172
|
-
responseBody?: string;
|
|
173
|
-
metadata?: {
|
|
174
|
-
[key: string]: string;
|
|
175
|
-
};
|
|
463
|
+
system?: string;
|
|
464
|
+
tools?: {
|
|
465
|
+
[key: string]: boolean;
|
|
176
466
|
};
|
|
467
|
+
variant?: string;
|
|
177
468
|
};
|
|
178
469
|
export type AssistantMessage = {
|
|
179
470
|
id: string;
|
|
@@ -213,6 +504,7 @@ export type Message = UserMessage | AssistantMessage;
|
|
|
213
504
|
export type EventMessageUpdated = {
|
|
214
505
|
type: "message.updated";
|
|
215
506
|
properties: {
|
|
507
|
+
sessionID: string;
|
|
216
508
|
info: Message;
|
|
217
509
|
};
|
|
218
510
|
};
|
|
@@ -415,264 +707,54 @@ export type PatchPart = {
|
|
|
415
707
|
messageID: string;
|
|
416
708
|
type: "patch";
|
|
417
709
|
hash: string;
|
|
418
|
-
files: Array<string>;
|
|
419
|
-
};
|
|
420
|
-
export type AgentPart = {
|
|
421
|
-
id: string;
|
|
422
|
-
sessionID: string;
|
|
423
|
-
messageID: string;
|
|
424
|
-
type: "agent";
|
|
425
|
-
name: string;
|
|
426
|
-
source?: {
|
|
427
|
-
value: string;
|
|
428
|
-
start: number;
|
|
429
|
-
end: number;
|
|
430
|
-
};
|
|
431
|
-
};
|
|
432
|
-
export type RetryPart = {
|
|
433
|
-
id: string;
|
|
434
|
-
sessionID: string;
|
|
435
|
-
messageID: string;
|
|
436
|
-
type: "retry";
|
|
437
|
-
attempt: number;
|
|
438
|
-
error: ApiError;
|
|
439
|
-
time: {
|
|
440
|
-
created: number;
|
|
441
|
-
};
|
|
442
|
-
};
|
|
443
|
-
export type CompactionPart = {
|
|
444
|
-
id: string;
|
|
445
|
-
sessionID: string;
|
|
446
|
-
messageID: string;
|
|
447
|
-
type: "compaction";
|
|
448
|
-
auto: boolean;
|
|
449
|
-
overflow?: boolean;
|
|
450
|
-
};
|
|
451
|
-
export type Part = TextPart | SubtaskPart | ReasoningPart | FilePart | ToolPart | StepStartPart | StepFinishPart | SnapshotPart | PatchPart | AgentPart | RetryPart | CompactionPart;
|
|
452
|
-
export type EventMessagePartUpdated = {
|
|
453
|
-
type: "message.part.updated";
|
|
454
|
-
properties: {
|
|
455
|
-
part: Part;
|
|
456
|
-
};
|
|
457
|
-
};
|
|
458
|
-
export type EventMessagePartDelta = {
|
|
459
|
-
type: "message.part.delta";
|
|
460
|
-
properties: {
|
|
461
|
-
sessionID: string;
|
|
462
|
-
messageID: string;
|
|
463
|
-
partID: string;
|
|
464
|
-
field: string;
|
|
465
|
-
delta: string;
|
|
466
|
-
};
|
|
467
|
-
};
|
|
468
|
-
export type EventMessagePartRemoved = {
|
|
469
|
-
type: "message.part.removed";
|
|
470
|
-
properties: {
|
|
471
|
-
sessionID: string;
|
|
472
|
-
messageID: string;
|
|
473
|
-
partID: string;
|
|
474
|
-
};
|
|
475
|
-
};
|
|
476
|
-
export type PermissionRequest = {
|
|
477
|
-
id: string;
|
|
478
|
-
sessionID: string;
|
|
479
|
-
permission: string;
|
|
480
|
-
patterns: Array<string>;
|
|
481
|
-
metadata: {
|
|
482
|
-
[key: string]: unknown;
|
|
483
|
-
};
|
|
484
|
-
always: Array<string>;
|
|
485
|
-
tool?: {
|
|
486
|
-
messageID: string;
|
|
487
|
-
callID: string;
|
|
488
|
-
};
|
|
489
|
-
};
|
|
490
|
-
export type EventPermissionAsked = {
|
|
491
|
-
type: "permission.asked";
|
|
492
|
-
properties: PermissionRequest;
|
|
493
|
-
};
|
|
494
|
-
export type EventPermissionReplied = {
|
|
495
|
-
type: "permission.replied";
|
|
496
|
-
properties: {
|
|
497
|
-
sessionID: string;
|
|
498
|
-
requestID: string;
|
|
499
|
-
reply: "once" | "always" | "reject";
|
|
500
|
-
};
|
|
501
|
-
};
|
|
502
|
-
export type SessionStatus = {
|
|
503
|
-
type: "idle";
|
|
504
|
-
} | {
|
|
505
|
-
type: "retry";
|
|
506
|
-
attempt: number;
|
|
507
|
-
message: string;
|
|
508
|
-
next: number;
|
|
509
|
-
} | {
|
|
510
|
-
type: "busy";
|
|
511
|
-
};
|
|
512
|
-
export type EventSessionStatus = {
|
|
513
|
-
type: "session.status";
|
|
514
|
-
properties: {
|
|
515
|
-
sessionID: string;
|
|
516
|
-
status: SessionStatus;
|
|
517
|
-
};
|
|
518
|
-
};
|
|
519
|
-
export type EventSessionIdle = {
|
|
520
|
-
type: "session.idle";
|
|
521
|
-
properties: {
|
|
522
|
-
sessionID: string;
|
|
523
|
-
};
|
|
524
|
-
};
|
|
525
|
-
export type QuestionOption = {
|
|
526
|
-
/**
|
|
527
|
-
* Display text (1-5 words, concise)
|
|
528
|
-
*/
|
|
529
|
-
label: string;
|
|
530
|
-
/**
|
|
531
|
-
* Explanation of choice
|
|
532
|
-
*/
|
|
533
|
-
description: string;
|
|
534
|
-
};
|
|
535
|
-
export type QuestionInfo = {
|
|
536
|
-
/**
|
|
537
|
-
* Complete question
|
|
538
|
-
*/
|
|
539
|
-
question: string;
|
|
540
|
-
/**
|
|
541
|
-
* Very short label (max 30 chars)
|
|
542
|
-
*/
|
|
543
|
-
header: string;
|
|
544
|
-
/**
|
|
545
|
-
* Available choices
|
|
546
|
-
*/
|
|
547
|
-
options: Array<QuestionOption>;
|
|
548
|
-
/**
|
|
549
|
-
* Allow selecting multiple choices
|
|
550
|
-
*/
|
|
551
|
-
multiple?: boolean;
|
|
552
|
-
/**
|
|
553
|
-
* Allow typing a custom answer (default: true)
|
|
554
|
-
*/
|
|
555
|
-
custom?: boolean;
|
|
556
|
-
};
|
|
557
|
-
export type QuestionRequest = {
|
|
558
|
-
id: string;
|
|
559
|
-
sessionID: string;
|
|
560
|
-
/**
|
|
561
|
-
* Questions to ask
|
|
562
|
-
*/
|
|
563
|
-
questions: Array<QuestionInfo>;
|
|
564
|
-
tool?: {
|
|
565
|
-
messageID: string;
|
|
566
|
-
callID: string;
|
|
567
|
-
};
|
|
568
|
-
};
|
|
569
|
-
export type EventQuestionAsked = {
|
|
570
|
-
type: "question.asked";
|
|
571
|
-
properties: QuestionRequest;
|
|
572
|
-
};
|
|
573
|
-
export type QuestionAnswer = Array<string>;
|
|
574
|
-
export type EventQuestionReplied = {
|
|
575
|
-
type: "question.replied";
|
|
576
|
-
properties: {
|
|
577
|
-
sessionID: string;
|
|
578
|
-
requestID: string;
|
|
579
|
-
answers: Array<QuestionAnswer>;
|
|
580
|
-
};
|
|
581
|
-
};
|
|
582
|
-
export type EventQuestionRejected = {
|
|
583
|
-
type: "question.rejected";
|
|
584
|
-
properties: {
|
|
585
|
-
sessionID: string;
|
|
586
|
-
requestID: string;
|
|
587
|
-
};
|
|
588
|
-
};
|
|
589
|
-
export type EventSessionCompacted = {
|
|
590
|
-
type: "session.compacted";
|
|
591
|
-
properties: {
|
|
592
|
-
sessionID: string;
|
|
593
|
-
};
|
|
594
|
-
};
|
|
595
|
-
export type EventFileWatcherUpdated = {
|
|
596
|
-
type: "file.watcher.updated";
|
|
597
|
-
properties: {
|
|
598
|
-
file: string;
|
|
599
|
-
event: "add" | "change" | "unlink";
|
|
600
|
-
};
|
|
601
|
-
};
|
|
602
|
-
export type Todo = {
|
|
603
|
-
/**
|
|
604
|
-
* Brief description of the task
|
|
605
|
-
*/
|
|
606
|
-
content: string;
|
|
607
|
-
/**
|
|
608
|
-
* Current status of the task: pending, in_progress, completed, cancelled
|
|
609
|
-
*/
|
|
610
|
-
status: string;
|
|
611
|
-
/**
|
|
612
|
-
* Priority level of the task: high, medium, low
|
|
613
|
-
*/
|
|
614
|
-
priority: string;
|
|
615
|
-
};
|
|
616
|
-
export type EventTodoUpdated = {
|
|
617
|
-
type: "todo.updated";
|
|
618
|
-
properties: {
|
|
619
|
-
sessionID: string;
|
|
620
|
-
todos: Array<Todo>;
|
|
621
|
-
};
|
|
622
|
-
};
|
|
623
|
-
export type EventTuiPromptAppend = {
|
|
624
|
-
type: "tui.prompt.append";
|
|
625
|
-
properties: {
|
|
626
|
-
text: string;
|
|
627
|
-
};
|
|
628
|
-
};
|
|
629
|
-
export type EventTuiCommandExecute = {
|
|
630
|
-
type: "tui.command.execute";
|
|
631
|
-
properties: {
|
|
632
|
-
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;
|
|
633
|
-
};
|
|
710
|
+
files: Array<string>;
|
|
634
711
|
};
|
|
635
|
-
export type
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
712
|
+
export type AgentPart = {
|
|
713
|
+
id: string;
|
|
714
|
+
sessionID: string;
|
|
715
|
+
messageID: string;
|
|
716
|
+
type: "agent";
|
|
717
|
+
name: string;
|
|
718
|
+
source?: {
|
|
719
|
+
value: string;
|
|
720
|
+
start: number;
|
|
721
|
+
end: number;
|
|
645
722
|
};
|
|
646
723
|
};
|
|
647
|
-
export type
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
724
|
+
export type RetryPart = {
|
|
725
|
+
id: string;
|
|
726
|
+
sessionID: string;
|
|
727
|
+
messageID: string;
|
|
728
|
+
type: "retry";
|
|
729
|
+
attempt: number;
|
|
730
|
+
error: ApiError;
|
|
731
|
+
time: {
|
|
732
|
+
created: number;
|
|
654
733
|
};
|
|
655
734
|
};
|
|
656
|
-
export type
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
735
|
+
export type CompactionPart = {
|
|
736
|
+
id: string;
|
|
737
|
+
sessionID: string;
|
|
738
|
+
messageID: string;
|
|
739
|
+
type: "compaction";
|
|
740
|
+
auto: boolean;
|
|
741
|
+
overflow?: boolean;
|
|
661
742
|
};
|
|
662
|
-
export type
|
|
663
|
-
|
|
743
|
+
export type Part = TextPart | SubtaskPart | ReasoningPart | FilePart | ToolPart | StepStartPart | StepFinishPart | SnapshotPart | PatchPart | AgentPart | RetryPart | CompactionPart;
|
|
744
|
+
export type EventMessagePartUpdated = {
|
|
745
|
+
type: "message.part.updated";
|
|
664
746
|
properties: {
|
|
665
|
-
|
|
666
|
-
|
|
747
|
+
sessionID: string;
|
|
748
|
+
part: Part;
|
|
749
|
+
time: number;
|
|
667
750
|
};
|
|
668
751
|
};
|
|
669
|
-
export type
|
|
670
|
-
type: "
|
|
752
|
+
export type EventMessagePartRemoved = {
|
|
753
|
+
type: "message.part.removed";
|
|
671
754
|
properties: {
|
|
672
|
-
name: string;
|
|
673
755
|
sessionID: string;
|
|
674
|
-
arguments: string;
|
|
675
756
|
messageID: string;
|
|
757
|
+
partID: string;
|
|
676
758
|
};
|
|
677
759
|
};
|
|
678
760
|
export type PermissionAction = "allow" | "deny" | "ask";
|
|
@@ -717,104 +799,120 @@ export type Session = {
|
|
|
717
799
|
export type EventSessionCreated = {
|
|
718
800
|
type: "session.created";
|
|
719
801
|
properties: {
|
|
802
|
+
sessionID: string;
|
|
720
803
|
info: Session;
|
|
721
804
|
};
|
|
722
805
|
};
|
|
723
806
|
export type EventSessionUpdated = {
|
|
724
807
|
type: "session.updated";
|
|
725
808
|
properties: {
|
|
809
|
+
sessionID: string;
|
|
726
810
|
info: Session;
|
|
727
811
|
};
|
|
728
812
|
};
|
|
729
813
|
export type EventSessionDeleted = {
|
|
730
814
|
type: "session.deleted";
|
|
731
|
-
properties: {
|
|
732
|
-
info: Session;
|
|
733
|
-
};
|
|
734
|
-
};
|
|
735
|
-
export type EventSessionDiff = {
|
|
736
|
-
type: "session.diff";
|
|
737
815
|
properties: {
|
|
738
816
|
sessionID: string;
|
|
739
|
-
|
|
740
|
-
};
|
|
741
|
-
};
|
|
742
|
-
export type EventSessionError = {
|
|
743
|
-
type: "session.error";
|
|
744
|
-
properties: {
|
|
745
|
-
sessionID?: string;
|
|
746
|
-
error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | StructuredOutputError | ContextOverflowError | ApiError;
|
|
747
|
-
};
|
|
748
|
-
};
|
|
749
|
-
export type EventVcsBranchUpdated = {
|
|
750
|
-
type: "vcs.branch.updated";
|
|
751
|
-
properties: {
|
|
752
|
-
branch?: string;
|
|
817
|
+
info: Session;
|
|
753
818
|
};
|
|
754
819
|
};
|
|
755
|
-
export type
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
};
|
|
820
|
+
export type Event = EventInstallationUpdated | EventInstallationUpdateAvailable | EventProjectUpdated | EventServerInstanceDisposed | EventServerConnected | EventGlobalDisposed | EventLspClientDiagnostics | EventLspUpdated | EventMessagePartDelta | EventPermissionAsked | EventPermissionReplied | EventSessionStatus | EventSessionIdle | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventSessionCompacted | EventFileEdited | EventFileWatcherUpdated | EventTodoUpdated | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventCommandExecuted | EventSessionDiff | EventSessionError | EventVcsBranchUpdated | EventWorkspaceReady | EventWorkspaceFailed | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventWorktreeReady | EventWorktreeFailed | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventSessionCreated | EventSessionUpdated | EventSessionDeleted;
|
|
821
|
+
export type GlobalEvent = {
|
|
822
|
+
directory: string;
|
|
823
|
+
payload: Event;
|
|
760
824
|
};
|
|
761
|
-
export type
|
|
762
|
-
type: "
|
|
763
|
-
|
|
764
|
-
|
|
825
|
+
export type SyncEventMessageUpdated = {
|
|
826
|
+
type: "message.updated.1";
|
|
827
|
+
aggregate: "sessionID";
|
|
828
|
+
data: {
|
|
829
|
+
sessionID: string;
|
|
830
|
+
info: Message;
|
|
765
831
|
};
|
|
766
832
|
};
|
|
767
|
-
export type
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
status: "running" | "exited";
|
|
774
|
-
pid: number;
|
|
775
|
-
};
|
|
776
|
-
export type EventPtyCreated = {
|
|
777
|
-
type: "pty.created";
|
|
778
|
-
properties: {
|
|
779
|
-
info: Pty;
|
|
833
|
+
export type SyncEventMessageRemoved = {
|
|
834
|
+
type: "message.removed.1";
|
|
835
|
+
aggregate: "sessionID";
|
|
836
|
+
data: {
|
|
837
|
+
sessionID: string;
|
|
838
|
+
messageID: string;
|
|
780
839
|
};
|
|
781
840
|
};
|
|
782
|
-
export type
|
|
783
|
-
type: "
|
|
784
|
-
|
|
785
|
-
|
|
841
|
+
export type SyncEventMessagePartUpdated = {
|
|
842
|
+
type: "message.part.updated.1";
|
|
843
|
+
aggregate: "sessionID";
|
|
844
|
+
data: {
|
|
845
|
+
sessionID: string;
|
|
846
|
+
part: Part;
|
|
847
|
+
time: number;
|
|
786
848
|
};
|
|
787
849
|
};
|
|
788
|
-
export type
|
|
789
|
-
type: "
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
850
|
+
export type SyncEventMessagePartRemoved = {
|
|
851
|
+
type: "message.part.removed.1";
|
|
852
|
+
aggregate: "sessionID";
|
|
853
|
+
data: {
|
|
854
|
+
sessionID: string;
|
|
855
|
+
messageID: string;
|
|
856
|
+
partID: string;
|
|
793
857
|
};
|
|
794
858
|
};
|
|
795
|
-
export type
|
|
796
|
-
type: "
|
|
797
|
-
|
|
798
|
-
|
|
859
|
+
export type SyncEventSessionCreated = {
|
|
860
|
+
type: "session.created.1";
|
|
861
|
+
aggregate: "sessionID";
|
|
862
|
+
data: {
|
|
863
|
+
sessionID: string;
|
|
864
|
+
info: Session;
|
|
799
865
|
};
|
|
800
866
|
};
|
|
801
|
-
export type
|
|
802
|
-
type: "
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
867
|
+
export type SyncEventSessionUpdated = {
|
|
868
|
+
type: "session.updated.1";
|
|
869
|
+
aggregate: "sessionID";
|
|
870
|
+
data: {
|
|
871
|
+
sessionID: string;
|
|
872
|
+
info: {
|
|
873
|
+
id: string | null;
|
|
874
|
+
slug: string | null;
|
|
875
|
+
projectID: string | null;
|
|
876
|
+
workspaceID: string | null;
|
|
877
|
+
directory: string | null;
|
|
878
|
+
parentID: string | null;
|
|
879
|
+
summary: {
|
|
880
|
+
additions: number;
|
|
881
|
+
deletions: number;
|
|
882
|
+
files: number;
|
|
883
|
+
diffs?: Array<FileDiff>;
|
|
884
|
+
} | null;
|
|
885
|
+
share?: {
|
|
886
|
+
url: string | null;
|
|
887
|
+
};
|
|
888
|
+
title: string | null;
|
|
889
|
+
version: string | null;
|
|
890
|
+
time?: {
|
|
891
|
+
created: number | null;
|
|
892
|
+
updated: number | null;
|
|
893
|
+
compacting: number | null;
|
|
894
|
+
archived: number | null;
|
|
895
|
+
};
|
|
896
|
+
permission: PermissionRuleset | null;
|
|
897
|
+
revert: {
|
|
898
|
+
messageID: string;
|
|
899
|
+
partID?: string;
|
|
900
|
+
snapshot?: string;
|
|
901
|
+
diff?: string;
|
|
902
|
+
} | null;
|
|
903
|
+
};
|
|
806
904
|
};
|
|
807
905
|
};
|
|
808
|
-
export type
|
|
809
|
-
type: "
|
|
810
|
-
|
|
811
|
-
|
|
906
|
+
export type SyncEventSessionDeleted = {
|
|
907
|
+
type: "session.deleted.1";
|
|
908
|
+
aggregate: "sessionID";
|
|
909
|
+
data: {
|
|
910
|
+
sessionID: string;
|
|
911
|
+
info: Session;
|
|
812
912
|
};
|
|
813
913
|
};
|
|
814
|
-
export type
|
|
815
|
-
|
|
816
|
-
directory: string;
|
|
817
|
-
payload: Event;
|
|
914
|
+
export type SyncEvent = {
|
|
915
|
+
payload: SyncEvent;
|
|
818
916
|
};
|
|
819
917
|
/**
|
|
820
918
|
* Log level
|
|
@@ -861,7 +959,6 @@ export type PermissionConfig = {
|
|
|
861
959
|
task?: PermissionRuleConfig;
|
|
862
960
|
external_directory?: PermissionRuleConfig;
|
|
863
961
|
todowrite?: PermissionActionConfig;
|
|
864
|
-
todoread?: PermissionActionConfig;
|
|
865
962
|
question?: PermissionActionConfig;
|
|
866
963
|
webfetch?: PermissionActionConfig;
|
|
867
964
|
websearch?: PermissionActionConfig;
|
|
@@ -1113,11 +1210,16 @@ export type Config = {
|
|
|
1113
1210
|
watcher?: {
|
|
1114
1211
|
ignore?: Array<string>;
|
|
1115
1212
|
};
|
|
1116
|
-
plugin?: Array<string>;
|
|
1117
1213
|
/**
|
|
1118
1214
|
* Enable or disable snapshot tracking. When false, filesystem snapshots are not recorded and undoing or reverting will not undo/redo file changes. Defaults to true.
|
|
1119
1215
|
*/
|
|
1120
1216
|
snapshot?: boolean;
|
|
1217
|
+
plugin?: Array<string | [
|
|
1218
|
+
string,
|
|
1219
|
+
{
|
|
1220
|
+
[key: string]: unknown;
|
|
1221
|
+
}
|
|
1222
|
+
]>;
|
|
1121
1223
|
/**
|
|
1122
1224
|
* Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing
|
|
1123
1225
|
*/
|
|
@@ -1604,7 +1706,7 @@ export type Path = {
|
|
|
1604
1706
|
directory: string;
|
|
1605
1707
|
};
|
|
1606
1708
|
export type VcsInfo = {
|
|
1607
|
-
branch
|
|
1709
|
+
branch?: string;
|
|
1608
1710
|
};
|
|
1609
1711
|
export type Command = {
|
|
1610
1712
|
name: string;
|
|
@@ -1677,6 +1779,19 @@ export type GlobalEventResponses = {
|
|
|
1677
1779
|
200: GlobalEvent;
|
|
1678
1780
|
};
|
|
1679
1781
|
export type GlobalEventResponse = GlobalEventResponses[keyof GlobalEventResponses];
|
|
1782
|
+
export type GlobalSyncEventSubscribeData = {
|
|
1783
|
+
body?: never;
|
|
1784
|
+
path?: never;
|
|
1785
|
+
query?: never;
|
|
1786
|
+
url: "/global/sync-event";
|
|
1787
|
+
};
|
|
1788
|
+
export type GlobalSyncEventSubscribeResponses = {
|
|
1789
|
+
/**
|
|
1790
|
+
* Event stream
|
|
1791
|
+
*/
|
|
1792
|
+
200: SyncEvent;
|
|
1793
|
+
};
|
|
1794
|
+
export type GlobalSyncEventSubscribeResponse = GlobalSyncEventSubscribeResponses[keyof GlobalSyncEventSubscribeResponses];
|
|
1680
1795
|
export type GlobalConfigGetData = {
|
|
1681
1796
|
body?: never;
|
|
1682
1797
|
path?: never;
|
|
@@ -1795,6 +1910,48 @@ export type AuthSetResponses = {
|
|
|
1795
1910
|
200: boolean;
|
|
1796
1911
|
};
|
|
1797
1912
|
export type AuthSetResponse = AuthSetResponses[keyof AuthSetResponses];
|
|
1913
|
+
export type AppLogData = {
|
|
1914
|
+
body?: {
|
|
1915
|
+
/**
|
|
1916
|
+
* Service name for the log entry
|
|
1917
|
+
*/
|
|
1918
|
+
service: string;
|
|
1919
|
+
/**
|
|
1920
|
+
* Log level
|
|
1921
|
+
*/
|
|
1922
|
+
level: "debug" | "info" | "error" | "warn";
|
|
1923
|
+
/**
|
|
1924
|
+
* Log message
|
|
1925
|
+
*/
|
|
1926
|
+
message: string;
|
|
1927
|
+
/**
|
|
1928
|
+
* Additional metadata for the log entry
|
|
1929
|
+
*/
|
|
1930
|
+
extra?: {
|
|
1931
|
+
[key: string]: unknown;
|
|
1932
|
+
};
|
|
1933
|
+
};
|
|
1934
|
+
path?: never;
|
|
1935
|
+
query?: {
|
|
1936
|
+
directory?: string;
|
|
1937
|
+
workspace?: string;
|
|
1938
|
+
};
|
|
1939
|
+
url: "/log";
|
|
1940
|
+
};
|
|
1941
|
+
export type AppLogErrors = {
|
|
1942
|
+
/**
|
|
1943
|
+
* Bad request
|
|
1944
|
+
*/
|
|
1945
|
+
400: BadRequestError;
|
|
1946
|
+
};
|
|
1947
|
+
export type AppLogError = AppLogErrors[keyof AppLogErrors];
|
|
1948
|
+
export type AppLogResponses = {
|
|
1949
|
+
/**
|
|
1950
|
+
* Log entry written successfully
|
|
1951
|
+
*/
|
|
1952
|
+
200: boolean;
|
|
1953
|
+
};
|
|
1954
|
+
export type AppLogResponse = AppLogResponses[keyof AppLogResponses];
|
|
1798
1955
|
export type ProjectListData = {
|
|
1799
1956
|
body?: never;
|
|
1800
1957
|
path?: never;
|
|
@@ -4194,48 +4351,6 @@ export type CommandListResponses = {
|
|
|
4194
4351
|
200: Array<Command>;
|
|
4195
4352
|
};
|
|
4196
4353
|
export type CommandListResponse = CommandListResponses[keyof CommandListResponses];
|
|
4197
|
-
export type AppLogData = {
|
|
4198
|
-
body?: {
|
|
4199
|
-
/**
|
|
4200
|
-
* Service name for the log entry
|
|
4201
|
-
*/
|
|
4202
|
-
service: string;
|
|
4203
|
-
/**
|
|
4204
|
-
* Log level
|
|
4205
|
-
*/
|
|
4206
|
-
level: "debug" | "info" | "error" | "warn";
|
|
4207
|
-
/**
|
|
4208
|
-
* Log message
|
|
4209
|
-
*/
|
|
4210
|
-
message: string;
|
|
4211
|
-
/**
|
|
4212
|
-
* Additional metadata for the log entry
|
|
4213
|
-
*/
|
|
4214
|
-
extra?: {
|
|
4215
|
-
[key: string]: unknown;
|
|
4216
|
-
};
|
|
4217
|
-
};
|
|
4218
|
-
path?: never;
|
|
4219
|
-
query?: {
|
|
4220
|
-
directory?: string;
|
|
4221
|
-
workspace?: string;
|
|
4222
|
-
};
|
|
4223
|
-
url: "/log";
|
|
4224
|
-
};
|
|
4225
|
-
export type AppLogErrors = {
|
|
4226
|
-
/**
|
|
4227
|
-
* Bad request
|
|
4228
|
-
*/
|
|
4229
|
-
400: BadRequestError;
|
|
4230
|
-
};
|
|
4231
|
-
export type AppLogError = AppLogErrors[keyof AppLogErrors];
|
|
4232
|
-
export type AppLogResponses = {
|
|
4233
|
-
/**
|
|
4234
|
-
* Log entry written successfully
|
|
4235
|
-
*/
|
|
4236
|
-
200: boolean;
|
|
4237
|
-
};
|
|
4238
|
-
export type AppLogResponse = AppLogResponses[keyof AppLogResponses];
|
|
4239
4354
|
export type AppAgentsData = {
|
|
4240
4355
|
body?: never;
|
|
4241
4356
|
path?: never;
|