@descent-vtt/spec-guard 0.11.0 → 0.12.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 +354 -3
- package/README.md +377 -22
- package/dist/cites.d.ts +192 -0
- package/dist/cites.d.ts.map +1 -0
- package/dist/cites.js +599 -0
- package/dist/cites.js.map +1 -0
- package/dist/cli.d.ts +14 -6
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +315 -22
- package/dist/cli.js.map +1 -1
- package/dist/comments.d.ts +1 -1
- package/dist/comments.js +1 -1
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +46 -5
- package/dist/config.js.map +1 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +38 -14
- package/dist/engine.js.map +1 -1
- package/dist/glob.d.ts +128 -24
- package/dist/glob.d.ts.map +1 -1
- package/dist/glob.js +304 -61
- package/dist/glob.js.map +1 -1
- package/dist/impact.d.ts +179 -0
- package/dist/impact.d.ts.map +1 -0
- package/dist/impact.js +360 -0
- package/dist/impact.js.map +1 -0
- package/dist/index.d.ts +13 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp.d.ts +16 -75
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +198 -370
- package/dist/mcp.js.map +1 -1
- package/dist/overlay.d.ts +39 -0
- package/dist/overlay.d.ts.map +1 -0
- package/dist/overlay.js +133 -0
- package/dist/overlay.js.map +1 -0
- package/dist/parser.d.ts +41 -24
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +217 -160
- package/dist/parser.js.map +1 -1
- package/dist/prove.d.ts +46 -0
- package/dist/prove.d.ts.map +1 -0
- package/dist/prove.js +549 -0
- package/dist/prove.js.map +1 -0
- package/dist/query.d.ts +11 -0
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +9 -3
- package/dist/query.js.map +1 -1
- package/dist/reporter.d.ts +139 -1
- package/dist/reporter.d.ts.map +1 -1
- package/dist/reporter.js +593 -21
- package/dist/reporter.js.map +1 -1
- package/dist/rules.js +3 -3
- package/dist/rules.js.map +1 -1
- package/dist/runner.d.ts +24 -1
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +84 -21
- package/dist/runner.js.map +1 -1
- package/dist/specs.d.ts +5 -1
- package/dist/specs.d.ts.map +1 -1
- package/dist/specs.js +5 -1
- package/dist/specs.js.map +1 -1
- package/dist/structure.d.ts.map +1 -1
- package/dist/structure.js +7 -6
- package/dist/structure.js.map +1 -1
- package/dist/types.d.ts +193 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/vendor/spec-core/jsonrpc/index.d.ts +3 -0
- package/dist/vendor/spec-core/jsonrpc/index.d.ts.map +1 -0
- package/dist/vendor/spec-core/jsonrpc/index.js +2 -0
- package/dist/vendor/spec-core/jsonrpc/index.js.map +1 -0
- package/dist/vendor/spec-core/jsonrpc/mcp.d.ts +158 -0
- package/dist/vendor/spec-core/jsonrpc/mcp.d.ts.map +1 -0
- package/dist/vendor/spec-core/jsonrpc/mcp.js +353 -0
- package/dist/vendor/spec-core/jsonrpc/mcp.js.map +1 -0
- package/dist/vendor/spec-core/markdown/frontmatter.d.ts +104 -0
- package/dist/vendor/spec-core/markdown/frontmatter.d.ts.map +1 -0
- package/dist/vendor/spec-core/markdown/frontmatter.js +459 -0
- package/dist/vendor/spec-core/markdown/frontmatter.js.map +1 -0
- package/dist/vendor/spec-core/markdown/headings.d.ts +46 -0
- package/dist/vendor/spec-core/markdown/headings.d.ts.map +1 -0
- package/dist/vendor/spec-core/markdown/headings.js +199 -0
- package/dist/vendor/spec-core/markdown/headings.js.map +1 -0
- package/dist/vendor/spec-core/markdown/index.d.ts +6 -0
- package/dist/vendor/spec-core/markdown/index.d.ts.map +1 -0
- package/dist/vendor/spec-core/markdown/index.js +4 -0
- package/dist/vendor/spec-core/markdown/index.js.map +1 -0
- package/dist/vendor/spec-core/markdown/layout.d.ts +40 -0
- package/dist/vendor/spec-core/markdown/layout.d.ts.map +1 -0
- package/dist/vendor/spec-core/markdown/layout.js +28 -0
- package/dist/vendor/spec-core/markdown/layout.js.map +1 -0
- package/dist/vendor/spec-core/markdown/links.d.ts +23 -0
- package/dist/vendor/spec-core/markdown/links.d.ts.map +1 -0
- package/dist/vendor/spec-core/markdown/links.js +364 -0
- package/dist/vendor/spec-core/markdown/links.js.map +1 -0
- package/dist/vendor/spec-core/markdown/lists.d.ts +23 -0
- package/dist/vendor/spec-core/markdown/lists.d.ts.map +1 -0
- package/dist/vendor/spec-core/markdown/lists.js +127 -0
- package/dist/vendor/spec-core/markdown/lists.js.map +1 -0
- package/dist/vendor/spec-core/markdown/scan.d.ts +37 -0
- package/dist/vendor/spec-core/markdown/scan.d.ts.map +1 -0
- package/dist/vendor/spec-core/markdown/scan.js +439 -0
- package/dist/vendor/spec-core/markdown/scan.js.map +1 -0
- package/dist/vendor/spec-core/markdown/syntax.d.ts +76 -0
- package/dist/vendor/spec-core/markdown/syntax.d.ts.map +1 -0
- package/dist/vendor/spec-core/markdown/syntax.js +181 -0
- package/dist/vendor/spec-core/markdown/syntax.js.map +1 -0
- package/dist/vendor/spec-core/markdown/tables.d.ts +19 -0
- package/dist/vendor/spec-core/markdown/tables.d.ts.map +1 -0
- package/dist/vendor/spec-core/markdown/tables.js +86 -0
- package/dist/vendor/spec-core/markdown/tables.js.map +1 -0
- package/dist/vendor/spec-core/markdown/types.d.ts +288 -0
- package/dist/vendor/spec-core/markdown/types.d.ts.map +1 -0
- package/dist/vendor/spec-core/markdown/types.js +9 -0
- package/dist/vendor/spec-core/markdown/types.js.map +1 -0
- package/dist/vendor/spec-core/path/index.d.ts +2 -0
- package/dist/vendor/spec-core/path/index.d.ts.map +1 -0
- package/dist/vendor/spec-core/path/index.js +2 -0
- package/dist/vendor/spec-core/path/index.js.map +1 -0
- package/dist/vendor/spec-core/path/posix.d.ts +84 -0
- package/dist/vendor/spec-core/path/posix.d.ts.map +1 -0
- package/dist/vendor/spec-core/path/posix.js +150 -0
- package/dist/vendor/spec-core/path/posix.js.map +1 -0
- package/dist/vendor/spec-core/pattern/automaton.d.ts +130 -0
- package/dist/vendor/spec-core/pattern/automaton.d.ts.map +1 -0
- package/dist/vendor/spec-core/pattern/automaton.js +340 -0
- package/dist/vendor/spec-core/pattern/automaton.js.map +1 -0
- package/dist/vendor/spec-core/pattern/charset.d.ts +59 -0
- package/dist/vendor/spec-core/pattern/charset.d.ts.map +1 -0
- package/dist/vendor/spec-core/pattern/charset.js +116 -0
- package/dist/vendor/spec-core/pattern/charset.js.map +1 -0
- package/dist/vendor/spec-core/pattern/glob.d.ts +122 -0
- package/dist/vendor/spec-core/pattern/glob.d.ts.map +1 -0
- package/dist/vendor/spec-core/pattern/glob.js +481 -0
- package/dist/vendor/spec-core/pattern/glob.js.map +1 -0
- package/dist/vendor/spec-core/pattern/index.d.ts +7 -0
- package/dist/vendor/spec-core/pattern/index.d.ts.map +1 -0
- package/dist/vendor/spec-core/pattern/index.js +4 -0
- package/dist/vendor/spec-core/pattern/index.js.map +1 -0
- package/dist/vendor/spec-core/pattern/regex.d.ts +68 -0
- package/dist/vendor/spec-core/pattern/regex.d.ts.map +1 -0
- package/dist/vendor/spec-core/pattern/regex.js +813 -0
- package/dist/vendor/spec-core/pattern/regex.js.map +1 -0
- package/dist/vendor/spec-core/text/index.d.ts +3 -0
- package/dist/vendor/spec-core/text/index.d.ts.map +1 -0
- package/dist/vendor/spec-core/text/index.js +2 -0
- package/dist/vendor/spec-core/text/index.js.map +1 -0
- package/dist/vendor/spec-core/text/lines.d.ts +73 -0
- package/dist/vendor/spec-core/text/lines.d.ts.map +1 -0
- package/dist/vendor/spec-core/text/lines.js +156 -0
- package/dist/vendor/spec-core/text/lines.js.map +1 -0
- package/package.json +8 -1
- package/src/vendor/spec-core/LICENSE +21 -0
- package/src/vendor/spec-core/README.md +8 -0
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Model Context Protocol over JSON-RPC 2.0, without an SDK.
|
|
3
|
+
*
|
|
4
|
+
* MCP over stdio is JSON-RPC 2.0, one message per line, and what a server must
|
|
5
|
+
* get right fits here: framing, the two eras of the protocol, and the methods
|
|
6
|
+
* that serve tools, resources and prompts. The official SDK brings a schema
|
|
7
|
+
* library and a dependency tree to do the same; every spec-* tool promises no
|
|
8
|
+
* runtime dependencies. Moved here from spec-guard (its ADR-0012), where it
|
|
9
|
+
* was first written and measured, so that a second server does not relearn it.
|
|
10
|
+
*
|
|
11
|
+
* Two eras, served side by side. Revisions up to 2025-11-25 open with an
|
|
12
|
+
* `initialize` handshake; 2026-07-28 has none, and every request carries its
|
|
13
|
+
* protocol version in `_meta`. Clients of both are in use - the newest
|
|
14
|
+
* revision is not yet the one most clients speak - so each request is
|
|
15
|
+
* classified on its own, by the rule the TypeScript SDK's server applies: a
|
|
16
|
+
* request that claims a version in `_meta` is modern and its claim is
|
|
17
|
+
* validated; anything else, `initialize` included, is legacy.
|
|
18
|
+
*
|
|
19
|
+
* Nothing here touches a stream or a file. A server is a function from one
|
|
20
|
+
* parsed message to the message owed back; `serveLines` binds one to any
|
|
21
|
+
* source of bytes with `on('data')`, which on Node is `process.stdin`.
|
|
22
|
+
*/
|
|
23
|
+
/** Revisions that carry their version on every request. Newest first. */
|
|
24
|
+
export const MODERN_PROTOCOL_VERSIONS = ['2026-07-28'];
|
|
25
|
+
/** Revisions negotiated by `initialize`, newest first - the SDK's own list. */
|
|
26
|
+
export const LEGACY_PROTOCOL_VERSIONS = ['2025-11-25', '2025-06-18', '2025-03-26', '2024-11-05', '2024-10-07'];
|
|
27
|
+
export const PROTOCOL_VERSION_KEY = 'io.modelcontextprotocol/protocolVersion';
|
|
28
|
+
export const CLIENT_CAPABILITIES_KEY = 'io.modelcontextprotocol/clientCapabilities';
|
|
29
|
+
export const CLIENT_INFO_KEY = 'io.modelcontextprotocol/clientInfo';
|
|
30
|
+
export const SERVER_INFO_KEY = 'io.modelcontextprotocol/serverInfo';
|
|
31
|
+
export const PARSE_ERROR = -32700;
|
|
32
|
+
export const INVALID_REQUEST = -32600;
|
|
33
|
+
export const METHOD_NOT_FOUND = -32601;
|
|
34
|
+
export const INVALID_PARAMS = -32602;
|
|
35
|
+
export const INTERNAL_ERROR = -32603;
|
|
36
|
+
/** Resource not found before 2026-07-28, which forbids it in favour of -32602. */
|
|
37
|
+
export const LEGACY_RESOURCE_NOT_FOUND = -32002;
|
|
38
|
+
export const UNSUPPORTED_PROTOCOL_VERSION = -32022;
|
|
39
|
+
/** An error that becomes a JSON-RPC error response with its code. */
|
|
40
|
+
export class ProtocolError extends Error {
|
|
41
|
+
code;
|
|
42
|
+
data;
|
|
43
|
+
constructor(code, message, data) {
|
|
44
|
+
super(message);
|
|
45
|
+
this.name = 'ProtocolError';
|
|
46
|
+
this.code = code;
|
|
47
|
+
this.data = data;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export function isObject(value) {
|
|
51
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
52
|
+
}
|
|
53
|
+
/** JSON-RPC allows a null id; MCP does not, and wants an integer if a number. */
|
|
54
|
+
export function isRequestId(value) {
|
|
55
|
+
return typeof value === 'string' || Number.isInteger(value);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* What is wrong with a request's `_meta` once it claims a protocol version,
|
|
59
|
+
* or `undefined`. A claim is never ignored: a malformed one is an error, not
|
|
60
|
+
* a reason to fall back to the legacy handling.
|
|
61
|
+
*/
|
|
62
|
+
export function envelopeIssue(meta) {
|
|
63
|
+
if (!(CLIENT_CAPABILITIES_KEY in meta))
|
|
64
|
+
return `${CLIENT_CAPABILITIES_KEY}: missing`;
|
|
65
|
+
if (typeof meta[PROTOCOL_VERSION_KEY] !== 'string')
|
|
66
|
+
return `${PROTOCOL_VERSION_KEY}: expected a string`;
|
|
67
|
+
if (!isObject(meta[CLIENT_CAPABILITIES_KEY]))
|
|
68
|
+
return `${CLIENT_CAPABILITIES_KEY}: expected an object`;
|
|
69
|
+
const info = meta[CLIENT_INFO_KEY];
|
|
70
|
+
if (info !== undefined && !(isObject(info) && typeof info['name'] === 'string' && typeof info['version'] === 'string')) {
|
|
71
|
+
return `${CLIENT_INFO_KEY}: expected an object with a string name and version`;
|
|
72
|
+
}
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The era a request belongs to, or the error that answers it instead.
|
|
77
|
+
*
|
|
78
|
+
* `initialize` is the legacy handshake unless it carries a valid modern claim.
|
|
79
|
+
* Any other request is modern exactly when `_meta` holds the version key - its
|
|
80
|
+
* presence is the claim, whatever its value - and legacy otherwise.
|
|
81
|
+
*/
|
|
82
|
+
export function classifyRequest(method, params) {
|
|
83
|
+
const meta = params?.['_meta'];
|
|
84
|
+
const claimed = isObject(meta) && PROTOCOL_VERSION_KEY in meta;
|
|
85
|
+
if (!claimed)
|
|
86
|
+
return 'legacy';
|
|
87
|
+
const issue = envelopeIssue(meta);
|
|
88
|
+
const version = meta[PROTOCOL_VERSION_KEY];
|
|
89
|
+
const supported = issue === undefined && MODERN_PROTOCOL_VERSIONS.includes(version);
|
|
90
|
+
if (method === 'initialize' && !supported)
|
|
91
|
+
return 'legacy';
|
|
92
|
+
if (issue !== undefined)
|
|
93
|
+
throw new ProtocolError(INVALID_PARAMS, `Invalid _meta envelope: ${issue}`);
|
|
94
|
+
if (!supported) {
|
|
95
|
+
throw new ProtocolError(UNSUPPORTED_PROTOCOL_VERSION, 'Unsupported protocol version', {
|
|
96
|
+
supported: [...MODERN_PROTOCOL_VERSIONS],
|
|
97
|
+
requested: version,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return 'modern';
|
|
101
|
+
}
|
|
102
|
+
/** The version `initialize` settles on: the one asked for, or the newest legacy one. */
|
|
103
|
+
export function negotiateLegacyVersion(requested) {
|
|
104
|
+
return LEGACY_PROTOCOL_VERSIONS.includes(requested) ? requested : LEGACY_PROTOCOL_VERSIONS[0];
|
|
105
|
+
}
|
|
106
|
+
/** A tool's failure, reported to the model rather than as a protocol error it cannot read. */
|
|
107
|
+
export function toolError(text) {
|
|
108
|
+
return { text, isError: true };
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Arguments a tool does not declare, which the model should hear about rather
|
|
112
|
+
* than have silently dropped. `undefined` when there are none.
|
|
113
|
+
*/
|
|
114
|
+
export function unknownArguments(args, allowed) {
|
|
115
|
+
const unknown = Object.keys(args).filter((name) => !allowed.includes(name));
|
|
116
|
+
if (unknown.length === 0)
|
|
117
|
+
return undefined;
|
|
118
|
+
const list = unknown.map((name) => `"${name}"`).join(', ');
|
|
119
|
+
const takes = allowed.length === 0
|
|
120
|
+
? 'no arguments'
|
|
121
|
+
: allowed.length === 1
|
|
122
|
+
? allowed[0]
|
|
123
|
+
: `${allowed.slice(0, -1).join(', ')} and ${allowed[allowed.length - 1]}`;
|
|
124
|
+
return toolError(`Unknown argument${unknown.length === 1 ? '' : 's'} ${list}; this tool takes ${takes}.`);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Builds the function that answers one parsed JSON-RPC message: the message
|
|
128
|
+
* to send back, or `null` when nothing is owed - a notification, or a
|
|
129
|
+
* response the client should not have sent.
|
|
130
|
+
*/
|
|
131
|
+
export function createMcpServer(definition) {
|
|
132
|
+
const serverInfo = { name: definition.name, version: definition.version };
|
|
133
|
+
const tools = definition.tools ?? [];
|
|
134
|
+
const prompts = definition.prompts ?? [];
|
|
135
|
+
const capabilities = {
|
|
136
|
+
...(tools.length > 0 ? { tools: {} } : {}),
|
|
137
|
+
...(definition.resources !== undefined ? { resources: {} } : {}),
|
|
138
|
+
...(prompts.length > 0 ? { prompts: {} } : {}),
|
|
139
|
+
};
|
|
140
|
+
const refuseCursor = (params) => {
|
|
141
|
+
if (params?.['cursor'] !== undefined)
|
|
142
|
+
throw new ProtocolError(INVALID_PARAMS, 'Invalid cursor: this server does not paginate.');
|
|
143
|
+
};
|
|
144
|
+
const callTool = async (params) => {
|
|
145
|
+
const name = params['name'];
|
|
146
|
+
if (typeof name !== 'string')
|
|
147
|
+
throw new ProtocolError(INVALID_PARAMS, 'tools/call needs the name of a tool.');
|
|
148
|
+
const tool = tools.find((candidate) => candidate.descriptor.name === name);
|
|
149
|
+
if (tool === undefined)
|
|
150
|
+
throw new ProtocolError(INVALID_PARAMS, `Unknown tool: ${name}`);
|
|
151
|
+
const args = params['arguments'] ?? {};
|
|
152
|
+
if (!isObject(args))
|
|
153
|
+
throw new ProtocolError(INVALID_PARAMS, 'Tool arguments must be an object.');
|
|
154
|
+
let outcome;
|
|
155
|
+
try {
|
|
156
|
+
outcome = await tool.call(args);
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
outcome = toolError(`${definition.name} failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
content: [{ type: 'text', text: outcome.text }],
|
|
163
|
+
...(outcome.structured === undefined ? {} : { structuredContent: outcome.structured }),
|
|
164
|
+
...(outcome.isError === true ? { isError: true } : {}),
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
const readResource = async (params, era) => {
|
|
168
|
+
const uri = params['uri'];
|
|
169
|
+
if (typeof uri !== 'string')
|
|
170
|
+
throw new ProtocolError(INVALID_PARAMS, 'resources/read needs a uri.');
|
|
171
|
+
const contents = await definition.resources.read(uri);
|
|
172
|
+
if (contents === null) {
|
|
173
|
+
throw new ProtocolError(era === 'modern' ? INVALID_PARAMS : LEGACY_RESOURCE_NOT_FOUND, 'Resource not found', { uri });
|
|
174
|
+
}
|
|
175
|
+
return { contents: [...contents] };
|
|
176
|
+
};
|
|
177
|
+
const getPrompt = async (params) => {
|
|
178
|
+
const name = params['name'];
|
|
179
|
+
if (typeof name !== 'string')
|
|
180
|
+
throw new ProtocolError(INVALID_PARAMS, 'prompts/get needs the name of a prompt.');
|
|
181
|
+
const prompt = prompts.find((candidate) => candidate.descriptor.name === name);
|
|
182
|
+
if (prompt === undefined)
|
|
183
|
+
throw new ProtocolError(INVALID_PARAMS, `Unknown prompt: ${name}`);
|
|
184
|
+
const args = params['arguments'] ?? {};
|
|
185
|
+
if (!isObject(args) || !Object.values(args).every((value) => typeof value === 'string')) {
|
|
186
|
+
throw new ProtocolError(INVALID_PARAMS, 'Prompt arguments must be an object of strings.');
|
|
187
|
+
}
|
|
188
|
+
return prompt.get(args);
|
|
189
|
+
};
|
|
190
|
+
const dispatch = async (method, params, era) => {
|
|
191
|
+
const given = params ?? {};
|
|
192
|
+
if (era === 'legacy') {
|
|
193
|
+
if (method === 'initialize') {
|
|
194
|
+
return {
|
|
195
|
+
protocolVersion: negotiateLegacyVersion(given['protocolVersion']),
|
|
196
|
+
capabilities,
|
|
197
|
+
serverInfo,
|
|
198
|
+
instructions: definition.instructions,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
if (method === 'ping')
|
|
202
|
+
return {};
|
|
203
|
+
}
|
|
204
|
+
else if (method === 'server/discover') {
|
|
205
|
+
return { supportedVersions: [...MODERN_PROTOCOL_VERSIONS], capabilities, instructions: definition.instructions };
|
|
206
|
+
}
|
|
207
|
+
// A method for a capability the server did not declare does not exist on
|
|
208
|
+
// it: the answer is the one for any unknown method, not an empty list that
|
|
209
|
+
// reads as "declared, and empty".
|
|
210
|
+
const family = method.slice(0, method.indexOf('/') + 1);
|
|
211
|
+
if ((family === 'tools/' && tools.length === 0) ||
|
|
212
|
+
(family === 'resources/' && definition.resources === undefined) ||
|
|
213
|
+
(family === 'prompts/' && prompts.length === 0)) {
|
|
214
|
+
throw new ProtocolError(METHOD_NOT_FOUND, 'Method not found');
|
|
215
|
+
}
|
|
216
|
+
switch (method) {
|
|
217
|
+
case 'tools/list':
|
|
218
|
+
refuseCursor(params);
|
|
219
|
+
return { tools: tools.map((tool) => tool.descriptor) };
|
|
220
|
+
case 'tools/call':
|
|
221
|
+
return callTool(given);
|
|
222
|
+
case 'resources/list':
|
|
223
|
+
refuseCursor(params);
|
|
224
|
+
return { resources: [...(await definition.resources.list())] };
|
|
225
|
+
case 'resources/templates/list':
|
|
226
|
+
refuseCursor(params);
|
|
227
|
+
return { resourceTemplates: [...(definition.resources.templates ?? [])] };
|
|
228
|
+
case 'resources/read':
|
|
229
|
+
return readResource(given, era);
|
|
230
|
+
case 'prompts/list':
|
|
231
|
+
refuseCursor(params);
|
|
232
|
+
return { prompts: prompts.map((prompt) => prompt.descriptor) };
|
|
233
|
+
case 'prompts/get':
|
|
234
|
+
return getPrompt(given);
|
|
235
|
+
default:
|
|
236
|
+
throw new ProtocolError(METHOD_NOT_FOUND, 'Method not found');
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
/** The 2026-07-28 shape: a result type, caching hints where required, and identity. */
|
|
240
|
+
const modernResult = (method, result) => {
|
|
241
|
+
const cacheable = method !== 'tools/call';
|
|
242
|
+
return {
|
|
243
|
+
resultType: 'complete',
|
|
244
|
+
...result,
|
|
245
|
+
...(cacheable ? { ttlMs: definition.cacheTtlMs ?? 0, cacheScope: 'private' } : {}),
|
|
246
|
+
_meta: { [SERVER_INFO_KEY]: serverInfo },
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
return async (message) => {
|
|
250
|
+
if (!isObject(message)) {
|
|
251
|
+
return {
|
|
252
|
+
jsonrpc: '2.0',
|
|
253
|
+
error: {
|
|
254
|
+
code: INVALID_REQUEST,
|
|
255
|
+
message: Array.isArray(message) ? 'Invalid Request: batches are not supported' : 'Invalid Request',
|
|
256
|
+
},
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
const { id, method, params } = message;
|
|
260
|
+
if (message['jsonrpc'] === '2.0' && method === undefined && isRequestId(id) && ('result' in message || 'error' in message)) {
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
if (message['jsonrpc'] !== '2.0' || typeof method !== 'string' || (id !== undefined && !isRequestId(id))) {
|
|
264
|
+
return { jsonrpc: '2.0', ...(isRequestId(id) ? { id } : {}), error: { code: INVALID_REQUEST, message: 'Invalid Request' } };
|
|
265
|
+
}
|
|
266
|
+
if (id === undefined)
|
|
267
|
+
return null;
|
|
268
|
+
try {
|
|
269
|
+
if (params !== undefined && !isObject(params))
|
|
270
|
+
throw new ProtocolError(INVALID_PARAMS, 'params must be an object.');
|
|
271
|
+
const era = classifyRequest(method, params);
|
|
272
|
+
const result = await dispatch(method, params, era);
|
|
273
|
+
return { jsonrpc: '2.0', id, result: era === 'modern' ? modernResult(method, result) : result };
|
|
274
|
+
}
|
|
275
|
+
catch (error) {
|
|
276
|
+
const failure = error instanceof ProtocolError
|
|
277
|
+
? { code: error.code, message: error.message, data: error.data }
|
|
278
|
+
: { code: INTERNAL_ERROR, message: `Internal error: ${error instanceof Error ? error.message : String(error)}` };
|
|
279
|
+
return { jsonrpc: '2.0', id, error: failure };
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
/** The key a request is tracked under: `1` and `"1"` are different ids. */
|
|
284
|
+
function trackingKey(id) {
|
|
285
|
+
return `${typeof id}:${id}`;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Serves a handler over newline-delimited JSON-RPC until the input ends.
|
|
289
|
+
*
|
|
290
|
+
* Messages are split on `\n`; a CRLF line keeps its `\r`, which JSON reads
|
|
291
|
+
* as whitespace. Blank lines are skipped, and every response is written as a
|
|
292
|
+
* single line - `JSON.stringify` never emits a raw newline, which is what the
|
|
293
|
+
* binding requires. Requests are answered concurrently, in whatever order
|
|
294
|
+
* they finish. A request the client cancels gets no response. When the input
|
|
295
|
+
* closes, requests still running finish and then this resolves.
|
|
296
|
+
*/
|
|
297
|
+
export function serveLines(input, write, handle) {
|
|
298
|
+
return new Promise((resolve, reject) => {
|
|
299
|
+
const decoder = new TextDecoder();
|
|
300
|
+
let buffer = '';
|
|
301
|
+
let running = 0;
|
|
302
|
+
let ended = false;
|
|
303
|
+
const inFlight = new Set();
|
|
304
|
+
const cancelled = new Set();
|
|
305
|
+
const settle = () => {
|
|
306
|
+
if (ended && running === 0)
|
|
307
|
+
resolve();
|
|
308
|
+
};
|
|
309
|
+
const receive = (line) => {
|
|
310
|
+
if (line.trim() === '')
|
|
311
|
+
return;
|
|
312
|
+
let message;
|
|
313
|
+
try {
|
|
314
|
+
message = JSON.parse(line);
|
|
315
|
+
}
|
|
316
|
+
catch {
|
|
317
|
+
write(JSON.stringify({ jsonrpc: '2.0', error: { code: PARSE_ERROR, message: 'Parse error' } }));
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
if (isObject(message) && message['method'] === 'notifications/cancelled') {
|
|
321
|
+
const requestId = isObject(message['params']) ? message['params']['requestId'] : undefined;
|
|
322
|
+
if (isRequestId(requestId) && inFlight.has(trackingKey(requestId)))
|
|
323
|
+
cancelled.add(trackingKey(requestId));
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
const key = isObject(message) && typeof message['method'] === 'string' ? trackingKey(message['id']) : undefined;
|
|
327
|
+
inFlight.add(key);
|
|
328
|
+
running += 1;
|
|
329
|
+
void handle(message).then((response) => {
|
|
330
|
+
running -= 1;
|
|
331
|
+
inFlight.delete(key);
|
|
332
|
+
if (!cancelled.delete(key) && response !== null)
|
|
333
|
+
write(JSON.stringify(response));
|
|
334
|
+
settle();
|
|
335
|
+
});
|
|
336
|
+
};
|
|
337
|
+
input.on('data', (chunk) => {
|
|
338
|
+
buffer += decoder.decode(chunk, { stream: true });
|
|
339
|
+
for (let newline = buffer.indexOf('\n'); newline !== -1; newline = buffer.indexOf('\n')) {
|
|
340
|
+
const line = buffer.slice(0, newline);
|
|
341
|
+
buffer = buffer.slice(newline + 1);
|
|
342
|
+
receive(line);
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
input.once('end', () => {
|
|
346
|
+
ended = true;
|
|
347
|
+
receive(buffer + decoder.decode());
|
|
348
|
+
settle();
|
|
349
|
+
});
|
|
350
|
+
input.once('error', reject);
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
//# sourceMappingURL=mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../../src/vendor/spec-core/jsonrpc/mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,yEAAyE;AACzE,MAAM,CAAC,MAAM,wBAAwB,GAAsB,CAAC,YAAY,CAAC,CAAC;AAE1E,+EAA+E;AAC/E,MAAM,CAAC,MAAM,wBAAwB,GAAsB,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AAElI,MAAM,CAAC,MAAM,oBAAoB,GAAG,yCAAyC,CAAC;AAC9E,MAAM,CAAC,MAAM,uBAAuB,GAAG,4CAA4C,CAAC;AACpF,MAAM,CAAC,MAAM,eAAe,GAAG,oCAAoC,CAAC;AACpE,MAAM,CAAC,MAAM,eAAe,GAAG,oCAAoC,CAAC;AAEpE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAK,CAAC;AAClC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAK,CAAC;AACtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC;AACvC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAK,CAAC;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAK,CAAC;AACrC,kFAAkF;AAClF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,KAAK,CAAC;AAChD,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAK,CAAC;AAiBnD,qEAAqE;AACrE,MAAM,OAAO,aAAc,SAAQ,KAAK;IAC7B,IAAI,CAAS;IACb,IAAI,CAAU;IACvB,YAAY,IAAY,EAAE,OAAe,EAAE,IAAc;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,C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,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,QAAQ,KAAK,IAAI;oBAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACjF,MAAM,EAAE,CAAC;YACX,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAiB,EAAE,EAAE;YACrC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;YAClD,KAAK,IAAI,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxF,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;gBACtC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;gBACnC,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC;QACH,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE;YACrB,KAAK,GAAG,IAAI,CAAC;YACb,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;YACnC,MAAM,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A reader and editor for the front matter the spec-* tools use: a flat bag
|
|
3
|
+
* of YAML scalars and lists, and optionally one level of nested mapping.
|
|
4
|
+
*
|
|
5
|
+
* Supported: `key: value` lines; plain, single-quoted and double-quoted
|
|
6
|
+
* scalars; inline `[a, b]` sequences; block `- item` sequences; `#` comments.
|
|
7
|
+
* Plain scalars follow the YAML 1.2 core schema, so `yes` is a word and `035`
|
|
8
|
+
* keeps its leading zero for whoever reads it as text. With `nested`, a key
|
|
9
|
+
* whose value is an indented block of keys is read as `parent.child` entries.
|
|
10
|
+
*
|
|
11
|
+
* Anything richer - deeper nesting, block scalars, anchors, tags, a value
|
|
12
|
+
* continued onto the next line - is recognised and reported as unsupported
|
|
13
|
+
* rather than guessed at. A YAML library would parse more, but it would not
|
|
14
|
+
* give back the line and the offset of every value, and a report has to point
|
|
15
|
+
* at the value it is about, and an edit has to leave every other line of the
|
|
16
|
+
* file as it was.
|
|
17
|
+
*/
|
|
18
|
+
import type { FrontMatterKind } from './types.js';
|
|
19
|
+
export interface YamlScalar {
|
|
20
|
+
readonly text: string;
|
|
21
|
+
readonly quoted: boolean;
|
|
22
|
+
}
|
|
23
|
+
export type YamlValue = {
|
|
24
|
+
readonly kind: 'scalar';
|
|
25
|
+
readonly scalar: YamlScalar;
|
|
26
|
+
} | {
|
|
27
|
+
readonly kind: 'list';
|
|
28
|
+
readonly items: readonly YamlScalar[];
|
|
29
|
+
} | {
|
|
30
|
+
readonly kind: 'unsupported';
|
|
31
|
+
readonly reason: string;
|
|
32
|
+
};
|
|
33
|
+
export interface FrontMatterEntry {
|
|
34
|
+
/** The key as written; a nested key is its parent's and its own, joined by a dot. */
|
|
35
|
+
readonly key: string;
|
|
36
|
+
/** The key compared: {@link keyName} of `key`, so `depends-on` is `dependsOn`. */
|
|
37
|
+
readonly name: string;
|
|
38
|
+
/** The parent key as written, for a nested key; `null` at the top level. */
|
|
39
|
+
readonly parent: string | null;
|
|
40
|
+
/** 0-based line of the key. */
|
|
41
|
+
readonly line: number;
|
|
42
|
+
/** 0-based line after the entry's last line. */
|
|
43
|
+
readonly end: number;
|
|
44
|
+
/** Offset of the key in the text read. */
|
|
45
|
+
readonly keyStart: number;
|
|
46
|
+
/**
|
|
47
|
+
* Offsets of the value as written: a quoted scalar with its quotes, an
|
|
48
|
+
* inline list with its brackets, a block list from its first item's text to
|
|
49
|
+
* its last item's. An empty value is the empty range just past the colon.
|
|
50
|
+
*/
|
|
51
|
+
readonly valueStart: number;
|
|
52
|
+
readonly valueEnd: number;
|
|
53
|
+
readonly value: YamlValue;
|
|
54
|
+
}
|
|
55
|
+
export interface FrontMatterProblem {
|
|
56
|
+
/** 0-based line. */
|
|
57
|
+
readonly line: number;
|
|
58
|
+
readonly message: string;
|
|
59
|
+
}
|
|
60
|
+
export interface FrontMatter {
|
|
61
|
+
readonly kind: FrontMatterKind;
|
|
62
|
+
/** 0-based line of the closing delimiter, or -1 when the block is never closed. */
|
|
63
|
+
readonly close: number;
|
|
64
|
+
readonly entries: readonly FrontMatterEntry[];
|
|
65
|
+
readonly problems: readonly FrontMatterProblem[];
|
|
66
|
+
}
|
|
67
|
+
export interface ReadOptions {
|
|
68
|
+
/**
|
|
69
|
+
* Read one level of nested mapping as `parent.child` entries, instead of
|
|
70
|
+
* reporting the parent's value as unsupported.
|
|
71
|
+
*/
|
|
72
|
+
readonly nested?: boolean;
|
|
73
|
+
}
|
|
74
|
+
/** The kind of front matter a document's first line opens, or `null` when it opens none. */
|
|
75
|
+
export declare function frontMatterKind(firstLine: string): FrontMatterKind | null;
|
|
76
|
+
/** Whether a line closes front matter of a kind: `---` or `...` for YAML, `+++` for TOML. */
|
|
77
|
+
export declare function frontMatterCloses(line: string, kind: FrontMatterKind): boolean;
|
|
78
|
+
export declare function keyName(key: string): string;
|
|
79
|
+
/**
|
|
80
|
+
* Reads the front matter at the top of a text, or `null` when there is none.
|
|
81
|
+
*
|
|
82
|
+
* A leading byte-order mark is not part of the text read: offsets count from
|
|
83
|
+
* the character after it, as a scan's do.
|
|
84
|
+
*/
|
|
85
|
+
export declare function readFrontMatter(source: string, options?: ReadOptions): FrontMatter | null;
|
|
86
|
+
/** Parses a value written on the key's own line. `text` is trimmed and non-empty. */
|
|
87
|
+
export declare function parseInline(text: string): YamlValue;
|
|
88
|
+
/** Null in the YAML 1.2 core schema: empty, `~` or `null` in any of its three spellings. */
|
|
89
|
+
export declare function isNull(scalar: YamlScalar): boolean;
|
|
90
|
+
/** Renders a string as a scalar that reads back as the same string. */
|
|
91
|
+
export declare function renderScalar(value: string): string;
|
|
92
|
+
export declare function findEntry(frontMatter: FrontMatter | null, key: string): FrontMatterEntry | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* Sets one key, leaving every other line as it was.
|
|
95
|
+
*
|
|
96
|
+
* `lines` are the lines of the text the front matter was read from, as
|
|
97
|
+
* `splitLines` gives them. An existing entry keeps the spelling and the
|
|
98
|
+
* indentation of its key; a new one goes last, at the top level. A text with
|
|
99
|
+
* no front matter gains a block.
|
|
100
|
+
*/
|
|
101
|
+
export declare function setEntry(lines: readonly string[], frontMatter: FrontMatter | null, key: string, rendered: string): string[];
|
|
102
|
+
/** Removes one key and its value lines; a key that is absent changes nothing. */
|
|
103
|
+
export declare function removeEntry(lines: readonly string[], frontMatter: FrontMatter | null, key: string): string[];
|
|
104
|
+
//# sourceMappingURL=frontmatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../../../../src/vendor/spec-core/markdown/frontmatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,MAAM,SAAS,GACjB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;CAAE,GACxD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE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