#!/usr/bin/env node /** * Ollama Intern MCP — entrypoint. * * Registers the 8-tool labor surface. Tool descriptions encode *when* to reach * for them — Claude picks the tier by picking the tool, and the tool implies * the model. ollama_chat is visibly last-resort. */ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import type { RunContext } from "./runContext.js"; export declare function createServer(ctx: RunContext): McpServer; /** * CLI surface (Phase 7 / FT-003). * * `npm install -g ollama-intern-mcp` used to give an empty CLI: running * the bin with `--version`, `--help`, or any subcommand fell through to * `main()` and connected to stdio expecting an MCP client on the other * end. Operators couldn't even check whether the install succeeded * without standing up the MCP wiring first. * * This function intercepts known CLI verbs BEFORE the stdio handshake * and exits cleanly. When no recognized verb is present, we fall through * to `main()` (existing MCP-server behavior) so adding the CLI doesn't * regress the published MCP integration. * * No external CLI library is added — the four verbs the audit identified * (`--version`, `--help`, `doctor`, `init`) fit cleanly inside a hand- * rolled switch. Unknown args exit 1 with the help pointer so a typo * never silently becomes a hung stdio handshake. * * Returns `true` when a CLI verb was handled (caller skips main()), * `false` when no CLI verb matched and the caller should proceed with * the MCP-server startup path. */ declare function runCli(argv: string[]): Promise; declare function printHelp(): void; /** * Run `ollama_doctor` outside the MCP transport and print the result * to stdout. Reuses `handleDoctor` so the CLI output stays in lockstep * with the MCP tool — no parallel implementation to keep aligned. * * Flags (F5, v2.9 — the CI persona): * --json emit the structured DoctorResult as JSON (stdout is * ONLY the JSON — pipeable to jq; the old comment * suggested `doctor | jq .` against the prose report, * which never worked). * --fail-unhealthy exit 1 when `healthy` is false OR the cloud config * itself failed to load (e.g. PRIMARY without a key) — * the machine gate the old "grep the report" advice * pretended existed. * * Default (no flags): the human prose report, exit 0 regardless of health — * doctor's job is to REPORT; gating is the explicit flag's job. Returns the * exit code; the runCli dispatcher owns process.exit. */ declare function runCliDoctor(flags?: string[]): Promise; /** * `init` subcommand — scaffold a starter `hermes.config.yaml` in the * caller's CWD by copying `hermes.config.example.yaml` from the package * install location. Refuses to overwrite an existing file so re-running * `init` after manual edits is safe. * * Locating the example: the bin file ships under `dist/index.js` and the * example lives at the package root, so `/../hermes.config.example.yaml` * resolves correctly for both local `npm link` and global install layouts. * * `--claude` (F3, v2.9): print a paste-ready Claude Code `.mcp.json` * fragment instead — PRINTED, never written (pasting into an existing * .mcp.json beats clobbering one), with the optional cloud env lines as * commented guidance (JSON carries no comments) + the standby semantics. * Returns the exit code; the runCli dispatcher owns process.exit. */ declare function runCliInit(flags?: string[]): Promise; export declare const __cliInternals: { runCli: typeof runCli; printHelp: typeof printHelp; runCliDoctor: typeof runCliDoctor; runCliInit: typeof runCliInit; }; export {}; //# sourceMappingURL=index.d.ts.map