specguard-mcp 0.1.26 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -6
- package/dist/src/config.d.ts +76 -8
- package/dist/src/config.js +41 -1
- package/dist/src/config.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +5 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/server.d.ts +10 -5
- package/dist/src/server.js +10 -5
- package/dist/src/server.js.map +1 -1
- package/dist/src/support/specguard-api.d.ts +8 -3
- package/dist/src/support/specguard-api.js +33 -6
- package/dist/src/support/specguard-api.js.map +1 -1
- package/dist/src/tools/get-server-version.d.ts +51 -0
- package/dist/src/tools/get-server-version.js +89 -0
- package/dist/src/tools/get-server-version.js.map +1 -0
- package/dist/src/tools/index.d.ts +20 -0
- package/dist/src/tools/index.js +22 -0
- package/dist/src/tools/index.js.map +1 -1
- package/dist/src/tools/repository-overview.js +10 -2
- package/dist/src/tools/repository-overview.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ refuses to boot and takes the tools that needed no configuration down with it.
|
|
|
32
32
|
|
|
33
33
|
| Variable | Needed by | Default | What it is |
|
|
34
34
|
| --- | --- | --- | --- |
|
|
35
|
-
| `SPECGUARD_ENDPOINT` | `get_repository_overview`, `list_repositories`, `add_repository`, `registrable_repositories` | — | your SpecGuard instance's root URL, **including the scheme** — e.g. `https://specguard.example.com`, or `http://localhost:3000`. A value with no scheme is refused by name (`SPECGUARD_ENDPOINT is not a usable URL: "sg.example.com"`) rather than surfacing later as an opaque failure. `SPECGUARD_URL` is accepted as an alias, and is the name every message uses when it is the one you set. A blank value counts as unset, so leaving `SPECGUARD_ENDPOINT` empty in a templated config falls through to `SPECGUARD_URL` instead of suppressing it |
|
|
35
|
+
| `SPECGUARD_ENDPOINT` | `get_repository_overview`, `get_server_version`, `list_repositories`, `add_repository`, `registrable_repositories` | — | your SpecGuard instance's root URL, **including the scheme** — e.g. `https://specguard.example.com`, or `http://localhost:3000`. A value with no scheme is refused by name (`SPECGUARD_ENDPOINT is not a usable URL: "sg.example.com"`) rather than surfacing later as an opaque failure. `SPECGUARD_URL` is accepted as an alias, and is the name every message uses when it is the one you set. A blank value counts as unset, so leaving `SPECGUARD_ENDPOINT` empty in a templated config falls through to `SPECGUARD_URL` instead of suppressing it. `get_server_version` needs only this variable — it sends no API key, because the version route is unauthenticated by design |
|
|
36
36
|
| `SPECGUARD_API_KEY` | `get_repository_overview`, `near_duplicate_clusters` (default calls) | — | an agent/CI API key (`sgk_…`) issued by that deployment — a **per-repository** key, which is the single repository those tools answer about by default |
|
|
37
37
|
| `SPECGUARD_USER_API_KEY` | `list_repositories` (fallback), `add_repository`, `registrable_repositories`, `remove_repository` (fallback), `create_repository_api_key` (fallback), `revoke_repository_api_key` (fallback), `list_repository_api_keys` (fallback), `list_repository_agent_keys` (fallback), `revoke_repository_agent_key` (fallback), `list_repository_agent_keys_presented_revoked` (fallback), `list_repository_members` (fallback), `add_repository_member` (fallback), `update_repository_member_permissions` (fallback), `remove_repository_member` (fallback), `get_repository_overview` / `near_duplicate_clusters` **with** `repository` (fallback), `rename_repository` | — | a **user** API key (`sgu_…`), minted from that deployment's account page. A different credential from the one above, not a second place to put the same value: SpecGuard decides which of them a request may use from the token's prefix, before it reads anything, and answers `401` for the other one. Set whichever your tools need — both, if you use both |
|
|
38
38
|
| `SPECGUARD_AGENT_API_KEY` | `list_repositories` (preferred), `remove_repository` (preferred), `create_repository_api_key` (preferred), `revoke_repository_api_key` (preferred), `list_repository_api_keys` (preferred), `list_repository_agent_keys` (preferred), `revoke_repository_agent_key` (preferred), `list_repository_agent_keys_presented_revoked` (preferred), `list_repository_members` (preferred), `add_repository_member` (preferred), `update_repository_member_permissions` (preferred), `remove_repository_member` (preferred), `get_repository_overview` / `near_duplicate_clusters` **with** `repository` (preferred) | — | an **agent** API key (`sga_…`), minted from that deployment's account page (Agent keys panel) with an explicit set of repositories and permissions. It speaks for nobody: its reach is exactly the set granted onto it, fixed at mint time, and every read is bounded by that set server-side. This is the credential to give an automated agent — one key, many repositories, none of a person's rights. When it and `SPECGUARD_USER_API_KEY` are both set, every tool that answers either key — `list_repositories`, `remove_repository`, the members tools, the key-lifecycle tools, and `get_repository_overview` / `near_duplicate_clusters` **with** `repository` — uses **this** one, so discovery stays inside the set the other tools can reach |
|
|
@@ -328,7 +328,15 @@ newest refusal is newer than the newest *accepted* run, and true when nothing ha
|
|
|
328
328
|
accepted, so a repository refused once and quiet since still answers `true`. Read it with
|
|
329
329
|
`last_rejection_at` and judge recency yourself. Each retained rejection carries the endpoint's own
|
|
330
330
|
reasons and, where the client reported one, the client
|
|
331
|
-
version that sent it
|
|
331
|
+
version that sent it, plus `served_by` — the build of the SpecGuard deployment that refused it,
|
|
332
|
+
stamped on the row at write time. That stamp answers a question the deployment's live version read
|
|
333
|
+
cannot: `get_server_version` reports which build is answering *now*, while retained refusals
|
|
334
|
+
outlive deploys, so for a past row the two routinely disagree — read `served_by` for which build
|
|
335
|
+
refused *that row*, never the live route. The row's two nulls mean *different* things and must not
|
|
336
|
+
be read as each other: a null `reported_client` means the client sent no `User-Agent` (the row
|
|
337
|
+
knows, and the client said nothing); a null `served_by` means the row predates the stamp —
|
|
338
|
+
refusals are retained across deploys, so the platform genuinely does not know which build answered
|
|
339
|
+
it. A `latest_run` from days ago beside a live rejection stream is a suite
|
|
332
340
|
SpecGuard *stopped accepting*, not a suite nobody ran. `credential_health` covers the break that one
|
|
333
341
|
structurally **cannot** see: a rejected key resolves no repository and writes no rejection row, so an
|
|
334
342
|
authentication-broken pipeline is invisible to every rejection figure — it names any key that was
|
|
@@ -348,7 +356,52 @@ ranking for the whole set. Where **no** bound sits beside a list, it is everythi
|
|
|
348
356
|
a finding and not a disclosure someone forgot.
|
|
349
357
|
|
|
350
358
|
Figures are `null` where CI did not report them. A `null` means *not measured*; it is never a zero,
|
|
351
|
-
because a zero would read as a measurement that was taken.
|
|
359
|
+
because a zero would read as a measurement that was taken. That rule is about nulls and does not
|
|
360
|
+
run backwards: a non-null figure is not thereby a measurement — a run that reported zero tests
|
|
361
|
+
serves a real `total_specs: 0` beside `suite_size_measured: false`, so it is that boolean, never
|
|
362
|
+
the nullness, that says whether the row measured a suite.
|
|
363
|
+
|
|
364
|
+
Three more keys ride **every** response, with no parameter to pass, and together they decide whether
|
|
365
|
+
two history rows may be *differenced at all* — which is what the history is for. `suite_size_measured`
|
|
366
|
+
is served on `latest_run` and on every `history[]` row, from the same predicate at both sites so one
|
|
367
|
+
run cannot disagree with itself: `false` means that run reported **no** tests, so its `total_specs`
|
|
368
|
+
is a *report*, not a measurement — never difference across a row where it is false. `shard_count`
|
|
369
|
+
and `timed_shard_count` ride every `history[]` row and are the two denominators: difference
|
|
370
|
+
`total_specs` only across rows of *equal* `shard_count`, because that count is a sum over the shards
|
|
371
|
+
**recorded**; difference `duration_seconds` only across rows of *equal* `timed_shard_count`, because
|
|
372
|
+
that figure is a max over the shards that **reported**. Ignore the second and a run whose four
|
|
373
|
+
shards all reported, differenced against a run whose two slowest were cancelled — identical
|
|
374
|
+
`shard_count`, identical `suite_size_measured`, only `timed_shard_count` differing — reads as a 70%
|
|
375
|
+
speedup produced entirely by telemetry loss. A half-reported run is the **ordinary** state, not an
|
|
376
|
+
exotic one: every sharded run passes through it while its shards are still arriving, and a job
|
|
377
|
+
cancelled after two of four shards leaves a half-sized row in the history permanently.
|
|
378
|
+
|
|
379
|
+
### `get_server_version`
|
|
380
|
+
|
|
381
|
+
Reports **which build of the SpecGuard deployment is answering**, read from the deployment's own
|
|
382
|
+
unauthenticated root-level `GET /version` — the figure the release bot's `VERSION` file carries,
|
|
383
|
+
served as `{"version": "0.1.46"}`-shaped JSON and passed through verbatim as `{version}`.
|
|
384
|
+
|
|
385
|
+
**This is the server's build, not this bridge's.** The version in the initialize handshake's
|
|
386
|
+
`serverInfo` and the `specguard-mcp/<version>` User-Agent describe *this bridge* — a different
|
|
387
|
+
component, released on its own cadence — so never read one as the other. Pinning which build's
|
|
388
|
+
crafted 404/400 message sentence a contract suite asserts, verifying that a deployment upgrade took
|
|
389
|
+
effect, or naming the build that produced a behavior is *this* tool's question; the handshake cannot
|
|
390
|
+
answer it.
|
|
391
|
+
|
|
392
|
+
**`version: null` is an honest answer, not an error.** The deployment is up but cannot say its own
|
|
393
|
+
build — its `VERSION` file was missing or unreadable at boot — and the platform serves that
|
|
394
|
+
deliberately, because an unverifiable identity beats a 500 from the one endpoint whose whole job is
|
|
395
|
+
to be askable. The null is passed through exactly as served, never replaced with a guessed value.
|
|
396
|
+
|
|
397
|
+
**A 404 means the deployment predates the route: the endpoint is right and the build is old.** The
|
|
398
|
+
error text names the endpoint as possibly misconfigured, because a non-contract 404 body names no
|
|
399
|
+
cause — when the other tools work against the same endpoint, read that error as *"the deployment
|
|
400
|
+
needs upgrading"*, not as a wrong URL.
|
|
401
|
+
|
|
402
|
+
**Needs no API key of any kind** — the route is unauthenticated by design — so it works with
|
|
403
|
+
`SPECGUARD_ENDPOINT` alone, and it is the one tool here that sends no `Authorization` header. Takes
|
|
404
|
+
no arguments.
|
|
352
405
|
|
|
353
406
|
### `list_repositories`
|
|
354
407
|
|
|
@@ -640,8 +693,9 @@ nor `credential_health` (findings only — a never-presented replacement is neit
|
|
|
640
693
|
presented-revoked) can answer this.
|
|
641
694
|
|
|
642
695
|
**This is the id source for every row this session did not mint.** The mint response carries the
|
|
643
|
-
id of the key IT minted (SPGD-993); a key minted in the web panel, or in
|
|
644
|
-
no other bridge-learnable id — list here to name a `key_id` for
|
|
696
|
+
id of the key IT minted, in its `api_key` block (SPGD-993); a key minted in the web panel, or in
|
|
697
|
+
an earlier session, has no other bridge-learnable id — list here to name a `key_id` for
|
|
698
|
+
`revoke_repository_api_key`.
|
|
645
699
|
|
|
646
700
|
`token_hint` is a hint, never the token — the plaintext existed for exactly one response at mint
|
|
647
701
|
time and nothing persisted it. There is no regenerate: rotation is mint-and-replace
|
|
@@ -957,7 +1011,8 @@ The toolset fills in as more of SpecGuard lands. Adding one is two mechanical ed
|
|
|
957
1011
|
There is no third — no third *wiring* edit, at least: every tool also earns a `### ` section above,
|
|
958
1012
|
and every argument earns a row in that section's table, since this README ships as the package's
|
|
959
1013
|
published documentation, and `test/readme.test.ts` derives that obligation from the registry so a
|
|
960
|
-
missing section or an undocumented parameter fails the suite
|
|
1014
|
+
missing section or an undocumented parameter fails the suite — as does a response key the tool's
|
|
1015
|
+
description names that the section never mentions. A tool that genuinely takes no
|
|
961
1016
|
arguments (`list_repositories` is the first) still earns the section, and is named in that file's
|
|
962
1017
|
`ARGUMENT_LESS_TOOLS` — a deliberate line to add, rather than a floor relaxed for everyone.
|
|
963
1018
|
`src/server.ts` iterates that array and contains no per-tool code — no `switch`, no hard-coded name — and everything a tool
|
package/dist/src/config.d.ts
CHANGED
|
@@ -107,7 +107,25 @@ export declare const DEFAULT_LINT_COMMAND: readonly string[];
|
|
|
107
107
|
export declare const DEFAULT_REQUEST_TIMEOUT_MS = 30000;
|
|
108
108
|
/** Reads config from an environment. Never throws — see the note above. */
|
|
109
109
|
export declare function loadConfig(env?: NodeJS.ProcessEnv): Config;
|
|
110
|
-
/**
|
|
110
|
+
/**
|
|
111
|
+
* What a tool that talks to the SpecGuard API needs, once both halves are known.
|
|
112
|
+
*
|
|
113
|
+
* `apiKey` and `credential` are OPTIONAL here, and that is the credential-free
|
|
114
|
+
* ask speaking (`requireEndpointApiConfig` below): an unauthenticated endpoint
|
|
115
|
+
* needs an endpoint and no key, so the type a transport function accepts cannot
|
|
116
|
+
* demand a credential the request will never present. `undefined` is a
|
|
117
|
+
* first-class value, never a gap — the transport reads it as "send no
|
|
118
|
+
* `Authorization` header", and `describeFailure` reads it as "this ask cannot
|
|
119
|
+
* have a key problem".
|
|
120
|
+
*
|
|
121
|
+
* Every credentialled `require*` helper returns the NARROWED shape,
|
|
122
|
+
* `CredentialledApiConfig` — the same object with both halves bound, which is
|
|
123
|
+
* what they have always built. Narrowing in the return type rather than keeping
|
|
124
|
+
* `ApiConfig` strict is what lets the optional fields exist without loosening
|
|
125
|
+
* the 18 existing tools: a caller holding a credentialled config still knows
|
|
126
|
+
* `apiKey` is a `string` and `credential` is a `Credential`, and TypeScript
|
|
127
|
+
* keeps enforcing that where it is true.
|
|
128
|
+
*/
|
|
111
129
|
export interface ApiConfig {
|
|
112
130
|
readonly endpoint: string;
|
|
113
131
|
/**
|
|
@@ -126,7 +144,15 @@ export interface ApiConfig {
|
|
|
126
144
|
* added later inherits correct naming the same way it inherits the URL check.
|
|
127
145
|
*/
|
|
128
146
|
readonly endpointVariable: EndpointVariable;
|
|
129
|
-
|
|
147
|
+
/**
|
|
148
|
+
* The key this request presents, when it presents one.
|
|
149
|
+
*
|
|
150
|
+
* `undefined` means the request presents NO `Authorization` header — never
|
|
151
|
+
* "a key we forgot to fill in". Every credentialled helper binds a `string`
|
|
152
|
+
* here (see `CredentialledApiConfig`), so for the 18 existing tools nothing
|
|
153
|
+
* about the wire changes.
|
|
154
|
+
*/
|
|
155
|
+
readonly apiKey: string | undefined;
|
|
130
156
|
/**
|
|
131
157
|
* WHICH credential `apiKey` is — the variable it was read from, the prefix
|
|
132
158
|
* that variable is expected to hold, and how to say both in a sentence.
|
|
@@ -139,11 +165,28 @@ export interface ApiConfig {
|
|
|
139
165
|
* sentences that are all false of it — naming a variable its operator may
|
|
140
166
|
* never have set. Carrying the answer rather than re-deriving it per tool is
|
|
141
167
|
* what makes the next credential-scoped tool inherit correct naming the same
|
|
142
|
-
* way it inherits the URL check.
|
|
168
|
+
* way it inherits the URL check. Optional here for exactly that reason and
|
|
169
|
+
* no other: a credential-free ask has no credential to describe, and
|
|
170
|
+
* inventing one would invent a requirement the deployment does not have.
|
|
143
171
|
*/
|
|
144
|
-
readonly credential: Credential;
|
|
172
|
+
readonly credential: Credential | undefined;
|
|
145
173
|
readonly requestTimeoutMs: number;
|
|
146
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* `ApiConfig` with BOTH halves bound — the shape every credentialled `require*`
|
|
177
|
+
* helper has always returned, now said in the type.
|
|
178
|
+
*
|
|
179
|
+
* A NARROWING, not a parallel type: `CredentialledApiConfig` extends
|
|
180
|
+
* `ApiConfig`, so it flows into every transport function unchanged, while a
|
|
181
|
+
* caller holding one still knows `apiKey` is a `string` and `credential` is a
|
|
182
|
+
* `Credential` — the guarantee every credentialled call site and test relies
|
|
183
|
+
* on. Only `requireEndpointApiConfig` returns the wider shape, and only the
|
|
184
|
+
* transport reads the two optional fields there.
|
|
185
|
+
*/
|
|
186
|
+
export interface CredentialledApiConfig extends ApiConfig {
|
|
187
|
+
readonly apiKey: string;
|
|
188
|
+
readonly credential: Credential;
|
|
189
|
+
}
|
|
147
190
|
export type EndpointVariable = "SPECGUARD_ENDPOINT" | "SPECGUARD_URL";
|
|
148
191
|
export type ApiKeyVariable = "SPECGUARD_API_KEY" | "SPECGUARD_USER_API_KEY" | "SPECGUARD_AGENT_API_KEY";
|
|
149
192
|
/**
|
|
@@ -213,7 +256,7 @@ export declare const AGENT_CREDENTIAL: Credential;
|
|
|
213
256
|
* before this file grew a second credential calls exactly this, and gets exactly
|
|
214
257
|
* what it got.
|
|
215
258
|
*/
|
|
216
|
-
export declare function requireApiConfig(config: Config):
|
|
259
|
+
export declare function requireApiConfig(config: Config): CredentialledApiConfig;
|
|
217
260
|
/**
|
|
218
261
|
* What a tool needing the `sgu_` USER key requires — the endpoint and
|
|
219
262
|
* `SPECGUARD_USER_API_KEY`.
|
|
@@ -226,7 +269,7 @@ export declare function requireApiConfig(config: Config): ApiConfig;
|
|
|
226
269
|
* diagnostics reaches both and they cannot drift into describing the same
|
|
227
270
|
* situation differently.
|
|
228
271
|
*/
|
|
229
|
-
export declare function requireUserApiConfig(config: Config):
|
|
272
|
+
export declare function requireUserApiConfig(config: Config): CredentialledApiConfig;
|
|
230
273
|
/**
|
|
231
274
|
* What a tool needing the `sga_` AGENT key requires — the endpoint and
|
|
232
275
|
* `SPECGUARD_AGENT_API_KEY`.
|
|
@@ -238,7 +281,7 @@ export declare function requireUserApiConfig(config: Config): ApiConfig;
|
|
|
238
281
|
* tool asked about a repository its `sgk_` slot does not name calls this, and
|
|
239
282
|
* reads the plural endpoints the agent credential is served by.
|
|
240
283
|
*/
|
|
241
|
-
export declare function requireAgentApiConfig(config: Config):
|
|
284
|
+
export declare function requireAgentApiConfig(config: Config): CredentialledApiConfig;
|
|
242
285
|
/**
|
|
243
286
|
* What a tool EITHER credential serves requires — the endpoint and at least one
|
|
244
287
|
* of `SPECGUARD_AGENT_API_KEY` / `SPECGUARD_USER_API_KEY`.
|
|
@@ -271,7 +314,32 @@ export declare function requireAgentApiConfig(config: Config): ApiConfig;
|
|
|
271
314
|
* every caller because no caller describes the situation itself — holds for
|
|
272
315
|
* this helper too. The endpoint joins the same sentence when it is missing too.
|
|
273
316
|
*/
|
|
274
|
-
export declare function requireUserOrAgentApiConfig(config: Config):
|
|
317
|
+
export declare function requireUserOrAgentApiConfig(config: Config): CredentialledApiConfig;
|
|
318
|
+
/**
|
|
319
|
+
* What a tool that needs NO credential requires — just the endpoint.
|
|
320
|
+
*
|
|
321
|
+
* The fourth sibling, and the first whose answer carries no key and no
|
|
322
|
+
* `Credential`: the server's root-level `GET /version` (SPGD-1197, specguard
|
|
323
|
+
* 08ab408) answers unauthenticated BY DESIGN — the platform's own doctrine
|
|
324
|
+
* places it outside the credential seam, at the root where the no-account
|
|
325
|
+
* reads (`/up`, the schema mirror) already live. Demanding a key here would
|
|
326
|
+
* invent a requirement the deployment does not have, and the
|
|
327
|
+
* credential-free config this returns is what keeps the transport from
|
|
328
|
+
* sending an `Authorization` header at all.
|
|
329
|
+
*
|
|
330
|
+
* The endpoint is REQUIRED and PARSED through the shared `requireHttpUrl`,
|
|
331
|
+
* exactly as the credentialled body does — a malformed value is the same
|
|
332
|
+
* config typo with the same legible answer, and a helper that skipped the
|
|
333
|
+
* parse would defer it to a bare `TypeError` at request time, read by the
|
|
334
|
+
* server's error boundary as a defect in the bridge.
|
|
335
|
+
*
|
|
336
|
+
* The missing-endpoint message is its OWN sentence rather than the shared
|
|
337
|
+
* body's, and that is deliberate: the shared body's sentence exists to name
|
|
338
|
+
* the key variables an operator must choose between, and this ask has none —
|
|
339
|
+
* folding it through would produce a message demanding a key nobody needs to
|
|
340
|
+
* set. One sentence, naming only the endpoint variable the operator can fix.
|
|
341
|
+
*/
|
|
342
|
+
export declare function requireEndpointApiConfig(config: Config): ApiConfig;
|
|
275
343
|
/**
|
|
276
344
|
* Splits a configured command into argv WITHOUT a shell, honouring single and
|
|
277
345
|
* double quotes so a path with a space survives.
|
package/dist/src/config.js
CHANGED
|
@@ -184,8 +184,48 @@ export function requireUserOrAgentApiConfig(config) {
|
|
|
184
184
|
return requireCredentialledApiConfig(config, undefined, USER_CREDENTIAL, [AGENT_CREDENTIAL]);
|
|
185
185
|
}
|
|
186
186
|
/**
|
|
187
|
-
*
|
|
187
|
+
* What a tool that needs NO credential requires — just the endpoint.
|
|
188
|
+
*
|
|
189
|
+
* The fourth sibling, and the first whose answer carries no key and no
|
|
190
|
+
* `Credential`: the server's root-level `GET /version` (SPGD-1197, specguard
|
|
191
|
+
* 08ab408) answers unauthenticated BY DESIGN — the platform's own doctrine
|
|
192
|
+
* places it outside the credential seam, at the root where the no-account
|
|
193
|
+
* reads (`/up`, the schema mirror) already live. Demanding a key here would
|
|
194
|
+
* invent a requirement the deployment does not have, and the
|
|
195
|
+
* credential-free config this returns is what keeps the transport from
|
|
196
|
+
* sending an `Authorization` header at all.
|
|
188
197
|
*
|
|
198
|
+
* The endpoint is REQUIRED and PARSED through the shared `requireHttpUrl`,
|
|
199
|
+
* exactly as the credentialled body does — a malformed value is the same
|
|
200
|
+
* config typo with the same legible answer, and a helper that skipped the
|
|
201
|
+
* parse would defer it to a bare `TypeError` at request time, read by the
|
|
202
|
+
* server's error boundary as a defect in the bridge.
|
|
203
|
+
*
|
|
204
|
+
* The missing-endpoint message is its OWN sentence rather than the shared
|
|
205
|
+
* body's, and that is deliberate: the shared body's sentence exists to name
|
|
206
|
+
* the key variables an operator must choose between, and this ask has none —
|
|
207
|
+
* folding it through would produce a message demanding a key nobody needs to
|
|
208
|
+
* set. One sentence, naming only the endpoint variable the operator can fix.
|
|
209
|
+
*/
|
|
210
|
+
export function requireEndpointApiConfig(config) {
|
|
211
|
+
const endpointVariable = config.endpointVariable ?? DEFAULT_ENDPOINT_VARIABLE;
|
|
212
|
+
if (config.endpoint === undefined) {
|
|
213
|
+
throw new ConfigError(`This tool talks to a SpecGuard deployment, and ${endpointVariable} ` +
|
|
214
|
+
"is not set in the MCP server's environment. Set it in your MCP client's server config " +
|
|
215
|
+
`(${endpointVariable} is your deployment's root URL). This tool needs no API key — the ` +
|
|
216
|
+
"endpoint it reads answers unauthenticated by design — so no key variable is required " +
|
|
217
|
+
"here. Tools that do not reach the deployment are unaffected.");
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
endpoint: requireHttpUrl(config.endpoint, endpointVariable),
|
|
221
|
+
endpointVariable,
|
|
222
|
+
apiKey: undefined,
|
|
223
|
+
credential: undefined,
|
|
224
|
+
requestTimeoutMs: config.requestTimeoutMs,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Both halves or a legible failure — never one half and a surprise later.
|
|
189
229
|
* Reported together rather than one at a time: an operator who set neither
|
|
190
230
|
* should learn that in one round trip instead of fixing a variable, re-calling,
|
|
191
231
|
* and being told about the next one. That property is why the two `require*`
|
package/dist/src/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA4G1C,MAAM,CAAC,MAAM,oBAAoB,GAAsB,CAAC,gBAAgB,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAEjD,2EA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d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createServer, SERVER_NAME, SERVER_VERSION, type CreateServerOptions } from "./server.js";
|
|
2
|
-
export { loadConfig, requireApiConfig, requireUserApiConfig, requireAgentApiConfig, requireUserOrAgentApiConfig, tokenise, type ApiConfig, type ApiKeyVariable, type Config, type Credential, } from "./config.js";
|
|
2
|
+
export { loadConfig, requireApiConfig, requireUserApiConfig, requireAgentApiConfig, requireUserOrAgentApiConfig, requireEndpointApiConfig, tokenise, type ApiConfig, type ApiKeyVariable, type Config, type Credential, type CredentialledApiConfig, } from "./config.js";
|
|
3
3
|
export { ApiError, ArgumentError, CommandError, ConfigError, SpecGuardMcpError } from "./errors.js";
|
|
4
4
|
export { TOOLS } from "./tools/index.js";
|
|
5
5
|
export type { ToolContext, ToolDefinition, ToolResult } from "./tools/types.js";
|
package/dist/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { createServer, SERVER_NAME, SERVER_VERSION } from "./server.js";
|
|
2
2
|
// The require* helpers are re-exported together rather than left behind each
|
|
3
3
|
// other: they are one seam over one credential machinery, now with three
|
|
4
|
-
// variables, and a consumer that can name only
|
|
5
|
-
// deep-import past this entrypoint to reach the rest
|
|
6
|
-
// unnameable-but-typed state `test/index.test.ts` exists to keep
|
|
7
|
-
// error taxonomy.
|
|
8
|
-
export { loadConfig, requireApiConfig, requireUserApiConfig, requireAgentApiConfig, requireUserOrAgentApiConfig, tokenise, } from "./config.js";
|
|
4
|
+
// variables and one credential-free sibling, and a consumer that can name only
|
|
5
|
+
// part of it would have to deep-import past this entrypoint to reach the rest
|
|
6
|
+
// — the same unnameable-but-typed state `test/index.test.ts` exists to keep
|
|
7
|
+
// out of the error taxonomy.
|
|
8
|
+
export { loadConfig, requireApiConfig, requireUserApiConfig, requireAgentApiConfig, requireUserOrAgentApiConfig, requireEndpointApiConfig, tokenise, } from "./config.js";
|
|
9
9
|
export { ApiError, ArgumentError, CommandError, ConfigError, SpecGuardMcpError } from "./errors.js";
|
|
10
10
|
export { TOOLS } from "./tools/index.js";
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAA4B,MAAM,aAAa,CAAC;AAClG,6EAA6E;AAC7E,yEAAyE;AACzE
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAA4B,MAAM,aAAa,CAAC;AAClG,6EAA6E;AAC7E,yEAAyE;AACzE,+EAA+E;AAC/E,8EAA8E;AAC9E,4EAA4E;AAC5E,6BAA6B;AAC7B,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,EACxB,QAAQ,GAMT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/src/server.d.ts
CHANGED
|
@@ -33,11 +33,16 @@ export declare function createServer(options?: CreateServerOptions): Server;
|
|
|
33
33
|
* The literal this replaced was written at bootstrap and never revisited: the
|
|
34
34
|
* release bot bumps `package.json` alone, so every initialize handshake after
|
|
35
35
|
* the first release told every client the bridge was still the bootstrap
|
|
36
|
-
* version. Nothing caught the drift
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
36
|
+
* version. Nothing caught the drift in that bootstrap era: then, every reader
|
|
37
|
+
* cell of the constant relayed the stale literal unchecked, and no test named
|
|
38
|
+
* it. That era is over. Whatever a reader cell does with `SERVER_VERSION`, it
|
|
39
|
+
* now sees the tracked value — and the suite now names the constant too. The
|
|
40
|
+
* per-request User-Agent (`requestUserAgent()` in
|
|
41
|
+
* `src/support/specguard-api.ts`) stamps `specguard-mcp/<version>` onto every
|
|
42
|
+
* outbound call, and the transport tests assert that header against this very
|
|
43
|
+
* constant. The manifest-walk change kept `SERVER_VERSION` a const export and
|
|
44
|
+
* left every reader cell's access to it untouched; the ONLY change is that
|
|
45
|
+
* its value now tracks the release instead of the bootstrap.
|
|
41
46
|
*
|
|
42
47
|
* `SERVER_VERSION`'s module-scope initialization is the single read: the walk
|
|
43
48
|
* runs once at import, and every later reader cell sees the cached result.
|
package/dist/src/server.js
CHANGED
|
@@ -120,11 +120,16 @@ function indexByName(tools) {
|
|
|
120
120
|
* The literal this replaced was written at bootstrap and never revisited: the
|
|
121
121
|
* release bot bumps `package.json` alone, so every initialize handshake after
|
|
122
122
|
* the first release told every client the bridge was still the bootstrap
|
|
123
|
-
* version. Nothing caught the drift
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
123
|
+
* version. Nothing caught the drift in that bootstrap era: then, every reader
|
|
124
|
+
* cell of the constant relayed the stale literal unchecked, and no test named
|
|
125
|
+
* it. That era is over. Whatever a reader cell does with `SERVER_VERSION`, it
|
|
126
|
+
* now sees the tracked value — and the suite now names the constant too. The
|
|
127
|
+
* per-request User-Agent (`requestUserAgent()` in
|
|
128
|
+
* `src/support/specguard-api.ts`) stamps `specguard-mcp/<version>` onto every
|
|
129
|
+
* outbound call, and the transport tests assert that header against this very
|
|
130
|
+
* constant. The manifest-walk change kept `SERVER_VERSION` a const export and
|
|
131
|
+
* left every reader cell's access to it untouched; the ONLY change is that
|
|
132
|
+
* its value now tracks the release instead of the bootstrap.
|
|
128
133
|
*
|
|
129
134
|
* `SERVER_VERSION`'s module-scope initialization is the single read: the walk
|
|
130
135
|
* runs once at import, and every later reader cell sees the cached result.
|
package/dist/src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,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;QAC7E,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IAC/E,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IACzB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC1C,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAEhC,CAAC;YACd,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,IAAI,KAAK,eAAe,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;gBACzF,OAAO,GAAG,CAAC,OAAO,CAAC;YACrB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,4DAA4D;QAC9D,CAAC;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM,CAAC,sBAAsB;QACjD,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { requireAgentApiConfig, requireApiConfig, requireUserApiConfig, requireUserOrAgentApiConfig, type ApiConfig, type Config } from "../config.js";
|
|
1
|
+
import { requireAgentApiConfig, requireApiConfig, requireEndpointApiConfig, requireUserApiConfig, requireUserOrAgentApiConfig, type ApiConfig, type Config, type CredentialledApiConfig } from "../config.js";
|
|
2
2
|
/**
|
|
3
3
|
* The SpecGuard HTTP client — a Bearer key and a path, and nothing else.
|
|
4
4
|
*
|
|
@@ -6,6 +6,11 @@ import { requireAgentApiConfig, requireApiConfig, requireUserApiConfig, requireU
|
|
|
6
6
|
* here: this carries the operator's key and reports what came back. The bridge
|
|
7
7
|
* adds no credentials of its own and makes no access decisions, so there is no
|
|
8
8
|
* second place for the permission model to be got wrong.
|
|
9
|
+
*
|
|
10
|
+
* The key is PRESENT-CONDITIONAL since SPGD-1200: every credentialled helper
|
|
11
|
+
* binds one and it rides every request as before, while a credential-free ask
|
|
12
|
+
* (`requireEndpointApiConfig`, the unauthenticated `/version`) presents NO
|
|
13
|
+
* `Authorization` header at all rather than `Bearer ` with nothing after it.
|
|
9
14
|
*/
|
|
10
15
|
export declare function getJson(api: ApiConfig, path: string, query: Record<string, string | undefined>, fetchImpl: typeof globalThis.fetch): Promise<unknown>;
|
|
11
16
|
/**
|
|
@@ -139,7 +144,7 @@ export declare function getJsonObject(api: ApiConfig, path: string, query: Recor
|
|
|
139
144
|
* one spelling of "no ask".
|
|
140
145
|
*/
|
|
141
146
|
export declare function repositoryTarget(config: Config, repository: string | undefined): {
|
|
142
|
-
api:
|
|
147
|
+
api: CredentialledApiConfig;
|
|
143
148
|
path: string;
|
|
144
149
|
};
|
|
145
|
-
export { requireApiConfig, requireUserApiConfig, requireAgentApiConfig, requireUserOrAgentApiConfig };
|
|
150
|
+
export { requireApiConfig, requireUserApiConfig, requireAgentApiConfig, requireUserOrAgentApiConfig, requireEndpointApiConfig, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { requireAgentApiConfig, requireApiConfig, requireUserApiConfig, requireUserOrAgentApiConfig, } from "../config.js";
|
|
1
|
+
import { requireAgentApiConfig, requireApiConfig, requireEndpointApiConfig, requireUserApiConfig, requireUserOrAgentApiConfig, } from "../config.js";
|
|
2
2
|
import { ApiError } from "../errors.js";
|
|
3
3
|
/**
|
|
4
4
|
* The SpecGuard HTTP client — a Bearer key and a path, and nothing else.
|
|
@@ -7,6 +7,11 @@ import { ApiError } from "../errors.js";
|
|
|
7
7
|
* here: this carries the operator's key and reports what came back. The bridge
|
|
8
8
|
* adds no credentials of its own and makes no access decisions, so there is no
|
|
9
9
|
* second place for the permission model to be got wrong.
|
|
10
|
+
*
|
|
11
|
+
* The key is PRESENT-CONDITIONAL since SPGD-1200: every credentialled helper
|
|
12
|
+
* binds one and it rides every request as before, while a credential-free ask
|
|
13
|
+
* (`requireEndpointApiConfig`, the unauthenticated `/version`) presents NO
|
|
14
|
+
* `Authorization` header at all rather than `Bearer ` with nothing after it.
|
|
10
15
|
*/
|
|
11
16
|
export async function getJson(api, path, query, fetchImpl) {
|
|
12
17
|
const url = new URL(`${api.endpoint}${path}`);
|
|
@@ -261,13 +266,20 @@ async function fetchWithTimeout(url, api, fetchImpl, request) {
|
|
|
261
266
|
fetchImpl(url, {
|
|
262
267
|
method: request.method,
|
|
263
268
|
headers: {
|
|
264
|
-
Authorization: `Bearer ${api.apiKey}`,
|
|
265
269
|
Accept: "application/json",
|
|
266
270
|
// The version rides the identity the platform's rejection triage
|
|
267
271
|
// stores verbatim (`specguard-mcp/<version>`), the same shape the
|
|
268
272
|
// sibling clients already send. Resolved per request — see
|
|
269
273
|
// `requestUserAgent` for why the load, not just the read, is lazy.
|
|
270
274
|
"User-Agent": userAgent,
|
|
275
|
+
// Sent only when there IS a key. The credential-free ask (SPGD-1200,
|
|
276
|
+
// `requireEndpointApiConfig`) presents nothing rather than `Bearer `
|
|
277
|
+
// with nothing after it — precisely the present-but-empty value
|
|
278
|
+
// `presence()` refuses on the way in, because a header announcing a
|
|
279
|
+
// key that is not there is a malformed request waiting for a proxy
|
|
280
|
+
// to notice. This is `Content-Type`'s conditional-header pattern,
|
|
281
|
+
// one key below, for the mirrored reason.
|
|
282
|
+
...(api.apiKey === undefined ? {} : { Authorization: `Bearer ${api.apiKey}` }),
|
|
271
283
|
// Sent only when there IS a body. A `Content-Type` on a GET announces
|
|
272
284
|
// a payload that is not there, and some deployments and proxies treat
|
|
273
285
|
// that as a malformed request rather than as a harmless header.
|
|
@@ -348,6 +360,16 @@ function timedOut(api) {
|
|
|
348
360
|
* `endpointVariable` fixes one branch down, and it gets the same remedy rather
|
|
349
361
|
* than a second hardcoded string: a tool added later inherits correct naming
|
|
350
362
|
* from the `require*` helper it already calls.
|
|
363
|
+
*
|
|
364
|
+
* The canned sentence is CREDENTIAL-CONDITIONAL since SPGD-1200: a
|
|
365
|
+
* credential-free ask cannot have a KEY problem — it presented no key, and the
|
|
366
|
+
* endpoint it reads (`/version`) never authenticates — so sentencing it to a
|
|
367
|
+
* `must be an … key` lecture would name a variable its operator never needed
|
|
368
|
+
* to set. With no credential bound the branch falls through to the generic
|
|
369
|
+
* sentence below, which shows what actually came back. The revoked-key arm
|
|
370
|
+
* above stays unconditional on purpose: it is keyed on the BODY the platform
|
|
371
|
+
* served, not on what this side sent, and surfacing the platform's own
|
|
372
|
+
* sentence is never the wrong answer.
|
|
351
373
|
*/
|
|
352
374
|
function describeFailure(status, body, api) {
|
|
353
375
|
if (status === 401) {
|
|
@@ -357,9 +379,14 @@ function describeFailure(status, body, api) {
|
|
|
357
379
|
const revoked = revokedCredentialMessage(body);
|
|
358
380
|
if (revoked !== undefined)
|
|
359
381
|
return new ApiError(revoked, status);
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
382
|
+
// A credential-free ask falls through to the generic sentence — see the
|
|
383
|
+
// header above. This branch only speaks when there is a credential whose
|
|
384
|
+
// variable and prefix a sentence about a key can truthfully name.
|
|
385
|
+
if (api.credential !== undefined) {
|
|
386
|
+
const { variable, prefix, rejection } = api.credential;
|
|
387
|
+
return new ApiError(`SpecGuard rejected the API key (401). ${variable} must be an ${prefix}… key issued by ` +
|
|
388
|
+
`${api.endpoint} ${rejection}.`, status);
|
|
389
|
+
}
|
|
363
390
|
}
|
|
364
391
|
if (status === 404) {
|
|
365
392
|
// Order by certainty: a body that names its own cause beats the heuristic.
|
|
@@ -574,5 +601,5 @@ export function repositoryTarget(config, repository) {
|
|
|
574
601
|
: `/api/v1/repositories/${encodeURIComponent(repository)}`;
|
|
575
602
|
return { api, path };
|
|
576
603
|
}
|
|
577
|
-
export { requireApiConfig, requireUserApiConfig, requireAgentApiConfig, requireUserOrAgentApiConfig };
|
|
604
|
+
export { requireApiConfig, requireUserApiConfig, requireAgentApiConfig, requireUserOrAgentApiConfig, requireEndpointApiConfig, };
|
|
578
605
|
//# sourceMappingURL=specguard-api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specguard-api.js","sourceRoot":"","sources":["../../../src/support/specguard-api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,2BAA2B,
|
|
1
|
+
{"version":3,"file":"specguard-api.js","sourceRoot":"","sources":["../../../src/support/specguard-api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,2BAA2B,GAI5B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,GAAc,EACd,IAAY,EACZ,KAAyC,EACzC,SAAkC;IAElC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,GAAG,CAAC,QAAQ,GAAG,IAAI,EAAE,CAAC,CAAC;IAC9C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjD,IAAI,KAAK,KAAK,SAAS;YAAE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,WAAW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AU,gBAAgB,CAC9B,MAAc,EACd,UAA8B;IAE9B,MAAM,GAAG,GACP,UAAU,KAAK,SAAS;QACtB,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC;QAC1B,CAAC,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,IAAI,GACR,UAAU,KAAK,SAAS;QACtB,CAAC,CAAC,oBAAoB;QACtB,CAAC,CAAC,wBAAwB,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC;IAC/D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AACvB,CAAC;AAED,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,GACzB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ToolDefinition } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* `GET /version` as a tool — the server's OWN identity, askable at last
|
|
4
|
+
* (shipped: SPGD-1197, specguard `08ab408`; first served by release 0.1.46,
|
|
5
|
+
* `d434c2a` — root-level and unauthenticated by design — `config/routes.rb`
|
|
6
|
+
* mounts it beside `/up` and the schema mirror, exactly because the credential
|
|
7
|
+
* seam under `api/` fails closed and this read is the platform's deliberate
|
|
8
|
+
* no-account exception at the root).
|
|
9
|
+
*
|
|
10
|
+
* == What it answers, and the one distinction the whole tool exists to carry
|
|
11
|
+
*
|
|
12
|
+
* "Which build is answering me?" has a second answer in this bridge, and the
|
|
13
|
+
* two are routinely confused because both are called a version. The
|
|
14
|
+
* `serverInfo.version` in the initialize handshake and the
|
|
15
|
+
* `specguard-mcp/<version>` User-Agent are THIS BRIDGE's build — its own
|
|
16
|
+
* manifest, released on its own cadence (SPGD-1190/1192). The deployment
|
|
17
|
+
* behind `SPECGUARD_ENDPOINT` is a different component built from a different
|
|
18
|
+
* tree, and before this tool nothing here could say which build of IT was
|
|
19
|
+
* answering. The consumers the platform's own controller names — a client
|
|
20
|
+
* author verifying an upgrade took effect, an agent pinning which build's
|
|
21
|
+
* crafted 404/400 message sentences its contract suite asserts, a bug
|
|
22
|
+
* reporter stating which build produced the behavior — are all asking about
|
|
23
|
+
* the DEPLOYMENT, and this tool is their channel.
|
|
24
|
+
*
|
|
25
|
+
* == The two non-happy arms are in the schema's description, not just here
|
|
26
|
+
*
|
|
27
|
+
* `version: null` is an HONEST answer the server deliberately serves (its
|
|
28
|
+
* VERSION file was missing or unreadable at boot — the controller memoizes
|
|
29
|
+
* even the failure): an unverifiable identity beats a 500 from the one
|
|
30
|
+
* endpoint whose whole job is to be askable. This bridge passes it through as
|
|
31
|
+
* `null` and never substitutes a guessed value — inventing one would be the
|
|
32
|
+
* exact defect the nil arm exists to prevent.
|
|
33
|
+
*
|
|
34
|
+
* A 404 means the deployment PREDATES the route: the endpoint is right and
|
|
35
|
+
* the build is old. `describeFailure` cannot know that — a non-contract 404
|
|
36
|
+
* body names no cause, so its canned hint names the endpoint as possibly
|
|
37
|
+
* misconfigured. The description pre-empts the wrong reading: when every
|
|
38
|
+
* other tool works against the same `SPECGUARD_ENDPOINT`, that error is an
|
|
39
|
+
* upgrade request, not a URL fix.
|
|
40
|
+
*
|
|
41
|
+
* == No arguments, no credential — the thin-client shape at its thinnest
|
|
42
|
+
*
|
|
43
|
+
* The endpoint takes no parameters and the route authenticates nothing, so
|
|
44
|
+
* the tool advertises no argument and requires no key: it is the first tool
|
|
45
|
+
* here served by `requireEndpointApiConfig`, and the transport sends no
|
|
46
|
+
* `Authorization` header for it. The body is passed through verbatim —
|
|
47
|
+
* reshaping `{version}` would be a second copy of the platform's own
|
|
48
|
+
* identity answer, one release behind it.
|
|
49
|
+
*/
|
|
50
|
+
declare const getServerVersion: ToolDefinition;
|
|
51
|
+
export default getServerVersion;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { getJsonObject, requireEndpointApiConfig } from "../support/specguard-api.js";
|
|
2
|
+
/**
|
|
3
|
+
* `GET /version` as a tool — the server's OWN identity, askable at last
|
|
4
|
+
* (shipped: SPGD-1197, specguard `08ab408`; first served by release 0.1.46,
|
|
5
|
+
* `d434c2a` — root-level and unauthenticated by design — `config/routes.rb`
|
|
6
|
+
* mounts it beside `/up` and the schema mirror, exactly because the credential
|
|
7
|
+
* seam under `api/` fails closed and this read is the platform's deliberate
|
|
8
|
+
* no-account exception at the root).
|
|
9
|
+
*
|
|
10
|
+
* == What it answers, and the one distinction the whole tool exists to carry
|
|
11
|
+
*
|
|
12
|
+
* "Which build is answering me?" has a second answer in this bridge, and the
|
|
13
|
+
* two are routinely confused because both are called a version. The
|
|
14
|
+
* `serverInfo.version` in the initialize handshake and the
|
|
15
|
+
* `specguard-mcp/<version>` User-Agent are THIS BRIDGE's build — its own
|
|
16
|
+
* manifest, released on its own cadence (SPGD-1190/1192). The deployment
|
|
17
|
+
* behind `SPECGUARD_ENDPOINT` is a different component built from a different
|
|
18
|
+
* tree, and before this tool nothing here could say which build of IT was
|
|
19
|
+
* answering. The consumers the platform's own controller names — a client
|
|
20
|
+
* author verifying an upgrade took effect, an agent pinning which build's
|
|
21
|
+
* crafted 404/400 message sentences its contract suite asserts, a bug
|
|
22
|
+
* reporter stating which build produced the behavior — are all asking about
|
|
23
|
+
* the DEPLOYMENT, and this tool is their channel.
|
|
24
|
+
*
|
|
25
|
+
* == The two non-happy arms are in the schema's description, not just here
|
|
26
|
+
*
|
|
27
|
+
* `version: null` is an HONEST answer the server deliberately serves (its
|
|
28
|
+
* VERSION file was missing or unreadable at boot — the controller memoizes
|
|
29
|
+
* even the failure): an unverifiable identity beats a 500 from the one
|
|
30
|
+
* endpoint whose whole job is to be askable. This bridge passes it through as
|
|
31
|
+
* `null` and never substitutes a guessed value — inventing one would be the
|
|
32
|
+
* exact defect the nil arm exists to prevent.
|
|
33
|
+
*
|
|
34
|
+
* A 404 means the deployment PREDATES the route: the endpoint is right and
|
|
35
|
+
* the build is old. `describeFailure` cannot know that — a non-contract 404
|
|
36
|
+
* body names no cause, so its canned hint names the endpoint as possibly
|
|
37
|
+
* misconfigured. The description pre-empts the wrong reading: when every
|
|
38
|
+
* other tool works against the same `SPECGUARD_ENDPOINT`, that error is an
|
|
39
|
+
* upgrade request, not a URL fix.
|
|
40
|
+
*
|
|
41
|
+
* == No arguments, no credential — the thin-client shape at its thinnest
|
|
42
|
+
*
|
|
43
|
+
* The endpoint takes no parameters and the route authenticates nothing, so
|
|
44
|
+
* the tool advertises no argument and requires no key: it is the first tool
|
|
45
|
+
* here served by `requireEndpointApiConfig`, and the transport sends no
|
|
46
|
+
* `Authorization` header for it. The body is passed through verbatim —
|
|
47
|
+
* reshaping `{version}` would be a second copy of the platform's own
|
|
48
|
+
* identity answer, one release behind it.
|
|
49
|
+
*/
|
|
50
|
+
const getServerVersion = {
|
|
51
|
+
name: "get_server_version",
|
|
52
|
+
title: "Server version",
|
|
53
|
+
description: "Reports WHICH BUILD of the SpecGuard DEPLOYMENT is answering, read from the deployment's own " +
|
|
54
|
+
"unauthenticated root-level `GET /version` — the figure the release bot's VERSION file carries, " +
|
|
55
|
+
'served as `{"version": "0.1.46"}`-shaped JSON and passed through verbatim as `{version}`. ' +
|
|
56
|
+
"This is the SERVER's build, NOT this bridge's: the version in the initialize handshake's " +
|
|
57
|
+
"`serverInfo` and the `specguard-mcp/<version>` User-Agent describe this bridge, a different " +
|
|
58
|
+
"component released on its own cadence, so never read one as the other. Pinning which build's " +
|
|
59
|
+
"crafted 404/400 message sentence a contract suite asserts, verifying that a deployment upgrade " +
|
|
60
|
+
"took effect, or naming the build that produced a behavior is this tool's question — the " +
|
|
61
|
+
"handshake cannot answer it. `version: null` is an honest answer, not an error: the deployment " +
|
|
62
|
+
"is up but cannot say its own build (its VERSION file was missing or unreadable at boot), and " +
|
|
63
|
+
"null is passed through exactly as served — never replaced with a guessed value. A 404 means " +
|
|
64
|
+
"this deployment PREDATES the route: the endpoint is right and the build is old. The error text " +
|
|
65
|
+
"names the endpoint as possibly misconfigured because a non-contract 404 body names no cause — " +
|
|
66
|
+
"when the other tools work against the same endpoint, read that error as 'the deployment needs " +
|
|
67
|
+
"upgrading', not as a wrong URL. Needs NO API key of any kind — the route is unauthenticated by " +
|
|
68
|
+
"design — so it works with `SPECGUARD_ENDPOINT` alone, and it is the one tool here that sends " +
|
|
69
|
+
"no `Authorization` header. Takes no arguments.",
|
|
70
|
+
inputSchema: {
|
|
71
|
+
type: "object",
|
|
72
|
+
// No properties, deliberately — see this file's header. Still CLOSED rather
|
|
73
|
+
// than merely empty, for the reason `registrable-repositories.ts` states:
|
|
74
|
+
// `server.ts` forwards `arguments` unvalidated and `run` ignores them, so
|
|
75
|
+
// an open schema would let an invented argument be silently dropped while
|
|
76
|
+
// the call is answered as if it had been honoured.
|
|
77
|
+
additionalProperties: false,
|
|
78
|
+
},
|
|
79
|
+
async run(_args, context) {
|
|
80
|
+
const api = requireEndpointApiConfig(context.config);
|
|
81
|
+
const answer = await getJsonObject(api, "/version", {}, context.fetch);
|
|
82
|
+
return {
|
|
83
|
+
text: JSON.stringify(answer, null, 2),
|
|
84
|
+
structured: answer,
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
export default getServerVersion;
|
|
89
|
+
//# sourceMappingURL=get-server-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-server-version.js","sourceRoot":"","sources":["../../../src/tools/get-server-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAGtF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,gBAAgB,GAAmB;IACvC,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,gBAAgB;IACvB,WAAW,EACT,+FAA+F;QAC/F,iGAAiG;QACjG,4FAA4F;QAC5F,2FAA2F;QAC3F,8FAA8F;QAC9F,+FAA+F;QAC/F,iGAAiG;QACjG,0FAA0F;QAC1F,gGAAgG;QAChG,+FAA+F;QAC/F,8FAA8F;QAC9F,iGAAiG;QACjG,gGAAgG;QAChG,gGAAgG;QAChG,iGAAiG;QACjG,+FAA+F;QAC/F,gDAAgD;IAClD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,4EAA4E;QAC5E,0EAA0E;QAC1E,0EAA0E;QAC1E,0EAA0E;QAC1E,mDAAmD;QACnD,oBAAoB,EAAE,KAAK;KAC5B;IAED,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO;QACtB,MAAM,GAAG,GAAG,wBAAwB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAErD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAEvE,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;YACrC,UAAU,EAAE,MAAM;SACnB,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -180,6 +180,26 @@ import type { ToolDefinition } from "./types.js";
|
|
|
180
180
|
* minting is deliberately web-only at /account, so unlike the `sgk_` pair
|
|
181
181
|
* there is no create response to read an id from — the list and revoke
|
|
182
182
|
* descriptions say so rather than leaving it implicit.
|
|
183
|
+
*
|
|
184
|
+
* == The first tool that needs NO credential
|
|
185
|
+
*
|
|
186
|
+
* - `get_server_version` wraps the server's root-level `GET /version`
|
|
187
|
+
* (shipped: SPGD-1197, specguard `08ab408`).
|
|
188
|
+
*
|
|
189
|
+
* The platform's own doctrine placed this read OUTSIDE the credential seam
|
|
190
|
+
* rather than inside with an exception: every controller under `api/` must
|
|
191
|
+
* declare an accepted credential or answer 401 to everything, so the
|
|
192
|
+
* unauthenticated identity read lives at the root, beside `/up` and the
|
|
193
|
+
* schema mirror. The bridge meets it where it stands — a fourth `require*`
|
|
194
|
+
* helper (`requireEndpointApiConfig`) demands an endpoint and no key, the
|
|
195
|
+
* transport's `Authorization` header became conditional on a present key
|
|
196
|
+
* (mirroring the conditional `Content-Type` one key below it), and
|
|
197
|
+
* `describeFailure`'s canned 401 sentence — a diagnosis of a wrong-kind key —
|
|
198
|
+
* falls to the generic sentence when no credential is bound, because a
|
|
199
|
+
* credential-free ask cannot have a key problem. The standing rule is
|
|
200
|
+
* unchanged and still binding: the endpoint was verified-shipped on
|
|
201
|
+
* `origin/main` before this entry wrapped it. What moved was the platform,
|
|
202
|
+
* not the bar.
|
|
183
203
|
*/
|
|
184
204
|
export declare const TOOLS: readonly ToolDefinition[];
|
|
185
205
|
export type { ToolContext, ToolDefinition, ToolResult } from "./types.js";
|
package/dist/src/tools/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import addRepository from "./add-repository.js";
|
|
2
2
|
import addRepositoryMember from "./add-repository-member.js";
|
|
3
3
|
import createRepositoryApiKey from "./create-repository-api-key.js";
|
|
4
|
+
import getServerVersion from "./get-server-version.js";
|
|
4
5
|
import lintIntentAnnotations from "./lint-intent-annotations.js";
|
|
5
6
|
import listRepositories from "./list-repositories.js";
|
|
6
7
|
import listRepositoryAgentKeys from "./list-repository-agent-keys.js";
|
|
@@ -197,10 +198,31 @@ import updateRepositoryMemberPermissions from "./update-repository-member-permis
|
|
|
197
198
|
* minting is deliberately web-only at /account, so unlike the `sgk_` pair
|
|
198
199
|
* there is no create response to read an id from — the list and revoke
|
|
199
200
|
* descriptions say so rather than leaving it implicit.
|
|
201
|
+
*
|
|
202
|
+
* == The first tool that needs NO credential
|
|
203
|
+
*
|
|
204
|
+
* - `get_server_version` wraps the server's root-level `GET /version`
|
|
205
|
+
* (shipped: SPGD-1197, specguard `08ab408`).
|
|
206
|
+
*
|
|
207
|
+
* The platform's own doctrine placed this read OUTSIDE the credential seam
|
|
208
|
+
* rather than inside with an exception: every controller under `api/` must
|
|
209
|
+
* declare an accepted credential or answer 401 to everything, so the
|
|
210
|
+
* unauthenticated identity read lives at the root, beside `/up` and the
|
|
211
|
+
* schema mirror. The bridge meets it where it stands — a fourth `require*`
|
|
212
|
+
* helper (`requireEndpointApiConfig`) demands an endpoint and no key, the
|
|
213
|
+
* transport's `Authorization` header became conditional on a present key
|
|
214
|
+
* (mirroring the conditional `Content-Type` one key below it), and
|
|
215
|
+
* `describeFailure`'s canned 401 sentence — a diagnosis of a wrong-kind key —
|
|
216
|
+
* falls to the generic sentence when no credential is bound, because a
|
|
217
|
+
* credential-free ask cannot have a key problem. The standing rule is
|
|
218
|
+
* unchanged and still binding: the endpoint was verified-shipped on
|
|
219
|
+
* `origin/main` before this entry wrapped it. What moved was the platform,
|
|
220
|
+
* not the bar.
|
|
200
221
|
*/
|
|
201
222
|
export const TOOLS = [
|
|
202
223
|
lintIntentAnnotations,
|
|
203
224
|
getRepositoryOverview,
|
|
225
|
+
getServerVersion,
|
|
204
226
|
listRepositories,
|
|
205
227
|
addRepository,
|
|
206
228
|
registrableRepositories,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAC7D,OAAO,sBAAsB,MAAM,gCAAgC,CAAC;AACpE,OAAO,qBAAqB,MAAM,8BAA8B,CAAC;AACjE,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,uBAAuB,MAAM,iCAAiC,CAAC;AACtE,OAAO,uCAAuC,MAAM,mDAAmD,CAAC;AACxG,OAAO,qBAAqB,MAAM,+BAA+B,CAAC;AAClE,OAAO,qBAAqB,MAAM,8BAA8B,CAAC;AACjE,OAAO,qBAAqB,MAAM,8BAA8B,CAAC;AACjE,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAC7D,OAAO,uBAAuB,MAAM,+BAA+B,CAAC;AACpE,OAAO,gBAAgB,MAAM,wBAAwB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyMG;AACH,MAAM,CAAC,MAAM,KAAK,GAA8B;IAC9C,qBAAqB;IACrB,qBAAqB;IACrB,gBAAgB;IAChB,gBAAgB;IAChB,aAAa;IACb,uBAAuB;IACvB,gBAAgB;IAChB,sBAAsB;IACtB,sBAAsB;IACtB,qBAAqB;IACrB,qBAAqB;IACrB,qBAAqB;IACrB,mBAAmB;IACnB,iCAAiC;IACjC,sBAAsB;IACtB,gBAAgB;IAChB,uBAAuB;IACvB,uCAAuC;IACvC,wBAAwB;CACzB,CAAC"}
|
|
@@ -516,8 +516,16 @@ const getRepositoryOverview = {
|
|
|
516
516
|
"nothing has ever been accepted — so read it with `last_rejection_at` and judge recency " +
|
|
517
517
|
"yourself, because a repository refused once and quiet since still answers true. Each retained " +
|
|
518
518
|
"rejection carries the endpoint's own reasons and, where the client reported one, the client " +
|
|
519
|
-
"version that sent it
|
|
520
|
-
"
|
|
519
|
+
"version that sent it, plus `served_by` — the build of the SpecGuard deployment that refused it, " +
|
|
520
|
+
"stamped on the row at write time. That stamp answers a question the deployment's live version " +
|
|
521
|
+
"read cannot: `get_server_version` reports which build is answering NOW, while retained " +
|
|
522
|
+
"refusals outlive deploys, so for a past row the two routinely disagree — read `served_by` for " +
|
|
523
|
+
"WHICH BUILD REFUSED THAT ROW, never the live route. The row's two nulls mean DIFFERENT things " +
|
|
524
|
+
"and must not be read as each other: a null `reported_client` means the client sent no " +
|
|
525
|
+
"`User-Agent` (the row knows, and the client said nothing); a null `served_by` means the row " +
|
|
526
|
+
"predates the stamp — refusals are retained across deploys, so the platform genuinely does not " +
|
|
527
|
+
"know which build answered it. A `latest_run` from days ago beside a live rejection stream is a " +
|
|
528
|
+
"suite SpecGuard STOPPED ACCEPTING, not a suite nobody ran. " +
|
|
521
529
|
"`credential_health` covers the break that one structurally CANNOT see — a rejected key " +
|
|
522
530
|
"resolves no repository and writes no rejection row, so an authentication-broken pipeline is " +
|
|
523
531
|
"invisible to every rejection figure — by naming any key that was ROTATED and has not " +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-overview.js","sourceRoot":"","sources":["../../../src/tools/repository-overview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAidG;AACH,MAAM,qBAAqB,GAAmB;IAC5C,IAAI,EAAE,yBAAyB;IAE/B,KAAK,EAAE,mCAAmC;IAE1C,WAAW,EACT,2FAA2F;QAC3F,6FAA6F;QAC7F,yFAAyF;QACzF,+FAA+F;QAC/F,8FAA8F;QAC9F,gEAAgE;QAChE,gGAAgG;QAChG,wFAAwF;QACxF,6FAA6F;QAC7F,4BAA4B;QAC5B,gFAAgF;QAChF,yFAAyF;QACzF,4FAA4F;QAC5F,qFAAqF;QACrF,yFAAyF;QACzF,yDAAyD;QACzD,4FAA4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