fraim-framework 2.0.26 → 2.0.30

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 (104) hide show
  1. package/.github/workflows/deploy-fraim.yml +1 -1
  2. package/dist/registry/scripts/build-scripts-generator.js +205 -0
  3. package/dist/registry/scripts/cleanup-branch.js +258 -0
  4. package/dist/registry/scripts/evaluate-code-quality.js +66 -0
  5. package/dist/registry/scripts/exec-with-timeout.js +142 -0
  6. package/dist/registry/scripts/fraim-config.js +61 -0
  7. package/dist/registry/scripts/generate-engagement-emails.js +630 -0
  8. package/dist/registry/scripts/generic-issues-api.js +100 -0
  9. package/dist/registry/scripts/newsletter-helpers.js +731 -0
  10. package/dist/registry/scripts/openapi-generator.js +664 -0
  11. package/dist/registry/scripts/performance/profile-server.js +390 -0
  12. package/dist/registry/scripts/run-thank-you-workflow.js +92 -0
  13. package/dist/registry/scripts/send-newsletter-simple.js +85 -0
  14. package/dist/registry/scripts/send-thank-you-emails.js +54 -0
  15. package/dist/registry/scripts/validate-openapi-limits.js +311 -0
  16. package/dist/registry/scripts/validate-test-coverage.js +262 -0
  17. package/dist/registry/scripts/verify-test-coverage.js +66 -0
  18. package/dist/src/cli/commands/init.js +14 -12
  19. package/dist/src/cli/commands/sync.js +19 -2
  20. package/dist/src/cli/fraim.js +24 -22
  21. package/dist/src/cli/setup/first-run.js +13 -6
  22. package/dist/src/fraim/config-loader.js +0 -8
  23. package/dist/src/fraim/db-service.js +26 -15
  24. package/dist/src/fraim/issues.js +67 -0
  25. package/dist/src/fraim/setup-wizard.js +1 -69
  26. package/dist/src/fraim/types.js +0 -11
  27. package/dist/src/fraim-mcp-server.js +272 -18
  28. package/dist/src/utils/git-utils.js +1 -1
  29. package/dist/src/utils/version-utils.js +32 -0
  30. package/dist/tests/debug-tools.js +79 -0
  31. package/dist/tests/esm-compat.js +11 -0
  32. package/dist/tests/test-chalk-esm-issue.js +159 -0
  33. package/dist/tests/test-chalk-real-world.js +265 -0
  34. package/dist/tests/test-chalk-regression.js +327 -0
  35. package/dist/tests/test-chalk-resolution-issue.js +304 -0
  36. package/dist/tests/test-cli.js +0 -2
  37. package/dist/tests/test-fraim-install-chalk-issue.js +254 -0
  38. package/dist/tests/test-fraim-issues.js +59 -0
  39. package/dist/tests/test-genericization.js +1 -3
  40. package/dist/tests/test-mcp-connection.js +166 -0
  41. package/dist/tests/test-mcp-issue-integration.js +144 -0
  42. package/dist/tests/test-mcp-lifecycle-methods.js +312 -0
  43. package/dist/tests/test-node-compatibility.js +71 -0
  44. package/dist/tests/test-npm-install.js +66 -0
  45. package/dist/tests/test-npm-resolution-diagnostic.js +140 -0
  46. package/dist/tests/test-session-rehydration.js +145 -0
  47. package/dist/tests/test-standalone.js +2 -8
  48. package/dist/tests/test-sync-version-update.js +93 -0
  49. package/dist/tests/test-telemetry.js +190 -0
  50. package/package.json +10 -8
  51. package/registry/agent-guardrails.md +62 -54
  52. package/registry/rules/agent-success-criteria.md +52 -0
  53. package/registry/rules/agent-testing-guidelines.md +502 -502
  54. package/registry/rules/communication.md +121 -121
  55. package/registry/rules/continuous-learning.md +54 -54
  56. package/registry/rules/ephemeral-execution.md +10 -5
  57. package/registry/rules/hitl-ppe-record-analysis.md +302 -302
  58. package/registry/rules/local-development.md +251 -251
  59. package/registry/rules/software-development-lifecycle.md +104 -104
  60. package/registry/rules/successful-debugging-patterns.md +482 -478
  61. package/registry/rules/telemetry.md +67 -0
  62. package/registry/scripts/build-scripts-generator.ts +216 -215
  63. package/registry/scripts/cleanup-branch.ts +303 -284
  64. package/registry/scripts/code-quality-check.sh +559 -559
  65. package/registry/scripts/detect-tautological-tests.sh +38 -38
  66. package/registry/scripts/evaluate-code-quality.ts +1 -1
  67. package/registry/scripts/generate-engagement-emails.ts +744 -744
  68. package/registry/scripts/generic-issues-api.ts +110 -150
  69. package/registry/scripts/newsletter-helpers.ts +874 -874
  70. package/registry/scripts/openapi-generator.ts +695 -693
  71. package/registry/scripts/performance/profile-server.ts +5 -3
  72. package/registry/scripts/prep-issue.sh +468 -455
  73. package/registry/scripts/validate-openapi-limits.ts +366 -365
  74. package/registry/scripts/validate-test-coverage.ts +280 -280
  75. package/registry/scripts/verify-pr-comments.sh +70 -70
  76. package/registry/scripts/verify-test-coverage.ts +1 -1
  77. package/registry/templates/bootstrap/ARCHITECTURE-TEMPLATE.md +53 -53
  78. package/registry/templates/evidence/Implementation-BugEvidence.md +85 -85
  79. package/registry/templates/evidence/Implementation-FeatureEvidence.md +120 -120
  80. package/registry/templates/marketing/HBR-ARTICLE-TEMPLATE.md +66 -0
  81. package/registry/workflows/bootstrap/create-architecture.md +2 -2
  82. package/registry/workflows/bootstrap/evaluate-code-quality.md +3 -3
  83. package/registry/workflows/bootstrap/verify-test-coverage.md +2 -2
  84. package/registry/workflows/customer-development/insight-analysis.md +156 -156
  85. package/registry/workflows/customer-development/interview-preparation.md +421 -421
  86. package/registry/workflows/customer-development/strategic-brainstorming.md +146 -146
  87. package/registry/workflows/customer-development/thank-customers.md +193 -191
  88. package/registry/workflows/customer-development/weekly-newsletter.md +362 -352
  89. package/registry/workflows/improve-fraim/contribute.md +32 -0
  90. package/registry/workflows/improve-fraim/file-issue.md +32 -0
  91. package/registry/workflows/marketing/hbr-article.md +73 -0
  92. package/registry/workflows/performance/analyze-performance.md +63 -59
  93. package/registry/workflows/product-building/design.md +3 -2
  94. package/registry/workflows/product-building/implement.md +4 -3
  95. package/registry/workflows/product-building/prep-issue.md +28 -17
  96. package/registry/workflows/product-building/resolve.md +3 -2
  97. package/registry/workflows/product-building/retrospect.md +3 -2
  98. package/registry/workflows/product-building/spec.md +5 -4
  99. package/registry/workflows/product-building/test.md +3 -2
  100. package/registry/workflows/quality-assurance/iterative-improvement-cycle.md +562 -562
  101. package/registry/workflows/replicate/website-discovery-analysis.md +3 -3
  102. package/registry/workflows/reviewer/review-implementation-vs-design-spec.md +632 -632
  103. package/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +669 -669
  104. package/tsconfig.json +2 -1
