@opencode-ai/sdk 1.4.2 → 1.4.5
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/client.js +7 -2
- package/dist/v2/gen/sdk.gen.d.ts +24 -11
- package/dist/v2/gen/sdk.gen.js +47 -17
- package/dist/v2/gen/types.gen.d.ts +235 -172
- package/package.json +1 -1
package/dist/v2/client.js
CHANGED
|
@@ -66,6 +66,11 @@ export function createOpencodeClient(config) {
|
|
|
66
66
|
directory: config?.directory,
|
|
67
67
|
workspace: config?.experimental_workspaceID,
|
|
68
68
|
}));
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
client.interceptors.response.use((response) => {
|
|
70
|
+
const contentType = response.headers.get("content-type");
|
|
71
|
+
if (contentType === "text/html")
|
|
72
|
+
throw new Error("Request is not supported by this version of OpenCode Server (Server responded with text/html)");
|
|
73
|
+
return response;
|
|
74
|
+
});
|
|
75
|
+
return new OpencodeClient({ client });
|
|
71
76
|
}
|
package/dist/v2/gen/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Client, type Options as Options2, type TDataShape } from "./client/index.js";
|
|
2
|
-
import type { AgentPartInput, AppAgentsResponses, AppLogErrors, AppLogResponses, AppSkillsResponses, Auth as Auth3, AuthRemoveErrors, AuthRemoveResponses, AuthSetErrors, AuthSetResponses, CommandListResponses, Config as Config3, ConfigGetResponses, ConfigProvidersResponses, ConfigUpdateErrors, ConfigUpdateResponses, EventSubscribeResponses, EventTuiCommandExecute, EventTuiPromptAppend, EventTuiSessionSelect, EventTuiToastShow, ExperimentalConsoleGetResponses, ExperimentalConsoleListOrgsResponses, ExperimentalConsoleSwitchOrgResponses, ExperimentalResourceListResponses, ExperimentalSessionListResponses, ExperimentalWorkspaceCreateErrors, ExperimentalWorkspaceCreateResponses, ExperimentalWorkspaceListResponses, ExperimentalWorkspaceRemoveErrors, ExperimentalWorkspaceRemoveResponses, FileListResponses, FilePartInput, FilePartSource, FileReadResponses, FileStatusResponses, FindFilesResponses, FindSymbolsResponses, FindTextResponses, FormatterStatusResponses, GlobalConfigGetResponses, GlobalConfigUpdateErrors, GlobalConfigUpdateResponses, GlobalDisposeResponses, GlobalEventResponses, GlobalHealthResponses,
|
|
2
|
+
import type { AgentPartInput, AppAgentsResponses, AppLogErrors, AppLogResponses, AppSkillsResponses, Auth as Auth3, AuthRemoveErrors, AuthRemoveResponses, AuthSetErrors, AuthSetResponses, CommandListResponses, Config as Config3, ConfigGetResponses, ConfigProvidersResponses, ConfigUpdateErrors, ConfigUpdateResponses, EventSubscribeResponses, EventTuiCommandExecute, EventTuiPromptAppend, EventTuiSessionSelect, EventTuiToastShow, ExperimentalConsoleGetResponses, ExperimentalConsoleListOrgsResponses, ExperimentalConsoleSwitchOrgResponses, ExperimentalResourceListResponses, ExperimentalSessionListResponses, ExperimentalWorkspaceAdaptorListResponses, ExperimentalWorkspaceCreateErrors, ExperimentalWorkspaceCreateResponses, ExperimentalWorkspaceListResponses, ExperimentalWorkspaceRemoveErrors, ExperimentalWorkspaceRemoveResponses, ExperimentalWorkspaceStatusResponses, FileListResponses, FilePartInput, FilePartSource, FileReadResponses, FileStatusResponses, FindFilesResponses, FindSymbolsResponses, FindTextResponses, FormatterStatusResponses, GlobalConfigGetResponses, GlobalConfigUpdateErrors, GlobalConfigUpdateResponses, GlobalDisposeResponses, GlobalEventResponses, GlobalHealthResponses, GlobalUpgradeErrors, GlobalUpgradeResponses, InstanceDisposeResponses, LspStatusResponses, McpAddErrors, McpAddResponses, McpAuthAuthenticateErrors, McpAuthAuthenticateResponses, McpAuthCallbackErrors, McpAuthCallbackResponses, McpAuthRemoveErrors, McpAuthRemoveResponses, McpAuthStartErrors, McpAuthStartResponses, McpConnectResponses, McpDisconnectResponses, McpLocalConfig, McpRemoteConfig, McpStatusResponses, OutputFormat, Part as Part2, PartDeleteErrors, PartDeleteResponses, PartUpdateErrors, PartUpdateResponses, PathGetResponses, PermissionListResponses, PermissionReplyErrors, PermissionReplyResponses, PermissionRespondErrors, PermissionRespondResponses, PermissionRuleset, ProjectCurrentResponses, ProjectInitGitResponses, ProjectListResponses, ProjectUpdateErrors, ProjectUpdateResponses, ProviderAuthResponses, ProviderListResponses, ProviderOauthAuthorizeErrors, ProviderOauthAuthorizeResponses, ProviderOauthCallbackErrors, ProviderOauthCallbackResponses, PtyConnectErrors, PtyConnectResponses, PtyCreateErrors, PtyCreateResponses, PtyGetErrors, PtyGetResponses, PtyListResponses, PtyRemoveErrors, PtyRemoveResponses, PtyUpdateErrors, PtyUpdateResponses, QuestionAnswer, QuestionListResponses, QuestionRejectErrors, QuestionRejectResponses, QuestionReplyErrors, QuestionReplyResponses, SessionAbortErrors, SessionAbortResponses, SessionChildrenErrors, SessionChildrenResponses, SessionCommandErrors, SessionCommandResponses, SessionCreateErrors, SessionCreateResponses, SessionDeleteErrors, SessionDeleteMessageErrors, SessionDeleteMessageResponses, SessionDeleteResponses, SessionDiffResponses, SessionForkResponses, SessionGetErrors, SessionGetResponses, SessionInitErrors, SessionInitResponses, SessionListResponses, SessionMessageErrors, SessionMessageResponses, SessionMessagesErrors, SessionMessagesResponses, SessionPromptAsyncErrors, SessionPromptAsyncResponses, SessionPromptErrors, SessionPromptResponses, SessionRevertErrors, SessionRevertResponses, SessionShareErrors, SessionShareResponses, SessionShellErrors, SessionShellResponses, SessionStatusErrors, SessionStatusResponses, SessionSummarizeErrors, SessionSummarizeResponses, SessionTodoErrors, SessionTodoResponses, SessionUnrevertErrors, SessionUnrevertResponses, SessionUnshareErrors, SessionUnshareResponses, SessionUpdateErrors, SessionUpdateResponses, SubtaskPartInput, TextPartInput, ToolIdsErrors, ToolIdsResponses, ToolListErrors, ToolListResponses, TuiAppendPromptErrors, TuiAppendPromptResponses, TuiClearPromptResponses, TuiControlNextResponses, TuiControlResponseResponses, TuiExecuteCommandErrors, TuiExecuteCommandResponses, TuiOpenHelpResponses, TuiOpenModelsResponses, TuiOpenSessionsResponses, TuiOpenThemesResponses, TuiPublishErrors, TuiPublishResponses, TuiSelectSessionErrors, TuiSelectSessionResponses, TuiShowToastResponses, TuiSubmitPromptResponses, VcsDiffResponses, VcsGetResponses, WorktreeCreateErrors, WorktreeCreateInput, WorktreeCreateResponses, WorktreeListResponses, WorktreeRemoveErrors, WorktreeRemoveInput, WorktreeRemoveResponses, WorktreeResetErrors, WorktreeResetInput, WorktreeResetResponses } from "./types.gen.js";
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -25,14 +25,6 @@ declare class HeyApiRegistry<T> {
|
|
|
25
25
|
get(key?: string): T;
|
|
26
26
|
set(value: T, key?: string): void;
|
|
27
27
|
}
|
|
28
|
-
export declare class SyncEvent extends HeyApiClient {
|
|
29
|
-
/**
|
|
30
|
-
* Subscribe to global sync events
|
|
31
|
-
*
|
|
32
|
-
* Get global sync events
|
|
33
|
-
*/
|
|
34
|
-
subscribe<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>): Promise<import("./core/serverSentEvents.gen.js").ServerSentEventsResult<GlobalSyncEventSubscribeResponses, unknown>>;
|
|
35
|
-
}
|
|
36
28
|
export declare class Config extends HeyApiClient {
|
|
37
29
|
/**
|
|
38
30
|
* Get global configuration
|
|
@@ -76,8 +68,6 @@ export declare class Global extends HeyApiClient {
|
|
|
76
68
|
upgrade<ThrowOnError extends boolean = false>(parameters?: {
|
|
77
69
|
target?: string;
|
|
78
70
|
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<GlobalUpgradeResponses, GlobalUpgradeErrors, ThrowOnError, "fields">;
|
|
79
|
-
private _syncEvent?;
|
|
80
|
-
get syncEvent(): SyncEvent;
|
|
81
71
|
private _config?;
|
|
82
72
|
get config(): Config;
|
|
83
73
|
}
|
|
@@ -319,6 +309,17 @@ export declare class Console extends HeyApiClient {
|
|
|
319
309
|
orgID?: string;
|
|
320
310
|
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<ExperimentalConsoleSwitchOrgResponses, unknown, ThrowOnError, "fields">;
|
|
321
311
|
}
|
|
312
|
+
export declare class Adaptor extends HeyApiClient {
|
|
313
|
+
/**
|
|
314
|
+
* List workspace adaptors
|
|
315
|
+
*
|
|
316
|
+
* List all available workspace adaptors for the current project.
|
|
317
|
+
*/
|
|
318
|
+
list<ThrowOnError extends boolean = false>(parameters?: {
|
|
319
|
+
directory?: string;
|
|
320
|
+
workspace?: string;
|
|
321
|
+
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<ExperimentalWorkspaceAdaptorListResponses, unknown, ThrowOnError, "fields">;
|
|
322
|
+
}
|
|
322
323
|
export declare class Workspace extends HeyApiClient {
|
|
323
324
|
/**
|
|
324
325
|
* List workspaces
|
|
@@ -342,6 +343,15 @@ export declare class Workspace extends HeyApiClient {
|
|
|
342
343
|
branch?: string | null;
|
|
343
344
|
extra?: unknown | null;
|
|
344
345
|
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<ExperimentalWorkspaceCreateResponses, ExperimentalWorkspaceCreateErrors, ThrowOnError, "fields">;
|
|
346
|
+
/**
|
|
347
|
+
* Workspace status
|
|
348
|
+
*
|
|
349
|
+
* Get connection status for workspaces in the current project.
|
|
350
|
+
*/
|
|
351
|
+
status<ThrowOnError extends boolean = false>(parameters?: {
|
|
352
|
+
directory?: string;
|
|
353
|
+
workspace?: string;
|
|
354
|
+
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<ExperimentalWorkspaceStatusResponses, unknown, ThrowOnError, "fields">;
|
|
345
355
|
/**
|
|
346
356
|
* Remove workspace
|
|
347
357
|
*
|
|
@@ -352,6 +362,8 @@ export declare class Workspace extends HeyApiClient {
|
|
|
352
362
|
directory?: string;
|
|
353
363
|
workspace?: string;
|
|
354
364
|
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<ExperimentalWorkspaceRemoveResponses, ExperimentalWorkspaceRemoveErrors, ThrowOnError, "fields">;
|
|
365
|
+
private _adaptor?;
|
|
366
|
+
get adaptor(): Adaptor;
|
|
355
367
|
}
|
|
356
368
|
export declare class Session extends HeyApiClient {
|
|
357
369
|
/**
|
|
@@ -520,6 +532,7 @@ export declare class Session2 extends HeyApiClient {
|
|
|
520
532
|
directory?: string;
|
|
521
533
|
workspace?: string;
|
|
522
534
|
title?: string;
|
|
535
|
+
permission?: PermissionRuleset;
|
|
523
536
|
time?: {
|
|
524
537
|
archived?: number;
|
|
525
538
|
};
|
package/dist/v2/gen/sdk.gen.js
CHANGED
|
@@ -21,19 +21,6 @@ class HeyApiRegistry {
|
|
|
21
21
|
this.instances.set(key ?? this.defaultKey, value);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
export class SyncEvent extends HeyApiClient {
|
|
25
|
-
/**
|
|
26
|
-
* Subscribe to global sync events
|
|
27
|
-
*
|
|
28
|
-
* Get global sync events
|
|
29
|
-
*/
|
|
30
|
-
subscribe(options) {
|
|
31
|
-
return (options?.client ?? this.client).sse.get({
|
|
32
|
-
url: "/global/sync-event",
|
|
33
|
-
...options,
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
24
|
export class Config extends HeyApiClient {
|
|
38
25
|
/**
|
|
39
26
|
* Get global configuration
|
|
@@ -117,10 +104,6 @@ export class Global extends HeyApiClient {
|
|
|
117
104
|
},
|
|
118
105
|
});
|
|
119
106
|
}
|
|
120
|
-
_syncEvent;
|
|
121
|
-
get syncEvent() {
|
|
122
|
-
return (this._syncEvent ??= new SyncEvent({ client: this.client }));
|
|
123
|
-
}
|
|
124
107
|
_config;
|
|
125
108
|
get config() {
|
|
126
109
|
return (this._config ??= new Config({ client: this.client }));
|
|
@@ -608,6 +591,28 @@ export class Console extends HeyApiClient {
|
|
|
608
591
|
});
|
|
609
592
|
}
|
|
610
593
|
}
|
|
594
|
+
export class Adaptor extends HeyApiClient {
|
|
595
|
+
/**
|
|
596
|
+
* List workspace adaptors
|
|
597
|
+
*
|
|
598
|
+
* List all available workspace adaptors for the current project.
|
|
599
|
+
*/
|
|
600
|
+
list(parameters, options) {
|
|
601
|
+
const params = buildClientParams([parameters], [
|
|
602
|
+
{
|
|
603
|
+
args: [
|
|
604
|
+
{ in: "query", key: "directory" },
|
|
605
|
+
{ in: "query", key: "workspace" },
|
|
606
|
+
],
|
|
607
|
+
},
|
|
608
|
+
]);
|
|
609
|
+
return (options?.client ?? this.client).get({
|
|
610
|
+
url: "/experimental/workspace/adaptor",
|
|
611
|
+
...options,
|
|
612
|
+
...params,
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
}
|
|
611
616
|
export class Workspace extends HeyApiClient {
|
|
612
617
|
/**
|
|
613
618
|
* List workspaces
|
|
@@ -658,6 +663,26 @@ export class Workspace extends HeyApiClient {
|
|
|
658
663
|
},
|
|
659
664
|
});
|
|
660
665
|
}
|
|
666
|
+
/**
|
|
667
|
+
* Workspace status
|
|
668
|
+
*
|
|
669
|
+
* Get connection status for workspaces in the current project.
|
|
670
|
+
*/
|
|
671
|
+
status(parameters, options) {
|
|
672
|
+
const params = buildClientParams([parameters], [
|
|
673
|
+
{
|
|
674
|
+
args: [
|
|
675
|
+
{ in: "query", key: "directory" },
|
|
676
|
+
{ in: "query", key: "workspace" },
|
|
677
|
+
],
|
|
678
|
+
},
|
|
679
|
+
]);
|
|
680
|
+
return (options?.client ?? this.client).get({
|
|
681
|
+
url: "/experimental/workspace/status",
|
|
682
|
+
...options,
|
|
683
|
+
...params,
|
|
684
|
+
});
|
|
685
|
+
}
|
|
661
686
|
/**
|
|
662
687
|
* Remove workspace
|
|
663
688
|
*
|
|
@@ -679,6 +704,10 @@ export class Workspace extends HeyApiClient {
|
|
|
679
704
|
...params,
|
|
680
705
|
});
|
|
681
706
|
}
|
|
707
|
+
_adaptor;
|
|
708
|
+
get adaptor() {
|
|
709
|
+
return (this._adaptor ??= new Adaptor({ client: this.client }));
|
|
710
|
+
}
|
|
682
711
|
}
|
|
683
712
|
export class Session extends HeyApiClient {
|
|
684
713
|
/**
|
|
@@ -1021,6 +1050,7 @@ export class Session2 extends HeyApiClient {
|
|
|
1021
1050
|
{ in: "query", key: "directory" },
|
|
1022
1051
|
{ in: "query", key: "workspace" },
|
|
1023
1052
|
{ in: "body", key: "title" },
|
|
1053
|
+
{ in: "body", key: "permission" },
|
|
1024
1054
|
{ in: "body", key: "time" },
|
|
1025
1055
|
],
|
|
1026
1056
|
},
|
|
@@ -28,6 +28,12 @@ export type EventProjectUpdated = {
|
|
|
28
28
|
type: "project.updated";
|
|
29
29
|
properties: Project;
|
|
30
30
|
};
|
|
31
|
+
export type EventServerInstanceDisposed = {
|
|
32
|
+
type: "server.instance.disposed";
|
|
33
|
+
properties: {
|
|
34
|
+
directory: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
31
37
|
export type EventInstallationUpdated = {
|
|
32
38
|
type: "installation.updated";
|
|
33
39
|
properties: {
|
|
@@ -40,12 +46,6 @@ export type EventInstallationUpdateAvailable = {
|
|
|
40
46
|
version: string;
|
|
41
47
|
};
|
|
42
48
|
};
|
|
43
|
-
export type EventServerInstanceDisposed = {
|
|
44
|
-
type: "server.instance.disposed";
|
|
45
|
-
properties: {
|
|
46
|
-
directory: string;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
49
|
export type EventServerConnected = {
|
|
50
50
|
type: "server.connected";
|
|
51
51
|
properties: {
|
|
@@ -58,6 +58,19 @@ export type EventGlobalDisposed = {
|
|
|
58
58
|
[key: string]: unknown;
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
|
+
export type EventFileEdited = {
|
|
62
|
+
type: "file.edited";
|
|
63
|
+
properties: {
|
|
64
|
+
file: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export type EventFileWatcherUpdated = {
|
|
68
|
+
type: "file.watcher.updated";
|
|
69
|
+
properties: {
|
|
70
|
+
file: string;
|
|
71
|
+
event: "add" | "change" | "unlink";
|
|
72
|
+
};
|
|
73
|
+
};
|
|
61
74
|
export type EventLspClientDiagnostics = {
|
|
62
75
|
type: "lsp.client.diagnostics";
|
|
63
76
|
properties: {
|
|
@@ -107,27 +120,79 @@ export type EventPermissionReplied = {
|
|
|
107
120
|
reply: "once" | "always" | "reject";
|
|
108
121
|
};
|
|
109
122
|
};
|
|
110
|
-
export type
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
next: number;
|
|
117
|
-
} | {
|
|
118
|
-
type: "busy";
|
|
123
|
+
export type SnapshotFileDiff = {
|
|
124
|
+
file: string;
|
|
125
|
+
patch: string;
|
|
126
|
+
additions: number;
|
|
127
|
+
deletions: number;
|
|
128
|
+
status?: "added" | "deleted" | "modified";
|
|
119
129
|
};
|
|
120
|
-
export type
|
|
121
|
-
type: "session.
|
|
130
|
+
export type EventSessionDiff = {
|
|
131
|
+
type: "session.diff";
|
|
122
132
|
properties: {
|
|
123
133
|
sessionID: string;
|
|
124
|
-
|
|
134
|
+
diff: Array<SnapshotFileDiff>;
|
|
125
135
|
};
|
|
126
136
|
};
|
|
127
|
-
export type
|
|
128
|
-
|
|
137
|
+
export type ProviderAuthError = {
|
|
138
|
+
name: "ProviderAuthError";
|
|
139
|
+
data: {
|
|
140
|
+
providerID: string;
|
|
141
|
+
message: string;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
export type UnknownError = {
|
|
145
|
+
name: "UnknownError";
|
|
146
|
+
data: {
|
|
147
|
+
message: string;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
export type MessageOutputLengthError = {
|
|
151
|
+
name: "MessageOutputLengthError";
|
|
152
|
+
data: {
|
|
153
|
+
[key: string]: unknown;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
export type MessageAbortedError = {
|
|
157
|
+
name: "MessageAbortedError";
|
|
158
|
+
data: {
|
|
159
|
+
message: string;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
export type StructuredOutputError = {
|
|
163
|
+
name: "StructuredOutputError";
|
|
164
|
+
data: {
|
|
165
|
+
message: string;
|
|
166
|
+
retries: number;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
export type ContextOverflowError = {
|
|
170
|
+
name: "ContextOverflowError";
|
|
171
|
+
data: {
|
|
172
|
+
message: string;
|
|
173
|
+
responseBody?: string;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
export type ApiError = {
|
|
177
|
+
name: "APIError";
|
|
178
|
+
data: {
|
|
179
|
+
message: string;
|
|
180
|
+
statusCode?: number;
|
|
181
|
+
isRetryable: boolean;
|
|
182
|
+
responseHeaders?: {
|
|
183
|
+
[key: string]: string;
|
|
184
|
+
};
|
|
185
|
+
responseBody?: string;
|
|
186
|
+
metadata?: {
|
|
187
|
+
[key: string]: string;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
export type EventSessionError = {
|
|
192
|
+
type: "session.error";
|
|
129
193
|
properties: {
|
|
130
|
-
sessionID
|
|
194
|
+
sessionID?: string;
|
|
195
|
+
error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | StructuredOutputError | ContextOverflowError | ApiError;
|
|
131
196
|
};
|
|
132
197
|
};
|
|
133
198
|
export type QuestionOption = {
|
|
@@ -162,6 +227,10 @@ export type QuestionInfo = {
|
|
|
162
227
|
*/
|
|
163
228
|
custom?: boolean;
|
|
164
229
|
};
|
|
230
|
+
export type QuestionTool = {
|
|
231
|
+
messageID: string;
|
|
232
|
+
callID: string;
|
|
233
|
+
};
|
|
165
234
|
export type QuestionRequest = {
|
|
166
235
|
id: string;
|
|
167
236
|
sessionID: string;
|
|
@@ -169,49 +238,29 @@ export type QuestionRequest = {
|
|
|
169
238
|
* Questions to ask
|
|
170
239
|
*/
|
|
171
240
|
questions: Array<QuestionInfo>;
|
|
172
|
-
tool?:
|
|
173
|
-
messageID: string;
|
|
174
|
-
callID: string;
|
|
175
|
-
};
|
|
241
|
+
tool?: QuestionTool;
|
|
176
242
|
};
|
|
177
243
|
export type EventQuestionAsked = {
|
|
178
244
|
type: "question.asked";
|
|
179
245
|
properties: QuestionRequest;
|
|
180
246
|
};
|
|
181
247
|
export type QuestionAnswer = Array<string>;
|
|
248
|
+
export type QuestionReplied = {
|
|
249
|
+
sessionID: string;
|
|
250
|
+
requestID: string;
|
|
251
|
+
answers: Array<QuestionAnswer>;
|
|
252
|
+
};
|
|
182
253
|
export type EventQuestionReplied = {
|
|
183
254
|
type: "question.replied";
|
|
184
|
-
properties:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
255
|
+
properties: QuestionReplied;
|
|
256
|
+
};
|
|
257
|
+
export type QuestionRejected = {
|
|
258
|
+
sessionID: string;
|
|
259
|
+
requestID: string;
|
|
189
260
|
};
|
|
190
261
|
export type EventQuestionRejected = {
|
|
191
262
|
type: "question.rejected";
|
|
192
|
-
properties:
|
|
193
|
-
sessionID: string;
|
|
194
|
-
requestID: string;
|
|
195
|
-
};
|
|
196
|
-
};
|
|
197
|
-
export type EventSessionCompacted = {
|
|
198
|
-
type: "session.compacted";
|
|
199
|
-
properties: {
|
|
200
|
-
sessionID: string;
|
|
201
|
-
};
|
|
202
|
-
};
|
|
203
|
-
export type EventFileEdited = {
|
|
204
|
-
type: "file.edited";
|
|
205
|
-
properties: {
|
|
206
|
-
file: string;
|
|
207
|
-
};
|
|
208
|
-
};
|
|
209
|
-
export type EventFileWatcherUpdated = {
|
|
210
|
-
type: "file.watcher.updated";
|
|
211
|
-
properties: {
|
|
212
|
-
file: string;
|
|
213
|
-
event: "add" | "change" | "unlink";
|
|
214
|
-
};
|
|
263
|
+
properties: QuestionRejected;
|
|
215
264
|
};
|
|
216
265
|
export type Todo = {
|
|
217
266
|
/**
|
|
@@ -234,6 +283,35 @@ export type EventTodoUpdated = {
|
|
|
234
283
|
todos: Array<Todo>;
|
|
235
284
|
};
|
|
236
285
|
};
|
|
286
|
+
export type SessionStatus = {
|
|
287
|
+
type: "idle";
|
|
288
|
+
} | {
|
|
289
|
+
type: "retry";
|
|
290
|
+
attempt: number;
|
|
291
|
+
message: string;
|
|
292
|
+
next: number;
|
|
293
|
+
} | {
|
|
294
|
+
type: "busy";
|
|
295
|
+
};
|
|
296
|
+
export type EventSessionStatus = {
|
|
297
|
+
type: "session.status";
|
|
298
|
+
properties: {
|
|
299
|
+
sessionID: string;
|
|
300
|
+
status: SessionStatus;
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
export type EventSessionIdle = {
|
|
304
|
+
type: "session.idle";
|
|
305
|
+
properties: {
|
|
306
|
+
sessionID: string;
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
export type EventSessionCompacted = {
|
|
310
|
+
type: "session.compacted";
|
|
311
|
+
properties: {
|
|
312
|
+
sessionID: string;
|
|
313
|
+
};
|
|
314
|
+
};
|
|
237
315
|
export type EventTuiPromptAppend = {
|
|
238
316
|
type: "tui.prompt.append";
|
|
239
317
|
properties: {
|
|
@@ -289,95 +367,21 @@ export type EventCommandExecuted = {
|
|
|
289
367
|
messageID: string;
|
|
290
368
|
};
|
|
291
369
|
};
|
|
292
|
-
export type SnapshotFileDiff = {
|
|
293
|
-
file: string;
|
|
294
|
-
patch: string;
|
|
295
|
-
additions: number;
|
|
296
|
-
deletions: number;
|
|
297
|
-
status?: "added" | "deleted" | "modified";
|
|
298
|
-
};
|
|
299
|
-
export type EventSessionDiff = {
|
|
300
|
-
type: "session.diff";
|
|
301
|
-
properties: {
|
|
302
|
-
sessionID: string;
|
|
303
|
-
diff: Array<SnapshotFileDiff>;
|
|
304
|
-
};
|
|
305
|
-
};
|
|
306
|
-
export type ProviderAuthError = {
|
|
307
|
-
name: "ProviderAuthError";
|
|
308
|
-
data: {
|
|
309
|
-
providerID: string;
|
|
310
|
-
message: string;
|
|
311
|
-
};
|
|
312
|
-
};
|
|
313
|
-
export type UnknownError = {
|
|
314
|
-
name: "UnknownError";
|
|
315
|
-
data: {
|
|
316
|
-
message: string;
|
|
317
|
-
};
|
|
318
|
-
};
|
|
319
|
-
export type MessageOutputLengthError = {
|
|
320
|
-
name: "MessageOutputLengthError";
|
|
321
|
-
data: {
|
|
322
|
-
[key: string]: unknown;
|
|
323
|
-
};
|
|
324
|
-
};
|
|
325
|
-
export type MessageAbortedError = {
|
|
326
|
-
name: "MessageAbortedError";
|
|
327
|
-
data: {
|
|
328
|
-
message: string;
|
|
329
|
-
};
|
|
330
|
-
};
|
|
331
|
-
export type StructuredOutputError = {
|
|
332
|
-
name: "StructuredOutputError";
|
|
333
|
-
data: {
|
|
334
|
-
message: string;
|
|
335
|
-
retries: number;
|
|
336
|
-
};
|
|
337
|
-
};
|
|
338
|
-
export type ContextOverflowError = {
|
|
339
|
-
name: "ContextOverflowError";
|
|
340
|
-
data: {
|
|
341
|
-
message: string;
|
|
342
|
-
responseBody?: string;
|
|
343
|
-
};
|
|
344
|
-
};
|
|
345
|
-
export type ApiError = {
|
|
346
|
-
name: "APIError";
|
|
347
|
-
data: {
|
|
348
|
-
message: string;
|
|
349
|
-
statusCode?: number;
|
|
350
|
-
isRetryable: boolean;
|
|
351
|
-
responseHeaders?: {
|
|
352
|
-
[key: string]: string;
|
|
353
|
-
};
|
|
354
|
-
responseBody?: string;
|
|
355
|
-
metadata?: {
|
|
356
|
-
[key: string]: string;
|
|
357
|
-
};
|
|
358
|
-
};
|
|
359
|
-
};
|
|
360
|
-
export type EventSessionError = {
|
|
361
|
-
type: "session.error";
|
|
362
|
-
properties: {
|
|
363
|
-
sessionID?: string;
|
|
364
|
-
error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | StructuredOutputError | ContextOverflowError | ApiError;
|
|
365
|
-
};
|
|
366
|
-
};
|
|
367
370
|
export type EventVcsBranchUpdated = {
|
|
368
371
|
type: "vcs.branch.updated";
|
|
369
372
|
properties: {
|
|
370
373
|
branch?: string;
|
|
371
374
|
};
|
|
372
375
|
};
|
|
373
|
-
export type
|
|
374
|
-
type: "
|
|
376
|
+
export type EventWorktreeReady = {
|
|
377
|
+
type: "worktree.ready";
|
|
375
378
|
properties: {
|
|
376
379
|
name: string;
|
|
380
|
+
branch: string;
|
|
377
381
|
};
|
|
378
382
|
};
|
|
379
|
-
export type
|
|
380
|
-
type: "
|
|
383
|
+
export type EventWorktreeFailed = {
|
|
384
|
+
type: "worktree.failed";
|
|
381
385
|
properties: {
|
|
382
386
|
message: string;
|
|
383
387
|
};
|
|
@@ -416,19 +420,26 @@ export type EventPtyDeleted = {
|
|
|
416
420
|
id: string;
|
|
417
421
|
};
|
|
418
422
|
};
|
|
419
|
-
export type
|
|
420
|
-
type: "
|
|
423
|
+
export type EventWorkspaceReady = {
|
|
424
|
+
type: "workspace.ready";
|
|
421
425
|
properties: {
|
|
422
426
|
name: string;
|
|
423
|
-
branch: string;
|
|
424
427
|
};
|
|
425
428
|
};
|
|
426
|
-
export type
|
|
427
|
-
type: "
|
|
429
|
+
export type EventWorkspaceFailed = {
|
|
430
|
+
type: "workspace.failed";
|
|
428
431
|
properties: {
|
|
429
432
|
message: string;
|
|
430
433
|
};
|
|
431
434
|
};
|
|
435
|
+
export type EventWorkspaceStatus = {
|
|
436
|
+
type: "workspace.status";
|
|
437
|
+
properties: {
|
|
438
|
+
workspaceID: string;
|
|
439
|
+
status: "connected" | "connecting" | "disconnected" | "error";
|
|
440
|
+
error?: string;
|
|
441
|
+
};
|
|
442
|
+
};
|
|
432
443
|
export type OutputFormatText = {
|
|
433
444
|
type: "text";
|
|
434
445
|
};
|
|
@@ -816,30 +827,34 @@ export type EventSessionDeleted = {
|
|
|
816
827
|
info: Session;
|
|
817
828
|
};
|
|
818
829
|
};
|
|
819
|
-
export type Event = EventProjectUpdated | EventInstallationUpdated | EventInstallationUpdateAvailable | EventServerInstanceDisposed | EventServerConnected | EventGlobalDisposed | EventLspClientDiagnostics | EventLspUpdated | EventMessagePartDelta | EventPermissionAsked | EventPermissionReplied | EventSessionStatus | EventSessionIdle | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventSessionCompacted | EventFileEdited | EventFileWatcherUpdated | EventTodoUpdated | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventCommandExecuted | EventSessionDiff | EventSessionError | EventVcsBranchUpdated | EventWorkspaceReady | EventWorkspaceFailed | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventWorktreeReady | EventWorktreeFailed | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventSessionCreated | EventSessionUpdated | EventSessionDeleted;
|
|
820
|
-
export type GlobalEvent = {
|
|
821
|
-
directory: string;
|
|
822
|
-
payload: Event;
|
|
823
|
-
};
|
|
824
830
|
export type SyncEventMessageUpdated = {
|
|
825
|
-
type: "
|
|
826
|
-
|
|
831
|
+
type: "sync";
|
|
832
|
+
name: "message.updated.1";
|
|
833
|
+
id: string;
|
|
834
|
+
seq: number;
|
|
835
|
+
aggregateID: "sessionID";
|
|
827
836
|
data: {
|
|
828
837
|
sessionID: string;
|
|
829
838
|
info: Message;
|
|
830
839
|
};
|
|
831
840
|
};
|
|
832
841
|
export type SyncEventMessageRemoved = {
|
|
833
|
-
type: "
|
|
834
|
-
|
|
842
|
+
type: "sync";
|
|
843
|
+
name: "message.removed.1";
|
|
844
|
+
id: string;
|
|
845
|
+
seq: number;
|
|
846
|
+
aggregateID: "sessionID";
|
|
835
847
|
data: {
|
|
836
848
|
sessionID: string;
|
|
837
849
|
messageID: string;
|
|
838
850
|
};
|
|
839
851
|
};
|
|
840
852
|
export type SyncEventMessagePartUpdated = {
|
|
841
|
-
type: "
|
|
842
|
-
|
|
853
|
+
type: "sync";
|
|
854
|
+
name: "message.part.updated.1";
|
|
855
|
+
id: string;
|
|
856
|
+
seq: number;
|
|
857
|
+
aggregateID: "sessionID";
|
|
843
858
|
data: {
|
|
844
859
|
sessionID: string;
|
|
845
860
|
part: Part;
|
|
@@ -847,8 +862,11 @@ export type SyncEventMessagePartUpdated = {
|
|
|
847
862
|
};
|
|
848
863
|
};
|
|
849
864
|
export type SyncEventMessagePartRemoved = {
|
|
850
|
-
type: "
|
|
851
|
-
|
|
865
|
+
type: "sync";
|
|
866
|
+
name: "message.part.removed.1";
|
|
867
|
+
id: string;
|
|
868
|
+
seq: number;
|
|
869
|
+
aggregateID: "sessionID";
|
|
852
870
|
data: {
|
|
853
871
|
sessionID: string;
|
|
854
872
|
messageID: string;
|
|
@@ -856,16 +874,22 @@ export type SyncEventMessagePartRemoved = {
|
|
|
856
874
|
};
|
|
857
875
|
};
|
|
858
876
|
export type SyncEventSessionCreated = {
|
|
859
|
-
type: "
|
|
860
|
-
|
|
877
|
+
type: "sync";
|
|
878
|
+
name: "session.created.1";
|
|
879
|
+
id: string;
|
|
880
|
+
seq: number;
|
|
881
|
+
aggregateID: "sessionID";
|
|
861
882
|
data: {
|
|
862
883
|
sessionID: string;
|
|
863
884
|
info: Session;
|
|
864
885
|
};
|
|
865
886
|
};
|
|
866
887
|
export type SyncEventSessionUpdated = {
|
|
867
|
-
type: "
|
|
868
|
-
|
|
888
|
+
type: "sync";
|
|
889
|
+
name: "session.updated.1";
|
|
890
|
+
id: string;
|
|
891
|
+
seq: number;
|
|
892
|
+
aggregateID: "sessionID";
|
|
869
893
|
data: {
|
|
870
894
|
sessionID: string;
|
|
871
895
|
info: {
|
|
@@ -903,15 +927,21 @@ export type SyncEventSessionUpdated = {
|
|
|
903
927
|
};
|
|
904
928
|
};
|
|
905
929
|
export type SyncEventSessionDeleted = {
|
|
906
|
-
type: "
|
|
907
|
-
|
|
930
|
+
type: "sync";
|
|
931
|
+
name: "session.deleted.1";
|
|
932
|
+
id: string;
|
|
933
|
+
seq: number;
|
|
934
|
+
aggregateID: "sessionID";
|
|
908
935
|
data: {
|
|
909
936
|
sessionID: string;
|
|
910
937
|
info: Session;
|
|
911
938
|
};
|
|
912
939
|
};
|
|
913
|
-
export type
|
|
914
|
-
|
|
940
|
+
export type GlobalEvent = {
|
|
941
|
+
directory: string;
|
|
942
|
+
project?: string;
|
|
943
|
+
workspace?: string;
|
|
944
|
+
payload: EventProjectUpdated | EventServerInstanceDisposed | EventInstallationUpdated | EventInstallationUpdateAvailable | EventServerConnected | EventGlobalDisposed | EventFileEdited | EventFileWatcherUpdated | EventLspClientDiagnostics | EventLspUpdated | EventMessagePartDelta | EventPermissionAsked | EventPermissionReplied | EventSessionDiff | EventSessionError | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventTodoUpdated | EventSessionStatus | EventSessionIdle | EventSessionCompacted | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventCommandExecuted | EventVcsBranchUpdated | EventWorktreeReady | EventWorktreeFailed | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventWorkspaceReady | EventWorkspaceFailed | EventWorkspaceStatus | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | SyncEventMessageUpdated | SyncEventMessageRemoved | SyncEventMessagePartUpdated | SyncEventMessagePartRemoved | SyncEventSessionCreated | SyncEventSessionUpdated | SyncEventSessionDeleted;
|
|
915
945
|
};
|
|
916
946
|
/**
|
|
917
947
|
* Log level
|
|
@@ -1141,6 +1171,10 @@ export type McpOAuthConfig = {
|
|
|
1141
1171
|
* OAuth scopes to request during authorization
|
|
1142
1172
|
*/
|
|
1143
1173
|
scope?: string;
|
|
1174
|
+
/**
|
|
1175
|
+
* OAuth redirect URI (default: http://127.0.0.1:19876/mcp/oauth/callback).
|
|
1176
|
+
*/
|
|
1177
|
+
redirectUri?: string;
|
|
1144
1178
|
};
|
|
1145
1179
|
export type McpRemoteConfig = {
|
|
1146
1180
|
/**
|
|
@@ -1493,8 +1527,8 @@ export type ToolList = Array<ToolListItem>;
|
|
|
1493
1527
|
export type Workspace = {
|
|
1494
1528
|
id: string;
|
|
1495
1529
|
type: string;
|
|
1530
|
+
name: string;
|
|
1496
1531
|
branch: string | null;
|
|
1497
|
-
name: string | null;
|
|
1498
1532
|
directory: string | null;
|
|
1499
1533
|
extra: unknown | null;
|
|
1500
1534
|
projectID: string;
|
|
@@ -1682,6 +1716,7 @@ export type File = {
|
|
|
1682
1716
|
removed: number;
|
|
1683
1717
|
status: "added" | "deleted" | "modified";
|
|
1684
1718
|
};
|
|
1719
|
+
export type Event = EventProjectUpdated | EventServerInstanceDisposed | EventInstallationUpdated | EventInstallationUpdateAvailable | EventServerConnected | EventGlobalDisposed | EventFileEdited | EventFileWatcherUpdated | EventLspClientDiagnostics | EventLspUpdated | EventMessagePartDelta | EventPermissionAsked | EventPermissionReplied | EventSessionDiff | EventSessionError | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventTodoUpdated | EventSessionStatus | EventSessionIdle | EventSessionCompacted | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventCommandExecuted | EventVcsBranchUpdated | EventWorktreeReady | EventWorktreeFailed | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventWorkspaceReady | EventWorkspaceFailed | EventWorkspaceStatus | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventSessionCreated | EventSessionUpdated | EventSessionDeleted;
|
|
1685
1720
|
export type McpStatusConnected = {
|
|
1686
1721
|
status: "connected";
|
|
1687
1722
|
};
|
|
@@ -1789,19 +1824,6 @@ export type GlobalEventResponses = {
|
|
|
1789
1824
|
200: GlobalEvent;
|
|
1790
1825
|
};
|
|
1791
1826
|
export type GlobalEventResponse = GlobalEventResponses[keyof GlobalEventResponses];
|
|
1792
|
-
export type GlobalSyncEventSubscribeData = {
|
|
1793
|
-
body?: never;
|
|
1794
|
-
path?: never;
|
|
1795
|
-
query?: never;
|
|
1796
|
-
url: "/global/sync-event";
|
|
1797
|
-
};
|
|
1798
|
-
export type GlobalSyncEventSubscribeResponses = {
|
|
1799
|
-
/**
|
|
1800
|
-
* Event stream
|
|
1801
|
-
*/
|
|
1802
|
-
200: SyncEvent;
|
|
1803
|
-
};
|
|
1804
|
-
export type GlobalSyncEventSubscribeResponse = GlobalSyncEventSubscribeResponses[keyof GlobalSyncEventSubscribeResponses];
|
|
1805
1827
|
export type GlobalConfigGetData = {
|
|
1806
1828
|
body?: never;
|
|
1807
1829
|
path?: never;
|
|
@@ -2377,6 +2399,26 @@ export type ToolListResponses = {
|
|
|
2377
2399
|
200: ToolList;
|
|
2378
2400
|
};
|
|
2379
2401
|
export type ToolListResponse = ToolListResponses[keyof ToolListResponses];
|
|
2402
|
+
export type ExperimentalWorkspaceAdaptorListData = {
|
|
2403
|
+
body?: never;
|
|
2404
|
+
path?: never;
|
|
2405
|
+
query?: {
|
|
2406
|
+
directory?: string;
|
|
2407
|
+
workspace?: string;
|
|
2408
|
+
};
|
|
2409
|
+
url: "/experimental/workspace/adaptor";
|
|
2410
|
+
};
|
|
2411
|
+
export type ExperimentalWorkspaceAdaptorListResponses = {
|
|
2412
|
+
/**
|
|
2413
|
+
* Workspace adaptors
|
|
2414
|
+
*/
|
|
2415
|
+
200: Array<{
|
|
2416
|
+
type: string;
|
|
2417
|
+
name: string;
|
|
2418
|
+
description: string;
|
|
2419
|
+
}>;
|
|
2420
|
+
};
|
|
2421
|
+
export type ExperimentalWorkspaceAdaptorListResponse = ExperimentalWorkspaceAdaptorListResponses[keyof ExperimentalWorkspaceAdaptorListResponses];
|
|
2380
2422
|
export type ExperimentalWorkspaceListData = {
|
|
2381
2423
|
body?: never;
|
|
2382
2424
|
path?: never;
|
|
@@ -2421,6 +2463,26 @@ export type ExperimentalWorkspaceCreateResponses = {
|
|
|
2421
2463
|
200: Workspace;
|
|
2422
2464
|
};
|
|
2423
2465
|
export type ExperimentalWorkspaceCreateResponse = ExperimentalWorkspaceCreateResponses[keyof ExperimentalWorkspaceCreateResponses];
|
|
2466
|
+
export type ExperimentalWorkspaceStatusData = {
|
|
2467
|
+
body?: never;
|
|
2468
|
+
path?: never;
|
|
2469
|
+
query?: {
|
|
2470
|
+
directory?: string;
|
|
2471
|
+
workspace?: string;
|
|
2472
|
+
};
|
|
2473
|
+
url: "/experimental/workspace/status";
|
|
2474
|
+
};
|
|
2475
|
+
export type ExperimentalWorkspaceStatusResponses = {
|
|
2476
|
+
/**
|
|
2477
|
+
* Workspace status
|
|
2478
|
+
*/
|
|
2479
|
+
200: Array<{
|
|
2480
|
+
workspaceID: string;
|
|
2481
|
+
status: "connected" | "connecting" | "disconnected" | "error";
|
|
2482
|
+
error?: string;
|
|
2483
|
+
}>;
|
|
2484
|
+
};
|
|
2485
|
+
export type ExperimentalWorkspaceStatusResponse = ExperimentalWorkspaceStatusResponses[keyof ExperimentalWorkspaceStatusResponses];
|
|
2424
2486
|
export type ExperimentalWorkspaceRemoveData = {
|
|
2425
2487
|
body?: never;
|
|
2426
2488
|
path: {
|
|
@@ -2741,6 +2803,7 @@ export type SessionGetResponse = SessionGetResponses[keyof SessionGetResponses];
|
|
|
2741
2803
|
export type SessionUpdateData = {
|
|
2742
2804
|
body?: {
|
|
2743
2805
|
title?: string;
|
|
2806
|
+
permission?: PermissionRuleset;
|
|
2744
2807
|
time?: {
|
|
2745
2808
|
archived?: number;
|
|
2746
2809
|
};
|