@botiverse/kimi-code-sdk 0.20.1-botiverse.0 → 0.20.3

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.20.1`, 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.20.3`, 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.20.1) for Slock/Botiverse.
3
+ Built repackage of `@moonshot-ai/kimi-code-sdk` (kimi-code @moonshot-ai/kimi-code@0.20.3) 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
@@ -431,6 +431,15 @@ declare interface AnthropicOptions {
431
431
  * encode a parseable Claude version. Leave undefined to infer from the name.
432
432
  */
433
433
  adaptiveThinking?: boolean | undefined;
434
+ /**
435
+ * Use the Anthropic **beta** Messages API (`client.beta.messages.create`,
436
+ * `POST /v1/messages?beta=true`) instead of the standard Messages API.
437
+ *
438
+ * Beta features (`betaFeatures`) are then sent via the request `betas`
439
+ * field rather than the `anthropic-beta` header. Defaults to false, which
440
+ * keeps the standard endpoint + header behavior.
441
+ */
442
+ betaApi?: boolean | undefined;
434
443
  clientFactory?: (auth: ProviderRequestAuth) => Anthropic;
435
444
  }
436
445
 
@@ -1962,13 +1971,19 @@ declare class FullCompaction {
1962
1971
  promise: Promise<void>;
1963
1972
  blockedByTurn: boolean;
1964
1973
  } | null;
1974
+ private readonly observedMaxContextTokensByModel;
1965
1975
  protected readonly strategy: CompactionStrategy;
1966
1976
  constructor(agent: Agent, strategy?: CompactionStrategy);
1967
1977
  get isCompacting(): boolean;
1978
+ getEffectiveMaxContextTokens(): number;
1979
+ estimateCurrentRequestTokens(): number;
1980
+ shouldRecoverFromContextOverflow(error: unknown, estimatedRequestTokens?: number): boolean;
1981
+ observeContextOverflow(estimatedRequestTokens: number): void;
1968
1982
  begin(data: Readonly<CompactionBeginData>): void;
1969
1983
  cancel(): void;
1970
1984
  markCompleted(): void;
1971
1985
  private get tokenCountWithPending();
1986
+ private estimateRequestTokens;
1972
1987
  resetForTurn(): void;
1973
1988
  handleOverflowError(signal: AbortSignal, error: unknown): Promise<void>;
1974
1989
  beforeStep(signal: AbortSignal): Promise<void>;
@@ -2385,6 +2400,7 @@ declare interface GoogleGenAIOptions {
2385
2400
  project?: string | undefined;
2386
2401
  location?: string | undefined;
2387
2402
  stream?: boolean | undefined;
2403
+ defaultHeaders?: Record<string, string>;
2388
2404
  clientFactory?: (auth: ProviderRequestAuth) => GoogleGenAI;
2389
2405
  }
2390
2406
 
@@ -3149,7 +3165,9 @@ declare const KimiConfigPatchSchema: z.ZodObject<{
3149
3165
  capabilities: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
3150
3166
  displayName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
3151
3167
  reasoningKey: z.ZodOptional<z.ZodOptional<z.ZodString>>;
3168
+ protocol: z.ZodOptional<z.ZodOptional<z.ZodLiteral<"anthropic">>>;
3152
3169
  adaptiveThinking: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
3170
+ betaApi: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
3153
3171
  }, z.core.$strip>>>;
3154
3172
  thinking: z.ZodOptional<z.ZodObject<{
3155
3173
  mode: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
@@ -3251,6 +3269,10 @@ declare const KimiConfigPatchSchema: z.ZodObject<{
3251
3269
  killGracePeriodMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
3252
3270
  printWaitCeilingS: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
3253
3271
  }, z.core.$strip>>;
3272
+ modelCatalog: z.ZodOptional<z.ZodObject<{
3273
+ refreshIntervalMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
3274
+ refreshOnStart: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
3275
+ }, z.core.$strip>>;
3254
3276
  experimental: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
3255
3277
  telemetry: z.ZodOptional<z.ZodBoolean>;
3256
3278
  }, z.core.$strict>;
@@ -3302,7 +3324,9 @@ declare const KimiConfigSchema: z.ZodObject<{
3302
3324
  capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
3303
3325
  displayName: z.ZodOptional<z.ZodString>;
3304
3326
  reasoningKey: z.ZodOptional<z.ZodString>;
3327
+ protocol: z.ZodOptional<z.ZodLiteral<"anthropic">>;
3305
3328
  adaptiveThinking: z.ZodOptional<z.ZodBoolean>;
3329
+ betaApi: z.ZodOptional<z.ZodBoolean>;
3306
3330
  }, z.core.$strip>>>;
