#!/usr/bin/env node /** * The stdio adapter (ADR 0044, amended by ADR 0149 and ADR 0156). * * The tool table is the package's (`yarramate/tools`), and so is every * answer: a call resolves its workspace against the filesystem, then runs * the same `runTool` a hosted workspace runs over its own store. The CLI * commands are thin over those same functions, so what an agent gets here * is what a person gets from the CLI and what a hosted agent gets over the * network. The adapter's own work is the filesystem: which manifest, where * `out` writes, and `reconcile`, which reads a repository and still runs * the CLI. */ interface JsonRpcRequest { readonly jsonrpc: '2.0'; readonly id?: number | string | null; readonly method: string; readonly params?: Record; } /** * Where a tool call resolves its workspace when the call names none * (#514). In order: the `--workspace` the server was started with, then the * conventional `.yarramate/workspace.yaml` under the working directory. A * desktop app starts the server from a directory that is not the repository, * so the first is the one that matters there; a terminal agent runs it from * the repository, so the second is what it gets for free. */ export interface ServerOptions { readonly workspace?: string; } /** What a tool call needs from the server beyond its own arguments. */ export interface ToolContext { readonly cwd: string; readonly workspace: string | undefined; } export declare const resolveWorkspace: (input: Record, context: ToolContext) => string | undefined; /** * The CLI runs inside the repository: a manifest's globs resolve against the * manifest, but a record's contracts, coverage and evidence name files by * their repository-root path, which is the directory that holds `.yarramate`. * A desktop app starts this server anywhere, so a workspace given as a path * from elsewhere is run as the CLI would be run by a person standing in that * repository: working directory at the root, manifest path relative to it. */ export declare const workingDirectoryFor: (workspace: string, cwd: string) => { readonly cwd: string; readonly workspace: string; }; /** The tool list a client sees; exported so a test can read it without stdio. */ export declare const toolCatalogue: { name: string; description: string; inputSchema: Record; }[]; export declare const handleRequest: (request: JsonRpcRequest, context?: ToolContext) => void; export declare const parseServerOptions: (argv: readonly string[]) => ServerOptions | undefined; export declare const serverUsage = "Usage:\n yarramate-mcp [--workspace ]\n yarramate-mcp --version\n"; export {};