/** Cordis activation for the lexical tool retriever. @module dsh-tool-retriever/runtime */ import type { Context } from '@deepseek-ai/cordis' import { resolveConfig, type Config } from './config.ts' import { createToolSearch } from './retrieval/tool-search.ts' /** * Register `tool_search` in the calling plugin fiber. * @param ctx - Cordis context carrying the required DSH tools service. * @param config - Loader-validated lexical retrieval configuration. * @returns The exact tool-registry disposer owned by this plugin fiber. */ export function apply(ctx: Context, config: Config = {}): () => void { return ctx.tools.register(createToolSearch(ctx.tools, resolveConfig(config))) }