ai-project-maintainer 0.3.1 → 0.4.1

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 (51) hide show
  1. package/README.md +45 -9
  2. package/ai-project-maintainer/agents/openai.yaml +6 -6
  3. package/ai-project-maintainer/references/ci-guardrails.md +55 -55
  4. package/ai-project-maintainer/references/database.md +60 -60
  5. package/ai-project-maintainer/references/electron-desktop.md +43 -43
  6. package/ai-project-maintainer/references/incident-response.md +52 -52
  7. package/ai-project-maintainer/references/security.md +48 -48
  8. package/ai-project-maintainer/references/tool-router.md +53 -53
  9. package/ai-project-maintainer/scripts/bootstrap-local-tools.ps1 +109 -109
  10. package/ai-project-maintainer/scripts/ci-smoke-gate.mjs +26 -26
  11. package/ai-project-maintainer/scripts/init-project.mjs +28 -16
  12. package/ai-project-maintainer/scripts/lib/check-registry.mjs +10 -9
  13. package/ai-project-maintainer/scripts/lib/checks.mjs +22 -10
  14. package/ai-project-maintainer/scripts/lib/command-runner.mjs +17 -3
  15. package/ai-project-maintainer/scripts/lib/policy.mjs +6 -4
  16. package/ai-project-maintainer/scripts/lib/report.mjs +56 -32
  17. package/assets/demo-90s-storyboard.svg +98 -0
  18. package/assets/demo-90s.gif +0 -0
  19. package/assets/social-preview.png +0 -0
  20. package/assets/social-preview.svg +55 -0
  21. package/docs/DEMO.md +39 -44
  22. package/docs/DEMO.zh-CN.md +40 -46
  23. package/docs/GITHUB-LAUNCH-CHECKLIST.md +11 -11
  24. package/docs/POLICY-AND-EXCEPTIONS.zh-CN.md +1 -1
  25. package/docs/PROMOTION.md +49 -21
  26. package/docs/SECURITY-WORKFLOW.md +63 -0
  27. package/docs/UPGRADE-ROADMAP.zh-CN.md +28 -27
  28. package/docs/demo-output/90-second-demo.html +187 -0
  29. package/docs/demo-output/before-after-case.md +91 -0
  30. package/docs/demo-output/security-report.md +45 -37
  31. package/docs/superpowers/plans/2026-06-29-ci-dogfooding.md +200 -200
  32. package/examples/demo-ai-app/.ai-maintainer/business-flows.yml +14 -0
  33. package/examples/demo-ai-app/.ai-maintainer/db-migration-policy.yml +6 -0
  34. package/examples/demo-ai-app/.ai-maintainer/evidence-sources.yml +18 -0
  35. package/examples/demo-ai-app/.ai-maintainer/exceptions.yml +1 -0
  36. package/examples/demo-ai-app/.ai-maintainer/incident-runbook.md +11 -0
  37. package/examples/demo-ai-app/.ai-maintainer/observability-checklist.yml +7 -0
  38. package/examples/demo-ai-app/.ai-maintainer/policy.yml +27 -0
  39. package/examples/demo-ai-app/.ai-maintainer/project-profile.yml +15 -0
  40. package/examples/demo-ai-app/.ai-maintainer/release-checklist.yml +7 -0
  41. package/examples/demo-ai-app/.ai-maintainer/risk-policy.yml +5 -0
  42. package/examples/demo-ai-app/.ai-maintainer/threat-model.md +18 -0
  43. package/examples/demo-ai-app/README.md +38 -0
  44. package/examples/demo-ai-app/package-lock.json +15 -0
  45. package/examples/demo-ai-app/package.json +16 -0
  46. package/examples/demo-ai-app/scripts/build.mjs +18 -0
  47. package/examples/demo-ai-app/scripts/create-before-state.mjs +86 -0
  48. package/examples/demo-ai-app/scripts/run-demo-gate.mjs +95 -0
  49. package/examples/demo-ai-app/src/order-risk.js +28 -0
  50. package/examples/demo-ai-app/test/order-risk.test.mjs +24 -0
  51. package/package.json +11 -3
