@xenonbyte/da-vinci-workflow 0.1.25 → 0.1.26
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/CHANGELOG.md +23 -0
- package/README.md +39 -10
- package/README.zh-CN.md +28 -10
- package/SKILL.md +3 -0
- package/commands/claude/dv/design.md +1 -0
- package/commands/codex/prompts/dv-design.md +1 -0
- package/commands/gemini/dv/design.toml +1 -0
- package/docs/dv-command-reference.md +14 -2
- package/docs/pencil-rendering-workflow.md +9 -7
- package/docs/prompt-presets/README.md +4 -0
- package/docs/visual-assist-presets/README.md +4 -0
- package/docs/workflow-examples.md +13 -11
- package/docs/workflow-overview.md +2 -0
- package/docs/zh-CN/dv-command-reference.md +14 -2
- package/docs/zh-CN/pencil-rendering-workflow.md +9 -7
- package/docs/zh-CN/prompt-presets/README.md +5 -1
- package/docs/zh-CN/visual-assist-presets/README.md +5 -1
- package/docs/zh-CN/workflow-examples.md +13 -11
- package/docs/zh-CN/workflow-overview.md +2 -0
- package/examples/greenfield-spec-markupflow/README.md +6 -1
- package/lib/async-offload-worker.js +26 -0
- package/lib/async-offload.js +82 -0
- package/lib/audit-parsers.js +152 -32
- package/lib/audit.js +84 -23
- package/lib/cli.js +749 -433
- package/lib/fs-safety.js +1 -4
- package/lib/icon-aliases.js +7 -7
- package/lib/icon-search.js +21 -14
- package/lib/icon-sync.js +220 -41
- package/lib/install.js +128 -60
- package/lib/mcp-runtime-gate.js +4 -7
- package/lib/pen-persistence.js +318 -46
- package/lib/pencil-lock.js +237 -25
- package/lib/pencil-preflight.js +233 -12
- package/lib/pencil-session.js +216 -36
- package/lib/supervisor-review.js +56 -34
- package/lib/utils.js +121 -0
- package/lib/workflow-bootstrap.js +255 -0
- package/package.json +13 -3
- package/references/checkpoints.md +2 -0
- package/references/design-inputs.md +2 -0
- package/references/pencil-design-to-code.md +2 -0
- package/scripts/fixtures/complex-sample.pen +0 -295
- package/scripts/fixtures/mock-pencil.js +0 -49
- package/scripts/test-audit-context-delta.js +0 -446
- package/scripts/test-audit-design-supervisor.js +0 -691
- package/scripts/test-audit-safety.js +0 -92
- package/scripts/test-icon-aliases.js +0 -96
- package/scripts/test-icon-search.js +0 -77
- package/scripts/test-icon-sync.js +0 -178
- package/scripts/test-mcp-runtime-gate.js +0 -287
- package/scripts/test-mode-consistency.js +0 -344
- package/scripts/test-pen-persistence.js +0 -403
- package/scripts/test-pencil-lock.js +0 -130
- package/scripts/test-pencil-preflight.js +0 -169
- package/scripts/test-pencil-session.js +0 -192
- package/scripts/test-persistence-flows.js +0 -345
- package/scripts/test-supervisor-review-cli.js +0 -619
- package/scripts/test-supervisor-review-integration.js +0 -115
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
const assert = require("assert/strict");
|
|
2
|
-
const fs = require("fs");
|
|
3
|
-
const os = require("os");
|
|
4
|
-
const path = require("path");
|
|
5
|
-
const { spawnSync } = require("child_process");
|
|
6
|
-
|
|
7
|
-
const repo = path.resolve(__dirname, "..");
|
|
8
|
-
const daVinciBin = path.join(repo, "bin", "da-vinci.js");
|
|
9
|
-
|
|
10
|
-
function isEnabled(value) {
|
|
11
|
-
return /^(1|true|yes|on)$/i.test(String(value || "").trim());
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (!isEnabled(process.env.DA_VINCI_RUN_SUPERVISOR_INTEGRATION)) {
|
|
15
|
-
console.log(
|
|
16
|
-
"SKIP supervisor-review integration (set DA_VINCI_RUN_SUPERVISOR_INTEGRATION=1 to enable)"
|
|
17
|
-
);
|
|
18
|
-
process.exit(0);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function runNodeScript(args, env = process.env) {
|
|
22
|
-
return spawnSync(process.execPath, [daVinciBin, ...args], {
|
|
23
|
-
cwd: repo,
|
|
24
|
-
encoding: "utf8",
|
|
25
|
-
maxBuffer: 8 * 1024 * 1024,
|
|
26
|
-
env
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function writeText(filePath, text) {
|
|
31
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
32
|
-
fs.writeFileSync(filePath, text);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function runTest(name, fn) {
|
|
36
|
-
try {
|
|
37
|
-
fn();
|
|
38
|
-
console.log(`PASS ${name}`);
|
|
39
|
-
} catch (error) {
|
|
40
|
-
console.error(`FAIL ${name}`);
|
|
41
|
-
throw error;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
runTest("supervisor-review run-reviewers executes codex bridge", () => {
|
|
46
|
-
const base = fs.mkdtempSync(path.join(os.tmpdir(), "da-vinci-supervisor-integration-"));
|
|
47
|
-
const projectRoot = path.join(base, "project");
|
|
48
|
-
const changeId = "integration-001";
|
|
49
|
-
const pencilDesignPath = path.join(
|
|
50
|
-
projectRoot,
|
|
51
|
-
".da-vinci",
|
|
52
|
-
"changes",
|
|
53
|
-
changeId,
|
|
54
|
-
"pencil-design.md"
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
writeText(
|
|
58
|
-
path.join(projectRoot, "DA-VINCI.md"),
|
|
59
|
-
[
|
|
60
|
-
"# DA-VINCI",
|
|
61
|
-
"",
|
|
62
|
-
"## Visual Assist",
|
|
63
|
-
"- Preferred adapters:",
|
|
64
|
-
" - frontend-skill",
|
|
65
|
-
"- Design-supervisor reviewers:",
|
|
66
|
-
" - frontend-skill",
|
|
67
|
-
"- Require Supervisor Review:",
|
|
68
|
-
" - true",
|
|
69
|
-
""
|
|
70
|
-
].join("\n")
|
|
71
|
-
);
|
|
72
|
-
writeText(
|
|
73
|
-
pencilDesignPath,
|
|
74
|
-
[
|
|
75
|
-
"# Pencil Design",
|
|
76
|
-
"",
|
|
77
|
-
"## Screenshot Review Records",
|
|
78
|
-
"- `A_HOME` => `PASS`",
|
|
79
|
-
"",
|
|
80
|
-
"## Checkpoint Status",
|
|
81
|
-
"- Design checkpoint: `PASS`",
|
|
82
|
-
""
|
|
83
|
-
].join("\n")
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
const codexBin = String(process.env.DA_VINCI_CODEX_BIN || "codex").trim() || "codex";
|
|
87
|
-
const result = runNodeScript(
|
|
88
|
-
[
|
|
89
|
-
"supervisor-review",
|
|
90
|
-
"--project",
|
|
91
|
-
projectRoot,
|
|
92
|
-
"--change",
|
|
93
|
-
changeId,
|
|
94
|
-
"--run-reviewers",
|
|
95
|
-
"--review-retries",
|
|
96
|
-
"0",
|
|
97
|
-
"--review-timeout-ms",
|
|
98
|
-
"180000",
|
|
99
|
-
"--codex-bin",
|
|
100
|
-
codexBin,
|
|
101
|
-
"--write",
|
|
102
|
-
"--json"
|
|
103
|
-
],
|
|
104
|
-
process.env
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
assert.equal(result.status, 0, result.stderr || result.stdout);
|
|
108
|
-
const payload = JSON.parse(String(result.stdout || "{}").trim());
|
|
109
|
-
assert.equal(payload.source, "skill");
|
|
110
|
-
assert.equal(payload.runReviewers, true);
|
|
111
|
-
assert.equal(payload.wrote, true);
|
|
112
|
-
assert.ok(Array.isArray(payload.executedReviewers) && payload.executedReviewers.length > 0);
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
console.log("All supervisor-review integration tests passed.");
|