@opencode-ai/sdk 0.0.0-fix-build-202511160139 → 0.0.0-next-202606261956
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.d.ts +4 -2
- package/dist/client.js +41 -6
- package/dist/error-interceptor.d.ts +15 -0
- package/dist/error-interceptor.js +43 -0
- package/dist/gen/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/gen/core/queryKeySerializer.gen.js +93 -0
- package/dist/gen/core/serverSentEvents.gen.js +1 -1
- package/dist/gen/sdk.gen.d.ts +103 -7
- package/dist/gen/sdk.gen.js +235 -15
- package/dist/gen/types.gen.d.ts +930 -130
- package/dist/process.d.ts +3 -0
- package/dist/process.js +33 -0
- package/dist/server.js +28 -14
- package/dist/v2/client.d.ts +9 -0
- package/dist/v2/client.js +80 -0
- package/dist/v2/data.d.ts +9 -0
- package/dist/v2/data.js +22 -0
- package/dist/v2/gen/client/client.gen.d.ts +2 -0
- package/dist/v2/gen/client/client.gen.js +232 -0
- package/dist/v2/gen/client/index.d.ts +8 -0
- package/dist/v2/gen/client/index.js +6 -0
- package/dist/v2/gen/client/types.gen.d.ts +117 -0
- package/dist/v2/gen/client/types.gen.js +2 -0
- package/dist/v2/gen/client/utils.gen.d.ts +33 -0
- package/dist/v2/gen/client/utils.gen.js +226 -0
- package/dist/v2/gen/client.gen.d.ts +12 -0
- package/dist/v2/gen/client.gen.js +3 -0
- package/dist/v2/gen/core/auth.gen.d.ts +18 -0
- package/dist/v2/gen/core/auth.gen.js +14 -0
- package/dist/v2/gen/core/bodySerializer.gen.d.ts +25 -0
- package/dist/v2/gen/core/bodySerializer.gen.js +57 -0
- package/dist/v2/gen/core/params.gen.d.ts +43 -0
- package/dist/v2/gen/core/params.gen.js +102 -0
- package/dist/v2/gen/core/pathSerializer.gen.d.ts +33 -0
- package/dist/v2/gen/core/pathSerializer.gen.js +106 -0
- package/dist/v2/gen/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/v2/gen/core/queryKeySerializer.gen.js +93 -0
- package/dist/v2/gen/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/v2/gen/core/serverSentEvents.gen.js +133 -0
- package/dist/v2/gen/core/types.gen.d.ts +78 -0
- package/dist/v2/gen/core/types.gen.js +2 -0
- package/dist/v2/gen/core/utils.gen.d.ts +19 -0
- package/dist/v2/gen/core/utils.gen.js +87 -0
- package/dist/v2/gen/sdk.gen.d.ts +2292 -0
- package/dist/v2/gen/sdk.gen.js +4435 -0
- package/dist/v2/gen/types.gen.d.ts +12186 -0
- package/dist/v2/gen/types.gen.js +2 -0
- package/dist/v2/index.d.ts +11 -0
- package/dist/v2/index.js +17 -0
- package/dist/v2/server.d.ts +23 -0
- package/dist/v2/server.js +105 -0
- package/package.json +30 -9
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from "./gen/types.gen.js";
|
|
2
|
-
export { type Config as OpencodeClientConfig, OpencodeClient };
|
|
3
2
|
import { type Config } from "./gen/client/types.gen.js";
|
|
4
3
|
import { OpencodeClient } from "./gen/sdk.gen.js";
|
|
5
|
-
export
|
|
4
|
+
export { type Config as OpencodeClientConfig, OpencodeClient };
|
|
5
|
+
export declare function createOpencodeClient(config?: Config & {
|
|
6
|
+
directory?: string;
|
|
7
|
+
}): OpencodeClient;
|
package/dist/client.js
CHANGED
|
@@ -1,18 +1,53 @@
|
|
|
1
1
|
export * from "./gen/types.gen.js";
|
|
2
|
-
export { OpencodeClient };
|
|
3
2
|
import { createClient } from "./gen/client/client.gen.js";
|
|
4
3
|
import { OpencodeClient } from "./gen/sdk.gen.js";
|
|
4
|
+
import { wrapClientError } from "./error-interceptor.js";
|
|
5
|
+
export { OpencodeClient };
|
|
6
|
+
function pick(value, fallback) {
|
|
7
|
+
if (!value)
|
|
8
|
+
return;
|
|
9
|
+
if (!fallback)
|
|
10
|
+
return value;
|
|
11
|
+
if (value === fallback)
|
|
12
|
+
return fallback;
|
|
13
|
+
if (value === encodeURIComponent(fallback))
|
|
14
|
+
return fallback;
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
function rewrite(request, directory) {
|
|
18
|
+
if (request.method !== "GET" && request.method !== "HEAD")
|
|
19
|
+
return request;
|
|
20
|
+
const value = pick(request.headers.get("x-opencode-directory"), directory);
|
|
21
|
+
if (!value)
|
|
22
|
+
return request;
|
|
23
|
+
const url = new URL(request.url);
|
|
24
|
+
if (!url.searchParams.has("directory")) {
|
|
25
|
+
url.searchParams.set("directory", value);
|
|
26
|
+
}
|
|
27
|
+
const next = new Request(url, request);
|
|
28
|
+
next.headers.delete("x-opencode-directory");
|
|
29
|
+
return next;
|
|
30
|
+
}
|
|
5
31
|
export function createOpencodeClient(config) {
|
|
6
32
|
if (!config?.fetch) {
|
|
33
|
+
const customFetch = (req) => {
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
req.timeout = false;
|
|
36
|
+
return fetch(req);
|
|
37
|
+
};
|
|
7
38
|
config = {
|
|
8
39
|
...config,
|
|
9
|
-
fetch:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
40
|
+
fetch: customFetch,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (config?.directory) {
|
|
44
|
+
config.headers = {
|
|
45
|
+
...config.headers,
|
|
46
|
+
"x-opencode-directory": encodeURIComponent(config.directory),
|
|
14
47
|
};
|
|
15
48
|
}
|
|
16
49
|
const client = createClient(config);
|
|
50
|
+
client.interceptors.request.use((request) => rewrite(request, config?.directory));
|
|
51
|
+
client.interceptors.error.use(wrapClientError);
|
|
17
52
|
return new OpencodeClient({ client });
|
|
18
53
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wrap whatever the generated client decoded from a non-2xx error body
|
|
3
|
+
* into a real `Error` so downstream formatters (TUI, plugins) get a
|
|
4
|
+
* useful `.message` instead of `[object Object]` or blank. The original
|
|
5
|
+
* parsed body and status live under `.cause` for callers that need
|
|
6
|
+
* structured fields.
|
|
7
|
+
*
|
|
8
|
+
* Only fires when the caller used `{ throwOnError: true }`. Callers that
|
|
9
|
+
* read `result.error` directly (the result-tuple path) get the parsed
|
|
10
|
+
* body unchanged so existing field-level reads (`.error.name`,
|
|
11
|
+
* `JSON.stringify(error)`, etc.) are byte-for-byte identical to before.
|
|
12
|
+
*/
|
|
13
|
+
export declare function wrapClientError(error: unknown, response: Response | undefined, request: Request | undefined, opts: {
|
|
14
|
+
throwOnError?: boolean;
|
|
15
|
+
} | undefined): unknown;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wrap whatever the generated client decoded from a non-2xx error body
|
|
3
|
+
* into a real `Error` so downstream formatters (TUI, plugins) get a
|
|
4
|
+
* useful `.message` instead of `[object Object]` or blank. The original
|
|
5
|
+
* parsed body and status live under `.cause` for callers that need
|
|
6
|
+
* structured fields.
|
|
7
|
+
*
|
|
8
|
+
* Only fires when the caller used `{ throwOnError: true }`. Callers that
|
|
9
|
+
* read `result.error` directly (the result-tuple path) get the parsed
|
|
10
|
+
* body unchanged so existing field-level reads (`.error.name`,
|
|
11
|
+
* `JSON.stringify(error)`, etc.) are byte-for-byte identical to before.
|
|
12
|
+
*/
|
|
13
|
+
export function wrapClientError(error, response, request, opts) {
|
|
14
|
+
if (!opts?.throwOnError)
|
|
15
|
+
return error;
|
|
16
|
+
if (error instanceof Error)
|
|
17
|
+
return error;
|
|
18
|
+
// NamedError-shaped responses (the common case for opencode 4xx) come
|
|
19
|
+
// through as POJOs — extract a useful message first, then wrap.
|
|
20
|
+
if (typeof error === "object" && error !== null && Object.keys(error).length > 0) {
|
|
21
|
+
const obj = error;
|
|
22
|
+
const message = (typeof obj.data?.message === "string" && obj.data.message) ||
|
|
23
|
+
(typeof obj.message === "string" && obj.message) ||
|
|
24
|
+
(typeof obj.name === "string" && obj.name) ||
|
|
25
|
+
describe(request, response);
|
|
26
|
+
return new Error(message, { cause: { body: error, status: response?.status } });
|
|
27
|
+
}
|
|
28
|
+
if (typeof error === "string" && error.length > 0) {
|
|
29
|
+
return new Error(error, { cause: { body: error, status: response?.status } });
|
|
30
|
+
}
|
|
31
|
+
// Empty body / network failure / undefined / null / empty object.
|
|
32
|
+
const reason = response ? "(empty response body)" : "network error (no response)";
|
|
33
|
+
return new Error(`opencode server ${describe(request, response)}: ${reason}`, {
|
|
34
|
+
cause: { body: error, status: response?.status },
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function describe(request, response) {
|
|
38
|
+
const method = request?.method ?? "?";
|
|
39
|
+
const url = request?.url ?? "?";
|
|
40
|
+
const status = response?.status;
|
|
41
|
+
const statusText = response?.statusText;
|
|
42
|
+
return `${method} ${url}${status ? " → " + status : ""}${statusText ? " " + statusText : ""}`;
|
|
43
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON-friendly union that mirrors what Pinia Colada can hash.
|
|
3
|
+
*/
|
|
4
|
+
export type JsonValue = null | string | number | boolean | JsonValue[] | {
|
|
5
|
+
[key: string]: JsonValue;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.
|
|
9
|
+
*/
|
|
10
|
+
export declare const queryKeyJsonReplacer: (_key: string, value: unknown) => {} | null | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Safely stringifies a value and parses it back into a JsonValue.
|
|
13
|
+
*/
|
|
14
|
+
export declare const stringifyToJsonValue: (input: unknown) => JsonValue | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Normalizes any accepted value into a JSON-friendly shape for query keys.
|
|
17
|
+
*/
|
|
18
|
+
export declare const serializeQueryKeyValue: (value: unknown) => JsonValue | undefined;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
/**
|
|
3
|
+
* Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.
|
|
4
|
+
*/
|
|
5
|
+
export const queryKeyJsonReplacer = (_key, value) => {
|
|
6
|
+
if (value === undefined || typeof value === "function" || typeof value === "symbol") {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
if (typeof value === "bigint") {
|
|
10
|
+
return value.toString();
|
|
11
|
+
}
|
|
12
|
+
if (value instanceof Date) {
|
|
13
|
+
return value.toISOString();
|
|
14
|
+
}
|
|
15
|
+
return value;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Safely stringifies a value and parses it back into a JsonValue.
|
|
19
|
+
*/
|
|
20
|
+
export const stringifyToJsonValue = (input) => {
|
|
21
|
+
try {
|
|
22
|
+
const json = JSON.stringify(input, queryKeyJsonReplacer);
|
|
23
|
+
if (json === undefined) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
return JSON.parse(json);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Detects plain objects (including objects with a null prototype).
|
|
34
|
+
*/
|
|
35
|
+
const isPlainObject = (value) => {
|
|
36
|
+
if (value === null || typeof value !== "object") {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
const prototype = Object.getPrototypeOf(value);
|
|
40
|
+
return prototype === Object.prototype || prototype === null;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Turns URLSearchParams into a sorted JSON object for deterministic keys.
|
|
44
|
+
*/
|
|
45
|
+
const serializeSearchParams = (params) => {
|
|
46
|
+
const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b));
|
|
47
|
+
const result = {};
|
|
48
|
+
for (const [key, value] of entries) {
|
|
49
|
+
const existing = result[key];
|
|
50
|
+
if (existing === undefined) {
|
|
51
|
+
result[key] = value;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (Array.isArray(existing)) {
|
|
55
|
+
;
|
|
56
|
+
existing.push(value);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
result[key] = [existing, value];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Normalizes any accepted value into a JSON-friendly shape for query keys.
|
|
66
|
+
*/
|
|
67
|
+
export const serializeQueryKeyValue = (value) => {
|
|
68
|
+
if (value === null) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
if (value === undefined || typeof value === "function" || typeof value === "symbol") {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
if (typeof value === "bigint") {
|
|
78
|
+
return value.toString();
|
|
79
|
+
}
|
|
80
|
+
if (value instanceof Date) {
|
|
81
|
+
return value.toISOString();
|
|
82
|
+
}
|
|
83
|
+
if (Array.isArray(value)) {
|
|
84
|
+
return stringifyToJsonValue(value);
|
|
85
|
+
}
|
|
86
|
+
if (typeof URLSearchParams !== "undefined" && value instanceof URLSearchParams) {
|
|
87
|
+
return serializeSearchParams(value);
|
|
88
|
+
}
|
|
89
|
+
if (isPlainObject(value)) {
|
|
90
|
+
return stringifyToJsonValue(value);
|
|
91
|
+
}
|
|
92
|
+
return undefined;
|
|
93
|
+
};
|
package/dist/gen/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options as ClientOptions, TDataShape, Client } from "./client/index.js";
|
|
2
|
-
import type { GlobalEventData, GlobalEventResponses, ProjectListData, ProjectListResponses, ProjectCurrentData, ProjectCurrentResponses, ConfigGetData, ConfigGetResponses, ConfigUpdateData, ConfigUpdateResponses, ConfigUpdateErrors, ToolIdsData, ToolIdsResponses, ToolIdsErrors, ToolListData, ToolListResponses, ToolListErrors, PathGetData, PathGetResponses, SessionListData, SessionListResponses, SessionCreateData, SessionCreateResponses, SessionCreateErrors, SessionDeleteData, SessionDeleteResponses, SessionDeleteErrors, SessionGetData, SessionGetResponses, SessionGetErrors, SessionUpdateData, SessionUpdateResponses, SessionUpdateErrors, SessionChildrenData, SessionChildrenResponses, SessionChildrenErrors, SessionTodoData, SessionTodoResponses, SessionTodoErrors, SessionInitData, SessionInitResponses, SessionInitErrors, SessionForkData, SessionForkResponses, SessionAbortData, SessionAbortResponses, SessionAbortErrors, SessionUnshareData, SessionUnshareResponses, SessionUnshareErrors, SessionShareData, SessionShareResponses, SessionShareErrors, SessionDiffData, SessionDiffResponses, SessionDiffErrors, SessionSummarizeData, SessionSummarizeResponses, SessionSummarizeErrors, SessionMessagesData, SessionMessagesResponses, SessionMessagesErrors, SessionPromptData, SessionPromptResponses, SessionPromptErrors, SessionMessageData, SessionMessageResponses, SessionMessageErrors, SessionCommandData, SessionCommandResponses, SessionCommandErrors, SessionShellData, SessionShellResponses, SessionShellErrors, SessionRevertData, SessionRevertResponses, SessionRevertErrors, SessionUnrevertData, SessionUnrevertResponses, SessionUnrevertErrors, PostSessionIdPermissionsPermissionIdData, PostSessionIdPermissionsPermissionIdResponses, PostSessionIdPermissionsPermissionIdErrors, CommandListData, CommandListResponses, ConfigProvidersData, ConfigProvidersResponses, FindTextData, FindTextResponses, FindFilesData, FindFilesResponses, FindSymbolsData, FindSymbolsResponses, FileListData, FileListResponses, FileReadData, FileReadResponses, FileStatusData, FileStatusResponses, AppLogData, AppLogResponses, AppLogErrors, AppAgentsData, AppAgentsResponses, McpStatusData, McpStatusResponses, McpAddData, McpAddResponses, McpAddErrors, LspStatusData, LspStatusResponses, FormatterStatusData, FormatterStatusResponses, TuiAppendPromptData, TuiAppendPromptResponses, TuiAppendPromptErrors, TuiOpenHelpData, TuiOpenHelpResponses, TuiOpenSessionsData, TuiOpenSessionsResponses, TuiOpenThemesData, TuiOpenThemesResponses, TuiOpenModelsData, TuiOpenModelsResponses, TuiSubmitPromptData, TuiSubmitPromptResponses, TuiClearPromptData, TuiClearPromptResponses, TuiExecuteCommandData, TuiExecuteCommandResponses, TuiExecuteCommandErrors, TuiShowToastData, TuiShowToastResponses, TuiPublishData, TuiPublishResponses, TuiPublishErrors, TuiControlNextData, TuiControlNextResponses, TuiControlResponseData, TuiControlResponseResponses, AuthSetData, AuthSetResponses, AuthSetErrors, EventSubscribeData, EventSubscribeResponses } from "./types.gen.js";
|
|
2
|
+
import type { GlobalEventData, GlobalEventResponses, ProjectListData, ProjectListResponses, ProjectCurrentData, ProjectCurrentResponses, PtyListData, PtyListResponses, PtyCreateData, PtyCreateResponses, PtyCreateErrors, PtyRemoveData, PtyRemoveResponses, PtyRemoveErrors, PtyGetData, PtyGetResponses, PtyGetErrors, PtyUpdateData, PtyUpdateResponses, PtyUpdateErrors, PtyConnectData, PtyConnectResponses, PtyConnectErrors, ConfigGetData, ConfigGetResponses, ConfigUpdateData, ConfigUpdateResponses, ConfigUpdateErrors, ToolIdsData, ToolIdsResponses, ToolIdsErrors, ToolListData, ToolListResponses, ToolListErrors, InstanceDisposeData, InstanceDisposeResponses, PathGetData, PathGetResponses, VcsGetData, VcsGetResponses, SessionListData, SessionListResponses, SessionCreateData, SessionCreateResponses, SessionCreateErrors, SessionStatusData, SessionStatusResponses, SessionStatusErrors, SessionDeleteData, SessionDeleteResponses, SessionDeleteErrors, SessionGetData, SessionGetResponses, SessionGetErrors, SessionUpdateData, SessionUpdateResponses, SessionUpdateErrors, SessionChildrenData, SessionChildrenResponses, SessionChildrenErrors, SessionTodoData, SessionTodoResponses, SessionTodoErrors, SessionInitData, SessionInitResponses, SessionInitErrors, SessionForkData, SessionForkResponses, SessionAbortData, SessionAbortResponses, SessionAbortErrors, SessionUnshareData, SessionUnshareResponses, SessionUnshareErrors, SessionShareData, SessionShareResponses, SessionShareErrors, SessionDiffData, SessionDiffResponses, SessionDiffErrors, SessionSummarizeData, SessionSummarizeResponses, SessionSummarizeErrors, SessionMessagesData, SessionMessagesResponses, SessionMessagesErrors, SessionPromptData, SessionPromptResponses, SessionPromptErrors, SessionMessageData, SessionMessageResponses, SessionMessageErrors, SessionPromptAsyncData, SessionPromptAsyncResponses, SessionPromptAsyncErrors, SessionCommandData, SessionCommandResponses, SessionCommandErrors, SessionShellData, SessionShellResponses, SessionShellErrors, SessionRevertData, SessionRevertResponses, SessionRevertErrors, SessionUnrevertData, SessionUnrevertResponses, SessionUnrevertErrors, PostSessionIdPermissionsPermissionIdData, PostSessionIdPermissionsPermissionIdResponses, PostSessionIdPermissionsPermissionIdErrors, CommandListData, CommandListResponses, ConfigProvidersData, ConfigProvidersResponses, ProviderListData, ProviderListResponses, ProviderAuthData, ProviderAuthResponses, ProviderOauthAuthorizeData, ProviderOauthAuthorizeResponses, ProviderOauthAuthorizeErrors, ProviderOauthCallbackData, ProviderOauthCallbackResponses, ProviderOauthCallbackErrors, FindTextData, FindTextResponses, FindFilesData, FindFilesResponses, FindSymbolsData, FindSymbolsResponses, FileListData, FileListResponses, FileReadData, FileReadResponses, FileStatusData, FileStatusResponses, AppLogData, AppLogResponses, AppLogErrors, AppAgentsData, AppAgentsResponses, McpStatusData, McpStatusResponses, McpAddData, McpAddResponses, McpAddErrors, McpAuthRemoveData, McpAuthRemoveResponses, McpAuthRemoveErrors, McpAuthStartData, McpAuthStartResponses, McpAuthStartErrors, McpAuthCallbackData, McpAuthCallbackResponses, McpAuthCallbackErrors, McpAuthAuthenticateData, McpAuthAuthenticateResponses, McpAuthAuthenticateErrors, McpConnectData, McpConnectResponses, McpDisconnectData, McpDisconnectResponses, LspStatusData, LspStatusResponses, FormatterStatusData, FormatterStatusResponses, TuiAppendPromptData, TuiAppendPromptResponses, TuiAppendPromptErrors, TuiOpenHelpData, TuiOpenHelpResponses, TuiOpenSessionsData, TuiOpenSessionsResponses, TuiOpenThemesData, TuiOpenThemesResponses, TuiOpenModelsData, TuiOpenModelsResponses, TuiSubmitPromptData, TuiSubmitPromptResponses, TuiClearPromptData, TuiClearPromptResponses, TuiExecuteCommandData, TuiExecuteCommandResponses, TuiExecuteCommandErrors, TuiShowToastData, TuiShowToastResponses, TuiPublishData, TuiPublishResponses, TuiPublishErrors, TuiControlNextData, TuiControlNextResponses, TuiControlResponseData, TuiControlResponseResponses, AuthSetData, AuthSetResponses, AuthSetErrors, EventSubscribeData, EventSubscribeResponses } from "./types.gen.js";
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -35,6 +35,32 @@ declare class Project extends _HeyApiClient {
|
|
|
35
35
|
*/
|
|
36
36
|
current<ThrowOnError extends boolean = false>(options?: Options<ProjectCurrentData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProjectCurrentResponses, unknown, ThrowOnError, "fields">;
|
|
37
37
|
}
|
|
38
|
+
declare class Pty extends _HeyApiClient {
|
|
39
|
+
/**
|
|
40
|
+
* List all PTY sessions
|
|
41
|
+
*/
|
|
42
|
+
list<ThrowOnError extends boolean = false>(options?: Options<PtyListData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyListResponses, unknown, ThrowOnError, "fields">;
|
|
43
|
+
/**
|
|
44
|
+
* Create a new PTY session
|
|
45
|
+
*/
|
|
46
|
+
create<ThrowOnError extends boolean = false>(options?: Options<PtyCreateData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyCreateResponses, PtyCreateErrors, ThrowOnError, "fields">;
|
|
47
|
+
/**
|
|
48
|
+
* Remove a PTY session
|
|
49
|
+
*/
|
|
50
|
+
remove<ThrowOnError extends boolean = false>(options: Options<PtyRemoveData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyRemoveResponses, PtyRemoveErrors, ThrowOnError, "fields">;
|
|
51
|
+
/**
|
|
52
|
+
* Get PTY session info
|
|
53
|
+
*/
|
|
54
|
+
get<ThrowOnError extends boolean = false>(options: Options<PtyGetData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyGetResponses, PtyGetErrors, ThrowOnError, "fields">;
|
|
55
|
+
/**
|
|
56
|
+
* Update PTY session
|
|
57
|
+
*/
|
|
58
|
+
update<ThrowOnError extends boolean = false>(options: Options<PtyUpdateData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyUpdateResponses, PtyUpdateErrors, ThrowOnError, "fields">;
|
|
59
|
+
/**
|
|
60
|
+
* Connect to a PTY session
|
|
61
|
+
*/
|
|
62
|
+
connect<ThrowOnError extends boolean = false>(options: Options<PtyConnectData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyConnectResponses, PtyConnectErrors, ThrowOnError, "fields">;
|
|
63
|
+
}
|
|
38
64
|
declare class Config extends _HeyApiClient {
|
|
39
65
|
/**
|
|
40
66
|
* Get config info
|
|
@@ -59,12 +85,24 @@ declare class Tool extends _HeyApiClient {
|
|
|
59
85
|
*/
|
|
60
86
|
list<ThrowOnError extends boolean = false>(options: Options<ToolListData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ToolListResponses, ToolListErrors, ThrowOnError, "fields">;
|
|
61
87
|
}
|
|
88
|
+
declare class Instance extends _HeyApiClient {
|
|
89
|
+
/**
|
|
90
|
+
* Dispose the current instance
|
|
91
|
+
*/
|
|
92
|
+
dispose<ThrowOnError extends boolean = false>(options?: Options<InstanceDisposeData, ThrowOnError>): import("./client/types.gen.js").RequestResult<InstanceDisposeResponses, unknown, ThrowOnError, "fields">;
|
|
93
|
+
}
|
|
62
94
|
declare class Path extends _HeyApiClient {
|
|
63
95
|
/**
|
|
64
96
|
* Get the current path
|
|
65
97
|
*/
|
|
66
98
|
get<ThrowOnError extends boolean = false>(options?: Options<PathGetData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PathGetResponses, unknown, ThrowOnError, "fields">;
|
|
67
99
|
}
|
|
100
|
+
declare class Vcs extends _HeyApiClient {
|
|
101
|
+
/**
|
|
102
|
+
* Get VCS info for the current instance
|
|
103
|
+
*/
|
|
104
|
+
get<ThrowOnError extends boolean = false>(options?: Options<VcsGetData, ThrowOnError>): import("./client/types.gen.js").RequestResult<VcsGetResponses, unknown, ThrowOnError, "fields">;
|
|
105
|
+
}
|
|
68
106
|
declare class Session extends _HeyApiClient {
|
|
69
107
|
/**
|
|
70
108
|
* List all sessions
|
|
@@ -74,6 +112,10 @@ declare class Session extends _HeyApiClient {
|
|
|
74
112
|
* Create a new session
|
|
75
113
|
*/
|
|
76
114
|
create<ThrowOnError extends boolean = false>(options?: Options<SessionCreateData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionCreateResponses, SessionCreateErrors, ThrowOnError, "fields">;
|
|
115
|
+
/**
|
|
116
|
+
* Get session status
|
|
117
|
+
*/
|
|
118
|
+
status<ThrowOnError extends boolean = false>(options?: Options<SessionStatusData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionStatusResponses, SessionStatusErrors, ThrowOnError, "fields">;
|
|
77
119
|
/**
|
|
78
120
|
* Delete a session and all its data
|
|
79
121
|
*/
|
|
@@ -134,6 +176,10 @@ declare class Session extends _HeyApiClient {
|
|
|
134
176
|
* Get a message from a session
|
|
135
177
|
*/
|
|
136
178
|
message<ThrowOnError extends boolean = false>(options: Options<SessionMessageData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionMessageResponses, SessionMessageErrors, ThrowOnError, "fields">;
|
|
179
|
+
/**
|
|
180
|
+
* Create and send a new message to a session, start if needed and return immediately
|
|
181
|
+
*/
|
|
182
|
+
promptAsync<ThrowOnError extends boolean = false>(options: Options<SessionPromptAsyncData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionPromptAsyncResponses, SessionPromptAsyncErrors, ThrowOnError, "fields">;
|
|
137
183
|
/**
|
|
138
184
|
* Send a new command to a session
|
|
139
185
|
*/
|
|
@@ -157,6 +203,27 @@ declare class Command extends _HeyApiClient {
|
|
|
157
203
|
*/
|
|
158
204
|
list<ThrowOnError extends boolean = false>(options?: Options<CommandListData, ThrowOnError>): import("./client/types.gen.js").RequestResult<CommandListResponses, unknown, ThrowOnError, "fields">;
|
|
159
205
|
}
|
|
206
|
+
declare class Oauth extends _HeyApiClient {
|
|
207
|
+
/**
|
|
208
|
+
* Authorize a provider using OAuth
|
|
209
|
+
*/
|
|
210
|
+
authorize<ThrowOnError extends boolean = false>(options: Options<ProviderOauthAuthorizeData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderOauthAuthorizeResponses, ProviderOauthAuthorizeErrors, ThrowOnError, "fields">;
|
|
211
|
+
/**
|
|
212
|
+
* Handle OAuth callback for a provider
|
|
213
|
+
*/
|
|
214
|
+
callback<ThrowOnError extends boolean = false>(options: Options<ProviderOauthCallbackData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderOauthCallbackResponses, ProviderOauthCallbackErrors, ThrowOnError, "fields">;
|
|
215
|
+
}
|
|
216
|
+
declare class Provider extends _HeyApiClient {
|
|
217
|
+
/**
|
|
218
|
+
* List all providers
|
|
219
|
+
*/
|
|
220
|
+
list<ThrowOnError extends boolean = false>(options?: Options<ProviderListData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderListResponses, unknown, ThrowOnError, "fields">;
|
|
221
|
+
/**
|
|
222
|
+
* Get provider authentication methods
|
|
223
|
+
*/
|
|
224
|
+
auth<ThrowOnError extends boolean = false>(options?: Options<ProviderAuthData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderAuthResponses, unknown, ThrowOnError, "fields">;
|
|
225
|
+
oauth: Oauth;
|
|
226
|
+
}
|
|
160
227
|
declare class Find extends _HeyApiClient {
|
|
161
228
|
/**
|
|
162
229
|
* Find text in files
|
|
@@ -195,6 +262,28 @@ declare class App extends _HeyApiClient {
|
|
|
195
262
|
*/
|
|
196
263
|
agents<ThrowOnError extends boolean = false>(options?: Options<AppAgentsData, ThrowOnError>): import("./client/types.gen.js").RequestResult<AppAgentsResponses, unknown, ThrowOnError, "fields">;
|
|
197
264
|
}
|
|
265
|
+
declare class Auth extends _HeyApiClient {
|
|
266
|
+
/**
|
|
267
|
+
* Remove OAuth credentials for an MCP server
|
|
268
|
+
*/
|
|
269
|
+
remove<ThrowOnError extends boolean = false>(options: Options<McpAuthRemoveData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpAuthRemoveResponses, McpAuthRemoveErrors, ThrowOnError, "fields">;
|
|
270
|
+
/**
|
|
271
|
+
* Start OAuth authentication flow for an MCP server
|
|
272
|
+
*/
|
|
273
|
+
start<ThrowOnError extends boolean = false>(options: Options<McpAuthStartData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpAuthStartResponses, McpAuthStartErrors, ThrowOnError, "fields">;
|
|
274
|
+
/**
|
|
275
|
+
* Complete OAuth authentication with authorization code
|
|
276
|
+
*/
|
|
277
|
+
callback<ThrowOnError extends boolean = false>(options: Options<McpAuthCallbackData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpAuthCallbackResponses, McpAuthCallbackErrors, ThrowOnError, "fields">;
|
|
278
|
+
/**
|
|
279
|
+
* Start OAuth flow and wait for callback (opens browser)
|
|
280
|
+
*/
|
|
281
|
+
authenticate<ThrowOnError extends boolean = false>(options: Options<McpAuthAuthenticateData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpAuthAuthenticateResponses, McpAuthAuthenticateErrors, ThrowOnError, "fields">;
|
|
282
|
+
/**
|
|
283
|
+
* Set authentication credentials
|
|
284
|
+
*/
|
|
285
|
+
set<ThrowOnError extends boolean = false>(options: Options<AuthSetData, ThrowOnError>): import("./client/types.gen.js").RequestResult<AuthSetResponses, AuthSetErrors, ThrowOnError, "fields">;
|
|
286
|
+
}
|
|
198
287
|
declare class Mcp extends _HeyApiClient {
|
|
199
288
|
/**
|
|
200
289
|
* Get MCP server status
|
|
@@ -204,6 +293,15 @@ declare class Mcp extends _HeyApiClient {
|
|
|
204
293
|
* Add MCP server dynamically
|
|
205
294
|
*/
|
|
206
295
|
add<ThrowOnError extends boolean = false>(options?: Options<McpAddData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpAddResponses, McpAddErrors, ThrowOnError, "fields">;
|
|
296
|
+
/**
|
|
297
|
+
* Connect an MCP server
|
|
298
|
+
*/
|
|
299
|
+
connect<ThrowOnError extends boolean = false>(options: Options<McpConnectData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpConnectResponses, unknown, ThrowOnError, "fields">;
|
|
300
|
+
/**
|
|
301
|
+
* Disconnect an MCP server
|
|
302
|
+
*/
|
|
303
|
+
disconnect<ThrowOnError extends boolean = false>(options: Options<McpDisconnectData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpDisconnectResponses, unknown, ThrowOnError, "fields">;
|
|
304
|
+
auth: Auth;
|
|
207
305
|
}
|
|
208
306
|
declare class Lsp extends _HeyApiClient {
|
|
209
307
|
/**
|
|
@@ -270,12 +368,6 @@ declare class Tui extends _HeyApiClient {
|
|
|
270
368
|
publish<ThrowOnError extends boolean = false>(options?: Options<TuiPublishData, ThrowOnError>): import("./client/types.gen.js").RequestResult<TuiPublishResponses, TuiPublishErrors, ThrowOnError, "fields">;
|
|
271
369
|
control: Control;
|
|
272
370
|
}
|
|
273
|
-
declare class Auth extends _HeyApiClient {
|
|
274
|
-
/**
|
|
275
|
-
* Set authentication credentials
|
|
276
|
-
*/
|
|
277
|
-
set<ThrowOnError extends boolean = false>(options: Options<AuthSetData, ThrowOnError>): import("./client/types.gen.js").RequestResult<AuthSetResponses, AuthSetErrors, ThrowOnError, "fields">;
|
|
278
|
-
}
|
|
279
371
|
declare class Event extends _HeyApiClient {
|
|
280
372
|
/**
|
|
281
373
|
* Get events
|
|
@@ -289,11 +381,15 @@ export declare class OpencodeClient extends _HeyApiClient {
|
|
|
289
381
|
postSessionIdPermissionsPermissionId<ThrowOnError extends boolean = false>(options: Options<PostSessionIdPermissionsPermissionIdData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PostSessionIdPermissionsPermissionIdResponses, PostSessionIdPermissionsPermissionIdErrors, ThrowOnError, "fields">;
|
|
290
382
|
global: Global;
|
|
291
383
|
project: Project;
|
|
384
|
+
pty: Pty;
|
|
292
385
|
config: Config;
|
|
293
386
|
tool: Tool;
|
|
387
|
+
instance: Instance;
|
|
294
388
|
path: Path;
|
|
389
|
+
vcs: Vcs;
|
|
295
390
|
session: Session;
|
|
296
391
|
command: Command;
|
|
392
|
+
provider: Provider;
|
|
297
393
|
find: Find;
|
|
298
394
|
file: File;
|
|
299
395
|
app: App;
|