@mfdaves/okf-mcp 0.9.1 → 0.13.0-rc.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/CHANGELOG.md +100 -0
- package/README.md +452 -26
- package/bin/okf-mcp.js +6 -1
- package/okf/okf-mcp/distribution/reference-bundle.md +10 -3
- package/okf/okf-mcp/index.md +2 -1
- package/okf/okf-mcp/interfaces/http-authoring-api.md +11 -2
- package/okf/okf-mcp/interfaces/mcp-http.md +64 -0
- package/okf/okf-mcp/interfaces/mcp-tools.md +25 -6
- package/okf/okf-mcp/overview/okf-mcp.md +16 -6
- package/okf/okf-mcp/policies/authoring-safety.md +28 -5
- package/okf/okf-mcp/runtime/indexer.md +14 -1
- package/okf/okf-mcp/runtime/mcp-server.md +16 -8
- package/okf/okf-mcp/specs/producer-api.md +16 -2
- package/package.json +17 -5
- package/server.json +38 -2
- package/src/assets.js +165 -73
- package/src/authoring/candidates.js +434 -0
- package/src/authoring/git-preflight.js +225 -0
- package/src/authoring/git-publish.js +783 -0
- package/src/authoring/live.js +757 -0
- package/src/authoring/paths.js +112 -0
- package/src/authoring/policy-hook.js +221 -0
- package/src/authoring/proposal-policy.js +159 -0
- package/src/authoring/receipts.js +373 -0
- package/src/authoring/render.js +38 -0
- package/src/authoring/shared.js +75 -0
- package/src/authoring/staging.js +216 -0
- package/src/authoring.js +386 -287
- package/src/cache/files.js +147 -0
- package/src/cache/lock.js +201 -0
- package/src/cache/paths.js +197 -0
- package/src/cache/store.js +703 -0
- package/src/catalog-text.js +19 -0
- package/src/cli/commands.js +448 -0
- package/src/cli/http-options.js +193 -0
- package/src/cli/options.js +554 -0
- package/src/cli/usage.js +96 -0
- package/src/cli.js +18 -932
- package/src/computation.js +99 -61
- package/src/context/assemble.js +567 -0
- package/src/context/cli-options.js +88 -0
- package/src/context/score.js +234 -0
- package/src/context/sections.js +274 -0
- package/src/embed/interface.js +160 -0
- package/src/embed/openai.js +715 -0
- package/src/embed/prepare.js +182 -0
- package/src/embed/units.js +96 -0
- package/src/error-details.js +53 -0
- package/src/git-source.js +112 -52
- package/src/graph.js +95 -37
- package/src/http-server.js +36 -17
- package/src/index.js +15 -0
- package/src/indexer/assemble.js +566 -0
- package/src/indexer/build.js +290 -0
- package/src/indexer/cache.js +81 -0
- package/src/indexer/edges.js +430 -0
- package/src/indexer/index.js +44 -0
- package/src/indexer/paths.js +178 -0
- package/src/indexer/resolve.js +282 -0
- package/src/indexer/update.js +720 -0
- package/src/indexer.js +3 -1068
- package/src/live-authoring.js +4 -2329
- package/src/markdown.js +21 -16
- package/src/mcp/auth.js +409 -0
- package/src/mcp/http.js +317 -0
- package/src/mcp/principal.js +59 -0
- package/src/mcp/registry.js +356 -0
- package/src/mcp/resources.js +45 -0
- package/src/mcp/server.js +567 -0
- package/src/mcp/tools/catalog.js +247 -0
- package/src/mcp/tools/computation.js +83 -0
- package/src/mcp/tools/context.js +133 -0
- package/src/mcp/tools/graph.js +167 -0
- package/src/mcp/tools/live-authoring.js +316 -0
- package/src/mcp/tools/migration.js +86 -0
- package/src/mcp/tools/producers.js +79 -0
- package/src/mcp/tools/proposals.js +225 -0
- package/src/mcp/tools/provenance.js +87 -0
- package/src/mcp/tools/remote.js +79 -0
- package/src/mcp/tools/search.js +242 -0
- package/src/mcp-server.js +3 -1611
- package/src/migration.js +431 -253
- package/src/parser.js +245 -130
- package/src/plugins.js +71 -48
- package/src/policy/write-policy.js +713 -0
- package/src/producer-publisher.js +202 -78
- package/src/producers.js +311 -103
- package/src/project.js +346 -93
- package/src/remote.js +96 -61
- package/src/search/cli-options.js +107 -0
- package/src/search/confidence.js +61 -0
- package/src/search/dense.js +304 -0
- package/src/search/embedding-cli.js +57 -0
- package/src/search/embedding-config.js +217 -0
- package/src/search/fusion.js +249 -0
- package/src/search/hybrid.js +526 -0
- package/src/search/languages.js +200 -0
- package/src/search/lexical.js +695 -0
- package/src/search/query.js +620 -0
- package/src/search/stem/among.js +43 -0
- package/src/search/stem/base-stemmer.js +311 -0
- package/src/search/stem/en-regions.js +456 -0
- package/src/search/stem/en-suffixes.js +664 -0
- package/src/search/stem/en-tables.js +176 -0
- package/src/search/stem/en.js +238 -0
- package/src/search/stem/it-regions.js +459 -0
- package/src/search/stem/it-suffixes.js +471 -0
- package/src/search/stem/it-tables.js +257 -0
- package/src/search/stem/it.js +155 -0
- package/src/search-index.js +2 -81
- package/src/search.js +2 -252
- package/src/store.js +134 -81
- package/src/tool-packs.js +346 -0
- package/src/v02.js +301 -105
- package/src/validation.js +24 -20
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { proposalServiceFor } = require("../authoring/proposal-policy");
|
|
4
|
+
const { canWrite, principalWriteContext } = require("./principal");
|
|
5
|
+
|
|
6
|
+
class ToolExecutionError extends Error {
|
|
7
|
+
constructor(message, code, details) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.name = "ToolExecutionError";
|
|
10
|
+
if (typeof code === "string" && code) {
|
|
11
|
+
this.code = code;
|
|
12
|
+
}
|
|
13
|
+
if (details !== undefined) {
|
|
14
|
+
this.details = details;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const READ_ONLY = {
|
|
20
|
+
readOnlyHint: true,
|
|
21
|
+
destructiveHint: false,
|
|
22
|
+
idempotentHint: true,
|
|
23
|
+
openWorldHint: false,
|
|
24
|
+
};
|
|
25
|
+
const LOCAL_WRITE = {
|
|
26
|
+
readOnlyHint: false,
|
|
27
|
+
destructiveHint: false,
|
|
28
|
+
idempotentHint: false,
|
|
29
|
+
openWorldHint: false,
|
|
30
|
+
};
|
|
31
|
+
const DESTRUCTIVE_WRITE = {
|
|
32
|
+
readOnlyHint: false,
|
|
33
|
+
destructiveHint: true,
|
|
34
|
+
idempotentHint: false,
|
|
35
|
+
openWorldHint: false,
|
|
36
|
+
};
|
|
37
|
+
const REMOTE_LOAD = {
|
|
38
|
+
readOnlyHint: false,
|
|
39
|
+
destructiveHint: false,
|
|
40
|
+
idempotentHint: false,
|
|
41
|
+
openWorldHint: true,
|
|
42
|
+
};
|
|
43
|
+
const PRODUCER_PREVIEW = {
|
|
44
|
+
readOnlyHint: true,
|
|
45
|
+
destructiveHint: false,
|
|
46
|
+
idempotentHint: true,
|
|
47
|
+
openWorldHint: true,
|
|
48
|
+
};
|
|
49
|
+
const PRODUCER_RUN = {
|
|
50
|
+
readOnlyHint: false,
|
|
51
|
+
destructiveHint: true,
|
|
52
|
+
idempotentHint: false,
|
|
53
|
+
openWorldHint: true,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
function stringParameter(description, extra) {
|
|
57
|
+
return Object.assign({ type: "string", description }, extra || {});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function nonEmptyStringParameter(description, extra) {
|
|
61
|
+
return stringParameter(description, Object.assign({ minLength: 1 }, extra || {}));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function integerParameter(description, minimum, maximum, defaultValue) {
|
|
65
|
+
return {
|
|
66
|
+
type: "integer",
|
|
67
|
+
description,
|
|
68
|
+
minimum,
|
|
69
|
+
...(maximum === undefined ? {} : { maximum }),
|
|
70
|
+
default: defaultValue,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function booleanParameter(description) {
|
|
75
|
+
return { type: "boolean", description, default: false };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function optionalBooleanParameter(description) {
|
|
79
|
+
return { type: "boolean", description };
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function stringArrayParameter(description, options) {
|
|
83
|
+
const config = options || {};
|
|
84
|
+
return {
|
|
85
|
+
type: "array",
|
|
86
|
+
description,
|
|
87
|
+
items: Object.assign({ type: "string" }, config.nonEmptyItems ? { minLength: 1 } : {}),
|
|
88
|
+
...(config.minItems === undefined ? {} : { minItems: config.minItems }),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function objectParameter(description, extra) {
|
|
93
|
+
return Object.assign(
|
|
94
|
+
{
|
|
95
|
+
type: "object",
|
|
96
|
+
description,
|
|
97
|
+
additionalProperties: true,
|
|
98
|
+
},
|
|
99
|
+
extra || {},
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function detailParameter(description) {
|
|
104
|
+
return stringParameter(description, { enum: ["compact", "full"], default: "compact" });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function relationParameter(description) {
|
|
108
|
+
return {
|
|
109
|
+
type: "object",
|
|
110
|
+
description,
|
|
111
|
+
additionalProperties: false,
|
|
112
|
+
properties: {
|
|
113
|
+
type: nonEmptyStringParameter("Typed relation name."),
|
|
114
|
+
target: nonEmptyStringParameter("Relation target URI or bundle-local path."),
|
|
115
|
+
label: stringParameter("Optional human-readable relation label."),
|
|
116
|
+
description: stringParameter("Optional relation explanation."),
|
|
117
|
+
},
|
|
118
|
+
required: ["type", "target"],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function sourceParameter(description) {
|
|
123
|
+
return {
|
|
124
|
+
description,
|
|
125
|
+
anyOf: [
|
|
126
|
+
nonEmptyStringParameter("Source resource URI or bundle-local path."),
|
|
127
|
+
objectParameter("Structured OKF source entry."),
|
|
128
|
+
],
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function collectionPatchParameter(description, item) {
|
|
133
|
+
return {
|
|
134
|
+
type: "object",
|
|
135
|
+
description,
|
|
136
|
+
additionalProperties: false,
|
|
137
|
+
minProperties: 1,
|
|
138
|
+
properties: {
|
|
139
|
+
add: { type: "array", items: item },
|
|
140
|
+
remove: { type: "array", items: item },
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function defineTool(description, annotations, properties, required, schemaExtras, outputSchema) {
|
|
146
|
+
return {
|
|
147
|
+
description,
|
|
148
|
+
annotations,
|
|
149
|
+
inputSchema: {
|
|
150
|
+
type: "object",
|
|
151
|
+
additionalProperties: false,
|
|
152
|
+
properties: properties || {},
|
|
153
|
+
...(required?.length ? { required } : {}),
|
|
154
|
+
...(schemaExtras || {}),
|
|
155
|
+
},
|
|
156
|
+
...(outputSchema ? { outputSchema } : {}),
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Availability gates. A tool names one as its `enabled` predicate; tools/list
|
|
161
|
+
// advertises, and a call reaches, only the tools whose gate passes for the
|
|
162
|
+
// running server state and the principal the call runs for (plan I-2a).
|
|
163
|
+
const GATES = {
|
|
164
|
+
always: () => true,
|
|
165
|
+
// Listing and previewing producers run them with the server's own source
|
|
166
|
+
// credentials (an administrator key, for instance). Over stdio the
|
|
167
|
+
// process's one principal does so as before; over HTTP it needs okf.write.
|
|
168
|
+
producer: (state, principal) =>
|
|
169
|
+
Boolean(state?.producerService && (state.transport !== "http" || canWrite(principal))),
|
|
170
|
+
producerWrite: (state, principal) =>
|
|
171
|
+
Boolean(state?.producerService && state.allowWrite && state.actor && canWrite(principal)),
|
|
172
|
+
projectHelper: (state) => Boolean(state?.authoringService),
|
|
173
|
+
// Stored proposals can hold complete candidate Markdown, which the REST
|
|
174
|
+
// authoring API guards with its write token. Over stdio the process's one
|
|
175
|
+
// principal reads them as before; over HTTP the principal needs okf.write.
|
|
176
|
+
proposalRead: (state, principal) =>
|
|
177
|
+
Boolean(state?.authoringService && (state.transport !== "http" || canWrite(principal))),
|
|
178
|
+
authoringMutation: (state) => Boolean(state?.authoringService && state.allowAuthoring),
|
|
179
|
+
computationAuthoring: (state) =>
|
|
180
|
+
Boolean(state?.authoringService && state.allowAuthoring && state.allowComputationAuthoring),
|
|
181
|
+
liveWrite: (state, principal) =>
|
|
182
|
+
Boolean(state?.allowWrite && state.liveAuthoringService && canWrite(principal)),
|
|
183
|
+
// A runtime remote load changes the index every principal of the process
|
|
184
|
+
// reads. Over stdio the process has one principal, so --allow-remote-tool
|
|
185
|
+
// is enough; over HTTP the principal must also hold okf.write.
|
|
186
|
+
runtimeRemote: (state, principal) =>
|
|
187
|
+
Boolean(state?.allowRuntimeRemoteLoad && (state.transport !== "http" || canWrite(principal))),
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
function toolEnabled(tool, state, principal) {
|
|
191
|
+
return (tool.enabled || GATES.always)(state, principal);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Advertised tools/list order. It predates the split into area modules and is
|
|
195
|
+
// kept verbatim so clients that cache the listing see the same sequence;
|
|
196
|
+
// composition fails fast when a module and this list disagree.
|
|
197
|
+
const TOOL_ORDER = [
|
|
198
|
+
"list_bundles",
|
|
199
|
+
"list_concepts",
|
|
200
|
+
"get_concept",
|
|
201
|
+
"search_concepts",
|
|
202
|
+
"get_context",
|
|
203
|
+
"list_types",
|
|
204
|
+
"list_tags",
|
|
205
|
+
"list_relation_types",
|
|
206
|
+
"list_edge_kinds",
|
|
207
|
+
"get_provenance",
|
|
208
|
+
"inspect_attested_computation",
|
|
209
|
+
"read_bundle_asset",
|
|
210
|
+
"read_git_source",
|
|
211
|
+
"prepare_attested_computation",
|
|
212
|
+
"check_computation_receipt",
|
|
213
|
+
"check_v02_migration",
|
|
214
|
+
"load_remote_bundle",
|
|
215
|
+
"list_remote_bundles",
|
|
216
|
+
"okf_validate_concept",
|
|
217
|
+
"okf_suggest_concept_path",
|
|
218
|
+
"okf_propose_concept",
|
|
219
|
+
"okf_propose_update",
|
|
220
|
+
"okf_propose_attested_computation",
|
|
221
|
+
"okf_propose_v02_migration",
|
|
222
|
+
"okf_list_proposals",
|
|
223
|
+
"okf_get_proposal",
|
|
224
|
+
"okf_accept_proposal",
|
|
225
|
+
"okf_reject_proposal",
|
|
226
|
+
"okf_validate_changes",
|
|
227
|
+
"okf_apply_changes",
|
|
228
|
+
"okf_list_producers",
|
|
229
|
+
"okf_preview_producer",
|
|
230
|
+
"okf_run_producer",
|
|
231
|
+
"get_graph",
|
|
232
|
+
"get_neighbors",
|
|
233
|
+
"get_subgraph",
|
|
234
|
+
"find_paths",
|
|
235
|
+
"graph_summary",
|
|
236
|
+
"validate_bundle",
|
|
237
|
+
"validate_project",
|
|
238
|
+
"export_graph",
|
|
239
|
+
// Gated on a configured embedder (WP3c); appended so existing positions hold.
|
|
240
|
+
"embedding_status",
|
|
241
|
+
];
|
|
242
|
+
|
|
243
|
+
function composeRegistry(modules) {
|
|
244
|
+
const tools = {};
|
|
245
|
+
modules.forEach((module) => {
|
|
246
|
+
Object.keys(module.tools).forEach((name) => {
|
|
247
|
+
if (tools[name]) {
|
|
248
|
+
throw new Error(`Duplicate MCP tool definition: ${name}`);
|
|
249
|
+
}
|
|
250
|
+
if (typeof module.tools[name].handler !== "function") {
|
|
251
|
+
throw new Error(`MCP tool ${name} has no handler.`);
|
|
252
|
+
}
|
|
253
|
+
tools[name] = module.tools[name];
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
const missing = TOOL_ORDER.filter((name) => !tools[name]);
|
|
257
|
+
const unlisted = Object.keys(tools).filter((name) => !TOOL_ORDER.includes(name));
|
|
258
|
+
if (missing.length || unlisted.length) {
|
|
259
|
+
throw new Error(
|
|
260
|
+
`MCP tool registry mismatch: missing ${missing.join(", ") || "none"}; ` +
|
|
261
|
+
`unlisted ${unlisted.join(", ") || "none"}`,
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
return { names: TOOL_ORDER.slice(), tools };
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function jsonContent(value, options) {
|
|
268
|
+
const result = {
|
|
269
|
+
content: [
|
|
270
|
+
{
|
|
271
|
+
type: "text",
|
|
272
|
+
text: JSON.stringify(value, null, 2),
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
};
|
|
276
|
+
if (options?.structured) {
|
|
277
|
+
result.structuredContent = value;
|
|
278
|
+
}
|
|
279
|
+
if (options?.isError) {
|
|
280
|
+
result.isError = true;
|
|
281
|
+
}
|
|
282
|
+
return result;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
async function expectedToolOperation(operation, options) {
|
|
286
|
+
try {
|
|
287
|
+
return await operation();
|
|
288
|
+
} catch (error) {
|
|
289
|
+
if (error instanceof ToolExecutionError) {
|
|
290
|
+
throw error;
|
|
291
|
+
}
|
|
292
|
+
const programmingError =
|
|
293
|
+
error instanceof ReferenceError ||
|
|
294
|
+
error instanceof SyntaxError ||
|
|
295
|
+
error instanceof RangeError ||
|
|
296
|
+
(error instanceof TypeError && !options?.translateTypeError);
|
|
297
|
+
if (programmingError) {
|
|
298
|
+
throw error;
|
|
299
|
+
}
|
|
300
|
+
throw new ToolExecutionError(
|
|
301
|
+
error?.message ? error.message : String(error),
|
|
302
|
+
error?.code,
|
|
303
|
+
error?.details,
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// The proposal service a call uses: the configured one, acting for the
|
|
309
|
+
// principal's actor (proposedBy and policy verdicts name it).
|
|
310
|
+
function requireAuthoring(state, principal) {
|
|
311
|
+
if (!state.authoringService) {
|
|
312
|
+
throw new Error(
|
|
313
|
+
"OKF authoring is not configured. Start the server with --root or --project to enable writable concept proposals.",
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
return proposalServiceFor(state.authoringService, principal?.actor);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// The context a live write hands the authoring service: the server's remote
|
|
320
|
+
// snapshots plus the principal's actor and git author.
|
|
321
|
+
function writeContext(state, principal) {
|
|
322
|
+
return Object.assign(
|
|
323
|
+
{ additionalBundles: state.remoteBundles },
|
|
324
|
+
principalWriteContext(principal),
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
module.exports = {
|
|
329
|
+
DESTRUCTIVE_WRITE,
|
|
330
|
+
GATES,
|
|
331
|
+
LOCAL_WRITE,
|
|
332
|
+
PRODUCER_PREVIEW,
|
|
333
|
+
PRODUCER_RUN,
|
|
334
|
+
READ_ONLY,
|
|
335
|
+
REMOTE_LOAD,
|
|
336
|
+
TOOL_ORDER,
|
|
337
|
+
ToolExecutionError,
|
|
338
|
+
booleanParameter,
|
|
339
|
+
collectionPatchParameter,
|
|
340
|
+
composeRegistry,
|
|
341
|
+
defineTool,
|
|
342
|
+
detailParameter,
|
|
343
|
+
expectedToolOperation,
|
|
344
|
+
integerParameter,
|
|
345
|
+
jsonContent,
|
|
346
|
+
nonEmptyStringParameter,
|
|
347
|
+
objectParameter,
|
|
348
|
+
optionalBooleanParameter,
|
|
349
|
+
relationParameter,
|
|
350
|
+
requireAuthoring,
|
|
351
|
+
sourceParameter,
|
|
352
|
+
stringArrayParameter,
|
|
353
|
+
stringParameter,
|
|
354
|
+
toolEnabled,
|
|
355
|
+
writeContext,
|
|
356
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { ResourceNotFoundError } = require("@modelcontextprotocol/server");
|
|
4
|
+
|
|
5
|
+
function canonicalResourceUri(uri) {
|
|
6
|
+
try {
|
|
7
|
+
return new URL(uri).href;
|
|
8
|
+
} catch {
|
|
9
|
+
return uri;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function listResources(index) {
|
|
14
|
+
return {
|
|
15
|
+
resources: index.documents.map((doc) => ({
|
|
16
|
+
uri: canonicalResourceUri(doc.uri),
|
|
17
|
+
name: doc.title,
|
|
18
|
+
description: doc.description || `${doc.kind} ${doc.path}`,
|
|
19
|
+
mimeType: "text/markdown",
|
|
20
|
+
})),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function readResource(index, uri) {
|
|
25
|
+
const doc =
|
|
26
|
+
index.byUri.get(uri) ||
|
|
27
|
+
index.documents.find((candidate) => canonicalResourceUri(candidate.uri) === uri);
|
|
28
|
+
if (!doc) {
|
|
29
|
+
throw new ResourceNotFoundError(uri);
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
contents: [
|
|
33
|
+
{
|
|
34
|
+
uri: canonicalResourceUri(doc.uri),
|
|
35
|
+
mimeType: "text/markdown",
|
|
36
|
+
text: doc.text,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
module.exports = {
|
|
43
|
+
listResources,
|
|
44
|
+
readResource,
|
|
45
|
+
};
|