@opencode-ai/sdk 0.1.0-alpha.18 → 0.1.0-alpha.20
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 +17 -0
- package/client.d.mts +4 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +4 -4
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/app.d.mts +47 -1
- package/resources/app.d.mts.map +1 -1
- package/resources/app.d.ts +47 -1
- package/resources/app.d.ts.map +1 -1
- package/resources/app.js +6 -0
- package/resources/app.js.map +1 -1
- package/resources/app.mjs +6 -0
- package/resources/app.mjs.map +1 -1
- package/resources/config.d.mts +30 -90
- package/resources/config.d.mts.map +1 -1
- package/resources/config.d.ts +30 -90
- package/resources/config.d.ts.map +1 -1
- package/resources/config.js +0 -6
- package/resources/config.js.map +1 -1
- package/resources/config.mjs +0 -6
- package/resources/config.mjs.map +1 -1
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +16 -12
- package/src/resources/app.ts +70 -0
- package/src/resources/config.ts +36 -119
- package/src/resources/index.ts +8 -6
- 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/app.ts
CHANGED
|
@@ -32,6 +32,13 @@ export class AppResource extends APIResource {
|
|
|
32
32
|
modes(options?: RequestOptions): APIPromise<AppModesResponse> {
|
|
33
33
|
return this._client.get('/mode', options);
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* List all providers
|
|
38
|
+
*/
|
|
39
|
+
providers(options?: RequestOptions): APIPromise<AppProvidersResponse> {
|
|
40
|
+
return this._client.get('/config/providers', options);
|
|
41
|
+
}
|
|
35
42
|
}
|
|
36
43
|
|
|
37
44
|
export interface App {
|
|
@@ -85,12 +92,72 @@ export namespace Mode {
|
|
|
85
92
|
}
|
|
86
93
|
}
|
|
87
94
|
|
|
95
|
+
export interface Model {
|
|
96
|
+
id: string;
|
|
97
|
+
|
|
98
|
+
attachment: boolean;
|
|
99
|
+
|
|
100
|
+
cost: Model.Cost;
|
|
101
|
+
|
|
102
|
+
limit: Model.Limit;
|
|
103
|
+
|
|
104
|
+
name: string;
|
|
105
|
+
|
|
106
|
+
options: { [key: string]: unknown };
|
|
107
|
+
|
|
108
|
+
reasoning: boolean;
|
|
109
|
+
|
|
110
|
+
release_date: string;
|
|
111
|
+
|
|
112
|
+
temperature: boolean;
|
|
113
|
+
|
|
114
|
+
tool_call: boolean;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export namespace Model {
|
|
118
|
+
export interface Cost {
|
|
119
|
+
input: number;
|
|
120
|
+
|
|
121
|
+
output: number;
|
|
122
|
+
|
|
123
|
+
cache_read?: number;
|
|
124
|
+
|
|
125
|
+
cache_write?: number;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface Limit {
|
|
129
|
+
context: number;
|
|
130
|
+
|
|
131
|
+
output: number;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface Provider {
|
|
136
|
+
id: string;
|
|
137
|
+
|
|
138
|
+
env: Array<string>;
|
|
139
|
+
|
|
140
|
+
models: { [key: string]: Model };
|
|
141
|
+
|
|
142
|
+
name: string;
|
|
143
|
+
|
|
144
|
+
api?: string;
|
|
145
|
+
|
|
146
|
+
npm?: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
88
149
|
export type AppInitResponse = boolean;
|
|
89
150
|
|
|
90
151
|
export type AppLogResponse = boolean;
|
|
91
152
|
|
|
92
153
|
export type AppModesResponse = Array<Mode>;
|
|
93
154
|
|
|
155
|
+
export interface AppProvidersResponse {
|
|
156
|
+
default: { [key: string]: string };
|
|
157
|
+
|
|
158
|
+
providers: Array<Provider>;
|
|
159
|
+
}
|
|
160
|
+
|
|
94
161
|
export interface AppLogParams {
|
|
95
162
|
/**
|
|
96
163
|
* Log level
|
|
@@ -118,9 +185,12 @@ export declare namespace AppResource {
|
|
|
118
185
|
type App as App,
|
|
119
186
|
type LogLevel as LogLevel,
|
|
120
187
|
type Mode as Mode,
|
|
188
|
+
type Model as Model,
|
|
189
|
+
type Provider as Provider,
|
|
121
190
|
type AppInitResponse as AppInitResponse,
|
|
122
191
|
type AppLogResponse as AppLogResponse,
|
|
123
192
|
type AppModesResponse as AppModesResponse,
|
|
193
|
+
type AppProvidersResponse as AppProvidersResponse,
|
|
124
194
|
type AppLogParams as AppLogParams,
|
|
125
195
|
};
|
|
126
196
|
}
|
package/src/resources/config.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as ConfigAPI from './config';
|
|
4
5
|
import * as AppAPI from './app';
|
|
5
6
|
import { APIPromise } from '../core/api-promise';
|
|
6
7
|
import { RequestOptions } from '../internal/request-options';
|
|
@@ -12,13 +13,6 @@ export class ConfigResource extends APIResource {
|
|
|
12
13
|
get(options?: RequestOptions): APIPromise<Config> {
|
|
13
14
|
return this._client.get('/config', options);
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* List all providers
|
|
18
|
-
*/
|
|
19
|
-
providers(options?: RequestOptions): APIPromise<ConfigProvidersResponse> {
|
|
20
|
-
return this._client.get('/config/providers', options);
|
|
21
|
-
}
|
|
22
16
|
}
|
|
23
17
|
|
|
24
18
|
export interface Config {
|
|
@@ -53,7 +47,12 @@ export interface Config {
|
|
|
53
47
|
/**
|
|
54
48
|
* Custom keybind configurations
|
|
55
49
|
*/
|
|
56
|
-
keybinds?:
|
|
50
|
+
keybinds?: KeybindsConfig;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Layout to use for the TUI
|
|
54
|
+
*/
|
|
55
|
+
layout?: LayoutConfig;
|
|
57
56
|
|
|
58
57
|
/**
|
|
59
58
|
* Minimum log level to write to log files
|
|
@@ -63,8 +62,11 @@ export interface Config {
|
|
|
63
62
|
/**
|
|
64
63
|
* MCP (Model Context Protocol) server configurations
|
|
65
64
|
*/
|
|
66
|
-
mcp?: { [key: string]:
|
|
65
|
+
mcp?: { [key: string]: McpLocalConfig | McpRemoteConfig };
|
|
67
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Modes configuration, see https://opencode.ai/docs/modes
|
|
69
|
+
*/
|
|
68
70
|
mode?: Config.Mode;
|
|
69
71
|
|
|
70
72
|
/**
|
|
@@ -121,54 +123,15 @@ export namespace Config {
|
|
|
121
123
|
}
|
|
122
124
|
}
|
|
123
125
|
|
|
126
|
+
/**
|
|
127
|
+
* Modes configuration, see https://opencode.ai/docs/modes
|
|
128
|
+
*/
|
|
124
129
|
export interface Mode {
|
|
125
|
-
build?:
|
|
126
|
-
|
|
127
|
-
plan?: Mode.Plan;
|
|
128
|
-
|
|
129
|
-
[k: string]: Mode.ModeConfig | undefined;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export namespace Mode {
|
|
133
|
-
export interface Build {
|
|
134
|
-
model?: string;
|
|
135
|
-
|
|
136
|
-
prompt?: string;
|
|
137
|
-
|
|
138
|
-
tools?: { [key: string]: boolean };
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export interface Plan {
|
|
142
|
-
model?: string;
|
|
143
|
-
|
|
144
|
-
prompt?: string;
|
|
145
|
-
|
|
146
|
-
tools?: { [key: string]: boolean };
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export interface ModeConfig {
|
|
150
|
-
model?: string;
|
|
151
|
-
|
|
152
|
-
prompt?: string;
|
|
153
|
-
|
|
154
|
-
tools?: { [key: string]: boolean };
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
export interface ModeConfig {
|
|
159
|
-
model?: string;
|
|
160
|
-
|
|
161
|
-
prompt?: string;
|
|
162
|
-
|
|
163
|
-
tools?: { [key: string]: boolean };
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export interface ModeConfig {
|
|
167
|
-
model?: string;
|
|
130
|
+
build?: ConfigAPI.ModeConfig;
|
|
168
131
|
|
|
169
|
-
|
|
132
|
+
plan?: ConfigAPI.ModeConfig;
|
|
170
133
|
|
|
171
|
-
|
|
134
|
+
[k: string]: ConfigAPI.ModeConfig | undefined;
|
|
172
135
|
}
|
|
173
136
|
|
|
174
137
|
export interface Provider {
|
|
@@ -230,7 +193,7 @@ export namespace Config {
|
|
|
230
193
|
}
|
|
231
194
|
}
|
|
232
195
|
|
|
233
|
-
export interface
|
|
196
|
+
export interface KeybindsConfig {
|
|
234
197
|
/**
|
|
235
198
|
* Exit the application
|
|
236
199
|
*/
|
|
@@ -361,6 +324,11 @@ export interface Keybinds {
|
|
|
361
324
|
*/
|
|
362
325
|
session_compact: string;
|
|
363
326
|
|
|
327
|
+
/**
|
|
328
|
+
* Export session to editor
|
|
329
|
+
*/
|
|
330
|
+
session_export: string;
|
|
331
|
+
|
|
364
332
|
/**
|
|
365
333
|
* Interrupt current session
|
|
366
334
|
*/
|
|
@@ -402,7 +370,9 @@ export interface Keybinds {
|
|
|
402
370
|
tool_details: string;
|
|
403
371
|
}
|
|
404
372
|
|
|
405
|
-
export
|
|
373
|
+
export type LayoutConfig = 'auto' | 'stretch';
|
|
374
|
+
|
|
375
|
+
export interface McpLocalConfig {
|
|
406
376
|
/**
|
|
407
377
|
* Command and arguments to run the MCP server
|
|
408
378
|
*/
|
|
@@ -424,7 +394,7 @@ export interface McpLocal {
|
|
|
424
394
|
environment?: { [key: string]: string };
|
|
425
395
|
}
|
|
426
396
|
|
|
427
|
-
export interface
|
|
397
|
+
export interface McpRemoteConfig {
|
|
428
398
|
/**
|
|
429
399
|
* Type of MCP server connection
|
|
430
400
|
*/
|
|
@@ -441,74 +411,21 @@ export interface McpRemote {
|
|
|
441
411
|
enabled?: boolean;
|
|
442
412
|
}
|
|
443
413
|
|
|
444
|
-
export interface
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
attachment: boolean;
|
|
448
|
-
|
|
449
|
-
cost: Model.Cost;
|
|
450
|
-
|
|
451
|
-
limit: Model.Limit;
|
|
452
|
-
|
|
453
|
-
name: string;
|
|
454
|
-
|
|
455
|
-
options: { [key: string]: unknown };
|
|
456
|
-
|
|
457
|
-
reasoning: boolean;
|
|
458
|
-
|
|
459
|
-
release_date: string;
|
|
460
|
-
|
|
461
|
-
temperature: boolean;
|
|
462
|
-
|
|
463
|
-
tool_call: boolean;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
export namespace Model {
|
|
467
|
-
export interface Cost {
|
|
468
|
-
input: number;
|
|
469
|
-
|
|
470
|
-
output: number;
|
|
471
|
-
|
|
472
|
-
cache_read?: number;
|
|
473
|
-
|
|
474
|
-
cache_write?: number;
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
export interface Limit {
|
|
478
|
-
context: number;
|
|
479
|
-
|
|
480
|
-
output: number;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
export interface Provider {
|
|
485
|
-
id: string;
|
|
486
|
-
|
|
487
|
-
env: Array<string>;
|
|
488
|
-
|
|
489
|
-
models: { [key: string]: Model };
|
|
490
|
-
|
|
491
|
-
name: string;
|
|
492
|
-
|
|
493
|
-
api?: string;
|
|
494
|
-
|
|
495
|
-
npm?: string;
|
|
496
|
-
}
|
|
414
|
+
export interface ModeConfig {
|
|
415
|
+
model?: string;
|
|
497
416
|
|
|
498
|
-
|
|
499
|
-
default: { [key: string]: string };
|
|
417
|
+
prompt?: string;
|
|
500
418
|
|
|
501
|
-
|
|
419
|
+
tools?: { [key: string]: boolean };
|
|
502
420
|
}
|
|
503
421
|
|
|
504
422
|
export declare namespace ConfigResource {
|
|
505
423
|
export {
|
|
506
424
|
type Config as Config,
|
|
507
|
-
type
|
|
508
|
-
type
|
|
509
|
-
type
|
|
510
|
-
type
|
|
511
|
-
type
|
|
512
|
-
type ConfigProvidersResponse as ConfigProvidersResponse,
|
|
425
|
+
type KeybindsConfig as KeybindsConfig,
|
|
426
|
+
type LayoutConfig as LayoutConfig,
|
|
427
|
+
type McpLocalConfig as McpLocalConfig,
|
|
428
|
+
type McpRemoteConfig as McpRemoteConfig,
|
|
429
|
+
type ModeConfig as ModeConfig,
|
|
513
430
|
};
|
|
514
431
|
}
|
package/src/resources/index.ts
CHANGED
|
@@ -6,20 +6,22 @@ export {
|
|
|
6
6
|
type App,
|
|
7
7
|
type LogLevel,
|
|
8
8
|
type Mode,
|
|
9
|
+
type Model,
|
|
10
|
+
type Provider,
|
|
9
11
|
type AppInitResponse,
|
|
10
12
|
type AppLogResponse,
|
|
11
13
|
type AppModesResponse,
|
|
14
|
+
type AppProvidersResponse,
|
|
12
15
|
type AppLogParams,
|
|
13
16
|
} from './app';
|
|
14
17
|
export {
|
|
15
18
|
ConfigResource,
|
|
16
19
|
type Config,
|
|
17
|
-
type
|
|
18
|
-
type
|
|
19
|
-
type
|
|
20
|
-
type
|
|
21
|
-
type
|
|
22
|
-
type ConfigProvidersResponse,
|
|
20
|
+
type KeybindsConfig,
|
|
21
|
+
type LayoutConfig,
|
|
22
|
+
type McpLocalConfig,
|
|
23
|
+
type McpRemoteConfig,
|
|
24
|
+
type ModeConfig,
|
|
23
25
|
} from './config';
|
|
24
26
|
export { Event, type EventListResponse } from './event';
|
|
25
27
|
export {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-alpha.
|
|
1
|
+
export const VERSION = '0.1.0-alpha.20'; // 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.20";
|
|
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.20";
|
|
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.20'; // 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.20'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|