@fgv/ts-extras-mcp 5.1.0-34

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.
Files changed (107) hide show
  1. package/.rush/temp/5d207610a84e494acaefe7ed13447cda74ddf7da.tar.log +90 -0
  2. package/.rush/temp/chunked-rush-logs/ts-extras-mcp.build.chunks.jsonl +9 -0
  3. package/.rush/temp/operation/build/all.log +9 -0
  4. package/.rush/temp/operation/build/log-chunks.jsonl +9 -0
  5. package/.rush/temp/operation/build/state.json +3 -0
  6. package/.rush/temp/shrinkwrap-deps.json +734 -0
  7. package/CHANGELOG.json +4 -0
  8. package/README.md +133 -0
  9. package/config/api-extractor.json +38 -0
  10. package/config/jest.config.json +13 -0
  11. package/config/rig.json +6 -0
  12. package/dist/index.js +49 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/packlets/mcp/adapter.js +122 -0
  15. package/dist/packlets/mcp/adapter.js.map +1 -0
  16. package/dist/packlets/mcp/index.js +33 -0
  17. package/dist/packlets/mcp/index.js.map +1 -0
  18. package/dist/packlets/mcp/model.js +23 -0
  19. package/dist/packlets/mcp/model.js.map +1 -0
  20. package/dist/packlets/mcp/operations.js +119 -0
  21. package/dist/packlets/mcp/operations.js.map +1 -0
  22. package/dist/packlets/mcp/sdk.js +67 -0
  23. package/dist/packlets/mcp/sdk.js.map +1 -0
  24. package/dist/packlets/mcp/session.js +109 -0
  25. package/dist/packlets/mcp/session.js.map +1 -0
  26. package/dist/packlets/mcp/transports.js +96 -0
  27. package/dist/packlets/mcp/transports.js.map +1 -0
  28. package/dist/test/unit/endToEnd.test.js +220 -0
  29. package/dist/test/unit/endToEnd.test.js.map +1 -0
  30. package/dist/test/unit/index.test.js +41 -0
  31. package/dist/test/unit/index.test.js.map +1 -0
  32. package/dist/test/unit/mcp.test.js +381 -0
  33. package/dist/test/unit/mcp.test.js.map +1 -0
  34. package/dist/test/unit/sdk.test.js +68 -0
  35. package/dist/test/unit/sdk.test.js.map +1 -0
  36. package/dist/ts-extras-mcp.d.ts +290 -0
  37. package/dist/tsdoc-metadata.json +11 -0
  38. package/eslint.config.js +15 -0
  39. package/etc/ts-extras-mcp.api.md +104 -0
  40. package/lib/index.d.ts +28 -0
  41. package/lib/index.d.ts.map +1 -0
  42. package/lib/index.js +65 -0
  43. package/lib/index.js.map +1 -0
  44. package/lib/packlets/mcp/adapter.d.ts +33 -0
  45. package/lib/packlets/mcp/adapter.d.ts.map +1 -0
  46. package/lib/packlets/mcp/adapter.js +125 -0
  47. package/lib/packlets/mcp/adapter.js.map +1 -0
  48. package/lib/packlets/mcp/index.d.ts +10 -0
  49. package/lib/packlets/mcp/index.d.ts.map +1 -0
  50. package/lib/packlets/mcp/index.js +57 -0
  51. package/lib/packlets/mcp/index.js.map +1 -0
  52. package/lib/packlets/mcp/model.d.ts +155 -0
  53. package/lib/packlets/mcp/model.d.ts.map +1 -0
  54. package/lib/packlets/mcp/model.js +24 -0
  55. package/lib/packlets/mcp/model.js.map +1 -0
  56. package/lib/packlets/mcp/operations.d.ts +36 -0
  57. package/lib/packlets/mcp/operations.d.ts.map +1 -0
  58. package/lib/packlets/mcp/operations.js +123 -0
  59. package/lib/packlets/mcp/operations.js.map +1 -0
  60. package/lib/packlets/mcp/sdk.d.ts +91 -0
  61. package/lib/packlets/mcp/sdk.d.ts.map +1 -0
  62. package/lib/packlets/mcp/sdk.js +72 -0
  63. package/lib/packlets/mcp/sdk.js.map +1 -0
  64. package/lib/packlets/mcp/session.d.ts +43 -0
  65. package/lib/packlets/mcp/session.d.ts.map +1 -0
  66. package/lib/packlets/mcp/session.js +115 -0
  67. package/lib/packlets/mcp/session.js.map +1 -0
  68. package/lib/packlets/mcp/transports.d.ts +49 -0
  69. package/lib/packlets/mcp/transports.d.ts.map +1 -0
  70. package/lib/packlets/mcp/transports.js +102 -0
  71. package/lib/packlets/mcp/transports.js.map +1 -0
  72. package/lib/test/unit/endToEnd.test.d.ts +13 -0
  73. package/lib/test/unit/endToEnd.test.d.ts.map +1 -0
  74. package/lib/test/unit/endToEnd.test.js +222 -0
  75. package/lib/test/unit/endToEnd.test.js.map +1 -0
  76. package/lib/test/unit/index.test.d.ts +2 -0
  77. package/lib/test/unit/index.test.d.ts.map +1 -0
  78. package/lib/test/unit/index.test.js +76 -0
  79. package/lib/test/unit/index.test.js.map +1 -0
  80. package/lib/test/unit/mcp.test.d.ts +2 -0
  81. package/lib/test/unit/mcp.test.d.ts.map +1 -0
  82. package/lib/test/unit/mcp.test.js +416 -0
  83. package/lib/test/unit/mcp.test.js.map +1 -0
  84. package/lib/test/unit/sdk.test.d.ts +2 -0
  85. package/lib/test/unit/sdk.test.d.ts.map +1 -0
  86. package/lib/test/unit/sdk.test.js +70 -0
  87. package/lib/test/unit/sdk.test.js.map +1 -0
  88. package/package.json +86 -0
  89. package/rush-logs/ts-extras-mcp.build.cache.log +3 -0
  90. package/rush-logs/ts-extras-mcp.build.log +9 -0
  91. package/src/index.ts +50 -0
  92. package/src/packlets/mcp/adapter.ts +152 -0
  93. package/src/packlets/mcp/index.ts +34 -0
  94. package/src/packlets/mcp/model.ts +204 -0
  95. package/src/packlets/mcp/operations.ts +138 -0
  96. package/src/packlets/mcp/sdk.ts +148 -0
  97. package/src/packlets/mcp/session.ts +137 -0
  98. package/src/packlets/mcp/transports.ts +111 -0
  99. package/src/test/unit/endToEnd.test.ts +254 -0
  100. package/src/test/unit/index.test.ts +43 -0
  101. package/src/test/unit/mcp.test.ts +473 -0
  102. package/src/test/unit/sdk.test.ts +73 -0
  103. package/temp/build/lint/_eslint-5eVG3S6w.json +54 -0
  104. package/temp/build/typescript/ts_8nwakTlr.json +1 -0
  105. package/temp/ts-extras-mcp.api.json +1662 -0
  106. package/temp/ts-extras-mcp.api.md +104 -0
  107. package/tsconfig.json +12 -0
