import type { BlackboardClientDependencies } from '../agent-blackboard/client.mts'; import type { RunTextCommand } from '../gh-cli/exec.mts'; import type { GhRunner } from './pr-gh.mts'; import type { PolicySpawner } from './policy-spawn.mts'; import { type SnapshotRegistry } from './snapshot-registry.mts'; import { type InstallInfo } from './install-info.mts'; export type ServerEnvironment = { /** The launch directory's worktree top level, or undefined when it is not inside one. */ launchRoot: string | undefined; env: NodeJS.ProcessEnv; runGit: RunTextCommand; /** Test seam: where `agent-blackboard` resolves from. Defaults to this package's own module. */ resolveFrom?: string | URL; /** Test seam: replaces how the consumer's `agent-blackboard` client is loaded. */ blackboard?: BlackboardClientDependencies; /** Test seam: replaces the child process a policy export runs in. */ spawnPolicy?: PolicySpawner; /** Test seam: replaces locating and running gh. */ runGh?: GhRunner; /** The connected MCP client's `clientInfo.name`, once `initialize` has completed. */ clientName?: () => string | undefined; /** Test seam: replaces the operating system user and host name. */ device?: () => { user: string; host: string; }; /** Test seam: a fresh registry stands in for a server restart. Defaults to the process's own. */ snapshots?: SnapshotRegistry; /** The server's own version and install location, captured at startup. */ install?: InstallInfo; }; export type ToolCallResult = { content: Array<{ type: 'text'; text: string; }>; isError?: true; }; /** Runs one tool call. Every failure becomes an MCP tool error; nothing here throws. */ export declare function callTool(name: string, rawArguments: unknown, environment: ServerEnvironment): Promise;