/** * The two model-facing knowledge tools (kb_search, kb_chat). agent_id is REQUIRED in the schema: * a model cannot know from the tool spec whether this deployment configures a default service, and a * missing default previously only surfaced at call time, forcing a wasted round-trip. The per-call * fallback to a configured default (dsh plugin settings) is retained as defense-in-depth, * but note defineTool validates args against the schema before execute, so through that entry point * the fallback is inert; the model-facing contract is explicit. * * These descriptions are deliberately STATIC. The available service ids are * deployment state that changes while the process runs, and re-registering a tool * to refresh its description invalidates the prompt prefix cache from the first * changed schema token. The live catalog therefore rides an `agent/pre-step` * context message instead (see `service-context.ts`), leaving these schemas * byte-stable for the life of the process. * * Being static is also why recovery instructions do NOT live here: how to look * further depends on what is actually deployed, and a token spent in a * description is spent on every request. The dynamic carriers own that — the * catalog message states a shortfall where one exists, and a rejected call comes * back with the services that do exist (`service-catalog.ts`). */ import { type KbClient } from "./client.js"; export interface KbToolDeps { client: KbClient; /** Resolves the default retrieval agent id per call (dsh plugin settings); omitted means no default for kb_search. */ resolveDefaultRetrieveAgentId?: () => Promise; /** Resolves the default chat agent id per call (dsh plugin settings); omitted means no default for kb_chat. */ resolveDefaultChatAgentId?: () => Promise; /** * Refreshes the service cache and summarizes what the workspace currently * deploys for one scene. Called only after a client-side API failure, so a * stale cached id self-corrects within the same step instead of waiting for the * next scheduled refresh. */ describeServicesAfterRefresh?: (scene: "search" | "chat") => Promise; /** Read per call (a live-settings deployment supplies a getter). */ chatTimeoutMs: number; } /** * Build the two tool definitions over one shared client. * @param deps - client plus the deployment's explicit pinning and timeout choices. * @returns definitions ready for `ctx.tools.register()`. */ export declare function createKbTools(deps: KbToolDeps): import("@deepseek-ai/dsh-tools").ToolDefinition[];