@foldkit/devtools-mcp 0.25.0-canary.f3be22cfeefe → 0.25.0-canary.fbc0bbd6fde6
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/README.md +23 -29
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +2 -2
- package/dist/relayClient.d.ts.map +1 -1
- package/dist/relayLocation.d.ts.map +1 -1
- package/dist/relayRegistry.d.ts.map +1 -1
- package/dist/relayRegistryTrust.d.ts.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +9923 -7109
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +6 -6
- package/package.json +11 -11
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAkB,MAAM,QAAQ,CAAA;AAOtD,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,kBAAkB,CAAA;AA0LzB,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAA;IAChE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAC,CAAA;AAEF,8HAA8H;AAC9H,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;CACzD,CAAC,CAAA;AAyEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,gBACR,WAAW,KACvB,aAAa,CAAC,cAAc,CAsM9B,CAAA"}
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAkB,MAAM,QAAQ,CAAA;AAOtD,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,kBAAkB,CAAA;AA0LzB,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAA;IAChE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAC,CAAA;AAEF,8HAA8H;AAC9H,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;CACzD,CAAC,CAAA;AAyEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,gBACR,WAAW,KACvB,aAAa,CAAC,cAAc,CAsM9B,CAAA"}
|
package/dist/tools.js
CHANGED
|
@@ -104,7 +104,7 @@ const DispatchMessagesInput = Schema.Struct({
|
|
|
104
104
|
}),
|
|
105
105
|
});
|
|
106
106
|
const VariantTagField = Schema.optional(Schema.String.annotate({
|
|
107
|
-
description: 'Optional dot-separated path of variant `_tag` values. When omitted, the tool returns a small variant index (tag names plus payload field names plus a tagged-union indicator) so agents can enumerate the top-level union cheaply. When provided, the tool walks the path through each variant\'s single tagged-union payload field, narrows the schema along the chain, and collapses any union deeper than the path to a `{ "_summary": "union", "variants": [...] }` placeholder. Extend the path to drill further. Examples: `"ScrolledSidebar"` (one top-level variant), `"GotMobileMenuDialogMessage.GotAnimationMessage"` (two levels of a
|
|
107
|
+
description: 'Optional dot-separated path of variant `_tag` values. When omitted, the tool returns a small variant index (tag names plus payload field names plus a tagged-union indicator) so agents can enumerate the top-level union cheaply. When provided, the tool walks the path through each variant\'s single tagged-union payload field, narrows the schema along the chain, and collapses any union deeper than the path to a `{ "_summary": "union", "variants": [...] }` placeholder. Extend the path to drill further. Examples: `"ScrolledSidebar"` (one top-level variant), `"GotMobileMenuDialogMessage.GotAnimationMessage"` (two levels of a Submodel chain).',
|
|
108
108
|
}));
|
|
109
109
|
const GetMessageSchemaInput = Schema.Struct({
|
|
110
110
|
runtime_id: RuntimeIdField,
|
|
@@ -212,13 +212,13 @@ export const buildTools = (relayClient) => [
|
|
|
212
212
|
},
|
|
213
213
|
{
|
|
214
214
|
name: 'foldkit_get_message',
|
|
215
|
-
description: 'Read a single Message history entry by absolute index. The response carries the SerializedEntry (tag, message body, commands, mountStarts, mountEnds, timestamp, `isModelChanged`, `changedPaths` for leaf-level mutations, `affectedPaths` adding their ancestor paths). Each entry in `commands` carries the Command name, `args` (`Some(record)` when the Command declared an args schema, `None` otherwise), and `
|
|
215
|
+
description: 'Read a single Message history entry by absolute index. The response carries the SerializedEntry (tag, message body, commands, mountStarts, mountEnds, timestamp, `isModelChanged`, `changedPaths` for leaf-level mutations, `affectedPaths` adding their ancestor paths). Each entry in `commands` carries the Command name, `args` (`Some(record)` when the Command declared an args schema, `None` otherwise), and `maybeSubmodelPath` (`None` before the result resolves, `Some([])` for a resolved top-level Command, or `Some(tags)` for a resolved Submodel Command). `mountStarts` lists Mounts that fired during the render after this Message; `mountEnds` lists Mounts whose elements were unmounted during that render. Each Mount carries its `name` and `args` (`Some(record)` when the Mount declared an args schema, `None` otherwise). For Submodel-routed entries (tag matches `Got*Message`), the entry also carries `submodelPath` listing wrapper tags from outer to inner and `maybeLeafTag` naming the innermost child Message. Model snapshots are not included; call foldkit_get_model_at with `index - 1` (before) and `index` (after) to inspect Model state around the entry.',
|
|
216
216
|
inputSchema: toInputSchema(GetMessageInput),
|
|
217
217
|
handle: runRuntimeTool(GetMessageInput, ({ index }) => Request.RequestGetMessage({ index }), relayClient),
|
|
218
218
|
},
|
|
219
219
|
{
|
|
220
220
|
name: 'foldkit_get_init',
|
|
221
|
-
description: "Read the runtime's initial Model, the Commands returned from the application's `init` function, and the Mounts that fired during the first render. The init entry is the synthetic row at index -1 in the DevTools panel; this tool exposes the same data without time-travelling the runtime. `maybeModel` is `None` until the runtime has finished its first render and recorded init, then stays `Some` for the rest of the runtime's life. `commands` lists init-time Commands in the order they were produced, each with its name, `args` (`Some(record)` when the Command declared an args schema, `None` otherwise), and `
|
|
221
|
+
description: "Read the runtime's initial Model, the Commands returned from the application's `init` function, and the Mounts that fired during the first render. The init entry is the synthetic row at index -1 in the DevTools panel; this tool exposes the same data without time-travelling the runtime. `maybeModel` is `None` until the runtime has finished its first render and recorded init, then stays `Some` for the rest of the runtime's life. `commands` lists init-time Commands in the order they were produced, each with its name, `args` (`Some(record)` when the Command declared an args schema, `None` otherwise), and `maybeSubmodelPath` (`None` before the result resolves, `Some([])` for a resolved top-level Command, or `Some(tags)` for a resolved Submodel Command); `mountStarts` lists Mounts whose elements appeared in the initial render, each with its name and `args` (`Some(record)` when the Mount declared an args schema, `None` otherwise).",
|
|
222
222
|
inputSchema: toInputSchema(GetInitInput),
|
|
223
223
|
handle: runRuntimeTool(GetInitInput, () => Request.RequestGetInit(), relayClient),
|
|
224
224
|
},
|
|
@@ -248,7 +248,7 @@ export const buildTools = (relayClient) => [
|
|
|
248
248
|
},
|
|
249
249
|
{
|
|
250
250
|
name: 'foldkit_get_message_schema',
|
|
251
|
-
description: 'Describe the Message Schema for a Foldkit runtime so agents can construct valid payloads for `foldkit_dispatch_message`. Call with no arguments to receive a small variant index (every top-level variant\'s `_tag`, its payload field names, and which payload fields are themselves tagged-union shapes). Then call with `variant_tag: "ChosenVariant"` to drill in. The argument is a dot-separated path of variant `_tag` values: each segment names a variant, and the walker steps through the variant\'s single tagged-union payload field to reach the next. So `"GotMobileMenuDialogMessage"` narrows one level; `"GotMobileMenuDialogMessage.GotAnimationMessage"` narrows two levels of a
|
|
251
|
+
description: 'Describe the Message Schema for a Foldkit runtime so agents can construct valid payloads for `foldkit_dispatch_message`. Call with no arguments to receive a small variant index (every top-level variant\'s `_tag`, its payload field names, and which payload fields are themselves tagged-union shapes). Then call with `variant_tag: "ChosenVariant"` to drill in. The argument is a dot-separated path of variant `_tag` values: each segment names a variant, and the walker steps through the variant\'s single tagged-union payload field to reach the next. So `"GotMobileMenuDialogMessage"` narrows one level; `"GotMobileMenuDialogMessage.GotAnimationMessage"` narrows two levels of a Submodel chain. Discriminated unions deeper than the supplied path collapse to `{ "_summary": "union", "variants": [...] }` placeholders so the response stays compact even for deeply-nested apps; extend the path to drill further. `Schema.Option` fields render as `anyOf: [{_tag: "Some", value}, {_tag: "None"}]`. The full document follows the JSON Schema draft-2020-12 shape from `Schema.toJsonSchemaDocument`: `{ dialect, schema, definitions }`. Returns `maybeResult: None` when the runtime hasn\'t configured `DevToolsConfig.Message` (dispatch is also unavailable). Fields with no JSON representation, notably `Schema.instanceOf(File)` for user-uploaded files, render as `{type: "null"}`; those variants can\'t be dispatched via MCP because their values live in browser memory.',
|
|
252
252
|
inputSchema: toInputSchema(GetMessageSchemaInput),
|
|
253
253
|
handle: runRuntimeTool(GetMessageSchemaInput, ({ variant_tag }) => Request.RequestGetMessageSchema({
|
|
254
254
|
maybeVariantTag: Option.fromNullishOr(variant_tag),
|
|
@@ -256,13 +256,13 @@ export const buildTools = (relayClient) => [
|
|
|
256
256
|
},
|
|
257
257
|
{
|
|
258
258
|
name: 'foldkit_dispatch_message',
|
|
259
|
-
description: "Dispatch a Message into a Foldkit runtime, as if the application itself produced it. Requires
|
|
259
|
+
description: "Dispatch a Message into a Foldkit runtime, as if the application itself produced it. Requires the runtime to have configured DevToolsConfig.Message; without it, dispatch is rejected. Call `foldkit_get_message_schema` with no arguments to enumerate the variants, then with `variant_tag` to learn one variant's exact payload shape, before constructing the Message object. The runtime decodes the payload and returns a clean error if it doesn't match. To dispatch several Messages in order with one call, use foldkit_dispatch_messages.",
|
|
260
260
|
inputSchema: toInputSchema(DispatchMessageInput),
|
|
261
261
|
handle: runRuntimeTool(DispatchMessageInput, ({ message }) => Request.RequestDispatchMessage({ message }), relayClient),
|
|
262
262
|
},
|
|
263
263
|
{
|
|
264
264
|
name: 'foldkit_dispatch_messages',
|
|
265
|
-
description: `Dispatch an ordered batch of Messages into a Foldkit runtime in one call, first to last, as if the application produced them in quick succession. Prefer this over repeated foldkit_dispatch_message calls when staging state that takes several Messages: reproducing a bug, filling a form, or building a history fixture. Takes 1 to ${MAX_DISPATCH_BATCH_SIZE} Messages. Validation is all-or-nothing: the runtime decodes every payload against the Message Schema before dispatching any of them, and one invalid entry rejects the whole batch with an error naming its zero-based position, so there is never a partially applied prefix to clean up.
|
|
265
|
+
description: `Dispatch an ordered batch of Messages into a Foldkit runtime in one call, first to last, as if the application produced them in quick succession. Prefer this over repeated foldkit_dispatch_message calls when staging state that takes several Messages: reproducing a bug, filling a form, or building a history fixture. Takes 1 to ${MAX_DISPATCH_BATCH_SIZE} Messages. Validation is all-or-nothing: the runtime decodes every payload against the Message Schema before dispatching any of them, and one invalid entry rejects the whole batch with an error naming its zero-based position, so there is never a partially applied prefix to clean up. On success the response carries acceptedAtIndices, the predicted history index for each Message in request order; the runtime may still record its own Messages between entries (for example a Command completing mid-burst), exactly as with rapid user input, and Messages excluded from history via excludeFromHistory are dispatched but never recorded, so entries after one land below their predicted index. Requires DevToolsConfig.Message, like foldkit_dispatch_message.`,
|
|
266
266
|
inputSchema: toInputSchema(DispatchMessagesInput),
|
|
267
267
|
handle: runRuntimeTool(DispatchMessagesInput, ({ messages }) => Request.RequestDispatchMessages({ messages }), relayClient),
|
|
268
268
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foldkit/devtools-mcp",
|
|
3
|
-
"version": "0.25.0-canary.
|
|
3
|
+
"version": "0.25.0-canary.fbc0bbd6fde6",
|
|
4
4
|
"description": "MCP server exposing Foldkit DevTools to AI agents (Claude Code, Cursor, etc.)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/server.js",
|
|
@@ -16,24 +16,24 @@
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"effect": "4.
|
|
20
|
-
"foldkit": "0.169.0-canary.
|
|
19
|
+
"effect": "~4.1.0",
|
|
20
|
+
"foldkit": "0.169.0-canary.fbc0bbd6fde6"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@modelcontextprotocol/sdk": "1.
|
|
23
|
+
"@modelcontextprotocol/sdk": "1.29.0",
|
|
24
24
|
"ws": "^8.21.3"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@effect/platform-node": "4.
|
|
28
|
-
"@foldkit/vite-plugin": "0.28.0-canary.
|
|
27
|
+
"@effect/platform-node": "4.1.0",
|
|
28
|
+
"@foldkit/vite-plugin": "0.28.0-canary.fbc0bbd6fde6",
|
|
29
29
|
"@types/node": "26.4.0",
|
|
30
30
|
"@types/ws": "^8.18.1",
|
|
31
|
-
"effect": "4.
|
|
32
|
-
"foldkit": "0.169.0-canary.
|
|
31
|
+
"effect": "4.1.0",
|
|
32
|
+
"foldkit": "0.169.0-canary.fbc0bbd6fde6",
|
|
33
33
|
"rimraf": "^6.1.3",
|
|
34
34
|
"rolldown": "^1.2.11",
|
|
35
|
-
"typescript": "7.
|
|
36
|
-
"vite": "^8.3.
|
|
35
|
+
"typescript": "^7.0.2",
|
|
36
|
+
"vite": "^8.3.1",
|
|
37
37
|
"vitest": "^4.1.11"
|
|
38
38
|
},
|
|
39
39
|
"files": [
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
61
|
-
"node": ">=
|
|
61
|
+
"node": ">=22.19.0"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"clean": "rimraf dist *.tsbuildinfo",
|