@@ -0,0 +1,1662 @@
1
+ {
2
+ "metadata": {
3
+ "toolPackage": "@microsoft/api-extractor",
4
+ "toolVersion": "7.58.7",
5
+ "schemaVersion": 1011,
6
+ "oldestForwardsCompatibleVersion": 1001,
7
+ "tsdocConfig": {
8
+ "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
9
+ "noStandardTags": true,
10
+ "tagDefinitions": [
11
+ {
12
+ "tagName": "@alpha",
13
+ "syntaxKind": "modifier"
14
+ },
15
+ {
16
+ "tagName": "@beta",
17
+ "syntaxKind": "modifier"
18
+ },
19
+ {
20
+ "tagName": "@defaultValue",
21
+ "syntaxKind": "block"
22
+ },
23
+ {
24
+ "tagName": "@decorator",
25
+ "syntaxKind": "block",
26
+ "allowMultiple": true
27
+ },
28
+ {
29
+ "tagName": "@deprecated",
30
+ "syntaxKind": "block"
31
+ },
32
+ {
33
+ "tagName": "@eventProperty",
34
+ "syntaxKind": "modifier"
35
+ },
36
+ {
37
+ "tagName": "@example",
38
+ "syntaxKind": "block",
39
+ "allowMultiple": true
40
+ },
41
+ {
42
+ "tagName": "@experimental",
43
+ "syntaxKind": "modifier"
44
+ },
45
+ {
46
+ "tagName": "@inheritDoc",
47
+ "syntaxKind": "inline"
48
+ },
49
+ {
50
+ "tagName": "@internal",
51
+ "syntaxKind": "modifier"
52
+ },
53
+ {
54
+ "tagName": "@label",
55
+ "syntaxKind": "inline"
56
+ },
57
+ {
58
+ "tagName": "@link",
59
+ "syntaxKind": "inline",
60
+ "allowMultiple": true
61
+ },
62
+ {
63
+ "tagName": "@override",
64
+ "syntaxKind": "modifier"
65
+ },
66
+ {
67
+ "tagName": "@packageDocumentation",
68
+ "syntaxKind": "modifier"
69
+ },
70
+ {
71
+ "tagName": "@param",
72
+ "syntaxKind": "block",
73
+ "allowMultiple": true
74
+ },
75
+ {
76
+ "tagName": "@privateRemarks",
77
+ "syntaxKind": "block"
78
+ },
79
+ {
80
+ "tagName": "@public",
81
+ "syntaxKind": "modifier"
82
+ },
83
+ {
84
+ "tagName": "@readonly",
85
+ "syntaxKind": "modifier"
86
+ },
87
+ {
88
+ "tagName": "@remarks",
89
+ "syntaxKind": "block"
90
+ },
91
+ {
92
+ "tagName": "@returns",
93
+ "syntaxKind": "block"
94
+ },
95
+ {
96
+ "tagName": "@sealed",
97
+ "syntaxKind": "modifier"
98
+ },
99
+ {
100
+ "tagName": "@see",
101
+ "syntaxKind": "block"
102
+ },
103
+ {
104
+ "tagName": "@throws",
105
+ "syntaxKind": "block",
106
+ "allowMultiple": true
107
+ },
108
+ {
109
+ "tagName": "@typeParam",
110
+ "syntaxKind": "block",
111
+ "allowMultiple": true
112
+ },
113
+ {
114
+ "tagName": "@virtual",
115
+ "syntaxKind": "modifier"
116
+ },
117
+ {
118
+ "tagName": "@jsx",
119
+ "syntaxKind": "block"
120
+ },
121
+ {
122
+ "tagName": "@jsxRuntime",
123
+ "syntaxKind": "block"
124
+ },
125
+ {
126
+ "tagName": "@jsxFrag",
127
+ "syntaxKind": "block"
128
+ },
129
+ {
130
+ "tagName": "@jsxImportSource",
131
+ "syntaxKind": "block"
132
+ },
133
+ {
134
+ "tagName": "@betaDocumentation",
135
+ "syntaxKind": "modifier"
136
+ },
137
+ {
138
+ "tagName": "@internalRemarks",
139
+ "syntaxKind": "block"
140
+ },
141
+ {
142
+ "tagName": "@preapproved",
143
+ "syntaxKind": "modifier"
144
+ }
145
+ ],
146
+ "supportForTags": {
147
+ "@alpha": true,
148
+ "@beta": true,
149
+ "@defaultValue": true,
150
+ "@decorator": true,
151
+ "@deprecated": true,
152
+ "@eventProperty": true,
153
+ "@example": true,
154
+ "@experimental": true,
155
+ "@inheritDoc": true,
156
+ "@internal": true,
157
+ "@label": true,
158
+ "@link": true,
159
+ "@override": true,
160
+ "@packageDocumentation": true,
161
+ "@param": true,
162
+ "@privateRemarks": true,
163
+ "@public": true,
164
+ "@readonly": true,
165
+ "@remarks": true,
166
+ "@returns": true,
167
+ "@sealed": true,
168
+ "@see": true,
169
+ "@throws": true,
170
+ "@typeParam": true,
171
+ "@virtual": true,
172
+ "@betaDocumentation": true,
173
+ "@internalRemarks": true,
174
+ "@preapproved": true
175
+ },
176
+ "reportUnsupportedHtmlElements": false
177
+ }
178
+ },
179
+ "kind": "Package",
180
+ "canonicalReference": "@fgv/ts-extras-mcp!",
181
+ "docComment": "/**\n * `@fgv/ts-extras-mcp` — a Result-integration boundary over `@modelcontextprotocol/sdk` that connects to MCP (Model Context Protocol) servers, discovers their tools, and adapts each into an `AiAssist.IAiClientTool` so it drops directly into `AiAssist.executeClientToolTurn` — making any MCP server's tools callable across all four cloud providers with no per-provider work.\n *\n * Mirrors the discipline of `@fgv/ts-extras-webauthn` / `@fgv/ts-extras-transformers`: thin `Result<T>` conversion over a well-maintained upstream SDK, with no opinionated orchestration above the boundary.\n *\n * **In scope (slice 1, Node):** transport factories (`createStdioTransport`, `createHttpTransport`), session lifecycle (`connectMcpSession`, `closeMcpSession`), tool discovery + invocation (`listMcpTools`, `callMcpTool`), and the headline adapter (`adaptMcpTools`) which gracefully degrades on tools whose `inputSchema` is outside the supported JSON Schema subset (surfacing them on `skipped` and warning NOISILY).\n *\n * **Explicitly NOT in scope (deferred — see README / docs/FUTURE.md):** - Browser sibling `@fgv/ts-web-extras-mcp` - MCP resources / prompts / sampling features - OAuth / managed auth (static headers only at v0.1) - Multimodal tool-result passthrough (text-block projection only) - Cross-server tool-name namespacing (duplicate names already fail loudly in `executeClientToolTurn`)\n *\n * @packageDocumentation\n */\n",
182
+ "name": "@fgv/ts-extras-mcp",
183
+ "preserveMemberOrder": false,
184
+ "members": [
185
+ {
186
+ "kind": "EntryPoint",
187
+ "canonicalReference": "@fgv/ts-extras-mcp!",
188
+ "name": "",
189
+ "preserveMemberOrder": false,
190
+ "members": [
191
+ {
192
+ "kind": "Function",
193
+ "canonicalReference": "@fgv/ts-extras-mcp!adaptMcpTools:function(1)",
194
+ "docComment": "/**\n * Discovers an MCP server's tools and adapts each into an `AiAssist.IAiClientTool` that drops directly into `AiAssist.executeClientToolTurn`.\n *\n * @remarks\n *\n * **Constraint 1 — graceful degradation with NOISY warnings.** A tool whose `inputSchema` is outside the JSON Schema subset supported by `JsonSchema.fromJson` is NOT adapted (the model must never be offered a tool whose args we can't validate). Instead it is: 1. excluded from {@link IAdaptMcpToolsResult.tools}; 2. surfaced structurally on {@link IAdaptMcpToolsResult.skipped} with the tool name, the JSON-pointer reason, and the raw failing schema; and 3. logged as a NOISY `warning` (name + reason + raw schema) when an `options.logger` is supplied — so pointing this at a new server immediately reveals every subset feature to extend, with the schema in hand.\n *\n * The whole catalog never fails on a single bad schema; the only failure mode is an upstream `listMcpTools` error.\n *\n * @param session - A connected session from `connectMcpSession`.\n *\n * @param options - Optional logger for the NOISY skip warnings.\n *\n * @returns `Success` with `{ tools, skipped }`, or `Failure` only if tool discovery fails.\n *\n * @public\n */\n",
195
+ "excerptTokens": [
196
+ {
197
+ "kind": "Content",
198
+ "text": "export declare function adaptMcpTools(session: "
199
+ },
200
+ {
201
+ "kind": "Reference",
202
+ "text": "IMcpSession",
203
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpSession:interface"
204
+ },
205
+ {
206
+ "kind": "Content",
207
+ "text": ", options?: "
208
+ },
209
+ {
210
+ "kind": "Reference",
211
+ "text": "IAdaptMcpToolsOptions",
212
+ "canonicalReference": "@fgv/ts-extras-mcp!IAdaptMcpToolsOptions:interface"
213
+ },
214
+ {
215
+ "kind": "Content",
216
+ "text": "): "
217
+ },
218
+ {
219
+ "kind": "Reference",
220
+ "text": "Promise",
221
+ "canonicalReference": "!Promise:interface"
222
+ },
223
+ {
224
+ "kind": "Content",
225
+ "text": "<"
226
+ },
227
+ {
228
+ "kind": "Reference",
229
+ "text": "Result",
230
+ "canonicalReference": "@fgv/ts-utils!Result:type"
231
+ },
232
+ {
233
+ "kind": "Content",
234
+ "text": "<"
235
+ },
236
+ {
237
+ "kind": "Reference",
238
+ "text": "IAdaptMcpToolsResult",
239
+ "canonicalReference": "@fgv/ts-extras-mcp!IAdaptMcpToolsResult:interface"
240
+ },
241
+ {
242
+ "kind": "Content",
243
+ "text": ">>"
244
+ },
245
+ {
246
+ "kind": "Content",
247
+ "text": ";"
248
+ }
249
+ ],
250
+ "fileUrlPath": "src/packlets/mcp/adapter.ts",
251
+ "returnTypeTokenRange": {
252
+ "startIndex": 5,
253
+ "endIndex": 11
254
+ },
255
+ "releaseTag": "Public",
256
+ "overloadIndex": 1,
257
+ "parameters": [
258
+ {
259
+ "parameterName": "session",
260
+ "parameterTypeTokenRange": {
261
+ "startIndex": 1,
262
+ "endIndex": 2
263
+ },
264
+ "isOptional": false
265
+ },
266
+ {
267
+ "parameterName": "options",
268
+ "parameterTypeTokenRange": {
269
+ "startIndex": 3,
270
+ "endIndex": 4
271
+ },
272
+ "isOptional": true
273
+ }
274
+ ],
275
+ "name": "adaptMcpTools"
276
+ },
277
+ {
278
+ "kind": "Function",
279
+ "canonicalReference": "@fgv/ts-extras-mcp!callMcpTool:function(1)",
280
+ "docComment": "/**\n * Calls a named tool on a connected MCP server.\n *\n * @remarks\n *\n * The SDK `CallToolResult` is projected to {@link IMcpToolCallResult} (text-block concatenation; non-text blocks summarized). A result flagged `isError: true` is mapped to `Result.fail` with the projected content — it is never swallowed, so `executeClientToolTurn` routes it back to the model as a provider-native error tool-result.\n *\n * @param session - A session from `connectMcpSession`.\n *\n * @param name - The tool name to invoke.\n *\n * @param args - The tool arguments (a JSON object).\n *\n * @returns `Success` with the projected content, or `Failure` on tool error / transport error / foreign handle.\n *\n * @public\n */\n",
281
+ "excerptTokens": [
282
+ {
283
+ "kind": "Content",
284
+ "text": "export declare function callMcpTool(session: "
285
+ },
286
+ {
287
+ "kind": "Reference",
288
+ "text": "IMcpSession",
289
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpSession:interface"
290
+ },
291
+ {
292
+ "kind": "Content",
293
+ "text": ", name: "
294
+ },
295
+ {
296
+ "kind": "Content",
297
+ "text": "string"
298
+ },
299
+ {
300
+ "kind": "Content",
301
+ "text": ", args: "
302
+ },
303
+ {
304
+ "kind": "Reference",
305
+ "text": "JsonObject",
306
+ "canonicalReference": "@fgv/ts-json-base!JsonObject:interface"
307
+ },
308
+ {
309
+ "kind": "Content",
310
+ "text": "): "
311
+ },
312
+ {
313
+ "kind": "Reference",
314
+ "text": "Promise",
315
+ "canonicalReference": "!Promise:interface"
316
+ },
317
+ {
318
+ "kind": "Content",
319
+ "text": "<"
320
+ },
321
+ {
322
+ "kind": "Reference",
323
+ "text": "Result",
324
+ "canonicalReference": "@fgv/ts-utils!Result:type"
325
+ },
326
+ {
327
+ "kind": "Content",
328
+ "text": "<"
329
+ },
330
+ {
331
+ "kind": "Reference",
332
+ "text": "IMcpToolCallResult",
333
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpToolCallResult:interface"
334
+ },
335
+ {
336
+ "kind": "Content",
337
+ "text": ">>"
338
+ },
339
+ {
340
+ "kind": "Content",
341
+ "text": ";"
342
+ }
343
+ ],
344
+ "fileUrlPath": "src/packlets/mcp/operations.ts",
345
+ "returnTypeTokenRange": {
346
+ "startIndex": 7,
347
+ "endIndex": 13
348
+ },
349
+ "releaseTag": "Public",
350
+ "overloadIndex": 1,
351
+ "parameters": [
352
+ {
353
+ "parameterName": "session",
354
+ "parameterTypeTokenRange": {
355
+ "startIndex": 1,
356
+ "endIndex": 2
357
+ },
358
+ "isOptional": false
359
+ },
360
+ {
361
+ "parameterName": "name",
362
+ "parameterTypeTokenRange": {
363
+ "startIndex": 3,
364
+ "endIndex": 4
365
+ },
366
+ "isOptional": false
367
+ },
368
+ {
369
+ "parameterName": "args",
370
+ "parameterTypeTokenRange": {
371
+ "startIndex": 5,
372
+ "endIndex": 6
373
+ },
374
+ "isOptional": false
375
+ }
376
+ ],
377
+ "name": "callMcpTool"
378
+ },
379
+ {
380
+ "kind": "Function",
381
+ "canonicalReference": "@fgv/ts-extras-mcp!closeMcpSession:function(1)",
382
+ "docComment": "/**\n * Closes an MCP session, tearing down the transport (and any spawned subprocess).\n *\n * @param session - A session from {@link connectMcpSession}.\n *\n * @returns `Success(true)`, or `Failure` if the handle is foreign or the close call throws.\n *\n * @public\n */\n",
383
+ "excerptTokens": [
384
+ {
385
+ "kind": "Content",
386
+ "text": "export declare function closeMcpSession(session: "
387
+ },
388
+ {
389
+ "kind": "Reference",
390
+ "text": "IMcpSession",
391
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpSession:interface"
392
+ },
393
+ {
394
+ "kind": "Content",
395
+ "text": "): "
396
+ },
397
+ {
398
+ "kind": "Reference",
399
+ "text": "Promise",
400
+ "canonicalReference": "!Promise:interface"
401
+ },
402
+ {
403
+ "kind": "Content",
404
+ "text": "<"
405
+ },
406
+ {
407
+ "kind": "Reference",
408
+ "text": "Result",
409
+ "canonicalReference": "@fgv/ts-utils!Result:type"
410
+ },
411
+ {
412
+ "kind": "Content",
413
+ "text": "<true>>"
414
+ },
415
+ {
416
+ "kind": "Content",
417
+ "text": ";"
418
+ }
419
+ ],
420
+ "fileUrlPath": "src/packlets/mcp/session.ts",
421
+ "returnTypeTokenRange": {
422
+ "startIndex": 3,
423
+ "endIndex": 7
424
+ },
425
+ "releaseTag": "Public",
426
+ "overloadIndex": 1,
427
+ "parameters": [
428
+ {
429
+ "parameterName": "session",
430
+ "parameterTypeTokenRange": {
431
+ "startIndex": 1,
432
+ "endIndex": 2
433
+ },
434
+ "isOptional": false
435
+ }
436
+ ],
437
+ "name": "closeMcpSession"
438
+ },
439
+ {
440
+ "kind": "Function",
441
+ "canonicalReference": "@fgv/ts-extras-mcp!connectMcpSession:function(1)",
442
+ "docComment": "/**\n * Connects to an MCP server over the given transport and performs the initialize handshake.\n *\n * @param params - Transport plus optional client identity and logger.\n *\n * @returns `Success` with an opaque {@link IMcpSession}, or `Failure` if the transport handle is foreign or the connection/handshake fails.\n *\n * @public\n */\n",
443
+ "excerptTokens": [
444
+ {
445
+ "kind": "Content",
446
+ "text": "export declare function connectMcpSession(params: "
447
+ },
448
+ {
449
+ "kind": "Reference",
450
+ "text": "IConnectMcpSessionParams",
451
+ "canonicalReference": "@fgv/ts-extras-mcp!IConnectMcpSessionParams:interface"
452
+ },
453
+ {
454
+ "kind": "Content",
455
+ "text": "): "
456
+ },
457
+ {
458
+ "kind": "Reference",
459
+ "text": "Promise",
460
+ "canonicalReference": "!Promise:interface"
461
+ },
462
+ {
463
+ "kind": "Content",
464
+ "text": "<"
465
+ },
466
+ {
467
+ "kind": "Reference",
468
+ "text": "Result",
469
+ "canonicalReference": "@fgv/ts-utils!Result:type"
470
+ },
471
+ {
472
+ "kind": "Content",
473
+ "text": "<"
474
+ },
475
+ {
476
+ "kind": "Reference",
477
+ "text": "IMcpSession",
478
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpSession:interface"
479
+ },
480
+ {
481
+ "kind": "Content",
482
+ "text": ">>"
483
+ },
484
+ {
485
+ "kind": "Content",
486
+ "text": ";"
487
+ }
488
+ ],
489
+ "fileUrlPath": "src/packlets/mcp/session.ts",
490
+ "returnTypeTokenRange": {
491
+ "startIndex": 3,
492
+ "endIndex": 9
493
+ },
494
+ "releaseTag": "Public",
495
+ "overloadIndex": 1,
496
+ "parameters": [
497
+ {
498
+ "parameterName": "params",
499
+ "parameterTypeTokenRange": {
500
+ "startIndex": 1,
501
+ "endIndex": 2
502
+ },
503
+ "isOptional": false
504
+ }
505
+ ],
506
+ "name": "connectMcpSession"
507
+ },
508
+ {
509
+ "kind": "Function",
510
+ "canonicalReference": "@fgv/ts-extras-mcp!createHttpTransport:function(1)",
511
+ "docComment": "/**\n * Creates a Streamable-HTTP MCP transport for the given endpoint URL.\n *\n * @param params - The endpoint URL and optional static headers.\n *\n * @returns `Success` with an opaque transport handle, or `Failure` if the URL is invalid or the SDK constructor throws.\n *\n * @public\n */\n",
512
+ "excerptTokens": [
513
+ {
514
+ "kind": "Content",
515
+ "text": "export declare function createHttpTransport(params: "
516
+ },
517
+ {
518
+ "kind": "Reference",
519
+ "text": "IMcpHttpTransportParams",
520
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpHttpTransportParams:interface"
521
+ },
522
+ {
523
+ "kind": "Content",
524
+ "text": "): "
525
+ },
526
+ {
527
+ "kind": "Reference",
528
+ "text": "Result",
529
+ "canonicalReference": "@fgv/ts-utils!Result:type"
530
+ },
531
+ {
532
+ "kind": "Content",
533
+ "text": "<"
534
+ },
535
+ {
536
+ "kind": "Reference",
537
+ "text": "IMcpTransport",
538
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpTransport:interface"
539
+ },
540
+ {
541
+ "kind": "Content",
542
+ "text": ">"
543
+ },
544
+ {
545
+ "kind": "Content",
546
+ "text": ";"
547
+ }
548
+ ],
549
+ "fileUrlPath": "src/packlets/mcp/transports.ts",
550
+ "returnTypeTokenRange": {
551
+ "startIndex": 3,
552
+ "endIndex": 7
553
+ },
554
+ "releaseTag": "Public",
555
+ "overloadIndex": 1,
556
+ "parameters": [
557
+ {
558
+ "parameterName": "params",
559
+ "parameterTypeTokenRange": {
560
+ "startIndex": 1,
561
+ "endIndex": 2
562
+ },
563
+ "isOptional": false
564
+ }
565
+ ],
566
+ "name": "createHttpTransport"
567
+ },
568
+ {
569
+ "kind": "Function",
570
+ "canonicalReference": "@fgv/ts-extras-mcp!createStdioTransport:function(1)",
571
+ "docComment": "/**\n * Creates a stdio MCP transport that speaks MCP over the stdin/stdout of a spawned subprocess.\n *\n * @remarks\n *\n * **Security — trust boundary.** The transport spawns `params.command` (with `params.args`) as a child process. Never source the command or arguments from untrusted input; treat them with the same care as any shell-out. See the package README's security note.\n *\n * @param params - The command, arguments, environment, and working directory.\n *\n * @returns `Success` with an opaque transport handle, or `Failure` if the SDK constructor throws (e.g. an empty command).\n *\n * @public\n */\n",
572
+ "excerptTokens": [
573
+ {
574
+ "kind": "Content",
575
+ "text": "export declare function createStdioTransport(params: "
576
+ },
577
+ {
578
+ "kind": "Reference",
579
+ "text": "IMcpStdioTransportParams",
580
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpStdioTransportParams:interface"
581
+ },
582
+ {
583
+ "kind": "Content",
584
+ "text": "): "
585
+ },
586
+ {
587
+ "kind": "Reference",
588
+ "text": "Result",
589
+ "canonicalReference": "@fgv/ts-utils!Result:type"
590
+ },
591
+ {
592
+ "kind": "Content",
593
+ "text": "<"
594
+ },
595
+ {
596
+ "kind": "Reference",
597
+ "text": "IMcpTransport",
598
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpTransport:interface"
599
+ },
600
+ {
601
+ "kind": "Content",
602
+ "text": ">"
603
+ },
604
+ {
605
+ "kind": "Content",
606
+ "text": ";"
607
+ }
608
+ ],
609
+ "fileUrlPath": "src/packlets/mcp/transports.ts",
610
+ "returnTypeTokenRange": {
611
+ "startIndex": 3,
612
+ "endIndex": 7
613
+ },
614
+ "releaseTag": "Public",
615
+ "overloadIndex": 1,
616
+ "parameters": [
617
+ {
618
+ "parameterName": "params",
619
+ "parameterTypeTokenRange": {
620
+ "startIndex": 1,
621
+ "endIndex": 2
622
+ },
623
+ "isOptional": false
624
+ }
625
+ ],
626
+ "name": "createStdioTransport"
627
+ },
628
+ {
629
+ "kind": "Interface",
630
+ "canonicalReference": "@fgv/ts-extras-mcp!IAdaptMcpToolsOptions:interface",
631
+ "docComment": "/**\n * Options for {@link adaptMcpTools}.\n *\n * @public\n */\n",
632
+ "excerptTokens": [
633
+ {
634
+ "kind": "Content",
635
+ "text": "export interface IAdaptMcpToolsOptions "
636
+ }
637
+ ],
638
+ "fileUrlPath": "src/packlets/mcp/model.ts",
639
+ "releaseTag": "Public",
640
+ "name": "IAdaptMcpToolsOptions",
641
+ "preserveMemberOrder": false,
642
+ "members": [
643
+ {
644
+ "kind": "PropertySignature",
645
+ "canonicalReference": "@fgv/ts-extras-mcp!IAdaptMcpToolsOptions#logger:member",
646
+ "docComment": "/**\n * Logger for the NOISY per-tool skip warnings. When a tool is skipped, a `warning` is emitted including the tool name, the JSON-pointer reason, and the raw failing schema. When omitted, skips are still surfaced structurally on {@link IAdaptMcpToolsResult.skipped}.\n */\n",
647
+ "excerptTokens": [
648
+ {
649
+ "kind": "Content",
650
+ "text": "readonly logger?: "
651
+ },
652
+ {
653
+ "kind": "Reference",
654
+ "text": "Logging.ILogger",
655
+ "canonicalReference": "@fgv/ts-utils!ILogger:interface"
656
+ },
657
+ {
658
+ "kind": "Content",
659
+ "text": ";"
660
+ }
661
+ ],
662
+ "isReadonly": true,
663
+ "isOptional": true,
664
+ "releaseTag": "Public",
665
+ "name": "logger",
666
+ "propertyTypeTokenRange": {
667
+ "startIndex": 1,
668
+ "endIndex": 2
669
+ }
670
+ }
671
+ ],
672
+ "extendsTokenRanges": []
673
+ },
674
+ {
675
+ "kind": "Interface",
676
+ "canonicalReference": "@fgv/ts-extras-mcp!IAdaptMcpToolsResult:interface",
677
+ "docComment": "/**\n * The result of {@link adaptMcpTools}: cleanly-adapted client tools plus the structurally-surfaced set of tools that could not be adapted (graceful degradation, Constraint 1).\n *\n * @public\n */\n",
678
+ "excerptTokens": [
679
+ {
680
+ "kind": "Content",
681
+ "text": "export interface IAdaptMcpToolsResult "
682
+ }
683
+ ],
684
+ "fileUrlPath": "src/packlets/mcp/model.ts",
685
+ "releaseTag": "Public",
686
+ "name": "IAdaptMcpToolsResult",
687
+ "preserveMemberOrder": false,
688
+ "members": [
689
+ {
690
+ "kind": "PropertySignature",
691
+ "canonicalReference": "@fgv/ts-extras-mcp!IAdaptMcpToolsResult#skipped:member",
692
+ "docComment": "/**\n * Tools excluded because their `inputSchema` is outside the supported JSON Schema subset.\n */\n",
693
+ "excerptTokens": [
694
+ {
695
+ "kind": "Content",
696
+ "text": "readonly skipped: "
697
+ },
698
+ {
699
+ "kind": "Reference",
700
+ "text": "ReadonlyArray",
701
+ "canonicalReference": "!ReadonlyArray:interface"
702
+ },
703
+ {
704
+ "kind": "Content",
705
+ "text": "<"
706
+ },
707
+ {
708
+ "kind": "Reference",
709
+ "text": "IMcpSkippedTool",
710
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpSkippedTool:interface"
711
+ },
712
+ {
713
+ "kind": "Content",
714
+ "text": ">"
715
+ },
716
+ {
717
+ "kind": "Content",
718
+ "text": ";"
719
+ }
720
+ ],
721
+ "isReadonly": true,
722
+ "isOptional": false,
723
+ "releaseTag": "Public",
724
+ "name": "skipped",
725
+ "propertyTypeTokenRange": {
726
+ "startIndex": 1,
727
+ "endIndex": 5
728
+ }
729
+ },
730
+ {
731
+ "kind": "PropertySignature",
732
+ "canonicalReference": "@fgv/ts-extras-mcp!IAdaptMcpToolsResult#tools:member",
733
+ "docComment": "/**\n * Tools adapted into `IAiClientTool` — safe to hand to `AiAssist.executeClientToolTurn`.\n */\n",
734
+ "excerptTokens": [
735
+ {
736
+ "kind": "Content",
737
+ "text": "readonly tools: "
738
+ },
739
+ {
740
+ "kind": "Reference",
741
+ "text": "ReadonlyArray",
742
+ "canonicalReference": "!ReadonlyArray:interface"
743
+ },
744
+ {
745
+ "kind": "Content",
746
+ "text": "<"
747
+ },
748
+ {
749
+ "kind": "Reference",
750
+ "text": "AiAssist.IAiClientTool",
751
+ "canonicalReference": "@fgv/ts-extras!IAiClientTool:interface"
752
+ },
753
+ {
754
+ "kind": "Content",
755
+ "text": ">"
756
+ },
757
+ {
758
+ "kind": "Content",
759
+ "text": ";"
760
+ }
761
+ ],
762
+ "isReadonly": true,
763
+ "isOptional": false,
764
+ "releaseTag": "Public",
765
+ "name": "tools",
766
+ "propertyTypeTokenRange": {
767
+ "startIndex": 1,
768
+ "endIndex": 5
769
+ }
770
+ }
771
+ ],
772
+ "extendsTokenRanges": []
773
+ },
774
+ {
775
+ "kind": "Interface",
776
+ "canonicalReference": "@fgv/ts-extras-mcp!IConnectMcpSessionParams:interface",
777
+ "docComment": "/**\n * Parameters for {@link connectMcpSession}.\n *\n * @public\n */\n",
778
+ "excerptTokens": [
779
+ {
780
+ "kind": "Content",
781
+ "text": "export interface IConnectMcpSessionParams "
782
+ }
783
+ ],
784
+ "fileUrlPath": "src/packlets/mcp/model.ts",
785
+ "releaseTag": "Public",
786
+ "name": "IConnectMcpSessionParams",
787
+ "preserveMemberOrder": false,
788
+ "members": [
789
+ {
790
+ "kind": "PropertySignature",
791
+ "canonicalReference": "@fgv/ts-extras-mcp!IConnectMcpSessionParams#clientName:member",
792
+ "docComment": "/**\n * Client name advertised to the server during the initialize handshake. Default `'@fgv/ts-extras-mcp'`.\n */\n",
793
+ "excerptTokens": [
794
+ {
795
+ "kind": "Content",
796
+ "text": "readonly clientName?: "
797
+ },
798
+ {
799
+ "kind": "Content",
800
+ "text": "string"
801
+ },
802
+ {
803
+ "kind": "Content",
804
+ "text": ";"
805
+ }
806
+ ],
807
+ "isReadonly": true,
808
+ "isOptional": true,
809
+ "releaseTag": "Public",
810
+ "name": "clientName",
811
+ "propertyTypeTokenRange": {
812
+ "startIndex": 1,
813
+ "endIndex": 2
814
+ }
815
+ },
816
+ {
817
+ "kind": "PropertySignature",
818
+ "canonicalReference": "@fgv/ts-extras-mcp!IConnectMcpSessionParams#clientVersion:member",
819
+ "docComment": "/**\n * Client version advertised to the server. Default the package version.\n */\n",
820
+ "excerptTokens": [
821
+ {
822
+ "kind": "Content",
823
+ "text": "readonly clientVersion?: "
824
+ },
825
+ {
826
+ "kind": "Content",
827
+ "text": "string"
828
+ },
829
+ {
830
+ "kind": "Content",
831
+ "text": ";"
832
+ }
833
+ ],
834
+ "isReadonly": true,
835
+ "isOptional": true,
836
+ "releaseTag": "Public",
837
+ "name": "clientVersion",
838
+ "propertyTypeTokenRange": {
839
+ "startIndex": 1,
840
+ "endIndex": 2
841
+ }
842
+ },
843
+ {
844
+ "kind": "PropertySignature",
845
+ "canonicalReference": "@fgv/ts-extras-mcp!IConnectMcpSessionParams#logger:member",
846
+ "docComment": "/**\n * Optional logger for connection diagnostics.\n */\n",
847
+ "excerptTokens": [
848
+ {
849
+ "kind": "Content",
850
+ "text": "readonly logger?: "
851
+ },
852
+ {
853
+ "kind": "Reference",
854
+ "text": "Logging.ILogger",
855
+ "canonicalReference": "@fgv/ts-utils!ILogger:interface"
856
+ },
857
+ {
858
+ "kind": "Content",
859
+ "text": ";"
860
+ }
861
+ ],
862
+ "isReadonly": true,
863
+ "isOptional": true,
864
+ "releaseTag": "Public",
865
+ "name": "logger",
866
+ "propertyTypeTokenRange": {
867
+ "startIndex": 1,
868
+ "endIndex": 2
869
+ }
870
+ },
871
+ {
872
+ "kind": "PropertySignature",
873
+ "canonicalReference": "@fgv/ts-extras-mcp!IConnectMcpSessionParams#transport:member",
874
+ "docComment": "/**\n * A transport produced by {@link createStdioTransport} / {@link createHttpTransport}.\n */\n",
875
+ "excerptTokens": [
876
+ {
877
+ "kind": "Content",
878
+ "text": "readonly transport: "
879
+ },
880
+ {
881
+ "kind": "Reference",
882
+ "text": "IMcpTransport",
883
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpTransport:interface"
884
+ },
885
+ {
886
+ "kind": "Content",
887
+ "text": ";"
888
+ }
889
+ ],
890
+ "isReadonly": true,
891
+ "isOptional": false,
892
+ "releaseTag": "Public",
893
+ "name": "transport",
894
+ "propertyTypeTokenRange": {
895
+ "startIndex": 1,
896
+ "endIndex": 2
897
+ }
898
+ }
899
+ ],
900
+ "extendsTokenRanges": []
901
+ },
902
+ {
903
+ "kind": "Interface",
904
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpHttpTransportParams:interface",
905
+ "docComment": "/**\n * Parameters for {@link createHttpTransport}. The transport connects to a Streamable-HTTP MCP endpoint.\n *\n * @public\n */\n",
906
+ "excerptTokens": [
907
+ {
908
+ "kind": "Content",
909
+ "text": "export interface IMcpHttpTransportParams "
910
+ }
911
+ ],
912
+ "fileUrlPath": "src/packlets/mcp/model.ts",
913
+ "releaseTag": "Public",
914
+ "name": "IMcpHttpTransportParams",
915
+ "preserveMemberOrder": false,
916
+ "members": [
917
+ {
918
+ "kind": "PropertySignature",
919
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpHttpTransportParams#headers:member",
920
+ "docComment": "/**\n * Optional static headers (e.g. an `Authorization` bearer token). OAuth/managed auth is out of scope at v0.1.\n */\n",
921
+ "excerptTokens": [
922
+ {
923
+ "kind": "Content",
924
+ "text": "readonly headers?: "
925
+ },
926
+ {
927
+ "kind": "Reference",
928
+ "text": "Record",
929
+ "canonicalReference": "!Record:type"
930
+ },
931
+ {
932
+ "kind": "Content",
933
+ "text": "<string, string>"
934
+ },
935
+ {
936
+ "kind": "Content",
937
+ "text": ";"
938
+ }
939
+ ],
940
+ "isReadonly": true,
941
+ "isOptional": true,
942
+ "releaseTag": "Public",
943
+ "name": "headers",
944
+ "propertyTypeTokenRange": {
945
+ "startIndex": 1,
946
+ "endIndex": 3
947
+ }
948
+ },
949
+ {
950
+ "kind": "PropertySignature",
951
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpHttpTransportParams#url:member",
952
+ "docComment": "/**\n * Absolute `http`/`https` URL of the MCP server endpoint.\n */\n",
953
+ "excerptTokens": [
954
+ {
955
+ "kind": "Content",
956
+ "text": "readonly url: "
957
+ },
958
+ {
959
+ "kind": "Content",
960
+ "text": "string"
961
+ },
962
+ {
963
+ "kind": "Content",
964
+ "text": ";"
965
+ }
966
+ ],
967
+ "isReadonly": true,
968
+ "isOptional": false,
969
+ "releaseTag": "Public",
970
+ "name": "url",
971
+ "propertyTypeTokenRange": {
972
+ "startIndex": 1,
973
+ "endIndex": 2
974
+ }
975
+ }
976
+ ],
977
+ "extendsTokenRanges": []
978
+ },
979
+ {
980
+ "kind": "Interface",
981
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpServerInfo:interface",
982
+ "docComment": "/**\n * Server identity reported during the MCP initialize handshake.\n *\n * @public\n */\n",
983
+ "excerptTokens": [
984
+ {
985
+ "kind": "Content",
986
+ "text": "export interface IMcpServerInfo "
987
+ }
988
+ ],
989
+ "fileUrlPath": "src/packlets/mcp/model.ts",
990
+ "releaseTag": "Public",
991
+ "name": "IMcpServerInfo",
992
+ "preserveMemberOrder": false,
993
+ "members": [
994
+ {
995
+ "kind": "PropertySignature",
996
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpServerInfo#name:member",
997
+ "docComment": "/**\n * Server-advertised name.\n */\n",
998
+ "excerptTokens": [
999
+ {
1000
+ "kind": "Content",
1001
+ "text": "readonly name: "
1002
+ },
1003
+ {
1004
+ "kind": "Content",
1005
+ "text": "string"
1006
+ },
1007
+ {
1008
+ "kind": "Content",
1009
+ "text": ";"
1010
+ }
1011
+ ],
1012
+ "isReadonly": true,
1013
+ "isOptional": false,
1014
+ "releaseTag": "Public",
1015
+ "name": "name",
1016
+ "propertyTypeTokenRange": {
1017
+ "startIndex": 1,
1018
+ "endIndex": 2
1019
+ }
1020
+ },
1021
+ {
1022
+ "kind": "PropertySignature",
1023
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpServerInfo#version:member",
1024
+ "docComment": "/**\n * Server-advertised version.\n */\n",
1025
+ "excerptTokens": [
1026
+ {
1027
+ "kind": "Content",
1028
+ "text": "readonly version: "
1029
+ },
1030
+ {
1031
+ "kind": "Content",
1032
+ "text": "string"
1033
+ },
1034
+ {
1035
+ "kind": "Content",
1036
+ "text": ";"
1037
+ }
1038
+ ],
1039
+ "isReadonly": true,
1040
+ "isOptional": false,
1041
+ "releaseTag": "Public",
1042
+ "name": "version",
1043
+ "propertyTypeTokenRange": {
1044
+ "startIndex": 1,
1045
+ "endIndex": 2
1046
+ }
1047
+ }
1048
+ ],
1049
+ "extendsTokenRanges": []
1050
+ },
1051
+ {
1052
+ "kind": "Interface",
1053
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpSession:interface",
1054
+ "docComment": "/**\n * Opaque handle to a connected MCP session. Pass it to {@link listMcpTools}, {@link callMcpTool}, {@link adaptMcpTools}, and {@link closeMcpSession}.\n *\n * @public\n */\n",
1055
+ "excerptTokens": [
1056
+ {
1057
+ "kind": "Content",
1058
+ "text": "export interface IMcpSession "
1059
+ }
1060
+ ],
1061
+ "fileUrlPath": "src/packlets/mcp/model.ts",
1062
+ "releaseTag": "Public",
1063
+ "name": "IMcpSession",
1064
+ "preserveMemberOrder": false,
1065
+ "members": [
1066
+ {
1067
+ "kind": "PropertySignature",
1068
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpSession#clientName:member",
1069
+ "docComment": "/**\n * Client name advertised during the handshake.\n */\n",
1070
+ "excerptTokens": [
1071
+ {
1072
+ "kind": "Content",
1073
+ "text": "readonly clientName: "
1074
+ },
1075
+ {
1076
+ "kind": "Content",
1077
+ "text": "string"
1078
+ },
1079
+ {
1080
+ "kind": "Content",
1081
+ "text": ";"
1082
+ }
1083
+ ],
1084
+ "isReadonly": true,
1085
+ "isOptional": false,
1086
+ "releaseTag": "Public",
1087
+ "name": "clientName",
1088
+ "propertyTypeTokenRange": {
1089
+ "startIndex": 1,
1090
+ "endIndex": 2
1091
+ }
1092
+ },
1093
+ {
1094
+ "kind": "PropertySignature",
1095
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpSession#clientVersion:member",
1096
+ "docComment": "/**\n * Client version advertised during the handshake.\n */\n",
1097
+ "excerptTokens": [
1098
+ {
1099
+ "kind": "Content",
1100
+ "text": "readonly clientVersion: "
1101
+ },
1102
+ {
1103
+ "kind": "Content",
1104
+ "text": "string"
1105
+ },
1106
+ {
1107
+ "kind": "Content",
1108
+ "text": ";"
1109
+ }
1110
+ ],
1111
+ "isReadonly": true,
1112
+ "isOptional": false,
1113
+ "releaseTag": "Public",
1114
+ "name": "clientVersion",
1115
+ "propertyTypeTokenRange": {
1116
+ "startIndex": 1,
1117
+ "endIndex": 2
1118
+ }
1119
+ },
1120
+ {
1121
+ "kind": "PropertySignature",
1122
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpSession#serverInfo:member",
1123
+ "docComment": "/**\n * Server identity reported by the handshake, when the server provided one.\n */\n",
1124
+ "excerptTokens": [
1125
+ {
1126
+ "kind": "Content",
1127
+ "text": "readonly serverInfo: "
1128
+ },
1129
+ {
1130
+ "kind": "Reference",
1131
+ "text": "IMcpServerInfo",
1132
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpServerInfo:interface"
1133
+ },
1134
+ {
1135
+ "kind": "Content",
1136
+ "text": " | undefined"
1137
+ },
1138
+ {
1139
+ "kind": "Content",
1140
+ "text": ";"
1141
+ }
1142
+ ],
1143
+ "isReadonly": true,
1144
+ "isOptional": false,
1145
+ "releaseTag": "Public",
1146
+ "name": "serverInfo",
1147
+ "propertyTypeTokenRange": {
1148
+ "startIndex": 1,
1149
+ "endIndex": 3
1150
+ }
1151
+ }
1152
+ ],
1153
+ "extendsTokenRanges": []
1154
+ },
1155
+ {
1156
+ "kind": "Interface",
1157
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpSkippedTool:interface",
1158
+ "docComment": "/**\n * A tool that was discovered but could NOT be adapted into an `AiAssist.IAiClientTool`, because its `inputSchema` is outside the JSON Schema subset supported by `JsonSchema.fromJson`. Surfaced structurally so callers/the probe can enumerate exactly which subset features a server needs (with the raw schema in hand to extend `fromJson` later).\n *\n * @public\n */\n",
1159
+ "excerptTokens": [
1160
+ {
1161
+ "kind": "Content",
1162
+ "text": "export interface IMcpSkippedTool "
1163
+ }
1164
+ ],
1165
+ "fileUrlPath": "src/packlets/mcp/model.ts",
1166
+ "releaseTag": "Public",
1167
+ "name": "IMcpSkippedTool",
1168
+ "preserveMemberOrder": false,
1169
+ "members": [
1170
+ {
1171
+ "kind": "PropertySignature",
1172
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpSkippedTool#name:member",
1173
+ "docComment": "/**\n * The tool's name.\n */\n",
1174
+ "excerptTokens": [
1175
+ {
1176
+ "kind": "Content",
1177
+ "text": "readonly name: "
1178
+ },
1179
+ {
1180
+ "kind": "Content",
1181
+ "text": "string"
1182
+ },
1183
+ {
1184
+ "kind": "Content",
1185
+ "text": ";"
1186
+ }
1187
+ ],
1188
+ "isReadonly": true,
1189
+ "isOptional": false,
1190
+ "releaseTag": "Public",
1191
+ "name": "name",
1192
+ "propertyTypeTokenRange": {
1193
+ "startIndex": 1,
1194
+ "endIndex": 2
1195
+ }
1196
+ },
1197
+ {
1198
+ "kind": "PropertySignature",
1199
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpSkippedTool#reason:member",
1200
+ "docComment": "/**\n * Why the tool was skipped — the JSON-pointer reason from `JsonSchema.fromJson`, or a structural reason.\n */\n",
1201
+ "excerptTokens": [
1202
+ {
1203
+ "kind": "Content",
1204
+ "text": "readonly reason: "
1205
+ },
1206
+ {
1207
+ "kind": "Content",
1208
+ "text": "string"
1209
+ },
1210
+ {
1211
+ "kind": "Content",
1212
+ "text": ";"
1213
+ }
1214
+ ],
1215
+ "isReadonly": true,
1216
+ "isOptional": false,
1217
+ "releaseTag": "Public",
1218
+ "name": "reason",
1219
+ "propertyTypeTokenRange": {
1220
+ "startIndex": 1,
1221
+ "endIndex": 2
1222
+ }
1223
+ },
1224
+ {
1225
+ "kind": "PropertySignature",
1226
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpSkippedTool#schema:member",
1227
+ "docComment": "/**\n * The raw failing input schema, verbatim, in hand for additively widening `JsonSchema.fromJson`.\n */\n",
1228
+ "excerptTokens": [
1229
+ {
1230
+ "kind": "Content",
1231
+ "text": "readonly schema: "
1232
+ },
1233
+ {
1234
+ "kind": "Reference",
1235
+ "text": "JsonValue",
1236
+ "canonicalReference": "@fgv/ts-json-base!JsonValue:type"
1237
+ },
1238
+ {
1239
+ "kind": "Content",
1240
+ "text": ";"
1241
+ }
1242
+ ],
1243
+ "isReadonly": true,
1244
+ "isOptional": false,
1245
+ "releaseTag": "Public",
1246
+ "name": "schema",
1247
+ "propertyTypeTokenRange": {
1248
+ "startIndex": 1,
1249
+ "endIndex": 2
1250
+ }
1251
+ }
1252
+ ],
1253
+ "extendsTokenRanges": []
1254
+ },
1255
+ {
1256
+ "kind": "Interface",
1257
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpStdioTransportParams:interface",
1258
+ "docComment": "/**\n * Parameters for {@link createStdioTransport}. The transport spawns `command` as a subprocess and speaks MCP over its stdin/stdout.\n *\n * @remarks\n *\n * **Security:** stdio transport executes a consumer-supplied command. Treat `command`/`args` as a trust boundary — never source them from untrusted input. See the package README.\n *\n * @public\n */\n",
1259
+ "excerptTokens": [
1260
+ {
1261
+ "kind": "Content",
1262
+ "text": "export interface IMcpStdioTransportParams "
1263
+ }
1264
+ ],
1265
+ "fileUrlPath": "src/packlets/mcp/model.ts",
1266
+ "releaseTag": "Public",
1267
+ "name": "IMcpStdioTransportParams",
1268
+ "preserveMemberOrder": false,
1269
+ "members": [
1270
+ {
1271
+ "kind": "PropertySignature",
1272
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpStdioTransportParams#args:member",
1273
+ "docComment": "/**\n * Arguments passed to the command.\n */\n",
1274
+ "excerptTokens": [
1275
+ {
1276
+ "kind": "Content",
1277
+ "text": "readonly args?: "
1278
+ },
1279
+ {
1280
+ "kind": "Reference",
1281
+ "text": "ReadonlyArray",
1282
+ "canonicalReference": "!ReadonlyArray:interface"
1283
+ },
1284
+ {
1285
+ "kind": "Content",
1286
+ "text": "<string>"
1287
+ },
1288
+ {
1289
+ "kind": "Content",
1290
+ "text": ";"
1291
+ }
1292
+ ],
1293
+ "isReadonly": true,
1294
+ "isOptional": true,
1295
+ "releaseTag": "Public",
1296
+ "name": "args",
1297
+ "propertyTypeTokenRange": {
1298
+ "startIndex": 1,
1299
+ "endIndex": 3
1300
+ }
1301
+ },
1302
+ {
1303
+ "kind": "PropertySignature",
1304
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpStdioTransportParams#command:member",
1305
+ "docComment": "/**\n * Executable to spawn (e.g. `'npx'`, `'node'`, an absolute path).\n */\n",
1306
+ "excerptTokens": [
1307
+ {
1308
+ "kind": "Content",
1309
+ "text": "readonly command: "
1310
+ },
1311
+ {
1312
+ "kind": "Content",
1313
+ "text": "string"
1314
+ },
1315
+ {
1316
+ "kind": "Content",
1317
+ "text": ";"
1318
+ }
1319
+ ],
1320
+ "isReadonly": true,
1321
+ "isOptional": false,
1322
+ "releaseTag": "Public",
1323
+ "name": "command",
1324
+ "propertyTypeTokenRange": {
1325
+ "startIndex": 1,
1326
+ "endIndex": 2
1327
+ }
1328
+ },
1329
+ {
1330
+ "kind": "PropertySignature",
1331
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpStdioTransportParams#cwd:member",
1332
+ "docComment": "/**\n * Working directory for the spawned process.\n */\n",
1333
+ "excerptTokens": [
1334
+ {
1335
+ "kind": "Content",
1336
+ "text": "readonly cwd?: "
1337
+ },
1338
+ {
1339
+ "kind": "Content",
1340
+ "text": "string"
1341
+ },
1342
+ {
1343
+ "kind": "Content",
1344
+ "text": ";"
1345
+ }
1346
+ ],
1347
+ "isReadonly": true,
1348
+ "isOptional": true,
1349
+ "releaseTag": "Public",
1350
+ "name": "cwd",
1351
+ "propertyTypeTokenRange": {
1352
+ "startIndex": 1,
1353
+ "endIndex": 2
1354
+ }
1355
+ },
1356
+ {
1357
+ "kind": "PropertySignature",
1358
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpStdioTransportParams#env:member",
1359
+ "docComment": "/**\n * Environment variables for the spawned process. When omitted, the SDK's safe default set is used.\n */\n",
1360
+ "excerptTokens": [
1361
+ {
1362
+ "kind": "Content",
1363
+ "text": "readonly env?: "
1364
+ },
1365
+ {
1366
+ "kind": "Reference",
1367
+ "text": "Record",
1368
+ "canonicalReference": "!Record:type"
1369
+ },
1370
+ {
1371
+ "kind": "Content",
1372
+ "text": "<string, string>"
1373
+ },
1374
+ {
1375
+ "kind": "Content",
1376
+ "text": ";"
1377
+ }
1378
+ ],
1379
+ "isReadonly": true,
1380
+ "isOptional": true,
1381
+ "releaseTag": "Public",
1382
+ "name": "env",
1383
+ "propertyTypeTokenRange": {
1384
+ "startIndex": 1,
1385
+ "endIndex": 3
1386
+ }
1387
+ }
1388
+ ],
1389
+ "extendsTokenRanges": []
1390
+ },
1391
+ {
1392
+ "kind": "Interface",
1393
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpToolCallResult:interface",
1394
+ "docComment": "/**\n * Successful projection of an MCP `CallToolResult` produced by {@link callMcpTool}.\n *\n * @remarks\n *\n * `content` is the text concatenation of the result's `text` blocks; non-text blocks (image / audio / resource) are projected to a one-line `[<type> block]` summary (multimodal passthrough is out of scope at v0.1). A result with `isError: true` is mapped to `Result.fail(content)` rather than returned here, so it is never silently swallowed.\n *\n * @public\n */\n",
1395
+ "excerptTokens": [
1396
+ {
1397
+ "kind": "Content",
1398
+ "text": "export interface IMcpToolCallResult "
1399
+ }
1400
+ ],
1401
+ "fileUrlPath": "src/packlets/mcp/model.ts",
1402
+ "releaseTag": "Public",
1403
+ "name": "IMcpToolCallResult",
1404
+ "preserveMemberOrder": false,
1405
+ "members": [
1406
+ {
1407
+ "kind": "PropertySignature",
1408
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpToolCallResult#content:member",
1409
+ "docComment": "/**\n * The projected text content of the tool result.\n */\n",
1410
+ "excerptTokens": [
1411
+ {
1412
+ "kind": "Content",
1413
+ "text": "readonly content: "
1414
+ },
1415
+ {
1416
+ "kind": "Content",
1417
+ "text": "string"
1418
+ },
1419
+ {
1420
+ "kind": "Content",
1421
+ "text": ";"
1422
+ }
1423
+ ],
1424
+ "isReadonly": true,
1425
+ "isOptional": false,
1426
+ "releaseTag": "Public",
1427
+ "name": "content",
1428
+ "propertyTypeTokenRange": {
1429
+ "startIndex": 1,
1430
+ "endIndex": 2
1431
+ }
1432
+ }
1433
+ ],
1434
+ "extendsTokenRanges": []
1435
+ },
1436
+ {
1437
+ "kind": "Interface",
1438
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpToolDescriptor:interface",
1439
+ "docComment": "/**\n * A tool descriptor discovered from an MCP server via {@link listMcpTools}.\n *\n * @public\n */\n",
1440
+ "excerptTokens": [
1441
+ {
1442
+ "kind": "Content",
1443
+ "text": "export interface IMcpToolDescriptor "
1444
+ }
1445
+ ],
1446
+ "fileUrlPath": "src/packlets/mcp/model.ts",
1447
+ "releaseTag": "Public",
1448
+ "name": "IMcpToolDescriptor",
1449
+ "preserveMemberOrder": false,
1450
+ "members": [
1451
+ {
1452
+ "kind": "PropertySignature",
1453
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpToolDescriptor#description:member",
1454
+ "docComment": "/**\n * Human-readable description, when the server provided one.\n */\n",
1455
+ "excerptTokens": [
1456
+ {
1457
+ "kind": "Content",
1458
+ "text": "readonly description: "
1459
+ },
1460
+ {
1461
+ "kind": "Content",
1462
+ "text": "string | undefined"
1463
+ },
1464
+ {
1465
+ "kind": "Content",
1466
+ "text": ";"
1467
+ }
1468
+ ],
1469
+ "isReadonly": true,
1470
+ "isOptional": false,
1471
+ "releaseTag": "Public",
1472
+ "name": "description",
1473
+ "propertyTypeTokenRange": {
1474
+ "startIndex": 1,
1475
+ "endIndex": 2
1476
+ }
1477
+ },
1478
+ {
1479
+ "kind": "PropertySignature",
1480
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpToolDescriptor#inputSchema:member",
1481
+ "docComment": "/**\n * The tool's declared input schema as raw JSON. Per the MCP spec this is normally a JSON Schema object; carried verbatim so {@link adaptMcpTools} can run it through `JsonSchema.fromJson` (and surface it on {@link IMcpSkippedTool} when it is outside the supported subset).\n */\n",
1482
+ "excerptTokens": [
1483
+ {
1484
+ "kind": "Content",
1485
+ "text": "readonly inputSchema: "
1486
+ },
1487
+ {
1488
+ "kind": "Reference",
1489
+ "text": "JsonValue",
1490
+ "canonicalReference": "@fgv/ts-json-base!JsonValue:type"
1491
+ },
1492
+ {
1493
+ "kind": "Content",
1494
+ "text": ";"
1495
+ }
1496
+ ],
1497
+ "isReadonly": true,
1498
+ "isOptional": false,
1499
+ "releaseTag": "Public",
1500
+ "name": "inputSchema",
1501
+ "propertyTypeTokenRange": {
1502
+ "startIndex": 1,
1503
+ "endIndex": 2
1504
+ }
1505
+ },
1506
+ {
1507
+ "kind": "PropertySignature",
1508
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpToolDescriptor#name:member",
1509
+ "docComment": "/**\n * Tool name (unique within a server).\n */\n",
1510
+ "excerptTokens": [
1511
+ {
1512
+ "kind": "Content",
1513
+ "text": "readonly name: "
1514
+ },
1515
+ {
1516
+ "kind": "Content",
1517
+ "text": "string"
1518
+ },
1519
+ {
1520
+ "kind": "Content",
1521
+ "text": ";"
1522
+ }
1523
+ ],
1524
+ "isReadonly": true,
1525
+ "isOptional": false,
1526
+ "releaseTag": "Public",
1527
+ "name": "name",
1528
+ "propertyTypeTokenRange": {
1529
+ "startIndex": 1,
1530
+ "endIndex": 2
1531
+ }
1532
+ }
1533
+ ],
1534
+ "extendsTokenRanges": []
1535
+ },
1536
+ {
1537
+ "kind": "Interface",
1538
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpTransport:interface",
1539
+ "docComment": "/**\n * Opaque handle to an MCP transport produced by {@link createStdioTransport} or {@link createHttpTransport}. Hand it to {@link connectMcpSession}; do not construct directly.\n *\n * @public\n */\n",
1540
+ "excerptTokens": [
1541
+ {
1542
+ "kind": "Content",
1543
+ "text": "export interface IMcpTransport "
1544
+ }
1545
+ ],
1546
+ "fileUrlPath": "src/packlets/mcp/model.ts",
1547
+ "releaseTag": "Public",
1548
+ "name": "IMcpTransport",
1549
+ "preserveMemberOrder": false,
1550
+ "members": [
1551
+ {
1552
+ "kind": "PropertySignature",
1553
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpTransport#transportKind:member",
1554
+ "docComment": "/**\n * Which transport kind this handle wraps.\n */\n",
1555
+ "excerptTokens": [
1556
+ {
1557
+ "kind": "Content",
1558
+ "text": "readonly transportKind: "
1559
+ },
1560
+ {
1561
+ "kind": "Content",
1562
+ "text": "'stdio' | 'http'"
1563
+ },
1564
+ {
1565
+ "kind": "Content",
1566
+ "text": ";"
1567
+ }
1568
+ ],
1569
+ "isReadonly": true,
1570
+ "isOptional": false,
1571
+ "releaseTag": "Public",
1572
+ "name": "transportKind",
1573
+ "propertyTypeTokenRange": {
1574
+ "startIndex": 1,
1575
+ "endIndex": 2
1576
+ }
1577
+ }
1578
+ ],
1579
+ "extendsTokenRanges": []
1580
+ },
1581
+ {
1582
+ "kind": "Function",
1583
+ "canonicalReference": "@fgv/ts-extras-mcp!listMcpTools:function(1)",
1584
+ "docComment": "/**\n * Lists every tool a connected MCP server advertises, following the SDK's `nextCursor` pagination until the full catalog is accumulated.\n *\n * @param session - A session from `connectMcpSession`.\n *\n * @returns `Success` with the full tool catalog, or `Failure` on a foreign handle or a transport/protocol error.\n *\n * @public\n */\n",
1585
+ "excerptTokens": [
1586
+ {
1587
+ "kind": "Content",
1588
+ "text": "export declare function listMcpTools(session: "
1589
+ },
1590
+ {
1591
+ "kind": "Reference",
1592
+ "text": "IMcpSession",
1593
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpSession:interface"
1594
+ },
1595
+ {
1596
+ "kind": "Content",
1597
+ "text": "): "
1598
+ },
1599
+ {
1600
+ "kind": "Reference",
1601
+ "text": "Promise",
1602
+ "canonicalReference": "!Promise:interface"
1603
+ },
1604
+ {
1605
+ "kind": "Content",
1606
+ "text": "<"
1607
+ },
1608
+ {
1609
+ "kind": "Reference",
1610
+ "text": "Result",
1611
+ "canonicalReference": "@fgv/ts-utils!Result:type"
1612
+ },
1613
+ {
1614
+ "kind": "Content",
1615
+ "text": "<"
1616
+ },
1617
+ {
1618
+ "kind": "Reference",
1619
+ "text": "ReadonlyArray",
1620
+ "canonicalReference": "!ReadonlyArray:interface"
1621
+ },
1622
+ {
1623
+ "kind": "Content",
1624
+ "text": "<"
1625
+ },
1626
+ {
1627
+ "kind": "Reference",
1628
+ "text": "IMcpToolDescriptor",
1629
+ "canonicalReference": "@fgv/ts-extras-mcp!IMcpToolDescriptor:interface"
1630
+ },
1631
+ {
1632
+ "kind": "Content",
1633
+ "text": ">>>"
1634
+ },
1635
+ {
1636
+ "kind": "Content",
1637
+ "text": ";"
1638
+ }
1639
+ ],
1640
+ "fileUrlPath": "src/packlets/mcp/operations.ts",
1641
+ "returnTypeTokenRange": {
1642
+ "startIndex": 3,
1643
+ "endIndex": 11
1644
+ },
1645
+ "releaseTag": "Public",
1646
+ "overloadIndex": 1,
1647
+ "parameters": [
1648
+ {
1649
+ "parameterName": "session",
1650
+ "parameterTypeTokenRange": {
1651
+ "startIndex": 1,
1652
+ "endIndex": 2
1653
+ },
1654
+ "isOptional": false
1655
+ }
1656
+ ],
1657
+ "name": "listMcpTools"
1658
+ }
1659
+ ]
1660
+ }
1661
+ ]
1662
+ }