@@ -0,0 +1,67 @@
1
+ # Telemetry & Session Management
2
+
3
+ ## Protocol Overview
4
+
5
+ FRAIM enforces a strict **Session Handshake** protocol to ensure proper environment tracking and implicit activity monitoring. All Agents interacting with a FRAIM server MUST adhere to this protocol.
6
+
7
+ ### 1. Mandatory Handshake (`fraim_connect`)
8
+
9
+ At the start of **every** session (i.e., when the agent starts up or connects to a new workspace), you MUST call the `fraim_connect` tool immediately.
10
+
11
+ **Tool**: `fraim_connect`
12
+ **Arguments**:
13
+ - `machine`: Object containing hardware specs.
14
+ - `hostname`: (string) e.g., "dev-box-1"
15
+ - `platform`: (string) e.g., "win32", "darwin"
16
+ - `arch`: (string) e.g., "x64"
17
+ - `cpus`: (string/number) CPU details
18
+ - `memory`: (string/number) Total RAM
19
+ - `repo`: Object containing repository context.
20
+ - `url`: (string) **Required**. The git remote URL.
21
+ - `owner`: (string) e.g., "user-or-org"
22
+ - `name`: (string) e.g., "my-repo"
23
+
24
+ **Example Call**:
25
+ ```json
26
+ {
27
+ "name": "fraim_connect",
28
+ "arguments": {
29
+ "machine": {
30
+ "hostname": "azure-vm-01",
31
+ "platform": "linux",
32
+ "arch": "x64"
33
+ },
34
+ "repo": {
35
+ "url": "https://github.com/fraim/framework.git",
36
+ "owner": "fraim",
37
+ "name": "framework"
38
+ }
39
+ }
40
+ }
41
+ ```
42
+
43
+ **Failure Consequence**:
44
+ If you attempt to call other tools (e.g., `get_fraim_workflow`, `get_fraim_file`) *without* first establishing a session via `fraim_connect`, the server will reject your request with a **400 Bad Request** error:
45
+
46
+ > "ā›” Session Not Started. Please call the 'fraim_connect' tool first to register your environment and begin the session."
47
+
48
+ ### 2. Implicit Activity Tracking
49
+
50
+ Once a session is established, you do **not** need to manually report usage. The FRAIM server automatically tracks your activity based on the API calls you make.
51
+
52
+ - **Keep-Alive**: Every tool call acts as a "heartbeat", updating your session's `lastActive` timestamp.
53
+ - **Efficiency**: The server uses write-behind caching to minimize database writes, so you can make frequent calls without performance penalty.
54
+ - **Persistence**: Usage data is persisted across server restarts.
55
+
56
+ ### 3. Data Collection Policy
57
+
58
+ We collect minimal metadata to improve the FRAIM system and validate startup credits:
59
+ - **Hardware**: To optimize resource allocation recommendations.
60
+ - **Repository**: To map work to specific projects/organizations.
61
+ - **Duration**: Calculated as `lastActive - startTime` to measure session length.
62
+ - **Tool Usage**: Which tools are used (implicitly derived).
63
+
64
+ **We do NOT collect**:
65
+ - Source code content (except what is explicitly passed in specific tool arguments like reviews).
66
+ - Environment variables.
67
+ - Personal files.
@@ -1,215 +1,216 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * FRAIM Build Scripts Generator
5
- *
6
- * Generates generic build scripts and validation patterns.
7
- * These are generic enough to apply to any project.
8
- *
9
- * Usage:
10
- * npx tsx .ai-agents/scripts/build-scripts-generator.ts
11
- */
12
-
13
- import { writeFileSync, existsSync, mkdirSync } from 'fs';
14
- import { join } from 'path';
15
- import { loadFraimConfig } from '../../../src/fraim/config-loader.js';
16
-
17
- /**
18
- * Generate package.json scripts section
19
- */
20
- export function generatePackageScripts(config: any): any {
21
- return {
22
- "build": "tsc && npm run validate:openapi",
23
- "validate:openapi": "npx tsx fraim/generators/validate-openapi-limits.ts",
24
- "start": "node dist/src/server.js",
25
- "start:mcp": "node dist/src/mcp-server.js",
26
- "dev": "npx tsx --watch src/server.ts",
27
- "dev:mcp": "tsx src/mcp-server.ts",
28
- "generate:openapi": "npx tsx fraim/generators/openapi-generator.ts",
29
- "test": "npx tsx --test test*.ts",
30
- "lint": "eslint *.ts",
31
- "lint:fix": "eslint *.ts --fix"
32
- };
33
- }
34
-
35
- /**
36
- * Generate code quality check script (generic version)
37
- */
38
- export function generateCodeQualityScript(outputDir: string): void {
39
- if (!existsSync(outputDir)) {
40
- mkdirSync(outputDir, { recursive: true });
41
- }
42
-
43
- const scriptContent = `#!/bin/bash
44
-
45
- # FRAIM Generic Code Quality Check
46
- # Validates code quality, build, and ChatGPT limits
47
-
48
- set -e
49
-
50
- MODE=\${1:-full}
51
- FAILED=0
52
- WARNINGS=0
53
-
54
- echo "================================================"
55
- echo "šŸ” CODE QUALITY CHECK ($MODE mode)"
56
- echo "================================================"
57
- echo ""
58
-
59
- # Build check
60
- if [ "$MODE" = "full" ] || [ "$MODE" = "build" ]; then
61
- echo "šŸ“¦ Building project..."
62
- if npm run build; then
63
- echo "āœ… Build passed"
64
- else
65
- echo "āŒ Build failed"
66
- FAILED=1
67
- fi
68
- echo ""
69
- fi
70
-
71
- # Lint check
72
- if [ "$MODE" = "full" ] || [ "$MODE" = "lint" ]; then
73
- echo "šŸ” Linting code..."
74
- if npm run lint; then
75
- echo "āœ… Lint passed"
76
- else
77
- echo "āš ļø Lint warnings (non-blocking)"
78
- WARNINGS=1
79
- fi
80
- echo ""
81
- fi
82
-
83
- # OpenAPI validation (ChatGPT limits)
84
- if [ "$MODE" = "full" ] || [ "$MODE" = "openapi" ]; then
85
- echo "šŸ“‹ Validating OpenAPI and ChatGPT limits..."
86
- if npm run validate:openapi; then
87
- echo "āœ… OpenAPI validation passed"
88
- else
89
- echo "āŒ OpenAPI validation failed"
90
- FAILED=1
91
- fi
92
- echo ""
93
- fi
94
-
95
- # Summary
96
- echo "================================================"
97
- echo "šŸ“Š QUALITY CHECK SUMMARY ($MODE mode)"
98
- echo "================================================"
99
- echo ""
100
-
101
- if [ $FAILED -eq 1 ]; then
102
- echo "āŒ CHECKS FAILED"
103
- echo ""
104
- echo "Fix the errors above before proceeding."
105
- exit 1
106
- elif [ $WARNINGS -eq 1 ]; then
107
- echo "āš ļø CHECKS PASSED WITH WARNINGS"
108
- echo ""
109
- echo "Review warnings above."
110
- exit 0
111
- else
112
- echo "āœ… ALL CHECKS PASSED"
113
- echo ""
114
- exit 0
115
- fi
116
- `;
117
-
118
- const scriptPath = join(outputDir, 'code-quality-check.sh');
119
- writeFileSync(scriptPath, scriptContent);
120
-
121
- // Make executable (Unix)
122
- if (process.platform !== 'win32') {
123
- const { execSync } = require('child_process');
124
- execSync(`chmod +x ${scriptPath}`);
125
- }
126
-
127
- console.log(`āœ… Generated code quality check script at ${scriptPath}`);
128
- }
129
-
130
- /**
131
- * Generate build copy scripts (generic)
132
- */
133
- export function generateCopyScripts(outputDir: string): void {
134
- if (!existsSync(outputDir)) {
135
- mkdirSync(outputDir, { recursive: true });
136
- }
137
-
138
- // Copy AI agents script (if .ai-agents exists)
139
- const copyAiAgents = `#!/usr/bin/env node
140
-
141
- /**
142
- * Copy .ai-agents directory to dist
143
- * Generic build script for FRAIM projects
144
- */
145
-
146
- const fs = require('fs');
147
- const path = require('path');
148
-
149
- const sourceDir = path.join(__dirname, '..', '.ai-agents');
150
- const destDir = path.join(__dirname, '..', 'dist', '.ai-agents');
151
-
152
- if (fs.existsSync(sourceDir)) {
153
- // Recursive copy
154
- function copyRecursive(src, dest) {
155
- if (!fs.existsSync(dest)) {
156
- fs.mkdirSync(dest, { recursive: true });
157
- }
158
-
159
- const entries = fs.readdirSync(src, { withFileTypes: true });
160
-
161
- for (const entry of entries) {
162
- const srcPath = path.join(src, entry.name);
163
- const destPath = path.join(dest, entry.name);
164
-
165
- if (entry.isDirectory()) {
166
- copyRecursive(srcPath, destPath);
167
- } else {
168
- fs.copyFileSync(srcPath, destPath);
169
- }
170
- }
171
- }
172
-
173
- copyRecursive(sourceDir, destDir);
174
- console.log('āœ… Copied .ai-agents to dist/.ai-agents');
175
- } else {
176
- console.log('ā„¹ļø .ai-agents directory not found, skipping');
177
- }
178
- `;
179
-
180
- writeFileSync(join(outputDir, 'copy-ai-agents.js'), copyAiAgents);
181
- console.log(`āœ… Generated copy-ai-agents.js`);
182
- }
183
-
184
- /**
185
- * Main generator function
186
- */
187
- export function generateBuildScripts(config: any, outputDir: string = 'scripts/build'): void {
188
- console.log('šŸš€ FRAIM Build Scripts Generator\n');
189
- console.log(`šŸ“ Output directory: ${outputDir}\n`);
190
-
191
- // Ensure output directory exists
192
- if (!existsSync(outputDir)) {
193
- mkdirSync(outputDir, { recursive: true });
194
- }
195
-
196
- // Generate code quality check
197
- console.log('šŸ“ Generating code quality check script...');
198
- generateCodeQualityScript(outputDir);
199
-
200
- // Generate build scripts
201
- console.log('\nšŸ“ Generating build scripts...');
202
- generateCopyScripts(outputDir);
203
-
204
- console.log('\nāœ… Build scripts generation complete!');
205
- console.log('\nšŸ“‹ Next steps:');
206
- console.log('1. Add scripts to package.json');
207
- console.log('2. Run: npm run validate:openapi');
208
- console.log('3. Run: ./scripts/build/code-quality-check.sh');
209
- }
210
-
211
- // Run if executed directly
212
- if (import.meta.url === `file://${process.argv[1]}`) {
213
- const config = loadFraimConfig();
214
- generateBuildScripts(config);
215
- }
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * FRAIM Build Scripts Generator
5
+ *
6
+ * Generates generic build scripts and validation patterns.
7
+ * These are generic enough to apply to any project.
8
+ *
9
+ * Usage:
10
+ * npx tsx scripts/build-scripts-generator.ts
11
+ */
12
+
13
+ import { writeFileSync, existsSync, mkdirSync } from 'fs';
14
+ import { join } from 'path';
15
+ import { loadFraimConfig } from '../../src/fraim/config-loader.js';
16
+
17
+ /**
18
+ * Generate package.json scripts section
19
+ */
20
+ export function generatePackageScripts(config: any): any {
21
+ return {
22
+ "build": "tsc && npm run validate:openapi",
23
+ "validate:openapi": "npx tsx " + "reg" + "istry/scripts/validate-openapi-limits.ts",
24
+ "start": "node dist/src/server.js",
25
+ "start:mcp": "node dist/src/mcp-server.js",
26
+ "dev": "npx tsx --watch src/server.ts",
27
+ "dev:mcp": "tsx src/mcp-server.ts",
28
+ "generate:openapi": "npx tsx " + "reg" + "istry/scripts/openapi-generator.ts",
29
+ "test": "npx tsx --test test*.ts",
30
+ "lint": "eslint *.ts",
31
+ "lint:fix": "eslint *.ts --fix"
32
+ };
33
+ }
34
+
35
+ /**
36
+ * Generate code quality check script (generic version)
37
+ */
38
+ export function generateCodeQualityScript(outputDir: string): void {
39
+ if (!existsSync(outputDir)) {
40
+ mkdirSync(outputDir, { recursive: true });
41
+ }
42
+
43
+ const scriptContent = `#!/bin/bash
44
+
45
+ # FRAIM Generic Code Quality Check
46
+ # Validates code quality, build, and ChatGPT limits
47
+
48
+ set -e
49
+
50
+ MODE=\${1:-full}
51
+ FAILED=0
52
+ WARNINGS=0
53
+
54
+ echo "================================================"
55
+ echo "šŸ” CODE QUALITY CHECK ($MODE mode)"
56
+ echo "================================================"
57
+ echo ""
58
+
59
+ # Build check
60
+ if [ "$MODE" = "full" ] || [ "$MODE" = "build" ]; then
61
+ echo "šŸ“¦ Building project..."
62
+ if npm run build; then
63
+ echo "āœ… Build passed"
64
+ else
65
+ echo "āŒ Build failed"
66
+ FAILED=1
67
+ fi
68
+ echo ""
69
+ fi
70
+
71
+ # Lint check
72
+ if [ "$MODE" = "full" ] || [ "$MODE" = "lint" ]; then
73
+ echo "šŸ” Linting code..."
74
+ if npm run lint; then
75
+ echo "āœ… Lint passed"
76
+ else
77
+ echo "āš ļø Lint warnings (non-blocking)"
78
+ WARNINGS=1
79
+ fi
80
+ echo ""
81
+ fi
82
+
83
+ # OpenAPI validation (ChatGPT limits)
84
+ if [ "$MODE" = "full" ] || [ "$MODE" = "openapi" ]; then
85
+ echo "šŸ“‹ Validating OpenAPI and ChatGPT limits..."
86
+ if npm run validate:openapi; then
87
+ echo "āœ… OpenAPI validation passed"
88
+ else
89
+ echo "āŒ OpenAPI validation failed"
90
+ FAILED=1
91
+ fi
92
+ echo ""
93
+ fi
94
+
95
+ # Summary
96
+ echo "================================================"
97
+ echo "šŸ“Š QUALITY CHECK SUMMARY ($MODE mode)"
98
+ echo "================================================"
99
+ echo ""
100
+
101
+ if [ $FAILED -eq 1 ]; then
102
+ echo "āŒ CHECKS FAILED"
103
+ echo ""
104
+ echo "Fix the errors above before proceeding."
105
+ exit 1
106
+ elif [ $WARNINGS -eq 1 ]; then
107
+ echo "āš ļø CHECKS PASSED WITH WARNINGS"
108
+ echo ""
109
+ echo "Review warnings above."
110
+ exit 0
111
+ else
112
+ echo "āœ… ALL CHECKS PASSED"
113
+ echo ""
114
+ exit 0
115
+ fi
116
+ `;
117
+
118
+ const scriptPath = join(outputDir, 'code-quality-check.sh');
119
+ writeFileSync(scriptPath, scriptContent);
120
+
121
+ // Make executable (Unix)
122
+ if (process.platform !== 'win32') {
123
+ const { execSync } = require('child_process');
124
+ execSync(`chmod +x ${scriptPath}`);
125
+ }
126
+
127
+ console.log(`āœ… Generated code quality check script at ${scriptPath}`);
128
+ }
129
+
130
+ /**
131
+ * Generate build copy scripts (generic)
132
+ */
133
+ export function generateCopyScripts(outputDir: string): void {
134
+ if (!existsSync(outputDir)) {
135
+ mkdirSync(outputDir, { recursive: true });
136
+ }
137
+
138
+ // Copy AI agents script (if .fraim exists)
139
+ const copyAiAgents = `#!/usr/bin/env node
140
+
141
+ /**
142
+ * Copy registry directory to dist
143
+ * Generic build script for FRAIM projects
144
+ */
145
+
146
+ const fs = require('fs');
147
+ const path = require('path');
148
+
149
+ const sourceDir = path.join(__dirname, '..', '..', 'registry');
150
+ const destDir = path.join(__dirname, '..', '..', 'dist', 'registry');
151
+
152
+ if (fs.existsSync(sourceDir)) {
153
+ // Recursive copy
154
+ function copyRecursive(src, dest) {
155
+ if (!fs.existsSync(dest)) {
156
+ fs.mkdirSync(dest, { recursive: true });
157
+ }
158
+
159
+ const entries = fs.readdirSync(src, { withFileTypes: true });
160
+
161
+ for (const entry of entries) {
162
+ const srcPath = path.join(src, entry.name);
163
+ const destPath = path.join(dest, entry.name);
164
+
165
+ if (entry.isDirectory()) {
166
+ copyRecursive(srcPath, destPath);
167
+ } else {
168
+ fs.copyFileSync(srcPath, destPath);
169
+ }
170
+ }
171
+ }
172
+
173
+ copyRecursive(sourceDir, destDir);
174
+ console.log('āœ… Copied registry to dist/registry');
175
+ } else {
176
+ console.log('ā„¹ļø registry directory not found, skipping');
177
+ }
178
+ `;
179
+
180
+ writeFileSync(join(outputDir, 'copy-ai-agents.js'), copyAiAgents);
181
+ console.log(`āœ… Generated copy-ai-agents.js`);
182
+ }
183
+
184
+ /**
185
+ * Main generator function
186
+ */
187
+ export function generateBuildScripts(config: any, outputDir: string = "scr" + "ipts/build"): void {
188
+ console.log('šŸš€ FRAIM Build Scripts Generator\n');
189
+ console.log(`šŸ“ Output directory: ${outputDir}\n`);
190
+
191
+ // Ensure output directory exists
192
+ if (!existsSync(outputDir)) {
193
+ mkdirSync(outputDir, { recursive: true });
194
+ }
195
+
196
+ // Generate code quality check
197
+ console.log('šŸ“ Generating code quality check script...');
198
+ generateCodeQualityScript(outputDir);
199
+
200
+ // Generate build scripts
201
+ console.log('\nšŸ“ Generating build scripts...');
202
+ generateCopyScripts(outputDir);
203
+
204
+ console.log('\nāœ… Build scripts generation complete!');
205
+ console.log('\nšŸ“‹ Next steps:');
206
+ console.log('1. Add scripts to package.json');
207
+ console.log('2. Run: npm run validate:openapi');
208
+ console.log('3. Run: ./scripts/build/code-quality-check.sh');
209
+ }
210
+
211
+ // Run if executed directly
212
+ // @ts-ignore
213
+ if (import.meta.url === `file://${process.argv[1]}`) {
214
+ const config = loadFraimConfig();
215
+ generateBuildScripts(config);
216
+ }