@kilocode/sdk 7.1.10 → 7.1.12

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 CHANGED
@@ -5,9 +5,13 @@ export { KiloClient };
5
5
  export function createKiloClient(config) {
6
6
  if (!config?.fetch) {
7
7
  const customFetch = (req) => {
8
- // @ts-ignore
9
- req.timeout = false;
10
- return fetch(req);
8
+ // Pass duplex in the init arg so it survives VS Code's proxy-agent
9
+ // fetch wrapper, which calls originalFetch(request, { ...init, dispatcher })
10
+ // and would otherwise drop duplex from the cloned Request.
11
+ // timeout: false disables Bun's default request timeout for long-running
12
+ // streaming calls (replaces the old req.timeout = false assignment which
13
+ // wouldn't survive the clone triggered by passing an init object).
14
+ return fetch(req, { duplex: "half", timeout: false });
11
15
  };
12
16
  config = {
13
17
  ...config,
package/dist/v2/client.js CHANGED
@@ -5,9 +5,13 @@ export { KiloClient };
5
5
  export function createKiloClient(config) {
6
6
  if (!config?.fetch) {
7
7
  const customFetch = (req) => {
8
- // @ts-ignore
9
- req.timeout = false;
10
- return fetch(req);
8
+ // Pass duplex in the init arg so it survives VS Code's proxy-agent
9
+ // fetch wrapper, which calls originalFetch(request, { ...init, dispatcher })
10
+ // and would otherwise drop duplex from the cloned Request.
11
+ // timeout: false disables Bun's default request timeout for long-running
12
+ // streaming calls (replaces the old req.timeout = false assignment which
13
+ // wouldn't survive the clone triggered by passing an init object).
14
+ return fetch(req, { duplex: "half", timeout: false });
11
15
  };
12
16
  config = {
13
17
  ...config,
@@ -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, CommitMessageGenerateErrors, CommitMessageGenerateResponses, Config as Config3, ConfigGetResponses, ConfigProvidersResponses, ConfigUpdateErrors, ConfigUpdateResponses, EnhancePromptEnhanceErrors, EnhancePromptEnhanceResponses, EventSubscribeResponses, EventTuiCommandExecute, EventTuiPromptAppend, EventTuiSessionSelect, EventTuiToastShow, ExperimentalResourceListResponses, ExperimentalSessionListResponses, ExperimentalWorkspaceCreateErrors, ExperimentalWorkspaceCreateResponses, ExperimentalWorkspaceListResponses, ExperimentalWorkspaceRemoveErrors, ExperimentalWorkspaceRemoveResponses, FileListResponses, FilePartInput, FilePartSource, FileReadResponses, FileStatusResponses, FindFilesResponses, FindSymbolsResponses, FindTextResponses, FormatterStatusResponses, GlobalConfigGetResponses, GlobalConfigUpdateErrors, GlobalConfigUpdateResponses, GlobalDisposeResponses, GlobalEventResponses, GlobalHealthResponses, InstanceDisposeResponses, KiloCloudSessionGetErrors, KiloCloudSessionGetResponses, KiloCloudSessionImportErrors, KiloCloudSessionImportResponses, KiloCloudSessionsErrors, KiloCloudSessionsResponses, KilocodeRemoveAgentErrors, KilocodeRemoveAgentResponses, KilocodeRemoveSkillErrors, KilocodeRemoveSkillResponses, KiloFimErrors, KiloFimResponses, KiloModesResponses, KiloNotificationsErrors, KiloNotificationsResponses, KiloOrganizationSetErrors, KiloOrganizationSetResponses, KiloProfileErrors, KiloProfileResponses, 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, PermissionSaveAlwaysRulesErrors, PermissionSaveAlwaysRulesResponses, 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, RemoteDisableResponses, RemoteEnableResponses, RemoteStatusResponses, 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, SessionViewedResponses, SubtaskPartInput, TelemetryCaptureErrors, TelemetryCaptureResponses, TextPartInput, ToolIdsErrors, ToolIdsResponses, ToolListErrors, ToolListResponses, TuiAppendPromptErrors, TuiAppendPromptResponses, TuiClearPromptResponses, TuiControlNextResponses, TuiControlResponseResponses, TuiExecuteCommandErrors, TuiExecuteCommandResponses, TuiOpenHelpResponses, TuiOpenModelsResponses, TuiOpenSessionsResponses, TuiOpenThemesResponses, TuiPublishErrors, TuiPublishResponses, TuiSelectSessionErrors, TuiSelectSessionResponses, TuiShowToastResponses, TuiSubmitPromptResponses, VcsGetResponses, WorktreeCreateErrors, WorktreeCreateInput, WorktreeCreateResponses, WorktreeDiffErrors, WorktreeDiffFileErrors, WorktreeDiffFileResponses, WorktreeDiffResponses, WorktreeDiffSummaryErrors, WorktreeDiffSummaryResponses, WorktreeListResponses, WorktreeRemoveErrors, WorktreeRemoveInput, WorktreeRemoveResponses, WorktreeResetErrors, WorktreeResetInput, WorktreeResetResponses } from "./types.gen.js";
2
+ import type { AgentPartInput, AppAgentsResponses, AppLogErrors, AppLogResponses, AppSkillsResponses, Auth as Auth3, AuthRemoveErrors, AuthRemoveResponses, AuthSetErrors, AuthSetResponses, CommandListResponses, CommitMessageGenerateErrors, CommitMessageGenerateResponses, Config as Config3, ConfigGetResponses, ConfigProvidersResponses, ConfigUpdateErrors, ConfigUpdateResponses, EnhancePromptEnhanceErrors, EnhancePromptEnhanceResponses, EventSubscribeResponses, EventTuiCommandExecute, EventTuiPromptAppend, EventTuiSessionSelect, EventTuiToastShow, ExperimentalResourceListResponses, ExperimentalSessionListResponses, ExperimentalWorkspaceCreateErrors, ExperimentalWorkspaceCreateResponses, ExperimentalWorkspaceListResponses, ExperimentalWorkspaceRemoveErrors, ExperimentalWorkspaceRemoveResponses, FileListResponses, FilePartInput, FilePartSource, FileReadResponses, FileStatusResponses, FindFilesResponses, FindSymbolsResponses, FindTextResponses, FormatterStatusResponses, GlobalConfigGetResponses, GlobalConfigUpdateErrors, GlobalConfigUpdateResponses, GlobalDisposeResponses, GlobalEventResponses, GlobalHealthResponses, InstanceDisposeResponses, KiloCloudSessionGetErrors, KiloCloudSessionGetResponses, KiloCloudSessionImportErrors, KiloCloudSessionImportResponses, KiloCloudSessionsErrors, KiloCloudSessionsResponses, KilocodeRemoveAgentErrors, KilocodeRemoveAgentResponses, KilocodeRemoveSkillErrors, KilocodeRemoveSkillResponses, KilocodeSessionImportMessageErrors, KilocodeSessionImportMessageResponses, KilocodeSessionImportPartErrors, KilocodeSessionImportPartResponses, KilocodeSessionImportProjectErrors, KilocodeSessionImportProjectResponses, KilocodeSessionImportSessionErrors, KilocodeSessionImportSessionResponses, KiloFimErrors, KiloFimResponses, KiloModesResponses, KiloNotificationsErrors, KiloNotificationsResponses, KiloOrganizationSetErrors, KiloOrganizationSetResponses, KiloProfileErrors, KiloProfileResponses, 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, PermissionSaveAlwaysRulesErrors, PermissionSaveAlwaysRulesResponses, 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, RemoteDisableResponses, RemoteEnableResponses, RemoteStatusResponses, 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, SessionViewedResponses, SubtaskPartInput, TelemetryCaptureErrors, TelemetryCaptureResponses, TextPartInput, ToolIdsErrors, ToolIdsResponses, ToolListErrors, ToolListResponses, TuiAppendPromptErrors, TuiAppendPromptResponses, TuiClearPromptResponses, TuiControlNextResponses, TuiControlResponseResponses, TuiExecuteCommandErrors, TuiExecuteCommandResponses, TuiOpenHelpResponses, TuiOpenModelsResponses, TuiOpenSessionsResponses, TuiOpenThemesResponses, TuiPublishErrors, TuiPublishResponses, TuiSelectSessionErrors, TuiSelectSessionResponses, TuiShowToastResponses, TuiSubmitPromptResponses, VcsGetResponses, WorktreeCreateErrors, WorktreeCreateInput, WorktreeCreateResponses, WorktreeDiffErrors, WorktreeDiffFileErrors, WorktreeDiffFileResponses, WorktreeDiffResponses, WorktreeDiffSummaryErrors, WorktreeDiffSummaryResponses, 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
@@ -954,6 +954,215 @@ export declare class EnhancePrompt extends HeyApiClient {
954
954
  text?: string;
955
955
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<EnhancePromptEnhanceResponses, EnhancePromptEnhanceErrors, ThrowOnError, "fields">;
956
956
  }
957
+ export declare class SessionImport extends HeyApiClient {
958
+ /**
959
+ * Insert project for session import
960
+ *
961
+ * Insert or update a project row used by legacy session import.
962
+ */
963
+ project<ThrowOnError extends boolean = false>(parameters?: {
964
+ directory?: string;
965
+ workspace?: string;
966
+ id?: string;
967
+ worktree?: string;
968
+ vcs?: string;
969
+ name?: string;
970
+ iconUrl?: string;
971
+ iconColor?: string;
972
+ timeCreated?: number;
973
+ timeUpdated?: number;
974
+ timeInitialized?: number;
975
+ sandboxes?: Array<string>;
976
+ commands?: {
977
+ start?: string;
978
+ };
979
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<KilocodeSessionImportProjectResponses, KilocodeSessionImportProjectErrors, ThrowOnError, "fields">;
980
+ /**
981
+ * Insert session for session import
982
+ *
983
+ * Insert or update a session row used by legacy session import.
984
+ */
985
+ session<ThrowOnError extends boolean = false>(parameters?: {
986
+ query_directory?: string;
987
+ workspace?: string;
988
+ id?: string;
989
+ projectID?: string;
990
+ workspaceID?: string;
991
+ parentID?: string;
992
+ slug?: string;
993
+ body_directory?: string;
994
+ title?: string;
995
+ version?: string;
996
+ shareURL?: string;
997
+ summary?: {
998
+ additions: number;
999
+ deletions: number;
1000
+ files: number;
1001
+ diffs?: Array<{
1002
+ [key: string]: unknown;
1003
+ }>;
1004
+ };
1005
+ revert?: {
1006
+ messageID: string;
1007
+ partID?: string;
1008
+ snapshot?: string;
1009
+ diff?: string;
1010
+ };
1011
+ permission?: {
1012
+ [key: string]: unknown;
1013
+ };
1014
+ timeCreated?: number;
1015
+ timeUpdated?: number;
1016
+ timeCompacting?: number;
1017
+ timeArchived?: number;
1018
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<KilocodeSessionImportSessionResponses, KilocodeSessionImportSessionErrors, ThrowOnError, "fields">;
1019
+ /**
1020
+ * Insert message for session import
1021
+ *
1022
+ * Insert or update a message row used by legacy session import.
1023
+ */
1024
+ message<ThrowOnError extends boolean = false>(parameters?: {
1025
+ directory?: string;
1026
+ workspace?: string;
1027
+ id?: string;
1028
+ sessionID?: string;
1029
+ timeCreated?: number;
1030
+ data?: {
1031
+ role: "user";
1032
+ time: {
1033
+ created: number;
1034
+ };
1035
+ agent: string;
1036
+ model: {
1037
+ providerID: string;
1038
+ modelID: string;
1039
+ };
1040
+ tools?: {
1041
+ [key: string]: boolean;
1042
+ };
1043
+ } | {
1044
+ role: "assistant";
1045
+ time: {
1046
+ created: number;
1047
+ completed?: number;
1048
+ };
1049
+ parentID: string;
1050
+ modelID: string;
1051
+ providerID: string;
1052
+ mode: string;
1053
+ agent: string;
1054
+ path: {
1055
+ cwd: string;
1056
+ root: string;
1057
+ };
1058
+ summary?: boolean;
1059
+ cost: number;
1060
+ tokens: {
1061
+ total?: number;
1062
+ input: number;
1063
+ output: number;
1064
+ reasoning: number;
1065
+ cache: {
1066
+ read: number;
1067
+ write: number;
1068
+ };
1069
+ };
1070
+ structured?: unknown;
1071
+ variant?: string;
1072
+ finish?: string;
1073
+ };
1074
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<KilocodeSessionImportMessageResponses, KilocodeSessionImportMessageErrors, ThrowOnError, "fields">;
1075
+ /**
1076
+ * Insert part for session import
1077
+ *
1078
+ * Insert or update a part row used by legacy session import.
1079
+ */
1080
+ part<ThrowOnError extends boolean = false>(parameters?: {
1081
+ directory?: string;
1082
+ workspace?: string;
1083
+ id?: string;
1084
+ messageID?: string;
1085
+ sessionID?: string;
1086
+ timeCreated?: number;
1087
+ data?: {
1088
+ type: "text";
1089
+ text: string;
1090
+ synthetic?: boolean;
1091
+ ignored?: boolean;
1092
+ time?: {
1093
+ start: number;
1094
+ end?: number;
1095
+ };
1096
+ metadata?: {
1097
+ [key: string]: unknown;
1098
+ };
1099
+ } | {
1100
+ type: "reasoning";
1101
+ text: string;
1102
+ metadata?: {
1103
+ [key: string]: unknown;
1104
+ };
1105
+ time: {
1106
+ start: number;
1107
+ end?: number;
1108
+ };
1109
+ } | {
1110
+ type: "tool";
1111
+ callID: string;
1112
+ tool: string;
1113
+ state: {
1114
+ status: "pending";
1115
+ input: {
1116
+ [key: string]: unknown;
1117
+ };
1118
+ raw: string;
1119
+ } | {
1120
+ status: "running";
1121
+ input: {
1122
+ [key: string]: unknown;
1123
+ };
1124
+ title?: string;
1125
+ metadata?: {
1126
+ [key: string]: unknown;
1127
+ };
1128
+ time: {
1129
+ start: number;
1130
+ };
1131
+ } | {
1132
+ status: "completed";
1133
+ input: {
1134
+ [key: string]: unknown;
1135
+ };
1136
+ output: string;
1137
+ title: string;
1138
+ metadata: {
1139
+ [key: string]: unknown;
1140
+ };
1141
+ time: {
1142
+ start: number;
1143
+ end: number;
1144
+ compacted?: number;
1145
+ };
1146
+ } | {
1147
+ status: "error";
1148
+ input: {
1149
+ [key: string]: unknown;
1150
+ };
1151
+ error: string;
1152
+ metadata?: {
1153
+ [key: string]: unknown;
1154
+ };
1155
+ time: {
1156
+ start: number;
1157
+ end: number;
1158
+ };
1159
+ };
1160
+ metadata?: {
1161
+ [key: string]: unknown;
1162
+ };
1163
+ };
1164
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<KilocodeSessionImportPartResponses, KilocodeSessionImportPartErrors, ThrowOnError, "fields">;
1165
+ }
957
1166
  export declare class Kilocode extends HeyApiClient {
958
1167
  /**
959
1168
  * Remove a skill
@@ -975,6 +1184,8 @@ export declare class Kilocode extends HeyApiClient {
975
1184
  workspace?: string;
976
1185
  name?: string;
977
1186
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<KilocodeRemoveAgentResponses, KilocodeRemoveAgentErrors, ThrowOnError, "fields">;
1187
+ private _sessionImport?;
1188
+ get sessionImport(): SessionImport;
978
1189
  }
979
1190
  export declare class Organization extends HeyApiClient {
980
1191
  /**
@@ -1889,6 +1889,152 @@ export class EnhancePrompt extends HeyApiClient {
1889
1889
  });
1890
1890
  }
1891
1891
  }
1892
+ export class SessionImport extends HeyApiClient {
1893
+ /**
1894
+ * Insert project for session import
1895
+ *
1896
+ * Insert or update a project row used by legacy session import.
1897
+ */
1898
+ project(parameters, options) {
1899
+ const params = buildClientParams([parameters], [
1900
+ {
1901
+ args: [
1902
+ { in: "query", key: "directory" },
1903
+ { in: "query", key: "workspace" },
1904
+ { in: "body", key: "id" },
1905
+ { in: "body", key: "worktree" },
1906
+ { in: "body", key: "vcs" },
1907
+ { in: "body", key: "name" },
1908
+ { in: "body", key: "iconUrl" },
1909
+ { in: "body", key: "iconColor" },
1910
+ { in: "body", key: "timeCreated" },
1911
+ { in: "body", key: "timeUpdated" },
1912
+ { in: "body", key: "timeInitialized" },
1913
+ { in: "body", key: "sandboxes" },
1914
+ { in: "body", key: "commands" },
1915
+ ],
1916
+ },
1917
+ ]);
1918
+ return (options?.client ?? this.client).post({
1919
+ url: "/kilocode/session-import/project",
1920
+ ...options,
1921
+ ...params,
1922
+ headers: {
1923
+ "Content-Type": "application/json",
1924
+ ...options?.headers,
1925
+ ...params.headers,
1926
+ },
1927
+ });
1928
+ }
1929
+ /**
1930
+ * Insert session for session import
1931
+ *
1932
+ * Insert or update a session row used by legacy session import.
1933
+ */
1934
+ session(parameters, options) {
1935
+ const params = buildClientParams([parameters], [
1936
+ {
1937
+ args: [
1938
+ {
1939
+ in: "query",
1940
+ key: "query_directory",
1941
+ map: "directory",
1942
+ },
1943
+ { in: "query", key: "workspace" },
1944
+ { in: "body", key: "id" },
1945
+ { in: "body", key: "projectID" },
1946
+ { in: "body", key: "workspaceID" },
1947
+ { in: "body", key: "parentID" },
1948
+ { in: "body", key: "slug" },
1949
+ {
1950
+ in: "body",
1951
+ key: "body_directory",
1952
+ map: "directory",
1953
+ },
1954
+ { in: "body", key: "title" },
1955
+ { in: "body", key: "version" },
1956
+ { in: "body", key: "shareURL" },
1957
+ { in: "body", key: "summary" },
1958
+ { in: "body", key: "revert" },
1959
+ { in: "body", key: "permission" },
1960
+ { in: "body", key: "timeCreated" },
1961
+ { in: "body", key: "timeUpdated" },
1962
+ { in: "body", key: "timeCompacting" },
1963
+ { in: "body", key: "timeArchived" },
1964
+ ],
1965
+ },
1966
+ ]);
1967
+ return (options?.client ?? this.client).post({
1968
+ url: "/kilocode/session-import/session",
1969
+ ...options,
1970
+ ...params,
1971
+ headers: {
1972
+ "Content-Type": "application/json",
1973
+ ...options?.headers,
1974
+ ...params.headers,
1975
+ },
1976
+ });
1977
+ }
1978
+ /**
1979
+ * Insert message for session import
1980
+ *
1981
+ * Insert or update a message row used by legacy session import.
1982
+ */
1983
+ message(parameters, options) {
1984
+ const params = buildClientParams([parameters], [
1985
+ {
1986
+ args: [
1987
+ { in: "query", key: "directory" },
1988
+ { in: "query", key: "workspace" },
1989
+ { in: "body", key: "id" },
1990
+ { in: "body", key: "sessionID" },
1991
+ { in: "body", key: "timeCreated" },
1992
+ { in: "body", key: "data" },
1993
+ ],
1994
+ },
1995
+ ]);
1996
+ return (options?.client ?? this.client).post({
1997
+ url: "/kilocode/session-import/message",
1998
+ ...options,
1999
+ ...params,
2000
+ headers: {
2001
+ "Content-Type": "application/json",
2002
+ ...options?.headers,
2003
+ ...params.headers,
2004
+ },
2005
+ });
2006
+ }
2007
+ /**
2008
+ * Insert part for session import
2009
+ *
2010
+ * Insert or update a part row used by legacy session import.
2011
+ */
2012
+ part(parameters, options) {
2013
+ const params = buildClientParams([parameters], [
2014
+ {
2015
+ args: [
2016
+ { in: "query", key: "directory" },
2017
+ { in: "query", key: "workspace" },
2018
+ { in: "body", key: "id" },
2019
+ { in: "body", key: "messageID" },
2020
+ { in: "body", key: "sessionID" },
2021
+ { in: "body", key: "timeCreated" },
2022
+ { in: "body", key: "data" },
2023
+ ],
2024
+ },
2025
+ ]);
2026
+ return (options?.client ?? this.client).post({
2027
+ url: "/kilocode/session-import/part",
2028
+ ...options,
2029
+ ...params,
2030
+ headers: {
2031
+ "Content-Type": "application/json",
2032
+ ...options?.headers,
2033
+ ...params.headers,
2034
+ },
2035
+ });
2036
+ }
2037
+ }
1892
2038
  export class Kilocode extends HeyApiClient {
1893
2039
  /**
1894
2040
  * Remove a skill
@@ -1942,6 +2088,10 @@ export class Kilocode extends HeyApiClient {
1942
2088
  },
1943
2089
  });
1944
2090
  }
2091
+ _sessionImport;
2092
+ get sessionImport() {
2093
+ return (this._sessionImport ??= new SessionImport({ client: this.client }));
2094
+ }
1945
2095
  }
1946
2096
  export class Organization extends HeyApiClient {
1947
2097
  /**
@@ -3884,6 +3884,289 @@ export type EnhancePromptEnhanceResponses = {
3884
3884
  };
3885
3885
  };
3886
3886
  export type EnhancePromptEnhanceResponse = EnhancePromptEnhanceResponses[keyof EnhancePromptEnhanceResponses];
3887
+ export type KilocodeSessionImportProjectData = {
3888
+ body?: {
3889
+ id: string;
3890
+ worktree: string;
3891
+ vcs?: string;
3892
+ name?: string;
3893
+ iconUrl?: string;
3894
+ iconColor?: string;
3895
+ timeCreated: number;
3896
+ timeUpdated: number;
3897
+ timeInitialized?: number;
3898
+ sandboxes: Array<string>;
3899
+ commands?: {
3900
+ start?: string;
3901
+ };
3902
+ };
3903
+ path?: never;
3904
+ query?: {
3905
+ directory?: string;
3906
+ workspace?: string;
3907
+ };
3908
+ url: "/kilocode/session-import/project";
3909
+ };
3910
+ export type KilocodeSessionImportProjectErrors = {
3911
+ /**
3912
+ * Bad request
3913
+ */
3914
+ 400: BadRequestError;
3915
+ };
3916
+ export type KilocodeSessionImportProjectError = KilocodeSessionImportProjectErrors[keyof KilocodeSessionImportProjectErrors];
3917
+ export type KilocodeSessionImportProjectResponses = {
3918
+ /**
3919
+ * Project import result
3920
+ */
3921
+ 200: {
3922
+ ok: boolean;
3923
+ id: string;
3924
+ skipped?: boolean;
3925
+ };
3926
+ };
3927
+ export type KilocodeSessionImportProjectResponse = KilocodeSessionImportProjectResponses[keyof KilocodeSessionImportProjectResponses];
3928
+ export type KilocodeSessionImportSessionData = {
3929
+ body?: {
3930
+ id: string;
3931
+ projectID: string;
3932
+ workspaceID?: string;
3933
+ parentID?: string;
3934
+ slug: string;
3935
+ directory: string;
3936
+ title: string;
3937
+ version: string;
3938
+ shareURL?: string;
3939
+ summary?: {
3940
+ additions: number;
3941
+ deletions: number;
3942
+ files: number;
3943
+ diffs?: Array<{
3944
+ [key: string]: unknown;
3945
+ }>;
3946
+ };
3947
+ revert?: {
3948
+ messageID: string;
3949
+ partID?: string;
3950
+ snapshot?: string;
3951
+ diff?: string;
3952
+ };
3953
+ permission?: {
3954
+ [key: string]: unknown;
3955
+ };
3956
+ timeCreated: number;
3957
+ timeUpdated: number;
3958
+ timeCompacting?: number;
3959
+ timeArchived?: number;
3960
+ };
3961
+ path?: never;
3962
+ query?: {
3963
+ directory?: string;
3964
+ workspace?: string;
3965
+ };
3966
+ url: "/kilocode/session-import/session";
3967
+ };
3968
+ export type KilocodeSessionImportSessionErrors = {
3969
+ /**
3970
+ * Bad request
3971
+ */
3972
+ 400: BadRequestError;
3973
+ };
3974
+ export type KilocodeSessionImportSessionError = KilocodeSessionImportSessionErrors[keyof KilocodeSessionImportSessionErrors];
3975
+ export type KilocodeSessionImportSessionResponses = {
3976
+ /**
3977
+ * Session import result
3978
+ */
3979
+ 200: {
3980
+ ok: boolean;
3981
+ id: string;
3982
+ skipped?: boolean;
3983
+ };
3984
+ };
3985
+ export type KilocodeSessionImportSessionResponse = KilocodeSessionImportSessionResponses[keyof KilocodeSessionImportSessionResponses];
3986
+ export type KilocodeSessionImportMessageData = {
3987
+ body?: {
3988
+ id: string;
3989
+ sessionID: string;
3990
+ timeCreated: number;
3991
+ data: {
3992
+ role: "user";
3993
+ time: {
3994
+ created: number;
3995
+ };
3996
+ agent: string;
3997
+ model: {
3998
+ providerID: string;
3999
+ modelID: string;
4000
+ };
4001
+ tools?: {
4002
+ [key: string]: boolean;
4003
+ };
4004
+ } | {
4005
+ role: "assistant";
4006
+ time: {
4007
+ created: number;
4008
+ completed?: number;
4009
+ };
4010
+ parentID: string;
4011
+ modelID: string;
4012
+ providerID: string;
4013
+ mode: string;
4014
+ agent: string;
4015
+ path: {
4016
+ cwd: string;
4017
+ root: string;
4018
+ };
4019
+ summary?: boolean;
4020
+ cost: number;
4021
+ tokens: {
4022
+ total?: number;
4023
+ input: number;
4024
+ output: number;
4025
+ reasoning: number;
4026
+ cache: {
4027
+ read: number;
4028
+ write: number;
4029
+ };
4030
+ };
4031
+ structured?: unknown;
4032
+ variant?: string;
4033
+ finish?: string;
4034
+ };
4035
+ };
4036
+ path?: never;
4037
+ query?: {
4038
+ directory?: string;
4039
+ workspace?: string;
4040
+ };
4041
+ url: "/kilocode/session-import/message";
4042
+ };
4043
+ export type KilocodeSessionImportMessageErrors = {
4044
+ /**
4045
+ * Bad request
4046
+ */
4047
+ 400: BadRequestError;
4048
+ };
4049
+ export type KilocodeSessionImportMessageError = KilocodeSessionImportMessageErrors[keyof KilocodeSessionImportMessageErrors];
4050
+ export type KilocodeSessionImportMessageResponses = {
4051
+ /**
4052
+ * Message import result
4053
+ */
4054
+ 200: {
4055
+ ok: boolean;
4056
+ id: string;
4057
+ skipped?: boolean;
4058
+ };
4059
+ };
4060
+ export type KilocodeSessionImportMessageResponse = KilocodeSessionImportMessageResponses[keyof KilocodeSessionImportMessageResponses];
4061
+ export type KilocodeSessionImportPartData = {
4062
+ body?: {
4063
+ id: string;
4064
+ messageID: string;
4065
+ sessionID: string;
4066
+ timeCreated?: number;
4067
+ data: {
4068
+ type: "text";
4069
+ text: string;
4070
+ synthetic?: boolean;
4071
+ ignored?: boolean;
4072
+ time?: {
4073
+ start: number;
4074
+ end?: number;
4075
+ };
4076
+ metadata?: {
4077
+ [key: string]: unknown;
4078
+ };
4079
+ } | {
4080
+ type: "reasoning";
4081
+ text: string;
4082
+ metadata?: {
4083
+ [key: string]: unknown;
4084
+ };
4085
+ time: {
4086
+ start: number;
4087
+ end?: number;
4088
+ };
4089
+ } | {
4090
+ type: "tool";
4091
+ callID: string;
4092
+ tool: string;
4093
+ state: {
4094
+ status: "pending";
4095
+ input: {
4096
+ [key: string]: unknown;
4097
+ };
4098
+ raw: string;
4099
+ } | {
4100
+ status: "running";
4101
+ input: {
4102
+ [key: string]: unknown;
4103
+ };
4104
+ title?: string;
4105
+ metadata?: {
4106
+ [key: string]: unknown;
4107
+ };
4108
+ time: {
4109
+ start: number;
4110
+ };
4111
+ } | {
4112
+ status: "completed";
4113
+ input: {
4114
+ [key: string]: unknown;
4115
+ };
4116
+ output: string;
4117
+ title: string;
4118
+ metadata: {
4119
+ [key: string]: unknown;
4120
+ };
4121
+ time: {
4122
+ start: number;
4123
+ end: number;
4124
+ compacted?: number;
4125
+ };
4126
+ } | {
4127
+ status: "error";
4128
+ input: {
4129
+ [key: string]: unknown;
4130
+ };
4131
+ error: string;
4132
+ metadata?: {
4133
+ [key: string]: unknown;
4134
+ };
4135
+ time: {
4136
+ start: number;
4137
+ end: number;
4138
+ };
4139
+ };
4140
+ metadata?: {
4141
+ [key: string]: unknown;
4142
+ };
4143
+ };
4144
+ };
4145
+ path?: never;
4146
+ query?: {
4147
+ directory?: string;
4148
+ workspace?: string;
4149
+ };
4150
+ url: "/kilocode/session-import/part";
4151
+ };
4152
+ export type KilocodeSessionImportPartErrors = {
4153
+ /**
4154
+ * Bad request
4155
+ */
4156
+ 400: BadRequestError;
4157
+ };
4158
+ export type KilocodeSessionImportPartError = KilocodeSessionImportPartErrors[keyof KilocodeSessionImportPartErrors];
4159
+ export type KilocodeSessionImportPartResponses = {
4160
+ /**
4161
+ * Part import result
4162
+ */
4163
+ 200: {
4164
+ ok: boolean;
4165
+ id: string;
4166
+ skipped?: boolean;
4167
+ };
4168
+ };
4169
+ export type KilocodeSessionImportPartResponse = KilocodeSessionImportPartResponses[keyof KilocodeSessionImportPartResponses];
3887
4170
  export type KilocodeRemoveSkillData = {
3888
4171
  body?: {
3889
4172
  location: string;
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.1.10",
4
+ "version": "7.1.12",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "scripts": {