@opencode-ai/sdk 0.1.0-alpha.13 → 0.1.0-alpha.2
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 +0 -100
- package/LICENSE +4 -198
- package/README.md +0 -18
- package/client.d.mts +48 -19
- package/client.d.mts.map +1 -1
- package/client.d.ts +48 -19
- package/client.d.ts.map +1 -1
- package/client.js +48 -15
- package/client.js.map +1 -1
- package/client.mjs +48 -15
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +0 -10
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +0 -10
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts +0 -44
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +0 -44
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs.map +1 -1
- package/internal/tslib.js +6 -6
- package/internal/types.d.mts +6 -8
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +6 -8
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.js +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/log.js +1 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.d.mts.map +1 -1
- package/internal/utils/path.d.ts.map +1 -1
- package/internal/utils/path.js +5 -26
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs +5 -26
- package/internal/utils/path.mjs.map +1 -1
- package/package.json +3 -13
- package/resources/app-info.d.mts +31 -0
- package/resources/app-info.d.mts.map +1 -0
- package/resources/app-info.d.ts +31 -0
- package/resources/app-info.d.ts.map +1 -0
- package/resources/app-info.js +15 -0
- package/resources/app-info.js.map +1 -0
- package/resources/app-info.mjs +11 -0
- package/resources/app-info.mjs.map +1 -0
- package/resources/app-initialize.d.mts +14 -0
- package/resources/app-initialize.d.mts.map +1 -0
- package/resources/app-initialize.d.ts +14 -0
- package/resources/app-initialize.d.ts.map +1 -0
- package/resources/app-initialize.js +15 -0
- package/resources/app-initialize.js.map +1 -0
- package/resources/app-initialize.mjs +11 -0
- package/resources/app-initialize.mjs.map +1 -0
- package/resources/config-get.d.mts +236 -0
- package/resources/config-get.d.mts.map +1 -0
- package/resources/config-get.d.ts +236 -0
- package/resources/config-get.d.ts.map +1 -0
- package/resources/config-get.js +15 -0
- package/resources/config-get.js.map +1 -0
- package/resources/config-get.mjs +11 -0
- package/resources/config-get.mjs.map +1 -0
- package/resources/event.d.mts +27 -71
- package/resources/event.d.mts.map +1 -1
- package/resources/event.d.ts +27 -71
- package/resources/event.d.ts.map +1 -1
- package/resources/event.js +1 -1
- package/resources/event.js.map +1 -1
- package/resources/event.mjs +1 -1
- package/resources/event.mjs.map +1 -1
- package/resources/file-search.d.mts +17 -0
- package/resources/file-search.d.mts.map +1 -0
- package/resources/file-search.d.ts +17 -0
- package/resources/file-search.d.ts.map +1 -0
- package/resources/file-search.js +15 -0
- package/resources/file-search.js.map +1 -0
- package/resources/file-search.mjs +11 -0
- package/resources/file-search.mjs.map +1 -0
- package/resources/index.d.mts +16 -6
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +16 -6
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +33 -13
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +16 -6
- package/resources/index.mjs.map +1 -1
- package/resources/installation-info.d.mts +17 -0
- package/resources/installation-info.d.mts.map +1 -0
- package/resources/installation-info.d.ts +17 -0
- package/resources/installation-info.d.ts.map +1 -0
- package/resources/installation-info.js +15 -0
- package/resources/installation-info.js.map +1 -0
- package/resources/installation-info.mjs +11 -0
- package/resources/installation-info.mjs.map +1 -0
- package/resources/path-get.d.mts +19 -0
- package/resources/path-get.d.mts.map +1 -0
- package/resources/path-get.d.ts +19 -0
- package/resources/path-get.d.ts.map +1 -0
- package/resources/path-get.js +15 -0
- package/resources/path-get.js.map +1 -0
- package/resources/path-get.mjs +11 -0
- package/resources/path-get.mjs.map +1 -0
- package/resources/provider-list.d.mts +58 -0
- package/resources/provider-list.d.mts.map +1 -0
- package/resources/provider-list.d.ts +58 -0
- package/resources/provider-list.d.ts.map +1 -0
- package/resources/provider-list.js +15 -0
- package/resources/provider-list.js.map +1 -0
- package/resources/provider-list.mjs +11 -0
- package/resources/provider-list.mjs.map +1 -0
- package/resources/session-abort.d.mts +17 -0
- package/resources/session-abort.d.mts.map +1 -0
- package/resources/session-abort.d.ts +17 -0
- package/resources/session-abort.d.ts.map +1 -0
- package/resources/session-abort.js +15 -0
- package/resources/session-abort.js.map +1 -0
- package/resources/session-abort.mjs +11 -0
- package/resources/session-abort.mjs.map +1 -0
- package/resources/session-chat.d.mts +160 -0
- package/resources/session-chat.d.mts.map +1 -0
- package/resources/session-chat.d.ts +160 -0
- package/resources/session-chat.d.ts.map +1 -0
- package/resources/session-chat.js +15 -0
- package/resources/session-chat.js.map +1 -0
- package/resources/session-chat.mjs +11 -0
- package/resources/session-chat.mjs.map +1 -0
- package/resources/session-create.d.mts +30 -0
- package/resources/session-create.d.mts.map +1 -0
- package/resources/session-create.d.ts +30 -0
- package/resources/session-create.d.ts.map +1 -0
- package/resources/session-create.js +15 -0
- package/resources/session-create.js.map +1 -0
- package/resources/session-create.mjs +11 -0
- package/resources/session-create.mjs.map +1 -0
- package/resources/session-initialize.d.mts +19 -0
- package/resources/session-initialize.d.mts.map +1 -0
- package/resources/session-initialize.d.ts +19 -0
- package/resources/session-initialize.d.ts.map +1 -0
- package/resources/session-initialize.js +15 -0
- package/resources/session-initialize.js.map +1 -0
- package/resources/session-initialize.mjs +11 -0
- package/resources/session-initialize.mjs.map +1 -0
- package/resources/session-list.d.mts +15 -0
- package/resources/session-list.d.mts.map +1 -0
- package/resources/session-list.d.ts +15 -0
- package/resources/session-list.d.ts.map +1 -0
- package/resources/session-list.js +15 -0
- package/resources/session-list.js.map +1 -0
- package/resources/session-list.mjs +11 -0
- package/resources/session-list.mjs.map +1 -0
- package/resources/session-messages.d.mts +18 -0
- package/resources/session-messages.d.mts.map +1 -0
- package/resources/session-messages.d.ts +18 -0
- package/resources/session-messages.d.ts.map +1 -0
- package/resources/session-messages.js +15 -0
- package/resources/session-messages.js.map +1 -0
- package/resources/session-messages.mjs +11 -0
- package/resources/session-messages.mjs.map +1 -0
- package/resources/session-share.d.mts +17 -0
- package/resources/session-share.d.mts.map +1 -0
- package/resources/session-share.d.ts +17 -0
- package/resources/session-share.d.ts.map +1 -0
- package/resources/session-share.js +15 -0
- package/resources/session-share.js.map +1 -0
- package/resources/session-share.mjs +11 -0
- package/resources/session-share.mjs.map +1 -0
- package/resources/session-summarize.d.mts +19 -0
- package/resources/session-summarize.d.mts.map +1 -0
- package/resources/session-summarize.d.ts +19 -0
- package/resources/session-summarize.d.ts.map +1 -0
- package/resources/session-summarize.js +15 -0
- package/resources/session-summarize.js.map +1 -0
- package/resources/session-summarize.mjs +11 -0
- package/resources/session-summarize.mjs.map +1 -0
- package/resources/session-unshare.d.mts +17 -0
- package/resources/session-unshare.d.mts.map +1 -0
- package/resources/session-unshare.d.ts +17 -0
- package/resources/session-unshare.d.ts.map +1 -0
- package/resources/session-unshare.js +15 -0
- package/resources/session-unshare.js.map +1 -0
- package/resources/session-unshare.mjs +11 -0
- package/resources/session-unshare.mjs.map +1 -0
- package/src/client.ts +118 -98
- package/src/internal/parse.ts +0 -14
- package/src/internal/request-options.ts +0 -55
- package/src/internal/types.ts +6 -9
- package/src/internal/uploads.ts +1 -1
- package/src/internal/utils/log.ts +1 -1
- package/src/internal/utils/path.ts +7 -32
- package/src/resources/app-info.ts +46 -0
- package/src/resources/app-initialize.ts +20 -0
- package/src/resources/config-get.ts +294 -0
- package/src/resources/event.ts +37 -100
- package/src/resources/file-search.ts +27 -0
- package/src/resources/index.ts +33 -44
- package/src/resources/installation-info.ts +24 -0
- package/src/resources/path-get.ts +28 -0
- package/src/resources/provider-list.ts +80 -0
- package/src/resources/session-abort.ts +27 -0
- package/src/resources/session-chat.ts +250 -0
- package/src/resources/session-create.ts +44 -0
- package/src/resources/session-initialize.ts +34 -0
- package/src/resources/session-list.ts +21 -0
- package/src/resources/session-messages.ts +31 -0
- package/src/resources/session-share.ts +23 -0
- package/src/resources/session-summarize.ts +34 -0
- package/src/resources/session-unshare.ts +26 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/core/streaming.d.mts +0 -33
- package/core/streaming.d.mts.map +0 -1
- package/core/streaming.d.ts +0 -33
- package/core/streaming.d.ts.map +0 -1
- package/core/streaming.js +0 -263
- package/core/streaming.js.map +0 -1
- package/core/streaming.mjs +0 -258
- package/core/streaming.mjs.map +0 -1
- package/internal/decoders/line.d.mts +0 -17
- package/internal/decoders/line.d.mts.map +0 -1
- package/internal/decoders/line.d.ts +0 -17
- package/internal/decoders/line.d.ts.map +0 -1
- package/internal/decoders/line.js +0 -113
- package/internal/decoders/line.js.map +0 -1
- package/internal/decoders/line.mjs +0 -108
- package/internal/decoders/line.mjs.map +0 -1
- package/resources/app.d.mts +0 -37
- package/resources/app.d.mts.map +0 -1
- package/resources/app.d.ts +0 -37
- package/resources/app.d.ts.map +0 -1
- package/resources/app.js +0 -21
- package/resources/app.js.map +0 -1
- package/resources/app.mjs +0 -17
- package/resources/app.mjs.map +0 -1
- package/resources/config.d.mts +0 -314
- package/resources/config.d.mts.map +0 -1
- package/resources/config.d.ts +0 -314
- package/resources/config.d.ts.map +0 -1
- package/resources/config.js +0 -21
- package/resources/config.js.map +0 -1
- package/resources/config.mjs +0 -17
- package/resources/config.mjs.map +0 -1
- package/resources/file.d.mts +0 -33
- package/resources/file.d.mts.map +0 -1
- package/resources/file.d.ts +0 -33
- package/resources/file.d.ts.map +0 -1
- package/resources/file.js +0 -21
- package/resources/file.js.map +0 -1
- package/resources/file.mjs +0 -17
- package/resources/file.mjs.map +0 -1
- package/resources/find.d.mts +0 -60
- package/resources/find.d.mts.map +0 -1
- package/resources/find.d.ts +0 -60
- package/resources/find.d.ts.map +0 -1
- package/resources/find.js +0 -27
- package/resources/find.js.map +0 -1
- package/resources/find.mjs +0 -23
- package/resources/find.mjs.map +0 -1
- package/resources/session.d.mts +0 -211
- package/resources/session.d.mts.map +0 -1
- package/resources/session.d.ts +0 -211
- package/resources/session.d.ts.map +0 -1
- package/resources/session.js +0 -70
- package/resources/session.js.map +0 -1
- package/resources/session.mjs +0 -66
- package/resources/session.mjs.map +0 -1
- package/resources/shared.d.mts +0 -20
- package/resources/shared.d.mts.map +0 -1
- package/resources/shared.d.ts +0 -20
- package/resources/shared.d.ts.map +0 -1
- package/resources/shared.js +0 -4
- package/resources/shared.js.map +0 -1
- package/resources/shared.mjs +0 -3
- package/resources/shared.mjs.map +0 -1
- package/src/core/streaming.ts +0 -315
- package/src/internal/decoders/line.ts +0 -135
- package/src/resources/app.ts +0 -57
- package/src/resources/config.ts +0 -404
- package/src/resources/file.ts +0 -53
- package/src/resources/find.ts +0 -95
- package/src/resources/session.ts +0 -361
- package/src/resources/shared.ts +0 -27
- package/src/streaming.ts +0 -2
- package/streaming.d.mts +0 -2
- package/streaming.d.mts.map +0 -1
- package/streaming.d.ts +0 -2
- package/streaming.d.ts.map +0 -1
- package/streaming.js +0 -6
- package/streaming.js.map +0 -1
- package/streaming.mjs +0 -2
- package/streaming.mjs.map +0 -1
|
@@ -12,43 +12,25 @@ export function encodeURIPath(str: string) {
|
|
|
12
12
|
return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
16
|
-
|
|
17
15
|
export const createPathTagFunction = (pathEncoder = encodeURIPath) =>
|
|
18
16
|
function path(statics: readonly string[], ...params: readonly unknown[]): string {
|
|
19
17
|
// If there are no params, no processing is needed.
|
|
20
18
|
if (statics.length === 1) return statics[0]!;
|
|
21
19
|
|
|
22
20
|
let postPath = false;
|
|
23
|
-
const invalidSegments = [];
|
|
24
21
|
const path = statics.reduce((previousValue, currentValue, index) => {
|
|
25
22
|
if (/[?#]/.test(currentValue)) {
|
|
26
23
|
postPath = true;
|
|
27
24
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
index
|
|
32
|
-
|
|
33
|
-
(typeof value === 'object' &&
|
|
34
|
-
// handle values from other realms
|
|
35
|
-
value.toString ===
|
|
36
|
-
Object.getPrototypeOf(Object.getPrototypeOf((value as any).hasOwnProperty ?? EMPTY) ?? EMPTY)
|
|
37
|
-
?.toString))
|
|
38
|
-
) {
|
|
39
|
-
encoded = value + '';
|
|
40
|
-
invalidSegments.push({
|
|
41
|
-
start: previousValue.length + currentValue.length,
|
|
42
|
-
length: encoded.length,
|
|
43
|
-
error: `Value of type ${Object.prototype.toString
|
|
44
|
-
.call(value)
|
|
45
|
-
.slice(8, -1)} is not a valid path parameter`,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return previousValue + currentValue + (index === params.length ? '' : encoded);
|
|
25
|
+
return (
|
|
26
|
+
previousValue +
|
|
27
|
+
currentValue +
|
|
28
|
+
(index === params.length ? '' : (postPath ? encodeURIComponent : pathEncoder)(String(params[index])))
|
|
29
|
+
);
|
|
49
30
|
}, '');
|
|
50
31
|
|
|
51
32
|
const pathOnly = path.split(/[?#]/, 1)[0]!;
|
|
33
|
+
const invalidSegments = [];
|
|
52
34
|
const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
53
35
|
let match;
|
|
54
36
|
|
|
@@ -57,12 +39,9 @@ export const createPathTagFunction = (pathEncoder = encodeURIPath) =>
|
|
|
57
39
|
invalidSegments.push({
|
|
58
40
|
start: match.index,
|
|
59
41
|
length: match[0].length,
|
|
60
|
-
error: `Value "${match[0]}" can\'t be safely passed as a path parameter`,
|
|
61
42
|
});
|
|
62
43
|
}
|
|
63
44
|
|
|
64
|
-
invalidSegments.sort((a, b) => a.start - b.start);
|
|
65
|
-
|
|
66
45
|
if (invalidSegments.length > 0) {
|
|
67
46
|
let lastEnd = 0;
|
|
68
47
|
const underline = invalidSegments.reduce((acc, segment) => {
|
|
@@ -72,11 +51,7 @@ export const createPathTagFunction = (pathEncoder = encodeURIPath) =>
|
|
|
72
51
|
return acc + spaces + arrows;
|
|
73
52
|
}, '');
|
|
74
53
|
|
|
75
|
-
throw new OpencodeError(
|
|
76
|
-
`Path parameters result in path with invalid segments:\n${invalidSegments
|
|
77
|
-
.map((e) => e.error)
|
|
78
|
-
.join('\n')}\n${path}\n${underline}`,
|
|
79
|
-
);
|
|
54
|
+
throw new OpencodeError(`Path parameters result in path with invalid segments:\n${path}\n${underline}`);
|
|
80
55
|
}
|
|
81
56
|
|
|
82
57
|
return path;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class AppInfo extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Get app info
|
|
10
|
+
*/
|
|
11
|
+
create(options?: RequestOptions): APIPromise<AppInfoCreateResponse> {
|
|
12
|
+
return this._client.post('/app_info', options);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface AppInfoCreateResponse {
|
|
17
|
+
git: boolean;
|
|
18
|
+
|
|
19
|
+
path: AppInfoCreateResponse.Path;
|
|
20
|
+
|
|
21
|
+
time: AppInfoCreateResponse.Time;
|
|
22
|
+
|
|
23
|
+
user: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export namespace AppInfoCreateResponse {
|
|
27
|
+
export interface Path {
|
|
28
|
+
config: string;
|
|
29
|
+
|
|
30
|
+
cwd: string;
|
|
31
|
+
|
|
32
|
+
data: string;
|
|
33
|
+
|
|
34
|
+
root: string;
|
|
35
|
+
|
|
36
|
+
state: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface Time {
|
|
40
|
+
initialized?: number;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export declare namespace AppInfo {
|
|
45
|
+
export { type AppInfoCreateResponse as AppInfoCreateResponse };
|
|
46
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class AppInitialize extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Initialize the app
|
|
10
|
+
*/
|
|
11
|
+
initialize(options?: RequestOptions): APIPromise<AppInitializeInitializeResponse> {
|
|
12
|
+
return this._client.post('/app_initialize', options);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type AppInitializeInitializeResponse = boolean;
|
|
17
|
+
|
|
18
|
+
export declare namespace AppInitialize {
|
|
19
|
+
export { type AppInitializeInitializeResponse as AppInitializeInitializeResponse };
|
|
20
|
+
}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class ConfigGet extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Get config info
|
|
10
|
+
*/
|
|
11
|
+
retrieve(options?: RequestOptions): APIPromise<ConfigGetRetrieveResponse> {
|
|
12
|
+
return this._client.post('/config_get', options);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ConfigGetRetrieveResponse {
|
|
17
|
+
/**
|
|
18
|
+
* JSON schema reference for configuration validation
|
|
19
|
+
*/
|
|
20
|
+
$schema?: string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Share newly created sessions automatically
|
|
24
|
+
*/
|
|
25
|
+
autoshare?: boolean;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Automatically update to the latest version
|
|
29
|
+
*/
|
|
30
|
+
autoupdate?: boolean;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Disable providers that are loaded automatically
|
|
34
|
+
*/
|
|
35
|
+
disabled_providers?: Array<string>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Custom keybind configurations
|
|
39
|
+
*/
|
|
40
|
+
keybinds?: ConfigGetRetrieveResponse.Keybinds;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* MCP (Model Context Protocol) server configurations
|
|
44
|
+
*/
|
|
45
|
+
mcp?: {
|
|
46
|
+
[key: string]: ConfigGetRetrieveResponse.ConfigMcpLocal | ConfigGetRetrieveResponse.ConfigMcpRemote;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Model to use in the format of provider/model, eg anthropic/claude-2
|
|
51
|
+
*/
|
|
52
|
+
model?: string;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Custom provider configurations and model overrides
|
|
56
|
+
*/
|
|
57
|
+
provider?: { [key: string]: ConfigGetRetrieveResponse.Provider };
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Theme name to use for the interface
|
|
61
|
+
*/
|
|
62
|
+
theme?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export namespace ConfigGetRetrieveResponse {
|
|
66
|
+
/**
|
|
67
|
+
* Custom keybind configurations
|
|
68
|
+
*/
|
|
69
|
+
export interface Keybinds {
|
|
70
|
+
/**
|
|
71
|
+
* Exit the application
|
|
72
|
+
*/
|
|
73
|
+
app_exit?: string;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Open external editor
|
|
77
|
+
*/
|
|
78
|
+
editor_open?: string;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Show help dialog
|
|
82
|
+
*/
|
|
83
|
+
help?: string;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Navigate to next history item
|
|
87
|
+
*/
|
|
88
|
+
history_next?: string;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Navigate to previous history item
|
|
92
|
+
*/
|
|
93
|
+
history_previous?: string;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Clear input field
|
|
97
|
+
*/
|
|
98
|
+
input_clear?: string;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Insert newline in input
|
|
102
|
+
*/
|
|
103
|
+
input_newline?: string;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Paste from clipboard
|
|
107
|
+
*/
|
|
108
|
+
input_paste?: string;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Submit input
|
|
112
|
+
*/
|
|
113
|
+
input_submit?: string;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Leader key for keybind combinations
|
|
117
|
+
*/
|
|
118
|
+
leader?: string;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Navigate to first message
|
|
122
|
+
*/
|
|
123
|
+
messages_first?: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Scroll messages down by half page
|
|
127
|
+
*/
|
|
128
|
+
messages_half_page_down?: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Scroll messages up by half page
|
|
132
|
+
*/
|
|
133
|
+
messages_half_page_up?: string;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Navigate to last message
|
|
137
|
+
*/
|
|
138
|
+
messages_last?: string;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Navigate to next message
|
|
142
|
+
*/
|
|
143
|
+
messages_next?: string;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Scroll messages down by one page
|
|
147
|
+
*/
|
|
148
|
+
messages_page_down?: string;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Scroll messages up by one page
|
|
152
|
+
*/
|
|
153
|
+
messages_page_up?: string;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Navigate to previous message
|
|
157
|
+
*/
|
|
158
|
+
messages_previous?: string;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* List available models
|
|
162
|
+
*/
|
|
163
|
+
model_list?: string;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Initialize project configuration
|
|
167
|
+
*/
|
|
168
|
+
project_init?: string;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Toggle compact mode for session
|
|
172
|
+
*/
|
|
173
|
+
session_compact?: string;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Interrupt current session
|
|
177
|
+
*/
|
|
178
|
+
session_interrupt?: string;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* List all sessions
|
|
182
|
+
*/
|
|
183
|
+
session_list?: string;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Create a new session
|
|
187
|
+
*/
|
|
188
|
+
session_new?: string;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Share current session
|
|
192
|
+
*/
|
|
193
|
+
session_share?: string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* List available themes
|
|
197
|
+
*/
|
|
198
|
+
theme_list?: string;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Show tool details
|
|
202
|
+
*/
|
|
203
|
+
tool_details?: string;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export interface ConfigMcpLocal {
|
|
207
|
+
/**
|
|
208
|
+
* Command and arguments to run the MCP server
|
|
209
|
+
*/
|
|
210
|
+
command: Array<string>;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Type of MCP server connection
|
|
214
|
+
*/
|
|
215
|
+
type: 'local';
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Environment variables to set when running the MCP server
|
|
219
|
+
*/
|
|
220
|
+
environment?: { [key: string]: string };
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface ConfigMcpRemote {
|
|
224
|
+
/**
|
|
225
|
+
* Type of MCP server connection
|
|
226
|
+
*/
|
|
227
|
+
type: 'remote';
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* URL of the remote MCP server
|
|
231
|
+
*/
|
|
232
|
+
url: string;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export interface Provider {
|
|
236
|
+
models: { [key: string]: Provider.Models };
|
|
237
|
+
|
|
238
|
+
id?: string;
|
|
239
|
+
|
|
240
|
+
api?: string;
|
|
241
|
+
|
|
242
|
+
env?: Array<string>;
|
|
243
|
+
|
|
244
|
+
name?: string;
|
|
245
|
+
|
|
246
|
+
npm?: string;
|
|
247
|
+
|
|
248
|
+
options?: { [key: string]: unknown };
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export namespace Provider {
|
|
252
|
+
export interface Models {
|
|
253
|
+
id?: string;
|
|
254
|
+
|
|
255
|
+
attachment?: boolean;
|
|
256
|
+
|
|
257
|
+
cost?: Models.Cost;
|
|
258
|
+
|
|
259
|
+
limit?: Models.Limit;
|
|
260
|
+
|
|
261
|
+
name?: string;
|
|
262
|
+
|
|
263
|
+
options?: { [key: string]: unknown };
|
|
264
|
+
|
|
265
|
+
reasoning?: boolean;
|
|
266
|
+
|
|
267
|
+
temperature?: boolean;
|
|
268
|
+
|
|
269
|
+
tool_call?: boolean;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export namespace Models {
|
|
273
|
+
export interface Cost {
|
|
274
|
+
input: number;
|
|
275
|
+
|
|
276
|
+
output: number;
|
|
277
|
+
|
|
278
|
+
cache_read?: number;
|
|
279
|
+
|
|
280
|
+
cache_write?: number;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export interface Limit {
|
|
284
|
+
context: number;
|
|
285
|
+
|
|
286
|
+
output: number;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export declare namespace ConfigGet {
|
|
293
|
+
export { type ConfigGetRetrieveResponse as ConfigGetRetrieveResponse };
|
|
294
|
+
}
|
package/src/resources/event.ts
CHANGED
|
@@ -1,36 +1,57 @@
|
|
|
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
|
|
5
|
-
import * as
|
|
4
|
+
import * as SessionChatAPI from './session-chat';
|
|
5
|
+
import * as SessionCreateAPI from './session-create';
|
|
6
6
|
import { APIPromise } from '../core/api-promise';
|
|
7
|
-
import { Stream } from '../core/streaming';
|
|
8
7
|
import { RequestOptions } from '../internal/request-options';
|
|
9
8
|
|
|
10
9
|
export class Event extends APIResource {
|
|
11
10
|
/**
|
|
12
11
|
* Get events
|
|
13
12
|
*/
|
|
14
|
-
list(options?: RequestOptions): APIPromise<
|
|
15
|
-
return this._client.get('/event',
|
|
13
|
+
list(options?: RequestOptions): APIPromise<EventListResponse> {
|
|
14
|
+
return this._client.get('/event', options);
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
export type EventListResponse =
|
|
20
|
-
| EventListResponse.EventLspClientDiagnostics
|
|
21
|
-
| EventListResponse.EventPermissionUpdated
|
|
22
|
-
| EventListResponse.EventFileEdited
|
|
23
19
|
| EventListResponse.EventStorageWrite
|
|
24
20
|
| EventListResponse.EventInstallationUpdated
|
|
21
|
+
| EventListResponse.EventLspClientDiagnostics
|
|
22
|
+
| EventListResponse.EventPermissionUpdated
|
|
25
23
|
| EventListResponse.EventMessageUpdated
|
|
26
24
|
| EventListResponse.EventMessagePartUpdated
|
|
27
25
|
| EventListResponse.EventSessionUpdated
|
|
28
|
-
| EventListResponse.
|
|
29
|
-
| EventListResponse.EventSessionIdle
|
|
30
|
-
| EventListResponse.EventSessionError
|
|
31
|
-
| EventListResponse.EventFileWatcherUpdated;
|
|
26
|
+
| EventListResponse.EventSessionError;
|
|
32
27
|
|
|
33
28
|
export namespace EventListResponse {
|
|
29
|
+
export interface EventStorageWrite {
|
|
30
|
+
properties: EventStorageWrite.Properties;
|
|
31
|
+
|
|
32
|
+
type: 'storage.write';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export namespace EventStorageWrite {
|
|
36
|
+
export interface Properties {
|
|
37
|
+
key: string;
|
|
38
|
+
|
|
39
|
+
content?: unknown;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface EventInstallationUpdated {
|
|
44
|
+
properties: EventInstallationUpdated.Properties;
|
|
45
|
+
|
|
46
|
+
type: 'installation.updated';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export namespace EventInstallationUpdated {
|
|
50
|
+
export interface Properties {
|
|
51
|
+
version: string;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
34
55
|
export interface EventLspClientDiagnostics {
|
|
35
56
|
properties: EventLspClientDiagnostics.Properties;
|
|
36
57
|
|
|
@@ -71,44 +92,6 @@ export namespace EventListResponse {
|
|
|
71
92
|
}
|
|
72
93
|
}
|
|
73
94
|
|
|
74
|
-
export interface EventFileEdited {
|
|
75
|
-
properties: EventFileEdited.Properties;
|
|
76
|
-
|
|
77
|
-
type: 'file.edited';
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export namespace EventFileEdited {
|
|
81
|
-
export interface Properties {
|
|
82
|
-
file: string;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface EventStorageWrite {
|
|
87
|
-
properties: EventStorageWrite.Properties;
|
|
88
|
-
|
|
89
|
-
type: 'storage.write';
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export namespace EventStorageWrite {
|
|
93
|
-
export interface Properties {
|
|
94
|
-
key: string;
|
|
95
|
-
|
|
96
|
-
content?: unknown;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export interface EventInstallationUpdated {
|
|
101
|
-
properties: EventInstallationUpdated.Properties;
|
|
102
|
-
|
|
103
|
-
type: 'installation.updated';
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export namespace EventInstallationUpdated {
|
|
107
|
-
export interface Properties {
|
|
108
|
-
version: string;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
95
|
export interface EventMessageUpdated {
|
|
113
96
|
properties: EventMessageUpdated.Properties;
|
|
114
97
|
|
|
@@ -117,7 +100,7 @@ export namespace EventListResponse {
|
|
|
117
100
|
|
|
118
101
|
export namespace EventMessageUpdated {
|
|
119
102
|
export interface Properties {
|
|
120
|
-
info:
|
|
103
|
+
info: SessionChatAPI.MessageInfo;
|
|
121
104
|
}
|
|
122
105
|
}
|
|
123
106
|
|
|
@@ -131,7 +114,7 @@ export namespace EventListResponse {
|
|
|
131
114
|
export interface Properties {
|
|
132
115
|
messageID: string;
|
|
133
116
|
|
|
134
|
-
part:
|
|
117
|
+
part: SessionChatAPI.MessagePart;
|
|
135
118
|
|
|
136
119
|
sessionID: string;
|
|
137
120
|
}
|
|
@@ -145,31 +128,7 @@ export namespace EventListResponse {
|
|
|
145
128
|
|
|
146
129
|
export namespace EventSessionUpdated {
|
|
147
130
|
export interface Properties {
|
|
148
|
-
info:
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export interface EventSessionDeleted {
|
|
153
|
-
properties: EventSessionDeleted.Properties;
|
|
154
|
-
|
|
155
|
-
type: 'session.deleted';
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
export namespace EventSessionDeleted {
|
|
159
|
-
export interface Properties {
|
|
160
|
-
info: SessionAPI.Session;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export interface EventSessionIdle {
|
|
165
|
-
properties: EventSessionIdle.Properties;
|
|
166
|
-
|
|
167
|
-
type: 'session.idle';
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export namespace EventSessionIdle {
|
|
171
|
-
export interface Properties {
|
|
172
|
-
sessionID: string;
|
|
131
|
+
info: SessionCreateAPI.SessionInfo;
|
|
173
132
|
}
|
|
174
133
|
}
|
|
175
134
|
|
|
@@ -181,29 +140,7 @@ export namespace EventListResponse {
|
|
|
181
140
|
|
|
182
141
|
export namespace EventSessionError {
|
|
183
142
|
export interface Properties {
|
|
184
|
-
error?:
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export namespace Properties {
|
|
188
|
-
export interface MessageOutputLengthError {
|
|
189
|
-
data: unknown;
|
|
190
|
-
|
|
191
|
-
name: 'MessageOutputLengthError';
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
export interface EventFileWatcherUpdated {
|
|
197
|
-
properties: EventFileWatcherUpdated.Properties;
|
|
198
|
-
|
|
199
|
-
type: 'file.watcher.updated';
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export namespace EventFileWatcherUpdated {
|
|
203
|
-
export interface Properties {
|
|
204
|
-
event: 'rename' | 'change';
|
|
205
|
-
|
|
206
|
-
file: string;
|
|
143
|
+
error?: SessionChatAPI.ProviderAuthError | SessionChatAPI.UnknownError;
|
|
207
144
|
}
|
|
208
145
|
}
|
|
209
146
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class FileSearch extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Search for files
|
|
10
|
+
*/
|
|
11
|
+
search(body: FileSearchSearchParams, options?: RequestOptions): APIPromise<FileSearchSearchResponse> {
|
|
12
|
+
return this._client.post('/file_search', { body, ...options });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type FileSearchSearchResponse = Array<string>;
|
|
17
|
+
|
|
18
|
+
export interface FileSearchSearchParams {
|
|
19
|
+
query: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export declare namespace FileSearch {
|
|
23
|
+
export {
|
|
24
|
+
type FileSearchSearchResponse as FileSearchSearchResponse,
|
|
25
|
+
type FileSearchSearchParams as FileSearchSearchParams,
|
|
26
|
+
};
|
|
27
|
+
}
|