@llui/mcp 0.0.11 → 0.0.13

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 CHANGED
@@ -69,3 +69,49 @@ export default defineConfig({ plugins: [llui({ mcpPort: 5200 })] })
69
69
  | ------------------ | ------------------------------------------ |
70
70
  | `list_components` | List all mounted component instances |
71
71
  | `select_component` | Select a component for subsequent commands |
72
+
73
+ ### View and DOM
74
+
75
+ | Tool | Description |
76
+ | ------------------- | ------------------------------------------------------------------------ |
77
+ | `inspect_element` | Rich report: tag, attrs, classes, data-\*, text, computed, box, bindings |
78
+ | `get_rendered_html` | outerHTML of a selector (default = mount root), truncatable |
79
+ | `dom_diff` | Compare expected HTML against rendered HTML |
80
+ | `dispatch_event` | Synthesize a browser event; returns Msgs produced + resulting state |
81
+ | `get_focus` | Active element info: selector, tag, selection range |
82
+
83
+ ### Bindings and Scope
84
+
85
+ | Tool | Description |
86
+ | -------------------- | -------------------------------------------------------------- |
87
+ | `force_rerender` | Re-evaluate all bindings; returns indices that changed |
88
+ | `each_diff` | Per-each-site add/remove/move/reuse per update |
89
+ | `scope_tree` | Scope hierarchy with kind (root/show/each/branch/child/portal) |
90
+ | `disposer_log` | Recent scope disposals with cause |
91
+ | `list_dead_bindings` | Bindings that are dead or have never changed value |
92
+ | `binding_graph` | state path -> binding indices (inverts compiler mask legend) |
93
+
94
+ ### Effects
95
+
96
+ | Tool | Description |
97
+ | ----------------- | ---------------------------------------------------------------------- |
98
+ | `pending_effects` | Queued and in-flight effects |
99
+ | `effect_timeline` | Phased log: dispatched -> in-flight -> resolved/cancelled |
100
+ | `mock_effect` | Register match->response mock; next matching effect resolves with mock |
101
+ | `resolve_effect` | Manually resolve a specific pending effect |
102
+
103
+ ### Time Travel and Utilities
104
+
105
+ | Tool | Description |
106
+ | ---------------- | -------------------------------------------------------------- |
107
+ | `step_back` | Rewind N messages by replaying from init (pure mode default) |
108
+ | `coverage` | Per-Msg variant fire counts + list of never-fired variants |
109
+ | `diff_state` | Structured JSON diff between two state values |
110
+ | `assert` | Evaluate eq/neq/exists/gt/lt/in against a state path |
111
+ | `search_history` | Filter history by type, statePath change, effectType, or range |
112
+
113
+ ### Eval
114
+
115
+ | Tool | Description |
116
+ | ------ | --------------------------------------------------------------------- |
117
+ | `eval` | Arbitrary JS in page context; returns result + observability envelope |
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { LluiDebugAPI } from '@llui/dom';
2
+ import { type ToolDefinition } from './tool-registry.js';
2
3
  /**
3
4
  * Walk up from `start` until we find a workspace root marker. Used by
4
5
  * both the MCP server (writing the active marker) and the Vite plugin
@@ -22,27 +23,21 @@ export declare function findWorkspaceRoot(start?: string): string;
22
23
  * when one runs from the repo root and the other from a subpackage.
23
24
  */
24
25
  export declare function mcpActiveFilePath(cwd?: string): string;
25
- interface McpToolDefinition {
26
- name: string;
27
- description: string;
28
- inputSchema: {
29
- type: 'object';
30
- properties: Record<string, unknown>;
31
- required?: string[];
32
- };
33
- }
34
- declare const TOOLS: McpToolDefinition[];
35
26
  export declare class LluiMcpServer {
36
- /** Direct (same-process) debug API, used for tests or in-process bridging. */
37
- private debugApi;
38
- /** Bridge (WebSocket) state for out-of-process browser connection. */
39
- private wsServer;
40
- private browserWs;
41
- private pending;
42
- private bridgePort;
27
+ private readonly registry;
28
+ private readonly relay;
29
+ private readonly bridgePort;
30
+ private devUrl;
43
31
  constructor(bridgePort?: number);
44
32
  /** Connect to a debug API instance directly (for in-process usage). */
45
33
  connectDirect(api: LluiDebugAPI): void;
34
+ /**
35
+ * Set the dev-server URL that Phase 2's CDP fallback can navigate a
36
+ * Playwright browser to. Persisted into the active marker file so the
37
+ * Vite plugin (or other consumers) can rebroadcast it. If the bridge is
38
+ * already running, rewrites the marker so consumers see the update.
39
+ */
40
+ setDevUrl(url: string): void;
46
41
  /**
47
42
  * Start a WebSocket server on the configured bridge port. The browser-side
48
43
  * relay (injected by the Vite plugin in dev mode) connects here and forwards
@@ -52,15 +47,18 @@ export declare class LluiMcpServer {
52
47
  stopBridge(): void;
53
48
  private writeActiveFile;
54
49
  private removeActiveFile;
55
- /** Invoke a debug API method — over the bridge if connected, else direct. */
56
- private call;
57
50
  /** Get tool definitions for MCP handshake */
58
- getTools(): McpToolDefinition[];
51
+ getTools(): ToolDefinition[];
59
52
  /** Handle an MCP tool call */
60
53
  handleToolCall(name: string, args: Record<string, unknown>): Promise<unknown>;
61
54
  /** Start the MCP server on stdin/stdout */
62
55
  start(): void;
63
56
  private handleRequest;
64
57
  }
65
- export { TOOLS as mcpToolDefinitions };
58
+ /**
59
+ * Snapshot of all registered tool definitions. Kept as a named export for
60
+ * backward compatibility with downstream consumers that used to import the
61
+ * `TOOLS` array re-export under this alias.
62
+ */
63
+ export declare const mcpToolDefinitions: ToolDefinition[];
66
64
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAO7C;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,GAAE,MAAsB,GAAG,MAAM,CAgBvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CAErE;AAID,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ,CAAA;QACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QACnC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KACpB,CAAA;CACF;AAkBD,QAAA,MAAM,KAAK,EAAE,iBAAiB,EAgS7B,CAAA;AASD,qBAAa,aAAa;IACxB,8EAA8E;IAC9E,OAAO,CAAC,QAAQ,CAA4B;IA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