@botiverse/kimi-code-sdk 0.16.0 → 0.17.1

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/NOTICE.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # NOTICE
2
2
 
3
3
  @botiverse/kimi-code-sdk is a repackage of the built **@moonshot-ai/kimi-code-sdk** node-sdk
4
- from [MoonshotAI/kimi-code](https://github.com/MoonshotAI/kimi-code) at `@moonshot-ai/kimi-code@0.16.0`, distributed under upstream's MIT License (see LICENSE). Sibling packages are bundled into `dist`.
4
+ from [MoonshotAI/kimi-code](https://github.com/MoonshotAI/kimi-code) at `@moonshot-ai/kimi-code@0.17.1`, distributed under upstream's MIT License (see LICENSE). Sibling packages are bundled into `dist`.
5
5
  Mirror + provenance: https://github.com/botiverse/kimi-code-sdk
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @botiverse/kimi-code-sdk
2
2
 
3
- Built repackage of `@moonshot-ai/kimi-code-sdk` (kimi-code @moonshot-ai/kimi-code@0.16.0) for Slock/Botiverse.
3
+ Built repackage of `@moonshot-ai/kimi-code-sdk` (kimi-code @moonshot-ai/kimi-code@0.17.1) for Slock/Botiverse.
4
4
  Read-only mirror + release notes: https://github.com/botiverse/kimi-code-sdk
5
5
 
6
6
  > Not affiliated with Moonshot AI. MIT (see LICENSE).
package/dist/index.d.mts CHANGED
@@ -451,6 +451,10 @@ declare interface ApprovalResponse_2 {
451
451
 
452
452
  export declare type ApprovalScope = 'session';
453
453
 
454
+ declare interface ArchiveSessionPayload {
455
+ readonly sessionId: string;
456
+ }
457
+
454
458
  export { AssistantDeltaEvent }
455
459
 
456
460
  declare interface AudioURLPart {
@@ -903,6 +907,13 @@ declare interface ChatProvider {
903
907
  uploadVideo?(input: string | VideoUploadInput, options?: GenerateOptions): Promise<VideoURLPart>;
904
908
  }
905
909
 
910
+ declare interface ClientTelemetryInfo {
911
+ readonly id?: string | undefined;
912
+ readonly name?: string | undefined;
913
+ readonly version?: string | undefined;
914
+ readonly uiMode?: string | undefined;
915
+ }
916
+
906
917
  declare interface ClockSources {
907
918
  /**
908
919
  * Wall-clock epoch milliseconds. May be overridden in tests / bench
@@ -1055,6 +1066,7 @@ declare interface CoreAPI extends SessionAPIWithId {
1055
1066
  removeKimiProvider: (payload: RemoveKimiProviderPayload) => KimiConfig;
1056
1067
  createSession: (payload: CreateSessionPayload) => SessionSummary_2;
1057
1068
  closeSession: (payload: CloseSessionPayload) => void;
1069
+ archiveSession: (payload: ArchiveSessionPayload) => void;
1058
1070
  resumeSession: (payload: ResumeSessionPayload) => ResumeSessionResult;
1059
1071
  reloadSession: (payload: ReloadSessionPayload) => ResumeSessionResult;
1060
1072
  forkSession: (payload: ForkSessionPayload) => ResumeSessionResult;
@@ -1122,6 +1134,7 @@ declare interface CreateSessionPayload {
1122
1134
  readonly permission?: PermissionMode_2 | undefined;
1123
1135
  readonly metadata?: JsonObject_2 | undefined;
1124
1136
  readonly mcpServers?: Readonly<Record<string, McpServerConfig>>;
1137
+ readonly client?: ClientTelemetryInfo | undefined;
1125
1138
  }
1126
1139
 
1127
1140
  export { CronFiredEvent }
@@ -2521,6 +2534,8 @@ declare interface KaosProcess {
2521
2534
  wait(): Promise<number>;
2522
2535
  /** Send a signal to the process (defaults to `SIGTERM`). */
2523
2536
  kill(signal?: NodeJS.Signals): Promise<void>;
2537
+ /** Release stdin/stdout/stderr resources owned by this process wrapper. */
2538
+ dispose(): Promise<void> | void;
2524
2539
  }
2525
2540
 
2526
2541
  export declare const KIMI_ERROR_INFO: {
@@ -3252,6 +3267,7 @@ declare class KimiCore implements PromisableMethods<CoreAPI> {
3252
3267
  getCoreInfo(): CoreInfo;
3253
3268
  getExperimentalFeatures(): readonly ExperimentalFeatureState[];
3254
3269
  closeSession({ sessionId }: CloseSessionPayload): Promise<void>;
3270
+ archiveSession({ sessionId }: ArchiveSessionPayload): Promise<void>;
3255
3271
  resumeSession(input: ResumeSessionPayload): Promise<ResumeSessionResult>;
3256
3272
  resumeSessionWithOverrides(input: ResumeSessionPayload, overrides: {
3257
3273
  kaos?: Kaos;
@@ -3546,6 +3562,7 @@ export declare interface ListSessionsOptions {
3546
3562
  declare interface ListSessionsPayload {
3547
3563
  readonly workDir?: string;
3548
3564
  readonly sessionId?: string;
3565
+ readonly includeArchive?: boolean;
3549
3566
  }
3550
3567
 
3551
3568
  declare interface LLM {
@@ -3619,6 +3636,17 @@ declare interface LLMStreamTiming {
3619
3636
  */
3620
3637
  export declare function loadBuiltInCatalog(text?: string): Catalog | undefined;
3621
3638
 
3639
+ /**
3640
+ * Lenient variant of `loadRuntimeConfig` that never throws: schema errors
3641
+ * drop only the offending sections (whole entry for `providers`/`models`,
3642
+ * whole top-level section otherwise) and a bad KIMI_MODEL_* env overlay is
3643
+ * skipped, each reported as a warning. A file that cannot be used at all
3644
+ * additionally sets `fileError` so startup can fail fast while mid-run
3645
+ * reloads degrade. Runtime read paths use this; write paths must keep using
3646
+ * the strict readers so a broken file is never silently rewritten.
3647
+ */
3648
+ export declare function loadRuntimeConfigSafe(filePath: string, env?: Readonly<Record<string, string | undefined>>): RuntimeConfigLoadResult;
3649
+
3622
3650
  /**
3623
3651
  * Root logger. Import and use directly for events that don't belong to any
3624
3652
  * session (CLI startup, harness construction, etc.):
@@ -4826,6 +4854,11 @@ declare interface ReplayRangeOptions {
4826
4854
  readonly count?: number;
4827
4855
  }
4828
4856
 
4857
+ export declare function resolveConfigPath(input: {
4858
+ readonly homeDir?: string | undefined;
4859
+ readonly configPath?: string | undefined;
4860
+ }): string;
4861
+
4829
4862
  declare interface ResolvedAgentProfile {
4830
4863
  name: string;
4831
4864
  description?: string;
@@ -4953,6 +4986,22 @@ declare interface RunSubagentOptions {
4953
4986
  readonly suppressRateLimitFailureEvent?: boolean;
4954
4987
  }
4955
4988
 
4989
+ declare interface RuntimeConfigLoadResult {
4990
+ readonly config: KimiConfig;
4991
+ /** Problems in config.toml itself; non-empty means parts (or all) of the file were ignored. */
4992
+ readonly fileWarnings: readonly string[];
4993
+ /** Problems applying KIMI_MODEL_* env overrides; the overlay was skipped. */
4994
+ readonly envWarnings: readonly string[];
4995
+ /**
4996
+ * Set when the file is entirely unusable (unreadable, TOML syntax error, or
4997
+ * nothing salvageable) and `config` is pure defaults. Startup fails fast on
4998
+ * this — defaults-only means the user looks logged out, which is worse than
4999
+ * an actionable parse error. Mid-run reloads ignore it and keep the last
5000
+ * good config instead.
5001
+ */
5002
+ readonly fileError?: KimiError;
5003
+ }
5004
+
4956
5005
  declare interface SDKAgentAPI {
4957
5006
  emitEvent: (event: AgentEvent) => void;
4958
5007
  requestApproval: (request: ApprovalRequest) => Promise<ApprovalResponse>;
@@ -6208,6 +6257,16 @@ declare class TurnFlow {
6208
6257
  /** Allocates the next monotonic turn id. */
6209
6258
  private allocateTurnId;
6210
6259
  restorePrompt(): void;
6260
+ /**
6261
+ * Raise the turn counter to cover a turnId observed in a replayed loop event.
6262
+ * This is the authoritative source of the restored counter: every turn that
6263
+ * ran — a prompted turn, a goal continuation, or a steer-launched turn —
6264
+ * emits loop events carrying its real turnId, even though only prompted turns
6265
+ * write a `turn.prompt` record. Resuming then continues from `max + 1`. Only
6266
+ * ever raises the counter, never lowers it, so the live path (where `turnId`
6267
+ * is already allocated before any loop event) is unaffected.
6268
+ */
6269
+ observeRestoredTurnId(turnId: number): void;
6211
6270
  restoreSteer(input: readonly ContentPart[], origin: PromptOrigin): void;
6212
6271
  cancel(turnId?: number, reason?: unknown): void;
6213
6272
  get currentId(): number;