UNPKG

@code-yeongyu/senpi

Version:

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

22 lines • 1.38 kB
import type { ExtensionAPI, ToolDefinition } from "./core/extensions/types.ts"; /** Event-bus channel on which a host bridge sets (`execute`) or clears (no `execute`) the route for one name. */ export declare const HOST_TOOL_ROUTE_CHANNEL = "senpi:host-tool-route"; /** The `Error.name` a route throws when its host cannot serve the call; the call then runs on the standalone tool. */ export declare const HOST_TOOL_ROUTE_UNAVAILABLE = "HostToolRouteUnavailable"; type Execute = ToolDefinition["execute"]; /** * A host tool and, optionally, what its session does with a routed result before recording it, the same * session-level step its standalone implementation applies to its own result. */ export interface HostTool { readonly tool: ToolDefinition; settleRouted?(result: Awaited<ReturnType<Execute>>, ...args: Parameters<Execute>): Awaited<ReturnType<Execute>>; } /** * Attach host tools through the SDK. Each tool is registered exactly once, under its own name, and always serves: * a host bridge may route its calls to the host once the host is confirmed, and a route that reports * `HOST_TOOL_ROUTE_UNAVAILABLE` is dropped and the call runs on the standalone implementation. */ export declare function attachHostTools(api: Pick<ExtensionAPI, "registerTool" | "events">, tools: readonly HostTool[]): void; export {}; //# sourceMappingURL=host-tools.d.ts.map