import type { ToolDefinition } from "./types.js"; /** * `GET /version` as a tool — the server's OWN identity, askable at last * (shipped: SPGD-1197, specguard `08ab408`; first served by release 0.1.46, * `d434c2a` — root-level and unauthenticated by design — `config/routes.rb` * mounts it beside `/up` and the schema mirror, exactly because the credential * seam under `api/` fails closed and this read is the platform's deliberate * no-account exception at the root). * * == What it answers, and the one distinction the whole tool exists to carry * * "Which build is answering me?" has a second answer in this bridge, and the * two are routinely confused because both are called a version. The * `serverInfo.version` in the initialize handshake and the * `specguard-mcp/` User-Agent are THIS BRIDGE's build — its own * manifest, released on its own cadence (SPGD-1190/1192). The deployment * behind `SPECGUARD_ENDPOINT` is a different component built from a different * tree, and before this tool nothing here could say which build of IT was * answering. The consumers the platform's own controller names — a client * author verifying an upgrade took effect, an agent pinning which build's * crafted 404/400 message sentences its contract suite asserts, a bug * reporter stating which build produced the behavior — are all asking about * the DEPLOYMENT, and this tool is their channel. * * == The two non-happy arms are in the schema's description, not just here * * `version: null` is an HONEST answer the server deliberately serves (its * VERSION file was missing or unreadable at boot — the controller memoizes * even the failure): an unverifiable identity beats a 500 from the one * endpoint whose whole job is to be askable. This bridge passes it through as * `null` and never substitutes a guessed value — inventing one would be the * exact defect the nil arm exists to prevent. * * A 404 means the deployment PREDATES the route: the endpoint is right and * the build is old. `describeFailure` cannot know that — a non-contract 404 * body names no cause, so its canned hint names the endpoint as possibly * misconfigured. The description pre-empts the wrong reading: when every * other tool works against the same `SPECGUARD_ENDPOINT`, that error is an * upgrade request, not a URL fix. * * == No arguments, no credential — the thin-client shape at its thinnest * * The endpoint takes no parameters and the route authenticates nothing, so * the tool advertises no argument and requires no key: it is the first tool * here served by `requireEndpointApiConfig`, and the transport sends no * `Authorization` header for it. The body is passed through verbatim — * reshaping it would be a second copy of the platform's own identity answer, * one release behind it. Since SPGD-1316 that body also carries the enforced * contract's identity (`schema_sha256` + `schema_origin`) beside the build; * this tool does not interpret it — `get_intent_schema` serves the contract * beside that identity, which is where the pair is compared. */ declare const getServerVersion: ToolDefinition; export default getServerVersion;