UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

53 lines • 2.98 kB
import type { ExtensionAPI } from "../../../types.ts"; import type { ToolSearchService } from "../../tool-search/service.ts"; import type { McpToolCatalogEntry } from "../catalog.ts"; import type { McpSettings } from "../config-schema.ts"; import { type McpToolDefinition } from "./register.ts"; type McpToolRegistrar = Pick<ExtensionAPI, "getActiveTools" | "setActiveTools" | "registerTool">; type WarnFn = (message: string) => void; export interface McpTierBRegistrationInput { /** Full catalog to register (all filtered tools across all servers). */ readonly registeredEntries: readonly McpToolCatalogEntry[]; /** Subset kept active immediately (direct-mode servers + directTools). */ readonly activeEntries: readonly McpToolCatalogEntry[]; /** True when at least one server resolved to search mode. */ readonly searchMode: boolean; /** Tier-C proxy servers (todo 38): one always-active gateway tool each. */ readonly proxyGateways?: readonly { server: string; entries: readonly McpToolCatalogEntry[]; }[]; /** Always-active utility tools (todo 39: mcp_list_resources/mcp_read_resource). */ readonly utilityTools?: readonly McpToolDefinition[]; readonly settings: McpSettings; } export interface SearchableMcpTool { readonly name: string; readonly toolName: string; readonly description?: string; readonly server: string; } export interface McpTierBRegistration { /** Searchable catalog (for reuse by /mcp status and list_changed). */ readonly searchable: SearchableMcpTool[]; /** Activate registered tools through the shared feeder hook. */ activate(names: readonly string[]): void; } /** Register MCP tools honouring Tier-B search mode + prompt-cache mitigations. */ export declare function registerMcpTierBTools(pi: McpToolRegistrar, input: McpTierBRegistrationInput, toolSearchService: ToolSearchService, warn?: WarnFn): McpTierBRegistration; /** Order the active set deterministically without disturbing base tools. * Base tools retain reference order; every shared-catalog member sorts by * canonical name so consecutive promotions remain byte-stable. */ export declare function orderActiveSet(names: readonly string[], reference: readonly string[], catalogNames: ReadonlySet<string>): string[]; /** How a stub promotes itself: swap to the full definition, then run that definition. */ export interface McpStubPromotion { readonly full: McpToolDefinition; readonly promote: () => void; } /** A 30-70 token placeholder for an inactive search-mode tool. Keeps the tools * array length-stable under stubSwap. Calling it by name promotes the full * definition and runs the call in the same turn, so the model never needs a * tool_search round trip; without a promotion hook it only points at tool_search. */ export declare function buildMcpStubDefinition(name: string, promotion?: McpStubPromotion): McpToolDefinition; export {}; //# sourceMappingURL=tier-b.d.ts.map