@opencode-ai/sdk 0.1.0-alpha.15 → 0.1.0-alpha.16
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/CHANGELOG.md +13 -0
- package/client.d.mts +15 -14
- package/client.d.mts.map +1 -1
- package/client.d.ts +15 -14
- package/client.d.ts.map +1 -1
- package/client.js +12 -9
- package/client.js.map +1 -1
- package/client.mjs +14 -11
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/app.d.mts +49 -2
- package/resources/app.d.mts.map +1 -1
- package/resources/app.d.ts +49 -2
- package/resources/app.d.ts.map +1 -1
- package/resources/app.js +12 -0
- package/resources/app.js.map +1 -1
- package/resources/app.mjs +12 -0
- package/resources/app.mjs.map +1 -1
- package/resources/config.d.mts +120 -34
- package/resources/config.d.mts.map +1 -1
- package/resources/config.d.ts +120 -34
- package/resources/config.d.ts.map +1 -1
- package/resources/config.js.map +1 -1
- package/resources/config.mjs.map +1 -1
- package/resources/event.d.mts +14 -15
- package/resources/event.d.mts.map +1 -1
- package/resources/event.d.ts +14 -15
- package/resources/event.d.ts.map +1 -1
- package/resources/file.d.mts +10 -12
- package/resources/file.d.mts.map +1 -1
- package/resources/file.d.ts +10 -12
- package/resources/file.d.ts.map +1 -1
- package/resources/file.js +3 -3
- package/resources/file.js.map +1 -1
- package/resources/file.mjs +1 -1
- package/resources/file.mjs.map +1 -1
- package/resources/find.d.mts +48 -23
- package/resources/find.d.mts.map +1 -1
- package/resources/find.d.ts +48 -23
- package/resources/find.d.ts.map +1 -1
- package/resources/index.d.mts +4 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +2 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -2
- package/resources/index.mjs.map +1 -1
- package/resources/session.d.mts +79 -20
- package/resources/session.d.mts.map +1 -1
- package/resources/session.d.ts +79 -20
- package/resources/session.d.ts.map +1 -1
- package/resources/shared.d.mts +4 -0
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +4 -0
- package/resources/shared.d.ts.map +1 -1
- package/src/client.ts +51 -22
- package/src/resources/app.ts +72 -3
- package/src/resources/config.ts +139 -34
- package/src/resources/event.ts +21 -19
- package/src/resources/file.ts +14 -15
- package/src/resources/find.ts +60 -22
- package/src/resources/index.ts +22 -4
- package/src/resources/session.ts +121 -26
- package/src/resources/shared.ts +6 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/resources/session.ts
CHANGED
|
@@ -90,8 +90,6 @@ export interface AssistantMessage {
|
|
|
90
90
|
|
|
91
91
|
modelID: string;
|
|
92
92
|
|
|
93
|
-
parts: Array<AssistantMessagePart>;
|
|
94
|
-
|
|
95
93
|
path: AssistantMessage.Path;
|
|
96
94
|
|
|
97
95
|
providerID: string;
|
|
@@ -106,7 +104,11 @@ export interface AssistantMessage {
|
|
|
106
104
|
|
|
107
105
|
tokens: AssistantMessage.Tokens;
|
|
108
106
|
|
|
109
|
-
error?:
|
|
107
|
+
error?:
|
|
108
|
+
| Shared.ProviderAuthError
|
|
109
|
+
| Shared.UnknownError
|
|
110
|
+
| AssistantMessage.MessageOutputLengthError
|
|
111
|
+
| Shared.MessageAbortedError;
|
|
110
112
|
|
|
111
113
|
summary?: boolean;
|
|
112
114
|
}
|
|
@@ -149,11 +151,15 @@ export namespace AssistantMessage {
|
|
|
149
151
|
}
|
|
150
152
|
}
|
|
151
153
|
|
|
152
|
-
export type AssistantMessagePart = TextPart | ToolPart | StepStartPart;
|
|
153
|
-
|
|
154
154
|
export interface FilePart {
|
|
155
|
+
id: string;
|
|
156
|
+
|
|
157
|
+
messageID: string;
|
|
158
|
+
|
|
155
159
|
mime: string;
|
|
156
160
|
|
|
161
|
+
sessionID: string;
|
|
162
|
+
|
|
157
163
|
type: 'file';
|
|
158
164
|
|
|
159
165
|
url: string;
|
|
@@ -161,25 +167,21 @@ export interface FilePart {
|
|
|
161
167
|
filename?: string;
|
|
162
168
|
}
|
|
163
169
|
|
|
164
|
-
export type Message =
|
|
170
|
+
export type Message = UserMessage | AssistantMessage;
|
|
165
171
|
|
|
166
|
-
export
|
|
167
|
-
export interface UserMessage {
|
|
168
|
-
id: string;
|
|
172
|
+
export type Part = TextPart | FilePart | ToolPart | StepStartPart | StepFinishPart | Part.UnionMember5;
|
|
169
173
|
|
|
170
|
-
|
|
174
|
+
export namespace Part {
|
|
175
|
+
export interface UnionMember5 {
|
|
176
|
+
id: string;
|
|
171
177
|
|
|
172
|
-
|
|
178
|
+
messageID: string;
|
|
173
179
|
|
|
174
180
|
sessionID: string;
|
|
175
181
|
|
|
176
|
-
|
|
177
|
-
}
|
|
182
|
+
snapshot: string;
|
|
178
183
|
|
|
179
|
-
|
|
180
|
-
export interface Time {
|
|
181
|
-
created: number;
|
|
182
|
-
}
|
|
184
|
+
type: 'snapshot';
|
|
183
185
|
}
|
|
184
186
|
}
|
|
185
187
|
|
|
@@ -219,19 +221,83 @@ export namespace Session {
|
|
|
219
221
|
}
|
|
220
222
|
}
|
|
221
223
|
|
|
224
|
+
export interface StepFinishPart {
|
|
225
|
+
id: string;
|
|
226
|
+
|
|
227
|
+
cost: number;
|
|
228
|
+
|
|
229
|
+
messageID: string;
|
|
230
|
+
|
|
231
|
+
sessionID: string;
|
|
232
|
+
|
|
233
|
+
tokens: StepFinishPart.Tokens;
|
|
234
|
+
|
|
235
|
+
type: 'step-finish';
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export namespace StepFinishPart {
|
|
239
|
+
export interface Tokens {
|
|
240
|
+
cache: Tokens.Cache;
|
|
241
|
+
|
|
242
|
+
input: number;
|
|
243
|
+
|
|
244
|
+
output: number;
|
|
245
|
+
|
|
246
|
+
reasoning: number;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export namespace Tokens {
|
|
250
|
+
export interface Cache {
|
|
251
|
+
read: number;
|
|
252
|
+
|
|
253
|
+
write: number;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
222
258
|
export interface StepStartPart {
|
|
259
|
+
id: string;
|
|
260
|
+
|
|
261
|
+
messageID: string;
|
|
262
|
+
|
|
263
|
+
sessionID: string;
|
|
264
|
+
|
|
223
265
|
type: 'step-start';
|
|
224
266
|
}
|
|
225
267
|
|
|
226
268
|
export interface TextPart {
|
|
269
|
+
id: string;
|
|
270
|
+
|
|
271
|
+
messageID: string;
|
|
272
|
+
|
|
273
|
+
sessionID: string;
|
|
274
|
+
|
|
227
275
|
text: string;
|
|
228
276
|
|
|
229
277
|
type: 'text';
|
|
278
|
+
|
|
279
|
+
synthetic?: boolean;
|
|
280
|
+
|
|
281
|
+
time?: TextPart.Time;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export namespace TextPart {
|
|
285
|
+
export interface Time {
|
|
286
|
+
start: number;
|
|
287
|
+
|
|
288
|
+
end?: number;
|
|
289
|
+
}
|
|
230
290
|
}
|
|
231
291
|
|
|
232
292
|
export interface ToolPart {
|
|
233
293
|
id: string;
|
|
234
294
|
|
|
295
|
+
callID: string;
|
|
296
|
+
|
|
297
|
+
messageID: string;
|
|
298
|
+
|
|
299
|
+
sessionID: string;
|
|
300
|
+
|
|
235
301
|
state: ToolStatePending | ToolStateRunning | ToolStateCompleted | ToolStateError;
|
|
236
302
|
|
|
237
303
|
tool: string;
|
|
@@ -240,6 +306,8 @@ export interface ToolPart {
|
|
|
240
306
|
}
|
|
241
307
|
|
|
242
308
|
export interface ToolStateCompleted {
|
|
309
|
+
input: { [key: string]: unknown };
|
|
310
|
+
|
|
243
311
|
metadata: { [key: string]: unknown };
|
|
244
312
|
|
|
245
313
|
output: string;
|
|
@@ -249,8 +317,6 @@ export interface ToolStateCompleted {
|
|
|
249
317
|
time: ToolStateCompleted.Time;
|
|
250
318
|
|
|
251
319
|
title: string;
|
|
252
|
-
|
|
253
|
-
input?: unknown;
|
|
254
320
|
}
|
|
255
321
|
|
|
256
322
|
export namespace ToolStateCompleted {
|
|
@@ -264,11 +330,11 @@ export namespace ToolStateCompleted {
|
|
|
264
330
|
export interface ToolStateError {
|
|
265
331
|
error: string;
|
|
266
332
|
|
|
333
|
+
input: { [key: string]: unknown };
|
|
334
|
+
|
|
267
335
|
status: 'error';
|
|
268
336
|
|
|
269
337
|
time: ToolStateError.Time;
|
|
270
|
-
|
|
271
|
-
input?: unknown;
|
|
272
338
|
}
|
|
273
339
|
|
|
274
340
|
export namespace ToolStateError {
|
|
@@ -301,7 +367,21 @@ export namespace ToolStateRunning {
|
|
|
301
367
|
}
|
|
302
368
|
}
|
|
303
369
|
|
|
304
|
-
export
|
|
370
|
+
export interface UserMessage {
|
|
371
|
+
id: string;
|
|
372
|
+
|
|
373
|
+
role: 'user';
|
|
374
|
+
|
|
375
|
+
sessionID: string;
|
|
376
|
+
|
|
377
|
+
time: UserMessage.Time;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export namespace UserMessage {
|
|
381
|
+
export interface Time {
|
|
382
|
+
created: number;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
305
385
|
|
|
306
386
|
export type SessionListResponse = Array<Session>;
|
|
307
387
|
|
|
@@ -311,19 +391,33 @@ export type SessionAbortResponse = boolean;
|
|
|
311
391
|
|
|
312
392
|
export type SessionInitResponse = boolean;
|
|
313
393
|
|
|
314
|
-
export type SessionMessagesResponse = Array<
|
|
394
|
+
export type SessionMessagesResponse = Array<SessionMessagesResponse.SessionMessagesResponseItem>;
|
|
395
|
+
|
|
396
|
+
export namespace SessionMessagesResponse {
|
|
397
|
+
export interface SessionMessagesResponseItem {
|
|
398
|
+
info: SessionAPI.Message;
|
|
399
|
+
|
|
400
|
+
parts: Array<SessionAPI.Part>;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
315
403
|
|
|
316
404
|
export type SessionSummarizeResponse = boolean;
|
|
317
405
|
|
|
318
406
|
export interface SessionChatParams {
|
|
407
|
+
messageID: string;
|
|
408
|
+
|
|
409
|
+
mode: string;
|
|
410
|
+
|
|
319
411
|
modelID: string;
|
|
320
412
|
|
|
321
|
-
parts: Array<
|
|
413
|
+
parts: Array<FilePart | TextPart>;
|
|
322
414
|
|
|
323
415
|
providerID: string;
|
|
324
416
|
}
|
|
325
417
|
|
|
326
418
|
export interface SessionInitParams {
|
|
419
|
+
messageID: string;
|
|
420
|
+
|
|
327
421
|
modelID: string;
|
|
328
422
|
|
|
329
423
|
providerID: string;
|
|
@@ -338,10 +432,11 @@ export interface SessionSummarizeParams {
|
|
|
338
432
|
export declare namespace SessionResource {
|
|
339
433
|
export {
|
|
340
434
|
type AssistantMessage as AssistantMessage,
|
|
341
|
-
type AssistantMessagePart as AssistantMessagePart,
|
|
342
435
|
type FilePart as FilePart,
|
|
343
436
|
type Message as Message,
|
|
437
|
+
type Part as Part,
|
|
344
438
|
type Session as Session,
|
|
439
|
+
type StepFinishPart as StepFinishPart,
|
|
345
440
|
type StepStartPart as StepStartPart,
|
|
346
441
|
type TextPart as TextPart,
|
|
347
442
|
type ToolPart as ToolPart,
|
|
@@ -349,7 +444,7 @@ export declare namespace SessionResource {
|
|
|
349
444
|
type ToolStateError as ToolStateError,
|
|
350
445
|
type ToolStatePending as ToolStatePending,
|
|
351
446
|
type ToolStateRunning as ToolStateRunning,
|
|
352
|
-
type
|
|
447
|
+
type UserMessage as UserMessage,
|
|
353
448
|
type SessionListResponse as SessionListResponse,
|
|
354
449
|
type SessionDeleteResponse as SessionDeleteResponse,
|
|
355
450
|
type SessionAbortResponse as SessionAbortResponse,
|
package/src/resources/shared.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
export interface MessageAbortedError {
|
|
4
|
+
data: unknown;
|
|
5
|
+
|
|
6
|
+
name: 'MessageAbortedError';
|
|
7
|
+
}
|
|
8
|
+
|
|
3
9
|
export interface ProviderAuthError {
|
|
4
10
|
data: ProviderAuthError.Data;
|
|
5
11
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-alpha.
|
|
1
|
+
export const VERSION = '0.1.0-alpha.16'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0-alpha.
|
|
1
|
+
export declare const VERSION = "0.1.0-alpha.16";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0-alpha.
|
|
1
|
+
export declare const VERSION = "0.1.0-alpha.16";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
|
-
exports.VERSION = '0.1.0-alpha.
|
|
4
|
+
exports.VERSION = '0.1.0-alpha.16'; // x-release-please-version
|
|
5
5
|
//# sourceMappingURL=version.js.map
|
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-alpha.
|
|
1
|
+
export const VERSION = '0.1.0-alpha.16'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|