@soleur/opencode 3.359.19 → 3.360.1
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/agents/product/design/ux-design-lead.md +49 -13
- package/commands/go.md +1 -1
- package/hooks/stop-hook.sh +8 -1
- package/package.json +1 -1
- package/skills/brainstorm/SKILL.md +3 -3
- package/skills/brainstorm/references/brainstorm-brand-workshop.md +17 -10
- package/skills/brainstorm-techniques/references/technical-ruling-delegation.md +2 -0
- package/skills/one-shot/SKILL.md +1 -1
- package/skills/pencil-setup/SKILL.md +77 -27
- package/skills/pencil-setup/scripts/check_deps.sh +597 -132
- package/skills/pencil-setup/scripts/copy_adapter.sh +79 -11
- package/skills/pencil-setup/scripts/engine-contract-probe.sh +1132 -133
- package/skills/pencil-setup/scripts/pen-cli/package-lock.json +4359 -0
- package/skills/pencil-setup/scripts/pen-cli/package.json +13 -0
- package/skills/pencil-setup/scripts/pencil-error-enrichment.mjs +67 -14
- package/skills/pencil-setup/scripts/pencil-mcp-adapter.mjs +1283 -458
- package/skills/pencil-setup/scripts/pencil-repl-surface.mjs +377 -68
- package/skills/pencil-setup/scripts/pencil-response-classify.mjs +53 -12
- package/skills/pencil-setup/scripts/pencil-save-gate.mjs +484 -75
- package/skills/plan/SKILL.md +1 -1
- package/skills/plan/references/plan-sharp-edges.md +1 -0
- package/skills/ship/references/operator-holds.md +2 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pen-cli-prefix",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Lockfile-pinned install prefix for the headless Pencil engine. check_deps.sh copies this pair to ~/.local/share/pen-cli and runs npm ci there (ADR-191).",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@pen.dev/cli": "0.3.13"
|
|
8
|
+
},
|
|
9
|
+
"overrides": {
|
|
10
|
+
"undici": "8.12.2",
|
|
11
|
+
"sharp": "0.35.5"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,21 +1,63 @@
|
|
|
1
1
|
// Pure function: enriches known Pencil API error messages with actionable hints.
|
|
2
2
|
// Extracted for testability — no external dependencies.
|
|
3
|
+
//
|
|
4
|
+
// Tool surface (CTO ruling 1): the adapter keeps the agent-facing `mcp__pencil__*`
|
|
5
|
+
// names stable and translates them onto @pen.dev/cli's REPL. Eight tools are
|
|
6
|
+
// live; nine are removed stubs that never reach the engine. REMOVED_TOOL_HINTS is
|
|
7
|
+
// the ONE table behind both the adapter's stub handlers and the hint appended to
|
|
8
|
+
// an engine `Unknown tool:` line, so the two cannot drift.
|
|
3
9
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
export const LIVE_TOOL_NAMES = Object.freeze([
|
|
11
|
+
"open_document",
|
|
12
|
+
"save",
|
|
13
|
+
"batch_design",
|
|
14
|
+
"get_screenshot",
|
|
15
|
+
"export_nodes",
|
|
16
|
+
"get_editor_state",
|
|
17
|
+
"get_variables",
|
|
18
|
+
"read_skill",
|
|
19
|
+
]);
|
|
20
|
+
|
|
21
|
+
// The one steering sentence for the raw DSL calls that bypass the adapter's tools (the
|
|
22
|
+
// batch_design description, SKILL.md and ux-design-lead.md step 2 quote it verbatim).
|
|
23
|
+
export const RAW_CALL_STEERING =
|
|
24
|
+
"Do not call Export or TakeScreenshot inside batch_design: use export_nodes and get_screenshot (raw calls skip the adapter's containment, overwrite list and unsaved-memory warning, and a relative path is resolved against the document's directory, so it can write next to the .pen).";
|
|
25
|
+
|
|
26
|
+
// Every hint starts with the removed tool's own name and names a tool that exists.
|
|
27
|
+
const REMOVED_TOOL_HINTS = Object.freeze({
|
|
28
|
+
batch_get:
|
|
29
|
+
"batch_get was removed (the engine has no node-dump tool). Read nodes with Get(...) and Print(...) inside batch_design, for example Get(id,(n,c)=>Print(n.id+' '+c.bounds.width)) for a node's measured size; in the same visitor c.problems reports clipping (partially or fully clipped). A batch_design call also auto-saves. get_editor_state lists the top-level nodes.",
|
|
30
|
+
snapshot_layout:
|
|
31
|
+
"snapshot_layout was removed. Layout problems arrive as an `## issues detected:` block on batch_design replies; fix them with Update(...) inside batch_design. To measure a node, Print its bounds: Get(id,(n,c)=>Print(n.id+' '+c.bounds.width)); c.problems reports clipping (partially or fully clipped) (grammar: read_skill({ path: \"execute.md\" })).",
|
|
32
|
+
get_guidelines:
|
|
33
|
+
'get_guidelines was removed. Read design guidance with read_skill({ path: "guide/<name>.md" }); call read_skill() with no path for the index.',
|
|
10
34
|
get_style_guide:
|
|
11
|
-
|
|
35
|
+
'get_style_guide was removed. read_skill() lists the engine guides by name, but style archetypes cannot be loaded headless: continue with brand tokens, or read a design guide page with read_skill({ path: "guide/<name>.md" }).',
|
|
12
36
|
get_style_guide_tags:
|
|
13
|
-
|
|
37
|
+
'get_style_guide_tags was removed. read_skill() lists the engine guides by name, but style archetypes cannot be loaded headless: continue with brand tokens, or read a design guide page with read_skill({ path: "guide/<name>.md" }).',
|
|
38
|
+
find_empty_space_on_canvas:
|
|
39
|
+
'find_empty_space_on_canvas was removed. Call Print(FindEmptySpace(...)) inside batch_design to read the free position (grammar: read_skill({ path: "execute.md" })).',
|
|
40
|
+
set_variables:
|
|
41
|
+
'set_variables was removed. Call SetVariables(...) inside batch_design (grammar: read_skill({ path: "execute.md" })).',
|
|
14
42
|
search_all_unique_properties:
|
|
15
|
-
"search_all_unique_properties has no headless equivalent
|
|
43
|
+
"search_all_unique_properties has no headless equivalent. Read nodes with Get(...) and Print(...) inside batch_design; change them with Update(...) in the same batch_design call.",
|
|
16
44
|
replace_all_matching_properties:
|
|
17
|
-
"replace_all_matching_properties has no headless equivalent
|
|
18
|
-
};
|
|
45
|
+
"replace_all_matching_properties has no headless equivalent. Read with Get(...) and change nodes with Update(...) calls inside batch_design.",
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const REMOVED_TOOL_NAMES = Object.freeze(Object.keys(REMOVED_TOOL_HINTS));
|
|
49
|
+
|
|
50
|
+
// The hint for a removed tool, or undefined for any other name (prototype names
|
|
51
|
+
// included).
|
|
52
|
+
export function removedToolHint(name) {
|
|
53
|
+
return Object.hasOwn(REMOVED_TOOL_HINTS, name) ? REMOVED_TOOL_HINTS[name] : undefined;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// `execute` failures end with advice to retry with `edits`/`editId`, which the
|
|
57
|
+
// adapter does not expose; point at the one path that exists instead.
|
|
58
|
+
const EXECUTE_RETRY_ADVICE =
|
|
59
|
+
/^- IMPORTANT: Fix this by calling `execute` again with the `edits` parameter.*$/m;
|
|
60
|
+
const EXECUTE_EDIT_ID_LINE = /^- `editId`: .*\n?/m;
|
|
19
61
|
|
|
20
62
|
export function enrichErrorMessage(text) {
|
|
21
63
|
if (text.includes("alignSelf") && text.includes("unexpected property")) {
|
|
@@ -31,11 +73,22 @@ export function enrichErrorMessage(text) {
|
|
|
31
73
|
"third positional argument to I() (e.g., {after: \"nodeId\"}). Positional " +
|
|
32
74
|
"insertion is not supported. Nodes are appended at end of parent. Use " +
|
|
33
75
|
"M(nodeId, parent, index) to reorder after insertion. Discover the target " +
|
|
34
|
-
"index with
|
|
76
|
+
"index with Get(...) on the parent inside batch_design. See #1117.";
|
|
35
77
|
}
|
|
36
78
|
const removed = text.match(/^Unknown tool: ([a-z_]+)/m);
|
|
37
|
-
if (removed
|
|
38
|
-
|
|
79
|
+
if (removed) {
|
|
80
|
+
const hint = removedToolHint(removed[1]);
|
|
81
|
+
if (hint) return text + "\n\n[adapter hint] " + hint;
|
|
82
|
+
return text;
|
|
83
|
+
}
|
|
84
|
+
if (EXECUTE_RETRY_ADVICE.test(text)) {
|
|
85
|
+
return text
|
|
86
|
+
.replace(
|
|
87
|
+
EXECUTE_RETRY_ADVICE,
|
|
88
|
+
"- IMPORTANT: Fix the operations and re-send the corrected operations with batch_design (the failed block was rolled back)."
|
|
89
|
+
)
|
|
90
|
+
.replace(EXECUTE_EDIT_ID_LINE, "")
|
|
91
|
+
.trimEnd();
|
|
39
92
|
}
|
|
40
93
|
return text;
|
|
41
94
|
}
|