thevoidforge 21.0.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 (328) hide show
  1. package/dist/scripts/vault-read.d.ts +11 -0
  2. package/dist/scripts/vault-read.js +89 -0
  3. package/dist/scripts/voidforge.d.ts +20 -0
  4. package/dist/scripts/voidforge.js +404 -0
  5. package/dist/tsconfig.tsbuildinfo +1 -0
  6. package/dist/wizard/api/auth.d.ts +5 -0
  7. package/dist/wizard/api/auth.js +133 -0
  8. package/dist/wizard/api/blueprint.d.ts +45 -0
  9. package/dist/wizard/api/blueprint.js +184 -0
  10. package/dist/wizard/api/cloud-providers.d.ts +16 -0
  11. package/dist/wizard/api/cloud-providers.js +363 -0
  12. package/dist/wizard/api/credentials.d.ts +1 -0
  13. package/dist/wizard/api/credentials.js +258 -0
  14. package/dist/wizard/api/danger-room.d.ts +18 -0
  15. package/dist/wizard/api/danger-room.js +401 -0
  16. package/dist/wizard/api/deploy.d.ts +4 -0
  17. package/dist/wizard/api/deploy.js +164 -0
  18. package/dist/wizard/api/prd.d.ts +1 -0
  19. package/dist/wizard/api/prd.js +363 -0
  20. package/dist/wizard/api/project.d.ts +1 -0
  21. package/dist/wizard/api/project.js +239 -0
  22. package/dist/wizard/api/projects.d.ts +6 -0
  23. package/dist/wizard/api/projects.js +648 -0
  24. package/dist/wizard/api/provision.d.ts +4 -0
  25. package/dist/wizard/api/provision.js +535 -0
  26. package/dist/wizard/api/terminal.d.ts +25 -0
  27. package/dist/wizard/api/terminal.js +241 -0
  28. package/dist/wizard/api/users.d.ts +6 -0
  29. package/dist/wizard/api/users.js +244 -0
  30. package/dist/wizard/api/war-room.d.ts +14 -0
  31. package/dist/wizard/api/war-room.js +45 -0
  32. package/dist/wizard/lib/ad-platform-core.d.ts +6 -0
  33. package/dist/wizard/lib/ad-platform-core.js +1 -0
  34. package/dist/wizard/lib/adapters/index.d.ts +52 -0
  35. package/dist/wizard/lib/adapters/index.js +38 -0
  36. package/dist/wizard/lib/adapters/sandbox-bank.d.ts +17 -0
  37. package/dist/wizard/lib/adapters/sandbox-bank.js +77 -0
  38. package/dist/wizard/lib/adapters/sandbox.d.ts +39 -0
  39. package/dist/wizard/lib/adapters/sandbox.js +174 -0
  40. package/dist/wizard/lib/adapters/stripe.d.ts +19 -0
  41. package/dist/wizard/lib/adapters/stripe.js +143 -0
  42. package/dist/wizard/lib/adapters/types.d.ts +9 -0
  43. package/dist/wizard/lib/adapters/types.js +10 -0
  44. package/dist/wizard/lib/agent-memory.d.ts +36 -0
  45. package/dist/wizard/lib/agent-memory.js +114 -0
  46. package/dist/wizard/lib/anomaly-detection.d.ts +59 -0
  47. package/dist/wizard/lib/anomaly-detection.js +122 -0
  48. package/dist/wizard/lib/anthropic.d.ts +21 -0
  49. package/dist/wizard/lib/anthropic.js +105 -0
  50. package/dist/wizard/lib/asset-scanner.d.ts +23 -0
  51. package/dist/wizard/lib/asset-scanner.js +107 -0
  52. package/dist/wizard/lib/audit-log.d.ts +23 -0
  53. package/dist/wizard/lib/audit-log.js +70 -0
  54. package/dist/wizard/lib/autonomy-controller.d.ts +76 -0
  55. package/dist/wizard/lib/autonomy-controller.js +183 -0
  56. package/dist/wizard/lib/body-parser.d.ts +2 -0
  57. package/dist/wizard/lib/body-parser.js +36 -0
  58. package/dist/wizard/lib/build-analytics.d.ts +39 -0
  59. package/dist/wizard/lib/build-analytics.js +91 -0
  60. package/dist/wizard/lib/build-step.d.ts +21 -0
  61. package/dist/wizard/lib/build-step.js +104 -0
  62. package/dist/wizard/lib/campaign-proposer.d.ts +39 -0
  63. package/dist/wizard/lib/campaign-proposer.js +180 -0
  64. package/dist/wizard/lib/campaign-state-machine.d.ts +63 -0
  65. package/dist/wizard/lib/campaign-state-machine.js +114 -0
  66. package/dist/wizard/lib/ci-generator.d.ts +14 -0
  67. package/dist/wizard/lib/ci-generator.js +187 -0
  68. package/dist/wizard/lib/claude-merge.d.ts +38 -0
  69. package/dist/wizard/lib/claude-merge.js +115 -0
  70. package/dist/wizard/lib/codegen/erd-gen.d.ts +16 -0
  71. package/dist/wizard/lib/codegen/erd-gen.js +98 -0
  72. package/dist/wizard/lib/codegen/integrations.d.ts +18 -0
  73. package/dist/wizard/lib/codegen/integrations.js +189 -0
  74. package/dist/wizard/lib/codegen/openapi-gen.d.ts +15 -0
  75. package/dist/wizard/lib/codegen/openapi-gen.js +79 -0
  76. package/dist/wizard/lib/codegen/prisma-types.d.ts +15 -0
  77. package/dist/wizard/lib/codegen/prisma-types.js +44 -0
  78. package/dist/wizard/lib/codegen/seed-gen.d.ts +16 -0
  79. package/dist/wizard/lib/codegen/seed-gen.js +128 -0
  80. package/dist/wizard/lib/compliance.d.ts +51 -0
  81. package/dist/wizard/lib/compliance.js +112 -0
  82. package/dist/wizard/lib/correlation-engine.d.ts +59 -0
  83. package/dist/wizard/lib/correlation-engine.js +151 -0
  84. package/dist/wizard/lib/cost-estimator.d.ts +22 -0
  85. package/dist/wizard/lib/cost-estimator.js +72 -0
  86. package/dist/wizard/lib/cost-tracker.d.ts +27 -0
  87. package/dist/wizard/lib/cost-tracker.js +37 -0
  88. package/dist/wizard/lib/daemon-aggregator.d.ts +71 -0
  89. package/dist/wizard/lib/daemon-aggregator.js +204 -0
  90. package/dist/wizard/lib/daemon-core.d.ts +6 -0
  91. package/dist/wizard/lib/daemon-core.js +5 -0
  92. package/dist/wizard/lib/dashboard-data.d.ts +132 -0
  93. package/dist/wizard/lib/dashboard-data.js +336 -0
  94. package/dist/wizard/lib/dashboard-ws.d.ts +25 -0
  95. package/dist/wizard/lib/dashboard-ws.js +91 -0
  96. package/dist/wizard/lib/deep-current.d.ts +77 -0
  97. package/dist/wizard/lib/deep-current.js +234 -0
  98. package/dist/wizard/lib/deploy-coordinator.d.ts +40 -0
  99. package/dist/wizard/lib/deploy-coordinator.js +86 -0
  100. package/dist/wizard/lib/deploy-log.d.ts +28 -0
  101. package/dist/wizard/lib/deploy-log.js +52 -0
  102. package/dist/wizard/lib/desktop-notify.d.ts +27 -0
  103. package/dist/wizard/lib/desktop-notify.js +98 -0
  104. package/dist/wizard/lib/dns/cloudflare-dns.d.ts +35 -0
  105. package/dist/wizard/lib/dns/cloudflare-dns.js +216 -0
  106. package/dist/wizard/lib/dns/cloudflare-registrar.d.ts +31 -0
  107. package/dist/wizard/lib/dns/cloudflare-registrar.js +148 -0
  108. package/dist/wizard/lib/dns/types.d.ts +22 -0
  109. package/dist/wizard/lib/dns/types.js +4 -0
  110. package/dist/wizard/lib/document-discovery.d.ts +33 -0
  111. package/dist/wizard/lib/document-discovery.js +145 -0
  112. package/dist/wizard/lib/env-validator.d.ts +14 -0
  113. package/dist/wizard/lib/env-validator.js +205 -0
  114. package/dist/wizard/lib/env-writer.d.ts +13 -0
  115. package/dist/wizard/lib/env-writer.js +26 -0
  116. package/dist/wizard/lib/exec.d.ts +30 -0
  117. package/dist/wizard/lib/exec.js +52 -0
  118. package/dist/wizard/lib/experiment.d.ts +70 -0
  119. package/dist/wizard/lib/experiment.js +169 -0
  120. package/dist/wizard/lib/extensions.d.ts +20 -0
  121. package/dist/wizard/lib/extensions.js +183 -0
  122. package/dist/wizard/lib/financial/adapter-factory.d.ts +47 -0
  123. package/dist/wizard/lib/financial/adapter-factory.js +225 -0
  124. package/dist/wizard/lib/financial/billing/base.d.ts +6 -0
  125. package/dist/wizard/lib/financial/billing/base.js +1 -0
  126. package/dist/wizard/lib/financial/billing/google-billing.d.ts +56 -0
  127. package/dist/wizard/lib/financial/billing/google-billing.js +298 -0
  128. package/dist/wizard/lib/financial/billing/meta-billing.d.ts +54 -0
  129. package/dist/wizard/lib/financial/billing/meta-billing.js +243 -0
  130. package/dist/wizard/lib/financial/billing/tiktok-billing.d.ts +54 -0
  131. package/dist/wizard/lib/financial/billing/tiktok-billing.js +260 -0
  132. package/dist/wizard/lib/financial/campaign/base.d.ts +13 -0
  133. package/dist/wizard/lib/financial/campaign/base.js +1 -0
  134. package/dist/wizard/lib/financial/campaign/google-campaign.d.ts +42 -0
  135. package/dist/wizard/lib/financial/campaign/google-campaign.js +388 -0
  136. package/dist/wizard/lib/financial/campaign/meta-campaign.d.ts +41 -0
  137. package/dist/wizard/lib/financial/campaign/meta-campaign.js +311 -0
  138. package/dist/wizard/lib/financial/campaign/sandbox-campaign.d.ts +45 -0
  139. package/dist/wizard/lib/financial/campaign/sandbox-campaign.js +261 -0
  140. package/dist/wizard/lib/financial/campaign/tiktok-campaign.d.ts +40 -0
  141. package/dist/wizard/lib/financial/campaign/tiktok-campaign.js +350 -0
  142. package/dist/wizard/lib/financial/funding-auto.d.ts +44 -0
  143. package/dist/wizard/lib/financial/funding-auto.js +52 -0
  144. package/dist/wizard/lib/financial/funding-policy.d.ts +60 -0
  145. package/dist/wizard/lib/financial/funding-policy.js +179 -0
  146. package/dist/wizard/lib/financial/platform-planner.d.ts +47 -0
  147. package/dist/wizard/lib/financial/platform-planner.js +134 -0
  148. package/dist/wizard/lib/financial/reconciliation-engine.d.ts +78 -0
  149. package/dist/wizard/lib/financial/reconciliation-engine.js +193 -0
  150. package/dist/wizard/lib/financial/registry.d.ts +22 -0
  151. package/dist/wizard/lib/financial/registry.js +26 -0
  152. package/dist/wizard/lib/financial/reporting.d.ts +96 -0
  153. package/dist/wizard/lib/financial/reporting.js +198 -0
  154. package/dist/wizard/lib/financial/stablecoin/base.d.ts +6 -0
  155. package/dist/wizard/lib/financial/stablecoin/base.js +1 -0
  156. package/dist/wizard/lib/financial/stablecoin/circle.d.ts +54 -0
  157. package/dist/wizard/lib/financial/stablecoin/circle.js +367 -0
  158. package/dist/wizard/lib/financial/stablecoin/mercury.d.ts +24 -0
  159. package/dist/wizard/lib/financial/stablecoin/mercury.js +171 -0
  160. package/dist/wizard/lib/financial/stablecoin/sandbox-stablecoin.d.ts +47 -0
  161. package/dist/wizard/lib/financial/stablecoin/sandbox-stablecoin.js +202 -0
  162. package/dist/wizard/lib/financial/treasury-planner.d.ts +52 -0
  163. package/dist/wizard/lib/financial/treasury-planner.js +128 -0
  164. package/dist/wizard/lib/financial-core.d.ts +6 -0
  165. package/dist/wizard/lib/financial-core.js +5 -0
  166. package/dist/wizard/lib/financial-vault.d.ts +34 -0
  167. package/dist/wizard/lib/financial-vault.js +199 -0
  168. package/dist/wizard/lib/frontmatter.d.ts +30 -0
  169. package/dist/wizard/lib/frontmatter.js +96 -0
  170. package/dist/wizard/lib/gap-analysis.d.ts +37 -0
  171. package/dist/wizard/lib/gap-analysis.js +218 -0
  172. package/dist/wizard/lib/github.d.ts +22 -0
  173. package/dist/wizard/lib/github.js +261 -0
  174. package/dist/wizard/lib/headless-deploy.d.ts +14 -0
  175. package/dist/wizard/lib/headless-deploy.js +452 -0
  176. package/dist/wizard/lib/health-monitor.d.ts +15 -0
  177. package/dist/wizard/lib/health-monitor.js +91 -0
  178. package/dist/wizard/lib/health-poller.d.ts +9 -0
  179. package/dist/wizard/lib/health-poller.js +123 -0
  180. package/dist/wizard/lib/heartbeat.d.ts +15 -0
  181. package/dist/wizard/lib/heartbeat.js +827 -0
  182. package/dist/wizard/lib/http-helpers.d.ts +9 -0
  183. package/dist/wizard/lib/http-helpers.js +24 -0
  184. package/dist/wizard/lib/image-gen.d.ts +56 -0
  185. package/dist/wizard/lib/image-gen.js +159 -0
  186. package/dist/wizard/lib/instance-sizing.d.ts +26 -0
  187. package/dist/wizard/lib/instance-sizing.js +51 -0
  188. package/dist/wizard/lib/kongo/analytics.d.ts +29 -0
  189. package/dist/wizard/lib/kongo/analytics.js +179 -0
  190. package/dist/wizard/lib/kongo/campaigns.d.ts +52 -0
  191. package/dist/wizard/lib/kongo/campaigns.js +91 -0
  192. package/dist/wizard/lib/kongo/client.d.ts +58 -0
  193. package/dist/wizard/lib/kongo/client.js +221 -0
  194. package/dist/wizard/lib/kongo/jobs.d.ts +57 -0
  195. package/dist/wizard/lib/kongo/jobs.js +122 -0
  196. package/dist/wizard/lib/kongo/pages.d.ts +60 -0
  197. package/dist/wizard/lib/kongo/pages.js +150 -0
  198. package/dist/wizard/lib/kongo/provisioner.d.ts +64 -0
  199. package/dist/wizard/lib/kongo/provisioner.js +116 -0
  200. package/dist/wizard/lib/kongo/seed.d.ts +49 -0
  201. package/dist/wizard/lib/kongo/seed.js +237 -0
  202. package/dist/wizard/lib/kongo/types.d.ts +323 -0
  203. package/dist/wizard/lib/kongo/types.js +11 -0
  204. package/dist/wizard/lib/kongo/variants.d.ts +57 -0
  205. package/dist/wizard/lib/kongo/variants.js +88 -0
  206. package/dist/wizard/lib/kongo/webhooks.d.ts +41 -0
  207. package/dist/wizard/lib/kongo/webhooks.js +112 -0
  208. package/dist/wizard/lib/marker.d.ts +28 -0
  209. package/dist/wizard/lib/marker.js +79 -0
  210. package/dist/wizard/lib/migrator.d.ts +35 -0
  211. package/dist/wizard/lib/migrator.js +190 -0
  212. package/dist/wizard/lib/natural-language-deploy.d.ts +30 -0
  213. package/dist/wizard/lib/natural-language-deploy.js +186 -0
  214. package/dist/wizard/lib/network.d.ts +22 -0
  215. package/dist/wizard/lib/network.js +72 -0
  216. package/dist/wizard/lib/oauth-core.d.ts +6 -0
  217. package/dist/wizard/lib/oauth-core.js +5 -0
  218. package/dist/wizard/lib/open-browser.d.ts +1 -0
  219. package/dist/wizard/lib/open-browser.js +26 -0
  220. package/dist/wizard/lib/patterns/ad-billing-adapter.d.ts +209 -0
  221. package/dist/wizard/lib/patterns/ad-billing-adapter.js +269 -0
  222. package/dist/wizard/lib/patterns/ad-platform-adapter.d.ts +200 -0
  223. package/dist/wizard/lib/patterns/ad-platform-adapter.js +212 -0
  224. package/dist/wizard/lib/patterns/daemon-process.d.ts +88 -0
  225. package/dist/wizard/lib/patterns/daemon-process.js +271 -0
  226. package/dist/wizard/lib/patterns/financial-transaction.d.ts +161 -0
  227. package/dist/wizard/lib/patterns/financial-transaction.js +132 -0
  228. package/dist/wizard/lib/patterns/funding-plan.d.ts +136 -0
  229. package/dist/wizard/lib/patterns/funding-plan.js +200 -0
  230. package/dist/wizard/lib/patterns/oauth-token-lifecycle.d.ts +94 -0
  231. package/dist/wizard/lib/patterns/oauth-token-lifecycle.js +139 -0
  232. package/dist/wizard/lib/patterns/outbound-rate-limiter.d.ts +67 -0
  233. package/dist/wizard/lib/patterns/outbound-rate-limiter.js +216 -0
  234. package/dist/wizard/lib/patterns/revenue-source-adapter.d.ts +96 -0
  235. package/dist/wizard/lib/patterns/revenue-source-adapter.js +182 -0
  236. package/dist/wizard/lib/patterns/stablecoin-adapter.d.ts +218 -0
  237. package/dist/wizard/lib/patterns/stablecoin-adapter.js +264 -0
  238. package/dist/wizard/lib/prd-validator.d.ts +39 -0
  239. package/dist/wizard/lib/prd-validator.js +137 -0
  240. package/dist/wizard/lib/project-init.d.ts +24 -0
  241. package/dist/wizard/lib/project-init.js +193 -0
  242. package/dist/wizard/lib/project-registry.d.ts +86 -0
  243. package/dist/wizard/lib/project-registry.js +359 -0
  244. package/dist/wizard/lib/provision-manifest.d.ts +44 -0
  245. package/dist/wizard/lib/provision-manifest.js +164 -0
  246. package/dist/wizard/lib/provisioner-registry.d.ts +15 -0
  247. package/dist/wizard/lib/provisioner-registry.js +34 -0
  248. package/dist/wizard/lib/provisioners/aws-vps.d.ts +6 -0
  249. package/dist/wizard/lib/provisioners/aws-vps.js +643 -0
  250. package/dist/wizard/lib/provisioners/cloudflare.d.ts +6 -0
  251. package/dist/wizard/lib/provisioners/cloudflare.js +300 -0
  252. package/dist/wizard/lib/provisioners/docker.d.ts +6 -0
  253. package/dist/wizard/lib/provisioners/docker.js +75 -0
  254. package/dist/wizard/lib/provisioners/http-client.d.ts +20 -0
  255. package/dist/wizard/lib/provisioners/http-client.js +79 -0
  256. package/dist/wizard/lib/provisioners/railway.d.ts +6 -0
  257. package/dist/wizard/lib/provisioners/railway.js +413 -0
  258. package/dist/wizard/lib/provisioners/scripts/caddyfile.d.ts +10 -0
  259. package/dist/wizard/lib/provisioners/scripts/caddyfile.js +54 -0
  260. package/dist/wizard/lib/provisioners/scripts/deploy-vps.d.ts +10 -0
  261. package/dist/wizard/lib/provisioners/scripts/deploy-vps.js +112 -0
  262. package/dist/wizard/lib/provisioners/scripts/docker-compose.d.ts +11 -0
  263. package/dist/wizard/lib/provisioners/scripts/docker-compose.js +91 -0
  264. package/dist/wizard/lib/provisioners/scripts/dockerfile.d.ts +5 -0
  265. package/dist/wizard/lib/provisioners/scripts/dockerfile.js +185 -0
  266. package/dist/wizard/lib/provisioners/scripts/ecosystem-config.d.ts +10 -0
  267. package/dist/wizard/lib/provisioners/scripts/ecosystem-config.js +36 -0
  268. package/dist/wizard/lib/provisioners/scripts/provision-vps.d.ts +14 -0
  269. package/dist/wizard/lib/provisioners/scripts/provision-vps.js +202 -0
  270. package/dist/wizard/lib/provisioners/scripts/rollback-vps.d.ts +10 -0
  271. package/dist/wizard/lib/provisioners/scripts/rollback-vps.js +67 -0
  272. package/dist/wizard/lib/provisioners/self-deploy.d.ts +41 -0
  273. package/dist/wizard/lib/provisioners/self-deploy.js +185 -0
  274. package/dist/wizard/lib/provisioners/static-s3.d.ts +6 -0
  275. package/dist/wizard/lib/provisioners/static-s3.js +235 -0
  276. package/dist/wizard/lib/provisioners/types.d.ts +40 -0
  277. package/dist/wizard/lib/provisioners/types.js +4 -0
  278. package/dist/wizard/lib/provisioners/vercel.d.ts +6 -0
  279. package/dist/wizard/lib/provisioners/vercel.js +287 -0
  280. package/dist/wizard/lib/pty-manager.d.ts +42 -0
  281. package/dist/wizard/lib/pty-manager.js +231 -0
  282. package/dist/wizard/lib/rate-limiter-core.d.ts +5 -0
  283. package/dist/wizard/lib/rate-limiter-core.js +5 -0
  284. package/dist/wizard/lib/reconciliation.d.ts +43 -0
  285. package/dist/wizard/lib/reconciliation.js +173 -0
  286. package/dist/wizard/lib/revenue-types.d.ts +5 -0
  287. package/dist/wizard/lib/revenue-types.js +1 -0
  288. package/dist/wizard/lib/route-optimizer.d.ts +28 -0
  289. package/dist/wizard/lib/route-optimizer.js +93 -0
  290. package/dist/wizard/lib/s3-deploy.d.ts +19 -0
  291. package/dist/wizard/lib/s3-deploy.js +156 -0
  292. package/dist/wizard/lib/safety-tiers.d.ts +76 -0
  293. package/dist/wizard/lib/safety-tiers.js +134 -0
  294. package/dist/wizard/lib/sentry-generator.d.ts +15 -0
  295. package/dist/wizard/lib/sentry-generator.js +116 -0
  296. package/dist/wizard/lib/server-config.d.ts +13 -0
  297. package/dist/wizard/lib/server-config.js +23 -0
  298. package/dist/wizard/lib/service-install.d.ts +18 -0
  299. package/dist/wizard/lib/service-install.js +182 -0
  300. package/dist/wizard/lib/site-scanner.d.ts +80 -0
  301. package/dist/wizard/lib/site-scanner.js +262 -0
  302. package/dist/wizard/lib/ssh-deploy.d.ts +25 -0
  303. package/dist/wizard/lib/ssh-deploy.js +225 -0
  304. package/dist/wizard/lib/templates.d.ts +24 -0
  305. package/dist/wizard/lib/templates.js +219 -0
  306. package/dist/wizard/lib/totp.d.ts +35 -0
  307. package/dist/wizard/lib/totp.js +276 -0
  308. package/dist/wizard/lib/tower-auth.d.ts +43 -0
  309. package/dist/wizard/lib/tower-auth.js +352 -0
  310. package/dist/wizard/lib/tower-rate-limit.d.ts +14 -0
  311. package/dist/wizard/lib/tower-rate-limit.js +61 -0
  312. package/dist/wizard/lib/tower-session.d.ts +28 -0
  313. package/dist/wizard/lib/tower-session.js +119 -0
  314. package/dist/wizard/lib/treasury-backup.d.ts +23 -0
  315. package/dist/wizard/lib/treasury-backup.js +126 -0
  316. package/dist/wizard/lib/treasury-heartbeat.d.ts +82 -0
  317. package/dist/wizard/lib/treasury-heartbeat.js +1104 -0
  318. package/dist/wizard/lib/updater.d.ts +29 -0
  319. package/dist/wizard/lib/updater.js +190 -0
  320. package/dist/wizard/lib/user-manager.d.ts +39 -0
  321. package/dist/wizard/lib/user-manager.js +182 -0
  322. package/dist/wizard/lib/vault.d.ts +26 -0
  323. package/dist/wizard/lib/vault.js +161 -0
  324. package/dist/wizard/router.d.ts +5 -0
  325. package/dist/wizard/router.js +15 -0
  326. package/dist/wizard/server.d.ts +18 -0
  327. package/dist/wizard/server.js +436 -0
  328. package/package.json +59 -0
