@dxos/introspect-mcp 0.10.0 → 0.11.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/dist/lib/chunk-tools.mjs +412 -0
- package/dist/lib/chunk-tools.mjs.map +1 -0
- package/dist/lib/index.mjs +231 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/tools.mjs +2 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/dist/lib/node-esm/chunk-KIWCWIXA.mjs +0 -444
- package/dist/lib/node-esm/chunk-KIWCWIXA.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -270
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/tools/index.mjs +0 -34
- package/dist/lib/node-esm/tools/index.mjs.map +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/introspect-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "MCP server exposing DXOS monorepo introspection.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
".": {
|
|
16
16
|
"source": "./src/index.ts",
|
|
17
17
|
"types": "./dist/types/src/index.d.ts",
|
|
18
|
-
"
|
|
18
|
+
"import": "./dist/lib/index.mjs"
|
|
19
19
|
},
|
|
20
20
|
"./tools": {
|
|
21
21
|
"source": "./src/tools/index.ts",
|
|
22
22
|
"types": "./dist/types/src/tools/index.d.ts",
|
|
23
|
-
"
|
|
23
|
+
"import": "./dist/lib/tools.mjs"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"bin": {
|
|
@@ -35,17 +35,17 @@
|
|
|
35
35
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
36
36
|
"effect": "3.21.4",
|
|
37
37
|
"zod": "^4.0.0",
|
|
38
|
-
"@dxos/effect-zod": "0.
|
|
39
|
-
"@dxos/introspect": "0.
|
|
40
|
-
"@dxos/introspect-tools": "0.
|
|
41
|
-
"@dxos/log": "0.
|
|
42
|
-
"@dxos/util": "0.
|
|
38
|
+
"@dxos/effect-zod": "0.11.0",
|
|
39
|
+
"@dxos/introspect": "0.11.0",
|
|
40
|
+
"@dxos/introspect-tools": "0.11.0",
|
|
41
|
+
"@dxos/log": "0.11.0",
|
|
42
|
+
"@dxos/util": "0.11.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "22.10.2",
|
|
46
46
|
"tsx": "^4.21.0",
|
|
47
47
|
"typescript": "^6.0.3",
|
|
48
|
-
"vitest": "4.1.
|
|
48
|
+
"vitest": "4.1.10"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
@@ -1,444 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/tools/tools.ts
|
|
4
|
-
import { TOOL_METADATA } from "@dxos/introspect-tools";
|
|
5
|
-
|
|
6
|
-
// src/tools/shaping.ts
|
|
7
|
-
import { DEFAULT_LIST_LIMIT, MAX_LIST_LIMIT } from "@dxos/introspect-tools";
|
|
8
|
-
var SOURCE_PREVIEW = 1200;
|
|
9
|
-
var JSDOC_PREVIEW = 600;
|
|
10
|
-
var shapeList = (all, opts, config) => {
|
|
11
|
-
const requested = opts.limit ?? DEFAULT_LIST_LIMIT;
|
|
12
|
-
const limit = Math.min(Math.max(0, Math.floor(requested)), MAX_LIST_LIMIT);
|
|
13
|
-
const project = opts.compact ? config.compact : config.full;
|
|
14
|
-
const data = all.slice(0, limit).map(project);
|
|
15
|
-
if (all.length > limit) {
|
|
16
|
-
return {
|
|
17
|
-
data,
|
|
18
|
-
truncated: `${all.length - limit} more results \u2014 ${config.truncationHint}`
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
data
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
var shapeListPackages = (all, opts = {}) => shapeList(all, opts, {
|
|
26
|
-
full: (p) => ({
|
|
27
|
-
name: p.name,
|
|
28
|
-
version: p.version,
|
|
29
|
-
private: p.private,
|
|
30
|
-
path: p.path,
|
|
31
|
-
description: p.description
|
|
32
|
-
}),
|
|
33
|
-
compact: (p) => ({
|
|
34
|
-
name: p.name,
|
|
35
|
-
path: p.path
|
|
36
|
-
}),
|
|
37
|
-
truncationHint: "raise `limit` (max 200), refine with `name`/`pathPrefix`, or call get_package directly."
|
|
38
|
-
});
|
|
39
|
-
var shapeGetPackage = (detail) => ({
|
|
40
|
-
data: {
|
|
41
|
-
name: detail.name,
|
|
42
|
-
version: detail.version,
|
|
43
|
-
private: detail.private,
|
|
44
|
-
path: detail.path,
|
|
45
|
-
description: detail.description,
|
|
46
|
-
workspaceDependencies: detail.workspaceDependencies,
|
|
47
|
-
externalDependencies: detail.externalDependencies,
|
|
48
|
-
entryPoints: detail.entryPoints,
|
|
49
|
-
// Surfaced so callers can decide whether to call find_symbol against this package.
|
|
50
|
-
exportCount: detail.exportCount
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
var shapeFindSymbol = (matches, opts = {}) => shapeList(matches, opts, {
|
|
54
|
-
full: (m) => ({
|
|
55
|
-
ref: m.ref,
|
|
56
|
-
name: m.name,
|
|
57
|
-
package: m.package,
|
|
58
|
-
kind: m.kind,
|
|
59
|
-
summary: m.summary
|
|
60
|
-
}),
|
|
61
|
-
compact: (m) => ({
|
|
62
|
-
ref: m.ref,
|
|
63
|
-
name: m.name
|
|
64
|
-
}),
|
|
65
|
-
truncationHint: "raise `limit` (max 200), refine the query, or filter by `kind`."
|
|
66
|
-
});
|
|
67
|
-
var shapeGetSymbol = (detail) => {
|
|
68
|
-
const result = {
|
|
69
|
-
ref: detail.ref,
|
|
70
|
-
package: detail.package,
|
|
71
|
-
name: detail.name,
|
|
72
|
-
kind: detail.kind,
|
|
73
|
-
signature: detail.signature,
|
|
74
|
-
summary: detail.summary,
|
|
75
|
-
location: detail.location
|
|
76
|
-
};
|
|
77
|
-
if (detail.jsdoc) {
|
|
78
|
-
result.jsdoc = truncate(detail.jsdoc, JSDOC_PREVIEW);
|
|
79
|
-
}
|
|
80
|
-
if (detail.source !== void 0) {
|
|
81
|
-
result.source = truncate(detail.source, SOURCE_PREVIEW);
|
|
82
|
-
}
|
|
83
|
-
return {
|
|
84
|
-
data: result
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
var truncate = (s, limit) => {
|
|
88
|
-
if (s.length <= limit) {
|
|
89
|
-
return s;
|
|
90
|
-
}
|
|
91
|
-
return `${s.slice(0, limit)}
|
|
92
|
-
... (truncated, ${s.length - limit} more chars)`;
|
|
93
|
-
};
|
|
94
|
-
var shapeListPlugins = (all, opts = {}) => shapeList(all, opts, {
|
|
95
|
-
full: (p) => ({
|
|
96
|
-
id: p.id,
|
|
97
|
-
package: p.package,
|
|
98
|
-
name: p.name,
|
|
99
|
-
description: p.description,
|
|
100
|
-
icon: p.icon,
|
|
101
|
-
iconHue: p.iconHue,
|
|
102
|
-
tags: p.tags,
|
|
103
|
-
dependsOn: p.dependsOn
|
|
104
|
-
}),
|
|
105
|
-
compact: (p) => ({
|
|
106
|
-
id: p.id,
|
|
107
|
-
name: p.name
|
|
108
|
-
}),
|
|
109
|
-
truncationHint: "raise `limit` (max 200) or filter with `id` substring."
|
|
110
|
-
});
|
|
111
|
-
var shapePluginDetail = (detail) => ({
|
|
112
|
-
data: {
|
|
113
|
-
id: detail.id,
|
|
114
|
-
package: detail.package,
|
|
115
|
-
name: detail.name,
|
|
116
|
-
description: detail.description,
|
|
117
|
-
icon: detail.icon,
|
|
118
|
-
iconHue: detail.iconHue,
|
|
119
|
-
tags: detail.tags,
|
|
120
|
-
dependsOn: detail.dependsOn,
|
|
121
|
-
metaLocation: detail.metaLocation,
|
|
122
|
-
surfaces: detail.surfaces.map((s) => ({
|
|
123
|
-
id: s.id,
|
|
124
|
-
role: s.role
|
|
125
|
-
})),
|
|
126
|
-
capabilities: detail.capabilities.map((c) => ({
|
|
127
|
-
type: c.type
|
|
128
|
-
})),
|
|
129
|
-
operations: detail.operations.map((o) => ({
|
|
130
|
-
type: o.type
|
|
131
|
-
})),
|
|
132
|
-
schemas: detail.schemas.map((s) => ({
|
|
133
|
-
name: s.name,
|
|
134
|
-
typename: s.typename
|
|
135
|
-
}))
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
var shapeListSurfaces = (all, opts = {}) => shapeList(all, opts, {
|
|
139
|
-
full: (s) => ({
|
|
140
|
-
pluginId: s.pluginId,
|
|
141
|
-
id: s.id,
|
|
142
|
-
role: s.role,
|
|
143
|
-
location: s.location
|
|
144
|
-
}),
|
|
145
|
-
compact: (s) => ({
|
|
146
|
-
pluginId: s.pluginId,
|
|
147
|
-
id: s.id
|
|
148
|
-
}),
|
|
149
|
-
truncationHint: "raise `limit` (max 200) or filter by plugin `id`."
|
|
150
|
-
});
|
|
151
|
-
var shapeListCapabilities = (all, opts = {}) => shapeList(all, opts, {
|
|
152
|
-
full: (c) => ({
|
|
153
|
-
pluginId: c.pluginId,
|
|
154
|
-
type: c.type,
|
|
155
|
-
location: c.location
|
|
156
|
-
}),
|
|
157
|
-
compact: (c) => ({
|
|
158
|
-
pluginId: c.pluginId,
|
|
159
|
-
type: c.type
|
|
160
|
-
}),
|
|
161
|
-
truncationHint: "raise `limit` (max 200) or filter by plugin `id`."
|
|
162
|
-
});
|
|
163
|
-
var shapeListOperations = (all, opts = {}) => shapeList(all, opts, {
|
|
164
|
-
full: (o) => ({
|
|
165
|
-
pluginId: o.pluginId,
|
|
166
|
-
type: o.type,
|
|
167
|
-
location: o.location
|
|
168
|
-
}),
|
|
169
|
-
compact: (o) => ({
|
|
170
|
-
pluginId: o.pluginId,
|
|
171
|
-
type: o.type
|
|
172
|
-
}),
|
|
173
|
-
truncationHint: "raise `limit` (max 200) or filter by plugin `id`."
|
|
174
|
-
});
|
|
175
|
-
var shapeListSchemas = (all, opts = {}) => shapeList(all, opts, {
|
|
176
|
-
full: (s) => ({
|
|
177
|
-
pluginId: s.pluginId,
|
|
178
|
-
name: s.name,
|
|
179
|
-
typename: s.typename,
|
|
180
|
-
location: s.location
|
|
181
|
-
}),
|
|
182
|
-
compact: (s) => ({
|
|
183
|
-
pluginId: s.pluginId,
|
|
184
|
-
name: s.name,
|
|
185
|
-
typename: s.typename
|
|
186
|
-
}),
|
|
187
|
-
truncationHint: "raise `limit` (max 200) or filter by plugin `id`."
|
|
188
|
-
});
|
|
189
|
-
var shapeListIdioms = (all, opts = {}) => shapeList(all, opts, {
|
|
190
|
-
full: (idiom) => ({
|
|
191
|
-
slug: idiom.slug,
|
|
192
|
-
summary: idiom.summary,
|
|
193
|
-
applies: idiom.applies,
|
|
194
|
-
insteadOf: idiom.insteadOf,
|
|
195
|
-
uses: idiom.uses,
|
|
196
|
-
related: idiom.related,
|
|
197
|
-
host: {
|
|
198
|
-
file: idiom.host.file,
|
|
199
|
-
line: idiom.host.line,
|
|
200
|
-
symbol: idiom.host.symbol,
|
|
201
|
-
kind: idiom.host.kind
|
|
202
|
-
}
|
|
203
|
-
}),
|
|
204
|
-
compact: (idiom) => ({
|
|
205
|
-
slug: idiom.slug,
|
|
206
|
-
kind: idiom.host.kind,
|
|
207
|
-
file: idiom.host.file,
|
|
208
|
-
symbol: idiom.host.symbol
|
|
209
|
-
}),
|
|
210
|
-
truncationHint: "raise `limit` (max 200), refine with `slug`, or filter by `hostKind`."
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
// src/tools/tools.ts
|
|
214
|
-
var pickListOptions = (args) => ({
|
|
215
|
-
limit: args.limit,
|
|
216
|
-
compact: args.compact
|
|
217
|
-
});
|
|
218
|
-
var createToolDefinitions = (introspector, log) => ({
|
|
219
|
-
list_packages: {
|
|
220
|
-
...TOOL_METADATA.list_packages,
|
|
221
|
-
handler: (args) => {
|
|
222
|
-
const result = introspector.listPackages({
|
|
223
|
-
name: args.name,
|
|
224
|
-
pathPrefix: args.pathPrefix,
|
|
225
|
-
privateOnly: args.privateOnly
|
|
226
|
-
});
|
|
227
|
-
const shaped = shapeListPackages(result, pickListOptions(args));
|
|
228
|
-
log({
|
|
229
|
-
tool: "list_packages",
|
|
230
|
-
args,
|
|
231
|
-
count: result.length,
|
|
232
|
-
truncated: shaped.truncated
|
|
233
|
-
});
|
|
234
|
-
return shaped;
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
get_package: {
|
|
238
|
-
...TOOL_METADATA.get_package,
|
|
239
|
-
handler: (args) => {
|
|
240
|
-
const detail = introspector.getPackage(args.name);
|
|
241
|
-
log({
|
|
242
|
-
tool: "get_package",
|
|
243
|
-
args,
|
|
244
|
-
found: detail !== null
|
|
245
|
-
});
|
|
246
|
-
if (!detail) {
|
|
247
|
-
return {
|
|
248
|
-
data: null,
|
|
249
|
-
note: `No package named ${args.name}`
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
return shapeGetPackage(detail);
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
list_symbols: {
|
|
256
|
-
...TOOL_METADATA.list_symbols,
|
|
257
|
-
handler: (args) => {
|
|
258
|
-
const matches = introspector.listSymbols(args.package, args.kind);
|
|
259
|
-
const shaped = shapeFindSymbol(matches, pickListOptions(args));
|
|
260
|
-
log({
|
|
261
|
-
tool: "list_symbols",
|
|
262
|
-
args,
|
|
263
|
-
count: matches.length,
|
|
264
|
-
truncated: shaped.truncated
|
|
265
|
-
});
|
|
266
|
-
return shaped;
|
|
267
|
-
}
|
|
268
|
-
},
|
|
269
|
-
find_symbol: {
|
|
270
|
-
...TOOL_METADATA.find_symbol,
|
|
271
|
-
handler: (args) => {
|
|
272
|
-
const matches = introspector.findSymbol(args.query, args.kind);
|
|
273
|
-
const shaped = shapeFindSymbol(matches, pickListOptions(args));
|
|
274
|
-
log({
|
|
275
|
-
tool: "find_symbol",
|
|
276
|
-
args,
|
|
277
|
-
count: matches.length,
|
|
278
|
-
truncated: shaped.truncated
|
|
279
|
-
});
|
|
280
|
-
return shaped;
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
get_symbol: {
|
|
284
|
-
...TOOL_METADATA.get_symbol,
|
|
285
|
-
handler: (args) => {
|
|
286
|
-
const detail = introspector.getSymbol(args.ref, args.include);
|
|
287
|
-
log({
|
|
288
|
-
tool: "get_symbol",
|
|
289
|
-
args,
|
|
290
|
-
found: detail !== null
|
|
291
|
-
});
|
|
292
|
-
if (!detail) {
|
|
293
|
-
return {
|
|
294
|
-
data: null,
|
|
295
|
-
note: `No symbol with ref ${args.ref}`
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
return shapeGetSymbol(detail);
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
|
-
list_plugins: {
|
|
302
|
-
...TOOL_METADATA.list_plugins,
|
|
303
|
-
handler: (args) => {
|
|
304
|
-
const result = introspector.listPlugins(args.id !== void 0 ? {
|
|
305
|
-
id: args.id
|
|
306
|
-
} : void 0);
|
|
307
|
-
const shaped = shapeListPlugins(result, pickListOptions(args));
|
|
308
|
-
log({
|
|
309
|
-
tool: "list_plugins",
|
|
310
|
-
args,
|
|
311
|
-
count: result.length,
|
|
312
|
-
truncated: shaped.truncated
|
|
313
|
-
});
|
|
314
|
-
return shaped;
|
|
315
|
-
}
|
|
316
|
-
},
|
|
317
|
-
list_surfaces: {
|
|
318
|
-
...TOOL_METADATA.list_surfaces,
|
|
319
|
-
handler: (args) => {
|
|
320
|
-
const result = introspector.listSurfaces(args.id);
|
|
321
|
-
const shaped = shapeListSurfaces(result, pickListOptions(args));
|
|
322
|
-
log({
|
|
323
|
-
tool: "list_surfaces",
|
|
324
|
-
args,
|
|
325
|
-
count: result.length,
|
|
326
|
-
truncated: shaped.truncated
|
|
327
|
-
});
|
|
328
|
-
return shaped;
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
list_capabilities: {
|
|
332
|
-
...TOOL_METADATA.list_capabilities,
|
|
333
|
-
handler: (args) => {
|
|
334
|
-
const result = introspector.listCapabilities(args.id);
|
|
335
|
-
const shaped = shapeListCapabilities(result, pickListOptions(args));
|
|
336
|
-
log({
|
|
337
|
-
tool: "list_capabilities",
|
|
338
|
-
args,
|
|
339
|
-
count: result.length,
|
|
340
|
-
truncated: shaped.truncated
|
|
341
|
-
});
|
|
342
|
-
return shaped;
|
|
343
|
-
}
|
|
344
|
-
},
|
|
345
|
-
list_operations: {
|
|
346
|
-
...TOOL_METADATA.list_operations,
|
|
347
|
-
handler: (args) => {
|
|
348
|
-
const result = introspector.listOperations(args.id);
|
|
349
|
-
const shaped = shapeListOperations(result, pickListOptions(args));
|
|
350
|
-
log({
|
|
351
|
-
tool: "list_operations",
|
|
352
|
-
args,
|
|
353
|
-
count: result.length,
|
|
354
|
-
truncated: shaped.truncated
|
|
355
|
-
});
|
|
356
|
-
return shaped;
|
|
357
|
-
}
|
|
358
|
-
},
|
|
359
|
-
list_schemas: {
|
|
360
|
-
...TOOL_METADATA.list_schemas,
|
|
361
|
-
handler: (args) => {
|
|
362
|
-
const result = introspector.listSchemas(args.id);
|
|
363
|
-
const shaped = shapeListSchemas(result, pickListOptions(args));
|
|
364
|
-
log({
|
|
365
|
-
tool: "list_schemas",
|
|
366
|
-
args,
|
|
367
|
-
count: result.length,
|
|
368
|
-
truncated: shaped.truncated
|
|
369
|
-
});
|
|
370
|
-
return shaped;
|
|
371
|
-
}
|
|
372
|
-
},
|
|
373
|
-
list_idioms: {
|
|
374
|
-
...TOOL_METADATA.list_idioms,
|
|
375
|
-
handler: (args) => {
|
|
376
|
-
const result = introspector.listIdioms({
|
|
377
|
-
slug: args.slug,
|
|
378
|
-
hostKind: args.hostKind
|
|
379
|
-
});
|
|
380
|
-
const shaped = shapeListIdioms(result, pickListOptions(args));
|
|
381
|
-
log({
|
|
382
|
-
tool: "list_idioms",
|
|
383
|
-
args,
|
|
384
|
-
count: result.length,
|
|
385
|
-
truncated: shaped.truncated
|
|
386
|
-
});
|
|
387
|
-
return shaped;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
|
|
392
|
-
// src/tools/logger.ts
|
|
393
|
-
import { appendFile, mkdir } from "node:fs/promises";
|
|
394
|
-
import { dirname } from "node:path";
|
|
395
|
-
var noopLogger = () => {
|
|
396
|
-
};
|
|
397
|
-
var registerLogger = (inner) => {
|
|
398
|
-
if (!inner) {
|
|
399
|
-
return noopLogger;
|
|
400
|
-
}
|
|
401
|
-
return (entry) => {
|
|
402
|
-
try {
|
|
403
|
-
inner(entry);
|
|
404
|
-
} catch {
|
|
405
|
-
}
|
|
406
|
-
};
|
|
407
|
-
};
|
|
408
|
-
var fileLogger = (path) => {
|
|
409
|
-
let ensured = false;
|
|
410
|
-
return (entry) => {
|
|
411
|
-
const line = `${JSON.stringify({
|
|
412
|
-
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
413
|
-
...entry
|
|
414
|
-
})}
|
|
415
|
-
`;
|
|
416
|
-
void (async () => {
|
|
417
|
-
if (!ensured) {
|
|
418
|
-
await mkdir(dirname(path), {
|
|
419
|
-
recursive: true
|
|
420
|
-
});
|
|
421
|
-
ensured = true;
|
|
422
|
-
}
|
|
423
|
-
await appendFile(path, line, "utf8");
|
|
424
|
-
})().catch(() => void 0);
|
|
425
|
-
};
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
export {
|
|
429
|
-
shapeListPackages,
|
|
430
|
-
shapeGetPackage,
|
|
431
|
-
shapeFindSymbol,
|
|
432
|
-
shapeGetSymbol,
|
|
433
|
-
shapeListPlugins,
|
|
434
|
-
shapePluginDetail,
|
|
435
|
-
shapeListSurfaces,
|
|
436
|
-
shapeListCapabilities,
|
|
437
|
-
shapeListOperations,
|
|
438
|
-
shapeListSchemas,
|
|
439
|
-
createToolDefinitions,
|
|
440
|
-
noopLogger,
|
|
441
|
-
registerLogger,
|
|
442
|
-
fileLogger
|
|
443
|
-
};
|
|
444
|
-
//# sourceMappingURL=chunk-KIWCWIXA.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/tools/tools.ts", "../../../src/tools/shaping.ts", "../../../src/tools/logger.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\n// Tool definitions — the metadata + handler body for every MCP tool the\n// introspect-mcp server exposes.\n//\n// Centralizing this map gives us:\n//\n// - One place to read when wondering \"what tools does this server expose?\"\n// - A simple shape for `server.ts` to iterate when registering tools, so the\n// server's only job is wiring (transport, error handling, readiness gate).\n// - A natural surface to extend without touching server-construction logic\n// — adding a tool is a single new entry in this map.\n//\n// Input schemas are authored in Effect Schema (see `@dxos/introspect-tools`)\n// so that downstream consumers like `react-ui-form` can render forms from\n// the same definitions. The MCP SDK requires zod, so the server converts at\n// registration time via `inputSchemaToZod` from `@dxos/introspect-tools`.\n//\n// Each handler returns a `ToolResult` (data + optional note + optional\n// truncated marker); the server wraps that in the MCP `content` envelope.\n// Handlers DO NOT call `await introspector.ready` themselves — the server\n// applies that gate uniformly via `withReady`, so a future tool can't\n// accidentally skip it.\n\nimport type * as Schema from 'effect/Schema';\n\nimport type { Introspector } from '@dxos/introspect';\nimport {\n type FindSymbolArgs,\n type GetPackageArgs,\n type GetSymbolArgs,\n type ListCapabilitiesArgs,\n type ListIdiomsArgs,\n type ListOperationsArgs,\n type ListOptions,\n type ListPackagesArgs,\n type ListPluginsArgs,\n type ListSchemasArgs,\n type ListSurfacesArgs,\n type ListSymbolsArgs,\n TOOL_METADATA,\n} from '@dxos/introspect-tools';\n\nimport type { ToolLogger } from './logger';\nimport {\n type ToolResult,\n shapeFindSymbol,\n shapeGetPackage,\n shapeGetSymbol,\n shapeListCapabilities,\n shapeListIdioms,\n shapeListOperations,\n shapeListPackages,\n shapeListPlugins,\n shapeListSchemas,\n shapeListSurfaces,\n} from './shaping';\n\n/** Pull the list-options bag out of an args object before forwarding to a shaper. */\nconst pickListOptions = (args: { limit?: number; compact?: boolean }): ListOptions => ({\n limit: args.limit,\n compact: args.compact,\n});\n\n/**\n * A single MCP tool — metadata + handler. The `inputSchema` field is the\n * Effect `Schema.Struct` that defines the input shape; the server converts\n * it to zod at registration via `effectFieldsToZod`. Authoring in Effect\n * Schema gives `react-ui-form` and other downstream consumers a single\n * source of truth.\n */\nexport type ToolDefinition<TArgs = Record<string, unknown>> = {\n /** Human-readable title surfaced by Inspector / Composer. */\n title: string;\n\n /**\n * LLM-targeted description. Models read this to decide WHEN to call the\n * tool — write it for trigger accuracy, not for human reading. State both\n * what the tool does and the situations it's the right answer for.\n */\n description: string;\n\n /**\n * Effect Schema struct describing the tool's input. The server converts\n * to zod for the MCP SDK; downstream consumers (react-ui-form, etc.) can\n * use this directly.\n */\n inputSchema: Schema.Struct<any>;\n\n /** Tool body. Must NOT await `introspector.ready` — the server gates that uniformly. */\n handler: (args: TArgs) => ToolResult | Promise<ToolResult>;\n};\n\n/**\n * Build the tool map for a given introspector. Returning a map (rather than a\n * static const) lets the handlers close over the introspector instance and\n * the per-process logger. Title / description / inputSchema all come from the\n * shared `TOOL_METADATA` map in `@dxos/introspect-tools` so the contract is\n * authored once and consumed by both server (here) and browser callers.\n */\nexport const createToolDefinitions = (\n introspector: Introspector,\n log: ToolLogger,\n): Record<string, ToolDefinition<any>> => ({\n list_packages: {\n ...TOOL_METADATA.list_packages,\n handler: (args: ListPackagesArgs) => {\n const result = introspector.listPackages({\n name: args.name,\n pathPrefix: args.pathPrefix,\n privateOnly: args.privateOnly,\n });\n const shaped = shapeListPackages(result, pickListOptions(args));\n log({ tool: 'list_packages', args, count: result.length, truncated: shaped.truncated });\n return shaped;\n },\n } satisfies ToolDefinition<ListPackagesArgs>,\n\n get_package: {\n ...TOOL_METADATA.get_package,\n handler: (args: GetPackageArgs) => {\n const detail = introspector.getPackage(args.name);\n log({ tool: 'get_package', args, found: detail !== null });\n if (!detail) {\n return { data: null, note: `No package named ${args.name}` };\n }\n return shapeGetPackage(detail);\n },\n } satisfies ToolDefinition<GetPackageArgs>,\n\n list_symbols: {\n ...TOOL_METADATA.list_symbols,\n handler: (args: ListSymbolsArgs) => {\n const matches = introspector.listSymbols(args.package, args.kind);\n const shaped = shapeFindSymbol(matches, pickListOptions(args));\n log({ tool: 'list_symbols', args, count: matches.length, truncated: shaped.truncated });\n return shaped;\n },\n } satisfies ToolDefinition<ListSymbolsArgs>,\n\n find_symbol: {\n ...TOOL_METADATA.find_symbol,\n handler: (args: FindSymbolArgs) => {\n const matches = introspector.findSymbol(args.query, args.kind);\n const shaped = shapeFindSymbol(matches, pickListOptions(args));\n log({ tool: 'find_symbol', args, count: matches.length, truncated: shaped.truncated });\n return shaped;\n },\n } satisfies ToolDefinition<FindSymbolArgs>,\n\n get_symbol: {\n ...TOOL_METADATA.get_symbol,\n handler: (args: GetSymbolArgs) => {\n const detail = introspector.getSymbol(args.ref, args.include as Array<'source' | 'jsdoc'> | undefined);\n log({ tool: 'get_symbol', args, found: detail !== null });\n if (!detail) {\n return { data: null, note: `No symbol with ref ${args.ref}` };\n }\n return shapeGetSymbol(detail);\n },\n } satisfies ToolDefinition<GetSymbolArgs>,\n\n list_plugins: {\n ...TOOL_METADATA.list_plugins,\n handler: (args: ListPluginsArgs) => {\n const result = introspector.listPlugins(args.id !== undefined ? { id: args.id } : undefined);\n const shaped = shapeListPlugins(result, pickListOptions(args));\n log({ tool: 'list_plugins', args, count: result.length, truncated: shaped.truncated });\n return shaped;\n },\n } satisfies ToolDefinition<ListPluginsArgs>,\n\n list_surfaces: {\n ...TOOL_METADATA.list_surfaces,\n handler: (args: ListSurfacesArgs) => {\n const result = introspector.listSurfaces(args.id);\n const shaped = shapeListSurfaces(result, pickListOptions(args));\n log({ tool: 'list_surfaces', args, count: result.length, truncated: shaped.truncated });\n return shaped;\n },\n } satisfies ToolDefinition<ListSurfacesArgs>,\n\n list_capabilities: {\n ...TOOL_METADATA.list_capabilities,\n handler: (args: ListCapabilitiesArgs) => {\n const result = introspector.listCapabilities(args.id);\n const shaped = shapeListCapabilities(result, pickListOptions(args));\n log({ tool: 'list_capabilities', args, count: result.length, truncated: shaped.truncated });\n return shaped;\n },\n } satisfies ToolDefinition<ListCapabilitiesArgs>,\n\n list_operations: {\n ...TOOL_METADATA.list_operations,\n handler: (args: ListOperationsArgs) => {\n const result = introspector.listOperations(args.id);\n const shaped = shapeListOperations(result, pickListOptions(args));\n log({ tool: 'list_operations', args, count: result.length, truncated: shaped.truncated });\n return shaped;\n },\n } satisfies ToolDefinition<ListOperationsArgs>,\n\n list_schemas: {\n ...TOOL_METADATA.list_schemas,\n handler: (args: ListSchemasArgs) => {\n const result = introspector.listSchemas(args.id);\n const shaped = shapeListSchemas(result, pickListOptions(args));\n log({ tool: 'list_schemas', args, count: result.length, truncated: shaped.truncated });\n return shaped;\n },\n } satisfies ToolDefinition<ListSchemasArgs>,\n\n list_idioms: {\n ...TOOL_METADATA.list_idioms,\n handler: (args: ListIdiomsArgs) => {\n const result = introspector.listIdioms({ slug: args.slug, hostKind: args.hostKind });\n const shaped = shapeListIdioms(result, pickListOptions(args));\n log({ tool: 'list_idioms', args, count: result.length, truncated: shaped.truncated });\n return shaped;\n },\n } satisfies ToolDefinition<ListIdiomsArgs>,\n});\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// Response shaping for token budgets.\n//\n// Tool responses target a sane default size for the LLM context (~30 list\n// items, single-record fetches kept compact via `include` opt-ins). Callers\n// that legitimately need a longer list pass `limit`; callers in \"discovery\n// mode\" (just want to see what exists) pass `compact: true` for a refs/ids-\n// only projection at roughly 1/4 the wire size.\n\nimport type {\n Capability,\n Idiom,\n Operation,\n Package,\n PackageDetail,\n Plugin,\n PluginDetail,\n Schema,\n Surface,\n SymbolDetail,\n SymbolMatch,\n} from '@dxos/introspect';\nimport { DEFAULT_LIST_LIMIT, type ListOptions, MAX_LIST_LIMIT } from '@dxos/introspect-tools';\n\nconst SOURCE_PREVIEW = 1200;\nconst JSDOC_PREVIEW = 600;\n\nexport type ToolResult = {\n data: unknown;\n note?: string;\n truncated?: string;\n};\n\ntype ShapeListConfig<T> = {\n /** Full projection — what an LLM gets when `compact` is false/omitted. */\n full: (item: T) => Record<string, unknown>;\n /** Compact projection — ids / typenames / names only. */\n compact: (item: T) => Record<string, unknown>;\n /** Suffix for the `truncated` note: \"<N> more results — <hint>\". */\n truncationHint: string;\n};\n\nconst shapeList = <T>(all: readonly T[], opts: ListOptions, config: ShapeListConfig<T>): ToolResult => {\n const requested = opts.limit ?? DEFAULT_LIST_LIMIT;\n const limit = Math.min(Math.max(0, Math.floor(requested)), MAX_LIST_LIMIT);\n const project = opts.compact ? config.compact : config.full;\n const data = all.slice(0, limit).map(project);\n if (all.length > limit) {\n return {\n data,\n truncated: `${all.length - limit} more results — ${config.truncationHint}`,\n };\n }\n return { data };\n};\n\n//\n// Packages\n//\n\nexport const shapeListPackages = (all: Package[], opts: ListOptions = {}): ToolResult =>\n shapeList(all, opts, {\n full: (p) => ({\n name: p.name,\n version: p.version,\n private: p.private,\n path: p.path,\n description: p.description,\n }),\n compact: (p) => ({ name: p.name, path: p.path }),\n truncationHint: 'raise `limit` (max 200), refine with `name`/`pathPrefix`, or call get_package directly.',\n });\n\nexport const shapeGetPackage = (detail: PackageDetail): ToolResult => ({\n data: {\n name: detail.name,\n version: detail.version,\n private: detail.private,\n path: detail.path,\n description: detail.description,\n workspaceDependencies: detail.workspaceDependencies,\n externalDependencies: detail.externalDependencies,\n entryPoints: detail.entryPoints,\n // Surfaced so callers can decide whether to call find_symbol against this package.\n exportCount: detail.exportCount,\n },\n});\n\n//\n// Symbols\n//\n\nexport const shapeFindSymbol = (matches: SymbolMatch[], opts: ListOptions = {}): ToolResult =>\n shapeList(matches, opts, {\n full: (m) => ({ ref: m.ref, name: m.name, package: m.package, kind: m.kind, summary: m.summary }),\n compact: (m) => ({ ref: m.ref, name: m.name }),\n truncationHint: 'raise `limit` (max 200), refine the query, or filter by `kind`.',\n });\n\nexport const shapeGetSymbol = (detail: SymbolDetail): ToolResult => {\n const result: Record<string, unknown> = {\n ref: detail.ref,\n package: detail.package,\n name: detail.name,\n kind: detail.kind,\n signature: detail.signature,\n summary: detail.summary,\n location: detail.location,\n };\n if (detail.jsdoc) {\n result.jsdoc = truncate(detail.jsdoc, JSDOC_PREVIEW);\n }\n if (detail.source !== undefined) {\n result.source = truncate(detail.source, SOURCE_PREVIEW);\n }\n return { data: result };\n};\n\nconst truncate = (s: string, limit: number): string => {\n if (s.length <= limit) {\n return s;\n }\n return `${s.slice(0, limit)}\\n... (truncated, ${s.length - limit} more chars)`;\n};\n\n//\n// Plugin / surface / capability / operation / schema (main's flatter types)\n//\n\nexport const shapeListPlugins = (all: Plugin[], opts: ListOptions = {}): ToolResult =>\n shapeList(all, opts, {\n full: (p) => ({\n id: p.id,\n package: p.package,\n name: p.name,\n description: p.description,\n icon: p.icon,\n iconHue: p.iconHue,\n tags: p.tags,\n dependsOn: p.dependsOn,\n }),\n compact: (p) => ({ id: p.id, name: p.name }),\n truncationHint: 'raise `limit` (max 200) or filter with `id` substring.',\n });\n\n/**\n * `PluginDetail` is the same shape as `Plugin` plus arrays of contributions.\n * Returned by what would be `get_plugin` if the introspector exposed it; we\n * synthesize this on the MCP side by combining `listPlugins` + the per-id\n * `listSurfaces` / `listCapabilities` / `listOperations` / `listSchemas` calls.\n */\nexport const shapePluginDetail = (detail: PluginDetail): ToolResult => ({\n data: {\n id: detail.id,\n package: detail.package,\n name: detail.name,\n description: detail.description,\n icon: detail.icon,\n iconHue: detail.iconHue,\n tags: detail.tags,\n dependsOn: detail.dependsOn,\n metaLocation: detail.metaLocation,\n surfaces: detail.surfaces.map((s) => ({ id: s.id, role: s.role })),\n capabilities: detail.capabilities.map((c) => ({ type: c.type })),\n operations: detail.operations.map((o) => ({ type: o.type })),\n schemas: detail.schemas.map((s) => ({ name: s.name, typename: s.typename })),\n },\n});\n\nexport const shapeListSurfaces = (all: Surface[], opts: ListOptions = {}): ToolResult =>\n shapeList(all, opts, {\n full: (s) => ({ pluginId: s.pluginId, id: s.id, role: s.role, location: s.location }),\n compact: (s) => ({ pluginId: s.pluginId, id: s.id }),\n truncationHint: 'raise `limit` (max 200) or filter by plugin `id`.',\n });\n\nexport const shapeListCapabilities = (all: Capability[], opts: ListOptions = {}): ToolResult =>\n shapeList(all, opts, {\n full: (c) => ({ pluginId: c.pluginId, type: c.type, location: c.location }),\n compact: (c) => ({ pluginId: c.pluginId, type: c.type }),\n truncationHint: 'raise `limit` (max 200) or filter by plugin `id`.',\n });\n\nexport const shapeListOperations = (all: Operation[], opts: ListOptions = {}): ToolResult =>\n shapeList(all, opts, {\n full: (o) => ({ pluginId: o.pluginId, type: o.type, location: o.location }),\n compact: (o) => ({ pluginId: o.pluginId, type: o.type }),\n truncationHint: 'raise `limit` (max 200) or filter by plugin `id`.',\n });\n\nexport const shapeListSchemas = (all: Schema[], opts: ListOptions = {}): ToolResult =>\n shapeList(all, opts, {\n full: (s) => ({ pluginId: s.pluginId, name: s.name, typename: s.typename, location: s.location }),\n compact: (s) => ({ pluginId: s.pluginId, name: s.name, typename: s.typename }),\n truncationHint: 'raise `limit` (max 200) or filter by plugin `id`.',\n });\n\n//\n// Idioms\n//\n\nexport const shapeListIdioms = (all: Idiom[], opts: ListOptions = {}): ToolResult =>\n shapeList(all, opts, {\n full: (idiom) => ({\n slug: idiom.slug,\n summary: idiom.summary,\n applies: idiom.applies,\n insteadOf: idiom.insteadOf,\n uses: idiom.uses,\n related: idiom.related,\n host: {\n file: idiom.host.file,\n line: idiom.host.line,\n symbol: idiom.host.symbol,\n kind: idiom.host.kind,\n },\n }),\n compact: (idiom) => ({\n slug: idiom.slug,\n kind: idiom.host.kind,\n file: idiom.host.file,\n symbol: idiom.host.symbol,\n }),\n truncationHint: 'raise `limit` (max 200), refine with `slug`, or filter by `hostKind`.',\n });\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// Tool-call logging — drives future tool prioritization.\n//\n// Every tool call is logged; failed structured queries that fall through to\n// search_code (when added in a later phase) get logged separately. This is\n// intentionally minimal — appending JSONL is enough for the analysis we want\n// to do later, and keeps the runtime dependency surface small.\n\nimport { appendFile, mkdir } from 'node:fs/promises';\nimport { dirname } from 'node:path';\n\nexport type ToolLogEntry = {\n tool: string;\n args?: unknown;\n count?: number;\n found?: boolean;\n truncated?: string;\n};\n\nexport type ToolLogger = (entry: ToolLogEntry) => void;\n\nexport const noopLogger: ToolLogger = () => {};\n\n/**\n * Wrap a logger so failures inside it never throw into the caller. Returns the\n * wrapped logger; if `inner` is undefined, returns a no-op. Timestamp injection\n * is the responsibility of concrete sinks (see `fileLogger`).\n */\nexport const registerLogger = (inner?: ToolLogger): ToolLogger => {\n if (!inner) {\n return noopLogger;\n }\n return (entry) => {\n try {\n inner(entry);\n } catch {\n // Logger failures must not break tool calls.\n }\n };\n};\n\n/**\n * Append-only JSONL logger. Creates the parent directory on first write.\n */\nexport const fileLogger = (path: string): ToolLogger => {\n let ensured = false;\n return (entry) => {\n const line = `${JSON.stringify({ ts: new Date().toISOString(), ...entry })}\\n`;\n void (async () => {\n if (!ensured) {\n await mkdir(dirname(path), { recursive: true });\n ensured = true;\n }\n await appendFile(path, line, 'utf8');\n })().catch(() => undefined);\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;AA6BA,SAaEA,qBACK;;;AClBP,SAASC,oBAAsCC,sBAAsB;AAErE,IAAMC,iBAAiB;AACvB,IAAMC,gBAAgB;AAiBtB,IAAMC,YAAY,CAAIC,KAAmBC,MAAmBC,WAAAA;AAC1D,QAAMC,YAAYF,KAAKG,SAAST;AAChC,QAAMS,QAAQC,KAAKC,IAAID,KAAKE,IAAI,GAAGF,KAAKG,MAAML,SAAAA,CAAAA,GAAaP,cAAAA;AAC3D,QAAMa,UAAUR,KAAKS,UAAUR,OAAOQ,UAA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I,GAAGT;IAAM,CAAA,CAAA;;AACxE,UAAM,YAAA;AACJ,UAAI,CAACG,SAAS;AACZ,cAAMR,MAAMC,QAAQM,IAAAA,GAAO;UAAEQ,WAAW;QAAK,CAAA;AAC7CP,kBAAU;MACZ;AACA,YAAMT,WAAWQ,MAAME,MAAM,MAAA;IAC/B,GAAA,EAAKO,MAAM,MAAMC,MAAAA;EACnB;AACF;",
|
|
6
|
-
"names": ["TOOL_METADATA", "DEFAULT_LIST_LIMIT", "MAX_LIST_LIMIT", "SOURCE_PREVIEW", "JSDOC_PREVIEW", "shapeList", "all", "opts", "config", "requested", "limit", "Math", "min", "max", "floor", "project", "compact", "full", "data", "slice", "map", "length", "truncated", "truncationHint", "shapeListPackages", "p", "name", "version", "private", "path", "description", "shapeGetPackage", "detail", "workspaceDependencies", "externalDependencies", "entryPoints", "exportCount", "shapeFindSymbol", "matches", "m", "ref", "package", "kind", "summary", "shapeGetSymbol", "result", "signature", "location", "jsdoc", "truncate", "source", "undefined", "s", "shapeListPlugins", "id", "icon", "iconHue", "tags", "dependsOn", "shapePluginDetail", "metaLocation", "surfaces", "role", "capabilities", "c", "type", "operations", "o", "schemas", "typename", "shapeListSurfaces", "pluginId", "shapeListCapabilities", "shapeListOperations", "shapeListSchemas", "shapeListIdioms", "idiom", "slug", "applies", "insteadOf", "uses", "related", "host", "file", "line", "symbol", "pickListOptions", "args", "limit", "compact", "createToolDefinitions", "introspector", "log", "list_packages", "TOOL_METADATA", "handler", "result", "listPackages", "name", "pathPrefix", "privateOnly", "shaped", "shapeListPackages", "tool", "count", "length", "truncated", "get_package", "detail", "getPackage", "found", "data", "note", "shapeGetPackage", "list_symbols", "matches", "listSymbols", "package", "kind", "shapeFindSymbol", "find_symbol", "findSymbol", "query", "get_symbol", "getSymbol", "ref", "include", "shapeGetSymbol", "list_plugins", "listPlugins", "id", "undefined", "shapeListPlugins", "list_surfaces", "listSurfaces", "shapeListSurfaces", "list_capabilities", "listCapabilities", "shapeListCapabilities", "list_operations", "listOperations", "shapeListOperations", "list_schemas", "listSchemas", "shapeListSchemas", "list_idioms", "listIdioms", "slug", "hostKind", "shapeListIdioms", "appendFile", "mkdir", "dirname", "noopLogger", "registerLogger", "inner", "entry", "fileLogger", "path", "ensured", "line", "JSON", "stringify", "ts", "Date", "toISOString", "recursive", "catch", "undefined"]
|
|
7
|
-
}
|