@@ -1,200 +1,200 @@
1
- # CI Dogfooding Implementation Plan
2
-
3
- > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
4
-
5
- **Goal:** Add a real GitHub Actions CI gate so the repository dogfoods its own tests, syntax checks, package validation, and local safety gate.
6
-
7
- **Architecture:** Use a single GitHub Actions workflow at `.github/workflows/ci.yml` that runs on pushes and pull requests to `main`. Keep the first version account-free and deterministic: install npm dependencies with `npm ci`, run Node tests and syntax checks, validate npm package contents, run `doctor` without Trivy DB as a non-blocking tool probe, and run a local gate smoke test that generates reports while treating external scanners as unavailable on day one.
8
-
9
- **Tech Stack:** GitHub Actions, Node.js 20 and 22, npm, existing Node scripts in `ai-project-maintainer/scripts`.
10
-
11
- ---
12
-
13
- ### Task 1: Add GitHub Actions CI Workflow
14
-
15
- **Files:**
16
- - Create: `.github/workflows/ci.yml`
17
- - Create: `ai-project-maintainer/scripts/ci-smoke-gate.mjs`
18
-
19
- - [ ] **Step 1: Create the workflow file**
20
-
21
- Use this workflow content:
22
-
23
- ```yaml
24
- name: CI
25
-
26
- on:
27
- push:
28
- branches:
29
- - main
30
- pull_request:
31
- branches:
32
- - main
33
- workflow_dispatch:
34
-
35
- permissions:
36
- contents: read
37
-
38
- jobs:
39
- test:
40
- name: Node ${{ matrix.node-version }}
41
- runs-on: ubuntu-latest
42
- strategy:
43
- fail-fast: false
44
- matrix:
45
- node-version:
46
- - 20
47
- - 22
48
-
49
- steps:
50
- - name: Check out repository
51
- uses: actions/checkout@v4
52
-
53
- - name: Set up Node.js
54
- uses: actions/setup-node@v4
55
- with:
56
- node-version: ${{ matrix.node-version }}
57
- cache: npm
58
-
59
- - name: Install dependencies
60
- run: npm ci
61
-
62
- - name: Run tests
63
- run: npm test
64
-
65
- - name: Check script syntax
66
- run: npm run check
67
-
68
- - name: Validate package contents
69
- run: npm pack --dry-run
70
-
71
- - name: Probe local tool availability
72
- continue-on-error: true
73
- run: node ai-project-maintainer/scripts/doctor.mjs --no-trivy-db
74
-
75
- - name: Run local gate smoke test
76
- run: node ai-project-maintainer/scripts/ci-smoke-gate.mjs . reports/security-report.json
77
-
78
- - name: Upload gate reports
79
- if: always()
80
- uses: actions/upload-artifact@v4
81
- with:
82
- name: security-reports-node-${{ matrix.node-version }}
83
- path: reports/
84
- if-no-files-found: ignore
85
- ```
86
-
87
- - [ ] **Step 2: Validate workflow can be parsed as YAML**
88
-
89
- Run:
90
-
91
- ```powershell
92
- node -e "import('yaml').then(({parse})=>{const fs=require('node:fs'); parse(fs.readFileSync('.github/workflows/ci.yml','utf8')); console.log('workflow yaml ok')})"
93
- ```
94
-
95
- Expected: `workflow yaml ok`
96
-
97
- ### Task 2: Update README Trust Signals
98
-
99
- **Files:**
100
- - Modify: `README.md`
101
-
102
- - [ ] **Step 1: Replace the static CI badge**
103
-
104
- Replace:
105
-
106
- ```markdown
107
- ![CI ready](https://img.shields.io/badge/CI-GitHub%20Actions-24292f)
108
- ```
109
-
110
- With:
111
-
112
- ```markdown
113
- [![CI](https://github.com/xixifusi1213-gif/ai-project-maintainer/actions/workflows/ci.yml/badge.svg)](https://github.com/xixifusi1213-gif/ai-project-maintainer/actions/workflows/ci.yml)
114
- ```
115
-
116
- - [ ] **Step 2: Fix the README demo link separator**
117
-
118
- Replace the corrupted link separator line with:
119
-
120
- ```markdown
121
- [See the demo](docs/DEMO.md) · [中文演示](docs/DEMO.zh-CN.md) · [Production audit docs](docs/PRODUCTION-AUDIT.zh-CN.md)
122
- ```
123
-
124
- ### Task 3: Verify Locally
125
-
126
- **Files:**
127
- - No additional files.
128
-
129
- - [ ] **Step 1: Run tests**
130
-
131
- Run:
132
-
133
- ```powershell
134
- npm test
135
- ```
136
-
137
- Expected: all tests pass.
138
-
139
- - [ ] **Step 2: Run syntax checks**
140
-
141
- Run:
142
-
143
- ```powershell
144
- npm run check
145
- ```
146
-
147
- Expected: syntax check passes.
148
-
149
- - [ ] **Step 3: Validate package contents**
150
-
151
- Run:
152
-
153
- ```powershell
154
- npm pack --dry-run
155
- ```
156
-
157
- Expected: npm reports package `ai-project-maintainer@0.3.0` without errors.
158
-
159
- - [ ] **Step 4: Run CI-equivalent local checks**
160
-
161
- Run:
162
-
163
- ```powershell
164
- node ai-project-maintainer/scripts/doctor.mjs --no-trivy-db
165
- node ai-project-maintainer/scripts/ci-smoke-gate.mjs . reports/security-report.json
166
- ```
167
-
168
- Expected: commands exit successfully and reports are generated.
169
-
170
- ### Task 4: Publish
171
-
172
- **Files:**
173
- - Commit: `.github/workflows/ci.yml`, `README.md`, `ai-project-maintainer/scripts/ci-smoke-gate.mjs`, `docs/superpowers/plans/2026-06-29-ci-dogfooding.md`
174
-
175
- - [ ] **Step 1: Commit changes**
176
-
177
- Run:
178
-
179
- ```powershell
180
- git add .github/workflows/ci.yml README.md ai-project-maintainer/scripts/ci-smoke-gate.mjs docs/superpowers/plans/2026-06-29-ci-dogfooding.md
181
- git commit -m "Add CI dogfooding workflow"
182
- ```
183
-
184
- - [ ] **Step 2: Push to GitHub**
185
-
186
- Run:
187
-
188
- ```powershell
189
- git push origin HEAD:main
190
- ```
191
-
192
- - [ ] **Step 3: Check workflow registration**
193
-
194
- Run:
195
-
196
- ```powershell
197
- gh workflow list --repo xixifusi1213-gif/ai-project-maintainer
198
- ```
199
-
200
- Expected: workflow list includes `CI`.
1
+ # CI Dogfooding Implementation Plan
2
+
3
+ > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
4
+
5
+ **Goal:** Add a real GitHub Actions CI gate so the repository dogfoods its own tests, syntax checks, package validation, and local safety gate.
6
+
7
+ **Architecture:** Use a single GitHub Actions workflow at `.github/workflows/ci.yml` that runs on pushes and pull requests to `main`. Keep the first version account-free and deterministic: install npm dependencies with `npm ci`, run Node tests and syntax checks, validate npm package contents, run `doctor` without Trivy DB as a non-blocking tool probe, and run a local gate smoke test that generates reports while treating external scanners as unavailable on day one.
8
+
9
+ **Tech Stack:** GitHub Actions, Node.js 20 and 22, npm, existing Node scripts in `ai-project-maintainer/scripts`.
10
+
11
+ ---
12
+
13
+ ### Task 1: Add GitHub Actions CI Workflow
14
+
15
+ **Files:**
16
+ - Create: `.github/workflows/ci.yml`
17
+ - Create: `ai-project-maintainer/scripts/ci-smoke-gate.mjs`
18
+
19
+ - [ ] **Step 1: Create the workflow file**
20
+
21
+ Use this workflow content:
22
+
23
+ ```yaml
24
+ name: CI
25
+
26
+ on:
27
+ push:
28
+ branches:
29
+ - main
30
+ pull_request:
31
+ branches:
32
+ - main
33
+ workflow_dispatch:
34
+
35
+ permissions:
36
+ contents: read
37
+
38
+ jobs:
39
+ test:
40
+ name: Node ${{ matrix.node-version }}
41
+ runs-on: ubuntu-latest
42
+ strategy:
43
+ fail-fast: false
44
+ matrix:
45
+ node-version:
46
+ - 20
47
+ - 22
48
+
49
+ steps:
50
+ - name: Check out repository
51
+ uses: actions/checkout@v4
52
+
53
+ - name: Set up Node.js
54
+ uses: actions/setup-node@v4
55
+ with:
56
+ node-version: ${{ matrix.node-version }}
57
+ cache: npm
58
+
59
+ - name: Install dependencies
60
+ run: npm ci
61
+
62
+ - name: Run tests
63
+ run: npm test
64
+
65
+ - name: Check script syntax
66
+ run: npm run check
67
+
68
+ - name: Validate package contents
69
+ run: npm pack --dry-run
70
+
71
+ - name: Probe local tool availability
72
+ continue-on-error: true
73
+ run: node ai-project-maintainer/scripts/doctor.mjs --no-trivy-db
74
+
75
+ - name: Run local gate smoke test
76
+ run: node ai-project-maintainer/scripts/ci-smoke-gate.mjs . reports/security-report.json
77
+
78
+ - name: Upload gate reports
79
+ if: always()
80
+ uses: actions/upload-artifact@v4
81
+ with:
82
+ name: security-reports-node-${{ matrix.node-version }}
83
+ path: reports/
84
+ if-no-files-found: ignore
85
+ ```
86
+
87
+ - [ ] **Step 2: Validate workflow can be parsed as YAML**
88
+
89
+ Run:
90
+
91
+ ```powershell
92
+ node -e "import('yaml').then(({parse})=>{const fs=require('node:fs'); parse(fs.readFileSync('.github/workflows/ci.yml','utf8')); console.log('workflow yaml ok')})"
93
+ ```
94
+
95
+ Expected: `workflow yaml ok`
96
+
97
+ ### Task 2: Update README Trust Signals
98
+
99
+ **Files:**
100
+ - Modify: `README.md`
101
+
102
+ - [ ] **Step 1: Replace the static CI badge**
103
+
104
+ Replace:
105
+
106
+ ```markdown
107
+ ![CI ready](https://img.shields.io/badge/CI-GitHub%20Actions-24292f)
108
+ ```
109
+
110
+ With:
111
+
112
+ ```markdown
113
+ [![CI](https://github.com/xixifusi1213-gif/ai-project-maintainer/actions/workflows/ci.yml/badge.svg)](https://github.com/xixifusi1213-gif/ai-project-maintainer/actions/workflows/ci.yml)
114
+ ```
115
+
116
+ - [ ] **Step 2: Fix the README demo link separator**
117
+
118
+ Replace the corrupted link separator line with:
119
+
120
+ ```markdown
121
+ [See the demo](docs/DEMO.md) · [中文演示](docs/DEMO.zh-CN.md) · [Production audit docs](docs/PRODUCTION-AUDIT.zh-CN.md)
122
+ ```
123
+
124
+ ### Task 3: Verify Locally
125
+
126
+ **Files:**
127
+ - No additional files.
128
+
129
+ - [ ] **Step 1: Run tests**
130
+
131
+ Run:
132
+
133
+ ```powershell
134
+ npm test
135
+ ```
136
+
137
+ Expected: all tests pass.
138
+
139
+ - [ ] **Step 2: Run syntax checks**
140
+
141
+ Run:
142
+
143
+ ```powershell
144
+ npm run check
145
+ ```
146
+
147
+ Expected: syntax check passes.
148
+
149
+ - [ ] **Step 3: Validate package contents**
150
+
151
+ Run:
152
+
153
+ ```powershell
154
+ npm pack --dry-run
155
+ ```
156
+
157
+ Expected: npm reports package `ai-project-maintainer@0.3.0` without errors.
158
+
159
+ - [ ] **Step 4: Run CI-equivalent local checks**
160
+
161
+ Run:
162
+
163
+ ```powershell
164
+ node ai-project-maintainer/scripts/doctor.mjs --no-trivy-db
165
+ node ai-project-maintainer/scripts/ci-smoke-gate.mjs . reports/security-report.json
166
+ ```
167
+
168
+ Expected: commands exit successfully and reports are generated.
169
+
170
+ ### Task 4: Publish
171
+
172
+ **Files:**
173
+ - Commit: `.github/workflows/ci.yml`, `README.md`, `ai-project-maintainer/scripts/ci-smoke-gate.mjs`, `docs/superpowers/plans/2026-06-29-ci-dogfooding.md`
174
+
175
+ - [ ] **Step 1: Commit changes**
176
+
177
+ Run:
178
+
179
+ ```powershell
180
+ git add .github/workflows/ci.yml README.md ai-project-maintainer/scripts/ci-smoke-gate.mjs docs/superpowers/plans/2026-06-29-ci-dogfooding.md
181
+ git commit -m "Add CI dogfooding workflow"
182
+ ```
183
+
184
+ - [ ] **Step 2: Push to GitHub**
185
+
186
+ Run:
187
+
188
+ ```powershell
189
+ git push origin HEAD:main
190
+ ```
191
+
192
+ - [ ] **Step 3: Check workflow registration**
193
+
194
+ Run:
195
+
196
+ ```powershell
197
+ gh workflow list --repo xixifusi1213-gif/ai-project-maintainer
198
+ ```
199
+
200
+ Expected: workflow list includes `CI`.
@@ -0,0 +1,14 @@
1
+ schema_version: 1
2
+ business_flows:
3
+ - id: "checkout-quote"
4
+ name: "Customer checkout quote"
5
+ criticality: "high"
6
+ expected_behavior: "A customer-visible total must include the selected shipping cost exactly once."
7
+ tests:
8
+ - "test/order-risk.test.mjs"
9
+ - id: "order-release"
10
+ name: "Paid order release"
11
+ criticality: "high"
12
+ expected_behavior: "An order can be released only when payment, stock, and risk checks all pass."
13
+ tests:
14
+ - "test/order-risk.test.mjs"
@@ -0,0 +1,6 @@
1
+ schema_version: 1
2
+ database:
3
+ changes_use_migrations: false
4
+ destructive_changes_require_review: true
5
+ backup_before_production_migration: false
6
+ rollback_or_forward_fix_required: false
@@ -0,0 +1,18 @@
1
+ schema_version: 1
2
+ evidence:
3
+ github_actions: "present"
4
+ deployment:
5
+ provider: "demo"
6
+ has_staging: true
7
+ has_production: true
8
+ production_requires_approval: false
9
+ observability:
10
+ errors: "none"
11
+ logs: "none"
12
+ metrics: "none"
13
+ alerts: "none"
14
+ database:
15
+ migrations: "none"
16
+ review_tool: "none"
17
+ backup_policy: "none"
18
+ rollback_plan: "none"
@@ -0,0 +1 @@
1
+ exceptions: []
@@ -0,0 +1,11 @@
1
+ # Incident Runbook
2
+
3
+ ## First Response
4
+
5
+ - Stop new releases.
6
+ - Check checkout quote and order release tests.
7
+ - Decide whether to rollback the latest release.
8
+
9
+ ## Missing Evidence
10
+
11
+ - Production monitoring is intentionally missing in the demo so the audit report shows GAP items.
@@ -0,0 +1,7 @@
1
+ schema_version: 1
2
+ observability:
3
+ error_monitoring: false
4
+ structured_logs: false
5
+ metrics: false
6
+ alerts: false
7
+ release_tracking: false
@@ -0,0 +1,27 @@
1
+ profile: oss
2
+ mode: strict
3
+ checks:
4
+ gitleaks: block
5
+ trivy: block
6
+ semgrep: block
7
+ osv-scanner: warn
8
+ syft: warn
9
+ grype: warn
10
+ actionlint: block
11
+ zizmor: warn
12
+ checkov: warn
13
+ trivy-config: warn
14
+ scorecard: warn
15
+ megalinter: warn
16
+ pre-commit: warn
17
+ package-audit: warn
18
+ fail_on:
19
+ tests: true
20
+ secrets: true
21
+ dependency_high_or_critical: true
22
+ semgrep_blocking: true
23
+ trivy_unavailable: true
24
+ electron_dangerous_settings: true
25
+ ci_security_high: true
26
+ warn_on:
27
+ missing_optional_tools: true
@@ -0,0 +1,15 @@
1
+ schema_version: 1
2
+ project:
3
+ name: demo-ai-app
4
+ type: node
5
+ lifecycle: production-candidate
6
+ production: true
7
+ risk:
8
+ handles_auth: false
9
+ handles_sensitive_data: false
10
+ handles_payments: false
11
+ handles_financial_data: false
12
+ handles_health_data: false
13
+ has_database: false
14
+ has_deployment: true
15
+ has_user_generated_content: false
@@ -0,0 +1,7 @@
1
+ schema_version: 1
2
+ release:
3
+ has_staging: true
4
+ has_smoke_tests: true
5
+ has_manual_approval: false
6
+ has_rollback_plan: false
7
+ has_versioned_artifacts: true
@@ -0,0 +1,5 @@
1
+ schema_version: 1
2
+ production:
3
+ block_on_coverage_gaps: false
4
+ block_on_user_decisions: false
5
+ require_intake: true
@@ -0,0 +1,18 @@
1
+ # Threat Model
2
+
3
+ ## Assets
4
+
5
+ - Order totals
6
+ - Payment status
7
+ - Release decisions
8
+
9
+ ## Trust Boundaries
10
+
11
+ - Browser or API client input
12
+ - Order risk calculation
13
+ - Release approval process
14
+
15
+ ## User Decisions
16
+
17
+ - Confirm whether manual review threshold matches real business risk.
18
+ - Confirm who can override a release hold.
@@ -0,0 +1,38 @@
1
+ # Demo AI App
2
+
3
+ This is a small healthy Node.js project used by AI Project Maintainer demos.
4
+
5
+ It has:
6
+
7
+ - business-critical tests
8
+ - a build script
9
+ - production audit intake files
10
+ - intentional production evidence gaps for monitoring, alerts, approval, and rollback
11
+
12
+ ## Run The Healthy Project
13
+
14
+ ```powershell
15
+ npm test --prefix .\examples\demo-ai-app
16
+ npm run build --prefix .\examples\demo-ai-app
17
+ node .\examples\demo-ai-app\scripts\run-demo-gate.mjs
18
+ ```
19
+
20
+ The demo gate uses temporary scanner shims so the sample report is reproducible on machines that do not have Gitleaks, Trivy, Semgrep, and other scanners installed yet.
21
+
22
+ ## Generate The Broken Before State
23
+
24
+ ```powershell
25
+ node .\examples\demo-ai-app\scripts\create-before-state.mjs
26
+ ```
27
+
28
+ The command prints a temporary directory. Run `npm test` in that copied project to see the business tests fail. Nothing bad is committed into this repository; the failing state exists only under the OS temp directory.
29
+
30
+ ## Run The Real Gate
31
+
32
+ When scanner CLIs are installed, run the same command a real project would use:
33
+
34
+ ```powershell
35
+ npx ai-project-maintainer gate .\examples\demo-ai-app --production --strict --release --output reports/security-report.json
36
+ ```
37
+
38
+ The expected result is PASS with visible GAP items for missing production evidence.
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "demo-ai-app",
3
+ "version": "0.1.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "demo-ai-app",
9
+ "version": "0.1.0",
10
+ "engines": {
11
+ "node": ">=20"
12
+ }
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "demo-ai-app",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "description": "Runnable demo project for AI Project Maintainer.",
7
+ "scripts": {
8
+ "test": "node --test",
9
+ "build": "node scripts/build.mjs",
10
+ "demo:before": "node scripts/create-before-state.mjs",
11
+ "demo:gate": "node scripts/run-demo-gate.mjs"
12
+ },
13
+ "engines": {
14
+ "node": ">=20"
15
+ }
16
+ }
@@ -0,0 +1,18 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+
5
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
6
+ const outDir = path.join(root, "dist");
7
+
8
+ fs.mkdirSync(outDir, { recursive: true });
9
+ fs.writeFileSync(
10
+ path.join(outDir, "build-manifest.json"),
11
+ `${JSON.stringify({
12
+ app: "demo-ai-app",
13
+ builtAt: new Date().toISOString(),
14
+ entrypoints: ["src/order-risk.js"],
15
+ }, null, 2)}\n`,
16
+ );
17
+
18
+ console.log(`Demo build manifest written to ${path.relative(root, outDir)}`);