@descryy/mcp 0.6.0 → 0.7.1
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/dist/action-handshake.d.ts +8 -75
- package/dist/action-handshake.d.ts.map +1 -1
- package/dist/action-handshake.js +9 -79
- package/dist/action-handshake.js.map +1 -1
- package/dist/bin/descry-mcp.d.ts +4 -15
- package/dist/bin/descry-mcp.d.ts.map +1 -1
- package/dist/bin/descry-mcp.js +12 -42
- package/dist/bin/descry-mcp.js.map +1 -1
- package/dist/browser/driver.d.ts +121 -224
- package/dist/browser/driver.d.ts.map +1 -1
- package/dist/browser/driver.js +9 -55
- package/dist/browser/driver.js.map +1 -1
- package/dist/browser/evidence.d.ts +10 -43
- package/dist/browser/evidence.d.ts.map +1 -1
- package/dist/browser/evidence.js +20 -54
- package/dist/browser/evidence.js.map +1 -1
- package/dist/browser/fake-driver.d.ts +12 -19
- package/dist/browser/fake-driver.d.ts.map +1 -1
- package/dist/browser/fake-driver.js +31 -26
- package/dist/browser/fake-driver.js.map +1 -1
- package/dist/browser/graph-write.d.ts +4 -45
- package/dist/browser/graph-write.d.ts.map +1 -1
- package/dist/browser/graph-write.js +8 -53
- package/dist/browser/graph-write.js.map +1 -1
- package/dist/browser/playwright-driver.d.ts +7 -91
- package/dist/browser/playwright-driver.d.ts.map +1 -1
- package/dist/browser/playwright-driver.js +59 -197
- package/dist/browser/playwright-driver.js.map +1 -1
- package/dist/browser/provider.d.ts +5 -34
- package/dist/browser/provider.d.ts.map +1 -1
- package/dist/browser/provider.js +4 -24
- package/dist/browser/provider.js.map +1 -1
- package/dist/browser/registry.d.ts +26 -106
- package/dist/browser/registry.d.ts.map +1 -1
- package/dist/browser/registry.js +20 -77
- package/dist/browser/registry.js.map +1 -1
- package/dist/browser/scenario-provenance.d.ts +23 -0
- package/dist/browser/scenario-provenance.d.ts.map +1 -0
- package/dist/browser/scenario-provenance.js +59 -0
- package/dist/browser/scenario-provenance.js.map +1 -0
- package/dist/browser/scenario-resolve.d.ts +10 -44
- package/dist/browser/scenario-resolve.d.ts.map +1 -1
- package/dist/browser/scenario-resolve.js +10 -41
- package/dist/browser/scenario-resolve.js.map +1 -1
- package/dist/browser/scenario-runner.d.ts +12 -70
- package/dist/browser/scenario-runner.d.ts.map +1 -1
- package/dist/browser/scenario-runner.js +30 -90
- package/dist/browser/scenario-runner.js.map +1 -1
- package/dist/browser/stack-parser.d.ts +4 -28
- package/dist/browser/stack-parser.d.ts.map +1 -1
- package/dist/browser/stack-parser.js +12 -39
- package/dist/browser/stack-parser.js.map +1 -1
- package/dist/browser/tool-support.d.ts +20 -67
- package/dist/browser/tool-support.d.ts.map +1 -1
- package/dist/browser/tool-support.js +21 -65
- package/dist/browser/tool-support.js.map +1 -1
- package/dist/browser/url-scheme.d.ts +14 -0
- package/dist/browser/url-scheme.d.ts.map +1 -0
- package/dist/browser/url-scheme.js +38 -0
- package/dist/browser/url-scheme.js.map +1 -0
- package/dist/cancellation.d.ts +11 -46
- package/dist/cancellation.d.ts.map +1 -1
- package/dist/cancellation.js +11 -46
- package/dist/cancellation.js.map +1 -1
- package/dist/capped.d.ts +9 -33
- package/dist/capped.d.ts.map +1 -1
- package/dist/capped.js +7 -27
- package/dist/capped.js.map +1 -1
- package/dist/disclosure-ledger.d.ts +6 -30
- package/dist/disclosure-ledger.d.ts.map +1 -1
- package/dist/disclosure-ledger.js +4 -26
- package/dist/disclosure-ledger.js.map +1 -1
- package/dist/index.d.ts +10 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -17
- package/dist/index.js.map +1 -1
- package/dist/module-trust.d.ts +24 -0
- package/dist/module-trust.d.ts.map +1 -0
- package/dist/module-trust.js +60 -0
- package/dist/module-trust.js.map +1 -0
- package/dist/path-confinement.d.ts +31 -0
- package/dist/path-confinement.d.ts.map +1 -0
- package/dist/path-confinement.js +44 -0
- package/dist/path-confinement.js.map +1 -0
- package/dist/protocol.d.ts +10 -53
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +14 -60
- package/dist/protocol.js.map +1 -1
- package/dist/registry.d.ts +37 -58
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +88 -96
- package/dist/registry.js.map +1 -1
- package/dist/render.d.ts +89 -13
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +111 -16
- package/dist/render.js.map +1 -1
- package/dist/runtime-registry.d.ts +7 -66
- package/dist/runtime-registry.d.ts.map +1 -1
- package/dist/runtime-registry.js +39 -114
- package/dist/runtime-registry.js.map +1 -1
- package/dist/scenarios/index.d.ts +1 -1
- package/dist/scenarios/index.d.ts.map +1 -1
- package/dist/scenarios/index.js +1 -1
- package/dist/scenarios/index.js.map +1 -1
- package/dist/scenarios/parse.d.ts +4 -18
- package/dist/scenarios/parse.d.ts.map +1 -1
- package/dist/scenarios/parse.js +14 -34
- package/dist/scenarios/parse.js.map +1 -1
- package/dist/scenarios/scenario.d.ts +18 -74
- package/dist/scenarios/scenario.d.ts.map +1 -1
- package/dist/scenarios/scenario.js +7 -34
- package/dist/scenarios/scenario.js.map +1 -1
- package/dist/scenarios/storage.d.ts +11 -41
- package/dist/scenarios/storage.d.ts.map +1 -1
- package/dist/scenarios/storage.js +57 -47
- package/dist/scenarios/storage.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +69 -19
- package/dist/server.js.map +1 -1
- package/dist/session.d.ts +90 -259
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +136 -250
- package/dist/session.js.map +1 -1
- package/dist/tools/analyze.d.ts +32 -118
- package/dist/tools/analyze.d.ts.map +1 -1
- package/dist/tools/analyze.js +65 -186
- package/dist/tools/analyze.js.map +1 -1
- package/dist/tools/browser-click.d.ts +3 -21
- package/dist/tools/browser-click.d.ts.map +1 -1
- package/dist/tools/browser-click.js +10 -31
- package/dist/tools/browser-click.js.map +1 -1
- package/dist/tools/browser-close-session.d.ts +4 -13
- package/dist/tools/browser-close-session.d.ts.map +1 -1
- package/dist/tools/browser-close-session.js +4 -13
- package/dist/tools/browser-close-session.js.map +1 -1
- package/dist/tools/browser-fill.d.ts +5 -36
- package/dist/tools/browser-fill.d.ts.map +1 -1
- package/dist/tools/browser-fill.js +9 -44
- package/dist/tools/browser-fill.js.map +1 -1
- package/dist/tools/browser-navigate.d.ts +6 -27
- package/dist/tools/browser-navigate.d.ts.map +1 -1
- package/dist/tools/browser-navigate.js +6 -23
- package/dist/tools/browser-navigate.js.map +1 -1
- package/dist/tools/browser-run-scenario.d.ts +5 -31
- package/dist/tools/browser-run-scenario.d.ts.map +1 -1
- package/dist/tools/browser-run-scenario.js +10 -46
- package/dist/tools/browser-run-scenario.js.map +1 -1
- package/dist/tools/browser-save-scenario.d.ts +3 -28
- package/dist/tools/browser-save-scenario.d.ts.map +1 -1
- package/dist/tools/browser-save-scenario.js +47 -84
- package/dist/tools/browser-save-scenario.js.map +1 -1
- package/dist/tools/browser-snapshot.d.ts +6 -39
- package/dist/tools/browser-snapshot.d.ts.map +1 -1
- package/dist/tools/browser-snapshot.js +4 -31
- package/dist/tools/browser-snapshot.js.map +1 -1
- package/dist/tools/browser-start-session.d.ts +4 -23
- package/dist/tools/browser-start-session.d.ts.map +1 -1
- package/dist/tools/browser-start-session.js +145 -56
- package/dist/tools/browser-start-session.js.map +1 -1
- package/dist/tools/browser-type.d.ts +5 -35
- package/dist/tools/browser-type.d.ts.map +1 -1
- package/dist/tools/browser-type.js +10 -45
- package/dist/tools/browser-type.js.map +1 -1
- package/dist/tools/contracts.d.ts +9 -86
- package/dist/tools/contracts.d.ts.map +1 -1
- package/dist/tools/contracts.js +24 -80
- package/dist/tools/contracts.js.map +1 -1
- package/dist/tools/cross-pr.d.ts +42 -30
- package/dist/tools/cross-pr.d.ts.map +1 -1
- package/dist/tools/cross-pr.js +81 -62
- package/dist/tools/cross-pr.js.map +1 -1
- package/dist/tools/git-diff.d.ts +18 -2
- package/dist/tools/git-diff.d.ts.map +1 -1
- package/dist/tools/git-diff.js +118 -26
- package/dist/tools/git-diff.js.map +1 -1
- package/dist/tools/git-history.d.ts +5 -16
- package/dist/tools/git-history.d.ts.map +1 -1
- package/dist/tools/git-history.js +3 -10
- package/dist/tools/git-history.js.map +1 -1
- package/dist/tools/history.d.ts +4 -33
- package/dist/tools/history.d.ts.map +1 -1
- package/dist/tools/history.js +6 -31
- package/dist/tools/history.js.map +1 -1
- package/dist/tools/impact.d.ts +7 -51
- package/dist/tools/impact.d.ts.map +1 -1
- package/dist/tools/impact.js +15 -67
- package/dist/tools/impact.js.map +1 -1
- package/dist/tools/index.d.ts +3 -8
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -8
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/kit.d.ts +66 -113
- package/dist/tools/kit.d.ts.map +1 -1
- package/dist/tools/kit.js +60 -28
- package/dist/tools/kit.js.map +1 -1
- package/dist/tools/link-workspace.d.ts +7 -45
- package/dist/tools/link-workspace.d.ts.map +1 -1
- package/dist/tools/link-workspace.js +10 -48
- package/dist/tools/link-workspace.js.map +1 -1
- package/dist/tools/lookup.d.ts +4 -14
- package/dist/tools/lookup.d.ts.map +1 -1
- package/dist/tools/lookup.js +4 -14
- package/dist/tools/lookup.js.map +1 -1
- package/dist/tools/mark-incident.d.ts +7 -54
- package/dist/tools/mark-incident.d.ts.map +1 -1
- package/dist/tools/mark-incident.js +15 -68
- package/dist/tools/mark-incident.js.map +1 -1
- package/dist/tools/observe-runtime.d.ts +27 -210
- package/dist/tools/observe-runtime.d.ts.map +1 -1
- package/dist/tools/observe-runtime.js +273 -434
- package/dist/tools/observe-runtime.js.map +1 -1
- package/dist/tools/observe-tests.d.ts +9 -100
- package/dist/tools/observe-tests.d.ts.map +1 -1
- package/dist/tools/observe-tests.js +74 -152
- package/dist/tools/observe-tests.js.map +1 -1
- package/dist/tools/pr-analysis.d.ts +18 -2
- package/dist/tools/pr-analysis.d.ts.map +1 -1
- package/dist/tools/pr-analysis.js +73 -23
- package/dist/tools/pr-analysis.js.map +1 -1
- package/dist/tools/pre-push.d.ts +74 -16
- package/dist/tools/pre-push.d.ts.map +1 -1
- package/dist/tools/pre-push.js +152 -51
- package/dist/tools/pre-push.js.map +1 -1
- package/dist/tools/propagation.d.ts +11 -53
- package/dist/tools/propagation.d.ts.map +1 -1
- package/dist/tools/propagation.js +17 -58
- package/dist/tools/propagation.js.map +1 -1
- package/dist/tools/questions.d.ts +13 -63
- package/dist/tools/questions.d.ts.map +1 -1
- package/dist/tools/questions.js +33 -105
- package/dist/tools/questions.js.map +1 -1
- package/dist/tools/refusal-fetch.d.ts +4 -40
- package/dist/tools/refusal-fetch.d.ts.map +1 -1
- package/dist/tools/refusal-fetch.js +4 -40
- package/dist/tools/refusal-fetch.js.map +1 -1
- package/dist/tools/runtime-incident.d.ts +4 -63
- package/dist/tools/runtime-incident.d.ts.map +1 -1
- package/dist/tools/runtime-incident.js +10 -87
- package/dist/tools/runtime-incident.js.map +1 -1
- package/dist/tools/scope.d.ts +7 -25
- package/dist/tools/scope.d.ts.map +1 -1
- package/dist/tools/scope.js +10 -29
- package/dist/tools/scope.js.map +1 -1
- package/dist/tools/similar-incidents.d.ts +11 -86
- package/dist/tools/similar-incidents.d.ts.map +1 -1
- package/dist/tools/similar-incidents.js +7 -71
- package/dist/tools/similar-incidents.js.map +1 -1
- package/dist/tools/validate.d.ts +29 -70
- package/dist/tools/validate.d.ts.map +1 -1
- package/dist/tools/validate.js +141 -85
- package/dist/tools/validate.js.map +1 -1
- package/dist/tools/verification-status.d.ts +9 -64
- package/dist/tools/verification-status.d.ts.map +1 -1
- package/dist/tools/verification-status.js +9 -62
- package/dist/tools/verification-status.js.map +1 -1
- package/dist/tools/verify-claim.d.ts +5 -52
- package/dist/tools/verify-claim.d.ts.map +1 -1
- package/dist/tools/verify-claim.js +6 -56
- package/dist/tools/verify-claim.js.map +1 -1
- package/dist/transport.d.ts +15 -52
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +16 -60
- package/dist/transport.js.map +1 -1
- package/package.json +40 -22
package/dist/protocol.d.ts
CHANGED
|
@@ -1,42 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* JSON-RPC 2.0
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `@modelcontextprotocol/sdk` is the obvious answer and the blueprint's
|
|
7
|
-
* dependency table names it. It was measured rather than assumed: version 1.30.0
|
|
8
|
-
* declares **seventeen direct dependencies** — `express`, `hono`,
|
|
9
|
-
* `@hono/node-server`, `cors`, `express-rate-limit`, `jose`, `pkce-challenge`,
|
|
10
|
-
* `eventsource`, `ajv`, `zod` — essentially all of which exist to serve the HTTP
|
|
11
|
-
* and OAuth transports. This server speaks stdio to a coding agent on the same
|
|
12
|
-
* machine. It will never open a socket.
|
|
13
|
-
*
|
|
14
|
-
* The rest of this project has made the same call four times — `node:sqlite`
|
|
15
|
-
* over `better-sqlite3`, `node --test` over a test runner, `tsc` over a bundler,
|
|
16
|
-
* `git` invoked directly over a git library — every time on the same grounds:
|
|
17
|
-
* this is a **locally installed developer tool**, and a dependency tree is a
|
|
18
|
-
* distribution problem before it is anything else. Seventeen
|
|
19
|
-
* transitively-hundreds is a large price for newline-delimited JSON.
|
|
20
|
-
*
|
|
21
|
-
* This package no longer has zero runtime dependencies — `observe_runtime`
|
|
22
|
-
* composes `descry-runtime`'s execution and correlation packages, ruled in
|
|
23
|
-
* `DEC-NEXT-mcp-runtime-dependency-boundary-for-r4-evidence` — and the
|
|
24
|
-
* argument above is unaffected, because it was never a vow of zero. It is a
|
|
25
|
-
* cost/benefit about *this* dependency: every package `@descryy/mcp` depends
|
|
26
|
-
* on is one of Descry's own, versioned and published alongside it, and each
|
|
27
|
-
* one is there because a stage of a real run happens inside it. That is a
|
|
28
|
-
* different trade from adding a stack of HTTP and OAuth packages to serve a
|
|
29
|
-
* transport this server will never open a socket for.
|
|
30
|
-
*
|
|
31
|
-
* **The cost is named, not waved away.** Hand-rolling means spec drift is
|
|
32
|
-
* silent: the wire format changes, the client stops working, and nothing in this
|
|
33
|
-
* repository fails. Two things pay it down. `PROTOCOL_VERSION` is pinned and
|
|
34
|
-
* `SUPPORTED_PROTOCOL_VERSIONS` is explicit, so an unknown version is negotiated
|
|
35
|
-
* rather than assumed compatible; and the handshake is covered by tests that
|
|
36
|
-
* assert the exact frames, so a change to the shape is a red test rather than a
|
|
37
|
-
* user-visible mystery. If the protocol moves past what is here, the fix is to
|
|
38
|
-
* add a version to the list — not to discover it from a bug report.
|
|
39
|
-
*/
|
|
2
|
+
* JSON-RPC 2.0 + the MCP slice this server speaks — hand-written, not the SDK:
|
|
3
|
+
* v1.30.0 pulls 17 deps, nearly all for HTTP/OAuth transports this stdio-only
|
|
4
|
+
* server never opens (same call as `node:sqlite`, `node --test`, `tsc` elsewhere).
|
|
5
|
+
* Spec-drift risk is mitigated by a pinned `PROTOCOL_VERSION` and exact-frame tests. */
|
|
40
6
|
/** JSON-RPC 2.0 ids: string or number, never null in a request. */
|
|
41
7
|
export type RpcId = string | number;
|
|
42
8
|
export interface RpcRequest {
|
|
@@ -68,24 +34,15 @@ export declare const RPC_INVALID_REQUEST = -32600;
|
|
|
68
34
|
export declare const RPC_METHOD_NOT_FOUND = -32601;
|
|
69
35
|
export declare const RPC_INVALID_PARAMS = -32602;
|
|
70
36
|
export declare const RPC_INTERNAL_ERROR = -32603;
|
|
71
|
-
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* Newest first. Negotiation echoes the client's version when it is on this list
|
|
75
|
-
* and otherwise answers with `PROTOCOL_VERSION`, which is what the spec asks for
|
|
76
|
-
* — the client then decides whether it can proceed. Answering with the client's
|
|
77
|
-
* unknown version instead would be a claim of compatibility nobody has checked.
|
|
78
|
-
*/
|
|
37
|
+
/** The version this server implements. Negotiation echoes the client's version if
|
|
38
|
+
* it's on `SUPPORTED_PROTOCOL_VERSIONS`, else answers with this — never claims
|
|
39
|
+
* compatibility with an unchecked client version. */
|
|
79
40
|
export declare const PROTOCOL_VERSION = "2025-06-18";
|
|
80
41
|
export declare const SUPPORTED_PROTOCOL_VERSIONS: readonly string[];
|
|
81
42
|
export declare function negotiateVersion(requested: unknown): string;
|
|
82
|
-
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* Distinguished from a request that is merely wrong, because JSON-RPC says a
|
|
86
|
-
* message with no usable id gets no response at all — replying to it with a
|
|
87
|
-
* fabricated id would put a frame on the wire the client cannot correlate.
|
|
88
|
-
*/
|
|
43
|
+
/** A frame that couldn't be understood well enough to answer. Distinct from a
|
|
44
|
+
* merely-wrong request — JSON-RPC says a message with no usable id gets no
|
|
45
|
+
* response; replying with a fabricated id would be uncorrelatable. */
|
|
89
46
|
export declare class ProtocolError extends Error {
|
|
90
47
|
readonly code: number;
|
|
91
48
|
/** Null when the frame carried no usable id and must therefore go unanswered. */
|
package/dist/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;wFAIwF;AAExF,mEAAmE;AACnE,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpC,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IACxB,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EA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GAAG,OAAO,IAAI,UAAU,CAEpE;AAED,wBAAgB,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,GAAG,WAAW,CAE1D;AAED,wBAAgB,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAM1F"}
|
package/dist/protocol.js
CHANGED
|
@@ -1,56 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* JSON-RPC 2.0
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `@modelcontextprotocol/sdk` is the obvious answer and the blueprint's
|
|
7
|
-
* dependency table names it. It was measured rather than assumed: version 1.30.0
|
|
8
|
-
* declares **seventeen direct dependencies** — `express`, `hono`,
|
|
9
|
-
* `@hono/node-server`, `cors`, `express-rate-limit`, `jose`, `pkce-challenge`,
|
|
10
|
-
* `eventsource`, `ajv`, `zod` — essentially all of which exist to serve the HTTP
|
|
11
|
-
* and OAuth transports. This server speaks stdio to a coding agent on the same
|
|
12
|
-
* machine. It will never open a socket.
|
|
13
|
-
*
|
|
14
|
-
* The rest of this project has made the same call four times — `node:sqlite`
|
|
15
|
-
* over `better-sqlite3`, `node --test` over a test runner, `tsc` over a bundler,
|
|
16
|
-
* `git` invoked directly over a git library — every time on the same grounds:
|
|
17
|
-
* this is a **locally installed developer tool**, and a dependency tree is a
|
|
18
|
-
* distribution problem before it is anything else. Seventeen
|
|
19
|
-
* transitively-hundreds is a large price for newline-delimited JSON.
|
|
20
|
-
*
|
|
21
|
-
* This package no longer has zero runtime dependencies — `observe_runtime`
|
|
22
|
-
* composes `descry-runtime`'s execution and correlation packages, ruled in
|
|
23
|
-
* `DEC-NEXT-mcp-runtime-dependency-boundary-for-r4-evidence` — and the
|
|
24
|
-
* argument above is unaffected, because it was never a vow of zero. It is a
|
|
25
|
-
* cost/benefit about *this* dependency: every package `@descryy/mcp` depends
|
|
26
|
-
* on is one of Descry's own, versioned and published alongside it, and each
|
|
27
|
-
* one is there because a stage of a real run happens inside it. That is a
|
|
28
|
-
* different trade from adding a stack of HTTP and OAuth packages to serve a
|
|
29
|
-
* transport this server will never open a socket for.
|
|
30
|
-
*
|
|
31
|
-
* **The cost is named, not waved away.** Hand-rolling means spec drift is
|
|
32
|
-
* silent: the wire format changes, the client stops working, and nothing in this
|
|
33
|
-
* repository fails. Two things pay it down. `PROTOCOL_VERSION` is pinned and
|
|
34
|
-
* `SUPPORTED_PROTOCOL_VERSIONS` is explicit, so an unknown version is negotiated
|
|
35
|
-
* rather than assumed compatible; and the handshake is covered by tests that
|
|
36
|
-
* assert the exact frames, so a change to the shape is a red test rather than a
|
|
37
|
-
* user-visible mystery. If the protocol moves past what is here, the fix is to
|
|
38
|
-
* add a version to the list — not to discover it from a bug report.
|
|
39
|
-
*/
|
|
2
|
+
* JSON-RPC 2.0 + the MCP slice this server speaks — hand-written, not the SDK:
|
|
3
|
+
* v1.30.0 pulls 17 deps, nearly all for HTTP/OAuth transports this stdio-only
|
|
4
|
+
* server never opens (same call as `node:sqlite`, `node --test`, `tsc` elsewhere).
|
|
5
|
+
* Spec-drift risk is mitigated by a pinned `PROTOCOL_VERSION` and exact-frame tests. */
|
|
40
6
|
/** Standard JSON-RPC codes. MCP adds none of its own at this layer. */
|
|
41
7
|
export const RPC_PARSE_ERROR = -32700;
|
|
42
8
|
export const RPC_INVALID_REQUEST = -32600;
|
|
43
9
|
export const RPC_METHOD_NOT_FOUND = -32601;
|
|
44
10
|
export const RPC_INVALID_PARAMS = -32602;
|
|
45
11
|
export const RPC_INTERNAL_ERROR = -32603;
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* Newest first. Negotiation echoes the client's version when it is on this list
|
|
50
|
-
* and otherwise answers with `PROTOCOL_VERSION`, which is what the spec asks for
|
|
51
|
-
* — the client then decides whether it can proceed. Answering with the client's
|
|
52
|
-
* unknown version instead would be a claim of compatibility nobody has checked.
|
|
53
|
-
*/
|
|
12
|
+
/** The version this server implements. Negotiation echoes the client's version if
|
|
13
|
+
* it's on `SUPPORTED_PROTOCOL_VERSIONS`, else answers with this — never claims
|
|
14
|
+
* compatibility with an unchecked client version. */
|
|
54
15
|
export const PROTOCOL_VERSION = "2025-06-18";
|
|
55
16
|
export const SUPPORTED_PROTOCOL_VERSIONS = [
|
|
56
17
|
"2025-06-18",
|
|
@@ -62,16 +23,9 @@ export function negotiateVersion(requested) {
|
|
|
62
23
|
? requested
|
|
63
24
|
: PROTOCOL_VERSION;
|
|
64
25
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* A frame that could not be understood well enough to answer.
|
|
70
|
-
*
|
|
71
|
-
* Distinguished from a request that is merely wrong, because JSON-RPC says a
|
|
72
|
-
* message with no usable id gets no response at all — replying to it with a
|
|
73
|
-
* fabricated id would put a frame on the wire the client cannot correlate.
|
|
74
|
-
*/
|
|
26
|
+
/** A frame that couldn't be understood well enough to answer. Distinct from a
|
|
27
|
+
* merely-wrong request — JSON-RPC says a message with no usable id gets no
|
|
28
|
+
* response; replying with a fabricated id would be uncorrelatable. */
|
|
75
29
|
export class ProtocolError extends Error {
|
|
76
30
|
code;
|
|
77
31
|
/** Null when the frame carried no usable id and must therefore go unanswered. */
|
|
@@ -98,8 +52,8 @@ export function parseMessage(line) {
|
|
|
98
52
|
if (!isRecord(raw)) {
|
|
99
53
|
throw new ProtocolError(RPC_INVALID_REQUEST, "message must be a JSON object", null);
|
|
100
54
|
}
|
|
101
|
-
// Batch requests were removed from MCP in 2025-06-18
|
|
102
|
-
//
|
|
55
|
+
// Batch requests were removed from MCP in 2025-06-18; never supported here anyway —
|
|
56
|
+
// an array reaches the same branch as any other non-object.
|
|
103
57
|
const id = raw["id"];
|
|
104
58
|
const usableId = typeof id === "string" || typeof id === "number" ? id : null;
|
|
105
59
|
if (raw["jsonrpc"] !== "2.0") {
|
|
@@ -110,8 +64,8 @@ export function parseMessage(line) {
|
|
|
110
64
|
}
|
|
111
65
|
const params = raw["params"];
|
|
112
66
|
if (params !== undefined && !isRecord(params)) {
|
|
113
|
-
// Positional params are legal JSON-RPC
|
|
114
|
-
//
|
|
67
|
+
// Positional params are legal JSON-RPC, illegal MCP. Rejected, not coerced —
|
|
68
|
+
// an array silently read as an object would be a wrong answer, not an error.
|
|
115
69
|
throw new ProtocolError(RPC_INVALID_PARAMS, "params must be an object", usableId);
|
|
116
70
|
}
|
|
117
71
|
const method = raw["method"];
|
package/dist/protocol.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;wFAIwF;AAiCxF,uEAAuE;AACvE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAK,CAAC;AACtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAK,CAAC;AAC1C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAK,CAAC;AAC3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAK,CAAC;AACzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAK,CAAC;AAEzC;;sDAEsD;AACtD,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAC7C,MAAM,CAAC,MAAM,2BAA2B,GAAsB;IAC5D,YAAY;IACZ,YAAY;IACZ,YAAY;CACb,CAAC;AAEF,MAAM,UAAU,gBAAgB,CAAC,SAAkB;IACjD,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,2BAA2B,CAAC,QAAQ,CAAC,SAAS,CAAC;QACrF,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,gBAAgB,CAAC;AACvB,CAAC;AAED;;uEAE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AI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;KAClE,CAAC;AACJ,CAAC"}
|
package/dist/registry.d.ts
CHANGED
|
@@ -1,47 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* where it matters most — the process that runs everything. So sources are named
|
|
7
|
-
* in configuration as module specifiers and loaded at runtime. The engine knows
|
|
8
|
-
* `IRSource`; it never knows the word "python".
|
|
9
|
-
*
|
|
10
|
-
* ## The factory convention, and why it is a convention rather than an interface
|
|
11
|
-
*
|
|
12
|
-
* Every adapter in `descry-adapters` exports `ADAPTER_ID`, `ADAPTER_VERSION` and
|
|
13
|
-
* a factory named `create<Something>Adapter` — `createGoAdapter`,
|
|
14
|
-
* `createTypeScriptAdapter`, `createOpenApiAdapter`. There is no uniform name,
|
|
15
|
-
* and inventing one now would be a breaking change across twelve packages to
|
|
16
|
-
* save a regular expression. So: an explicit `export` in config wins; failing
|
|
17
|
-
* that, the single export matching `create*Adapter` is used; **two matches is an
|
|
18
|
-
* error, not a coin toss.**
|
|
19
|
-
*
|
|
20
|
-
* ## Failing to load a source is a disclosure, never a shrug
|
|
21
|
-
*
|
|
22
|
-
* An adapter that will not import is the difference between "we found no problem
|
|
23
|
-
* in your Python service" and "we could not read your Python service" — §20.2
|
|
24
|
-
* keeps those in different categories, and a registry that quietly skipped a
|
|
25
|
-
* broken specifier would collapse them at the very bottom of the stack, where no
|
|
26
|
-
* layer above could ever recover the distinction. Every failure comes back as a
|
|
27
|
-
* `SourceLoadFailure` carrying the specifier and the reason, and the caller is
|
|
28
|
-
* structurally unable to take the loaded sources without also taking the list of
|
|
29
|
-
* ones that are missing.
|
|
30
|
-
*
|
|
31
|
-
* ## Two places to look, because the server and the repository are not the same tree
|
|
32
|
-
*
|
|
33
|
-
* `import(spec.module)` resolves relative to *this package's* location. That is
|
|
34
|
-
* right for a side-by-side install — `npm i @descryy/mcp @descryy/adapter-x` puts
|
|
35
|
-
* both under the repository's own `node_modules` — and useless under `npx -y
|
|
36
|
-
* @descryy/mcp <repo>`, where the server runs out of an isolated npx cache
|
|
37
|
-
* directory that contains no adapter the user ever installed. So a specifier is
|
|
38
|
-
* resolved from the **repository root first** when one is known: that is where the
|
|
39
|
-
* user installed the adapter and where their lockfile pins its version. The
|
|
40
|
-
* server's own closure stays as the fallback, so the side-by-side install and the
|
|
41
|
-
* absolute-path and `file:` specifiers that never needed a repository keep working
|
|
42
|
-
* unchanged. When both fail, both are disclosed — a resolution nobody attempted is
|
|
43
|
-
* the worst thing to make somebody debug.
|
|
44
|
-
*/
|
|
1
|
+
/** How the server reaches adapters without depending on them: `descry-core` must never
|
|
2
|
+
* import `descry-adapters` (rule 1, IR boundary) — sources are named as module specifiers
|
|
3
|
+
* in config and loaded at runtime via a `create*Adapter` convention (an ambiguous match
|
|
4
|
+
* errors, never guesses). A failed load is disclosed as `SourceLoadFailure`, never silently
|
|
5
|
+
* skipped (§20.2). Specifiers resolve from the repo root first (npx isolates adapters there), then this package's own closure. */
|
|
45
6
|
import type { IRSource, LanguageAdapter, RepoRoot } from "@descryy/ir";
|
|
46
7
|
/** One entry in the configured source list. A bare string is `{ module }`. */
|
|
47
8
|
export interface SourceSpec {
|
|
@@ -56,6 +17,33 @@ export interface LoadedSource {
|
|
|
56
17
|
readonly source: IRSource;
|
|
57
18
|
/** Present when the source implements `LanguageAdapter`, so `detect` can run. */
|
|
58
19
|
readonly adapter: LanguageAdapter | null;
|
|
20
|
+
/**
|
|
21
|
+
* The absolute path this specifier actually resolved to. `null` only when
|
|
22
|
+
* the server's own module closure resolved it (`via: "server"`) and
|
|
23
|
+
* `import.meta.resolve` itself could not report where from.
|
|
24
|
+
*
|
|
25
|
+
* UAT phase 4 F3/§13.2.2: a bare specifier can resolve to more than one
|
|
26
|
+
* installed build with the same name (a stray `node_modules` above the
|
|
27
|
+
* repository shadows the intended one via CJS resolution's upward walk),
|
|
28
|
+
* and nothing previously said which build actually ran. This is that
|
|
29
|
+
* disclosure.
|
|
30
|
+
*/
|
|
31
|
+
readonly resolvedPath: string | null;
|
|
32
|
+
/**
|
|
33
|
+
* The version declared by the resolved module's own nearest
|
|
34
|
+
* `package.json`, walking up from `resolvedPath` — the *installed
|
|
35
|
+
* artifact's* version. Deliberately not the module's self-declared
|
|
36
|
+
* version constant (`source.version`, if it sets one): those two can
|
|
37
|
+
* disagree (an adapter's hardcoded `ADAPTER_VERSION` left stale while its
|
|
38
|
+
* `package.json` moved on), and conflating them would hide exactly the
|
|
39
|
+
* drift this field exists to catch. `null` when `resolvedPath` is `null`,
|
|
40
|
+
* or when no `package.json` encloses it.
|
|
41
|
+
*/
|
|
42
|
+
readonly packageVersion: string | null;
|
|
43
|
+
/** Which resolution path found it: the scanned repository's own
|
|
44
|
+
* `node_modules` (`"repo"`), or this server's own module closure
|
|
45
|
+
* (`"server"`). Both are legitimate — the point is naming which. */
|
|
46
|
+
readonly via: "repo" | "server";
|
|
59
47
|
}
|
|
60
48
|
export interface SourceLoadFailure {
|
|
61
49
|
readonly spec: SourceSpec;
|
|
@@ -66,21 +54,12 @@ export interface RegistryResult {
|
|
|
66
54
|
readonly failed: readonly SourceLoadFailure[];
|
|
67
55
|
}
|
|
68
56
|
export declare function normaliseSpec(entry: string | SourceSpec): SourceSpec;
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
* resolved from here first; without it only the server's own closure is searched,
|
|
72
|
-
* which is correct for callers that name modules by absolute path or `file:` URL.
|
|
73
|
-
*/
|
|
57
|
+
/** @param repoPath Repo being analysed, when known — specifiers resolve from here first;
|
|
58
|
+
* without it only this package's closure is searched (correct for absolute-path/`file:` callers). */
|
|
74
59
|
export declare function loadSources(entries: readonly (string | SourceSpec)[], repoPath?: string): Promise<RegistryResult>;
|
|
75
|
-
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* A source that is not a `LanguageAdapter` — the git history reader is the
|
|
79
|
-
* standing example — has nothing to detect and always runs. A `detect` that
|
|
80
|
-
* throws is treated as "did not detect", **with the reason recorded**: a broken
|
|
81
|
-
* detector must not be able to fail the whole run, and must not be able to hide
|
|
82
|
-
* either.
|
|
83
|
-
*/
|
|
60
|
+
/** Asks each loaded adapter whether it claims this repository. A non-`LanguageAdapter`
|
|
61
|
+
* source (the git reader) always runs. A throwing `detect` counts as "did not detect",
|
|
62
|
+
* with the reason recorded — it can't fail the whole run, and can't hide either. */
|
|
84
63
|
export declare function detectSources(sources: readonly LoadedSource[], root: RepoRoot): Promise<{
|
|
85
64
|
readonly applicable: readonly LoadedSource[];
|
|
86
65
|
readonly skipped: readonly {
|
package/dist/registry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;mIAImI;AAOnI,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvE,8EAA8E;AAC9E,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IACzC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC;;;;;;;;;OASG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC;;yEAEqE;IACrE,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC;CACjC;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC/C;AAID,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAEpE;AAoBD;sGACsG;AACtG,wBAAsB,WAAW,CAC/B,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,EACzC,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,cAAc,CAAC,CAmBzB;AA6HD;;qFAEqF;AACrF,wBAAsB,aAAa,CACjC,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC;IACT,QAAQ,CAAC,UAAU,EAAE,SAAS,YAAY,EAAE,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,SAAS;QAAE,MAAM,EAAE,YAAY,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACvE,CAAC,CAuBD"}
|
package/dist/registry.js
CHANGED
|
@@ -1,47 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* where it matters most — the process that runs everything. So sources are named
|
|
7
|
-
* in configuration as module specifiers and loaded at runtime. The engine knows
|
|
8
|
-
* `IRSource`; it never knows the word "python".
|
|
9
|
-
*
|
|
10
|
-
* ## The factory convention, and why it is a convention rather than an interface
|
|
11
|
-
*
|
|
12
|
-
* Every adapter in `descry-adapters` exports `ADAPTER_ID`, `ADAPTER_VERSION` and
|
|
13
|
-
* a factory named `create<Something>Adapter` — `createGoAdapter`,
|
|
14
|
-
* `createTypeScriptAdapter`, `createOpenApiAdapter`. There is no uniform name,
|
|
15
|
-
* and inventing one now would be a breaking change across twelve packages to
|
|
16
|
-
* save a regular expression. So: an explicit `export` in config wins; failing
|
|
17
|
-
* that, the single export matching `create*Adapter` is used; **two matches is an
|
|
18
|
-
* error, not a coin toss.**
|
|
19
|
-
*
|
|
20
|
-
* ## Failing to load a source is a disclosure, never a shrug
|
|
21
|
-
*
|
|
22
|
-
* An adapter that will not import is the difference between "we found no problem
|
|
23
|
-
* in your Python service" and "we could not read your Python service" — §20.2
|
|
24
|
-
* keeps those in different categories, and a registry that quietly skipped a
|
|
25
|
-
* broken specifier would collapse them at the very bottom of the stack, where no
|
|
26
|
-
* layer above could ever recover the distinction. Every failure comes back as a
|
|
27
|
-
* `SourceLoadFailure` carrying the specifier and the reason, and the caller is
|
|
28
|
-
* structurally unable to take the loaded sources without also taking the list of
|
|
29
|
-
* ones that are missing.
|
|
30
|
-
*
|
|
31
|
-
* ## Two places to look, because the server and the repository are not the same tree
|
|
32
|
-
*
|
|
33
|
-
* `import(spec.module)` resolves relative to *this package's* location. That is
|
|
34
|
-
* right for a side-by-side install — `npm i @descryy/mcp @descryy/adapter-x` puts
|
|
35
|
-
* both under the repository's own `node_modules` — and useless under `npx -y
|
|
36
|
-
* @descryy/mcp <repo>`, where the server runs out of an isolated npx cache
|
|
37
|
-
* directory that contains no adapter the user ever installed. So a specifier is
|
|
38
|
-
* resolved from the **repository root first** when one is known: that is where the
|
|
39
|
-
* user installed the adapter and where their lockfile pins its version. The
|
|
40
|
-
* server's own closure stays as the fallback, so the side-by-side install and the
|
|
41
|
-
* absolute-path and `file:` specifiers that never needed a repository keep working
|
|
42
|
-
* unchanged. When both fail, both are disclosed — a resolution nobody attempted is
|
|
43
|
-
* the worst thing to make somebody debug.
|
|
44
|
-
*/
|
|
1
|
+
/** How the server reaches adapters without depending on them: `descry-core` must never
|
|
2
|
+
* import `descry-adapters` (rule 1, IR boundary) — sources are named as module specifiers
|
|
3
|
+
* in config and loaded at runtime via a `create*Adapter` convention (an ambiguous match
|
|
4
|
+
* errors, never guesses). A failed load is disclosed as `SourceLoadFailure`, never silently
|
|
5
|
+
* skipped (§20.2). Specifiers resolve from the repo root first (npx isolates adapters there), then this package's own closure. */
|
|
45
6
|
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
46
7
|
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
47
8
|
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
@@ -51,20 +12,17 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
51
12
|
return path;
|
|
52
13
|
};
|
|
53
14
|
import { createRequire } from "node:module";
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
15
|
+
import { readFileSync } from "node:fs";
|
|
16
|
+
import { dirname, join } from "node:path";
|
|
17
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
18
|
+
import { checkModuleTrust, checkRepoResolvedModuleTrust } from "./module-trust.js";
|
|
56
19
|
const FACTORY_PATTERN = /^create[A-Za-z0-9]*Adapter$/;
|
|
57
20
|
export function normaliseSpec(entry) {
|
|
58
21
|
return typeof entry === "string" ? { module: entry } : entry;
|
|
59
22
|
}
|
|
60
|
-
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* Duck-typed on the two methods that matter rather than on a marker, because the
|
|
64
|
-
* adapters are compiled separately and `instanceof` across package boundaries is
|
|
65
|
-
* a well-known way to be wrong. `detect` and `capabilities` are the two the
|
|
66
|
-
* server actually calls; a source with both is one it can treat as an adapter.
|
|
67
|
-
*/
|
|
23
|
+
/** A loaded module is a `LanguageAdapter` when it can be asked what it supports. Duck-typed
|
|
24
|
+
* on `detect`/`capabilities` — the two methods the server calls — since `instanceof` across
|
|
25
|
+
* separately-compiled adapter packages is unreliable. */
|
|
68
26
|
function asAdapter(source) {
|
|
69
27
|
const candidate = source;
|
|
70
28
|
return typeof candidate.detect === "function" && typeof candidate.capabilities === "function"
|
|
@@ -78,18 +36,20 @@ function describe(error) {
|
|
|
78
36
|
}
|
|
79
37
|
return String(error);
|
|
80
38
|
}
|
|
81
|
-
/**
|
|
82
|
-
*
|
|
83
|
-
* resolved from here first; without it only the server's own closure is searched,
|
|
84
|
-
* which is correct for callers that name modules by absolute path or `file:` URL.
|
|
85
|
-
*/
|
|
39
|
+
/** @param repoPath Repo being analysed, when known — specifiers resolve from here first;
|
|
40
|
+
* without it only this package's closure is searched (correct for absolute-path/`file:` callers). */
|
|
86
41
|
export async function loadSources(entries, repoPath) {
|
|
87
42
|
const loaded = [];
|
|
88
43
|
const failed = [];
|
|
89
44
|
for (const entry of entries) {
|
|
90
45
|
const spec = normaliseSpec(entry);
|
|
91
46
|
try {
|
|
92
|
-
|
|
47
|
+
const instantiated = await instantiate(spec, repoPath);
|
|
48
|
+
loaded.push({
|
|
49
|
+
...instantiated,
|
|
50
|
+
spec,
|
|
51
|
+
packageVersion: packageVersionFor(instantiated.resolvedPath),
|
|
52
|
+
});
|
|
93
53
|
}
|
|
94
54
|
catch (error) {
|
|
95
55
|
failed.push({ spec, reason: describe(error) });
|
|
@@ -97,20 +57,9 @@ export async function loadSources(entries, repoPath) {
|
|
|
97
57
|
}
|
|
98
58
|
return { loaded, failed };
|
|
99
59
|
}
|
|
100
|
-
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* `createRequire` anchored at the repository's `package.json` is the resolution a
|
|
104
|
-
* script run inside that repository would get. It is CommonJS resolution, so it
|
|
105
|
-
* reads `exports` under the `require`/`default` conditions — every adapter here
|
|
106
|
-
* publishes a `default`, and one that did not would fall through to the server's
|
|
107
|
-
* closure rather than fail the load. The resolved path is imported as a URL, so
|
|
108
|
-
* the module itself is still loaded as ESM.
|
|
109
|
-
*
|
|
110
|
-
* Returns the reason on failure rather than throwing: a specifier the repository
|
|
111
|
-
* cannot see is not yet a failure, only a fact worth disclosing if the second
|
|
112
|
-
* attempt fails too.
|
|
113
|
-
*/
|
|
60
|
+
/** Resolves a specifier as the repo's own `node_modules` would, via `createRequire` anchored
|
|
61
|
+
* at its `package.json` (CJS resolution, `require`/`default` conditions), then imports the
|
|
62
|
+
* resolved path as ESM. Returns the reason on failure rather than throwing — not yet a failure until the fallback also fails. */
|
|
114
63
|
function resolveFromRepo(specifier, repoPath) {
|
|
115
64
|
try {
|
|
116
65
|
const require = createRequire(pathToFileURL(join(repoPath, "package.json")));
|
|
@@ -121,7 +70,8 @@ function resolveFromRepo(specifier, repoPath) {
|
|
|
121
70
|
}
|
|
122
71
|
}
|
|
123
72
|
async function instantiate(spec, repoPath) {
|
|
124
|
-
const
|
|
73
|
+
const imported = await importSource(spec.module, repoPath);
|
|
74
|
+
const module = imported.module;
|
|
125
75
|
let factoryName = spec.export;
|
|
126
76
|
if (factoryName === undefined) {
|
|
127
77
|
const candidates = Object.keys(module).filter((key) => FACTORY_PATTERN.test(key) && typeof module[key] === "function");
|
|
@@ -143,22 +93,70 @@ async function instantiate(spec, repoPath) {
|
|
|
143
93
|
if (typeof source?.emit !== "function" || typeof source.id !== "string") {
|
|
144
94
|
throw new Error(`"${factoryName}" did not return an IRSource (needs \`id\` and \`emit\`)`);
|
|
145
95
|
}
|
|
146
|
-
return { source, adapter: asAdapter(source) };
|
|
96
|
+
return { source, adapter: asAdapter(source), resolvedPath: imported.resolvedPath, via: imported.via };
|
|
147
97
|
}
|
|
148
|
-
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
98
|
+
/** Reads the version of the nearest enclosing `package.json`, walking up from `startPath`'s
|
|
99
|
+
* directory — the *installed artifact's* version, never the module's own self-declared
|
|
100
|
+
* constant. `null` when `startPath` is `null` or no `package.json` encloses it (a bare
|
|
101
|
+
* path-specifier source with no package boundary at all): a real absence, never a guess. */
|
|
102
|
+
function packageVersionFor(startPath) {
|
|
103
|
+
if (startPath === null)
|
|
104
|
+
return null;
|
|
105
|
+
let dir = dirname(startPath);
|
|
106
|
+
for (;;) {
|
|
107
|
+
try {
|
|
108
|
+
const pkg = JSON.parse(readFileSync(join(dir, "package.json"), "utf8"));
|
|
109
|
+
if (typeof pkg.version === "string")
|
|
110
|
+
return pkg.version;
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
// Not found at this level, or not parseable — keep walking up; a
|
|
115
|
+
// malformed package.json above the real one must not stop the search.
|
|
116
|
+
}
|
|
117
|
+
const parent = dirname(dir);
|
|
118
|
+
if (parent === dir)
|
|
119
|
+
return null; // reached the filesystem root
|
|
120
|
+
dir = parent;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/** Repository root first, the server's own closure second. Only a resolution failure falls
|
|
124
|
+
* through — a module that resolves and then throws is that module's own failure, not "could not be found". */
|
|
156
125
|
async function importSource(specifier, repoPath) {
|
|
126
|
+
// A-F1: specifier can come straight from the repo's own .descry/config.json (module-trust.ts).
|
|
127
|
+
// Checked on the raw string before either resolution attempt, since `resolveFromRepo` always
|
|
128
|
+
// turns its result into a `file:` URL regardless of whether the specifier was path-like.
|
|
129
|
+
const trust = checkModuleTrust(specifier);
|
|
130
|
+
if (!trust.allowed)
|
|
131
|
+
throw new Error(trust.reason);
|
|
157
132
|
const fromRepo = repoPath === undefined ? { reason: "no repository root" } : resolveFromRepo(specifier, repoPath);
|
|
158
|
-
if ("url" in fromRepo)
|
|
159
|
-
|
|
133
|
+
if ("url" in fromRepo) {
|
|
134
|
+
// A-F1 follow-up: checkModuleTrust only sees the raw specifier, not that it resolves into
|
|
135
|
+
// the repo's own git-tracked node_modules — closes the gap where a hostile repo commits
|
|
136
|
+
// node_modules/<name> and delivers a payload on clone alone; override: DESCRY_ALLOW_TRACKED_NODE_MODULES=1.
|
|
137
|
+
const repoTrust = await checkRepoResolvedModuleTrust({
|
|
138
|
+
specifier,
|
|
139
|
+
repoPath: repoPath,
|
|
140
|
+
resolvedAbsolutePath: fileURLToPath(fromRepo.url),
|
|
141
|
+
});
|
|
142
|
+
if (!repoTrust.allowed)
|
|
143
|
+
throw new Error(repoTrust.reason);
|
|
144
|
+
const module = await import(__rewriteRelativeImportExtension(fromRepo.url));
|
|
145
|
+
return { module, resolvedPath: fileURLToPath(fromRepo.url), via: "repo" };
|
|
146
|
+
}
|
|
160
147
|
try {
|
|
161
|
-
|
|
148
|
+
const module = await import(__rewriteRelativeImportExtension(specifier));
|
|
149
|
+
// Best-effort only — `import.meta.resolve` reports where the server's
|
|
150
|
+
// own module graph found it, but is not guaranteed to succeed for every
|
|
151
|
+
// legal specifier shape a runtime `import()` accepts.
|
|
152
|
+
let resolvedPath = null;
|
|
153
|
+
try {
|
|
154
|
+
resolvedPath = fileURLToPath(import.meta.resolve(specifier));
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
resolvedPath = null;
|
|
158
|
+
}
|
|
159
|
+
return { module, resolvedPath, via: "server" };
|
|
162
160
|
}
|
|
163
161
|
catch (error) {
|
|
164
162
|
if (repoPath === undefined)
|
|
@@ -167,15 +165,9 @@ async function importSource(specifier, repoPath) {
|
|
|
167
165
|
`(${fromRepo.reason})`, { cause: error });
|
|
168
166
|
}
|
|
169
167
|
}
|
|
170
|
-
/**
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* A source that is not a `LanguageAdapter` — the git history reader is the
|
|
174
|
-
* standing example — has nothing to detect and always runs. A `detect` that
|
|
175
|
-
* throws is treated as "did not detect", **with the reason recorded**: a broken
|
|
176
|
-
* detector must not be able to fail the whole run, and must not be able to hide
|
|
177
|
-
* either.
|
|
178
|
-
*/
|
|
168
|
+
/** Asks each loaded adapter whether it claims this repository. A non-`LanguageAdapter`
|
|
169
|
+
* source (the git reader) always runs. A throwing `detect` counts as "did not detect",
|
|
170
|
+
* with the reason recorded — it can't fail the whole run, and can't hide either. */
|
|
179
171
|
export async function detectSources(sources, root) {
|
|
180
172
|
const applicable = [];
|
|
181
173
|
const skipped = [];
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;mIAImI;;;;;;;;;AAEnI,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIxD,OAAO,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AAuDnF,MAAM,eAAe,GAAG,6BAA6B,CAAC;AAEtD,MAAM,UAAU,aAAa,CAAC,KAA0B;IACtD,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AAC/D,CAAC;AAED;;0DAE0D;AAC1D,SAAS,SAAS,CAAC,MAAgB;IACjC,MAAM,SAAS,GAAG,MAAkC,CAAC;IACrD,OAAO,OAAO,SAAS,CAAC,MAAM,KAAK,UAAU,IAAI,OAAO,SAAS,CAAC,YAAY,KAAK,UAAU;QAC3F,CAAC,CAAE,MAA0B;QAC7B,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,QAAQ,C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