@kilocode/sdk 7.3.22 → 7.3.29
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.js +2 -0
- package/dist/error-interceptor.d.ts +15 -0
- package/dist/error-interceptor.js +44 -0
- package/dist/gen/types.gen.d.ts +2 -2
- package/dist/v2/client.js +2 -20
- package/dist/v2/gen/sdk.gen.d.ts +10 -0
- package/dist/v2/gen/sdk.gen.js +10 -0
- package/dist/v2/gen/types.gen.d.ts +112 -90
- package/package.json +2 -2
package/dist/client.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./gen/types.gen.js";
|
|
2
2
|
import { createClient } from "./gen/client/client.gen.js";
|
|
3
3
|
import { KiloClient } from "./gen/sdk.gen.js";
|
|
4
|
+
import { wrapClientError } from "./error-interceptor.js";
|
|
4
5
|
export { KiloClient };
|
|
5
6
|
function pick(value, fallback) {
|
|
6
7
|
if (!value)
|
|
@@ -56,5 +57,6 @@ export function createKiloClient(config) {
|
|
|
56
57
|
config.duplex = "half";
|
|
57
58
|
const client = createClient(config);
|
|
58
59
|
client.interceptors.request.use((request) => rewrite(request, config?.directory));
|
|
60
|
+
client.interceptors.error.use(wrapClientError);
|
|
59
61
|
return new KiloClient({ client });
|
|
60
62
|
}
|
|
@@ -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,44 @@
|
|
|
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
|
+
// kilocode_change
|
|
34
|
+
return new Error(`kilo server ${describe(request, response)}: ${reason}`, {
|
|
35
|
+
cause: { body: error, status: response?.status },
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function describe(request, response) {
|
|
39
|
+
const method = request?.method ?? "?";
|
|
40
|
+
const url = request?.url ?? "?";
|
|
41
|
+
const status = response?.status;
|
|
42
|
+
const statusText = response?.statusText;
|
|
43
|
+
return `${method} ${url}${status ? " → " + status : ""}${statusText ? " " + statusText : ""}`;
|
|
44
|
+
}
|
package/dist/gen/types.gen.d.ts
CHANGED
|
@@ -911,7 +911,7 @@ export type ProviderConfig = {
|
|
|
911
911
|
output: Array<"text" | "audio" | "image" | "video" | "pdf">;
|
|
912
912
|
};
|
|
913
913
|
experimental?: boolean;
|
|
914
|
-
status?: "alpha" | "beta" | "deprecated";
|
|
914
|
+
status?: "alpha" | "beta" | "deprecated" | "active";
|
|
915
915
|
options?: {
|
|
916
916
|
[key: string]: unknown;
|
|
917
917
|
};
|
|
@@ -2619,7 +2619,7 @@ export type ProviderListResponses = {
|
|
|
2619
2619
|
output: Array<"text" | "audio" | "image" | "video" | "pdf">;
|
|
2620
2620
|
};
|
|
2621
2621
|
experimental?: boolean;
|
|
2622
|
-
status?: "alpha" | "beta" | "deprecated";
|
|
2622
|
+
status?: "alpha" | "beta" | "deprecated" | "active";
|
|
2623
2623
|
options: {
|
|
2624
2624
|
[key: string]: unknown;
|
|
2625
2625
|
};
|
package/dist/v2/client.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./gen/types.gen.js";
|
|
2
2
|
import { createClient } from "./gen/client/client.gen.js";
|
|
3
3
|
import { KiloClient } from "./gen/sdk.gen.js";
|
|
4
|
+
import { wrapClientError } from "../error-interceptor.js";
|
|
4
5
|
export { KiloClient };
|
|
5
6
|
function pick(value, fallback, encode) {
|
|
6
7
|
if (!value)
|
|
@@ -81,25 +82,6 @@ export function createKiloClient(config) {
|
|
|
81
82
|
throw new Error("Request is not supported by this version of OpenCode Server (Server responded with text/html)");
|
|
82
83
|
return response;
|
|
83
84
|
});
|
|
84
|
-
|
|
85
|
-
// responds with an empty / unparseable error body, which surfaces as a bare
|
|
86
|
-
// `{}` in TUI / CLI error output. Wrap ONLY that case in a real Error so
|
|
87
|
-
// downstream formatters get a useful message — but pass through any parsed
|
|
88
|
-
// JSON error body unchanged so existing consumers can still inspect fields.
|
|
89
|
-
client.interceptors.error.use((error, response, request) => {
|
|
90
|
-
const isEmpty = error === undefined ||
|
|
91
|
-
error === null ||
|
|
92
|
-
error === "" ||
|
|
93
|
-
(typeof error === "object" && !(error instanceof Error) && Object.keys(error).length === 0);
|
|
94
|
-
if (!isEmpty)
|
|
95
|
-
return error;
|
|
96
|
-
const method = request?.method ?? "?";
|
|
97
|
-
const url = request?.url ?? "?";
|
|
98
|
-
if (!response)
|
|
99
|
-
return new Error(`kilo server ${method} ${url}: network error (no response)`);
|
|
100
|
-
const status = response.status;
|
|
101
|
-
const statusText = response.statusText ? " " + response.statusText : "";
|
|
102
|
-
return new Error(`kilo server ${method} ${url} → ${status}${statusText}: (empty response body)`);
|
|
103
|
-
});
|
|
85
|
+
client.interceptors.error.use(wrapClientError);
|
|
104
86
|
return new KiloClient({ client });
|
|
105
87
|
}
|
package/dist/v2/gen/sdk.gen.d.ts
CHANGED
|
@@ -1483,6 +1483,13 @@ export declare class Session3 extends HeyApiClient {
|
|
|
1483
1483
|
list<ThrowOnError extends boolean = false>(parameters?: {
|
|
1484
1484
|
directory?: string;
|
|
1485
1485
|
workspace?: string;
|
|
1486
|
+
limit?: number;
|
|
1487
|
+
order?: "asc" | "desc";
|
|
1488
|
+
path?: string;
|
|
1489
|
+
roots?: boolean | "true" | "false";
|
|
1490
|
+
start?: number;
|
|
1491
|
+
search?: string;
|
|
1492
|
+
cursor?: string;
|
|
1486
1493
|
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<V2SessionListResponses, V2SessionListErrors, ThrowOnError, "fields">;
|
|
1487
1494
|
/**
|
|
1488
1495
|
* Send v2 message
|
|
@@ -1535,6 +1542,9 @@ export declare class Session3 extends HeyApiClient {
|
|
|
1535
1542
|
sessionID: string;
|
|
1536
1543
|
directory?: string;
|
|
1537
1544
|
workspace?: string;
|
|
1545
|
+
limit?: number;
|
|
1546
|
+
order?: "asc" | "desc";
|
|
1547
|
+
cursor?: string;
|
|
1538
1548
|
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<V2SessionMessagesResponses, V2SessionMessagesErrors, ThrowOnError, "fields">;
|
|
1539
1549
|
}
|
|
1540
1550
|
export declare class V2 extends HeyApiClient {
|
package/dist/v2/gen/sdk.gen.js
CHANGED
|
@@ -2973,6 +2973,13 @@ export class Session3 extends HeyApiClient {
|
|
|
2973
2973
|
args: [
|
|
2974
2974
|
{ in: "query", key: "directory" },
|
|
2975
2975
|
{ in: "query", key: "workspace" },
|
|
2976
|
+
{ in: "query", key: "limit" },
|
|
2977
|
+
{ in: "query", key: "order" },
|
|
2978
|
+
{ in: "query", key: "path" },
|
|
2979
|
+
{ in: "query", key: "roots" },
|
|
2980
|
+
{ in: "query", key: "start" },
|
|
2981
|
+
{ in: "query", key: "search" },
|
|
2982
|
+
{ in: "query", key: "cursor" },
|
|
2976
2983
|
],
|
|
2977
2984
|
},
|
|
2978
2985
|
]);
|
|
@@ -3085,6 +3092,9 @@ export class Session3 extends HeyApiClient {
|
|
|
3085
3092
|
{ in: "path", key: "sessionID" },
|
|
3086
3093
|
{ in: "query", key: "directory" },
|
|
3087
3094
|
{ in: "query", key: "workspace" },
|
|
3095
|
+
{ in: "query", key: "limit" },
|
|
3096
|
+
{ in: "query", key: "order" },
|
|
3097
|
+
{ in: "query", key: "cursor" },
|
|
3088
3098
|
],
|
|
3089
3099
|
},
|
|
3090
3100
|
]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type ClientOptions = {
|
|
2
2
|
baseUrl: `${string}://${string}` | (string & {});
|
|
3
3
|
};
|
|
4
|
-
export type Event =
|
|
4
|
+
export type Event = EventServerConnected | EventGlobalDisposed | EventGlobalConfigUpdated | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow1 | EventTuiSessionSelect | EventKilocodeAgentManagerStart | EventIndexingStatus | EventServerInstanceDisposed | EventFileEdited | EventFileWatcherUpdated | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventLspClientDiagnostics | EventLspUpdated | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventSessionNetworkAsked | EventSessionNetworkReplied | EventSessionNetworkRejected | EventSessionNetworkRestored | EventMessagePartDelta | EventPermissionAsked | EventPermissionReplied | EventBackgroundProcessUpdated | EventBackgroundProcessDeleted | EventSessionTurnOpen | EventSessionTurnClose | EventSessionDiff | EventSessionError | EventInstallationUpdated | EventInstallationUpdateAvailable | EventTodoUpdated | EventSessionStatus | EventSessionIdle | EventSuggestionShown | EventSuggestionAccepted | EventSuggestionDismissed | EventSessionCompacted | EventCommandExecuted | EventProjectUpdated | EventVcsBranchUpdated | EventKiloSessionsRemoteStatusChanged | EventWorkspaceReady | EventWorkspaceFailed | EventWorkspaceStatus | EventWorktreeReady | EventWorktreeFailed | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventSessionNextAgentSwitched | EventSessionNextModelSwitched | EventSessionNextPrompted | EventSessionNextSynthetic | EventSessionNextShellStarted | EventSessionNextShellEnded | EventSessionNextStepStarted | EventSessionNextStepEnded | EventSessionNextStepFailed | EventSessionNextTextStarted | EventSessionNextTextDelta | EventSessionNextTextEnded | EventSessionNextReasoningStarted | EventSessionNextReasoningDelta | EventSessionNextReasoningEnded | EventSessionNextToolInputStarted | EventSessionNextToolInputDelta | EventSessionNextToolInputEnded | EventSessionNextToolCalled | EventSessionNextToolProgress | EventSessionNextToolSuccess | EventSessionNextToolFailed | EventSessionNextRetried | EventSessionNextCompactionStarted | EventSessionNextCompactionDelta | EventSessionNextCompactionEnded;
|
|
5
5
|
export type OAuth = {
|
|
6
6
|
type: "oauth";
|
|
7
7
|
refresh: string;
|
|
@@ -23,6 +23,48 @@ export type WellKnownAuth = {
|
|
|
23
23
|
token: string;
|
|
24
24
|
};
|
|
25
25
|
export type Auth = OAuth | ApiAuth | WellKnownAuth;
|
|
26
|
+
export type EventTuiPromptAppend = {
|
|
27
|
+
id: string;
|
|
28
|
+
type: "tui.prompt.append";
|
|
29
|
+
properties: {
|
|
30
|
+
text: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export type EventTuiCommandExecute = {
|
|
34
|
+
id: string;
|
|
35
|
+
type: "tui.command.execute";
|
|
36
|
+
properties: {
|
|
37
|
+
command: "session.list" | "session.new" | "session.share" | "session.interrupt" | "session.compact" | "session.page.up" | "session.page.down" | "session.line.up" | "session.line.down" | "session.half.page.up" | "session.half.page.down" | "session.first" | "session.last" | "prompt.clear" | "prompt.submit" | "agent.cycle" | string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export type EventTuiToastShow = {
|
|
41
|
+
id: string;
|
|
42
|
+
type: "tui.toast.show";
|
|
43
|
+
properties: {
|
|
44
|
+
title?: string;
|
|
45
|
+
message: string;
|
|
46
|
+
variant: "info" | "success" | "warning" | "error";
|
|
47
|
+
duration?: number;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export type EventTuiSessionSelect = {
|
|
51
|
+
id: string;
|
|
52
|
+
type: "tui.session.select";
|
|
53
|
+
properties: {
|
|
54
|
+
/**
|
|
55
|
+
* Session ID to navigate to
|
|
56
|
+
*/
|
|
57
|
+
sessionID: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export type IndexingStatusState = "Disabled" | "In Progress" | "Complete" | "Error" | "Standby";
|
|
61
|
+
export type IndexingStatus = {
|
|
62
|
+
state: IndexingStatusState;
|
|
63
|
+
message: string;
|
|
64
|
+
processedFiles: number;
|
|
65
|
+
totalFiles: number;
|
|
66
|
+
percent: number;
|
|
67
|
+
};
|
|
26
68
|
export type QuestionOption = {
|
|
27
69
|
/**
|
|
28
70
|
* Display text (1-5 words, concise)
|
|
@@ -78,40 +120,6 @@ export type QuestionRejected = {
|
|
|
78
120
|
sessionID: string;
|
|
79
121
|
requestID: string;
|
|
80
122
|
};
|
|
81
|
-
export type EventTuiPromptAppend = {
|
|
82
|
-
id: string;
|
|
83
|
-
type: "tui.prompt.append";
|
|
84
|
-
properties: {
|
|
85
|
-
text: string;
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
export type EventTuiCommandExecute = {
|
|
89
|
-
id: string;
|
|
90
|
-
type: "tui.command.execute";
|
|
91
|
-
properties: {
|
|
92
|
-
command: "session.list" | "session.new" | "session.share" | "session.interrupt" | "session.compact" | "session.page.up" | "session.page.down" | "session.line.up" | "session.line.down" | "session.half.page.up" | "session.half.page.down" | "session.first" | "session.last" | "prompt.clear" | "prompt.submit" | "agent.cycle" | string;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
export type EventTuiToastShow = {
|
|
96
|
-
id: string;
|
|
97
|
-
type: "tui.toast.show";
|
|
98
|
-
properties: {
|
|
99
|
-
title?: string;
|
|
100
|
-
message: string;
|
|
101
|
-
variant: "info" | "success" | "warning" | "error";
|
|
102
|
-
duration?: number;
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
export type EventTuiSessionSelect = {
|
|
106
|
-
id: string;
|
|
107
|
-
type: "tui.session.select";
|
|
108
|
-
properties: {
|
|
109
|
-
/**
|
|
110
|
-
* Session ID to navigate to
|
|
111
|
-
*/
|
|
112
|
-
sessionID: string;
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
123
|
export type SessionNetworkWait = {
|
|
116
124
|
id: string;
|
|
117
125
|
sessionID: string;
|
|
@@ -156,8 +164,8 @@ export type BackgroundProcessInfo = {
|
|
|
156
164
|
};
|
|
157
165
|
};
|
|
158
166
|
export type SnapshotFileDiff = {
|
|
159
|
-
file
|
|
160
|
-
patch
|
|
167
|
+
file?: string;
|
|
168
|
+
patch?: string;
|
|
161
169
|
additions: number;
|
|
162
170
|
deletions: number;
|
|
163
171
|
status?: "added" | "deleted" | "modified";
|
|
@@ -611,7 +619,7 @@ export type CompactionPart = {
|
|
|
611
619
|
};
|
|
612
620
|
export type Part = TextPart | SubtaskPart | ReasoningPart | FilePart | ToolPart | StepStartPart | StepFinishPart | SnapshotPart | PatchPart | AgentPart | RetryPart | CompactionPart;
|
|
613
621
|
export type SnapshotSummaryFileDiff = {
|
|
614
|
-
file
|
|
622
|
+
file?: string;
|
|
615
623
|
additions: number;
|
|
616
624
|
deletions: number;
|
|
617
625
|
status?: "added" | "deleted" | "modified";
|
|
@@ -667,19 +675,11 @@ export type Prompt = {
|
|
|
667
675
|
files?: Array<PromptFileAttachment>;
|
|
668
676
|
agents?: Array<PromptAgentAttachment>;
|
|
669
677
|
};
|
|
670
|
-
export type IndexingStatusState = "Disabled" | "In Progress" | "Complete" | "Error" | "Standby";
|
|
671
|
-
export type IndexingStatus = {
|
|
672
|
-
state: IndexingStatusState;
|
|
673
|
-
message: string;
|
|
674
|
-
processedFiles: number;
|
|
675
|
-
totalFiles: number;
|
|
676
|
-
percent: number;
|
|
677
|
-
};
|
|
678
678
|
export type GlobalEvent = {
|
|
679
679
|
directory: string;
|
|
680
680
|
project?: string;
|
|
681
681
|
workspace?: string;
|
|
682
|
-
payload:
|
|
682
|
+
payload: EventServerConnected | EventGlobalDisposed | EventGlobalConfigUpdated | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect | EventKilocodeAgentManagerStart | EventIndexingStatus | EventServerInstanceDisposed | EventFileEdited | EventFileWatcherUpdated | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventLspClientDiagnostics | EventLspUpdated | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventSessionNetworkAsked | EventSessionNetworkReplied | EventSessionNetworkRejected | EventSessionNetworkRestored | EventMessagePartDelta | EventPermissionAsked | EventPermissionReplied | EventBackgroundProcessUpdated | EventBackgroundProcessDeleted | EventSessionTurnOpen | EventSessionTurnClose | EventSessionDiff | EventSessionError | EventInstallationUpdated | EventInstallationUpdateAvailable | EventTodoUpdated | EventSessionStatus | EventSessionIdle | EventSuggestionShown | EventSuggestionAccepted | EventSuggestionDismissed | EventSessionCompacted | EventCommandExecuted | EventProjectUpdated | EventVcsBranchUpdated | EventKiloSessionsRemoteStatusChanged | EventWorkspaceReady | EventWorkspaceFailed | EventWorkspaceStatus | EventWorktreeReady | EventWorktreeFailed | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventSessionNextAgentSwitched | EventSessionNextModelSwitched | EventSessionNextPrompted | EventSessionNextSynthetic | EventSessionNextShellStarted | EventSessionNextShellEnded | EventSessionNextStepStarted | EventSessionNextStepEnded | EventSessionNextStepFailed | EventSessionNextTextStarted | EventSessionNextTextDelta | EventSessionNextTextEnded | EventSessionNextReasoningStarted | EventSessionNextReasoningDelta | EventSessionNextReasoningEnded | EventSessionNextToolInputStarted | EventSessionNextToolInputDelta | EventSessionNextToolInputEnded | EventSessionNextToolCalled | EventSessionNextToolProgress | EventSessionNextToolSuccess | EventSessionNextToolFailed | EventSessionNextRetried | EventSessionNextCompactionStarted | EventSessionNextCompactionDelta | EventSessionNextCompactionEnded | SyncEventMessageUpdated | SyncEventMessageRemoved | SyncEventMessagePartUpdated | SyncEventMessagePartRemoved | SyncEventSessionCreated | SyncEventSessionUpdated | SyncEventSessionDeleted | SyncEventSessionNextAgentSwitched | SyncEventSessionNextModelSwitched | SyncEventSessionNextPrompted | SyncEventSessionNextSynthetic | SyncEventSessionNextShellStarted | SyncEventSessionNextShellEnded | SyncEventSessionNextStepStarted | SyncEventSessionNextStepEnded | SyncEventSessionNextStepFailed | SyncEventSessionNextTextStarted | SyncEventSessionNextTextDelta | SyncEventSessionNextTextEnded | SyncEventSessionNextReasoningStarted | SyncEventSessionNextReasoningDelta | SyncEventSessionNextReasoningEnded | SyncEventSessionNextToolInputStarted | SyncEventSessionNextToolInputDelta | SyncEventSessionNextToolInputEnded | SyncEventSessionNextToolCalled | SyncEventSessionNextToolProgress | SyncEventSessionNextToolSuccess | SyncEventSessionNextToolFailed | SyncEventSessionNextRetried | SyncEventSessionNextCompactionStarted | SyncEventSessionNextCompactionDelta | SyncEventSessionNextCompactionEnded;
|
|
683
683
|
};
|
|
684
684
|
/**
|
|
685
685
|
* Log level
|
|
@@ -845,6 +845,8 @@ export type ProviderConfig = {
|
|
|
845
845
|
name?: string;
|
|
846
846
|
family?: string;
|
|
847
847
|
prompt?: "codex" | "gemini" | "beast" | "anthropic" | "trinity" | "anthropic_without_todo" | "ling" | "gpt55";
|
|
848
|
+
isFree?: boolean;
|
|
849
|
+
ai_sdk_provider?: "alibaba" | "anthropic" | "openai" | "openai-compatible" | "openrouter";
|
|
848
850
|
release_date?: string;
|
|
849
851
|
attachment?: boolean;
|
|
850
852
|
reasoning?: boolean;
|
|
@@ -875,7 +877,7 @@ export type ProviderConfig = {
|
|
|
875
877
|
output: Array<"text" | "audio" | "image" | "video" | "pdf">;
|
|
876
878
|
};
|
|
877
879
|
experimental?: boolean;
|
|
878
|
-
status?: "alpha" | "beta" | "deprecated";
|
|
880
|
+
status?: "alpha" | "beta" | "deprecated" | "active";
|
|
879
881
|
provider?: {
|
|
880
882
|
npm?: string;
|
|
881
883
|
api?: string;
|
|
@@ -1201,8 +1203,8 @@ export type WorktreeResetInput = {
|
|
|
1201
1203
|
directory: string;
|
|
1202
1204
|
};
|
|
1203
1205
|
export type WorktreeDiffItem = {
|
|
1204
|
-
file
|
|
1205
|
-
patch
|
|
1206
|
+
file?: string;
|
|
1207
|
+
patch?: string;
|
|
1206
1208
|
additions: number;
|
|
1207
1209
|
deletions: number;
|
|
1208
1210
|
status?: "added" | "deleted" | "modified";
|
|
@@ -1327,7 +1329,7 @@ export type VcsFileStatus = {
|
|
|
1327
1329
|
};
|
|
1328
1330
|
export type VcsFileDiff = {
|
|
1329
1331
|
file: string;
|
|
1330
|
-
patch
|
|
1332
|
+
patch?: string;
|
|
1331
1333
|
additions: number;
|
|
1332
1334
|
deletions: number;
|
|
1333
1335
|
status?: "added" | "deleted" | "modified";
|
|
@@ -2187,13 +2189,6 @@ export type SyncEventSessionNextCompactionEnded = {
|
|
|
2187
2189
|
include?: string;
|
|
2188
2190
|
};
|
|
2189
2191
|
};
|
|
2190
|
-
export type EventServerInstanceDisposed = {
|
|
2191
|
-
id: string;
|
|
2192
|
-
type: "server.instance.disposed";
|
|
2193
|
-
properties: {
|
|
2194
|
-
directory: string;
|
|
2195
|
-
};
|
|
2196
|
-
};
|
|
2197
2192
|
export type EventServerConnected = {
|
|
2198
2193
|
id: string;
|
|
2199
2194
|
type: "server.connected";
|
|
@@ -2215,6 +2210,35 @@ export type EventGlobalConfigUpdated = {
|
|
|
2215
2210
|
[key: string]: unknown;
|
|
2216
2211
|
};
|
|
2217
2212
|
};
|
|
2213
|
+
export type EventKilocodeAgentManagerStart = {
|
|
2214
|
+
id: string;
|
|
2215
|
+
type: "kilocode.agent_manager.start";
|
|
2216
|
+
properties: {
|
|
2217
|
+
requestID: string;
|
|
2218
|
+
sessionID: string;
|
|
2219
|
+
mode: "worktree" | "local";
|
|
2220
|
+
versions?: boolean;
|
|
2221
|
+
tasks: Array<{
|
|
2222
|
+
prompt?: string;
|
|
2223
|
+
name?: string;
|
|
2224
|
+
branchName?: string;
|
|
2225
|
+
}>;
|
|
2226
|
+
};
|
|
2227
|
+
};
|
|
2228
|
+
export type EventIndexingStatus = {
|
|
2229
|
+
id: string;
|
|
2230
|
+
type: "indexing.status";
|
|
2231
|
+
properties: {
|
|
2232
|
+
status: IndexingStatus;
|
|
2233
|
+
};
|
|
2234
|
+
};
|
|
2235
|
+
export type EventServerInstanceDisposed = {
|
|
2236
|
+
id: string;
|
|
2237
|
+
type: "server.instance.disposed";
|
|
2238
|
+
properties: {
|
|
2239
|
+
directory: string;
|
|
2240
|
+
};
|
|
2241
|
+
};
|
|
2218
2242
|
export type EventFileEdited = {
|
|
2219
2243
|
id: string;
|
|
2220
2244
|
type: "file.edited";
|
|
@@ -2468,21 +2492,6 @@ export type EventProjectUpdated = {
|
|
|
2468
2492
|
type: "project.updated";
|
|
2469
2493
|
properties: Project;
|
|
2470
2494
|
};
|
|
2471
|
-
export type EventKilocodeAgentManagerStart = {
|
|
2472
|
-
id: string;
|
|
2473
|
-
type: "kilocode.agent_manager.start";
|
|
2474
|
-
properties: {
|
|
2475
|
-
requestID: string;
|
|
2476
|
-
sessionID: string;
|
|
2477
|
-
mode: "worktree" | "local";
|
|
2478
|
-
versions?: boolean;
|
|
2479
|
-
tasks: Array<{
|
|
2480
|
-
prompt?: string;
|
|
2481
|
-
name?: string;
|
|
2482
|
-
branchName?: string;
|
|
2483
|
-
}>;
|
|
2484
|
-
};
|
|
2485
|
-
};
|
|
2486
2495
|
export type EventVcsBranchUpdated = {
|
|
2487
2496
|
id: string;
|
|
2488
2497
|
type: "vcs.branch.updated";
|
|
@@ -2958,13 +2967,6 @@ export type EventSessionNextCompactionEnded = {
|
|
|
2958
2967
|
include?: string;
|
|
2959
2968
|
};
|
|
2960
2969
|
};
|
|
2961
|
-
export type EventIndexingStatus = {
|
|
2962
|
-
id: string;
|
|
2963
|
-
type: "indexing.status";
|
|
2964
|
-
properties: {
|
|
2965
|
-
status: IndexingStatus;
|
|
2966
|
-
};
|
|
2967
|
-
};
|
|
2968
2970
|
export type SessionInfo = {
|
|
2969
2971
|
id: string;
|
|
2970
2972
|
parentID?: string;
|
|
@@ -5291,6 +5293,10 @@ export type SessionForkData = {
|
|
|
5291
5293
|
url: "/session/{sessionID}/fork";
|
|
5292
5294
|
};
|
|
5293
5295
|
export type SessionForkErrors = {
|
|
5296
|
+
/**
|
|
5297
|
+
* Bad request
|
|
5298
|
+
*/
|
|
5299
|
+
400: BadRequestError;
|
|
5294
5300
|
/**
|
|
5295
5301
|
* NotFoundError
|
|
5296
5302
|
*/
|
|
@@ -5888,6 +5894,16 @@ export type V2SessionListData = {
|
|
|
5888
5894
|
query?: {
|
|
5889
5895
|
directory?: string;
|
|
5890
5896
|
workspace?: string;
|
|
5897
|
+
limit?: number;
|
|
5898
|
+
order?: "asc" | "desc";
|
|
5899
|
+
path?: string;
|
|
5900
|
+
roots?: boolean | "true" | "false";
|
|
5901
|
+
start?: number;
|
|
5902
|
+
search?: string;
|
|
5903
|
+
/**
|
|
5904
|
+
* Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order or filters.
|
|
5905
|
+
*/
|
|
5906
|
+
cursor?: string;
|
|
5891
5907
|
};
|
|
5892
5908
|
url: "/api/session";
|
|
5893
5909
|
};
|
|
@@ -5988,6 +6004,12 @@ export type V2SessionMessagesData = {
|
|
|
5988
6004
|
query?: {
|
|
5989
6005
|
directory?: string;
|
|
5990
6006
|
workspace?: string;
|
|
6007
|
+
limit?: number;
|
|
6008
|
+
order?: "asc" | "desc";
|
|
6009
|
+
/**
|
|
6010
|
+
* Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order.
|
|
6011
|
+
*/
|
|
6012
|
+
cursor?: string;
|
|
5991
6013
|
};
|
|
5992
6014
|
url: "/api/session/{sessionID}/message";
|
|
5993
6015
|
};
|
|
@@ -6968,8 +6990,8 @@ export type KiloProfileResponses = {
|
|
|
6968
6990
|
};
|
|
6969
6991
|
balance: {
|
|
6970
6992
|
balance: number;
|
|
6971
|
-
};
|
|
6972
|
-
currentOrgId: string;
|
|
6993
|
+
} | null;
|
|
6994
|
+
currentOrgId: string | null;
|
|
6973
6995
|
};
|
|
6974
6996
|
};
|
|
6975
6997
|
export type KiloProfileResponse = KiloProfileResponses[keyof KiloProfileResponses];
|
|
@@ -7212,20 +7234,20 @@ export type KiloClawStatusResponses = {
|
|
|
7212
7234
|
* Instance status
|
|
7213
7235
|
*/
|
|
7214
7236
|
200: {
|
|
7215
|
-
status: "provisioned" | "starting" | "restarting" | "recovering" | "running" | "stopped" | "destroying" | "restoring";
|
|
7237
|
+
status: "provisioned" | "starting" | "restarting" | "recovering" | "running" | "stopped" | "destroying" | "restoring" | null;
|
|
7216
7238
|
sandboxId?: string;
|
|
7217
7239
|
flyRegion?: string;
|
|
7218
7240
|
machineSize?: {
|
|
7219
7241
|
cpus: number;
|
|
7220
7242
|
memory_mb: number;
|
|
7221
7243
|
};
|
|
7222
|
-
openclawVersion?: string;
|
|
7223
|
-
lastStartedAt?: string;
|
|
7224
|
-
lastStoppedAt?: string;
|
|
7244
|
+
openclawVersion?: string | null;
|
|
7245
|
+
lastStartedAt?: string | null;
|
|
7246
|
+
lastStoppedAt?: string | null;
|
|
7225
7247
|
channelCount?: number;
|
|
7226
7248
|
secretCount?: number;
|
|
7227
7249
|
userId?: string;
|
|
7228
|
-
botName?: string;
|
|
7250
|
+
botName?: string | null;
|
|
7229
7251
|
};
|
|
7230
7252
|
};
|
|
7231
7253
|
export type KiloClawStatusResponse = KiloClawStatusResponses[keyof KiloClawStatusResponses];
|
|
@@ -7247,7 +7269,7 @@ export type KiloClawChatCredentialsResponses = {
|
|
|
7247
7269
|
expiresAt: string;
|
|
7248
7270
|
kiloChatUrl: string;
|
|
7249
7271
|
eventServiceUrl: string;
|
|
7250
|
-
};
|
|
7272
|
+
} | null;
|
|
7251
7273
|
};
|
|
7252
7274
|
export type KiloClawChatCredentialsResponse = KiloClawChatCredentialsResponses[keyof KiloClawChatCredentialsResponses];
|
|
7253
7275
|
export type KiloCloudSessionsData = {
|
|
@@ -7276,12 +7298,12 @@ export type KiloCloudSessionsResponses = {
|
|
|
7276
7298
|
200: {
|
|
7277
7299
|
cliSessions: Array<{
|
|
7278
7300
|
session_id: string;
|
|
7279
|
-
title: string;
|
|
7301
|
+
title: string | null;
|
|
7280
7302
|
created_at: string;
|
|
7281
7303
|
updated_at: string;
|
|
7282
7304
|
version: number;
|
|
7283
7305
|
}>;
|
|
7284
|
-
nextCursor: string;
|
|
7306
|
+
nextCursor: string | null;
|
|
7285
7307
|
};
|
|
7286
7308
|
};
|
|
7287
7309
|
export type KiloCloudSessionsResponse = KiloCloudSessionsResponses[keyof KiloCloudSessionsResponses];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@kilocode/sdk",
|
|
4
|
-
"version": "7.3.
|
|
4
|
+
"version": "7.3.29",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@hey-api/openapi-ts": "0.90.10",
|
|
46
46
|
"@tsconfig/node22": "22.0.2",
|
|
47
47
|
"@types/cross-spawn": "6.0.6",
|
|
48
|
-
"@types/node": "24.12.
|
|
48
|
+
"@types/node": "24.12.4",
|
|
49
49
|
"@typescript/native-preview": "7.0.0-dev.20260316.1",
|
|
50
50
|
"typescript": "5.8.2"
|
|
51
51
|
},
|