/** * Bailian knowledge-base consumer plugin: registers kb_search and kb_chat over the DashScope RAG API, * plus isolated CLI management and its skill. * @module dsh-tool-bailian-kb */ import type { Context, Volatile } from "@deepseek-ai/cordis"; import type { IncomingMessage, ServerResponse } from "node:http"; import z from "@deepseek-ai/schemastery"; /** Minimal webServer route shape (declared inline to avoid a host-package dependency). */ interface WebRoute { kind: "exact" | "prefix"; path: string; handler: (req: IncomingMessage, res: ServerResponse) => void | Promise; } declare module "@deepseek-ai/cordis" { interface Context { webServer: { register(route: WebRoute): () => void; }; connection: { requestRejection(request: { readonly headers: IncomingMessage["headers"]; }): 401 | 403 | undefined; }; } } export declare const name = "tool-bailian-kb"; export declare const inject: string[]; /** Loader entry id. Settings forms address the plugin by this id. */ export declare const KB_SETTINGS_NAMESPACE = "tool-bailian-kb"; /** Bailian knowledge-base plugin configuration. Page fields are volatile. */ export interface Config { /** Workspace id stored only in dsh plugin settings. */ workspaceId: Volatile; /** Internal migration marker: cleared fields must not be imported again. */ configInitialized: Volatile; /** Retrieval-service id. Stored in dsh settings. */ defaultRetrieveAgentId: Volatile; /** Q&A-service id. Stored in dsh settings. */ defaultChatAgentId: Volatile; /** Service version: `beta` or a published number. Never model-visible. */ agentVersion: Volatile; /** kb_chat timeout in milliseconds. */ chatTimeoutMs: Volatile; } export declare const Config: z; /** * Activate knowledge tools and isolated management after startup migration. Visible settings are * volatile plugin config, so a saved edit applies on the next call. * @param ctx - registrant context carrying tools and credentials. * @param config - deployment workspace, pinning, and timeout choices. */ export declare function apply(ctx: Context, config: Config): void; export {};