@cognium/mcp-server 0.2.1 → 0.5.0
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/CHANGELOG.md +176 -0
- package/README.md +102 -1
- package/dist/bin.js +11 -5
- package/dist/bin.js.map +1 -1
- package/dist/cache.d.ts +30 -1
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +96 -5
- package/dist/cache.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/licence.js +1 -1
- package/dist/licence.js.map +1 -1
- package/dist/modules.d.ts +1 -1
- package/dist/modules.d.ts.map +1 -1
- package/dist/params-guard.d.ts +31 -0
- package/dist/params-guard.d.ts.map +1 -0
- package/dist/params-guard.js +75 -0
- package/dist/params-guard.js.map +1 -0
- package/dist/resources/index.d.ts +1 -1
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/server.d.ts +17 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +31 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/attack-surface-summary.d.ts +6 -0
- package/dist/tools/attack-surface-summary.d.ts.map +1 -1
- package/dist/tools/attack-surface-summary.js +2 -1
- package/dist/tools/attack-surface-summary.js.map +1 -1
- package/dist/tools/check-sanitizer.d.ts +6 -0
- package/dist/tools/check-sanitizer.d.ts.map +1 -1
- package/dist/tools/check-sanitizer.js +2 -1
- package/dist/tools/check-sanitizer.js.map +1 -1
- package/dist/tools/describe-sink.d.ts +6 -0
- package/dist/tools/describe-sink.d.ts.map +1 -1
- package/dist/tools/describe-sink.js +2 -1
- package/dist/tools/describe-sink.js.map +1 -1
- package/dist/tools/describe-source.d.ts +6 -0
- package/dist/tools/describe-source.d.ts.map +1 -1
- package/dist/tools/describe-source.js +2 -1
- package/dist/tools/describe-source.js.map +1 -1
- package/dist/tools/explain-finding.d.ts +6 -0
- package/dist/tools/explain-finding.d.ts.map +1 -1
- package/dist/tools/explain-finding.js +2 -1
- package/dist/tools/explain-finding.js.map +1 -1
- package/dist/tools/find-similar.d.ts +6 -0
- package/dist/tools/find-similar.d.ts.map +1 -1
- package/dist/tools/find-similar.js +2 -1
- package/dist/tools/find-similar.js.map +1 -1
- package/dist/tools/list-entry-points.d.ts +6 -0
- package/dist/tools/list-entry-points.d.ts.map +1 -1
- package/dist/tools/list-entry-points.js +2 -1
- package/dist/tools/list-entry-points.js.map +1 -1
- package/dist/tools/list-reachable-sinks.d.ts +6 -0
- package/dist/tools/list-reachable-sinks.d.ts.map +1 -1
- package/dist/tools/list-reachable-sinks.js +2 -1
- package/dist/tools/list-reachable-sinks.js.map +1 -1
- package/dist/tools/navigation.d.ts +177 -0
- package/dist/tools/navigation.d.ts.map +1 -0
- package/dist/tools/navigation.js +216 -0
- package/dist/tools/navigation.js.map +1 -0
- package/dist/tools/refresh.d.ts +6 -0
- package/dist/tools/refresh.d.ts.map +1 -1
- package/dist/tools/refresh.js +2 -1
- package/dist/tools/refresh.js.map +1 -1
- package/dist/tools/scan.d.ts +6 -0
- package/dist/tools/scan.d.ts.map +1 -1
- package/dist/tools/scan.js +2 -1
- package/dist/tools/scan.js.map +1 -1
- package/dist/tools/taint-paths.d.ts +6 -0
- package/dist/tools/taint-paths.d.ts.map +1 -1
- package/dist/tools/taint-paths.js +2 -1
- package/dist/tools/taint-paths.js.map +1 -1
- package/dist/tools/types.d.ts +31 -1
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js +32 -1
- package/dist/tools/types.js.map +1 -1
- package/dist/util/files.d.ts +9 -0
- package/dist/util/files.d.ts.map +1 -1
- package/dist/util/files.js +11 -3
- package/dist/util/files.js.map +1 -1
- package/package.json +16 -5
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,182 @@ All notable changes to `@cognium/mcp-server` are documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.5.0] - 2026-10-02
|
|
8
|
+
|
|
9
|
+
Tested against `circle-ir` **4.10.0** (range `4.10`) and MCP SDK v2
|
|
10
|
+
(`@modelcontextprotocol/server` **^2.2.0**), with the optional module
|
|
11
|
+
`circle-ir-ai` **4.19.0**. Two tools are added. No tool was removed or
|
|
12
|
+
renamed, and what every existing tool accepts and returns is unchanged.
|
|
13
|
+
|
|
14
|
+
**`circle-ir` moves to a new minor, so an optional module must move with it.**
|
|
15
|
+
A module built against `4.9` is refused at load on `4.10` by design, which
|
|
16
|
+
would leave states 1 and 2 with none of their tools. Release order therefore
|
|
17
|
+
matters: `circle-ir` 4.10.0, then `circle-ir-ai` on 4.10, then this package.
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
- **`find_callers` and `find_callees`** — who calls a method, and what a
|
|
21
|
+
method calls, over `circle-ir`'s navigation index. Java today; the tools
|
|
22
|
+
report `unsupported-language` for a file in a language the index does not
|
|
23
|
+
resolve rather than guessing.
|
|
24
|
+
|
|
25
|
+
Every answer carries a **tier**: `exact` (the receiver's static type was
|
|
26
|
+
known and the target was unique in it), `polymorphic` (dispatch is open,
|
|
27
|
+
with every candidate body listed and the declaring member as the target),
|
|
28
|
+
or `inferred` (bound by the method name alone). `inferred` is a floor and is
|
|
29
|
+
never promoted; it is also never produced when a receiver's type *is* known
|
|
30
|
+
and lacks the method, which on a 405-file Java repository was 78 of 147
|
|
31
|
+
name-only "callers" of a single method.
|
|
32
|
+
|
|
33
|
+
Every call site that could not be resolved carries a **reason** from a
|
|
34
|
+
closed vocabulary — `external`, `dynamic`, `generated`, `parse-error`,
|
|
35
|
+
`unsupported-language`, `unknown` — so an unresolved count can be read
|
|
36
|
+
rather than guessed at. Every answer states its **denominator**: files
|
|
37
|
+
searched, languages, and the directories deliberately skipped. A list cut to
|
|
38
|
+
`limit` reports `truncated` with the real total.
|
|
39
|
+
|
|
40
|
+
Both tools accept either a `symbol` or a `site`. A site is
|
|
41
|
+
`{file, line, method_name}` and not a column, because a chained expression
|
|
42
|
+
reports several calls at one line and column — `b.of().step("a").done()` is
|
|
43
|
+
three calls at one position — so the method name is what completes the key.
|
|
44
|
+
|
|
45
|
+
Both are `readOnlyHint: true`, `openWorldHint: false`, and every successful
|
|
46
|
+
response says `provenance: deterministic`. No model is consulted.
|
|
47
|
+
|
|
48
|
+
When no answer is `exact`, the response carries a `nextStep` line saying
|
|
49
|
+
what to do instead — inspect the candidates, check a receiver, or reach for
|
|
50
|
+
a language server. It sits in the server's envelope, not inside the answer,
|
|
51
|
+
because it is advice rather than a fact about the code.
|
|
52
|
+
|
|
53
|
+
### Measured
|
|
54
|
+
|
|
55
|
+
The navigation tools were evaluated against compiler-backed ground truth: a
|
|
56
|
+
sample of call sites in WebGoat, each site's callee resolved by the Eclipse
|
|
57
|
+
JDT compiler, with a pinned `ripgrep` answering the same queries as a
|
|
58
|
+
baseline. Java only. Every figure below carries its denominator.
|
|
59
|
+
|
|
60
|
+
- **`exact` precision: 100 %** — of the 143 `exact` answers that landed on a
|
|
61
|
+
site the compiler had resolved, 143 named the compiler's callee and none
|
|
62
|
+
contradicted it.
|
|
63
|
+
- **`inferred` precision: 26.7 %** of 15, where the baseline's name match was
|
|
64
|
+
right 60.6 % of 711. **An `inferred` answer is not evidence that a call
|
|
65
|
+
happens**; it is a name that matched with no receiver type to confirm it.
|
|
66
|
+
It is a lead to check, and the tool will not promote it.
|
|
67
|
+
- **Recall over sites whose target is declared in the repository: 79.6 %**
|
|
68
|
+
(148 of 186), against the baseline's 93.5 % (174 of 186).
|
|
69
|
+
- **Recall over all sampled sites: 34.0 %** (159 of 467), against the
|
|
70
|
+
baseline's 92.3 % (431 of 467) — and capped at **39.8 %** for any tool
|
|
71
|
+
answering from an index, because only 186 of the 467 sampled sites have a
|
|
72
|
+
target declared inside the repository. That row's two columns answer
|
|
73
|
+
different questions and should not be read as one comparison.
|
|
74
|
+
|
|
75
|
+
### Changed
|
|
76
|
+
- The server's own cache keeps a navigation index per project, separately
|
|
77
|
+
from the scan analyses. It asks the engine for more (the extra type
|
|
78
|
+
information that makes a Java `record` visible) and for less (no cross-file
|
|
79
|
+
taint phase, which navigation does not read), so a caller asking "who calls
|
|
80
|
+
this" does not pay for taint analysis it will not use.
|
|
81
|
+
|
|
82
|
+
## [0.4.0] - 2026-10-02
|
|
83
|
+
|
|
84
|
+
Tested against `circle-ir` **4.9.29** (range `4.9`) and MCP SDK v2
|
|
85
|
+
(`@modelcontextprotocol/server` **^2.2.0**). No tool was added, removed or
|
|
86
|
+
renamed, and what each tool accepts and returns is unchanged.
|
|
87
|
+
|
|
88
|
+
### Added
|
|
89
|
+
- **The server speaks MCP revision 2026-07-28**, next to the revisions it
|
|
90
|
+
already spoke. A client of the newer revision opens with `server/discover`
|
|
91
|
+
and puts its protocol version, identity and capabilities on every request;
|
|
92
|
+
results carry `resultType`, and the server's identity is in the result's
|
|
93
|
+
`_meta`. A client that opens with `initialize` is served exactly as before.
|
|
94
|
+
The era is chosen per connection over stdio and per request over HTTP, from
|
|
95
|
+
the same server.
|
|
96
|
+
- **`createHandler()`** — the server as a web-standard HTTP handler:
|
|
97
|
+
`handler.fetch(request)` returns the response. It builds a fresh server per
|
|
98
|
+
request, serves both eras from one endpoint, and resolves the optional
|
|
99
|
+
modules and the licence state once per process. This is what an HTTP host
|
|
100
|
+
should mount.
|
|
101
|
+
|
|
102
|
+
### Changed
|
|
103
|
+
- **The MCP SDK moves from `@modelcontextprotocol/sdk` 1.x to the v2 packages**
|
|
104
|
+
(`@modelcontextprotocol/server`, `@modelcontextprotocol/core`). The 1.x line
|
|
105
|
+
has no release that speaks 2026-07-28.
|
|
106
|
+
- **The stdio binary serves through the SDK's era-aware entry**, so one process
|
|
107
|
+
answers either kind of client. The bin name and its arguments are unchanged.
|
|
108
|
+
|
|
109
|
+
#### Consumer Impact
|
|
110
|
+
Each of these changes what a client sees without an error at the point of
|
|
111
|
+
change, on the 2025-era protocol as well as the new one.
|
|
112
|
+
|
|
113
|
+
- **Tool input schemas declare JSON Schema 2020-12, not draft-07.** The
|
|
114
|
+
`$schema` of every `inputSchema` in `tools/list` changes from
|
|
115
|
+
`http://json-schema.org/draft-07/schema#` to
|
|
116
|
+
`https://json-schema.org/draft/2020-12/schema`. The schemas are otherwise
|
|
117
|
+
identical, key for key: what a tool accepts has not changed. A client that
|
|
118
|
+
compiles `inputSchema` with a validator that only knows draft-07 will refuse
|
|
119
|
+
the new `$schema` and has to move to a 2020-12 validator or drop the keyword.
|
|
120
|
+
- **A call to a tool that does not exist is a JSON-RPC error**, `-32602` with
|
|
121
|
+
`Tool <name> not found`. It was a normal result with `isError: true`. A client
|
|
122
|
+
that looked at `result.isError` to detect an unknown tool gets an error
|
|
123
|
+
response instead and has to handle it there.
|
|
124
|
+
- **Error text loses its `MCP error -32602: ` prefix.** A tool called with
|
|
125
|
+
arguments that do not match its schema still returns a result with
|
|
126
|
+
`isError: true`; the message now starts `Input validation error: …`. Match on
|
|
127
|
+
the structure, not on the old prefix.
|
|
128
|
+
- **`createServer()` connected to a transport of your own serves the 2025-era
|
|
129
|
+
protocol only.** That is what it did before, so nothing breaks; but a host
|
|
130
|
+
that wants to serve 2026-07-28 has to mount `createHandler()` instead.
|
|
131
|
+
- **A tool module is registered on the v2 SDK's `McpServer`.** A module built
|
|
132
|
+
against the 1.x SDK still loads and its tools still work — `registerTool` is
|
|
133
|
+
called the same way — but its types no longer line up with this package's
|
|
134
|
+
`ToolModule`. `circle-ir-ai/mcp` needs a release built on the v2 SDK for a
|
|
135
|
+
host that type-checks the two together.
|
|
136
|
+
|
|
137
|
+
## [0.3.0] - 2026-10-02
|
|
138
|
+
|
|
139
|
+
Tested against `circle-ir` **4.9.29** (range `4.9`), MCP SDK **^1.30.1** and the
|
|
140
|
+
`circle-ir-ai/mcp` module **4.17.0**. No tool was removed or renamed and no
|
|
141
|
+
input schema changed.
|
|
142
|
+
|
|
143
|
+
### Added
|
|
144
|
+
- **Every tool declares annotations.** Ten of the eleven tools declare
|
|
145
|
+
`readOnlyHint: true`; all declare `destructiveHint: false`,
|
|
146
|
+
`idempotentHint: true` and `openWorldHint: false`. They read the project they
|
|
147
|
+
are pointed at and nothing else: no file is written or deleted and nothing
|
|
148
|
+
leaves the machine. `refresh` declares `readOnlyHint: false` — it touches no
|
|
149
|
+
file, but it drops entries from the server's in-memory cache, which is a
|
|
150
|
+
change of state. A test holds the read-only claim to what a call does: after
|
|
151
|
+
every tool has run, the analysed project is byte-for-byte as it was.
|
|
152
|
+
- **Every successful response carries `provenance`.** It is `"deterministic"`
|
|
153
|
+
for all eleven tools, and it is the last field of the JSON body. A response
|
|
154
|
+
from an optional module that used a model says `llm: <model>` instead, so a
|
|
155
|
+
client can read how an answer was produced rather than infer it from the
|
|
156
|
+
tool's name. Error results carry none.
|
|
157
|
+
- **`circle-ir-ai` is declared as an optional peer dependency** (`>=4.17.0`).
|
|
158
|
+
Nothing changes at runtime: the server still looks for `circle-ir-ai/mcp` at
|
|
159
|
+
startup and runs without it. The declaration lets npm warn when a
|
|
160
|
+
`circle-ir-ai` too old to carry the module is installed next to the server.
|
|
161
|
+
- A `default` condition on the package's `exports`, so
|
|
162
|
+
`require.resolve('@cognium/mcp-server')` finds the entry. The package is still
|
|
163
|
+
ESM only.
|
|
164
|
+
|
|
165
|
+
### Changed
|
|
166
|
+
- **A request with malformed parameters is answered `-32602`, not `-32603`.**
|
|
167
|
+
`tools/call` with a non-string `name`, with `arguments` that are not an
|
|
168
|
+
object, or with no `params`, and `resources/read` with no `uri`, used to
|
|
169
|
+
come back as an internal error carrying the validator's raw issue list. They
|
|
170
|
+
now get the code JSON-RPC reserves for invalid parameters and one line that
|
|
171
|
+
names the field: `Invalid params for tools/call: params.name: …`. A client
|
|
172
|
+
that matched on `-32603` for these should match on `-32602`.
|
|
173
|
+
|
|
174
|
+
Unchanged: an unknown method is `-32601`; a well-formed call to a tool with
|
|
175
|
+
wrong arguments is a tool result with `isError: true`, not a protocol error.
|
|
176
|
+
|
|
177
|
+
#### Consumer Impact
|
|
178
|
+
- **A consumer that compares a whole response body with a stored one** — a
|
|
179
|
+
snapshot test, a cache keyed on the response text — sees every successful
|
|
180
|
+
response change, because of the added `provenance` field. Nothing is removed
|
|
181
|
+
or renamed, so a consumer that reads fields by name is unaffected.
|
|
182
|
+
|
|
7
183
|
## [0.2.1] - 2026-10-02
|
|
8
184
|
|
|
9
185
|
Tested against `circle-ir` **4.9.29** (range `4.9`), MCP SDK **^1.30.1** and the
|
package/README.md
CHANGED
|
@@ -76,6 +76,8 @@ The same stdio config is bundled in the [Cognium SAST plugin](../../plugins/cogn
|
|
|
76
76
|
| `describe_sink` | CWE, remediation, CVSS-like severity, and sanitizer list for a sink category. |
|
|
77
77
|
| `describe_source` | Every framework API pattern circle-ir treats as a source of a given category. |
|
|
78
78
|
| `find_similar` | Given a finding id, return other findings sharing the same `rule_id` and/or `sink_type`. |
|
|
79
|
+
| `find_callers` | Who calls a method, with a resolution tier on every answer and a reason on every site it could not resolve. Java. |
|
|
80
|
+
| `find_callees` | What a method calls, with the same tiers and reasons. Java. |
|
|
79
81
|
| `refresh` | Manually invalidate the cache for one project or every project. |
|
|
80
82
|
|
|
81
83
|
## Resources
|
|
@@ -95,6 +97,74 @@ The same stdio config is bundled in the [Cognium SAST plugin](../../plugins/cogn
|
|
|
95
97
|
3. Iterate over the highest-severity findings with `explain_finding` for CWE context.
|
|
96
98
|
4. `find_similar` to catch the same pattern elsewhere.
|
|
97
99
|
5. Before proposing a fix, `check_sanitizer` any proposed wrapper against the target sink type.
|
|
100
|
+
6. Before changing a method, `find_callers` on it to see what depends on it.
|
|
101
|
+
|
|
102
|
+
## Reading a navigation answer
|
|
103
|
+
|
|
104
|
+
`find_callers` and `find_callees` report a **tier** on every answer and a
|
|
105
|
+
**reason** on every call site they could not resolve, because a caller list is
|
|
106
|
+
only useful if you know whether it is complete.
|
|
107
|
+
|
|
108
|
+
| Tier | What it means |
|
|
109
|
+
| ---- | ------------- |
|
|
110
|
+
| `exact` | The receiver's static type was known and the target was unique in it. Act on these. |
|
|
111
|
+
| `polymorphic` | Dispatch is open. `candidates` lists every implementation that could run, and `target` is the declaring member. |
|
|
112
|
+
| `inferred` | Bound by the method name alone, with no receiver type to confirm it. **A lead to check, never a caller.** |
|
|
113
|
+
|
|
114
|
+
`inferred` is a floor and is never promoted. It is also never produced when a
|
|
115
|
+
receiver's type *is* known and lacks the method: on a 405-file Java
|
|
116
|
+
repository, 78 of 147 name-only "callers" of one method had a receiver whose
|
|
117
|
+
own declared type could not have had it, so that case is now no answer plus a
|
|
118
|
+
reason rather than a weak answer.
|
|
119
|
+
|
|
120
|
+
Every non-answer carries one of `external` (the target is outside the searched
|
|
121
|
+
tree — the JDK, a framework), `dynamic` (reflection), `generated` (the member
|
|
122
|
+
only exists after annotation processing, such as a Lombok accessor),
|
|
123
|
+
`parse-error`, `unsupported-language`, or `unknown` (in the tree, and the call
|
|
124
|
+
graph could not bind it). A large `external` count usually means the name is a
|
|
125
|
+
common one, not that the answer is poor.
|
|
126
|
+
|
|
127
|
+
`scope` states what was searched and what was skipped, so a count can be read
|
|
128
|
+
against its denominator, and `truncated` appears whenever a list was cut.
|
|
129
|
+
|
|
130
|
+
### What the tiers measure
|
|
131
|
+
|
|
132
|
+
The navigation tools resolve **Java**. A file in another language is reported
|
|
133
|
+
as `unsupported-language` and is not counted in `scope.searched`, so an answer
|
|
134
|
+
never implies a language was searched when it was not.
|
|
135
|
+
|
|
136
|
+
These numbers come from an independent evaluation against compiler-backed
|
|
137
|
+
ground truth — a sample of call sites in [WebGoat](https://github.com/WebGoat/WebGoat),
|
|
138
|
+
each site's callee resolved by the Eclipse JDT compiler, with a pinned
|
|
139
|
+
[ripgrep](https://github.com/BurntSushi/ripgrep) answering the same queries as
|
|
140
|
+
a baseline. Every figure carries its denominator, and the baseline is on the
|
|
141
|
+
same line so the comparison is visible rather than asserted.
|
|
142
|
+
|
|
143
|
+
| | this server | ripgrep baseline |
|
|
144
|
+
| --- | --- | --- |
|
|
145
|
+
| `exact` precision | **100 %** of 143 answers that landed on a resolved site | — (it claims no `exact`) |
|
|
146
|
+
| `inferred` precision | 26.7 % of 15 | 60.6 % of 711 |
|
|
147
|
+
| recall, all sampled sites | 34.0 % (159 of 467) | 92.3 % (431 of 467) |
|
|
148
|
+
| recall, targets declared in the repository | 79.6 % (148 of 186) | 93.5 % (174 of 186) |
|
|
149
|
+
|
|
150
|
+
Two of those rows need reading together rather than separately. **Recall over
|
|
151
|
+
all sampled sites is capped at 39.8 % for any tool that answers from an
|
|
152
|
+
index**, because only 186 of the 467 sampled sites have a target declared
|
|
153
|
+
inside the repository at all; the rest are in the JDK or a library. A text
|
|
154
|
+
search answers about a name wherever it is declared, so the two columns of
|
|
155
|
+
that row are answering different questions. The row below it — targets
|
|
156
|
+
declared in the repository — is the one where both columns answer the same
|
|
157
|
+
question.
|
|
158
|
+
|
|
159
|
+
**An `inferred` answer is not evidence that a call happens.** It is a method
|
|
160
|
+
name that matched with no receiver type to confirm it, and on this sample it
|
|
161
|
+
was right 26.7 % of the time. Treat it as a lead to check by opening the site,
|
|
162
|
+
never as a caller. That is why it is a separate tier rather than a weaker
|
|
163
|
+
`exact`: the label is the warning, and the tool will not promote it.
|
|
164
|
+
|
|
165
|
+
What `exact` is worth is the other half of the same point: of the 143 `exact`
|
|
166
|
+
answers that landed on a site the compiler had resolved, **143 named the
|
|
167
|
+
compiler's callee and none contradicted it.**
|
|
98
168
|
|
|
99
169
|
## Using it as a library
|
|
100
170
|
|
|
@@ -102,13 +172,26 @@ The package is side-effect free to import: nothing is built, read or connected
|
|
|
102
172
|
until you ask for it. The stdio binary is a separate file, so mounting the
|
|
103
173
|
server over your own transport does not spawn a subprocess.
|
|
104
174
|
|
|
175
|
+
Over HTTP, mount the handler. It is web-standard — a `Request` in, a `Response`
|
|
176
|
+
out — builds a fresh server per request, and serves both protocol eras:
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
import { createHandler } from '@cognium/mcp-server';
|
|
180
|
+
|
|
181
|
+
const handler = createHandler();
|
|
182
|
+
// Hono, Workers, Deno, Bun: hand it the request.
|
|
183
|
+
app.all('/mcp', (c) => handler.fetch(c.req.raw));
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
To inspect what the install loaded, or to connect a transport of your own:
|
|
187
|
+
|
|
105
188
|
```ts
|
|
106
189
|
import { createServer } from '@cognium/mcp-server';
|
|
107
190
|
|
|
108
191
|
// Floor plus whatever optional modules this install has.
|
|
109
192
|
const { server, discovery } = await createServer();
|
|
110
193
|
console.error(discovery.enablement.state); // 'floor' | 'extended' | 'commercial'
|
|
111
|
-
await server.connect(myTransport);
|
|
194
|
+
await server.connect(myTransport); // serves the 2025-era protocol only
|
|
112
195
|
```
|
|
113
196
|
|
|
114
197
|
`buildServer(options)` is the synchronous form: it registers exactly what you
|
|
@@ -162,6 +245,24 @@ written. No key is baked in yet, so tokens currently report `no-key`.
|
|
|
162
245
|
No telemetry, no phone-home, and no feature is locked behind a token: the state
|
|
163
246
|
decides what is *listed*, and the terms carry the grant.
|
|
164
247
|
|
|
248
|
+
## What a response and a tool tell you
|
|
249
|
+
|
|
250
|
+
- **`provenance`** is the last field of every successful response:
|
|
251
|
+
`"deterministic"` for all eleven built-in tools. A tool from an optional module
|
|
252
|
+
that used a model says `llm: <model>`.
|
|
253
|
+
- **Annotations** are declared on every tool in `tools/list`. Ten are
|
|
254
|
+
`readOnlyHint: true`; none reaches the network (`openWorldHint: false`) or
|
|
255
|
+
deletes anything (`destructiveHint: false`). `refresh` is not read-only: it
|
|
256
|
+
writes no file, but it clears the server's in-memory cache.
|
|
257
|
+
- **Errors.** A malformed request gets a JSON-RPC error: `-32602` for bad
|
|
258
|
+
parameters or a tool that does not exist, `-32601` for an unknown method. A
|
|
259
|
+
well-formed call a tool cannot serve — an unknown sink type, a missing path —
|
|
260
|
+
is a normal result with `isError: true` and a message that says what to do.
|
|
261
|
+
- **Protocol revisions.** The server speaks MCP 2026-07-28 and the 2025-era
|
|
262
|
+
revisions before it, from the same binary and the same HTTP handler. A client
|
|
263
|
+
that opens with `initialize` and one that opens with `server/discover` are
|
|
264
|
+
both served; nothing has to be configured.
|
|
265
|
+
|
|
165
266
|
## Development
|
|
166
267
|
|
|
167
268
|
```bash
|
package/dist/bin.js
CHANGED
|
@@ -14,16 +14,22 @@
|
|
|
14
14
|
* `--version` and the initial handshake do not pay the ~200 ms tree-sitter
|
|
15
15
|
* cost.
|
|
16
16
|
*/
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { serveStdio } from '@modelcontextprotocol/server/stdio';
|
|
18
|
+
import { buildServer, discoverModules } from './server.js';
|
|
19
19
|
import { startupLines } from './startup.js';
|
|
20
20
|
async function main() {
|
|
21
|
-
|
|
21
|
+
// Modules and the licence state are resolved once, before anything is
|
|
22
|
+
// served; every server the entry below builds reuses them.
|
|
23
|
+
const discovery = await discoverModules();
|
|
22
24
|
for (const line of startupLines(discovery)) {
|
|
23
25
|
process.stderr.write(`${line}\n`);
|
|
24
26
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
// `serveStdio` owns the transport and decides, from the client's opening
|
|
28
|
+
// message, which protocol era the connection speaks. A client that opens
|
|
29
|
+
// with `initialize` is served exactly as before; one that speaks the
|
|
30
|
+
// 2026-07-28 revision is served that. Either way it gets one server,
|
|
31
|
+
// built here, for the life of the connection.
|
|
32
|
+
serveStdio(() => buildServer({ modules: discovery.modules, enablement: discovery.enablement }));
|
|
27
33
|
}
|
|
28
34
|
main().catch((err) => {
|
|
29
35
|
// stderr is safe for stdio-transport servers (stdout is reserved for MCP
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,KAAK,UAAU,IAAI;IACjB,sEAAsE;IACtE,2DAA2D;IAC3D,MAAM,SAAS,GAAG,MAAM,eAAe,EAAE,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,yEAAyE;IACzE,yEAAyE;IACzE,qEAAqE;IACrE,qEAAqE;IACrE,8CAA8C;IAC9C,UAAU,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;AAClG,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,yEAAyE;IACzE,aAAa;IACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAiC,GAAa,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC,CAAC;IACtF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/cache.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* mtimes and re-run `analyzeProject` only if any file changed. LRU
|
|
7
7
|
* eviction keeps memory bounded when the LLM hops between projects.
|
|
8
8
|
*/
|
|
9
|
-
import { type ProjectAnalysis } from 'circle-ir';
|
|
9
|
+
import { type NavigationIndex, type ProjectAnalysis } from 'circle-ir';
|
|
10
10
|
/**
|
|
11
11
|
* Per-project analysis options that participate in the cache key. Two
|
|
12
12
|
* scans with different profiles / disabled passes must not share a cache
|
|
@@ -22,6 +22,7 @@ export interface ProjectScanOptions {
|
|
|
22
22
|
}
|
|
23
23
|
export declare class ProjectCache {
|
|
24
24
|
private entries;
|
|
25
|
+
private navEntries;
|
|
25
26
|
private readonly capacity;
|
|
26
27
|
constructor(capacity?: number);
|
|
27
28
|
private cacheKey;
|
|
@@ -36,6 +37,34 @@ export declare class ProjectCache {
|
|
|
36
37
|
analysisMs: number;
|
|
37
38
|
fileCount: number;
|
|
38
39
|
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Return a cached navigation index if fresh, else build one.
|
|
42
|
+
*
|
|
43
|
+
* Kept apart from `getOrCompute` on purpose, in both directions:
|
|
44
|
+
*
|
|
45
|
+
* - **It asks the engine for more.** The index needs `navigationTypes`,
|
|
46
|
+
* which makes a Java `record` visible and keeps a nested type's nesting.
|
|
47
|
+
* Sharing an entry with the scan tools would hand them type information
|
|
48
|
+
* they do not expect, so the two never share one.
|
|
49
|
+
* - **It asks the engine to do less.** Navigation needs per-file IR and
|
|
50
|
+
* nothing else, so this runs `analyze` per file rather than
|
|
51
|
+
* `analyzeProject`, skipping the cross-file taint phase entirely. On a
|
|
52
|
+
* large repository that phase is the expensive part, and a caller
|
|
53
|
+
* asking "who calls this method" should not pay for taint analysis it
|
|
54
|
+
* will not read.
|
|
55
|
+
*
|
|
56
|
+
* `parseMs` is the measured wall time of that loop, which is parsing **and**
|
|
57
|
+
* IR extraction — the two are one call and the server cannot separate them.
|
|
58
|
+
* It is handed to the index so `timing.parseMs` carries a real reading
|
|
59
|
+
* rather than a zero, and it over-reports pure parse time rather than
|
|
60
|
+
* guessing at it.
|
|
61
|
+
*/
|
|
62
|
+
getOrComputeNavigation(projectRoot: string, opts?: ProjectScanOptions): Promise<{
|
|
63
|
+
index: NavigationIndex;
|
|
64
|
+
cacheHit: boolean;
|
|
65
|
+
parseMs: number;
|
|
66
|
+
fileCount: number;
|
|
67
|
+
}>;
|
|
39
68
|
/** Invalidate one specific project (all option-keys) or one specific key. */
|
|
40
69
|
invalidate(projectRoot: string, opts?: ProjectScanOptions): number;
|
|
41
70
|
/** Invalidate every cached project. */
|
package/dist/cache.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,WAAW,CAAC;AAInB;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AA6BD,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,UAAU,CAAsC;IACxD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAElC,YAAY,QAAQ,SAAI,EAEvB;IAED,OAAO,CAAC,QAAQ;IAIhB;;;;OAIG;IACG,YAAY,CAChB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC;QAAE,QAAQ,EAAE,eAAe,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CA2ClG;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,sBAAsB,CAC1B,WAAW,EAAE,MAAM,EACnB,IAAI,GAAE,kBAAuB,GAC5B,OAAO,CAAC;QACT,KAAK,EAAE,eAAe,CAAC;QACvB,QAAQ,EAAE,OAAO,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC,CAwDD;IAED,6EAA6E;IAC7E,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAoBjE;IAED,uCAAuC;IACvC,KAAK,IAAI,MAAM,CAKd;IAED,IAAI,IAAI,MAAM,CAEb;IAED,OAAO,CAAC,QAAQ;CAejB"}
|
package/dist/cache.js
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* mtimes and re-run `analyzeProject` only if any file changed. LRU
|
|
7
7
|
* eviction keeps memory bounded when the LLM hops between projects.
|
|
8
8
|
*/
|
|
9
|
-
import { resolve } from 'path';
|
|
10
|
-
import { analyzeProject } from 'circle-ir';
|
|
11
|
-
import { collectFiles, indexMtimes, mtimesEqual } from './util/files.js';
|
|
9
|
+
import { relative, resolve } from 'path';
|
|
10
|
+
import { analyze, analyzeProject, buildNavigationIndex, } from 'circle-ir';
|
|
11
|
+
import { collectFiles, indexMtimes, mtimesEqual, SKIPPED_DIRECTORIES } from './util/files.js';
|
|
12
12
|
import { ensureAnalyzer } from './util/wasm.js';
|
|
13
13
|
function optionsKey(opts) {
|
|
14
14
|
const parts = [
|
|
@@ -20,6 +20,7 @@ function optionsKey(opts) {
|
|
|
20
20
|
}
|
|
21
21
|
export class ProjectCache {
|
|
22
22
|
entries = new Map();
|
|
23
|
+
navEntries = new Map();
|
|
23
24
|
capacity;
|
|
24
25
|
constructor(capacity = 3) {
|
|
25
26
|
this.capacity = capacity;
|
|
@@ -68,6 +69,80 @@ export class ProjectCache {
|
|
|
68
69
|
this.evictLRU();
|
|
69
70
|
return { analysis, cacheHit: false, analysisMs, fileCount: files.length };
|
|
70
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Return a cached navigation index if fresh, else build one.
|
|
74
|
+
*
|
|
75
|
+
* Kept apart from `getOrCompute` on purpose, in both directions:
|
|
76
|
+
*
|
|
77
|
+
* - **It asks the engine for more.** The index needs `navigationTypes`,
|
|
78
|
+
* which makes a Java `record` visible and keeps a nested type's nesting.
|
|
79
|
+
* Sharing an entry with the scan tools would hand them type information
|
|
80
|
+
* they do not expect, so the two never share one.
|
|
81
|
+
* - **It asks the engine to do less.** Navigation needs per-file IR and
|
|
82
|
+
* nothing else, so this runs `analyze` per file rather than
|
|
83
|
+
* `analyzeProject`, skipping the cross-file taint phase entirely. On a
|
|
84
|
+
* large repository that phase is the expensive part, and a caller
|
|
85
|
+
* asking "who calls this method" should not pay for taint analysis it
|
|
86
|
+
* will not read.
|
|
87
|
+
*
|
|
88
|
+
* `parseMs` is the measured wall time of that loop, which is parsing **and**
|
|
89
|
+
* IR extraction — the two are one call and the server cannot separate them.
|
|
90
|
+
* It is handed to the index so `timing.parseMs` carries a real reading
|
|
91
|
+
* rather than a zero, and it over-reports pure parse time rather than
|
|
92
|
+
* guessing at it.
|
|
93
|
+
*/
|
|
94
|
+
async getOrComputeNavigation(projectRoot, opts = {}) {
|
|
95
|
+
await ensureAnalyzer();
|
|
96
|
+
const absRoot = resolve(projectRoot);
|
|
97
|
+
const key = `${absRoot}::nav::${optionsKey(opts)}`;
|
|
98
|
+
const langOpt = opts.language;
|
|
99
|
+
const collectOpts = langOpt ? { language: langOpt } : {};
|
|
100
|
+
const currentMtimes = indexMtimes(absRoot, collectOpts);
|
|
101
|
+
const existing = this.navEntries.get(key);
|
|
102
|
+
if (existing && mtimesEqual(existing.mtimes, currentMtimes)) {
|
|
103
|
+
this.navEntries.delete(key);
|
|
104
|
+
this.navEntries.set(key, existing);
|
|
105
|
+
return {
|
|
106
|
+
index: existing.index,
|
|
107
|
+
cacheHit: true,
|
|
108
|
+
parseMs: existing.parseMs,
|
|
109
|
+
fileCount: existing.fileCount,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
const files = collectFiles(absRoot, collectOpts);
|
|
113
|
+
const t0 = Date.now();
|
|
114
|
+
const navFiles = [];
|
|
115
|
+
for (const f of files) {
|
|
116
|
+
navFiles.push({
|
|
117
|
+
// Paths are reported relative to the project root, so an answer does
|
|
118
|
+
// not leak the absolute layout of the machine it was produced on and
|
|
119
|
+
// two runs from different checkouts of the same commit agree.
|
|
120
|
+
path: relative(absRoot, f.filePath) || f.filePath,
|
|
121
|
+
language: f.language,
|
|
122
|
+
source: f.code,
|
|
123
|
+
ir: await analyze(f.code, f.filePath, f.language, { navigationTypes: true }),
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
const parseMs = Date.now() - t0;
|
|
127
|
+
const index = buildNavigationIndex(navFiles, {
|
|
128
|
+
parseMs,
|
|
129
|
+
cache: true,
|
|
130
|
+
excluded: SKIPPED_DIRECTORIES.map((d) => ({
|
|
131
|
+
pattern: `**/${d}/**`,
|
|
132
|
+
reason: 'not project source',
|
|
133
|
+
})),
|
|
134
|
+
});
|
|
135
|
+
this.navEntries.set(key, {
|
|
136
|
+
key,
|
|
137
|
+
index,
|
|
138
|
+
mtimes: currentMtimes,
|
|
139
|
+
computedAt: Date.now(),
|
|
140
|
+
parseMs,
|
|
141
|
+
fileCount: files.length,
|
|
142
|
+
});
|
|
143
|
+
this.evictLRU();
|
|
144
|
+
return { index, cacheHit: false, parseMs, fileCount: files.length };
|
|
145
|
+
}
|
|
71
146
|
/** Invalidate one specific project (all option-keys) or one specific key. */
|
|
72
147
|
invalidate(projectRoot, opts) {
|
|
73
148
|
const abs = resolve(projectRoot);
|
|
@@ -83,16 +158,23 @@ export class ProjectCache {
|
|
|
83
158
|
removed++;
|
|
84
159
|
}
|
|
85
160
|
}
|
|
161
|
+
for (const key of [...this.navEntries.keys()]) {
|
|
162
|
+
if (key.startsWith(abs + '::')) {
|
|
163
|
+
this.navEntries.delete(key);
|
|
164
|
+
removed++;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
86
167
|
return removed;
|
|
87
168
|
}
|
|
88
169
|
/** Invalidate every cached project. */
|
|
89
170
|
clear() {
|
|
90
|
-
const n = this.entries.size;
|
|
171
|
+
const n = this.entries.size + this.navEntries.size;
|
|
91
172
|
this.entries.clear();
|
|
173
|
+
this.navEntries.clear();
|
|
92
174
|
return n;
|
|
93
175
|
}
|
|
94
176
|
size() {
|
|
95
|
-
return this.entries.size;
|
|
177
|
+
return this.entries.size + this.navEntries.size;
|
|
96
178
|
}
|
|
97
179
|
evictLRU() {
|
|
98
180
|
while (this.entries.size > this.capacity) {
|
|
@@ -101,6 +183,15 @@ export class ProjectCache {
|
|
|
101
183
|
break;
|
|
102
184
|
this.entries.delete(oldestKey);
|
|
103
185
|
}
|
|
186
|
+
// Navigation indexes are evicted on their own budget: a project can hold
|
|
187
|
+
// one of each, and evicting a scan entry must not drop a navigation index
|
|
188
|
+
// the caller is still querying.
|
|
189
|
+
while (this.navEntries.size > this.capacity) {
|
|
190
|
+
const oldestKey = this.navEntries.keys().next().value;
|
|
191
|
+
if (oldestKey === undefined)
|
|
192
|
+
break;
|
|
193
|
+
this.navEntries.delete(oldestKey);
|
|
194
|
+
}
|
|
104
195
|
}
|
|
105
196
|
}
|
|
106
197
|
//# sourceMappingURL=cache.js.map
|
package/dist/cache.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EACL,OAAO,EACP,cAAc,EACd,oBAAoB,GAGrB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,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AI,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QACnD,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACxB,OAAO,CAAC,CAAC;IACX,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAClD,CAAC;IAEO,QAAQ;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;YACzC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;YACnD,IAAI,SAAS,KAAK,SAAS;gBAAE,MAAM;YACnC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QACD,yEAAyE;QACzE,0EAA0E;QAC1E,gCAAgC;QAChC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC5C,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;YACtD,IAAI,SAAS,KAAK,SAAS;gBAAE,MAAM;YACnC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* `createServer()` (floor plus whatever optional modules are installed) or
|
|
7
7
|
* `buildServer()` (exactly what it passes in). The stdio binary is `bin.ts`.
|
|
8
8
|
*/
|
|
9
|
-
export { buildServer, createServer, discoverModules, resetDiscoveryForTests, SERVER_NAME, SERVER_VERSION, type BuildServerOptions, type Discovery, } from './server.js';
|
|
9
|
+
export { buildServer, createServer, createHandler, discoverModules, resetDiscoveryForTests, SERVER_NAME, SERVER_VERSION, type BuildServerOptions, type Discovery, } from './server.js';
|
|
10
10
|
export { startupLines } from './startup.js';
|
|
11
11
|
export { loadModules, moduleSpecifiers, circleIrVersion, checkCircleIrRange, majorMinor, isToolModule, DEFAULT_MODULE_SPECIFIERS, ENV_MODULES, type ToolModule, type ModuleRefusal, type LoadModulesOptions, type LoadModulesResult, } from './modules.js';
|
|
12
12
|
export { computeEnablement, enablementForProcess, resetEnablementForTests, floorEnablement, configDir, ENV_ENDPOINT, ENV_LICENSE, ENV_LICENSE_PUBKEY, ENV_CONFIG_DIR, type Enablement, type LicenceState, } from './enablement.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,WAAW,EACX,cAAc,EACd,KAAK,kBAAkB,EACvB,KAAK,SAAS,GACf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,yBAAyB,EACzB,WAAW,EACX,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,GACvB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,SAAS,EACT,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,OAAO,EACP,KAAK,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MAAM,UAAU,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* `createServer()` (floor plus whatever optional modules are installed) or
|
|
7
7
|
* `buildServer()` (exactly what it passes in). The stdio binary is `bin.ts`.
|
|
8
8
|
*/
|
|
9
|
-
export { buildServer, createServer, discoverModules, resetDiscoveryForTests, SERVER_NAME, SERVER_VERSION, } from './server.js';
|
|
9
|
+
export { buildServer, createServer, createHandler, discoverModules, resetDiscoveryForTests, SERVER_NAME, SERVER_VERSION, } from './server.js';
|
|
10
10
|
export { startupLines } from './startup.js';
|
|
11
11
|
export { loadModules, moduleSpecifiers, circleIrVersion, checkCircleIrRange, majorMinor, isToolModule, DEFAULT_MODULE_SPECIFIERS, ENV_MODULES, } from './modules.js';
|
|
12
12
|
export { computeEnablement, enablementForProcess, resetEnablementForTests, floorEnablement, configDir, ENV_ENDPOINT, ENV_LICENSE, ENV_LICENSE_PUBKEY, ENV_CONFIG_DIR, } from './enablement.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,WAAW,EACX,cAAc,GAGf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,yBAAyB,EACzB,WAAW,GAKZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,SAAS,EACT,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,cAAc,GAGf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,OAAO,GAKR,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAElE,OAAO,EAAE,YAAY,EAA2B,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,WAAW,EACX,cAAc,GAGf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,yBAAyB,EACzB,WAAW,GAKZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,SAAS,EACT,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,cAAc,GAGf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,OAAO,GAKR,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAElE,OAAO,EAAE,YAAY,EAA2B,MAAM,YAAY,CAAC"}
|
package/dist/licence.js
CHANGED
|
@@ -192,7 +192,7 @@ export function verifyLicence(token, opts = {}) {
|
|
|
192
192
|
detail: `the verification key for key id "${payload.kid}" is unusable`,
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
|
-
let signatureOk
|
|
195
|
+
let signatureOk;
|
|
196
196
|
try {
|
|
197
197
|
// Over the canonical form of everything that arrived, not the segment's
|
|
198
198
|
// own bytes and not just the fields this version reads.
|