3307
3331
  thinking: z.ZodOptional<z.ZodObject<{
3308
3332
  mode: z.ZodOptional<z.ZodEnum<{
@@ -3404,6 +3428,10 @@ declare const KimiConfigSchema: z.ZodObject<{
3404
3428
  killGracePeriodMs: z.ZodOptional<z.ZodNumber>;
3405
3429
  printWaitCeilingS: z.ZodOptional<z.ZodNumber>;
3406
3430
  }, z.core.$strip>>;
3431
+ modelCatalog: z.ZodOptional<z.ZodObject<{
3432
+ refreshIntervalMs: z.ZodOptional<z.ZodNumber>;
3433
+ refreshOnStart: z.ZodOptional<z.ZodBoolean>;
3434
+ }, z.core.$strip>>;
3407
3435
  experimental: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
3408
3436
  telemetry: z.ZodOptional<z.ZodBoolean>;
3409
3437
  raw: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -4412,7 +4440,9 @@ declare const ModelAliasSchema: z.ZodObject<{
4412
4440
  capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
4413
4441
  displayName: z.ZodOptional<z.ZodString>;
4414
4442
  reasoningKey: z.ZodOptional<z.ZodString>;
4443
+ protocol: z.ZodOptional<z.ZodLiteral<"anthropic">>;
4415
4444
  adaptiveThinking: z.ZodOptional<z.ZodBoolean>;
4445
+ betaApi: z.ZodOptional<z.ZodBoolean>;
4416
4446
  }, z.core.$strip>;
4417
4447
 
4418
4448
  /**
@@ -4929,6 +4959,7 @@ declare interface ProviderManagerOptions {
4929
4959
  readonly kimiRequestHeaders?: Record<string, string>;
4930
4960
  readonly resolveOAuthTokenProvider?: OAuthTokenProviderResolver;
4931
4961
  readonly promptCacheKey?: string;
4962
+ readonly adaptiveThinkingOverride?: () => boolean | undefined;
4932
4963
  }
4933
4964
 
4934
4965
  /**
@@ -5134,6 +5165,10 @@ declare interface ResolvedRuntimeProvider {
5134
5165
  /** Declared 'always_thinking' capability — the model cannot disable thinking. */
5135
5166
  readonly alwaysThinking?: boolean;
5136
5167
  readonly maxOutputSize?: number;
5168
+ /** Configured provider wire type (`provider.type`), before any model-level protocol override. */
5169
+ readonly type: ProviderType;
5170
+ /** Model-level protocol override (`alias.protocol`); when set, takes precedence over `type` for transport selection. */
5171
+ readonly protocol: ModelAlias['protocol'];
5137
5172
  }
5138
5173
 
5139
5174
  declare interface ResolvedToolExecutionHookContext extends ToolExecutionHookContext {
@@ -6548,6 +6583,7 @@ declare class ToolManager {
6548
6583
  initializeBuiltinTools(): void;
6549
6584
  refreshBuiltinTools(): void;
6550
6585
  private createVideoUploader;
6586
+ private videoUploadTelemetryProps;
6551
6587
  get loopTools(): readonly ExecutableTool[];
6552
6588
  }
6553
6589
 
@@ -6699,6 +6735,13 @@ declare class TurnFlow {
6699
6735
  private hasPriorStepToolCallKey;
6700
6736
  private trackTurnInterrupted;
6701
6737
  private telemetryMode;
6738
+ /**
6739
+ * Resolve the current model's provider wire type and any model-level protocol
6740
+ * override for request telemetry. Never throws — telemetry must not break a
6741
+ * turn over an unresolvable provider config (the step loop will surface that
6742
+ * error on its own).
6743
+ */
6744
+ private requestProtocolProps;
6702
6745
  private shouldTrackApiError;
6703
6746
  }
6704
6747
 
@@ -6845,32 +6888,4 @@ declare interface WorkspaceAdditionalDirsLoadResult {
6845
6888
  readonly warning?: string;
6846
6889
  }
6847
6890
 
6848
- export { }
6849
-
6850
- // Botiverse mirror surface extension — see scripts/repackage-sdk.mjs.
6851
- // Minimal type declaration; runtime implementation is bundled in dist/index.mjs.
6852
- declare class LocalKaos implements Kaos {
6853
- static create(): Promise<LocalKaos>;
6854
- readonly name: string;
6855
- readonly osEnv: Kaos['osEnv'];
6856
- pathClass(): 'posix' | 'win32';
6857
- normpath(path: string): string;
6858
- gethome(): string;
6859
- getcwd(): string;
6860
- chdir(path: string): Promise<void>;
6861
- withCwd(cwd: string): LocalKaos;
6862
- withEnv(env: Record<string, string>): LocalKaos;
6863
- stat: Kaos['stat'];
6864
- iterdir: Kaos['iterdir'];
6865
- glob: Kaos['glob'];
6866
- readBytes: Kaos['readBytes'];
6867
- readText: Kaos['readText'];
6868
- readLines: Kaos['readLines'];
6869
- writeBytes: Kaos['writeBytes'];
6870
- writeText: Kaos['writeText'];
6871
- mkdir: Kaos['mkdir'];
6872
- exec: Kaos['exec'];
6873
- execWithEnv: Kaos['execWithEnv'];
6874
- }
6875
- export { LocalKaos };
6876
- export type { Kaos };
6891
+ export { }