@sightmap/mcp 0.8.0 → 0.10.0

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
@@ -9,29 +9,44 @@ browser-driving agents.
9
9
 
10
10
  | Tool | Purpose |
11
11
  |---|---|
12
- | `sightmap_match` | Pure-query: matches a URL against the loaded sightmap and returns view, components, requests, and aggregated memory. |
12
+ | `sightmap_match` | Pure-query: matches a URL against the loaded sightmap and returns view, components, requests, and aggregated memory. No browser call. |
13
13
  | `sightmap_snapshot` | ARIA snapshot enriched with sightmap awareness (matched view, applicable components with live `matchCount`). |
14
14
  | `sightmap_act` | Click / type / hover by sightmap component name; raw `selector` is an escape hatch. |
15
15
  | `sightmap_network_requests` | Recent network requests, annotated with sightmap names where the request URL+method matches a sightmap `requests:` entry. |
16
+ | `sightmap_runtime_snapshot` | Capture the live React fiber tree (components, ranked selectors, `data-sightmap` markers, unmarked candidates) for the agent to fold into `.sightmap/`. Three sources via `kind`: `"endpoint"` (fetch a `/__sightmap__/snapshot.json` served by `@sightmap/react`'s Vite plugin), `"browser"` (drive the upstream browser MCP, inject the bippy runtime, and read `window.__sightmap__.snapshot()`), or `"literal"` (accept a pre-captured snapshot from any other harness — e.g. Subtext's `live-eval-script`). |
16
17
 
17
18
  ### Curation tools
18
19
 
19
- The MCP also exposes a five-tool family for `.sightmap/` authoring:
20
+ The MCP exposes a seven-tool family for `.sightmap/` authoring. The
21
+ `sightmap-assistant` subagent has **full authority** over every view field
22
+ (structural and semantic) via these tools.
20
23
 
21
24
  | Tool | Purpose |
22
25
  |---|---|
23
26
  | `sightmap_list_views` | List all views (compact summary by default; pass `detail: "full"` for the entire view). |
24
27
  | `sightmap_get_view` | Fetch a single view + its source file path. |
25
28
  | `sightmap_check` | Validate the sightmap (`level: "schema"` or `"quality"`; default `"quality"`). |
26
- | `sightmap_update_view` | Patch a view's agent-authored fields (`description`, `intent`, `memory_append`, `memory_replace`). |
29
+ | `sightmap_add_view` | Create a new view file (full structural + semantic payload). |
30
+ | `sightmap_update_view` | Patch any field on an existing view — `name`, `route`, `components` (incl. per-component `selector`/`memory`), `description`, `intent`, view-level `memory`. |
31
+ | `sightmap_delete_view` | Remove a view file. |
27
32
  | `sightmap_init_project` | Scaffold an empty `.sightmap/` in a target project. |
28
33
 
29
34
  Curation write tools operate on the directory passed via `--curate-root`
30
35
  (defaults to the first `--sightmap-dir`).
31
36
 
32
- **Component / route / selector edits are not exposed via MCP** — those are
33
- codegen-owned. To track a new component, add a `data-sightmap` attribute to
34
- source and re-run `sightmap-react gen`.
37
+ ### Proposal tools (preview)
38
+
39
+ A three-stage propose / review / commit flow lets a sub-agent gather edits
40
+ in memory, surface them to the main thread for confirmation, and then apply
41
+ them as a batch. Useful for bootstrap and audit-driven fix flows that touch
42
+ multiple views in one turn.
43
+
44
+ | Tool | Purpose |
45
+ |---|---|
46
+ | `sightmap_propose_view` | Stage a new-view proposal (no write yet). |
47
+ | `sightmap_propose_component` | Stage a new-component proposal against an existing view. |
48
+ | `sightmap_review_proposals` | List currently-staged proposals for the main thread to confirm or discard. |
49
+ | `sightmap_commit_proposals` | Apply the staged proposals via the underlying `add_view` / `update_view` writes. |
35
50
 
36
51
  ## Prompts
37
52
 
@@ -65,9 +80,10 @@ curation surface — not its Playwright wrapping. Spawn with `--curate-only`:
65
80
 
66
81
  sightmap-mcp --sightmap-dir .sightmap --curate-only
67
82
 
68
- Only the `sightmap_list_views`, `sightmap_get_view`, `sightmap_update_view`,
69
- `sightmap_check`, `sightmap_init_project`, and `sightmap_match` tools are
70
- registered. No `@playwright/mcp` subprocess is launched.
83
+ In `--curate-only` mode, only the curation tools, proposal tools, and
84
+ `sightmap_match` are registered every tool that needs an upstream browser
85
+ (the four browser tools above plus `sightmap_runtime_snapshot kind: "browser"`)
86
+ is omitted, and no `@playwright/mcp` subprocess is launched.
71
87
 
72
88
  ## Usage
73
89
 
package/dist/cli.d.ts CHANGED
@@ -8,5 +8,17 @@ interface CliArgs {
8
8
  }
9
9
  /** Argv parser. Exposed for unit testing. */
10
10
  declare function parseArgv(argv: string[]): CliArgs;
11
+ /**
12
+ * Write the bippy inject script to a uniquely-named temp directory and return
13
+ * the path. Returns undefined if the script can't be materialized (e.g., bippy
14
+ * IIFE missing in dev contexts) — the caller treats that as "skip pre-nav
15
+ * injection; rely on the post-nav fallback".
16
+ *
17
+ * Visible for unit testing.
18
+ */
19
+ declare function writeInitScriptToTempDir(): Promise<{
20
+ dir: string;
21
+ scriptPath: string;
22
+ } | undefined>;
11
23
 
12
- export { parseArgv };
24
+ export { parseArgv, writeInitScriptToTempDir };