lace-mcp 0.0.2-alpha.2 → 0.0.2-alpha.21

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 (4) hide show
  1. package/README.md +7 -6
  2. package/SKILL.md +22 -7
  3. package/dist/cli.js +74924 -14385
  4. package/package.json +5 -5
package/README.md CHANGED
@@ -5,7 +5,7 @@ MCP server for [Lace](https://inlace.co). Connects your coding agent to approved
5
5
  ## How it works
6
6
 
7
7
  1. You review your product in Lace and approve a decision on the [Decision Canvas](https://docs.inlace.co/concepts/decision-canvas)
8
- 2. Your coding agent calls `list_decisions` to see what's been approved
8
+ 2. Your coding agent calls `search_decisions` to find what's been approved
9
9
  3. It calls `apply_decision` to get screenshots, element targeting, and step-by-step instructions
10
10
  4. The agent writes the code change and you review the diff
11
11
 
@@ -28,18 +28,19 @@ The Lace desktop app must be open and signed in for the MCP server to work.
28
28
 
29
29
  | Tool | Description |
30
30
  | --- | --- |
31
- | `list_decisions` | Returns all approved decisions as a summary list |
32
- | `get_decision` | Full details for a single decision — card, element targeting, bounding box, screenshots |
33
- | `apply_decision` | Everything needed to implement a decision: screenshots, targeting, and step-by-step instructions |
31
+ | `search_decisions` | Search and filter resolved decisions with pagination. No params returns the top 20 |
32
+ | `apply_decision` | Implementation kit for a decision: screenshots, targeting, instructions. `include` controls detail level (`discussion` requires the canvas owner to enable chat sharing) |
33
+ | `list_canvases` | Browse review canvases with page names and decision counts |
34
+ | `list_projects` | Browse projects with thread and canvas counts |
34
35
 
35
- Use `apply_decision` when implementing. Use `get_decision` for browsing.
36
+ Use `search_decisions` to discover, then `apply_decision` to act. Use `list_canvases` and `list_projects` to find IDs for filtering.
36
37
 
37
38
  ## Usage
38
39
 
39
40
  Once installed, ask your coding agent:
40
41
 
41
42
  ```
42
- "List Lace decisions"
43
+ "Search Lace decisions"
43
44
  ```
44
45
 
45
46
  Or to implement directly:
package/SKILL.md CHANGED
@@ -9,13 +9,28 @@ Lace surfaces adoption insights as actionable decisions. When a decision is appr
9
9
 
10
10
  ## Steps
11
11
 
12
- 1. Call the `list_decisions` MCP tool to see all approved decisions.
13
- 2. If there is exactly one decision, proceed with it. If there are multiple, ask the user which one to implement.
14
- 3. Call the `apply_decision` MCP tool with the chosen decision ID.
15
- 4. Follow the implementation instructions returned by `apply_decision` exactly they include screenshots, element targeting, and constraints.
16
- 5. Implement the minimal code change described. Do not refactor or modify anything outside the target element.
12
+ 1. Call the `search_decisions` MCP tool with no params to see recently approved decisions, or pass filters such as `query`, `canvasId`, `projectId`, `appName`, or `elementRole` when the user has given scope.
13
+ 2. If the workspace has many canvases or projects, call `list_canvases` or `list_projects` first and use the returned IDs/titles to scope `search_decisions`.
14
+ 3. If there is exactly one relevant decision, proceed with it. If there are multiple plausible matches, ask the user which one to implement.
15
+ 4. Call `apply_decision` with the chosen decision ID.
16
+ 5. Use `include: "instructions"` by default. Use `include: "crop"` for a cropped element image, `include: "discussion"` for review thread chat history (requires the canvas owner to enable chat sharing), or `include: "all"` for instructions, crop, and chat history combined.
17
+ 6. Follow the implementation instructions returned by `apply_decision` exactly — they include screenshots, element targeting, and constraints.
18
+ 7. Implement the minimal code change described. Do not refactor or modify anything outside the target element.
19
+
20
+ ## Element Grounding Strategies
21
+
22
+ When `apply_decision` returns metadata, use these fields to locate the target element accurately:
23
+
24
+ 1. **Visible text + role** — primary locator. Match the element's `label` text and `role` (button, link, textfield, etc.) in the DOM or component tree.
25
+ 2. **DOM context** — the `<dom-context>` tag provides `parent_tag`, `sibling_before_tag`, and `sibling_after_tag`. Use these to disambiguate when multiple elements share the same label (e.g., two "Save" buttons in different sections).
26
+ 3. **Page vocabulary** — the `<page-elements>` list shows nearby elements with `in:parentTag` context. Scan it to understand the target's neighborhood and confirm you're editing the right instance.
27
+ 4. **Bbox coordinates** — normalized 0–100 percentages. Use as a spatial hint (top-left vs bottom-right), not a pixel-precise locator. Helpful when text matching is ambiguous.
28
+ 5. **Anchor state** — `anchor_state="detached"` means the element moved since the review. Fall back to text + role matching, then sibling context, then ask the user. `anchor_state="reanchored"` means the system re-found it — trust the current metadata.
29
+ 6. **Crop image** — `include="crop"` returns both the full page screenshot and a zoomed crop of the target element. Use the full screenshot for spatial context and the crop for visual detail.
30
+
31
+ **Priority order:** visible text + role → DOM context / siblings → vocabulary neighbors → bbox position → crop image.
17
32
 
18
33
  ## Troubleshooting
19
34
 
20
- - If `list_decisions` returns an authentication error, tell the user to run `npx lace-mcp install <editor>` to re-authenticate.
21
- - If no decisions are returned, the user may need to approve a decision in the Lace overlay first.
35
+ - If `search_decisions` returns an authentication error, tell the user to run `npx lace-mcp install <editor>` to re-authenticate.
36
+ - If no decisions are returned, the user may need to approve a decision in the Lace overlay first or provide a narrower canvas/project scope.