@botiverse/kimi-code-sdk 0.9.3 → 0.9.4

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.14.2`, 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.15.0`, 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.14.2) for Slock/Botiverse.
3
+ Built repackage of `@moonshot-ai/kimi-code-sdk` (kimi-code @moonshot-ai/kimi-code@0.15.0) 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
@@ -77,7 +77,6 @@ declare class Agent {
77
77
  readonly hooks?: HookEngine;
78
78
  readonly log: Logger;
79
79
  readonly telemetry: TelemetryClient;
80
- readonly appVersion?: string;
81
80
  readonly experimentalFlags: ExperimentalFlagResolver;
82
81
  readonly blobStore: BlobStore | undefined;
83
82
  readonly records: AgentRecords;
@@ -215,7 +214,6 @@ declare interface AgentOptions {
215
214
  readonly log?: Logger;
216
215
  readonly telemetry?: TelemetryClient | undefined;
217
216
  readonly pluginSessionStarts?: readonly EnabledPluginSessionStart[];
218
- readonly appVersion?: string;
219
217
  readonly experimentalFlags?: ExperimentalFlagResolver;
220
218
  }
221
219
 
@@ -230,8 +228,6 @@ declare interface AgentRecordEvents {
230
228
  metadata: {
231
229
  protocol_version: string;
232
230
  created_at: number;
233
- app_version?: string;
234
- resumed?: boolean;
235
231
  };
236
232
  forked: {};
237
233
  'turn.prompt': {
@@ -902,20 +898,6 @@ declare interface ChatProvider {
902
898
  withMaxCompletionTokens?(maxCompletionTokens: number): ChatProvider;
903
899
  /** Upload a video and return a content part that can be sent to this provider. */
904
900
  uploadVideo?(input: string | VideoUploadInput, options?: GenerateOptions): Promise<VideoURLPart>;
905
- /**
906
- * Return declared capabilities for `model` (defaults to `modelName`).
907
- *
908
- * Unknown / uncatalogued models return {@link UNKNOWN_CAPABILITY} rather
909
- * than throwing, so capability checks stay non-fatal and operators can
910
- * point at private/custom deployments without crashing.
911
- *
912
- * Optional on the interface so pre-existing test mocks (which predate
913
- * the capability matrix) still structurally satisfy `ChatProvider`
914
- * without churn. Callers that gate on modalities should fall back to
915
- * {@link UNKNOWN_CAPABILITY} when a provider does not expose it.
916
- */
917
- getCapability?(model?: string): ModelCapability;
918
- getContextSizeLimit?(): number | undefined;
919
901
  }
920
902
 
921
903
  declare interface ClockSources {
@@ -1054,6 +1036,7 @@ declare class ContextMemory {
1054
1036
  project(messages: readonly ContextMessage[]): Message[];
1055
1037
  get messages(): Message[];
1056
1038
  useProjectedHistoryFrom(source: ContextMemory): void;
1039
+ finishResume(): void;
1057
1040
  appendLoopEvent(event: LoopRecordedEvent): void;
1058
1041
  appendMessage(message: ContextMessage): void;
1059
1042
  private flushDeferredMessagesIfToolExchangeClosed;
@@ -3842,10 +3825,15 @@ declare class McpConnectionManager {
3842
3825
  private readonly log;
3843
3826
  constructor(options?: McpConnectionManagerOptions);
3844
3827
  /**
3845
- * Returns the URL of an HTTP MCP server by name, or `undefined` for
3846
- * unknown / non-HTTP / disabled entries. Used by the synthetic auth tool
3828
+ * Returns the URL of a remote MCP server by name, or `undefined` for
3829
+ * unknown / non-remote / disabled entries. Used by the synthetic auth tool
3847
3830
  * to drive OAuth discovery against the right base URL.
3848
3831
  */
3832
+ getRemoteServerUrl(name: string): string | undefined;
3833
+ /**
3834
+ * @deprecated Use {@link getRemoteServerUrl}. Kept for in-repo callers that
3835
+ * were written before legacy SSE support shared the same OAuth path.
3836
+ */
3849
3837
  getHttpServerUrl(name: string): string | undefined;
3850
3838
  onStatusChange(listener: McpStatusListener): () => void;
3851
3839
  list(): readonly McpServerEntry[];
@@ -3886,7 +3874,7 @@ declare class McpConnectionManager {
3886
3874
  declare interface McpConnectionManagerOptions {
3887
3875
  readonly envLookup?: (name: string) => string | undefined;
3888
3876
  /**
3889
- * Optional OAuth orchestrator. When provided, HTTP servers without a
3877
+ * Optional OAuth orchestrator. When provided, remote servers without a
3890
3878
  * static bearer token participate in the OAuth-via-synthetic-tool flow:
3891
3879
  * - If `oauthService.hasTokens(name, url)` is true, the provider is
3892
3880
  * attached to the transport so the SDK can refresh tokens on 401.
@@ -4046,11 +4034,21 @@ declare const McpServerConfigSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>,
4046
4034
  url: z.ZodString;
4047
4035
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4048
4036
  bearerTokenEnvVar: z.ZodOptional<z.ZodString>;
4037
+ }, z.core.$strip>, z.ZodObject<{
4038
+ enabled: z.ZodOptional<z.ZodBoolean>;
4039
+ startupTimeoutMs: z.ZodOptional<z.ZodNumber>;
4040
+ toolTimeoutMs: z.ZodOptional<z.ZodNumber>;
4041
+ enabledTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
4042
+ disabledTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
4043
+ transport: z.ZodLiteral<"sse">;
4044
+ url: z.ZodString;
4045
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4046
+ bearerTokenEnvVar: z.ZodOptional<z.ZodString>;
4049
4047
  }, z.core.$strip>], "transport">>;
4050
4048
 
4051
4049
  declare interface McpServerEntry {
4052
4050
  readonly name: string;
4053
- readonly transport: 'stdio' | 'http';
4051
+ readonly transport: McpServerConfig['transport'];
4054
4052
  readonly status: McpServerStatus;
4055
4053
  readonly toolCount: number;
4056
4054
  readonly error?: string;
@@ -4058,7 +4056,7 @@ declare interface McpServerEntry {
4058
4056
 
4059
4057
  export declare interface McpServerInfo {
4060
4058
  readonly name: string;
4061
- readonly transport: 'stdio' | 'http';
4059
+ readonly transport: 'stdio' | 'http' | 'sse';
4062
4060
  readonly status: 'pending' | 'connected' | 'failed' | 'disabled' | 'needs-auth';
4063
4061
  readonly toolCount: number;
4064
4062
  readonly error?: string;
@@ -4174,11 +4172,11 @@ declare const ModelAliasSchema: z.ZodObject<{
4174
4172
  }, z.core.$strip>;
4175
4173
 
4176
4174
  /**
4177
- * Declared capabilities for a specific model exposed by a {@link ChatProvider}.
4175
+ * Declared capabilities for a specific model.
4178
4176
  *
4179
- * Providers return one of these from {@link ChatProvider.getCapability} so
4180
- * callers can gate requests against modalities the model does not accept
4181
- * without dispatching the request and watching it fail upstream.
4177
+ * `getModelCapability(wire, model)` returns one of these so callers can gate
4178
+ * requests against modalities the model does not accept without dispatching
4179
+ * the request and watching it fail upstream.
4182
4180
  *
4183
4181
  * `max_context_tokens: 0` means "unknown"; callers that do not gate on
4184
4182
  * context length can ignore the field.
@@ -4532,7 +4530,7 @@ export declare interface PluginMcpServerInfo {
4532
4530
  readonly name: string;
4533
4531
  readonly runtimeName: string;
4534
4532
  readonly enabled: boolean;
4535
- readonly transport: 'stdio' | 'http';
4533
+ readonly transport: 'stdio' | 'http' | 'sse';
4536
4534
  readonly command?: string;
4537
4535
  readonly args?: readonly string[];
4538
4536
  readonly cwd?: string;
@@ -4800,6 +4798,7 @@ declare type RenameSessionRequest = SessionScopedPayload<RenameSessionPayload>;
4800
4798
 
4801
4799
  declare class ReplayBuilder {
4802
4800
  readonly agent: Agent;
4801
+ postRestoring: boolean;
4803
4802
  captureLiveRecords: boolean;
4804
4803
  protected readonly records: AgentReplayRecord[];
4805
4804
  constructor(agent: Agent);
@@ -5196,7 +5195,7 @@ declare class Session_2 {
5196
5195
  readonly options: SessionOptions_2;
5197
5196
  readonly rpc: SDKSessionRPC;
5198
5197
  readonly telemetry: TelemetryClient;
5199
- readonly skills: SkillRegistry;
5198
+ readonly skills: SessionSkillRegistry;
5200
5199
  readonly agents: Map<string, AgentEntry>;
5201
5200
  readonly mcp: McpConnectionManager;
5202
5201
  readonly log: Logger;
@@ -5420,6 +5419,32 @@ declare interface SessionSkillConfig {
5420
5419
  readonly builtinDir?: string;
5421
5420
  }
5422
5421
 
5422
+ declare class SessionSkillRegistry implements SkillRegistry {
5423
+ private readonly byName;
5424
+ private readonly byPluginAndName;
5425
+ private readonly roots;
5426
+ private readonly skipped;
5427
+ private readonly discoverImpl;
5428
+ private readonly onWarning;
5429
+ readonly sessionId?: string;
5430
+ constructor(options?: SkillRegistryOptions);
5431
+ loadRoots(roots: readonly SkillRoot[]): Promise<void>;
5432
+ registerBuiltinSkill(skill: SkillDefinition): void;
5433
+ register(skill: SkillDefinition, options?: {
5434
+ readonly replace?: boolean;
5435
+ }): void;
5436
+ getSkill(name: string): SkillDefinition | undefined;
5437
+ getPluginSkill(pluginId: string, name: string): SkillDefinition | undefined;
5438
+ private indexPluginSkill;
5439
+ renderSkillPrompt(skill: SkillDefinition, rawArgs: string): string;
5440
+ listSkills(): readonly SkillDefinition[];
5441
+ listInvocableSkills(): readonly SkillDefinition[];
5442
+ getSkillRoots(): readonly string[];
5443
+ getSkippedByPolicy(): readonly SkippedSkill[];
5444
+ getKimiSkillsDescription(): string;
5445
+ getModelSkillListing(): string;
5446
+ }
5447
+
5423
5448
  export declare interface SessionStatus {
5424
5449
  readonly model?: string;
5425
5450
  readonly thinkingLevel: string;
@@ -5613,29 +5638,12 @@ declare interface SkillPluginContext {
5613
5638
  readonly instructions?: string;
5614
5639
  }
5615
5640
 
5616
- declare class SkillRegistry {
5617
- private readonly byName;
5618
- private readonly byPluginAndName;
5619
- private readonly roots;
5620
- private readonly skipped;
5621
- private readonly discoverImpl;
5622
- private readonly onWarning;
5623
- readonly sessionId?: string;
5624
- constructor(options?: SkillRegistryOptions);
5625
- loadRoots(roots: readonly SkillRoot[]): Promise<void>;
5626
- registerBuiltinSkill(skill: SkillDefinition): void;
5627
- register(skill: SkillDefinition, options?: {
5628
- readonly replace?: boolean;
5629
- }): void;
5641
+ declare interface SkillRegistry {
5630
5642
  getSkill(name: string): SkillDefinition | undefined;
5631
5643
  getPluginSkill(pluginId: string, name: string): SkillDefinition | undefined;
5632
- private indexPluginSkill;
5633
5644
  renderSkillPrompt(skill: SkillDefinition, rawArgs: string): string;
5634
- listSkills(): readonly SkillDefinition[];
5635
5645
  listInvocableSkills(): readonly SkillDefinition[];
5636
5646
  getSkillRoots(): readonly string[];
5637
- getSkippedByPolicy(): readonly SkippedSkill[];
5638
- getKimiSkillsDescription(): string;
5639
5647
  getModelSkillListing(): string;
5640
5648
  }
5641
5649
 
@@ -6088,6 +6096,7 @@ declare class ToolManager {
6088
6096
  data(): readonly ToolInfo[];
6089
6097
  storeData(): Readonly<Record<string, unknown>>;
6090
6098
  initializeBuiltinTools(): void;
6099
+ refreshBuiltinTools(): void;
6091
6100
  private createVideoUploader;
6092
6101
  get loopTools(): readonly ExecutableTool[];
6093
6102
  }