@xenonbyte/da-vinci-workflow 0.1.24 → 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.
Files changed (62) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/README.md +41 -10
  3. package/README.zh-CN.md +30 -10
  4. package/SKILL.md +4 -0
  5. package/commands/claude/dv/design.md +2 -1
  6. package/commands/codex/prompts/dv-design.md +2 -1
  7. package/commands/gemini/dv/design.toml +2 -1
  8. package/docs/constraint-files.md +1 -0
  9. package/docs/dv-command-reference.md +14 -2
  10. package/docs/pencil-rendering-workflow.md +9 -7
  11. package/docs/prompt-presets/README.md +4 -0
  12. package/docs/visual-assist-presets/README.md +4 -0
  13. package/docs/workflow-examples.md +13 -11
  14. package/docs/workflow-overview.md +2 -0
  15. package/docs/zh-CN/constraint-files.md +1 -0
  16. package/docs/zh-CN/dv-command-reference.md +14 -2
  17. package/docs/zh-CN/pencil-rendering-workflow.md +9 -7
  18. package/docs/zh-CN/prompt-presets/README.md +5 -1
  19. package/docs/zh-CN/visual-assist-presets/README.md +5 -1
  20. package/docs/zh-CN/workflow-examples.md +13 -11
  21. package/docs/zh-CN/workflow-overview.md +2 -0
  22. package/examples/greenfield-spec-markupflow/README.md +6 -1
  23. package/lib/async-offload-worker.js +26 -0
  24. package/lib/async-offload.js +82 -0
  25. package/lib/audit-parsers.js +223 -51
  26. package/lib/audit.js +91 -23
  27. package/lib/cli.js +749 -433
  28. package/lib/fs-safety.js +1 -4
  29. package/lib/icon-aliases.js +7 -7
  30. package/lib/icon-search.js +21 -14
  31. package/lib/icon-sync.js +220 -41
  32. package/lib/install.js +128 -60
  33. package/lib/mcp-runtime-gate.js +4 -7
  34. package/lib/pen-persistence.js +365 -46
  35. package/lib/pencil-lock.js +237 -25
  36. package/lib/pencil-preflight.js +233 -12
  37. package/lib/pencil-session.js +216 -36
  38. package/lib/supervisor-review.js +56 -34
  39. package/lib/utils.js +121 -0
  40. package/lib/workflow-bootstrap.js +255 -0
  41. package/package.json +13 -3
  42. package/references/artifact-templates.md +1 -0
  43. package/references/checkpoints.md +2 -0
  44. package/references/design-inputs.md +2 -0
  45. package/references/pencil-design-to-code.md +2 -0
  46. package/scripts/fixtures/complex-sample.pen +0 -295
  47. package/scripts/fixtures/mock-pencil.js +0 -49
  48. package/scripts/test-audit-context-delta.js +0 -446
  49. package/scripts/test-audit-design-supervisor.js +0 -537
  50. package/scripts/test-audit-safety.js +0 -92
  51. package/scripts/test-icon-aliases.js +0 -96
  52. package/scripts/test-icon-search.js +0 -77
  53. package/scripts/test-icon-sync.js +0 -178
  54. package/scripts/test-mcp-runtime-gate.js +0 -287
  55. package/scripts/test-mode-consistency.js +0 -339
  56. package/scripts/test-pen-persistence.js +0 -254
  57. package/scripts/test-pencil-lock.js +0 -130
  58. package/scripts/test-pencil-preflight.js +0 -169
  59. package/scripts/test-pencil-session.js +0 -192
  60. package/scripts/test-persistence-flows.js +0 -345
  61. package/scripts/test-supervisor-review-cli.js +0 -619
  62. 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.");