voidforge-build 23.10.0 → 23.11.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.
Files changed (65) hide show
  1. package/dist/.claude/agents/bashir-field-medic.md +1 -0
  2. package/dist/.claude/agents/coulson-release.md +3 -0
  3. package/dist/.claude/agents/irulan-historian.md +3 -0
  4. package/dist/.claude/agents/loki-chaos.md +1 -0
  5. package/dist/.claude/agents/picard-architecture.md +3 -0
  6. package/dist/.claude/agents/silver-surfer-herald.md +3 -0
  7. package/dist/.claude/agents/sisko-campaign.md +3 -0
  8. package/dist/.claude/commands/architect.md +38 -0
  9. package/dist/.claude/commands/campaign.md +2 -0
  10. package/dist/.claude/commands/gauntlet.md +11 -0
  11. package/dist/.claude/commands/git.md +13 -3
  12. package/dist/CHANGELOG.md +63 -0
  13. package/dist/CLAUDE.md +13 -4
  14. package/dist/VERSION.md +2 -1
  15. package/dist/docs/methods/AI_INTELLIGENCE.md +15 -0
  16. package/dist/docs/methods/BACKEND_ENGINEER.md +48 -0
  17. package/dist/docs/methods/CAMPAIGN.md +196 -1
  18. package/dist/docs/methods/DEVOPS_ENGINEER.md +16 -0
  19. package/dist/docs/methods/FORGE_KEEPER.md +18 -0
  20. package/dist/docs/methods/GAUNTLET.md +2 -0
  21. package/dist/docs/methods/QA_ENGINEER.md +46 -0
  22. package/dist/docs/methods/RELEASE_MANAGER.md +59 -0
  23. package/dist/docs/methods/SECURITY_AUDITOR.md +53 -0
  24. package/dist/docs/methods/SUB_AGENTS.md +90 -0
  25. package/dist/docs/methods/SYSTEMS_ARCHITECT.md +42 -2
  26. package/dist/docs/methods/TESTING.md +17 -0
  27. package/dist/docs/methods/TIME_VAULT.md +17 -0
  28. package/dist/docs/patterns/adr-verification-gate.md +80 -0
  29. package/dist/docs/patterns/ai-eval.ts +87 -0
  30. package/dist/docs/patterns/ai-prompt-safety.ts +242 -0
  31. package/dist/docs/patterns/audit-log.ts +132 -0
  32. package/dist/docs/patterns/llm-state-dedup.ts +246 -0
  33. package/dist/docs/patterns/middleware.ts +83 -0
  34. package/dist/docs/patterns/multi-tenant-pool-bypass.ts +134 -0
  35. package/dist/docs/patterns/multi-tenant-property-test.ts +127 -0
  36. package/dist/docs/patterns/refactor-extraction.md +96 -0
  37. package/dist/scripts/voidforge.js +0 -0
  38. package/dist/wizard/lib/anomaly-detection.d.ts +59 -0
  39. package/dist/wizard/lib/anomaly-detection.js +122 -0
  40. package/dist/wizard/lib/asset-scanner.d.ts +23 -0
  41. package/dist/wizard/lib/asset-scanner.js +107 -0
  42. package/dist/wizard/lib/build-analytics.d.ts +39 -0
  43. package/dist/wizard/lib/build-analytics.js +91 -0
  44. package/dist/wizard/lib/codegen/erd-gen.d.ts +16 -0
  45. package/dist/wizard/lib/codegen/erd-gen.js +98 -0
  46. package/dist/wizard/lib/codegen/openapi-gen.d.ts +15 -0
  47. package/dist/wizard/lib/codegen/openapi-gen.js +79 -0
  48. package/dist/wizard/lib/codegen/prisma-types.d.ts +15 -0
  49. package/dist/wizard/lib/codegen/prisma-types.js +44 -0
  50. package/dist/wizard/lib/codegen/seed-gen.d.ts +16 -0
  51. package/dist/wizard/lib/codegen/seed-gen.js +128 -0
  52. package/dist/wizard/lib/correlation-engine.d.ts +59 -0
  53. package/dist/wizard/lib/correlation-engine.js +152 -0
  54. package/dist/wizard/lib/desktop-notify.d.ts +27 -0
  55. package/dist/wizard/lib/desktop-notify.js +98 -0
  56. package/dist/wizard/lib/image-gen.d.ts +56 -0
  57. package/dist/wizard/lib/image-gen.js +159 -0
  58. package/dist/wizard/lib/natural-language-deploy.d.ts +30 -0
  59. package/dist/wizard/lib/natural-language-deploy.js +186 -0
  60. package/dist/wizard/lib/project-init.js +57 -0
  61. package/dist/wizard/lib/route-optimizer.d.ts +28 -0
  62. package/dist/wizard/lib/route-optimizer.js +93 -0
  63. package/dist/wizard/lib/service-install.d.ts +18 -0
  64. package/dist/wizard/lib/service-install.js +182 -0
  65. package/package.json +1 -1
