@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
28 lines • 1.97 kB
TypeScript
/**
* The tool catalog a caller sees, in the form both placements must agree on: a hand (the loopless runtime)
* and the fused engine expose the same declarations, in the same order, for the same configuration. It holds
* every field that reaches the model (the declaration, the system-prompt snippet and guidelines), the UI
* (label) or another client (`getAllTools`: namespace, annotations, the projected kernel prelude). A tool's
* `permissionParser` is code, not data, and is compared by the tool that owns it.
*/
import { projectKernelPrelude } from "../../core/extensions/kernel-prelude.ts";
import { normalizeToolExposure, type ToolDefinition } from "../../core/extensions/types.ts";
import type { ToolDefinitionEntry } from "../../core/runtime/bootstrap.ts";
type DeclaredTool = Pick<ToolDefinition, "name" | "label" | "description" | "parameters" | "promptSnippet" | "promptGuidelines" | "kernelPrelude" | "namespace" | "annotations" | "exposure" | "searchText" | "searchKeywords" | "searchGroup" | "allowLazyActivation" | "sessionBound">;
export interface ToolDeclaration extends ReturnType<typeof normalizeToolExposure> {
readonly name: string;
readonly label: string;
readonly description: string;
readonly parameters: unknown;
readonly promptSnippet: string | undefined;
readonly promptGuidelines: readonly string[] | undefined;
readonly kernelPrelude: ReturnType<typeof projectKernelPrelude>;
readonly namespace: DeclaredTool["namespace"];
readonly annotations: DeclaredTool["annotations"];
/** The tool acts on the calling session, so a loop that runs elsewhere calls it with that session's state. */
readonly sessionBound: boolean;
}
export declare function toolCatalog(tools: Iterable<DeclaredTool>): readonly ToolDeclaration[];
export declare function handToolCatalog(definitions: ReadonlyMap<string, ToolDefinitionEntry>): readonly ToolDeclaration[];
export {};
//# sourceMappingURL=tool-catalog.d.ts.map