@llui/mcp 0.0.21 → 0.0.23
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/tools/debug-api.js
CHANGED
|
@@ -344,7 +344,7 @@ export function registerDebugApiTools(registry) {
|
|
|
344
344
|
}, 'debug-api', async (_args, ctx) => ctx.relay.call('getFocus', []));
|
|
345
345
|
registry.register({
|
|
346
346
|
name: 'llui_lint',
|
|
347
|
-
description: "Lint LLui source code against @llui/lint-idiomatic's
|
|
347
|
+
description: "Lint LLui source code against @llui/lint-idiomatic's 20 anti-pattern rules. Returns violations grouped by rule with line/column/suggestion fields, plus a 0–20 score (20 = fully idiomatic). Pass either `source` (raw TypeScript code) or `path` (absolute file path on the dev machine) — exactly one is required. The optional `exclude` array skips specific rule names. Use this after writing or editing LLui code to self-correct: catches state mutation, missing memo(), each() closure violations, view-bag-import (use the bag inside component bodies, see llm-guide.md), missing exhaustive update() cases, async update() (must be sync), nested send() in update(), spread-in-children (use each() instead), imperative DOM in view(), and more. The same rules run as a Vite plugin in dev — this tool gives LLMs the same feedback without requiring a build.",
|
|
348
348
|
inputSchema: {
|
|
349
349
|
type: 'object',
|
|
350
350
|
properties: {
|
|
@@ -396,7 +396,7 @@ export function registerDebugApiTools(registry) {
|
|
|
396
396
|
file: filename,
|
|
397
397
|
score: result.score,
|
|
398
398
|
violations: result.violations,
|
|
399
|
-
summary: `${result.violations.length} violation(s), score ${result.score}/
|
|
399
|
+
summary: `${result.violations.length} violation(s), score ${result.score}/20`,
|
|
400
400
|
};
|
|
401
401
|
});
|
|
402
402
|
registry.register({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug-api.js","sourceRoot":"","sources":["../../src/tools/debug-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,OAAO,E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IACJ,CAAC,CACF,CAAA;IAED,QAAQ,CAAC,QAAQ,CACf;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EACT,8VAA8V;QAChW,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YACxC,QAAQ,EAAE,CAAC,MAAM,CAAC;SACnB;KACF,EACD,WAAW,EACX,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAM,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAChE,CAAA;AACH,CAAC","sourcesContent":["import { existsSync, readFileSync } from 'node:fs'\nimport { lintIdiomatic } from '@llui/lint-idiomatic'\nimport type { ToolRegistry } from '../tool-registry.js'\nimport { generateReplayTest } from './replay-test-generator.js'\nimport { domDiff, diffState } from '../util/diff.js'\n\n/**\n * Register the 23 debug-API-backed tools. Every handler here routes through\n * `ctx.relay!.call(method, args)` — which transparently dispatches to either\n * an in-process `LluiDebugAPI` or the WebSocket bridge, depending on how the\n * transport was wired.\n */\nexport function registerDebugApiTools(registry: ToolRegistry): void {\n registry.register(\n {\n name: 'llui_get_state',\n description:\n 'Get the current state of the LLui component. Returns a JSON-serializable state object.',\n inputSchema: {\n type: 'object',\n properties: {\n component: {\n type: 'string',\n description: 'Component name (defaults to root)',\n },\n },\n },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getState', []),\n )\n\n registry.register(\n {\n name: 'llui_send_message',\n description:\n 'Send a message to the component and return the new state and effects. Validates the message first. Calls flush() automatically.',\n inputSchema: {\n type: 'object',\n properties: {\n msg: {\n type: 'object',\n description: 'The message to send (must be a valid Msg variant)',\n },\n },\n required: ['msg'],\n },\n },\n 'debug-api',\n async (args, ctx) => {\n const errors = (await ctx.relay!.call('validateMessage', [args.msg])) as unknown[] | null\n if (errors) return { errors, sent: false }\n await ctx.relay!.call('send', [args.msg])\n await ctx.relay!.call('flush', [])\n return { state: await ctx.relay!.call('getState', []), sent: true }\n },\n )\n\n registry.register(\n {\n name: 'llui_eval_update',\n description:\n 'Dry-run: call update(state, msg) without applying. Returns what the new state and effects would be without modifying the running app.',\n inputSchema: {\n type: 'object',\n properties: {\n msg: {\n type: 'object',\n description: 'The hypothetical message to evaluate',\n },\n },\n required: ['msg'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('evalUpdate', [args.msg]),\n )\n\n registry.register(\n {\n name: 'llui_validate_message',\n description:\n 'Validate a message against the component Msg type. Returns errors or null if valid.',\n inputSchema: {\n type: 'object',\n properties: {\n msg: {\n type: 'object',\n description: 'The message to validate',\n },\n },\n required: ['msg'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('validateMessage', [args.msg]),\n )\n\n registry.register(\n {\n name: 'llui_get_message_history',\n description:\n 'Get the chronological message history with state transitions, effects, and dirty masks. Supports pagination via `since` (exclusive, return entries with index > since) and `limit` (return at most N most-recent entries). Use both together for tail-fetching.',\n inputSchema: {\n type: 'object',\n properties: {\n since: {\n type: 'number',\n description: 'Return entries with index strictly greater than this.',\n },\n limit: {\n type: 'number',\n description: 'Max entries to return (the N most recent).',\n },\n },\n },\n },\n 'debug-api',\n async (args, ctx) => {\n const opts: { since?: number; limit?: number } = {}\n if (typeof args.since === 'number') opts.since = args.since\n if (typeof args.limit === 'number') opts.limit = args.limit\n return ctx.relay!.call('getMessageHistory', [opts])\n },\n )\n\n registry.register(\n {\n name: 'llui_export_trace',\n description: 'Export the current session as a replayable LluiTrace JSON.',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('exportTrace', []),\n )\n\n registry.register(\n {\n name: 'llui_get_bindings',\n description:\n 'Get all active reactive bindings with their masks, last values, and DOM targets.',\n inputSchema: {\n type: 'object',\n properties: {\n filter: {\n type: 'string',\n description: 'Filter by DOM selector or mask value',\n },\n },\n },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getBindings', []),\n )\n\n registry.register(\n {\n name: 'llui_why_did_update',\n description:\n 'Explain why a specific binding re-evaluated: which mask bits were dirty, what the accessor returned, what the previous value was.',\n inputSchema: {\n type: 'object',\n properties: {\n bindingIndex: {\n type: 'number',\n description: 'The binding index to inspect',\n },\n },\n required: ['bindingIndex'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('whyDidUpdate', [args.bindingIndex as number]),\n )\n\n registry.register(\n {\n name: 'llui_search_state',\n description:\n 'Search current state using a dot-separated path query. E.g., \"cart.items\" returns the items array.',\n inputSchema: {\n type: 'object',\n properties: {\n query: {\n type: 'string',\n description: 'Dot-separated path to search. E.g., \"user.name\", \"items\"',\n },\n },\n required: ['query'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('searchState', [args.query as string]),\n )\n\n registry.register(\n {\n name: 'llui_clear_log',\n description: 'Clear the message and effects history.',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n 'debug-api',\n async (_args, ctx) => {\n await ctx.relay!.call('clearLog', [])\n return { cleared: true }\n },\n )\n\n registry.register(\n {\n name: 'llui_list_messages',\n description:\n 'List all message variants the component accepts, with their field types. Returns { discriminant, variants: { [name]: { [field]: typeDescriptor } } }. Use this to discover what messages can be sent without reading source code.',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getMessageSchema', []),\n )\n\n registry.register(\n {\n name: 'llui_decode_mask',\n description:\n \"Decode a dirty-mask value from llui_get_message_history (the 'dirtyMask' field) into the list of top-level state fields that changed. Requires 'mask' param.\",\n inputSchema: {\n type: 'object',\n properties: {\n mask: { type: 'number', description: 'The dirtyMask value to decode' },\n },\n required: ['mask'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('decodeMask', [args.mask as number]),\n )\n\n registry.register(\n {\n name: 'llui_mask_legend',\n description:\n 'Return the compiler-generated bit→field map for this component. Example: { todos: 1, filter: 2, nextId: 4 } means bit 0 represents `todos`, etc.',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getMaskLegend', []),\n )\n\n registry.register(\n {\n name: 'llui_component_info',\n description:\n 'Get component name and source location (file + line) of the component() declaration. Lets you find where to read or edit the component.',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getComponentInfo', []),\n )\n\n registry.register(\n {\n name: 'llui_describe_state',\n description:\n \"Return the State type's shape (not its value). Fields map to type descriptors: 'string', 'number', 'boolean', {kind:'enum',values:[...]}, {kind:'array',of:...}, {kind:'object',fields:...}, {kind:'optional',of:...}. Use this to know what fields exist and their types even when currently undefined.\",\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getStateSchema', []),\n )\n\n registry.register(\n {\n name: 'llui_list_effects',\n description:\n 'List all effect variants the component emits, with their field types (same format as llui_list_messages). Returns null if no Effect type is declared.',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getEffectSchema', []),\n )\n\n registry.register(\n {\n name: 'llui_trace_element',\n description:\n \"Find all bindings targeting a DOM element matched by a CSS selector. Returns { bindingIndex, kind, key, mask, lastValue, relation }[] so you can answer 'why is this element wrong?' — combine with llui_why_did_update(bindingIndex) for a full narrative.\",\n inputSchema: {\n type: 'object',\n properties: {\n selector: {\n type: 'string',\n description: 'CSS selector (e.g. `.todo.active`, `#submit`)',\n },\n },\n required: ['selector'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('getBindingsFor', [args.selector as string]),\n )\n\n registry.register(\n {\n name: 'llui_snapshot_state',\n description:\n 'Capture the current state (deep clone). Returns the snapshot — store it, then call llui_restore_state later to roll back. Useful for safely exploring transitions during a debugging session.',\n inputSchema: { type: 'object', properties: {} },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('snapshotState', []),\n )\n\n registry.register(\n {\n name: 'llui_restore_state',\n description:\n 'Overwrite the current state with a previously-captured snapshot. Triggers a full re-render (FULL_MASK). Bypasses update() — snap must already be a valid state value.',\n inputSchema: {\n type: 'object',\n properties: {\n snapshot: {\n description: 'The state object returned by llui_snapshot_state.',\n },\n },\n required: ['snapshot'],\n },\n },\n 'debug-api',\n async (args, ctx) => {\n await ctx.relay!.call('restoreState', [args.snapshot])\n return { restored: true, state: await ctx.relay!.call('getState', []) }\n },\n )\n\n registry.register(\n {\n name: 'llui_list_components',\n description:\n 'List all currently-mounted LLui components + which one is active (being targeted by subsequent tool calls). Multi-mount apps show one entry per mount.',\n inputSchema: { type: 'object', properties: {} },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('__listComponents', []),\n )\n\n registry.register(\n {\n name: 'llui_select_component',\n description:\n 'Switch the active component (the one all other tool calls target). Use a key from llui_list_components.',\n inputSchema: {\n type: 'object',\n properties: {\n key: {\n type: 'string',\n description: 'Component key as returned by llui_list_components',\n },\n },\n required: ['key'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('__selectComponent', [args.key]),\n )\n\n registry.register(\n {\n name: 'llui_replay_trace',\n description:\n 'Generate a ready-to-run vitest file that replays the current message history via `replayTrace()` from @llui/test. The output is a complete test file with the trace inlined — paste it into packages/<pkg>/test/ to reproduce the exact sequence of messages the component saw in this session. Use this to capture a debugging session as a regression test.',\n inputSchema: {\n type: 'object',\n properties: {\n importPath: {\n type: 'string',\n description:\n \"Where to import the component def from in the generated test (default: '../src/index'). Example: '../src/todo-app'.\",\n },\n exportName: {\n type: 'string',\n description:\n \"Named export that holds the component def (default: the component's name).\",\n },\n },\n },\n },\n 'debug-api',\n async (args, ctx) => {\n const trace = (await ctx.relay!.call('exportTrace', [])) as {\n component: string\n entries: Array<{ msg: unknown; expectedState: unknown; expectedEffects: unknown[] }>\n }\n const importPath = (args.importPath as string | undefined) ?? '../src/index'\n const exportName = (args.exportName as string | undefined) ?? trace.component\n return {\n filename: `${trace.component.toLowerCase()}-replay.test.ts`,\n code: generateReplayTest(trace, importPath, exportName),\n entryCount: trace.entries.length,\n }\n },\n )\n\n registry.register(\n {\n name: 'llui_inspect_element',\n description:\n 'Get a rich report for a DOM element: tag, attributes, classes, data-*, text, bounding box, a computed-style subset (display/visibility/position/dimensions), and the bindings targeting this node. Pass a CSS selector. Returns null if no element matches.',\n inputSchema: {\n type: 'object',\n properties: { selector: { type: 'string', description: 'CSS selector' } },\n required: ['selector'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('inspectElement', [args.selector as string]),\n )\n\n registry.register(\n {\n name: 'llui_get_rendered_html',\n description:\n \"Get the outerHTML of the mounted component or a specific element. Pass 'selector' for a specific node (defaults to the mount root). Pass 'maxLength' to truncate output.\",\n inputSchema: {\n type: 'object',\n properties: {\n selector: { type: 'string' },\n maxLength: { type: 'number' },\n },\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('getRenderedHtml', [args.selector, args.maxLength]),\n )\n\n registry.register(\n {\n name: 'llui_dispatch_event',\n description:\n \"Synthesize and dispatch a browser event at a DOM element. Returns the history indices of any Msgs the handler produced plus the resulting state. 'type' is the event name (e.g. 'click', 'input', 'keydown'). 'init' is an EventInit object (e.g. { key: 'Enter' } for keydown).\",\n inputSchema: {\n type: 'object',\n properties: {\n selector: { type: 'string' },\n type: { type: 'string' },\n init: { type: 'object' },\n },\n required: ['selector', 'type'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('dispatchDomEvent', [args.selector, args.type, args.init]),\n )\n\n registry.register(\n {\n name: 'llui_dom_diff',\n description:\n 'Compare expected HTML against the currently rendered HTML (from selector, or the mount root). Returns { match, differences }. Pass ignoreWhitespace=true to normalize whitespace.',\n inputSchema: {\n type: 'object',\n properties: {\n expected: { type: 'string' },\n selector: { type: 'string' },\n ignoreWhitespace: { type: 'boolean' },\n },\n required: ['expected'],\n },\n },\n 'debug-api',\n async (args, ctx) => {\n const actual = (await ctx.relay!.call('getRenderedHtml', [args.selector])) as string\n return domDiff(String(args.expected), actual, {\n ignoreWhitespace: Boolean(args.ignoreWhitespace),\n })\n },\n )\n\n registry.register(\n {\n name: 'llui_get_focus',\n description:\n 'Return info about the currently focused element: { selector (if it has an id), tagName, selectionStart, selectionEnd }. Useful for catching \"focus lost on re-render\" bugs.',\n inputSchema: { type: 'object', properties: {} },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getFocus', []),\n )\n\n registry.register(\n {\n name: 'llui_lint',\n description:\n \"Lint LLui source code against @llui/lint-idiomatic's 17 anti-pattern rules. Returns violations grouped by rule with line/column/suggestion fields, plus a 0–17 score (17 = fully idiomatic). Pass either `source` (raw TypeScript code) or `path` (absolute file path on the dev machine) — exactly one is required. The optional `exclude` array skips specific rule names. Use this after writing or editing LLui code to self-correct: catches state mutation, missing memo(), each() closure violations, view-bag-import (use the bag inside component bodies, see llm-guide.md), missing exhaustive update() cases, async update() (must be sync), nested send() in update(), spread-in-children (use each() instead), imperative DOM in view(), and more. The same rules run as a Vite plugin in dev — this tool gives LLMs the same feedback without requiring a build.\",\n inputSchema: {\n type: 'object',\n properties: {\n source: {\n type: 'string',\n description: 'TypeScript source code to lint. Mutually exclusive with `path`.',\n },\n path: {\n type: 'string',\n description:\n 'Absolute file path to read and lint (must be a .ts/.tsx file). Mutually exclusive with `source`.',\n },\n exclude: {\n type: 'array',\n items: { type: 'string' },\n description:\n \"Rule names to skip (e.g. ['map-on-state-array']). Useful when running in a project that already gets that rule from @llui/vite-plugin's diagnose() pass.\",\n },\n },\n },\n },\n 'debug-api',\n async (args, _ctx) => {\n const sourceArg = args.source as string | undefined\n const pathArg = args.path as string | undefined\n const excludeArg = args.exclude as string[] | undefined\n\n if (sourceArg !== undefined && pathArg !== undefined) {\n throw new Error(\"llui_lint: provide either 'source' or 'path', not both\")\n }\n if (sourceArg === undefined && pathArg === undefined) {\n throw new Error(\"llui_lint: must provide either 'source' or 'path'\")\n }\n\n let code: string\n let filename: string\n if (sourceArg !== undefined) {\n code = sourceArg\n filename = 'input.ts'\n } else {\n if (!pathArg!.endsWith('.ts') && !pathArg!.endsWith('.tsx')) {\n throw new Error(`llui_lint: path must end in .ts or .tsx (got ${pathArg!})`)\n }\n if (!existsSync(pathArg!)) {\n throw new Error(`llui_lint: file not found: ${pathArg!}`)\n }\n code = readFileSync(pathArg!, 'utf8')\n filename = pathArg!\n }\n\n const result = lintIdiomatic(code, filename, {\n exclude: excludeArg,\n })\n return {\n file: filename,\n score: result.score,\n violations: result.violations,\n summary: `${result.violations.length} violation(s), score ${result.score}/17`,\n }\n },\n )\n\n registry.register(\n {\n name: 'llui_force_rerender',\n description:\n \"Re-evaluate every binding's accessor against the current state, apply changed values to the DOM, and return the indices of bindings that changed. If a binding's DOM value corrects itself after this call but not after a real message, the mask for that binding is wrong.\",\n inputSchema: { type: 'object', properties: {} },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('forceRerender', []),\n )\n\n registry.register(\n {\n name: 'llui_each_diff',\n description:\n \"Per-each-site reconciliation diffs (added/removed/moved/reused keys) from the dev-time diff log. Pass 'sinceIndex' to filter to entries after a specific message history index.\",\n inputSchema: {\n type: 'object',\n properties: { sinceIndex: { type: 'number' } },\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('getEachDiff', [args.sinceIndex]),\n )\n\n registry.register(\n {\n name: 'llui_scope_tree',\n description:\n \"Walk the scope tree starting at the component root (or a specific scopeId). Returns a LifetimeNode tree with kind (root/show/each/branch/child/portal/foreign) and children. Pass 'depth' to limit traversal, 'scopeId' to start elsewhere.\",\n inputSchema: {\n type: 'object',\n properties: {\n depth: { type: 'number' },\n scopeId: { type: 'string' },\n },\n },\n },\n 'debug-api',\n async (args, ctx) =>\n ctx.relay!.call('getScopeTree', [{ depth: args.depth, scopeId: args.scopeId }]),\n )\n\n registry.register(\n {\n name: 'llui_disposer_log',\n description:\n \"Recent onDispose firings with scope id and cause. Pass 'limit' to cap results to the N most recent entries. Catches 'leak on branch swap' class bugs.\",\n inputSchema: {\n type: 'object',\n properties: { limit: { type: 'number' } },\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('getDisposerLog', [args.limit]),\n )\n\n registry.register(\n {\n name: 'llui_list_dead_bindings',\n description:\n \"Bindings that are inactive (scope disposed) OR never matched a dirty mask OR never changed value. Useful for finding wasted work and 'this never updates' bugs. Returns the subset of get_bindings with an annotation on why it's flagged.\",\n inputSchema: { type: 'object', properties: {} },\n },\n 'debug-api',\n async (_args, ctx) => {\n const bindings = (await ctx.relay!.call('getBindings', [])) as Array<{\n index: number\n mask: number\n lastValue: unknown\n kind: string\n key: string | undefined\n dead: boolean\n perItem: boolean\n }>\n return bindings\n .filter((b) => b.dead || b.lastValue === undefined)\n .map((b) => ({\n ...b,\n reason: b.dead ? 'scope_disposed' : 'never_changed',\n }))\n },\n )\n\n registry.register(\n {\n name: 'llui_binding_graph',\n description:\n 'Edge list: state path → binding indices that depend on it. Inverts the compiler-emitted mask legend to show, for each top-level state field, which bindings will re-evaluate when it changes.',\n inputSchema: { type: 'object', properties: {} },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getBindingGraph', []),\n )\n\n registry.register(\n {\n name: 'llui_mock_effect',\n description:\n \"Register a mock for an effect matching 'match' ({ type?, payloadPath?, payloadEquals? }). The next matching effect resolves with 'response' instead of running. Mocks are one-shot; pass { persist: true } to keep across matches. Returns { mockId } for later reference.\",\n inputSchema: {\n type: 'object',\n properties: {\n match: { type: 'object' },\n response: {},\n opts: { type: 'object' },\n },\n required: ['match', 'response'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('mockEffect', [args.match, args.response, args.opts]),\n )\n\n registry.register(\n {\n name: 'llui_resolve_effect',\n description:\n \"Manually resolve a pending effect with a given response. The effect's onSuccess callback (if any) runs as if it had actually resolved. Pass effectId from llui_pending_effects.\",\n inputSchema: {\n type: 'object',\n properties: {\n effectId: { type: 'string' },\n response: {},\n },\n required: ['effectId', 'response'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('resolveEffect', [args.effectId, args.response]),\n )\n\n registry.register(\n {\n name: 'llui_pending_effects',\n description:\n \"Current queued and in-flight effects. Each entry has { id, type, dispatchedAt, status, payload }. Use 'id' with llui_resolve_effect to manually resolve one.\",\n inputSchema: { type: 'object', properties: {} },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getPendingEffects', []),\n )\n\n registry.register(\n {\n name: 'llui_effect_timeline',\n description:\n \"Phased log of effect events: dispatched -> in-flight -> resolved/cancelled/resolved-mocked. Each entry has { effectId, type, phase, timestamp, durationMs? }. Pass 'limit' to cap the tail.\",\n inputSchema: {\n type: 'object',\n properties: { limit: { type: 'number' } },\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('getEffectTimeline', [args.limit]),\n )\n\n registry.register(\n {\n name: 'llui_step_back',\n description:\n \"Rewind state by replaying from init() with the last N messages excluded. 'mode' is 'pure' (default; suppresses effects) or 'live' (re-fires effects from replay). Returns the new state and rewindDepth.\",\n inputSchema: {\n type: 'object',\n properties: {\n n: { type: 'number' },\n mode: { type: 'string', enum: ['pure', 'live'] },\n },\n },\n },\n 'debug-api',\n async (args, ctx) => {\n const n = typeof args.n === 'number' ? args.n : 1\n const mode = args.mode === 'live' ? 'live' : 'pure'\n return ctx.relay!.call('stepBack', [n, mode])\n },\n )\n\n registry.register(\n {\n name: 'llui_coverage',\n description:\n \"Per-Msg-variant coverage for the current session: { fired: { variant: { count, lastIndex } }, neverFired: [variants] }. Shows which message types have run and which haven't — useful for finding untested paths.\",\n inputSchema: { type: 'object', properties: {} },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getCoverage', []),\n )\n\n registry.register(\n {\n name: 'llui_diff_state',\n description:\n \"Structured JSON diff between two state values. Pass 'a' and 'b' — plain objects. Returns { added, removed, changed }.\",\n inputSchema: {\n type: 'object',\n properties: {\n a: {},\n b: {},\n },\n required: ['a', 'b'],\n },\n },\n 'debug-api',\n async (args) => diffState(args.a, args.b),\n )\n\n registry.register(\n {\n name: 'llui_assert',\n description:\n \"Evaluate a predicate against current state. Pass 'path' (dot-separated), 'op' (eq/neq/exists/gt/lt/in), and 'value'. Returns { pass, actual, expected, op }.\",\n inputSchema: {\n type: 'object',\n properties: {\n path: { type: 'string' },\n op: { type: 'string', enum: ['eq', 'neq', 'exists', 'gt', 'lt', 'in'] },\n value: {},\n },\n required: ['path', 'op'],\n },\n },\n 'debug-api',\n async (args, ctx) => {\n const actual = await ctx.relay!.call('searchState', [args.path])\n const op = args.op as string\n const expected = args.value\n let pass = false\n switch (op) {\n case 'eq':\n pass = Object.is(actual, expected)\n break\n case 'neq':\n pass = !Object.is(actual, expected)\n break\n case 'exists':\n pass = actual !== undefined\n break\n case 'gt':\n pass = typeof actual === 'number' && typeof expected === 'number' && actual > expected\n break\n case 'lt':\n pass = typeof actual === 'number' && typeof expected === 'number' && actual < expected\n break\n case 'in':\n pass = Array.isArray(expected) && expected.includes(actual)\n break\n }\n return { pass, actual, expected, op }\n },\n )\n\n registry.register(\n {\n name: 'llui_search_history',\n description:\n \"Filtered message history. Pass 'filter' with { type?, statePath?, effectType?, fromIndex?, toIndex? }. Entries match if all present fields match — type is the Msg discriminant, statePath is a dot path whose value differs pre->post, effectType is a type present in the effects array.\",\n inputSchema: {\n type: 'object',\n properties: {\n filter: {\n type: 'object',\n properties: {\n type: { type: 'string' },\n statePath: { type: 'string' },\n effectType: { type: 'string' },\n fromIndex: { type: 'number' },\n toIndex: { type: 'number' },\n },\n },\n },\n required: ['filter'],\n },\n },\n 'debug-api',\n async (args, ctx) => {\n type HRecord = {\n index: number\n timestamp: number\n msg: unknown\n stateBefore: unknown\n stateAfter: unknown\n effects: unknown[]\n dirtyMask: number\n }\n const history = (await ctx.relay!.call('getMessageHistory', [{}])) as HRecord[]\n const f = (args.filter ?? {}) as {\n type?: string\n statePath?: string\n effectType?: string\n fromIndex?: number\n toIndex?: number\n }\n function pathValue(obj: unknown, path: string): unknown {\n const parts = path.split('.')\n let v: unknown = obj\n for (const p of parts) {\n if (v == null || typeof v !== 'object') return undefined\n v = (v as Record<string, unknown>)[p]\n }\n return v\n }\n return history.filter((r) => {\n if (f.fromIndex !== undefined && r.index < f.fromIndex) return false\n if (f.toIndex !== undefined && r.index > f.toIndex) return false\n if (f.type !== undefined) {\n const t = (r.msg as { type?: string } | null)?.type\n if (t !== f.type) return false\n }\n if (f.statePath !== undefined) {\n const before = pathValue(r.stateBefore, f.statePath)\n const after = pathValue(r.stateAfter, f.statePath)\n if (Object.is(before, after)) return false\n }\n if (f.effectType !== undefined) {\n if (!r.effects.some((e) => (e as { type?: string } | null)?.type === f.effectType)) {\n return false\n }\n }\n return true\n })\n },\n )\n\n registry.register(\n {\n name: 'llui_eval',\n description:\n \"Arbitrary JavaScript in the page context via the debug relay. Returns { result, sideEffects }. 'result' is the expression's return value or { error }. 'sideEffects' makes any state changes, new history entries, new pending effects, and dirty bindings visible. Phase 1 does not support async expressions; expose async results via globalThis instead.\",\n inputSchema: {\n type: 'object',\n properties: { code: { type: 'string' } },\n required: ['code'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('evalInPage', [args.code]),\n )\n}\n"]}
|
|
1
|
+
{"version":3,"file":"debug-api.js","sourceRoot":"","sources":["../../src/tools/debug-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAsB;IAC1D,QAAQ,CAA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EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YACxC,QAAQ,EAAE,CAAC,MAAM,CAAC;SACnB;KACF,EACD,WAAW,EACX,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAM,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAChE,CAAA;AACH,CAAC","sourcesContent":["import { existsSync, readFileSync } from 'node:fs'\nimport { lintIdiomatic } from '@llui/lint-idiomatic'\nimport type { ToolRegistry } from '../tool-registry.js'\nimport { generateReplayTest } from './replay-test-generator.js'\nimport { domDiff, diffState } from '../util/diff.js'\n\n/**\n * Register the 23 debug-API-backed tools. Every handler here routes through\n * `ctx.relay!.call(method, args)` — which transparently dispatches to either\n * an in-process `LluiDebugAPI` or the WebSocket bridge, depending on how the\n * transport was wired.\n */\nexport function registerDebugApiTools(registry: ToolRegistry): void {\n registry.register(\n {\n name: 'llui_get_state',\n description:\n 'Get the current state of the LLui component. Returns a JSON-serializable state object.',\n inputSchema: {\n type: 'object',\n properties: {\n component: {\n type: 'string',\n description: 'Component name (defaults to root)',\n },\n },\n },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getState', []),\n )\n\n registry.register(\n {\n name: 'llui_send_message',\n description:\n 'Send a message to the component and return the new state and effects. Validates the message first. Calls flush() automatically.',\n inputSchema: {\n type: 'object',\n properties: {\n msg: {\n type: 'object',\n description: 'The message to send (must be a valid Msg variant)',\n },\n },\n required: ['msg'],\n },\n },\n 'debug-api',\n async (args, ctx) => {\n const errors = (await ctx.relay!.call('validateMessage', [args.msg])) as unknown[] | null\n if (errors) return { errors, sent: false }\n await ctx.relay!.call('send', [args.msg])\n await ctx.relay!.call('flush', [])\n return { state: await ctx.relay!.call('getState', []), sent: true }\n },\n )\n\n registry.register(\n {\n name: 'llui_eval_update',\n description:\n 'Dry-run: call update(state, msg) without applying. Returns what the new state and effects would be without modifying the running app.',\n inputSchema: {\n type: 'object',\n properties: {\n msg: {\n type: 'object',\n description: 'The hypothetical message to evaluate',\n },\n },\n required: ['msg'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('evalUpdate', [args.msg]),\n )\n\n registry.register(\n {\n name: 'llui_validate_message',\n description:\n 'Validate a message against the component Msg type. Returns errors or null if valid.',\n inputSchema: {\n type: 'object',\n properties: {\n msg: {\n type: 'object',\n description: 'The message to validate',\n },\n },\n required: ['msg'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('validateMessage', [args.msg]),\n )\n\n registry.register(\n {\n name: 'llui_get_message_history',\n description:\n 'Get the chronological message history with state transitions, effects, and dirty masks. Supports pagination via `since` (exclusive, return entries with index > since) and `limit` (return at most N most-recent entries). Use both together for tail-fetching.',\n inputSchema: {\n type: 'object',\n properties: {\n since: {\n type: 'number',\n description: 'Return entries with index strictly greater than this.',\n },\n limit: {\n type: 'number',\n description: 'Max entries to return (the N most recent).',\n },\n },\n },\n },\n 'debug-api',\n async (args, ctx) => {\n const opts: { since?: number; limit?: number } = {}\n if (typeof args.since === 'number') opts.since = args.since\n if (typeof args.limit === 'number') opts.limit = args.limit\n return ctx.relay!.call('getMessageHistory', [opts])\n },\n )\n\n registry.register(\n {\n name: 'llui_export_trace',\n description: 'Export the current session as a replayable LluiTrace JSON.',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('exportTrace', []),\n )\n\n registry.register(\n {\n name: 'llui_get_bindings',\n description:\n 'Get all active reactive bindings with their masks, last values, and DOM targets.',\n inputSchema: {\n type: 'object',\n properties: {\n filter: {\n type: 'string',\n description: 'Filter by DOM selector or mask value',\n },\n },\n },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getBindings', []),\n )\n\n registry.register(\n {\n name: 'llui_why_did_update',\n description:\n 'Explain why a specific binding re-evaluated: which mask bits were dirty, what the accessor returned, what the previous value was.',\n inputSchema: {\n type: 'object',\n properties: {\n bindingIndex: {\n type: 'number',\n description: 'The binding index to inspect',\n },\n },\n required: ['bindingIndex'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('whyDidUpdate', [args.bindingIndex as number]),\n )\n\n registry.register(\n {\n name: 'llui_search_state',\n description:\n 'Search current state using a dot-separated path query. E.g., \"cart.items\" returns the items array.',\n inputSchema: {\n type: 'object',\n properties: {\n query: {\n type: 'string',\n description: 'Dot-separated path to search. E.g., \"user.name\", \"items\"',\n },\n },\n required: ['query'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('searchState', [args.query as string]),\n )\n\n registry.register(\n {\n name: 'llui_clear_log',\n description: 'Clear the message and effects history.',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n 'debug-api',\n async (_args, ctx) => {\n await ctx.relay!.call('clearLog', [])\n return { cleared: true }\n },\n )\n\n registry.register(\n {\n name: 'llui_list_messages',\n description:\n 'List all message variants the component accepts, with their field types. Returns { discriminant, variants: { [name]: { [field]: typeDescriptor } } }. Use this to discover what messages can be sent without reading source code.',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getMessageSchema', []),\n )\n\n registry.register(\n {\n name: 'llui_decode_mask',\n description:\n \"Decode a dirty-mask value from llui_get_message_history (the 'dirtyMask' field) into the list of top-level state fields that changed. Requires 'mask' param.\",\n inputSchema: {\n type: 'object',\n properties: {\n mask: { type: 'number', description: 'The dirtyMask value to decode' },\n },\n required: ['mask'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('decodeMask', [args.mask as number]),\n )\n\n registry.register(\n {\n name: 'llui_mask_legend',\n description:\n 'Return the compiler-generated bit→field map for this component. Example: { todos: 1, filter: 2, nextId: 4 } means bit 0 represents `todos`, etc.',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getMaskLegend', []),\n )\n\n registry.register(\n {\n name: 'llui_component_info',\n description:\n 'Get component name and source location (file + line) of the component() declaration. Lets you find where to read or edit the component.',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getComponentInfo', []),\n )\n\n registry.register(\n {\n name: 'llui_describe_state',\n description:\n \"Return the State type's shape (not its value). Fields map to type descriptors: 'string', 'number', 'boolean', {kind:'enum',values:[...]}, {kind:'array',of:...}, {kind:'object',fields:...}, {kind:'optional',of:...}. Use this to know what fields exist and their types even when currently undefined.\",\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getStateSchema', []),\n )\n\n registry.register(\n {\n name: 'llui_list_effects',\n description:\n 'List all effect variants the component emits, with their field types (same format as llui_list_messages). Returns null if no Effect type is declared.',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getEffectSchema', []),\n )\n\n registry.register(\n {\n name: 'llui_trace_element',\n description:\n \"Find all bindings targeting a DOM element matched by a CSS selector. Returns { bindingIndex, kind, key, mask, lastValue, relation }[] so you can answer 'why is this element wrong?' — combine with llui_why_did_update(bindingIndex) for a full narrative.\",\n inputSchema: {\n type: 'object',\n properties: {\n selector: {\n type: 'string',\n description: 'CSS selector (e.g. `.todo.active`, `#submit`)',\n },\n },\n required: ['selector'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('getBindingsFor', [args.selector as string]),\n )\n\n registry.register(\n {\n name: 'llui_snapshot_state',\n description:\n 'Capture the current state (deep clone). Returns the snapshot — store it, then call llui_restore_state later to roll back. Useful for safely exploring transitions during a debugging session.',\n inputSchema: { type: 'object', properties: {} },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('snapshotState', []),\n )\n\n registry.register(\n {\n name: 'llui_restore_state',\n description:\n 'Overwrite the current state with a previously-captured snapshot. Triggers a full re-render (FULL_MASK). Bypasses update() — snap must already be a valid state value.',\n inputSchema: {\n type: 'object',\n properties: {\n snapshot: {\n description: 'The state object returned by llui_snapshot_state.',\n },\n },\n required: ['snapshot'],\n },\n },\n 'debug-api',\n async (args, ctx) => {\n await ctx.relay!.call('restoreState', [args.snapshot])\n return { restored: true, state: await ctx.relay!.call('getState', []) }\n },\n )\n\n registry.register(\n {\n name: 'llui_list_components',\n description:\n 'List all currently-mounted LLui components + which one is active (being targeted by subsequent tool calls). Multi-mount apps show one entry per mount.',\n inputSchema: { type: 'object', properties: {} },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('__listComponents', []),\n )\n\n registry.register(\n {\n name: 'llui_select_component',\n description:\n 'Switch the active component (the one all other tool calls target). Use a key from llui_list_components.',\n inputSchema: {\n type: 'object',\n properties: {\n key: {\n type: 'string',\n description: 'Component key as returned by llui_list_components',\n },\n },\n required: ['key'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('__selectComponent', [args.key]),\n )\n\n registry.register(\n {\n name: 'llui_replay_trace',\n description:\n 'Generate a ready-to-run vitest file that replays the current message history via `replayTrace()` from @llui/test. The output is a complete test file with the trace inlined — paste it into packages/<pkg>/test/ to reproduce the exact sequence of messages the component saw in this session. Use this to capture a debugging session as a regression test.',\n inputSchema: {\n type: 'object',\n properties: {\n importPath: {\n type: 'string',\n description:\n \"Where to import the component def from in the generated test (default: '../src/index'). Example: '../src/todo-app'.\",\n },\n exportName: {\n type: 'string',\n description:\n \"Named export that holds the component def (default: the component's name).\",\n },\n },\n },\n },\n 'debug-api',\n async (args, ctx) => {\n const trace = (await ctx.relay!.call('exportTrace', [])) as {\n component: string\n entries: Array<{ msg: unknown; expectedState: unknown; expectedEffects: unknown[] }>\n }\n const importPath = (args.importPath as string | undefined) ?? '../src/index'\n const exportName = (args.exportName as string | undefined) ?? trace.component\n return {\n filename: `${trace.component.toLowerCase()}-replay.test.ts`,\n code: generateReplayTest(trace, importPath, exportName),\n entryCount: trace.entries.length,\n }\n },\n )\n\n registry.register(\n {\n name: 'llui_inspect_element',\n description:\n 'Get a rich report for a DOM element: tag, attributes, classes, data-*, text, bounding box, a computed-style subset (display/visibility/position/dimensions), and the bindings targeting this node. Pass a CSS selector. Returns null if no element matches.',\n inputSchema: {\n type: 'object',\n properties: { selector: { type: 'string', description: 'CSS selector' } },\n required: ['selector'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('inspectElement', [args.selector as string]),\n )\n\n registry.register(\n {\n name: 'llui_get_rendered_html',\n description:\n \"Get the outerHTML of the mounted component or a specific element. Pass 'selector' for a specific node (defaults to the mount root). Pass 'maxLength' to truncate output.\",\n inputSchema: {\n type: 'object',\n properties: {\n selector: { type: 'string' },\n maxLength: { type: 'number' },\n },\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('getRenderedHtml', [args.selector, args.maxLength]),\n )\n\n registry.register(\n {\n name: 'llui_dispatch_event',\n description:\n \"Synthesize and dispatch a browser event at a DOM element. Returns the history indices of any Msgs the handler produced plus the resulting state. 'type' is the event name (e.g. 'click', 'input', 'keydown'). 'init' is an EventInit object (e.g. { key: 'Enter' } for keydown).\",\n inputSchema: {\n type: 'object',\n properties: {\n selector: { type: 'string' },\n type: { type: 'string' },\n init: { type: 'object' },\n },\n required: ['selector', 'type'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('dispatchDomEvent', [args.selector, args.type, args.init]),\n )\n\n registry.register(\n {\n name: 'llui_dom_diff',\n description:\n 'Compare expected HTML against the currently rendered HTML (from selector, or the mount root). Returns { match, differences }. Pass ignoreWhitespace=true to normalize whitespace.',\n inputSchema: {\n type: 'object',\n properties: {\n expected: { type: 'string' },\n selector: { type: 'string' },\n ignoreWhitespace: { type: 'boolean' },\n },\n required: ['expected'],\n },\n },\n 'debug-api',\n async (args, ctx) => {\n const actual = (await ctx.relay!.call('getRenderedHtml', [args.selector])) as string\n return domDiff(String(args.expected), actual, {\n ignoreWhitespace: Boolean(args.ignoreWhitespace),\n })\n },\n )\n\n registry.register(\n {\n name: 'llui_get_focus',\n description:\n 'Return info about the currently focused element: { selector (if it has an id), tagName, selectionStart, selectionEnd }. Useful for catching \"focus lost on re-render\" bugs.',\n inputSchema: { type: 'object', properties: {} },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getFocus', []),\n )\n\n registry.register(\n {\n name: 'llui_lint',\n description:\n \"Lint LLui source code against @llui/lint-idiomatic's 20 anti-pattern rules. Returns violations grouped by rule with line/column/suggestion fields, plus a 0–20 score (20 = fully idiomatic). Pass either `source` (raw TypeScript code) or `path` (absolute file path on the dev machine) — exactly one is required. The optional `exclude` array skips specific rule names. Use this after writing or editing LLui code to self-correct: catches state mutation, missing memo(), each() closure violations, view-bag-import (use the bag inside component bodies, see llm-guide.md), missing exhaustive update() cases, async update() (must be sync), nested send() in update(), spread-in-children (use each() instead), imperative DOM in view(), and more. The same rules run as a Vite plugin in dev — this tool gives LLMs the same feedback without requiring a build.\",\n inputSchema: {\n type: 'object',\n properties: {\n source: {\n type: 'string',\n description: 'TypeScript source code to lint. Mutually exclusive with `path`.',\n },\n path: {\n type: 'string',\n description:\n 'Absolute file path to read and lint (must be a .ts/.tsx file). Mutually exclusive with `source`.',\n },\n exclude: {\n type: 'array',\n items: { type: 'string' },\n description:\n \"Rule names to skip (e.g. ['map-on-state-array']). Useful when running in a project that already gets that rule from @llui/vite-plugin's diagnose() pass.\",\n },\n },\n },\n },\n 'debug-api',\n async (args, _ctx) => {\n const sourceArg = args.source as string | undefined\n const pathArg = args.path as string | undefined\n const excludeArg = args.exclude as string[] | undefined\n\n if (sourceArg !== undefined && pathArg !== undefined) {\n throw new Error(\"llui_lint: provide either 'source' or 'path', not both\")\n }\n if (sourceArg === undefined && pathArg === undefined) {\n throw new Error(\"llui_lint: must provide either 'source' or 'path'\")\n }\n\n let code: string\n let filename: string\n if (sourceArg !== undefined) {\n code = sourceArg\n filename = 'input.ts'\n } else {\n if (!pathArg!.endsWith('.ts') && !pathArg!.endsWith('.tsx')) {\n throw new Error(`llui_lint: path must end in .ts or .tsx (got ${pathArg!})`)\n }\n if (!existsSync(pathArg!)) {\n throw new Error(`llui_lint: file not found: ${pathArg!}`)\n }\n code = readFileSync(pathArg!, 'utf8')\n filename = pathArg!\n }\n\n const result = lintIdiomatic(code, filename, {\n exclude: excludeArg,\n })\n return {\n file: filename,\n score: result.score,\n violations: result.violations,\n summary: `${result.violations.length} violation(s), score ${result.score}/20`,\n }\n },\n )\n\n registry.register(\n {\n name: 'llui_force_rerender',\n description:\n \"Re-evaluate every binding's accessor against the current state, apply changed values to the DOM, and return the indices of bindings that changed. If a binding's DOM value corrects itself after this call but not after a real message, the mask for that binding is wrong.\",\n inputSchema: { type: 'object', properties: {} },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('forceRerender', []),\n )\n\n registry.register(\n {\n name: 'llui_each_diff',\n description:\n \"Per-each-site reconciliation diffs (added/removed/moved/reused keys) from the dev-time diff log. Pass 'sinceIndex' to filter to entries after a specific message history index.\",\n inputSchema: {\n type: 'object',\n properties: { sinceIndex: { type: 'number' } },\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('getEachDiff', [args.sinceIndex]),\n )\n\n registry.register(\n {\n name: 'llui_scope_tree',\n description:\n \"Walk the scope tree starting at the component root (or a specific scopeId). Returns a LifetimeNode tree with kind (root/show/each/branch/child/portal/foreign) and children. Pass 'depth' to limit traversal, 'scopeId' to start elsewhere.\",\n inputSchema: {\n type: 'object',\n properties: {\n depth: { type: 'number' },\n scopeId: { type: 'string' },\n },\n },\n },\n 'debug-api',\n async (args, ctx) =>\n ctx.relay!.call('getScopeTree', [{ depth: args.depth, scopeId: args.scopeId }]),\n )\n\n registry.register(\n {\n name: 'llui_disposer_log',\n description:\n \"Recent onDispose firings with scope id and cause. Pass 'limit' to cap results to the N most recent entries. Catches 'leak on branch swap' class bugs.\",\n inputSchema: {\n type: 'object',\n properties: { limit: { type: 'number' } },\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('getDisposerLog', [args.limit]),\n )\n\n registry.register(\n {\n name: 'llui_list_dead_bindings',\n description:\n \"Bindings that are inactive (scope disposed) OR never matched a dirty mask OR never changed value. Useful for finding wasted work and 'this never updates' bugs. Returns the subset of get_bindings with an annotation on why it's flagged.\",\n inputSchema: { type: 'object', properties: {} },\n },\n 'debug-api',\n async (_args, ctx) => {\n const bindings = (await ctx.relay!.call('getBindings', [])) as Array<{\n index: number\n mask: number\n lastValue: unknown\n kind: string\n key: string | undefined\n dead: boolean\n perItem: boolean\n }>\n return bindings\n .filter((b) => b.dead || b.lastValue === undefined)\n .map((b) => ({\n ...b,\n reason: b.dead ? 'scope_disposed' : 'never_changed',\n }))\n },\n )\n\n registry.register(\n {\n name: 'llui_binding_graph',\n description:\n 'Edge list: state path → binding indices that depend on it. Inverts the compiler-emitted mask legend to show, for each top-level state field, which bindings will re-evaluate when it changes.',\n inputSchema: { type: 'object', properties: {} },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getBindingGraph', []),\n )\n\n registry.register(\n {\n name: 'llui_mock_effect',\n description:\n \"Register a mock for an effect matching 'match' ({ type?, payloadPath?, payloadEquals? }). The next matching effect resolves with 'response' instead of running. Mocks are one-shot; pass { persist: true } to keep across matches. Returns { mockId } for later reference.\",\n inputSchema: {\n type: 'object',\n properties: {\n match: { type: 'object' },\n response: {},\n opts: { type: 'object' },\n },\n required: ['match', 'response'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('mockEffect', [args.match, args.response, args.opts]),\n )\n\n registry.register(\n {\n name: 'llui_resolve_effect',\n description:\n \"Manually resolve a pending effect with a given response. The effect's onSuccess callback (if any) runs as if it had actually resolved. Pass effectId from llui_pending_effects.\",\n inputSchema: {\n type: 'object',\n properties: {\n effectId: { type: 'string' },\n response: {},\n },\n required: ['effectId', 'response'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('resolveEffect', [args.effectId, args.response]),\n )\n\n registry.register(\n {\n name: 'llui_pending_effects',\n description:\n \"Current queued and in-flight effects. Each entry has { id, type, dispatchedAt, status, payload }. Use 'id' with llui_resolve_effect to manually resolve one.\",\n inputSchema: { type: 'object', properties: {} },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getPendingEffects', []),\n )\n\n registry.register(\n {\n name: 'llui_effect_timeline',\n description:\n \"Phased log of effect events: dispatched -> in-flight -> resolved/cancelled/resolved-mocked. Each entry has { effectId, type, phase, timestamp, durationMs? }. Pass 'limit' to cap the tail.\",\n inputSchema: {\n type: 'object',\n properties: { limit: { type: 'number' } },\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('getEffectTimeline', [args.limit]),\n )\n\n registry.register(\n {\n name: 'llui_step_back',\n description:\n \"Rewind state by replaying from init() with the last N messages excluded. 'mode' is 'pure' (default; suppresses effects) or 'live' (re-fires effects from replay). Returns the new state and rewindDepth.\",\n inputSchema: {\n type: 'object',\n properties: {\n n: { type: 'number' },\n mode: { type: 'string', enum: ['pure', 'live'] },\n },\n },\n },\n 'debug-api',\n async (args, ctx) => {\n const n = typeof args.n === 'number' ? args.n : 1\n const mode = args.mode === 'live' ? 'live' : 'pure'\n return ctx.relay!.call('stepBack', [n, mode])\n },\n )\n\n registry.register(\n {\n name: 'llui_coverage',\n description:\n \"Per-Msg-variant coverage for the current session: { fired: { variant: { count, lastIndex } }, neverFired: [variants] }. Shows which message types have run and which haven't — useful for finding untested paths.\",\n inputSchema: { type: 'object', properties: {} },\n },\n 'debug-api',\n async (_args, ctx) => ctx.relay!.call('getCoverage', []),\n )\n\n registry.register(\n {\n name: 'llui_diff_state',\n description:\n \"Structured JSON diff between two state values. Pass 'a' and 'b' — plain objects. Returns { added, removed, changed }.\",\n inputSchema: {\n type: 'object',\n properties: {\n a: {},\n b: {},\n },\n required: ['a', 'b'],\n },\n },\n 'debug-api',\n async (args) => diffState(args.a, args.b),\n )\n\n registry.register(\n {\n name: 'llui_assert',\n description:\n \"Evaluate a predicate against current state. Pass 'path' (dot-separated), 'op' (eq/neq/exists/gt/lt/in), and 'value'. Returns { pass, actual, expected, op }.\",\n inputSchema: {\n type: 'object',\n properties: {\n path: { type: 'string' },\n op: { type: 'string', enum: ['eq', 'neq', 'exists', 'gt', 'lt', 'in'] },\n value: {},\n },\n required: ['path', 'op'],\n },\n },\n 'debug-api',\n async (args, ctx) => {\n const actual = await ctx.relay!.call('searchState', [args.path])\n const op = args.op as string\n const expected = args.value\n let pass = false\n switch (op) {\n case 'eq':\n pass = Object.is(actual, expected)\n break\n case 'neq':\n pass = !Object.is(actual, expected)\n break\n case 'exists':\n pass = actual !== undefined\n break\n case 'gt':\n pass = typeof actual === 'number' && typeof expected === 'number' && actual > expected\n break\n case 'lt':\n pass = typeof actual === 'number' && typeof expected === 'number' && actual < expected\n break\n case 'in':\n pass = Array.isArray(expected) && expected.includes(actual)\n break\n }\n return { pass, actual, expected, op }\n },\n )\n\n registry.register(\n {\n name: 'llui_search_history',\n description:\n \"Filtered message history. Pass 'filter' with { type?, statePath?, effectType?, fromIndex?, toIndex? }. Entries match if all present fields match — type is the Msg discriminant, statePath is a dot path whose value differs pre->post, effectType is a type present in the effects array.\",\n inputSchema: {\n type: 'object',\n properties: {\n filter: {\n type: 'object',\n properties: {\n type: { type: 'string' },\n statePath: { type: 'string' },\n effectType: { type: 'string' },\n fromIndex: { type: 'number' },\n toIndex: { type: 'number' },\n },\n },\n },\n required: ['filter'],\n },\n },\n 'debug-api',\n async (args, ctx) => {\n type HRecord = {\n index: number\n timestamp: number\n msg: unknown\n stateBefore: unknown\n stateAfter: unknown\n effects: unknown[]\n dirtyMask: number\n }\n const history = (await ctx.relay!.call('getMessageHistory', [{}])) as HRecord[]\n const f = (args.filter ?? {}) as {\n type?: string\n statePath?: string\n effectType?: string\n fromIndex?: number\n toIndex?: number\n }\n function pathValue(obj: unknown, path: string): unknown {\n const parts = path.split('.')\n let v: unknown = obj\n for (const p of parts) {\n if (v == null || typeof v !== 'object') return undefined\n v = (v as Record<string, unknown>)[p]\n }\n return v\n }\n return history.filter((r) => {\n if (f.fromIndex !== undefined && r.index < f.fromIndex) return false\n if (f.toIndex !== undefined && r.index > f.toIndex) return false\n if (f.type !== undefined) {\n const t = (r.msg as { type?: string } | null)?.type\n if (t !== f.type) return false\n }\n if (f.statePath !== undefined) {\n const before = pathValue(r.stateBefore, f.statePath)\n const after = pathValue(r.stateAfter, f.statePath)\n if (Object.is(before, after)) return false\n }\n if (f.effectType !== undefined) {\n if (!r.effects.some((e) => (e as { type?: string } | null)?.type === f.effectType)) {\n return false\n }\n }\n return true\n })\n },\n )\n\n registry.register(\n {\n name: 'llui_eval',\n description:\n \"Arbitrary JavaScript in the page context via the debug relay. Returns { result, sideEffects }. 'result' is the expression's return value or { error }. 'sideEffects' makes any state changes, new history entries, new pending effects, and dirty bindings visible. Phase 1 does not support async expressions; expose async results via globalThis instead.\",\n inputSchema: {\n type: 'object',\n properties: { code: { type: 'string' } },\n required: ['code'],\n },\n },\n 'debug-api',\n async (args, ctx) => ctx.relay!.call('evalInPage', [args.code]),\n )\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llui/mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"bin": {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
20
20
|
"ws": "^8.18.0",
|
|
21
|
-
"@llui/dom": "0.0.
|
|
22
|
-
"@llui/lint-idiomatic": "0.0.
|
|
21
|
+
"@llui/dom": "0.0.29",
|
|
22
|
+
"@llui/lint-idiomatic": "0.0.13"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^22.0.0",
|