import type { ReadOnlyWhitelistEntry } from '../readonly-surface/readonly-whitelist.js'; import { type CliExecution } from './cli-executor.js'; /** How much of one memory note's description travels back. */ export declare const MEMORY_EXCERPT_CHARS = 120; /** Hard ceiling on matches returned, independent of what the CLI was asked for. */ export declare const MEMORY_MAX_RETURNED = 50; export interface ToolTextContent { readonly type: 'text'; readonly text: string; } export interface ToolCallResult { readonly content: readonly ToolTextContent[]; /** Present and `true` only when something failed. Absent means success. */ readonly isError?: boolean; } /** Injectable execution, so a test can drive a handler without a CLI. */ export type CliExecutor = (argv: readonly string[]) => Promise; export interface ToolCallContext { readonly execute?: CliExecutor; /** Directory the CLI runs in. Defaults to the server process's own. */ readonly cwd?: string; } /** * The values to render one entry with, or `undefined` when the caller did not * supply enough for this entry to run. A value the caller DID supply is always * present — it is handed to the guard, which is what decides whether it is * allowed, so nothing supplied can be silently skipped. */ export declare function valuesForEntry(entry: ReadOnlyWhitelistEntry, args: Readonly>, context: ToolCallContext): Record | undefined; /** One argv's outcome, kept whole so the caller can see every envelope. */ export interface EntryOutcome { readonly key: string; readonly execution: CliExecution; readonly envelope: unknown; readonly failure?: string; } /** Render the outcomes as a tool result, failing the call when any argv failed. */ export declare function resultOf(outcomes: readonly EntryOutcome[]): ToolCallResult; /** A refused call: the parameter guard said no, before anything was executed. */ export declare function rejectedResult(entry: ReadOnlyWhitelistEntry, reason: string): ToolCallResult; /** Execute one already-validated argv and keep its whole outcome. */ export declare function runArgv(key: string, argv: readonly string[], context: ToolCallContext): Promise;