@@ -0,0 +1,336 @@
1
+ /**
2
+ * Dashboard data parsers — shared between Danger Room and War Room.
3
+ * Reads campaign-state.md, assemble-state.md, log files, deploy logs, VERSION.md.
4
+ *
5
+ * Parser fixes from field reports #127, #128:
6
+ * - parseCampaignState: rewritten for actual 5-column format, handles bold status
7
+ * - parseBuildState: explicit trim to remove capture artifacts
8
+ * - parseFindings: reads Known Issues from build-state.md first, falls back to regex
9
+ */
10
+ import { readdir, unlink } from 'node:fs/promises';
11
+ import { join, resolve } from 'node:path';
12
+ import { homedir } from 'node:os';
13
+ import { readFileOrNull } from './http-helpers.js';
14
+ const PROJECT_ROOT = resolve(join(import.meta.dirname, '..', '..'));
15
+ const LOGS_DIR = join(PROJECT_ROOT, 'logs');
16
+ const VOIDFORGE_DIR = join(homedir(), '.voidforge');
17
+ // ── Parsers ──────────────────────────────────
18
+ /**
19
+ * Parse campaign-state.md into structured campaign data.
20
+ *
21
+ * Handles the actual format written by /campaign:
22
+ * | # | Mission | Scope | Status | Debrief |
23
+ * | 1 | Name | ... | NOT STARTED | — |
24
+ *
25
+ * Status values may be wrapped in bold: **DONE**, **COMPLETE**
26
+ * Normalizes to: COMPLETE, ACTIVE, BLOCKED, PENDING, STRUCTURAL
27
+ */
28
+ export async function parseCampaignState() {
29
+ const content = await readFileOrNull(join(LOGS_DIR, 'campaign-state.md'));
30
+ if (!content)
31
+ return null;
32
+ const missions = [];
33
+ // Match 5-column table rows: | # | name | scope | status | debrief |
34
+ // Status may be wrapped in ** for bold markdown
35
+ const re = /\|\s*(\d+)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*\*{0,2}(COMPLETE|DONE|IN PROGRESS|NOT STARTED|BLOCKED|STRUCTURAL|ACTIVE|ABANDONED)\*{0,2}\s*\|\s*(.+?)\s*\|/g;
36
+ let m;
37
+ while ((m = re.exec(content)) !== null) {
38
+ const rawStatus = m[4].trim();
39
+ // Normalize: DONE→COMPLETE, IN PROGRESS→ACTIVE, NOT STARTED→PENDING
40
+ const status = rawStatus === 'IN PROGRESS' ? 'ACTIVE'
41
+ : rawStatus === 'NOT STARTED' ? 'PENDING'
42
+ : rawStatus === 'DONE' ? 'COMPLETE'
43
+ : rawStatus;
44
+ missions.push({
45
+ name: m[2].trim(),
46
+ status,
47
+ number: parseInt(m[1]),
48
+ debrief: m[5].trim() === '—' ? undefined : m[5].trim(),
49
+ });
50
+ }
51
+ if (missions.length === 0) {
52
+ // Defensive: warn if file has content but no missions parsed
53
+ if (content.length > 100) {
54
+ console.warn('parseCampaignState: no missions found in non-empty file (%d chars)', content.length);
55
+ }
56
+ return null;
57
+ }
58
+ const statusMatch = content.match(/CAMPAIGN STATUS:\s*(.+?)(?:\n|$)/);
59
+ const status = statusMatch ? statusMatch[1] : 'ACTIVE';
60
+ const sections = missions.map(mi => ({ name: mi.name, status: mi.status }));
61
+ return { missions, status, sections };
62
+ }
63
+ /**
64
+ * Parse assemble-state.md into phase pipeline data.
65
+ * Explicit trim on captures to remove leading artifacts.
66
+ */
67
+ export async function parseBuildState() {
68
+ const content = await readFileOrNull(join(LOGS_DIR, 'assemble-state.md'));
69
+ if (!content)
70
+ return null;
71
+ const phases = [];
72
+ const re = /\|\s*(?:\d+\.\s*)?(.+?)\s*\|\s*(COMPLETE|IN PROGRESS|NOT STARTED|PENDING|SKIPPED)\s*\|/g;
73
+ let m;
74
+ while ((m = re.exec(content)) !== null) {
75
+ // Explicit trim + artifact removal
76
+ const name = m[1].trim().replace(/^\|\s*/, '');
77
+ if (name === 'Phase' || name === 'Status' || name.startsWith('-') || name === '')
78
+ continue;
79
+ const raw = m[2].trim();
80
+ const normalized = raw === 'IN PROGRESS' ? 'active' : raw === 'NOT STARTED' ? 'pending' : raw.toLowerCase();
81
+ phases.push({ name, status: normalized });
82
+ }
83
+ return phases.length > 0 ? { phases } : null;
84
+ }
85
+ function countSeverity(content, severity) {
86
+ const tableHits = (content.match(new RegExp(`\\|\\s*${severity}\\s*\\|`, 'gi')) || []).length;
87
+ const boldHits = (content.match(new RegExp(`\\*\\*${severity}\\*\\*`, 'gi')) || []).length;
88
+ return tableHits + boldHits;
89
+ }
90
+ /**
91
+ * Parse findings — prefer Known Issues from build-state.md (curated, reflects open issues only).
92
+ * Falls back to regex counting across log files (historical totals, may overcount).
93
+ */
94
+ export async function parseFindings() {
95
+ const counts = { critical: 0, high: 0, medium: 0, low: 0 };
96
+ // Preferred: read Known Issues from build-state.md
97
+ const buildState = await readFileOrNull(join(LOGS_DIR, 'build-state.md'));
98
+ if (buildState) {
99
+ const knownIssuesMatch = buildState.match(/## Known Issues[\s\S]*?(?=\n## |\n---|$)/);
100
+ if (knownIssuesMatch) {
101
+ const section = knownIssuesMatch[0];
102
+ counts.critical = countSeverity(section, 'CRITICAL');
103
+ counts.high = countSeverity(section, 'HIGH');
104
+ counts.medium = countSeverity(section, 'MEDIUM');
105
+ counts.low = countSeverity(section, 'LOW');
106
+ return counts;
107
+ }
108
+ }
109
+ // Fallback: count across all log files (historical — may include fixed findings)
110
+ try {
111
+ const files = await readdir(LOGS_DIR);
112
+ const logFiles = files.filter(f => f.startsWith('phase-') || f === 'gauntlet-state.md');
113
+ for (const file of logFiles) {
114
+ const content = await readFileOrNull(join(LOGS_DIR, file));
115
+ if (!content)
116
+ continue;
117
+ counts.critical += countSeverity(content, 'CRITICAL');
118
+ counts.high += countSeverity(content, 'HIGH');
119
+ counts.medium += countSeverity(content, 'MEDIUM');
120
+ counts.low += countSeverity(content, 'LOW');
121
+ }
122
+ }
123
+ catch { /* no logs directory */ }
124
+ return counts;
125
+ }
126
+ /** Read deploy log from logs or .voidforge directory. Also reads deploy-state.md (v15.0). */
127
+ export async function readDeployLog() {
128
+ // Try JSON sources first
129
+ const jsonPaths = [
130
+ join(LOGS_DIR, 'deploy-log.json'),
131
+ join(VOIDFORGE_DIR, 'deploys', 'latest.json'),
132
+ ];
133
+ for (const p of jsonPaths) {
134
+ const content = await readFileOrNull(p);
135
+ if (!content)
136
+ continue;
137
+ try {
138
+ const data = JSON.parse(content);
139
+ return {
140
+ url: String(data.url || ''),
141
+ healthy: Boolean(data.healthy),
142
+ target: String(data.target || ''),
143
+ timestamp: String(data.timestamp || ''),
144
+ };
145
+ }
146
+ catch {
147
+ continue;
148
+ }
149
+ }
150
+ // Try deploy-state.md (v15.0 /deploy command format)
151
+ const deployState = await readFileOrNull(join(LOGS_DIR, 'deploy-state.md'));
152
+ if (deployState) {
153
+ const urlMatch = deployState.match(/(?:URL|Target):\s*(.+?)(?:\n|$)/i);
154
+ const statusMatch = deployState.match(/Status:\s*(.+?)(?:\n|$)/i);
155
+ const timestampMatch = deployState.match(/(?:Last deployed|Timestamp):\s*(.+?)(?:\n|$)/i);
156
+ const commitMatch = deployState.match(/Commit:\s*(.+?)(?:\n|$)/i);
157
+ if (urlMatch || statusMatch) {
158
+ return {
159
+ url: urlMatch ? urlMatch[1].trim() : '',
160
+ healthy: statusMatch ? statusMatch[1].trim().toLowerCase() === 'healthy' : false,
161
+ target: '',
162
+ timestamp: timestampMatch ? timestampMatch[1].trim() : '',
163
+ commit: commitMatch ? commitMatch[1].trim() : undefined,
164
+ };
165
+ }
166
+ }
167
+ return null;
168
+ }
169
+ /** Detect deployment drift — compare deployed commit against current HEAD. */
170
+ export async function detectDeployDrift() {
171
+ // Read deployed commit from deploy-state.md
172
+ const deployState = await readFileOrNull(join(LOGS_DIR, 'deploy-state.md'));
173
+ let deployedCommit = null;
174
+ if (deployState) {
175
+ const match = deployState.match(/Commit:\s*(\w+)/);
176
+ if (match)
177
+ deployedCommit = match[1];
178
+ }
179
+ if (!deployedCommit)
180
+ return null;
181
+ // Get current HEAD
182
+ try {
183
+ const { execFile } = await import('node:child_process');
184
+ const { promisify } = await import('node:util');
185
+ const exec = promisify(execFile);
186
+ const result = await exec('git', ['rev-parse', '--short', 'HEAD'], { cwd: PROJECT_ROOT, timeout: 5000 });
187
+ const headCommit = result.stdout.trim();
188
+ return {
189
+ deployed_commit: deployedCommit,
190
+ head_commit: headCommit,
191
+ drifted: deployedCommit !== headCommit,
192
+ };
193
+ }
194
+ catch {
195
+ return { deployed_commit: deployedCommit, head_commit: null, drifted: true };
196
+ }
197
+ }
198
+ /** Read current version from VERSION.md. */
199
+ export async function readVersion() {
200
+ const content = await readFileOrNull(join(PROJECT_ROOT, 'VERSION.md'));
201
+ if (!content)
202
+ return { version: 'unknown', branch: 'unknown' };
203
+ const match = content.match(/\*\*Current:\*\*\s*([\d.]+)/);
204
+ return { version: match ? match[1] : 'unknown', branch: 'main' };
205
+ }
206
+ const STALENESS_THRESHOLD_MS = 60000; // 60 seconds
207
+ /**
208
+ * Read context stats from the Status Line bridge.
209
+ * Reads per-session files (~/.voidforge/context-stats-*.json) and returns the most recent.
210
+ * Returns null if no data exists or all data is stale (>60s old).
211
+ */
212
+ export async function readContextStats() {
213
+ try {
214
+ const files = await readdir(VOIDFORGE_DIR);
215
+ const statsFiles = files.filter(f => f.startsWith('context-stats-') && f.endsWith('.json'));
216
+ if (statsFiles.length === 0)
217
+ return null;
218
+ let mostRecent = null;
219
+ let latestTime = 0;
220
+ const now = Date.now() / 1000; // jq's `now` outputs Unix seconds
221
+ const CLEANUP_AGE_S = 300; // 5 minutes — delete orphaned session files
222
+ for (const file of statsFiles) {
223
+ const filePath = join(VOIDFORGE_DIR, file);
224
+ const content = await readFileOrNull(filePath);
225
+ if (!content)
226
+ continue;
227
+ try {
228
+ const data = JSON.parse(content);
229
+ if (!data.updated_at)
230
+ continue;
231
+ // Clean up files older than 5 minutes (orphaned sessions — Gauntlet Picard DR-13)
232
+ if (now - data.updated_at > CLEANUP_AGE_S) {
233
+ try {
234
+ await unlink(filePath);
235
+ }
236
+ catch { /* ignore */ }
237
+ continue;
238
+ }
239
+ // Check staleness — skip files older than 60 seconds (still show —% gauge)
240
+ if (now - data.updated_at > STALENESS_THRESHOLD_MS / 1000)
241
+ continue;
242
+ if (data.updated_at > latestTime) {
243
+ latestTime = data.updated_at;
244
+ mostRecent = data;
245
+ }
246
+ }
247
+ catch {
248
+ continue;
249
+ }
250
+ }
251
+ return mostRecent;
252
+ }
253
+ catch {
254
+ return null;
255
+ }
256
+ }
257
+ /**
258
+ * Read test results from test-results.json (written by test runner or hook).
259
+ */
260
+ export async function readTestResults() {
261
+ const paths = [
262
+ join(PROJECT_ROOT, 'test-results.json'),
263
+ join(LOGS_DIR, 'test-results.json'),
264
+ ];
265
+ for (const p of paths) {
266
+ const content = await readFileOrNull(p);
267
+ if (!content)
268
+ continue;
269
+ try {
270
+ const data = JSON.parse(content);
271
+ if (typeof data.total === 'number')
272
+ return data;
273
+ }
274
+ catch {
275
+ continue;
276
+ }
277
+ }
278
+ return null;
279
+ }
280
+ /**
281
+ * Read danger-room.config.json for project-specific panel settings.
282
+ */
283
+ export async function readDashboardConfig() {
284
+ const paths = [
285
+ join(PROJECT_ROOT, 'wizard', 'danger-room.config.json'),
286
+ join(PROJECT_ROOT, 'danger-room.config.json'),
287
+ ];
288
+ for (const p of paths) {
289
+ const content = await readFileOrNull(p);
290
+ if (!content)
291
+ continue;
292
+ try {
293
+ return JSON.parse(content);
294
+ }
295
+ catch {
296
+ continue;
297
+ }
298
+ }
299
+ return {};
300
+ }
301
+ /**
302
+ * Read git status for the Git Status panel.
303
+ */
304
+ export async function readGitStatus() {
305
+ try {
306
+ const { execFile } = await import('node:child_process');
307
+ const { promisify } = await import('node:util');
308
+ const exec = promisify(execFile);
309
+ const [branchResult, statusResult, logResult] = await Promise.all([
310
+ exec('git', ['branch', '--show-current'], { cwd: PROJECT_ROOT, timeout: 5000 }).catch(() => ({ stdout: 'unknown' })),
311
+ exec('git', ['status', '--porcelain'], { cwd: PROJECT_ROOT, timeout: 5000 }).catch(() => ({ stdout: '' })),
312
+ exec('git', ['log', '--oneline', '-1'], { cwd: PROJECT_ROOT, timeout: 5000 }).catch(() => ({ stdout: '—' })),
313
+ ]);
314
+ const branch = branchResult.stdout.trim() || 'unknown';
315
+ const uncommitted = statusResult.stdout.trim().split('\n').filter(Boolean).length;
316
+ const lastCommit = logResult.stdout.trim();
317
+ // Ahead/behind — may fail if no upstream is set
318
+ let ahead = 0;
319
+ let behind = 0;
320
+ try {
321
+ const abResult = await exec('git', ['rev-list', '--count', '--left-right', `origin/${branch}...HEAD`], { cwd: PROJECT_ROOT, timeout: 5000 });
322
+ const parts = abResult.stdout.trim().split('\t');
323
+ if (parts.length === 2) {
324
+ behind = parseInt(parts[0]) || 0;
325
+ ahead = parseInt(parts[1]) || 0;
326
+ }
327
+ }
328
+ catch { /* no upstream — normal for some branches */ }
329
+ return { branch, uncommitted, ahead, behind, lastCommit };
330
+ }
331
+ catch {
332
+ return null;
333
+ }
334
+ }
335
+ /** Export paths for modules that need direct access. */
336
+ export { PROJECT_ROOT, LOGS_DIR, VOIDFORGE_DIR };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Dashboard WebSocket infrastructure factory.
3
+ * Creates WebSocket server instances for dashboards (Danger Room, War Room)
4
+ * with heartbeat, connection management, origin validation, and broadcast.
5
+ */
6
+ import type { IncomingMessage } from 'node:http';
7
+ import type { Duplex } from 'node:stream';
8
+ export interface DashboardWs {
9
+ /** Broadcast a message to all connected clients. */
10
+ broadcast: (data: {
11
+ type: string;
12
+ [key: string]: unknown;
13
+ }) => void;
14
+ /** Handle WebSocket upgrade for this dashboard's path. */
15
+ handleUpgrade: (req: IncomingMessage, socket: Duplex, head: Buffer) => void;
16
+ /** Close all connections and shut down. */
17
+ close: () => void;
18
+ /** Current number of connected clients. */
19
+ clientCount: () => number;
20
+ }
21
+ /**
22
+ * Create a new dashboard WebSocket instance.
23
+ * @param name — Human-readable name for logging (e.g., 'Danger Room')
24
+ */
25
+ export declare function createDashboardWs(name: string): DashboardWs;
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Dashboard WebSocket infrastructure factory.
3
+ * Creates WebSocket server instances for dashboards (Danger Room, War Room)
4
+ * with heartbeat, connection management, origin validation, and broadcast.
5
+ */
6
+ import { WebSocketServer, WebSocket } from 'ws';
7
+ import { getServerPort, getServerHost } from './server-config.js';
8
+ import { isLanMode } from './tower-auth.js';
9
+ import { isPrivateOrigin } from './network.js';
10
+ const HEARTBEAT_INTERVAL_MS = 30000;
11
+ const MAX_CLIENTS = 50;
12
+ /**
13
+ * Create a new dashboard WebSocket instance.
14
+ * @param name — Human-readable name for logging (e.g., 'Danger Room')
15
+ */
16
+ export function createDashboardWs(name) {
17
+ const wss = new WebSocketServer({ noServer: true });
18
+ const clients = new Set();
19
+ const heartbeat = setInterval(() => {
20
+ for (const client of clients) {
21
+ const ext = client;
22
+ if (!ext.isAlive) {
23
+ clients.delete(client);
24
+ client.terminate();
25
+ continue;
26
+ }
27
+ ext.isAlive = false;
28
+ try {
29
+ client.ping();
30
+ }
31
+ catch {
32
+ clients.delete(client);
33
+ }
34
+ }
35
+ }, HEARTBEAT_INTERVAL_MS);
36
+ return {
37
+ broadcast(data) {
38
+ const message = JSON.stringify(data);
39
+ for (const client of clients) {
40
+ if (client.readyState === WebSocket.OPEN) {
41
+ try {
42
+ client.send(message);
43
+ }
44
+ catch { /* client gone */ }
45
+ }
46
+ }
47
+ },
48
+ handleUpgrade(req, socket, head) {
49
+ const origin = req.headers.origin || '';
50
+ const port = getServerPort();
51
+ const allowed = [`http://127.0.0.1:${port}`, `http://localhost:${port}`];
52
+ const remoteHost = getServerHost();
53
+ if (remoteHost)
54
+ allowed.push(`https://${remoteHost}`);
55
+ // In LAN mode, accept connections from any private IP origin
56
+ const originAllowed = allowed.includes(origin)
57
+ || (isLanMode() && isPrivateOrigin(origin));
58
+ if (!origin || !originAllowed) {
59
+ socket.write('HTTP/1.1 403 Forbidden\r\n\r\n');
60
+ socket.destroy();
61
+ return;
62
+ }
63
+ if (clients.size >= MAX_CLIENTS) {
64
+ socket.write('HTTP/1.1 503 Service Unavailable\r\n\r\n');
65
+ socket.destroy();
66
+ return;
67
+ }
68
+ wss.handleUpgrade(req, socket, head, (ws) => {
69
+ clients.add(ws);
70
+ ws.isAlive = true;
71
+ ws.on('pong', () => { ws.isAlive = true; });
72
+ ws.on('close', () => clients.delete(ws));
73
+ ws.on('error', () => clients.delete(ws));
74
+ });
75
+ },
76
+ close() {
77
+ clearInterval(heartbeat);
78
+ for (const client of clients) {
79
+ try {
80
+ client.close(1001, 'Server shutting down');
81
+ }
82
+ catch { /* ignore */ }
83
+ }
84
+ clients.clear();
85
+ wss.close();
86
+ },
87
+ clientCount() {
88
+ return clients.size;
89
+ },
90
+ };
91
+ }
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Deep Current — Situation Model + Cold Start Intake (v12.0).
3
+ *
4
+ * The Deep Current maintains a persistent situation model that represents
5
+ * the system's understanding of the project at any point in time. The
6
+ * cold start intake classifies new projects and bootstraps the model.
7
+ *
8
+ * PRD Reference: ROADMAP v12.0, docs/methods/DEEP_CURRENT.md
9
+ */
10
+ import type { SiteScanResult } from './site-scanner.js';
11
+ declare const DEEP_CURRENT_DIR: string;
12
+ declare const SITUATION_PATH: string;
13
+ declare const PROPOSALS_DIR: string;
14
+ declare const PREDICTIONS_PATH: string;
15
+ declare const CORRELATIONS_PATH: string;
16
+ type ProjectState = 'GREENFIELD' | 'IDEA_PRD' | 'PARTIAL' | 'DEPLOYED' | 'OPERATING';
17
+ interface ProjectClassification {
18
+ state: ProjectState;
19
+ hasCodebase: boolean;
20
+ hasPrd: boolean;
21
+ isDeployed: boolean;
22
+ hasAnalytics: boolean;
23
+ hasRevenue: boolean;
24
+ deployedUrl?: string;
25
+ }
26
+ /**
27
+ * Classify the current project's state by checking for key files and config.
28
+ */
29
+ export declare function classifyProject(): Promise<ProjectClassification>;
30
+ interface DimensionScore {
31
+ score: number;
32
+ gaps: string[];
33
+ lastUpdated: string;
34
+ }
35
+ interface CampaignRecord {
36
+ id: string;
37
+ name: string;
38
+ proposedDate: string;
39
+ executedDate?: string;
40
+ predictedImpact: string;
41
+ actualImpact?: string;
42
+ predictionAccuracy?: number;
43
+ }
44
+ interface SituationModel {
45
+ projectState: ProjectState;
46
+ projectName: string;
47
+ deployedUrl?: string;
48
+ lastScan: string;
49
+ dimensions: {
50
+ featureCompleteness: DimensionScore;
51
+ quality: DimensionScore;
52
+ performance: DimensionScore;
53
+ growthReadiness: DimensionScore;
54
+ revenuePotential: DimensionScore;
55
+ };
56
+ campaignHistory: CampaignRecord[];
57
+ pendingProposals: string[];
58
+ averagePredictionAccuracy: number;
59
+ autonomyTier: 1 | 2 | 3;
60
+ lastSiteScan?: SiteScanResult;
61
+ }
62
+ export declare function loadSituation(): Promise<SituationModel | null>;
63
+ export declare function saveSituation(model: SituationModel): Promise<void>;
64
+ export declare function sense(model: SituationModel): Promise<SituationModel>;
65
+ interface IntakeResult {
66
+ classification: ProjectClassification;
67
+ situation: SituationModel;
68
+ siteScan?: SiteScanResult;
69
+ recommendedFirstAction: string;
70
+ }
71
+ /**
72
+ * Cold start intake: classify the project, scan if deployed, create situation model.
73
+ * Returns the initial situation and a recommended first action.
74
+ */
75
+ export declare function intake(projectName: string): Promise<IntakeResult>;
76
+ export type { ProjectState, ProjectClassification, SituationModel, DimensionScore, CampaignRecord, IntakeResult };
77
+ export { DEEP_CURRENT_DIR, SITUATION_PATH, PROPOSALS_DIR, PREDICTIONS_PATH, CORRELATIONS_PATH };