@kilocode/sdk 1.0.25 → 7.0.28

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.
@@ -0,0 +1,18 @@
1
+ /**
2
+ * JSON-friendly union that mirrors what Pinia Colada can hash.
3
+ */
4
+ export type JsonValue = null | string | number | boolean | JsonValue[] | {
5
+ [key: string]: JsonValue;
6
+ };
7
+ /**
8
+ * Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.
9
+ */
10
+ export declare const queryKeyJsonReplacer: (_key: string, value: unknown) => {} | null | undefined;
11
+ /**
12
+ * Safely stringifies a value and parses it back into a JsonValue.
13
+ */
14
+ export declare const stringifyToJsonValue: (input: unknown) => JsonValue | undefined;
15
+ /**
16
+ * Normalizes any accepted value into a JSON-friendly shape for query keys.
17
+ */
18
+ export declare const serializeQueryKeyValue: (value: unknown) => JsonValue | undefined;
@@ -0,0 +1,93 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ /**
3
+ * Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.
4
+ */
5
+ export const queryKeyJsonReplacer = (_key, value) => {
6
+ if (value === undefined || typeof value === "function" || typeof value === "symbol") {
7
+ return undefined;
8
+ }
9
+ if (typeof value === "bigint") {
10
+ return value.toString();
11
+ }
12
+ if (value instanceof Date) {
13
+ return value.toISOString();
14
+ }
15
+ return value;
16
+ };
17
+ /**
18
+ * Safely stringifies a value and parses it back into a JsonValue.
19
+ */
20
+ export const stringifyToJsonValue = (input) => {
21
+ try {
22
+ const json = JSON.stringify(input, queryKeyJsonReplacer);
23
+ if (json === undefined) {
24
+ return undefined;
25
+ }
26
+ return JSON.parse(json);
27
+ }
28
+ catch {
29
+ return undefined;
30
+ }
31
+ };
32
+ /**
33
+ * Detects plain objects (including objects with a null prototype).
34
+ */
35
+ const isPlainObject = (value) => {
36
+ if (value === null || typeof value !== "object") {
37
+ return false;
38
+ }
39
+ const prototype = Object.getPrototypeOf(value);
40
+ return prototype === Object.prototype || prototype === null;
41
+ };
42
+ /**
43
+ * Turns URLSearchParams into a sorted JSON object for deterministic keys.
44
+ */
45
+ const serializeSearchParams = (params) => {
46
+ const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b));
47
+ const result = {};
48
+ for (const [key, value] of entries) {
49
+ const existing = result[key];
50
+ if (existing === undefined) {
51
+ result[key] = value;
52
+ continue;
53
+ }
54
+ if (Array.isArray(existing)) {
55
+ ;
56
+ existing.push(value);
57
+ }
58
+ else {
59
+ result[key] = [existing, value];
60
+ }
61
+ }
62
+ return result;
63
+ };
64
+ /**
65
+ * Normalizes any accepted value into a JSON-friendly shape for query keys.
66
+ */
67
+ export const serializeQueryKeyValue = (value) => {
68
+ if (value === null) {
69
+ return null;
70
+ }
71
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
72
+ return value;
73
+ }
74
+ if (value === undefined || typeof value === "function" || typeof value === "symbol") {
75
+ return undefined;
76
+ }
77
+ if (typeof value === "bigint") {
78
+ return value.toString();
79
+ }
80
+ if (value instanceof Date) {
81
+ return value.toISOString();
82
+ }
83
+ if (Array.isArray(value)) {
84
+ return stringifyToJsonValue(value);
85
+ }
86
+ if (typeof URLSearchParams !== "undefined" && value instanceof URLSearchParams) {
87
+ return serializeSearchParams(value);
88
+ }
89
+ if (isPlainObject(value)) {
90
+ return stringifyToJsonValue(value);
91
+ }
92
+ return undefined;
93
+ };
package/dist/server.js CHANGED
@@ -39,7 +39,9 @@ export async function createOpencodeServer(options) {
39
39
  const args = [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`];
40
40
  if (options.config?.logLevel)
41
41
  args.push(`--log-level=${options.config.logLevel}`);
42
- const proc = spawn(`opencode`, args, {
42
+ // kilocode_change start
43
+ const proc = spawn(`kilo`, args, {
44
+ // kilocode_change end
43
45
  signal: options.signal,
44
46
  env: {
45
47
  ...process.env,
@@ -111,7 +113,9 @@ export function createOpencodeTui(options) {
111
113
  if (options?.agent) {
112
114
  args.push(`--agent=${options.agent}`);
113
115
  }
114
- const proc = spawn(`opencode`, args, {
116
+ // kilocode_change start
117
+ const proc = spawn(`kilo`, args, {
118
+ // kilocode_change end
115
119
  signal: options?.signal,
116
120
  stdio: "inherit",
117
121
  env: {
@@ -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, EventSubscribeResponses, EventTuiCommandExecute, EventTuiPromptAppend, EventTuiSessionSelect, EventTuiToastShow, ExperimentalResourceListResponses, FileListResponses, FilePartInput, FilePartSource, FileReadResponses, FileStatusResponses, FindFilesResponses, FindSymbolsResponses, FindTextResponses, FormatterStatusResponses, GlobalConfigGetResponses, GlobalConfigUpdateErrors, GlobalConfigUpdateResponses, GlobalDisposeResponses, GlobalEventResponses, GlobalHealthResponses, InstanceDisposeResponses, KiloFimErrors, KiloFimResponses, 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, ProjectCurrentResponses, 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, 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, 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, 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, EventSubscribeResponses, EventTuiCommandExecute, EventTuiPromptAppend, EventTuiSessionSelect, EventTuiToastShow, ExperimentalResourceListResponses, FileListResponses, FilePartInput, FilePartSource, FileReadResponses, FileStatusResponses, FindFilesResponses, FindSymbolsResponses, FindTextResponses, FormatterStatusResponses, GlobalConfigGetResponses, GlobalConfigUpdateErrors, GlobalConfigUpdateResponses, GlobalDisposeResponses, GlobalEventResponses, GlobalHealthResponses, InstanceDisposeResponses, KiloCloudSessionGetErrors, KiloCloudSessionGetResponses, KiloCloudSessionImportErrors, KiloCloudSessionImportResponses, KiloCloudSessionsErrors, KiloCloudSessionsResponses, KiloFimErrors, KiloFimResponses, 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, ProjectCurrentResponses, 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, 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, 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, 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
@@ -308,6 +308,7 @@ export declare class Session extends HeyApiClient {
308
308
  parentID?: string;
309
309
  title?: string;
310
310
  permission?: PermissionRuleset;
311
+ platform?: string;
311
312
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionCreateResponses, SessionCreateErrors, ThrowOnError, "fields">;
312
313
  /**
313
314
  * Get session status
@@ -468,6 +469,13 @@ export declare class Session extends HeyApiClient {
468
469
  format?: OutputFormat;
469
470
  system?: string;
470
471
  variant?: string;
472
+ editorContext?: {
473
+ visibleFiles?: Array<string>;
474
+ openTabs?: Array<string>;
475
+ activeFile?: string;
476
+ shell?: string;
477
+ timezone?: string;
478
+ };
471
479
  parts?: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>;
472
480
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionPromptResponses, SessionPromptErrors, ThrowOnError, "fields">;
473
481
  /**
@@ -501,6 +509,13 @@ export declare class Session extends HeyApiClient {
501
509
  format?: OutputFormat;
502
510
  system?: string;
503
511
  variant?: string;
512
+ editorContext?: {
513
+ visibleFiles?: Array<string>;
514
+ openTabs?: Array<string>;
515
+ activeFile?: string;
516
+ shell?: string;
517
+ timezone?: string;
518
+ };
504
519
  parts?: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>;
505
520
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionPromptAsyncResponses, SessionPromptAsyncErrors, ThrowOnError, "fields">;
506
521
  /**
@@ -727,6 +742,30 @@ export declare class Organization extends HeyApiClient {
727
742
  organizationId?: string | null;
728
743
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<KiloOrganizationSetResponses, KiloOrganizationSetErrors, ThrowOnError, "fields">;
729
744
  }
745
+ export declare class Session2 extends HeyApiClient {
746
+ /**
747
+ * Get cloud session
748
+ *
749
+ * Fetch full session data from the Kilo cloud for preview
750
+ */
751
+ get<ThrowOnError extends boolean = false>(parameters: {
752
+ id: string;
753
+ directory?: string;
754
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<KiloCloudSessionGetResponses, KiloCloudSessionGetErrors, ThrowOnError, "fields">;
755
+ /**
756
+ * Import session from cloud
757
+ *
758
+ * Download a cloud-synced session and write it to local storage with fresh IDs.
759
+ */
760
+ import<ThrowOnError extends boolean = false>(parameters?: {
761
+ directory?: string;
762
+ sessionId?: string;
763
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<KiloCloudSessionImportResponses, KiloCloudSessionImportErrors, ThrowOnError, "fields">;
764
+ }
765
+ export declare class Cloud extends HeyApiClient {
766
+ private _session?;
767
+ get session(): Session2;
768
+ }
730
769
  export declare class Kilo extends HeyApiClient {
731
770
  /**
732
771
  * Get Kilo Gateway profile
@@ -757,8 +796,21 @@ export declare class Kilo extends HeyApiClient {
757
796
  notifications<ThrowOnError extends boolean = false>(parameters?: {
758
797
  directory?: string;
759
798
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<KiloNotificationsResponses, KiloNotificationsErrors, ThrowOnError, "fields">;
799
+ /**
800
+ * Get cloud sessions
801
+ *
802
+ * Fetch cloud CLI sessions from Kilo API
803
+ */
804
+ cloudSessions<ThrowOnError extends boolean = false>(parameters?: {
805
+ directory?: string;
806
+ cursor?: string;
807
+ limit?: number;
808
+ gitUrl?: string;
809
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<KiloCloudSessionsResponses, KiloCloudSessionsErrors, ThrowOnError, "fields">;
760
810
  private _organization?;
761
811
  get organization(): Organization;
812
+ private _cloud?;
813
+ get cloud(): Cloud;
762
814
  }
763
815
  export declare class Find extends HeyApiClient {
764
816
  /**
@@ -555,6 +555,7 @@ export class Session extends HeyApiClient {
555
555
  { in: "body", key: "parentID" },
556
556
  { in: "body", key: "title" },
557
557
  { in: "body", key: "permission" },
558
+ { in: "body", key: "platform" },
558
559
  ],
559
560
  },
560
561
  ]);
@@ -892,6 +893,7 @@ export class Session extends HeyApiClient {
892
893
  { in: "body", key: "format" },
893
894
  { in: "body", key: "system" },
894
895
  { in: "body", key: "variant" },
896
+ { in: "body", key: "editorContext" },
895
897
  { in: "body", key: "parts" },
896
898
  ],
897
899
  },
@@ -947,6 +949,7 @@ export class Session extends HeyApiClient {
947
949
  { in: "body", key: "format" },
948
950
  { in: "body", key: "system" },
949
951
  { in: "body", key: "variant" },
952
+ { in: "body", key: "editorContext" },
950
953
  { in: "body", key: "parts" },
951
954
  ],
952
955
  },
@@ -1421,6 +1424,59 @@ export class Organization extends HeyApiClient {
1421
1424
  });
1422
1425
  }
1423
1426
  }
1427
+ export class Session2 extends HeyApiClient {
1428
+ /**
1429
+ * Get cloud session
1430
+ *
1431
+ * Fetch full session data from the Kilo cloud for preview
1432
+ */
1433
+ get(parameters, options) {
1434
+ const params = buildClientParams([parameters], [
1435
+ {
1436
+ args: [
1437
+ { in: "path", key: "id" },
1438
+ { in: "query", key: "directory" },
1439
+ ],
1440
+ },
1441
+ ]);
1442
+ return (options?.client ?? this.client).get({
1443
+ url: "/kilo/cloud/session/{id}",
1444
+ ...options,
1445
+ ...params,
1446
+ });
1447
+ }
1448
+ /**
1449
+ * Import session from cloud
1450
+ *
1451
+ * Download a cloud-synced session and write it to local storage with fresh IDs.
1452
+ */
1453
+ import(parameters, options) {
1454
+ const params = buildClientParams([parameters], [
1455
+ {
1456
+ args: [
1457
+ { in: "query", key: "directory" },
1458
+ { in: "body", key: "sessionId" },
1459
+ ],
1460
+ },
1461
+ ]);
1462
+ return (options?.client ?? this.client).post({
1463
+ url: "/kilo/cloud/session/import",
1464
+ ...options,
1465
+ ...params,
1466
+ headers: {
1467
+ "Content-Type": "application/json",
1468
+ ...options?.headers,
1469
+ ...params.headers,
1470
+ },
1471
+ });
1472
+ }
1473
+ }
1474
+ export class Cloud extends HeyApiClient {
1475
+ _session;
1476
+ get session() {
1477
+ return (this._session ??= new Session2({ client: this.client }));
1478
+ }
1479
+ }
1424
1480
  export class Kilo extends HeyApiClient {
1425
1481
  /**
1426
1482
  * Get Kilo Gateway profile
@@ -1477,10 +1533,36 @@ export class Kilo extends HeyApiClient {
1477
1533
  ...params,
1478
1534
  });
1479
1535
  }
1536
+ /**
1537
+ * Get cloud sessions
1538
+ *
1539
+ * Fetch cloud CLI sessions from Kilo API
1540
+ */
1541
+ cloudSessions(parameters, options) {
1542
+ const params = buildClientParams([parameters], [
1543
+ {
1544
+ args: [
1545
+ { in: "query", key: "directory" },
1546
+ { in: "query", key: "cursor" },
1547
+ { in: "query", key: "limit" },
1548
+ { in: "query", key: "gitUrl" },
1549
+ ],
1550
+ },
1551
+ ]);
1552
+ return (options?.client ?? this.client).get({
1553
+ url: "/kilo/cloud-sessions",
1554
+ ...options,
1555
+ ...params,
1556
+ });
1557
+ }
1480
1558
  _organization;
1481
1559
  get organization() {
1482
1560
  return (this._organization ??= new Organization({ client: this.client }));
1483
1561
  }
1562
+ _cloud;
1563
+ get cloud() {
1564
+ return (this._cloud ??= new Cloud({ client: this.client }));
1565
+ }
1484
1566
  }
1485
1567
  export class Find extends HeyApiClient {
1486
1568
  /**
@@ -120,6 +120,13 @@ export type UserMessage = {
120
120
  [key: string]: boolean;
121
121
  };
122
122
  variant?: string;
123
+ editorContext?: {
124
+ visibleFiles?: Array<string>;
125
+ openTabs?: Array<string>;
126
+ activeFile?: string;
127
+ shell?: string;
128
+ timezone?: string;
129
+ };
123
130
  };
124
131
  export type ProviderAuthError = {
125
132
  name: "ProviderAuthError";
@@ -452,7 +459,16 @@ export type EventMessagePartUpdated = {
452
459
  type: "message.part.updated";
453
460
  properties: {
454
461
  part: Part;
455
- delta?: string;
462
+ };
463
+ };
464
+ export type EventMessagePartDelta = {
465
+ type: "message.part.delta";
466
+ properties: {
467
+ sessionID: string;
468
+ messageID: string;
469
+ partID: string;
470
+ field: string;
471
+ delta: string;
456
472
  };
457
473
  };
458
474
  export type EventMessagePartRemoved = {
@@ -606,10 +622,6 @@ export type Todo = {
606
622
  * Priority level of the task: high, medium, low
607
623
  */
608
624
  priority: string;
609
- /**
610
- * Unique identifier for the todo item
611
- */
612
- id: string;
613
625
  };
614
626
  export type EventTodoUpdated = {
615
627
  type: "todo.updated";
@@ -809,7 +821,7 @@ export type EventWorktreeFailed = {
809
821
  message: string;
810
822
  };
811
823
  };
812
- export type Event = EventInstallationUpdated | EventInstallationUpdateAvailable | EventProjectUpdated | EventServerInstanceDisposed | EventServerConnected | EventGlobalDisposed | EventLspClientDiagnostics | EventLspUpdated | EventFileEdited | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventPermissionAsked | EventPermissionReplied | EventSessionStatus | EventSessionIdle | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventSessionCompacted | EventFileWatcherUpdated | EventTodoUpdated | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventCommandExecuted | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventSessionDiff | EventSessionError | EventSessionTurnOpen | EventSessionTurnClose | EventVcsBranchUpdated | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventWorktreeReady | EventWorktreeFailed;
824
+ export type Event = EventInstallationUpdated | EventInstallationUpdateAvailable | EventProjectUpdated | EventServerInstanceDisposed | EventServerConnected | EventGlobalDisposed | EventLspClientDiagnostics | EventLspUpdated | EventFileEdited | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartDelta | EventMessagePartRemoved | EventPermissionAsked | EventPermissionReplied | EventSessionStatus | EventSessionIdle | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventSessionCompacted | EventFileWatcherUpdated | EventTodoUpdated | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventCommandExecuted | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventSessionDiff | EventSessionError | EventSessionTurnOpen | EventSessionTurnClose | EventVcsBranchUpdated | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventWorktreeReady | EventWorktreeFailed;
813
825
  export type GlobalEvent = {
814
826
  directory: string;
815
827
  payload: Event;
@@ -2563,6 +2575,7 @@ export type SessionCreateData = {
2563
2575
  parentID?: string;
2564
2576
  title?: string;
2565
2577
  permission?: PermissionRuleset;
2578
+ platform?: string;
2566
2579
  };
2567
2580
  path?: never;
2568
2581
  query?: {
@@ -3000,6 +3013,13 @@ export type SessionPromptData = {
3000
3013
  format?: OutputFormat;
3001
3014
  system?: string;
3002
3015
  variant?: string;
3016
+ editorContext?: {
3017
+ visibleFiles?: Array<string>;
3018
+ openTabs?: Array<string>;
3019
+ activeFile?: string;
3020
+ shell?: string;
3021
+ timezone?: string;
3022
+ };
3003
3023
  parts: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>;
3004
3024
  };
3005
3025
  path: {
@@ -3168,6 +3188,13 @@ export type SessionPromptAsyncData = {
3168
3188
  format?: OutputFormat;
3169
3189
  system?: string;
3170
3190
  variant?: string;
3191
+ editorContext?: {
3192
+ visibleFiles?: Array<string>;
3193
+ openTabs?: Array<string>;
3194
+ activeFile?: string;
3195
+ shell?: string;
3196
+ timezone?: string;
3197
+ };
3171
3198
  parts: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>;
3172
3199
  };
3173
3200
  path: {
@@ -3853,6 +3880,90 @@ export type KiloNotificationsResponses = {
3853
3880
  }>;
3854
3881
  };
3855
3882
  export type KiloNotificationsResponse = KiloNotificationsResponses[keyof KiloNotificationsResponses];
3883
+ export type KiloCloudSessionGetData = {
3884
+ body?: never;
3885
+ path: {
3886
+ id: string;
3887
+ };
3888
+ query?: {
3889
+ directory?: string;
3890
+ };
3891
+ url: "/kilo/cloud/session/{id}";
3892
+ };
3893
+ export type KiloCloudSessionGetErrors = {
3894
+ /**
3895
+ * Not found
3896
+ */
3897
+ 404: NotFoundError;
3898
+ };
3899
+ export type KiloCloudSessionGetError = KiloCloudSessionGetErrors[keyof KiloCloudSessionGetErrors];
3900
+ export type KiloCloudSessionGetResponses = {
3901
+ /**
3902
+ * Cloud session data
3903
+ */
3904
+ 200: unknown;
3905
+ };
3906
+ export type KiloCloudSessionImportData = {
3907
+ body?: {
3908
+ sessionId: string;
3909
+ };
3910
+ path?: never;
3911
+ query?: {
3912
+ directory?: string;
3913
+ };
3914
+ url: "/kilo/cloud/session/import";
3915
+ };
3916
+ export type KiloCloudSessionImportErrors = {
3917
+ /**
3918
+ * Bad request
3919
+ */
3920
+ 400: BadRequestError;
3921
+ /**
3922
+ * Not found
3923
+ */
3924
+ 404: NotFoundError;
3925
+ };
3926
+ export type KiloCloudSessionImportError = KiloCloudSessionImportErrors[keyof KiloCloudSessionImportErrors];
3927
+ export type KiloCloudSessionImportResponses = {
3928
+ /**
3929
+ * Imported session info
3930
+ */
3931
+ 200: unknown;
3932
+ };
3933
+ export type KiloCloudSessionsData = {
3934
+ body?: never;
3935
+ path?: never;
3936
+ query?: {
3937
+ directory?: string;
3938
+ cursor?: string;
3939
+ limit?: number;
3940
+ gitUrl?: string;
3941
+ };
3942
+ url: "/kilo/cloud-sessions";
3943
+ };
3944
+ export type KiloCloudSessionsErrors = {
3945
+ /**
3946
+ * Bad request
3947
+ */
3948
+ 400: BadRequestError;
3949
+ };
3950
+ export type KiloCloudSessionsError = KiloCloudSessionsErrors[keyof KiloCloudSessionsErrors];
3951
+ export type KiloCloudSessionsResponses = {
3952
+ /**
3953
+ * Cloud sessions list
3954
+ */
3955
+ 200: {
3956
+ cliSessions: Array<{
3957
+ session_id: string;
3958
+ title: string | null;
3959
+ created_at: string;
3960
+ updated_at: string;
3961
+ version: number;
3962
+ }>;
3963
+ nextCursor: string | null;
3964
+ };
3965
+ };
3966
+ export type KiloCloudSessionsResponse = KiloCloudSessionsResponses[keyof KiloCloudSessionsResponses];
3856
3967
  export type FindTextData = {
3857
3968
  body?: never;
3858
3969
  path?: never;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@kilocode/sdk",
4
- "version": "1.0.25",
4
+ "version": "7.0.28",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/Kilo-Org/kilo",
9
+ "url": "https://github.com/Kilo-Org/kilocode",
10
10
  "directory": "packages/sdk/js"
11
11
  },
12
12
  "scripts": {
@@ -27,12 +27,34 @@
27
27
  "types": "./dist/server.d.ts"
28
28
  },
29
29
  "./v2": {
30
- "import": "./dist/v2/index.js",
31
- "types": "./dist/v2/index.d.ts"
30
+ "types": {
31
+ "import": "./dist/v2/index.d.js",
32
+ "types": "./dist/v2/index.d.d.ts"
33
+ },
34
+ "default": {
35
+ "import": "./dist/v2/index.js",
36
+ "types": "./dist/v2/index.d.ts"
37
+ }
32
38
  },
33
39
  "./v2/client": {
34
- "import": "./dist/v2/client.js",
35
- "types": "./dist/v2/client.d.ts"
40
+ "types": {
41
+ "import": "./dist/v2/client.d.js",
42
+ "types": "./dist/v2/client.d.d.ts"
43
+ },
44
+ "default": {
45
+ "import": "./dist/v2/client.js",
46
+ "types": "./dist/v2/client.d.ts"
47
+ }
48
+ },
49
+ "./v2/gen/client": {
50
+ "types": {
51
+ "import": "./dist/v2/gen/client/index.d.js",
52
+ "types": "./dist/v2/gen/client/index.d.d.ts"
53
+ },
54
+ "default": {
55
+ "import": "./dist/v2/gen/client/index.js",
56
+ "types": "./dist/v2/gen/client/index.d.ts"
57
+ }
36
58
  },
37
59
  "./v2/server": {
38
60
  "import": "./dist/v2/server.js",