@opencode-ai/sdk 1.4.2 → 1.4.3
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/v2/gen/types.gen.d.ts +163 -159
- package/package.json +1 -1
|
@@ -107,97 +107,79 @@ export type EventPermissionReplied = {
|
|
|
107
107
|
reply: "once" | "always" | "reject";
|
|
108
108
|
};
|
|
109
109
|
};
|
|
110
|
-
export type
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
next: number;
|
|
117
|
-
} | {
|
|
118
|
-
type: "busy";
|
|
110
|
+
export type SnapshotFileDiff = {
|
|
111
|
+
file: string;
|
|
112
|
+
patch: string;
|
|
113
|
+
additions: number;
|
|
114
|
+
deletions: number;
|
|
115
|
+
status?: "added" | "deleted" | "modified";
|
|
119
116
|
};
|
|
120
|
-
export type
|
|
121
|
-
type: "session.
|
|
117
|
+
export type EventSessionDiff = {
|
|
118
|
+
type: "session.diff";
|
|
122
119
|
properties: {
|
|
123
120
|
sessionID: string;
|
|
124
|
-
|
|
121
|
+
diff: Array<SnapshotFileDiff>;
|
|
125
122
|
};
|
|
126
123
|
};
|
|
127
|
-
export type
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
124
|
+
export type ProviderAuthError = {
|
|
125
|
+
name: "ProviderAuthError";
|
|
126
|
+
data: {
|
|
127
|
+
providerID: string;
|
|
128
|
+
message: string;
|
|
131
129
|
};
|
|
132
130
|
};
|
|
133
|
-
export type
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Explanation of choice
|
|
140
|
-
*/
|
|
141
|
-
description: string;
|
|
131
|
+
export type UnknownError = {
|
|
132
|
+
name: "UnknownError";
|
|
133
|
+
data: {
|
|
134
|
+
message: string;
|
|
135
|
+
};
|
|
142
136
|
};
|
|
143
|
-
export type
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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;
|
|
137
|
+
export type MessageOutputLengthError = {
|
|
138
|
+
name: "MessageOutputLengthError";
|
|
139
|
+
data: {
|
|
140
|
+
[key: string]: unknown;
|
|
141
|
+
};
|
|
164
142
|
};
|
|
165
|
-
export type
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
* Questions to ask
|
|
170
|
-
*/
|
|
171
|
-
questions: Array<QuestionInfo>;
|
|
172
|
-
tool?: {
|
|
173
|
-
messageID: string;
|
|
174
|
-
callID: string;
|
|
143
|
+
export type MessageAbortedError = {
|
|
144
|
+
name: "MessageAbortedError";
|
|
145
|
+
data: {
|
|
146
|
+
message: string;
|
|
175
147
|
};
|
|
176
148
|
};
|
|
177
|
-
export type
|
|
178
|
-
|
|
179
|
-
|
|
149
|
+
export type StructuredOutputError = {
|
|
150
|
+
name: "StructuredOutputError";
|
|
151
|
+
data: {
|
|
152
|
+
message: string;
|
|
153
|
+
retries: number;
|
|
154
|
+
};
|
|
180
155
|
};
|
|
181
|
-
export type
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
requestID: string;
|
|
187
|
-
answers: Array<QuestionAnswer>;
|
|
156
|
+
export type ContextOverflowError = {
|
|
157
|
+
name: "ContextOverflowError";
|
|
158
|
+
data: {
|
|
159
|
+
message: string;
|
|
160
|
+
responseBody?: string;
|
|
188
161
|
};
|
|
189
162
|
};
|
|
190
|
-
export type
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
163
|
+
export type ApiError = {
|
|
164
|
+
name: "APIError";
|
|
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
|
+
};
|
|
195
176
|
};
|
|
196
177
|
};
|
|
197
|
-
export type
|
|
198
|
-
type: "session.
|
|
178
|
+
export type EventSessionError = {
|
|
179
|
+
type: "session.error";
|
|
199
180
|
properties: {
|
|
200
|
-
sessionID
|
|
181
|
+
sessionID?: string;
|
|
182
|
+
error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | StructuredOutputError | ContextOverflowError | ApiError;
|
|
201
183
|
};
|
|
202
184
|
};
|
|
203
185
|
export type EventFileEdited = {
|
|
@@ -213,25 +195,10 @@ export type EventFileWatcherUpdated = {
|
|
|
213
195
|
event: "add" | "change" | "unlink";
|
|
214
196
|
};
|
|
215
197
|
};
|
|
216
|
-
export type
|
|
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;
|
|
229
|
-
};
|
|
230
|
-
export type EventTodoUpdated = {
|
|
231
|
-
type: "todo.updated";
|
|
198
|
+
export type EventVcsBranchUpdated = {
|
|
199
|
+
type: "vcs.branch.updated";
|
|
232
200
|
properties: {
|
|
233
|
-
|
|
234
|
-
todos: Array<Todo>;
|
|
201
|
+
branch?: string;
|
|
235
202
|
};
|
|
236
203
|
};
|
|
237
204
|
export type EventTuiPromptAppend = {
|
|
@@ -289,97 +256,130 @@ export type EventCommandExecuted = {
|
|
|
289
256
|
messageID: string;
|
|
290
257
|
};
|
|
291
258
|
};
|
|
292
|
-
export type
|
|
293
|
-
|
|
294
|
-
patch: string;
|
|
295
|
-
additions: number;
|
|
296
|
-
deletions: number;
|
|
297
|
-
status?: "added" | "deleted" | "modified";
|
|
298
|
-
};
|
|
299
|
-
export type EventSessionDiff = {
|
|
300
|
-
type: "session.diff";
|
|
259
|
+
export type EventWorkspaceReady = {
|
|
260
|
+
type: "workspace.ready";
|
|
301
261
|
properties: {
|
|
302
|
-
|
|
303
|
-
diff: Array<SnapshotFileDiff>;
|
|
262
|
+
name: string;
|
|
304
263
|
};
|
|
305
264
|
};
|
|
306
|
-
export type
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
providerID: string;
|
|
265
|
+
export type EventWorkspaceFailed = {
|
|
266
|
+
type: "workspace.failed";
|
|
267
|
+
properties: {
|
|
310
268
|
message: string;
|
|
311
269
|
};
|
|
312
270
|
};
|
|
313
|
-
export type
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
271
|
+
export type QuestionOption = {
|
|
272
|
+
/**
|
|
273
|
+
* Display text (1-5 words, concise)
|
|
274
|
+
*/
|
|
275
|
+
label: string;
|
|
276
|
+
/**
|
|
277
|
+
* Explanation of choice
|
|
278
|
+
*/
|
|
279
|
+
description: string;
|
|
318
280
|
};
|
|
319
|
-
export type
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
281
|
+
export type QuestionInfo = {
|
|
282
|
+
/**
|
|
283
|
+
* Complete question
|
|
284
|
+
*/
|
|
285
|
+
question: string;
|
|
286
|
+
/**
|
|
287
|
+
* Very short label (max 30 chars)
|
|
288
|
+
*/
|
|
289
|
+
header: string;
|
|
290
|
+
/**
|
|
291
|
+
* Available choices
|
|
292
|
+
*/
|
|
293
|
+
options: Array<QuestionOption>;
|
|
294
|
+
/**
|
|
295
|
+
* Allow selecting multiple choices
|
|
296
|
+
*/
|
|
297
|
+
multiple?: boolean;
|
|
298
|
+
/**
|
|
299
|
+
* Allow typing a custom answer (default: true)
|
|
300
|
+
*/
|
|
301
|
+
custom?: boolean;
|
|
324
302
|
};
|
|
325
|
-
export type
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
303
|
+
export type QuestionRequest = {
|
|
304
|
+
id: string;
|
|
305
|
+
sessionID: string;
|
|
306
|
+
/**
|
|
307
|
+
* Questions to ask
|
|
308
|
+
*/
|
|
309
|
+
questions: Array<QuestionInfo>;
|
|
310
|
+
tool?: {
|
|
311
|
+
messageID: string;
|
|
312
|
+
callID: string;
|
|
329
313
|
};
|
|
330
314
|
};
|
|
331
|
-
export type
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
message: string;
|
|
335
|
-
retries: number;
|
|
336
|
-
};
|
|
315
|
+
export type EventQuestionAsked = {
|
|
316
|
+
type: "question.asked";
|
|
317
|
+
properties: QuestionRequest;
|
|
337
318
|
};
|
|
338
|
-
export type
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
319
|
+
export type QuestionAnswer = Array<string>;
|
|
320
|
+
export type EventQuestionReplied = {
|
|
321
|
+
type: "question.replied";
|
|
322
|
+
properties: {
|
|
323
|
+
sessionID: string;
|
|
324
|
+
requestID: string;
|
|
325
|
+
answers: Array<QuestionAnswer>;
|
|
343
326
|
};
|
|
344
327
|
};
|
|
345
|
-
export type
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
isRetryable: boolean;
|
|
351
|
-
responseHeaders?: {
|
|
352
|
-
[key: string]: string;
|
|
353
|
-
};
|
|
354
|
-
responseBody?: string;
|
|
355
|
-
metadata?: {
|
|
356
|
-
[key: string]: string;
|
|
357
|
-
};
|
|
328
|
+
export type EventQuestionRejected = {
|
|
329
|
+
type: "question.rejected";
|
|
330
|
+
properties: {
|
|
331
|
+
sessionID: string;
|
|
332
|
+
requestID: string;
|
|
358
333
|
};
|
|
359
334
|
};
|
|
360
|
-
export type
|
|
361
|
-
type: "
|
|
335
|
+
export type SessionStatus = {
|
|
336
|
+
type: "idle";
|
|
337
|
+
} | {
|
|
338
|
+
type: "retry";
|
|
339
|
+
attempt: number;
|
|
340
|
+
message: string;
|
|
341
|
+
next: number;
|
|
342
|
+
} | {
|
|
343
|
+
type: "busy";
|
|
344
|
+
};
|
|
345
|
+
export type EventSessionStatus = {
|
|
346
|
+
type: "session.status";
|
|
362
347
|
properties: {
|
|
363
|
-
sessionID
|
|
364
|
-
|
|
348
|
+
sessionID: string;
|
|
349
|
+
status: SessionStatus;
|
|
365
350
|
};
|
|
366
351
|
};
|
|
367
|
-
export type
|
|
368
|
-
type: "
|
|
352
|
+
export type EventSessionIdle = {
|
|
353
|
+
type: "session.idle";
|
|
369
354
|
properties: {
|
|
370
|
-
|
|
355
|
+
sessionID: string;
|
|
371
356
|
};
|
|
372
357
|
};
|
|
373
|
-
export type
|
|
374
|
-
type: "
|
|
358
|
+
export type EventSessionCompacted = {
|
|
359
|
+
type: "session.compacted";
|
|
375
360
|
properties: {
|
|
376
|
-
|
|
361
|
+
sessionID: string;
|
|
377
362
|
};
|
|
378
363
|
};
|
|
379
|
-
export type
|
|
380
|
-
|
|
364
|
+
export type Todo = {
|
|
365
|
+
/**
|
|
366
|
+
* Brief description of the task
|
|
367
|
+
*/
|
|
368
|
+
content: string;
|
|
369
|
+
/**
|
|
370
|
+
* Current status of the task: pending, in_progress, completed, cancelled
|
|
371
|
+
*/
|
|
372
|
+
status: string;
|
|
373
|
+
/**
|
|
374
|
+
* Priority level of the task: high, medium, low
|
|
375
|
+
*/
|
|
376
|
+
priority: string;
|
|
377
|
+
};
|
|
378
|
+
export type EventTodoUpdated = {
|
|
379
|
+
type: "todo.updated";
|
|
381
380
|
properties: {
|
|
382
|
-
|
|
381
|
+
sessionID: string;
|
|
382
|
+
todos: Array<Todo>;
|
|
383
383
|
};
|
|
384
384
|
};
|
|
385
385
|
export type Pty = {
|
|
@@ -816,7 +816,7 @@ export type EventSessionDeleted = {
|
|
|
816
816
|
info: Session;
|
|
817
817
|
};
|
|
818
818
|
};
|
|
819
|
-
export type Event = EventProjectUpdated | EventInstallationUpdated | EventInstallationUpdateAvailable | EventServerInstanceDisposed | EventServerConnected | EventGlobalDisposed | EventLspClientDiagnostics | EventLspUpdated | EventMessagePartDelta | EventPermissionAsked | EventPermissionReplied |
|
|
819
|
+
export type Event = EventProjectUpdated | EventInstallationUpdated | EventInstallationUpdateAvailable | EventServerInstanceDisposed | EventServerConnected | EventGlobalDisposed | EventLspClientDiagnostics | EventLspUpdated | EventMessagePartDelta | EventPermissionAsked | EventPermissionReplied | EventSessionDiff | EventSessionError | EventFileEdited | EventFileWatcherUpdated | EventVcsBranchUpdated | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventCommandExecuted | EventWorkspaceReady | EventWorkspaceFailed | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventSessionStatus | EventSessionIdle | EventSessionCompacted | EventTodoUpdated | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventWorktreeReady | EventWorktreeFailed | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventSessionCreated | EventSessionUpdated | EventSessionDeleted;
|
|
820
820
|
export type GlobalEvent = {
|
|
821
821
|
directory: string;
|
|
822
822
|
payload: Event;
|
|
@@ -1141,6 +1141,10 @@ export type McpOAuthConfig = {
|
|
|
1141
1141
|
* OAuth scopes to request during authorization
|
|
1142
1142
|
*/
|
|
1143
1143
|
scope?: string;
|
|
1144
|
+
/**
|
|
1145
|
+
* OAuth redirect URI (default: http://127.0.0.1:19876/mcp/oauth/callback).
|
|
1146
|
+
*/
|
|
1147
|
+
redirectUri?: string;
|
|
1144
1148
|
};
|
|
1145
1149
|
export type McpRemoteConfig = {
|
|
1146
1150
|
/**
|