@@ -0,0 +1,182 @@
1
+ /**
2
+ * Service Install — launchd/systemd/Task Scheduler integration (§9.18, §9.19.2).
3
+ *
4
+ * Creates system services for:
5
+ * 1. Heartbeat daemon (com.voidforge.heartbeat)
6
+ * 2. Wizard server (com.voidforge.server) — persistent when Cultivation is installed
7
+ *
8
+ * PRD Reference: §9.18 (macOS LaunchAgent), §9.19.2 (two services)
9
+ */
10
+ import { writeFile, mkdir } from 'node:fs/promises';
11
+ import { join } from 'node:path';
12
+ import { homedir, platform } from 'node:os';
13
+ import { execSync } from 'node:child_process';
14
+ const VOIDFORGE_DIR = join(homedir(), '.voidforge');
15
+ // ── macOS LaunchAgent ─────────────────────────────────
16
+ function heartbeatPlist() {
17
+ const nodePath = process.execPath;
18
+ // Assuming the heartbeat entry point is at wizard/lib/heartbeat.js
19
+ // In production, this would be the installed package path
20
+ return `<?xml version="1.0" encoding="UTF-8"?>
21
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
22
+ <plist version="1.0">
23
+ <dict>
24
+ <key>Label</key>
25
+ <string>com.voidforge.heartbeat</string>
26
+ <key>ProgramArguments</key>
27
+ <array>
28
+ <string>${nodePath}</string>
29
+ <string>${join(VOIDFORGE_DIR, 'heartbeat-entry.js')}</string>
30
+ </array>
31
+ <key>KeepAlive</key>
32
+ <true/>
33
+ <key>RunAtLoad</key>
34
+ <true/>
35
+ <key>ProcessType</key>
36
+ <string>Background</string>
37
+ <key>ThrottleInterval</key>
38
+ <integer>10</integer>
39
+ <key>StandardOutPath</key>
40
+ <string>${join(VOIDFORGE_DIR, 'heartbeat-launchd.log')}</string>
41
+ <key>StandardErrorPath</key>
42
+ <string>${join(VOIDFORGE_DIR, 'heartbeat-launchd.log')}</string>
43
+ </dict>
44
+ </plist>`;
45
+ }
46
+ function serverPlist(port = 3141) {
47
+ const nodePath = process.execPath;
48
+ return `<?xml version="1.0" encoding="UTF-8"?>
49
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
50
+ <plist version="1.0">
51
+ <dict>
52
+ <key>Label</key>
53
+ <string>com.voidforge.server</string>
54
+ <key>ProgramArguments</key>
55
+ <array>
56
+ <string>${nodePath}</string>
57
+ <string>${join(VOIDFORGE_DIR, 'server-entry.js')}</string>
58
+ </array>
59
+ <key>KeepAlive</key>
60
+ <true/>
61
+ <key>RunAtLoad</key>
62
+ <true/>
63
+ <key>ProcessType</key>
64
+ <string>Background</string>
65
+ <key>ThrottleInterval</key>
66
+ <integer>10</integer>
67
+ <key>EnvironmentVariables</key>
68
+ <dict>
69
+ <key>VOIDFORGE_PORT</key>
70
+ <string>${port}</string>
71
+ </dict>
72
+ <key>StandardOutPath</key>
73
+ <string>${join(VOIDFORGE_DIR, 'server-launchd.log')}</string>
74
+ <key>StandardErrorPath</key>
75
+ <string>${join(VOIDFORGE_DIR, 'server-launchd.log')}</string>
76
+ </dict>
77
+ </plist>`;
78
+ }
79
+ // ── Linux systemd ─────────────────────────────────────
80
+ function heartbeatSystemdUnit() {
81
+ return `[Unit]
82
+ Description=VoidForge Heartbeat Daemon
83
+ After=network.target
84
+
85
+ [Service]
86
+ Type=simple
87
+ ExecStart=${process.execPath} ${join(VOIDFORGE_DIR, 'heartbeat-entry.js')}
88
+ Restart=always
89
+ RestartSec=10
90
+ StandardOutput=append:${join(VOIDFORGE_DIR, 'heartbeat-systemd.log')}
91
+ StandardError=append:${join(VOIDFORGE_DIR, 'heartbeat-systemd.log')}
92
+
93
+ [Install]
94
+ WantedBy=default.target`;
95
+ }
96
+ function serverSystemdUnit(port = 3141) {
97
+ return `[Unit]
98
+ Description=VoidForge Server (Danger Room + Cultivation)
99
+ After=network.target
100
+
101
+ [Service]
102
+ Type=simple
103
+ ExecStart=${process.execPath} ${join(VOIDFORGE_DIR, 'server-entry.js')}
104
+ Environment=VOIDFORGE_PORT=${port}
105
+ Restart=always
106
+ RestartSec=10
107
+ StandardOutput=append:${join(VOIDFORGE_DIR, 'server-systemd.log')}
108
+ StandardError=append:${join(VOIDFORGE_DIR, 'server-systemd.log')}
109
+
110
+ [Install]
111
+ WantedBy=default.target`;
112
+ }
113
+ // ── Install Functions ─────────────────────────────────
114
+ export async function installHeartbeatService() {
115
+ if (platform() === 'darwin') {
116
+ const plistDir = join(homedir(), 'Library', 'LaunchAgents');
117
+ const plistPath = join(plistDir, 'com.voidforge.heartbeat.plist');
118
+ await mkdir(plistDir, { recursive: true });
119
+ await writeFile(plistPath, heartbeatPlist());
120
+ execSync(`launchctl load "${plistPath}" 2>/dev/null || true`);
121
+ return { method: 'launchd', path: plistPath };
122
+ }
123
+ if (platform() === 'linux') {
124
+ const unitDir = join(homedir(), '.config', 'systemd', 'user');
125
+ const unitPath = join(unitDir, 'voidforge-heartbeat.service');
126
+ await mkdir(unitDir, { recursive: true });
127
+ await writeFile(unitPath, heartbeatSystemdUnit());
128
+ execSync('systemctl --user daemon-reload 2>/dev/null || true');
129
+ execSync('systemctl --user enable voidforge-heartbeat 2>/dev/null || true');
130
+ return { method: 'systemd', path: unitPath };
131
+ }
132
+ // Windows: Task Scheduler (recommend WSL2 for full support per §9.17)
133
+ return { method: 'manual', path: 'Windows: use WSL2 or run `voidforge heartbeat start --daemon` manually' };
134
+ }
135
+ export async function installServerService(port = 3141) {
136
+ if (platform() === 'darwin') {
137
+ const plistDir = join(homedir(), 'Library', 'LaunchAgents');
138
+ const plistPath = join(plistDir, 'com.voidforge.server.plist');
139
+ await mkdir(plistDir, { recursive: true });
140
+ await writeFile(plistPath, serverPlist(port));
141
+ execSync(`launchctl load "${plistPath}" 2>/dev/null || true`);
142
+ return { method: 'launchd', path: plistPath };
143
+ }
144
+ if (platform() === 'linux') {
145
+ const unitDir = join(homedir(), '.config', 'systemd', 'user');
146
+ const unitPath = join(unitDir, 'voidforge-server.service');
147
+ await mkdir(unitDir, { recursive: true });
148
+ await writeFile(unitPath, serverSystemdUnit(port));
149
+ execSync('systemctl --user daemon-reload 2>/dev/null || true');
150
+ execSync('systemctl --user enable voidforge-server 2>/dev/null || true');
151
+ return { method: 'systemd', path: unitPath };
152
+ }
153
+ return { method: 'manual', path: 'Windows: use WSL2 or run the wizard server manually' };
154
+ }
155
+ export async function uninstallServices() {
156
+ if (platform() === 'darwin') {
157
+ const agents = ['com.voidforge.heartbeat', 'com.voidforge.server'];
158
+ for (const label of agents) {
159
+ const path = join(homedir(), 'Library', 'LaunchAgents', `${label}.plist`);
160
+ try {
161
+ execSync(`launchctl unload "${path}" 2>/dev/null`);
162
+ const { unlink } = await import('node:fs/promises');
163
+ await unlink(path);
164
+ }
165
+ catch { /* not installed */ }
166
+ }
167
+ }
168
+ if (platform() === 'linux') {
169
+ const units = ['voidforge-heartbeat', 'voidforge-server'];
170
+ for (const unit of units) {
171
+ try {
172
+ execSync(`systemctl --user stop ${unit} 2>/dev/null`);
173
+ execSync(`systemctl --user disable ${unit} 2>/dev/null`);
174
+ const path = join(homedir(), '.config', 'systemd', 'user', `${unit}.service`);
175
+ const { unlink } = await import('node:fs/promises');
176
+ await unlink(path);
177
+ }
178
+ catch { /* not installed */ }
179
+ }
180
+ execSync('systemctl --user daemon-reload 2>/dev/null || true');
181
+ }
182
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "voidforge-build",
3
- "version": "23.10.0",
3
+ "version": "23.11.0",
4
4
  "description": "From nothing, everything. A methodology framework for building with Claude Code.",
5
5
  "type": "module",
6
6
  "engines": {