@foldkit/devtools-mcp 0.1.1 → 0.1.2

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 (3) hide show
  1. package/README.md +12 -12
  2. package/dist/tools.js +2 -2
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -7,7 +7,7 @@ With it attached, agents can:
7
7
  - Read the current Model
8
8
  - List and inspect the Message history
9
9
  - Replay to any past state and resume
10
- - Dispatch Messages into the runtime, validated against your `Message` Schema
10
+ - Dispatch Messages into the runtime, decoded against your `Message` Schema
11
11
 
12
12
  ## Quick Start
13
13
 
@@ -44,7 +44,7 @@ export default defineConfig({
44
44
  })
45
45
  ```
46
46
 
47
- In your `Runtime.makeProgram` call, pass your `Message` Schema. This is what the agent sees when it asks "what Messages can I dispatch?", and it gates dispatch by validating every payload before it reaches your update function:
47
+ In your `Runtime.makeProgram` call, pass your `Message` Schema. The runtime decodes every dispatched payload against it, returning a clean error if the shape does not match before it reaches your update function:
48
48
 
49
49
  ```typescript
50
50
  Runtime.makeProgram({
@@ -63,16 +63,16 @@ The browser bridge runs inside your app, so the MCP server only sees a runtime w
63
63
 
64
64
  Each tool accepts an optional `runtime_id`. When omitted, the most recently connected runtime is used.
65
65
 
66
- | Tool | Description |
67
- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
68
- | `foldkit_list_runtimes` | Returns metadata for every connected browser tab, including each runtime's Message Schema as JSON Schema. Agents call this first to discover what they can dispatch. |
69
- | `foldkit_get_model` | Snapshots the current Model. |
70
- | `foldkit_list_messages` | Lists recent Message history entries with pagination. Each entry carries the Message body, command names triggered, timestamp, and a path-level diff. |
71
- | `foldkit_get_message` | Reads one entry at a given index, including the Model before and after the Message was applied. |
72
- | `foldkit_list_keyframes` | Returns the indices Foldkit can replay back to. Index `-1` is the initial Model. |
73
- | `foldkit_replay_to_keyframe` | Time-travels the runtime to a previous state. The runtime is paused at that snapshot until `foldkit_resume` is called. |
74
- | `foldkit_resume` | Resumes normal execution after a replay. |
75
- | `foldkit_dispatch_message` | Enqueues a Message into the runtime as if your application produced it. The bridge validates the payload against your Schema before it reaches the update loop. |
66
+ | Tool | Description |
67
+ | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
68
+ | `foldkit_list_runtimes` | Returns metadata for every connected browser tab. Agents call this first to discover which runtime to target. |
69
+ | `foldkit_get_model` | Snapshots the current Model. |
70
+ | `foldkit_list_messages` | Lists recent Message history entries with pagination. Each entry carries the Message body, command names triggered, timestamp, and a path-level diff. |
71
+ | `foldkit_get_message` | Reads one entry at a given index, including the Model before and after the Message was applied. |
72
+ | `foldkit_list_keyframes` | Returns the indices Foldkit can replay back to. Index `-1` is the initial Model. |
73
+ | `foldkit_replay_to_keyframe` | Time-travels the runtime to a previous state. The runtime is paused at that snapshot until `foldkit_resume` is called. |
74
+ | `foldkit_resume` | Resumes normal execution after a replay. |
75
+ | `foldkit_dispatch_message` | Enqueues a Message into the runtime as if your application produced it. The runtime decodes the payload against your Schema and returns a clean error if it does not match. |
76
76
 
77
77
  ## Architecture
78
78
 
package/dist/tools.js CHANGED
@@ -40,7 +40,7 @@ const ResumeInput = S.Struct({
40
40
  const DispatchMessageInput = S.Struct({
41
41
  runtime_id: RuntimeIdField,
42
42
  message: S.Unknown.annotations({
43
- description: "A Foldkit Message object to dispatch into the runtime. Must match the runtime's Message Schema (call foldkit_list_runtimes and inspect each runtime's maybeMessageSchema field for the exact shape). At minimum it has a `_tag` field naming the variant.",
43
+ description: "A Foldkit Message object to dispatch into the runtime. Must match the runtime's Message Schema read the application's source to see the exact shape. At minimum it has a `_tag` field naming the variant. The runtime decodes the payload and returns a clean error if it doesn't match.",
44
44
  }),
45
45
  });
46
46
  /**
@@ -146,7 +146,7 @@ export const buildTools = (wsClient) => [
146
146
  },
147
147
  {
148
148
  name: 'foldkit_dispatch_message',
149
- description: "Dispatch a Message into a Foldkit runtime's message queue, as if the application itself produced it. Requires the runtime to have configured DevToolsConfig.Message; without it, dispatch is rejected. Use foldkit_list_runtimes to discover the runtime's maybeMessageSchema and construct a Message object.",
149
+ description: "Dispatch a Message into a Foldkit runtime's message queue, as if the application itself produced it. Requires the runtime to have configured DevToolsConfig.Message; without it, dispatch is rejected. Read the application's Message Schema source to construct a valid Message object. The runtime decodes the payload and returns a clean error if it doesn't match.",
150
150
  inputSchema: JSONSchema.make(DispatchMessageInput),
151
151
  handle: runRuntimeTool(DispatchMessageInput, ({ message }) => RequestDispatchMessage({ message }), wsClient),
152
152
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foldkit/devtools-mcp",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
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",
@@ -29,7 +29,7 @@
29
29
  "effect": "^3.19.19",
30
30
  "rimraf": "^6.0.0",
31
31
  "typescript": "^6.0.2",
32
- "foldkit": "0.76.1"
32
+ "foldkit": "0.77.0"
33
33
  },
34
34
  "files": [
35
35
  "dist"