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.
- package/dist/scripts/vault-read.d.ts +11 -0
- package/dist/scripts/vault-read.js +89 -0
- package/dist/scripts/voidforge.d.ts +20 -0
- package/dist/scripts/voidforge.js +404 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/wizard/api/auth.d.ts +5 -0
- package/dist/wizard/api/auth.js +133 -0
- package/dist/wizard/api/blueprint.d.ts +45 -0
- package/dist/wizard/api/blueprint.js +184 -0
- package/dist/wizard/api/cloud-providers.d.ts +16 -0
- package/dist/wizard/api/cloud-providers.js +363 -0
- package/dist/wizard/api/credentials.d.ts +1 -0
- package/dist/wizard/api/credentials.js +258 -0
- package/dist/wizard/api/danger-room.d.ts +18 -0
- package/dist/wizard/api/danger-room.js +401 -0
- package/dist/wizard/api/deploy.d.ts +4 -0
- package/dist/wizard/api/deploy.js +164 -0
- package/dist/wizard/api/prd.d.ts +1 -0
- package/dist/wizard/api/prd.js +363 -0
- package/dist/wizard/api/project.d.ts +1 -0
- package/dist/wizard/api/project.js +239 -0
- package/dist/wizard/api/projects.d.ts +6 -0
- package/dist/wizard/api/projects.js +648 -0
- package/dist/wizard/api/provision.d.ts +4 -0
- package/dist/wizard/api/provision.js +535 -0
- package/dist/wizard/api/terminal.d.ts +25 -0
- package/dist/wizard/api/terminal.js +241 -0
- package/dist/wizard/api/users.d.ts +6 -0
- package/dist/wizard/api/users.js +244 -0
- package/dist/wizard/api/war-room.d.ts +14 -0
- package/dist/wizard/api/war-room.js +45 -0
- package/dist/wizard/lib/ad-platform-core.d.ts +6 -0
- package/dist/wizard/lib/ad-platform-core.js +1 -0
- package/dist/wizard/lib/adapters/index.d.ts +52 -0
- package/dist/wizard/lib/adapters/index.js +38 -0
- package/dist/wizard/lib/adapters/sandbox-bank.d.ts +17 -0
- package/dist/wizard/lib/adapters/sandbox-bank.js +77 -0
- package/dist/wizard/lib/adapters/sandbox.d.ts +39 -0
- package/dist/wizard/lib/adapters/sandbox.js +174 -0
- package/dist/wizard/lib/adapters/stripe.d.ts +19 -0
- package/dist/wizard/lib/adapters/stripe.js +143 -0
- package/dist/wizard/lib/adapters/types.d.ts +9 -0
- package/dist/wizard/lib/adapters/types.js +10 -0
- package/dist/wizard/lib/agent-memory.d.ts +36 -0
- package/dist/wizard/lib/agent-memory.js +114 -0
- package/dist/wizard/lib/anomaly-detection.d.ts +59 -0
- package/dist/wizard/lib/anomaly-detection.js +122 -0
- package/dist/wizard/lib/anthropic.d.ts +21 -0
- package/dist/wizard/lib/anthropic.js +105 -0
- package/dist/wizard/lib/asset-scanner.d.ts +23 -0
- package/dist/wizard/lib/asset-scanner.js +107 -0
- package/dist/wizard/lib/audit-log.d.ts +23 -0
- package/dist/wizard/lib/audit-log.js +70 -0
- package/dist/wizard/lib/autonomy-controller.d.ts +76 -0
- package/dist/wizard/lib/autonomy-controller.js +183 -0
- package/dist/wizard/lib/body-parser.d.ts +2 -0
- package/dist/wizard/lib/body-parser.js +36 -0
- package/dist/wizard/lib/build-analytics.d.ts +39 -0
- package/dist/wizard/lib/build-analytics.js +91 -0
- package/dist/wizard/lib/build-step.d.ts +21 -0
- package/dist/wizard/lib/build-step.js +104 -0
- package/dist/wizard/lib/campaign-proposer.d.ts +39 -0
- package/dist/wizard/lib/campaign-proposer.js +180 -0
- package/dist/wizard/lib/campaign-state-machine.d.ts +63 -0
- package/dist/wizard/lib/campaign-state-machine.js +114 -0
- package/dist/wizard/lib/ci-generator.d.ts +14 -0
- package/dist/wizard/lib/ci-generator.js +187 -0
- package/dist/wizard/lib/claude-merge.d.ts +38 -0
- package/dist/wizard/lib/claude-merge.js +115 -0
- package/dist/wizard/lib/codegen/erd-gen.d.ts +16 -0
- package/dist/wizard/lib/codegen/erd-gen.js +98 -0
- package/dist/wizard/lib/codegen/integrations.d.ts +18 -0
- package/dist/wizard/lib/codegen/integrations.js +189 -0
- package/dist/wizard/lib/codegen/openapi-gen.d.ts +15 -0
- package/dist/wizard/lib/codegen/openapi-gen.js +79 -0
- package/dist/wizard/lib/codegen/prisma-types.d.ts +15 -0
- package/dist/wizard/lib/codegen/prisma-types.js +44 -0
- package/dist/wizard/lib/codegen/seed-gen.d.ts +16 -0
- package/dist/wizard/lib/codegen/seed-gen.js +128 -0
- package/dist/wizard/lib/compliance.d.ts +51 -0
- package/dist/wizard/lib/compliance.js +112 -0
- package/dist/wizard/lib/correlation-engine.d.ts +59 -0
- package/dist/wizard/lib/correlation-engine.js +151 -0
- package/dist/wizard/lib/cost-estimator.d.ts +22 -0
- package/dist/wizard/lib/cost-estimator.js +72 -0
- package/dist/wizard/lib/cost-tracker.d.ts +27 -0
- package/dist/wizard/lib/cost-tracker.js +37 -0
- package/dist/wizard/lib/daemon-aggregator.d.ts +71 -0
- package/dist/wizard/lib/daemon-aggregator.js +204 -0
- package/dist/wizard/lib/daemon-core.d.ts +6 -0
- package/dist/wizard/lib/daemon-core.js +5 -0
- package/dist/wizard/lib/dashboard-data.d.ts +132 -0
- package/dist/wizard/lib/dashboard-data.js +336 -0
- package/dist/wizard/lib/dashboard-ws.d.ts +25 -0
- package/dist/wizard/lib/dashboard-ws.js +91 -0
- package/dist/wizard/lib/deep-current.d.ts +77 -0
- package/dist/wizard/lib/deep-current.js +234 -0
- package/dist/wizard/lib/deploy-coordinator.d.ts +40 -0
- package/dist/wizard/lib/deploy-coordinator.js +86 -0
- package/dist/wizard/lib/deploy-log.d.ts +28 -0
- package/dist/wizard/lib/deploy-log.js +52 -0
- package/dist/wizard/lib/desktop-notify.d.ts +27 -0
- package/dist/wizard/lib/desktop-notify.js +98 -0
- package/dist/wizard/lib/dns/cloudflare-dns.d.ts +35 -0
- package/dist/wizard/lib/dns/cloudflare-dns.js +216 -0
- package/dist/wizard/lib/dns/cloudflare-registrar.d.ts +31 -0
- package/dist/wizard/lib/dns/cloudflare-registrar.js +148 -0
- package/dist/wizard/lib/dns/types.d.ts +22 -0
- package/dist/wizard/lib/dns/types.js +4 -0
- package/dist/wizard/lib/document-discovery.d.ts +33 -0
- package/dist/wizard/lib/document-discovery.js +145 -0
- package/dist/wizard/lib/env-validator.d.ts +14 -0
- package/dist/wizard/lib/env-validator.js +205 -0
- package/dist/wizard/lib/env-writer.d.ts +13 -0
- package/dist/wizard/lib/env-writer.js +26 -0
- package/dist/wizard/lib/exec.d.ts +30 -0
- package/dist/wizard/lib/exec.js +52 -0
- package/dist/wizard/lib/experiment.d.ts +70 -0
- package/dist/wizard/lib/experiment.js +169 -0
- package/dist/wizard/lib/extensions.d.ts +20 -0
- package/dist/wizard/lib/extensions.js +183 -0
- package/dist/wizard/lib/financial/adapter-factory.d.ts +47 -0
- package/dist/wizard/lib/financial/adapter-factory.js +225 -0
- package/dist/wizard/lib/financial/billing/base.d.ts +6 -0
- package/dist/wizard/lib/financial/billing/base.js +1 -0
- package/dist/wizard/lib/financial/billing/google-billing.d.ts +56 -0
- package/dist/wizard/lib/financial/billing/google-billing.js +298 -0
- package/dist/wizard/lib/financial/billing/meta-billing.d.ts +54 -0
- package/dist/wizard/lib/financial/billing/meta-billing.js +243 -0
- package/dist/wizard/lib/financial/billing/tiktok-billing.d.ts +54 -0
- package/dist/wizard/lib/financial/billing/tiktok-billing.js +260 -0
- package/dist/wizard/lib/financial/campaign/base.d.ts +13 -0
- package/dist/wizard/lib/financial/campaign/base.js +1 -0
- package/dist/wizard/lib/financial/campaign/google-campaign.d.ts +42 -0
- package/dist/wizard/lib/financial/campaign/google-campaign.js +388 -0
- package/dist/wizard/lib/financial/campaign/meta-campaign.d.ts +41 -0
- package/dist/wizard/lib/financial/campaign/meta-campaign.js +311 -0
- package/dist/wizard/lib/financial/campaign/sandbox-campaign.d.ts +45 -0
- package/dist/wizard/lib/financial/campaign/sandbox-campaign.js +261 -0
- package/dist/wizard/lib/financial/campaign/tiktok-campaign.d.ts +40 -0
- package/dist/wizard/lib/financial/campaign/tiktok-campaign.js +350 -0
- package/dist/wizard/lib/financial/funding-auto.d.ts +44 -0
- package/dist/wizard/lib/financial/funding-auto.js +52 -0
- package/dist/wizard/lib/financial/funding-policy.d.ts +60 -0
- package/dist/wizard/lib/financial/funding-policy.js +179 -0
- package/dist/wizard/lib/financial/platform-planner.d.ts +47 -0
- package/dist/wizard/lib/financial/platform-planner.js +134 -0
- package/dist/wizard/lib/financial/reconciliation-engine.d.ts +78 -0
- package/dist/wizard/lib/financial/reconciliation-engine.js +193 -0
- package/dist/wizard/lib/financial/registry.d.ts +22 -0
- package/dist/wizard/lib/financial/registry.js +26 -0
- package/dist/wizard/lib/financial/reporting.d.ts +96 -0
- package/dist/wizard/lib/financial/reporting.js +198 -0
- package/dist/wizard/lib/financial/stablecoin/base.d.ts +6 -0
- package/dist/wizard/lib/financial/stablecoin/base.js +1 -0
- package/dist/wizard/lib/financial/stablecoin/circle.d.ts +54 -0
- package/dist/wizard/lib/financial/stablecoin/circle.js +367 -0
- package/dist/wizard/lib/financial/stablecoin/mercury.d.ts +24 -0
- package/dist/wizard/lib/financial/stablecoin/mercury.js +171 -0
- package/dist/wizard/lib/financial/stablecoin/sandbox-stablecoin.d.ts +47 -0
- package/dist/wizard/lib/financial/stablecoin/sandbox-stablecoin.js +202 -0
- package/dist/wizard/lib/financial/treasury-planner.d.ts +52 -0
- package/dist/wizard/lib/financial/treasury-planner.js +128 -0
- package/dist/wizard/lib/financial-core.d.ts +6 -0
- package/dist/wizard/lib/financial-core.js +5 -0
- package/dist/wizard/lib/financial-vault.d.ts +34 -0
- package/dist/wizard/lib/financial-vault.js +199 -0
- package/dist/wizard/lib/frontmatter.d.ts +30 -0
- package/dist/wizard/lib/frontmatter.js +96 -0
- package/dist/wizard/lib/gap-analysis.d.ts +37 -0
- package/dist/wizard/lib/gap-analysis.js +218 -0
- package/dist/wizard/lib/github.d.ts +22 -0
- package/dist/wizard/lib/github.js +261 -0
- package/dist/wizard/lib/headless-deploy.d.ts +14 -0
- package/dist/wizard/lib/headless-deploy.js +452 -0
- package/dist/wizard/lib/health-monitor.d.ts +15 -0
- package/dist/wizard/lib/health-monitor.js +91 -0
- package/dist/wizard/lib/health-poller.d.ts +9 -0
- package/dist/wizard/lib/health-poller.js +123 -0
- package/dist/wizard/lib/heartbeat.d.ts +15 -0
- package/dist/wizard/lib/heartbeat.js +827 -0
- package/dist/wizard/lib/http-helpers.d.ts +9 -0
- package/dist/wizard/lib/http-helpers.js +24 -0
- package/dist/wizard/lib/image-gen.d.ts +56 -0
- package/dist/wizard/lib/image-gen.js +159 -0
- package/dist/wizard/lib/instance-sizing.d.ts +26 -0
- package/dist/wizard/lib/instance-sizing.js +51 -0
- package/dist/wizard/lib/kongo/analytics.d.ts +29 -0
- package/dist/wizard/lib/kongo/analytics.js +179 -0
- package/dist/wizard/lib/kongo/campaigns.d.ts +52 -0
- package/dist/wizard/lib/kongo/campaigns.js +91 -0
- package/dist/wizard/lib/kongo/client.d.ts +58 -0
- package/dist/wizard/lib/kongo/client.js +221 -0
- package/dist/wizard/lib/kongo/jobs.d.ts +57 -0
- package/dist/wizard/lib/kongo/jobs.js +122 -0
- package/dist/wizard/lib/kongo/pages.d.ts +60 -0
- package/dist/wizard/lib/kongo/pages.js +150 -0
- package/dist/wizard/lib/kongo/provisioner.d.ts +64 -0
- package/dist/wizard/lib/kongo/provisioner.js +116 -0
- package/dist/wizard/lib/kongo/seed.d.ts +49 -0
- package/dist/wizard/lib/kongo/seed.js +237 -0
- package/dist/wizard/lib/kongo/types.d.ts +323 -0
- package/dist/wizard/lib/kongo/types.js +11 -0
- package/dist/wizard/lib/kongo/variants.d.ts +57 -0
- package/dist/wizard/lib/kongo/variants.js +88 -0
- package/dist/wizard/lib/kongo/webhooks.d.ts +41 -0
- package/dist/wizard/lib/kongo/webhooks.js +112 -0
- package/dist/wizard/lib/marker.d.ts +28 -0
- package/dist/wizard/lib/marker.js +79 -0
- package/dist/wizard/lib/migrator.d.ts +35 -0
- package/dist/wizard/lib/migrator.js +190 -0
- package/dist/wizard/lib/natural-language-deploy.d.ts +30 -0
- package/dist/wizard/lib/natural-language-deploy.js +186 -0
- package/dist/wizard/lib/network.d.ts +22 -0
- package/dist/wizard/lib/network.js +72 -0
- package/dist/wizard/lib/oauth-core.d.ts +6 -0
- package/dist/wizard/lib/oauth-core.js +5 -0
- package/dist/wizard/lib/open-browser.d.ts +1 -0
- package/dist/wizard/lib/open-browser.js +26 -0
- package/dist/wizard/lib/patterns/ad-billing-adapter.d.ts +209 -0
- package/dist/wizard/lib/patterns/ad-billing-adapter.js +269 -0
- package/dist/wizard/lib/patterns/ad-platform-adapter.d.ts +200 -0
- package/dist/wizard/lib/patterns/ad-platform-adapter.js +212 -0
- package/dist/wizard/lib/patterns/daemon-process.d.ts +88 -0
- package/dist/wizard/lib/patterns/daemon-process.js +271 -0
- package/dist/wizard/lib/patterns/financial-transaction.d.ts +161 -0
- package/dist/wizard/lib/patterns/financial-transaction.js +132 -0
- package/dist/wizard/lib/patterns/funding-plan.d.ts +136 -0
- package/dist/wizard/lib/patterns/funding-plan.js +200 -0
- package/dist/wizard/lib/patterns/oauth-token-lifecycle.d.ts +94 -0
- package/dist/wizard/lib/patterns/oauth-token-lifecycle.js +139 -0
- package/dist/wizard/lib/patterns/outbound-rate-limiter.d.ts +67 -0
- package/dist/wizard/lib/patterns/outbound-rate-limiter.js +216 -0
- package/dist/wizard/lib/patterns/revenue-source-adapter.d.ts +96 -0
- package/dist/wizard/lib/patterns/revenue-source-adapter.js +182 -0
- package/dist/wizard/lib/patterns/stablecoin-adapter.d.ts +218 -0
- package/dist/wizard/lib/patterns/stablecoin-adapter.js +264 -0
- package/dist/wizard/lib/prd-validator.d.ts +39 -0
- package/dist/wizard/lib/prd-validator.js +137 -0
- package/dist/wizard/lib/project-init.d.ts +24 -0
- package/dist/wizard/lib/project-init.js +193 -0
- package/dist/wizard/lib/project-registry.d.ts +86 -0
- package/dist/wizard/lib/project-registry.js +359 -0
- package/dist/wizard/lib/provision-manifest.d.ts +44 -0
- package/dist/wizard/lib/provision-manifest.js +164 -0
- package/dist/wizard/lib/provisioner-registry.d.ts +15 -0
- package/dist/wizard/lib/provisioner-registry.js +34 -0
- package/dist/wizard/lib/provisioners/aws-vps.d.ts +6 -0
- package/dist/wizard/lib/provisioners/aws-vps.js +643 -0
- package/dist/wizard/lib/provisioners/cloudflare.d.ts +6 -0
- package/dist/wizard/lib/provisioners/cloudflare.js +300 -0
- package/dist/wizard/lib/provisioners/docker.d.ts +6 -0
- package/dist/wizard/lib/provisioners/docker.js +75 -0
- package/dist/wizard/lib/provisioners/http-client.d.ts +20 -0
- package/dist/wizard/lib/provisioners/http-client.js +79 -0
- package/dist/wizard/lib/provisioners/railway.d.ts +6 -0
- package/dist/wizard/lib/provisioners/railway.js +413 -0
- package/dist/wizard/lib/provisioners/scripts/caddyfile.d.ts +10 -0
- package/dist/wizard/lib/provisioners/scripts/caddyfile.js +54 -0
- package/dist/wizard/lib/provisioners/scripts/deploy-vps.d.ts +10 -0
- package/dist/wizard/lib/provisioners/scripts/deploy-vps.js +112 -0
- package/dist/wizard/lib/provisioners/scripts/docker-compose.d.ts +11 -0
- package/dist/wizard/lib/provisioners/scripts/docker-compose.js +91 -0
- package/dist/wizard/lib/provisioners/scripts/dockerfile.d.ts +5 -0
- package/dist/wizard/lib/provisioners/scripts/dockerfile.js +185 -0
- package/dist/wizard/lib/provisioners/scripts/ecosystem-config.d.ts +10 -0
- package/dist/wizard/lib/provisioners/scripts/ecosystem-config.js +36 -0
- package/dist/wizard/lib/provisioners/scripts/provision-vps.d.ts +14 -0
- package/dist/wizard/lib/provisioners/scripts/provision-vps.js +202 -0
- package/dist/wizard/lib/provisioners/scripts/rollback-vps.d.ts +10 -0
- package/dist/wizard/lib/provisioners/scripts/rollback-vps.js +67 -0
- package/dist/wizard/lib/provisioners/self-deploy.d.ts +41 -0
- package/dist/wizard/lib/provisioners/self-deploy.js +185 -0
- package/dist/wizard/lib/provisioners/static-s3.d.ts +6 -0
- package/dist/wizard/lib/provisioners/static-s3.js +235 -0
- package/dist/wizard/lib/provisioners/types.d.ts +40 -0
- package/dist/wizard/lib/provisioners/types.js +4 -0
- package/dist/wizard/lib/provisioners/vercel.d.ts +6 -0
- package/dist/wizard/lib/provisioners/vercel.js +287 -0
- package/dist/wizard/lib/pty-manager.d.ts +42 -0
- package/dist/wizard/lib/pty-manager.js +231 -0
- package/dist/wizard/lib/rate-limiter-core.d.ts +5 -0
- package/dist/wizard/lib/rate-limiter-core.js +5 -0
- package/dist/wizard/lib/reconciliation.d.ts +43 -0
- package/dist/wizard/lib/reconciliation.js +173 -0
- package/dist/wizard/lib/revenue-types.d.ts +5 -0
- package/dist/wizard/lib/revenue-types.js +1 -0
- package/dist/wizard/lib/route-optimizer.d.ts +28 -0
- package/dist/wizard/lib/route-optimizer.js +93 -0
- package/dist/wizard/lib/s3-deploy.d.ts +19 -0
- package/dist/wizard/lib/s3-deploy.js +156 -0
- package/dist/wizard/lib/safety-tiers.d.ts +76 -0
- package/dist/wizard/lib/safety-tiers.js +134 -0
- package/dist/wizard/lib/sentry-generator.d.ts +15 -0
- package/dist/wizard/lib/sentry-generator.js +116 -0
- package/dist/wizard/lib/server-config.d.ts +13 -0
- package/dist/wizard/lib/server-config.js +23 -0
- package/dist/wizard/lib/service-install.d.ts +18 -0
- package/dist/wizard/lib/service-install.js +182 -0
- package/dist/wizard/lib/site-scanner.d.ts +80 -0
- package/dist/wizard/lib/site-scanner.js +262 -0
- package/dist/wizard/lib/ssh-deploy.d.ts +25 -0
- package/dist/wizard/lib/ssh-deploy.js +225 -0
- package/dist/wizard/lib/templates.d.ts +24 -0
- package/dist/wizard/lib/templates.js +219 -0
- package/dist/wizard/lib/totp.d.ts +35 -0
- package/dist/wizard/lib/totp.js +276 -0
- package/dist/wizard/lib/tower-auth.d.ts +43 -0
- package/dist/wizard/lib/tower-auth.js +352 -0
- package/dist/wizard/lib/tower-rate-limit.d.ts +14 -0
- package/dist/wizard/lib/tower-rate-limit.js +61 -0
- package/dist/wizard/lib/tower-session.d.ts +28 -0
- package/dist/wizard/lib/tower-session.js +119 -0
- package/dist/wizard/lib/treasury-backup.d.ts +23 -0
- package/dist/wizard/lib/treasury-backup.js +126 -0
- package/dist/wizard/lib/treasury-heartbeat.d.ts +82 -0
- package/dist/wizard/lib/treasury-heartbeat.js +1104 -0
- package/dist/wizard/lib/updater.d.ts +29 -0
- package/dist/wizard/lib/updater.js +190 -0
- package/dist/wizard/lib/user-manager.d.ts +39 -0
- package/dist/wizard/lib/user-manager.js +182 -0
- package/dist/wizard/lib/vault.d.ts +26 -0
- package/dist/wizard/lib/vault.js +161 -0
- package/dist/wizard/router.d.ts +5 -0
- package/dist/wizard/router.js +15 -0
- package/dist/wizard/server.d.ts +18 -0
- package/dist/wizard/server.js +436 -0
- package/package.json +59 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daemon Aggregator — connects to per-project heartbeat daemons.
|
|
3
|
+
*
|
|
4
|
+
* The wizard server reads projects.json, connects to each project's
|
|
5
|
+
* heartbeat socket, polls /status, and serves aggregated data to
|
|
6
|
+
* the Danger Room dashboard.
|
|
7
|
+
*/
|
|
8
|
+
export interface DaemonStatus {
|
|
9
|
+
projectId: string;
|
|
10
|
+
projectName: string;
|
|
11
|
+
projectPath: string;
|
|
12
|
+
online: boolean;
|
|
13
|
+
lastBeat: string | null;
|
|
14
|
+
uptime: number;
|
|
15
|
+
jobs: JobStatus[];
|
|
16
|
+
platforms: PlatformStatus[];
|
|
17
|
+
spend: SpendSummary;
|
|
18
|
+
}
|
|
19
|
+
export interface JobStatus {
|
|
20
|
+
name: string;
|
|
21
|
+
lastRun: string | null;
|
|
22
|
+
nextRun: string | null;
|
|
23
|
+
status: 'idle' | 'running' | 'failed' | 'disabled';
|
|
24
|
+
failureCount: number;
|
|
25
|
+
}
|
|
26
|
+
export interface PlatformStatus {
|
|
27
|
+
name: string;
|
|
28
|
+
tokenStatus: 'valid' | 'expiring' | 'expired' | 'missing';
|
|
29
|
+
tokenExpiresAt: string | null;
|
|
30
|
+
}
|
|
31
|
+
export interface SpendSummary {
|
|
32
|
+
todayCents: number;
|
|
33
|
+
weekCents: number;
|
|
34
|
+
monthCents: number;
|
|
35
|
+
budgetCents: number;
|
|
36
|
+
revenueCents: number;
|
|
37
|
+
}
|
|
38
|
+
export interface AggregatedStatus {
|
|
39
|
+
projects: DaemonStatus[];
|
|
40
|
+
totals: {
|
|
41
|
+
totalSpendCents: number;
|
|
42
|
+
totalRevenueCents: number;
|
|
43
|
+
combinedRoas: number;
|
|
44
|
+
onlineCount: number;
|
|
45
|
+
offlineCount: number;
|
|
46
|
+
};
|
|
47
|
+
lastPoll: string;
|
|
48
|
+
}
|
|
49
|
+
export declare class DaemonAggregator {
|
|
50
|
+
private projects;
|
|
51
|
+
private statuses;
|
|
52
|
+
private pollInterval;
|
|
53
|
+
private pollIntervalMs;
|
|
54
|
+
constructor(pollIntervalMs?: number);
|
|
55
|
+
start(): Promise<void>;
|
|
56
|
+
stop(): void;
|
|
57
|
+
refresh(): Promise<void>;
|
|
58
|
+
private pollAll;
|
|
59
|
+
getStatus(): AggregatedStatus;
|
|
60
|
+
getProjectStatus(projectId: string): DaemonStatus | undefined;
|
|
61
|
+
/** Freeze all daemons or a specific project's daemon. */
|
|
62
|
+
freeze(projectId?: string): Promise<{
|
|
63
|
+
frozen: string[];
|
|
64
|
+
failed: string[];
|
|
65
|
+
}>;
|
|
66
|
+
/** Unfreeze all daemons or a specific project's daemon. */
|
|
67
|
+
unfreeze(projectId?: string): Promise<{
|
|
68
|
+
unfrozen: string[];
|
|
69
|
+
failed: string[];
|
|
70
|
+
}>;
|
|
71
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daemon Aggregator — connects to per-project heartbeat daemons.
|
|
3
|
+
*
|
|
4
|
+
* The wizard server reads projects.json, connects to each project's
|
|
5
|
+
* heartbeat socket, polls /status, and serves aggregated data to
|
|
6
|
+
* the Danger Room dashboard.
|
|
7
|
+
*/
|
|
8
|
+
import { existsSync } from 'node:fs';
|
|
9
|
+
import { readFile } from 'node:fs/promises';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { readMarker } from './marker.js';
|
|
12
|
+
async function discoverCultivationProjects() {
|
|
13
|
+
const { homedir } = await import('node:os');
|
|
14
|
+
const registryPath = join(homedir(), '.voidforge', 'projects.json');
|
|
15
|
+
if (!existsSync(registryPath))
|
|
16
|
+
return [];
|
|
17
|
+
try {
|
|
18
|
+
const raw = await readFile(registryPath, 'utf-8');
|
|
19
|
+
const projects = JSON.parse(raw);
|
|
20
|
+
const cultivationProjects = [];
|
|
21
|
+
for (const project of projects) {
|
|
22
|
+
if (!project.directory || !existsSync(project.directory))
|
|
23
|
+
continue;
|
|
24
|
+
const marker = await readMarker(project.directory);
|
|
25
|
+
if (marker && marker.extensions.includes('cultivation')) {
|
|
26
|
+
cultivationProjects.push(project);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return cultivationProjects;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// ── Socket Connection ────────────────────────────────────
|
|
36
|
+
async function pollDaemon(project) {
|
|
37
|
+
const socketPath = join(project.directory, 'cultivation', 'heartbeat.sock');
|
|
38
|
+
const pidPath = join(project.directory, 'cultivation', 'heartbeat.pid');
|
|
39
|
+
const offline = {
|
|
40
|
+
projectId: project.id,
|
|
41
|
+
projectName: project.name,
|
|
42
|
+
projectPath: project.directory,
|
|
43
|
+
online: false,
|
|
44
|
+
lastBeat: null,
|
|
45
|
+
uptime: 0,
|
|
46
|
+
jobs: [],
|
|
47
|
+
platforms: [],
|
|
48
|
+
spend: { todayCents: 0, weekCents: 0, monthCents: 0, budgetCents: 0, revenueCents: 0 },
|
|
49
|
+
};
|
|
50
|
+
// Check if daemon is running
|
|
51
|
+
if (!existsSync(pidPath))
|
|
52
|
+
return offline;
|
|
53
|
+
try {
|
|
54
|
+
const pid = parseInt(await readFile(pidPath, 'utf-8'), 10);
|
|
55
|
+
// Check if process is alive
|
|
56
|
+
process.kill(pid, 0);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return offline; // Process not running
|
|
60
|
+
}
|
|
61
|
+
// Connect to Unix socket and poll /status
|
|
62
|
+
if (!existsSync(socketPath))
|
|
63
|
+
return offline;
|
|
64
|
+
try {
|
|
65
|
+
const { default: net } = await import('node:net');
|
|
66
|
+
const response = await new Promise((resolve, reject) => {
|
|
67
|
+
const socket = net.createConnection(socketPath, () => {
|
|
68
|
+
socket.write('GET /status HTTP/1.0\r\n\r\n');
|
|
69
|
+
});
|
|
70
|
+
let data = '';
|
|
71
|
+
socket.on('data', (chunk) => { data += chunk.toString(); });
|
|
72
|
+
socket.on('end', () => resolve(data));
|
|
73
|
+
socket.on('error', reject);
|
|
74
|
+
socket.setTimeout(5000, () => {
|
|
75
|
+
socket.destroy();
|
|
76
|
+
reject(new Error('Socket timeout'));
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
// Parse HTTP response body
|
|
80
|
+
const bodyStart = response.indexOf('\r\n\r\n');
|
|
81
|
+
if (bodyStart === -1)
|
|
82
|
+
return offline;
|
|
83
|
+
const body = response.slice(bodyStart + 4);
|
|
84
|
+
const status = JSON.parse(body);
|
|
85
|
+
return {
|
|
86
|
+
...status,
|
|
87
|
+
projectId: project.id,
|
|
88
|
+
projectName: project.name,
|
|
89
|
+
projectPath: project.directory,
|
|
90
|
+
online: true,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return offline;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// ── Aggregator ───────────────────────────────────────────
|
|
98
|
+
export class DaemonAggregator {
|
|
99
|
+
projects = [];
|
|
100
|
+
statuses = new Map();
|
|
101
|
+
pollInterval = null;
|
|
102
|
+
pollIntervalMs;
|
|
103
|
+
constructor(pollIntervalMs = 30000) {
|
|
104
|
+
this.pollIntervalMs = pollIntervalMs;
|
|
105
|
+
}
|
|
106
|
+
async start() {
|
|
107
|
+
await this.refresh();
|
|
108
|
+
this.pollInterval = setInterval(() => this.pollAll(), this.pollIntervalMs);
|
|
109
|
+
}
|
|
110
|
+
stop() {
|
|
111
|
+
if (this.pollInterval) {
|
|
112
|
+
clearInterval(this.pollInterval);
|
|
113
|
+
this.pollInterval = null;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
async refresh() {
|
|
117
|
+
this.projects = await discoverCultivationProjects();
|
|
118
|
+
await this.pollAll();
|
|
119
|
+
}
|
|
120
|
+
async pollAll() {
|
|
121
|
+
const results = await Promise.allSettled(this.projects.map(p => pollDaemon(p)));
|
|
122
|
+
for (const result of results) {
|
|
123
|
+
if (result.status === 'fulfilled') {
|
|
124
|
+
this.statuses.set(result.value.projectId, result.value);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
getStatus() {
|
|
129
|
+
const projects = Array.from(this.statuses.values());
|
|
130
|
+
let totalSpendCents = 0;
|
|
131
|
+
let totalRevenueCents = 0;
|
|
132
|
+
let onlineCount = 0;
|
|
133
|
+
let offlineCount = 0;
|
|
134
|
+
for (const p of projects) {
|
|
135
|
+
totalSpendCents += p.spend.monthCents;
|
|
136
|
+
totalRevenueCents += p.spend.revenueCents;
|
|
137
|
+
if (p.online)
|
|
138
|
+
onlineCount++;
|
|
139
|
+
else
|
|
140
|
+
offlineCount++;
|
|
141
|
+
}
|
|
142
|
+
const combinedRoas = totalSpendCents > 0
|
|
143
|
+
? totalRevenueCents / totalSpendCents
|
|
144
|
+
: 0;
|
|
145
|
+
return {
|
|
146
|
+
projects,
|
|
147
|
+
totals: {
|
|
148
|
+
totalSpendCents,
|
|
149
|
+
totalRevenueCents,
|
|
150
|
+
combinedRoas,
|
|
151
|
+
onlineCount,
|
|
152
|
+
offlineCount,
|
|
153
|
+
},
|
|
154
|
+
lastPoll: new Date().toISOString(),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
getProjectStatus(projectId) {
|
|
158
|
+
return this.statuses.get(projectId);
|
|
159
|
+
}
|
|
160
|
+
/** Freeze all daemons or a specific project's daemon. */
|
|
161
|
+
async freeze(projectId) {
|
|
162
|
+
const targets = projectId
|
|
163
|
+
? this.projects.filter(p => p.id === projectId)
|
|
164
|
+
: this.projects;
|
|
165
|
+
const frozen = [];
|
|
166
|
+
const failed = [];
|
|
167
|
+
for (const project of targets) {
|
|
168
|
+
const pidPath = join(project.directory, 'cultivation', 'heartbeat.pid');
|
|
169
|
+
try {
|
|
170
|
+
if (existsSync(pidPath)) {
|
|
171
|
+
const pid = parseInt(await readFile(pidPath, 'utf-8'), 10);
|
|
172
|
+
process.kill(pid, 'SIGSTOP');
|
|
173
|
+
frozen.push(project.name);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
failed.push(project.name);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return { frozen, failed };
|
|
181
|
+
}
|
|
182
|
+
/** Unfreeze all daemons or a specific project's daemon. */
|
|
183
|
+
async unfreeze(projectId) {
|
|
184
|
+
const targets = projectId
|
|
185
|
+
? this.projects.filter(p => p.id === projectId)
|
|
186
|
+
: this.projects;
|
|
187
|
+
const unfrozen = [];
|
|
188
|
+
const failed = [];
|
|
189
|
+
for (const project of targets) {
|
|
190
|
+
const pidPath = join(project.directory, 'cultivation', 'heartbeat.pid');
|
|
191
|
+
try {
|
|
192
|
+
if (existsSync(pidPath)) {
|
|
193
|
+
const pid = parseInt(await readFile(pidPath, 'utf-8'), 10);
|
|
194
|
+
process.kill(pid, 'SIGCONT');
|
|
195
|
+
unfrozen.push(project.name);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
failed.push(project.name);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return { unfrozen, failed };
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daemon core — re-exports from the daemon-process pattern for wizard runtime use.
|
|
3
|
+
* ARCH-R2-012: Production code should not import from docs/patterns/ directly.
|
|
4
|
+
*/
|
|
5
|
+
export { writePidFile, checkStalePid, removePidFile, generateSessionToken, validateToken, createSocketServer, startSocketServer, writeState, setupSignalHandlers, JobScheduler, createLogger, STATE_FILE, SOCKET_PATH, TOKEN_FILE, } from './patterns/daemon-process.js';
|
|
6
|
+
export type { HeartbeatState, DaemonState } from './patterns/daemon-process.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daemon core — re-exports from the daemon-process pattern for wizard runtime use.
|
|
3
|
+
* ARCH-R2-012: Production code should not import from docs/patterns/ directly.
|
|
4
|
+
*/
|
|
5
|
+
export { writePidFile, checkStalePid, removePidFile, generateSessionToken, validateToken, createSocketServer, startSocketServer, writeState, setupSignalHandlers, JobScheduler, createLogger, STATE_FILE, SOCKET_PATH, TOKEN_FILE, } from './patterns/daemon-process.js';
|
|
@@ -0,0 +1,132 @@
|
|
|
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
|
+
declare const PROJECT_ROOT: string;
|
|
11
|
+
declare const LOGS_DIR: string;
|
|
12
|
+
declare const VOIDFORGE_DIR: string;
|
|
13
|
+
export interface Mission {
|
|
14
|
+
name: string;
|
|
15
|
+
status: string;
|
|
16
|
+
number: number;
|
|
17
|
+
blockedBy?: string;
|
|
18
|
+
debrief?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface CampaignData {
|
|
21
|
+
missions: Mission[];
|
|
22
|
+
status: string;
|
|
23
|
+
sections: Array<{
|
|
24
|
+
name: string;
|
|
25
|
+
status: string;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
export interface PhaseData {
|
|
29
|
+
phases: Array<{
|
|
30
|
+
name: string;
|
|
31
|
+
status: string;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
export interface FindingCounts {
|
|
35
|
+
critical: number;
|
|
36
|
+
high: number;
|
|
37
|
+
medium: number;
|
|
38
|
+
low: number;
|
|
39
|
+
}
|
|
40
|
+
export interface DeployData {
|
|
41
|
+
url: string;
|
|
42
|
+
commit?: string;
|
|
43
|
+
healthy: boolean;
|
|
44
|
+
target: string;
|
|
45
|
+
timestamp: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Parse campaign-state.md into structured campaign data.
|
|
49
|
+
*
|
|
50
|
+
* Handles the actual format written by /campaign:
|
|
51
|
+
* | # | Mission | Scope | Status | Debrief |
|
|
52
|
+
* | 1 | Name | ... | NOT STARTED | — |
|
|
53
|
+
*
|
|
54
|
+
* Status values may be wrapped in bold: **DONE**, **COMPLETE**
|
|
55
|
+
* Normalizes to: COMPLETE, ACTIVE, BLOCKED, PENDING, STRUCTURAL
|
|
56
|
+
*/
|
|
57
|
+
export declare function parseCampaignState(): Promise<CampaignData | null>;
|
|
58
|
+
/**
|
|
59
|
+
* Parse assemble-state.md into phase pipeline data.
|
|
60
|
+
* Explicit trim on captures to remove leading artifacts.
|
|
61
|
+
*/
|
|
62
|
+
export declare function parseBuildState(): Promise<PhaseData | null>;
|
|
63
|
+
/**
|
|
64
|
+
* Parse findings — prefer Known Issues from build-state.md (curated, reflects open issues only).
|
|
65
|
+
* Falls back to regex counting across log files (historical totals, may overcount).
|
|
66
|
+
*/
|
|
67
|
+
export declare function parseFindings(): Promise<FindingCounts>;
|
|
68
|
+
/** Read deploy log from logs or .voidforge directory. Also reads deploy-state.md (v15.0). */
|
|
69
|
+
export declare function readDeployLog(): Promise<DeployData | null>;
|
|
70
|
+
/** Detect deployment drift — compare deployed commit against current HEAD. */
|
|
71
|
+
export declare function detectDeployDrift(): Promise<{
|
|
72
|
+
deployed_commit: string | null;
|
|
73
|
+
head_commit: string | null;
|
|
74
|
+
drifted: boolean;
|
|
75
|
+
} | null>;
|
|
76
|
+
/** Read current version from VERSION.md. */
|
|
77
|
+
export declare function readVersion(): Promise<{
|
|
78
|
+
version: string;
|
|
79
|
+
branch: string;
|
|
80
|
+
}>;
|
|
81
|
+
export interface ContextStats {
|
|
82
|
+
percent: number | null;
|
|
83
|
+
tokens: number | null;
|
|
84
|
+
output_tokens: number | null;
|
|
85
|
+
window_size: number | null;
|
|
86
|
+
model: string | null;
|
|
87
|
+
cost: number | null;
|
|
88
|
+
session_id: string | null;
|
|
89
|
+
updated_at: number | null;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Read context stats from the Status Line bridge.
|
|
93
|
+
* Reads per-session files (~/.voidforge/context-stats-*.json) and returns the most recent.
|
|
94
|
+
* Returns null if no data exists or all data is stale (>60s old).
|
|
95
|
+
*/
|
|
96
|
+
export declare function readContextStats(): Promise<ContextStats | null>;
|
|
97
|
+
export interface TestResults {
|
|
98
|
+
passed: number;
|
|
99
|
+
failed: number;
|
|
100
|
+
total: number;
|
|
101
|
+
duration_ms?: number;
|
|
102
|
+
last_run?: string;
|
|
103
|
+
failures?: Array<{
|
|
104
|
+
name: string;
|
|
105
|
+
message: string;
|
|
106
|
+
}>;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Read test results from test-results.json (written by test runner or hook).
|
|
110
|
+
*/
|
|
111
|
+
export declare function readTestResults(): Promise<TestResults | null>;
|
|
112
|
+
export interface DangerRoomConfig {
|
|
113
|
+
health_endpoint?: string;
|
|
114
|
+
pm2_process?: string;
|
|
115
|
+
panels?: string[];
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Read danger-room.config.json for project-specific panel settings.
|
|
119
|
+
*/
|
|
120
|
+
export declare function readDashboardConfig(): Promise<DangerRoomConfig>;
|
|
121
|
+
/**
|
|
122
|
+
* Read git status for the Git Status panel.
|
|
123
|
+
*/
|
|
124
|
+
export declare function readGitStatus(): Promise<{
|
|
125
|
+
branch: string;
|
|
126
|
+
uncommitted: number;
|
|
127
|
+
ahead: number;
|
|
128
|
+
behind: number;
|
|
129
|
+
lastCommit: string;
|
|
130
|
+
} | null>;
|
|
131
|
+
/** Export paths for modules that need direct access. */
|
|
132
|
+
export { PROJECT_ROOT, LOGS_DIR, VOIDFORGE_DIR };
|