fraim-framework 2.0.30 → 2.0.33

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 (67) hide show
  1. package/dist/src/cli/commands/init.js +29 -2
  2. package/dist/src/cli/commands/sync.js +18 -1
  3. package/dist/src/utils/script-sync-utils.js +218 -0
  4. package/dist/tests/debug-tools.js +6 -5
  5. package/dist/tests/test-chalk-regression.js +58 -8
  6. package/dist/tests/test-cli.js +70 -5
  7. package/dist/tests/test-end-to-end-hybrid-validation.js +349 -0
  8. package/dist/tests/test-first-run-journey.js +43 -3
  9. package/dist/tests/test-hybrid-script-execution.js +369 -0
  10. package/dist/tests/test-mcp-connection.js +2 -2
  11. package/dist/tests/test-mcp-issue-integration.js +12 -4
  12. package/dist/tests/test-mcp-lifecycle-methods.js +4 -4
  13. package/dist/tests/test-node-compatibility.js +24 -2
  14. package/dist/tests/test-prep-issue.js +4 -1
  15. package/dist/tests/test-script-location-independence.js +173 -0
  16. package/dist/tests/test-script-sync.js +557 -0
  17. package/dist/tests/test-session-rehydration.js +2 -2
  18. package/dist/tests/test-standalone.js +3 -3
  19. package/dist/tests/test-sync-version-update.js +1 -1
  20. package/dist/tests/test-telemetry.js +2 -2
  21. package/dist/tests/test-user-journey.js +8 -4
  22. package/dist/tests/test-utils.js +13 -0
  23. package/dist/tests/test-wizard.js +2 -2
  24. package/package.json +3 -3
  25. package/registry/rules/agent-testing-guidelines.md +502 -502
  26. package/registry/rules/ephemeral-execution.md +37 -27
  27. package/registry/rules/local-development.md +253 -251
  28. package/registry/rules/successful-debugging-patterns.md +491 -482
  29. package/registry/scripts/prep-issue.sh +468 -468
  30. package/registry/workflows/bootstrap/evaluate-code-quality.md +8 -2
  31. package/registry/workflows/bootstrap/verify-test-coverage.md +8 -2
  32. package/registry/workflows/customer-development/thank-customers.md +203 -193
  33. package/registry/workflows/customer-development/weekly-newsletter.md +366 -362
  34. package/registry/workflows/performance/analyze-performance.md +65 -63
  35. package/registry/workflows/product-building/implement.md +6 -2
  36. package/registry/workflows/product-building/prep-issue.md +11 -24
  37. package/registry/workflows/product-building/resolve.md +5 -1
  38. package/registry/workflows/replicate/replicate-discovery.md +336 -0
  39. package/registry/workflows/replicate/replicate-to-issues.md +319 -0
  40. package/registry/workflows/reviewer/review-implementation-vs-design-spec.md +632 -632
  41. package/.windsurf/rules/windsurf-rules.md +0 -7
  42. package/.windsurf/workflows/resolve-issue.md +0 -6
  43. package/.windsurf/workflows/retrospect.md +0 -6
  44. package/.windsurf/workflows/start-design.md +0 -6
  45. package/.windsurf/workflows/start-impl.md +0 -6
  46. package/.windsurf/workflows/start-spec.md +0 -6
  47. package/.windsurf/workflows/start-tests.md +0 -6
  48. package/bin/fraim.js +0 -23
  49. package/registry/scripts/build-scripts-generator.ts +0 -216
  50. package/registry/scripts/cleanup-branch.ts +0 -303
  51. package/registry/scripts/fraim-config.ts +0 -63
  52. package/registry/scripts/generate-engagement-emails.ts +0 -744
  53. package/registry/scripts/generic-issues-api.ts +0 -110
  54. package/registry/scripts/newsletter-helpers.ts +0 -874
  55. package/registry/scripts/openapi-generator.ts +0 -695
  56. package/registry/scripts/performance/profile-server.ts +0 -370
  57. package/registry/scripts/run-thank-you-workflow.ts +0 -122
  58. package/registry/scripts/send-newsletter-simple.ts +0 -104
  59. package/registry/scripts/send-thank-you-emails.ts +0 -57
  60. package/registry/workflows/replicate/re-implementation-strategy.md +0 -226
  61. package/registry/workflows/replicate/use-case-extraction.md +0 -135
  62. package/registry/workflows/replicate/visual-analysis.md +0 -154
  63. package/registry/workflows/replicate/website-discovery-analysis.md +0 -231
  64. package/sample_package.json +0 -18
  65. /package/registry/scripts/{replicate/comprehensive-explorer.py → comprehensive-explorer.py} +0 -0
  66. /package/registry/scripts/{replicate/interactive-explorer.py → interactive-explorer.py} +0 -0
  67. /package/registry/scripts/{replicate/scrape-site.py → scrape-site.py} +0 -0
@@ -1,7 +0,0 @@
1
- ---
2
- trigger: always_on
3
- ---
4
-
5
- # Windsurf AI Agent Rules
6
-
7
- Thoroughly review `.ai-agents/agent-guardrails.md`
@@ -1,6 +0,0 @@
1
- ---
2
- description: Resolve issue (once confirmed complete)
3
- auto_execution_mode: 3
4
- ---
5
-
6
- Follow instructions in `.ai-agents/workflows/resolve.md`
@@ -1,6 +0,0 @@
1
- ---
2
- description: Resolve issue (once confirmed complete)
3
- auto_execution_mode: 3
4
- ---
5
-
6
- Follow instructions in `.ai-agents/workflows/retrospect.md`
@@ -1,6 +0,0 @@
1
- ---
2
- description: Start working on the issue
3
- auto_execution_mode: 3
4
- ---
5
-
6
- Follow instructions in `.ai-agents/workflows/design.md`
@@ -1,6 +0,0 @@
1
- ---
2
- description: Implement issue
3
- auto_execution_mode: 3
4
- ---
5
-
6
- Follow instructions in `.ai-agents/workflows/implement.md`
@@ -1,6 +0,0 @@
1
- ---
2
- description: Spec Issue
3
- auto_execution_mode: 3
4
- ---
5
-
6
- Follow instructions in `.ai-agents/workflows/spec.md`
@@ -1,6 +0,0 @@
1
- ---
2
- description: Start writing tests
3
- auto_execution_mode: 3
4
- ---
5
-
6
- Follow instructions in `.ai-agents/workflows/test.md`
package/bin/fraim.js DELETED
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * FRAIM Framework CLI Entry Point
5
- *
6
- * This file delegates to the compiled TypeScript implementation.
7
- */
8
-
9
- try {
10
- // In production/installed package, code is in dist/
11
- require('../dist/src/cli/fraim.js');
12
- } catch (error) {
13
- if (error.code === 'MODULE_NOT_FOUND') {
14
- // In development (local clone), we might use tsx if dist is missing
15
- // But typically we should just tell user to build.
16
- console.error('❌ Could not find FRAIM CLI implementation.');
17
- console.error(' If you are running from source, please run "npm run build" first.');
18
- console.error(` Error details: ${error.message}`);
19
- process.exit(1);
20
- } else {
21
- throw error;
22
- }
23
- }
@@ -1,216 +0,0 @@
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
- }
@@ -1,303 +0,0 @@
1
- #!/usr/bin/env npx tsx
2
-
3
- import { execSync } from 'child_process';
4
- import dotenv from 'dotenv';
5
-
6
- // Load environment variables
7
- dotenv.config({ override: true });
8
-
9
- interface CleanupOptions {
10
- branchName?: string;
11
- force?: boolean;
12
- skipProjectCleanup?: boolean;
13
- skipGit?: boolean;
14
- }
15
-
16
- class BranchCleanup {
17
- private options: CleanupOptions;
18
-
19
- constructor(options: CleanupOptions = {}) {
20
- this.options = {
21
- branchName: options.branchName,
22
- force: options.force || false,
23
- skipProjectCleanup: options.skipProjectCleanup || false,
24
- skipGit: options.skipGit || false,
25
- };
26
- }
27
-
28
- private async insertYourCodeHere(branchName: string): Promise<void> {
29
- const { extractIssueNumber } = require('../../src/utils/git-utils');
30
- const branchPattern = "branch_" + extractIssueNumber(branchName) + "%";
31
- this.log(`Attempting to fetch and run DB cleanup for pattern: ${branchPattern}`);
32
-
33
- // Historically this called: npx tsx scripts/database/cleanup-mongo-schemas.ts
34
- // In FRAIM 2.0, we should fetch it if possible, or skip if it's an internal-only script
35
- // that doesn't exist in the registry but was incorrectly referenced.
36
-
37
- // NOTE: In this specific case, cleanup-mongo-schemas.ts is likely an internal script.
38
- // If it's not in the registry, get_fraim_file will fail.
39
- // For now, we fix the path to be more agnostic or explicitly documented as a dependency.
40
-
41
- try {
42
- // NOTE: Users should define their own cleanup script location in .fraim/config.json
43
- // or the agent should fetch it. For now, we try to run it from a standard location
44
- // if it exists, but we don't hardcode it as a requirement for the script to run.
45
- const cleanupScript = process.env.FRAIM_PROJECT_CLEANUP_SCRIPT || (['scripts', 'database', 'cleanup-mongo-schemas.ts'].join('/'));
46
- this.log(`Checking for project cleanup script: ${cleanupScript}`);
47
-
48
- await this.executeCommand(
49
- `npx tsx ${cleanupScript} "${branchPattern}"`,
50
- 'Run project-specific cleanup script'
51
- );
52
- } catch (e) {
53
- this.log('Skipping project-specific cleanup (script not found or failed).', 'info');
54
- }
55
- }
56
-
57
-
58
- private log(message: string, level: 'info' | 'warn' | 'error' | 'success' = 'info') {
59
- const timestamp = new Date().toISOString();
60
- const prefix = {
61
- info: 'ℹ️ ',
62
- warn: '⚠️ ',
63
- error: '❌',
64
- success: '✅'
65
- }[level];
66
-
67
- console.log(`${prefix} [${timestamp}] ${message}`);
68
- }
69
-
70
- private async executeCommand(command: string, description: string): Promise<string> {
71
- this.log(`Executing: ${description}`);
72
-
73
- try {
74
- const result = execSync(command, {
75
- encoding: 'utf8',
76
- stdio: 'pipe',
77
- cwd: process.cwd()
78
- });
79
- this.log(`Success: ${description}`, 'success');
80
- return result;
81
- } catch (error: any) {
82
- this.log(`Failed: ${description} - ${error.message}`, 'error');
83
- throw error;
84
- }
85
- }
86
-
87
- private async getCurrentBranch(): Promise<string> {
88
- try {
89
- const result = await this.executeCommand('git branch --show-current', 'Get current branch');
90
- return result.trim();
91
- } catch (error) {
92
- this.log('Could not determine current branch', 'warn');
93
- return 'unknown';
94
- }
95
- }
96
-
97
- private async getBranchName(): Promise<string> {
98
- if (this.options.branchName) {
99
- return this.options.branchName;
100
- }
101
-
102
- const currentBranch = await this.getCurrentBranch();
103
- if (currentBranch === 'master' || currentBranch === 'main') {
104
- throw new Error('Cannot cleanup master/main branch. Please specify a feature branch name.');
105
- }
106
-
107
- return currentBranch;
108
- }
109
-
110
- private async checkBranchExists(branchName: string, remote: boolean = false): Promise<boolean> {
111
- try {
112
- const command = remote
113
- ? `git ls-remote --heads origin ${branchName}`
114
- : `git branch --list ${branchName}`;
115
-
116
- const result = await this.executeCommand(command, `Check if ${remote ? 'remote' : 'local'} branch exists`);
117
- return result.trim().length > 0;
118
- } catch (error) {
119
- return false;
120
- }
121
- }
122
-
123
- private async doProjectSpecificCleanup(branchName: string): Promise<void> {
124
- try {
125
- if (this.options.skipProjectCleanup) {
126
- this.log('Skipping project-specific cleanup', 'warn');
127
- return;
128
- }
129
-
130
- this.log('Starting project-specific cleanup...');
131
-
132
- await this.insertYourCodeHere(branchName);
133
-
134
- this.log('Project-specific cleanup completed successfully', 'success');
135
- } catch (error: any) {
136
- this.log(`Project-specific cleanup failed: ${error.message}`, 'error');
137
- if (!this.options.force) {
138
- throw error;
139
- }
140
- }
141
- }
142
-
143
- private async cleanupGitBranches(branchName: string): Promise<void> {
144
- if (this.options.skipGit) {
145
- this.log('Skipping Git cleanup', 'warn');
146
- return;
147
- }
148
-
149
- this.log(`Starting Git branch cleanup for: ${branchName}`);
150
-
151
- // Check if we're on the branch we want to delete
152
- const currentBranch = await this.getCurrentBranch();
153
- if (currentBranch === branchName) {
154
- this.log(`Currently on branch ${branchName}, switching to master first`, 'warn');
155
- await this.executeCommand('git checkout master', 'Switch to master branch');
156
- }
157
-
158
- // Delete remote branch
159
- const remoteExists = await this.checkBranchExists(branchName, true);
160
- if (remoteExists) {
161
- this.log(`Deleting remote branch: origin/${branchName}`);
162
- await this.executeCommand(`git push origin --delete ${branchName}`, `Delete remote branch ${branchName}`);
163
- } else {
164
- this.log(`Remote branch origin/${branchName} does not exist`, 'info');
165
- }
166
-
167
- // Delete local branch
168
- const localExists = await this.checkBranchExists(branchName, false);
169
- if (localExists) {
170
- this.log(`Deleting local branch: ${branchName}`);
171
- await this.executeCommand(`git branch -D ${branchName}`, `Delete local branch ${branchName}`);
172
- } else {
173
- this.log(`Local branch ${branchName} does not exist`, 'info');
174
- }
175
-
176
- // Clean up any untracked files
177
- this.log('Cleaning up untracked files...');
178
- await this.executeCommand('git clean -fd', 'Remove untracked files and directories');
179
-
180
- // Reset any uncommitted changes
181
- this.log('Resetting uncommitted changes...');
182
- await this.executeCommand('git reset --hard HEAD', 'Reset to HEAD');
183
-
184
- this.log('Git branch cleanup completed', 'success');
185
- }
186
-
187
-
188
- private async verifyCleanup(branchName: string): Promise<void> {
189
- this.log('Verifying cleanup...');
190
-
191
- // Verify branch deletion
192
- const remoteExists = await this.checkBranchExists(branchName, true);
193
- const localExists = await this.checkBranchExists(branchName, false);
194
-
195
- if (remoteExists || localExists) {
196
- this.log(`Warning: Branch ${branchName} still exists (remote: ${remoteExists}, local: ${localExists})`, 'warn');
197
- } else {
198
- this.log(`Branch ${branchName} successfully deleted`, 'success');
199
- }
200
-
201
- // Verify we're on master
202
- const currentBranch = await this.getCurrentBranch();
203
- if (currentBranch === 'master' || currentBranch === 'main') {
204
- this.log('Currently on master/main branch', 'success');
205
- } else {
206
- this.log(`Warning: Not on master branch, currently on ${currentBranch}`, 'warn');
207
- }
208
-
209
- this.log('Cleanup verification completed', 'success');
210
- }
211
-
212
- async cleanup(): Promise<void> {
213
- try {
214
- this.log('🚀 Starting branch cleanup process...');
215
-
216
- const branchName = await this.getBranchName();
217
- this.log(`Target branch: ${branchName}`);
218
-
219
- // Step 1: Project-specific cleanup
220
- await this.doProjectSpecificCleanup(branchName);
221
-
222
- // Step 2: Git branch cleanup
223
- await this.cleanupGitBranches(branchName);
224
-
225
- // Step 3: Verification
226
- await this.verifyCleanup(branchName);
227
-
228
- this.log('🎉 Branch cleanup completed successfully!', 'success');
229
-
230
- } catch (error: any) {
231
- this.log(`Cleanup failed: ${error.message}`, 'error');
232
- if (!this.options.force) {
233
- process.exit(1);
234
- }
235
- }
236
- }
237
- }
238
-
239
- // Parse command line arguments
240
- const args = process.argv.slice(2);
241
- const options: CleanupOptions = {};
242
-
243
- // Parse arguments
244
- for (let i = 0; i < args.length; i++) {
245
- const arg = args[i];
246
-
247
- switch (arg) {
248
- case '--branch':
249
- case '-b':
250
- options.branchName = args[++i];
251
- break;
252
- case '--force':
253
- case '-f':
254
- options.force = true;
255
- break;
256
- case '--skip-project-cleanup':
257
- options.skipProjectCleanup = true;
258
- break;
259
- case '--skip-git':
260
- options.skipGit = true;
261
- break;
262
- case '--help':
263
- case '-h':
264
- console.log(`
265
- 🧹 Branch Cleanup Script
266
-
267
- Usage:
268
- npx tsx scripts/cleanup-branch.ts [options]
269
-
270
- Options:
271
- --branch, -b <name> Specific branch name to cleanup (default: current branch)
272
- --force, -f Continue even if some operations fail
273
- --skip-project-cleanup Skip project-specific cleanup
274
- --skip-git Skip Git branch deletion
275
- --help, -h Show this help message
276
-
277
- Examples:
278
- # Cleanup current branch with default settings
279
- npx tsx <cleanup-script-path>
280
-
281
- # Cleanup specific branch
282
- npx tsx <cleanup-script-path> --branch feature/123
283
-
284
- # Force cleanup even if some operations fail
285
- npx tsx <cleanup-script-path> --force
286
-
287
- # Skip project-specific cleanup (only do Git cleanup)
288
- npx tsx <cleanup-script-path> --skip-project-cleanup
289
-
290
- This script performs the following cleanup operations:
291
- 1. 🗄️ Project-specific cleanup (calls configured cleanup script)
292
- 2. 🌿 Git branch deletion (remote and local)
293
- 3. ✅ Verification of cleanup completion
294
-
295
- ⚠️ WARNING: This script will permanently delete branches and data!
296
- `);
297
- process.exit(0);
298
- }
299
- }
300
-
301
- // Run the cleanup
302
- const cleanup = new BranchCleanup(options);
303
- cleanup.cleanup();
@@ -1,63 +0,0 @@
1
- import { loadFraimConfig } from '../../src/fraim/config-loader';
2
-
3
- const config = loadFraimConfig();
4
-
5
- const envOr = (keys: string[], fallback: string): string => {
6
- for (const key of keys) {
7
- const value = process.env[key];
8
- if (value && value.length) {
9
- return value;
10
- }
11
- }
12
- return fallback;
13
- };
14
-
15
- const personaName = config.persona.name;
16
- const personaDisplayNameDefault = config.persona.displayNamePattern.replace('{executiveName}', 'Your');
17
-
18
- export const fraimConfig = {
19
- repoOwner: config.git.repoOwner || 'mathursrus',
20
- repoName: config.git.repoName || 'fraim-repo',
21
- projectName: config.project.name,
22
- personaName,
23
- personaPronouns: envOr(['FRAIM_PERSONA_PRONOUNS'], 'they/them'), // Could add to config if needed
24
- personaDisplayName: envOr(['FRAIM_PERSONA_DISPLAY_NAME'], personaDisplayNameDefault),
25
- personaDisplayNamePattern: config.persona.displayNamePattern,
26
- personaThankYouSignature: config.persona.emailSignature,
27
- defaultEmail: envOr(['FRAIM_DEFAULT_EMAIL'], 'agent@example.com'),
28
- prodDefaultEmail: envOr(['PROD_FRAIM_DEFAULT_EMAIL'], 'agent@example.com'),
29
- defaultAccessToken: envOr(['FRAIM_DEFAULT_ACCESS_TOKEN'], ''),
30
- defaultRefreshToken: envOr(['FRAIM_DEFAULT_REFRESH_TOKEN'], ''),
31
- prodAccessToken: envOr(['PROD_FRAIM_DEFAULT_ACCESS_TOKEN'], ''),
32
- prodRefreshToken: envOr(['PROD_FRAIM_DEFAULT_REFRESH_TOKEN'], ''),
33
- defaultOAuthClientId: envOr(['FRAIM_DEFAULT_OAUTH_CLIENT_ID'], ''),
34
- defaultOAuthClientSecret: envOr(['FRAIM_DEFAULT_OAUTH_CLIENT_SECRET'], ''),
35
- prodOAuthClientId: envOr(['PROD_FRAIM_DEFAULT_OAUTH_CLIENT_ID'], ''),
36
- prodOAuthClientSecret: envOr(['PROD_FRAIM_DEFAULT_OAUTH_CLIENT_SECRET'], ''),
37
- identityCollection: config.database?.identityCollection || 'Identity',
38
- executiveCollection: config.database?.executiveCollection || 'Executive',
39
- newsletterTitle: config.marketing?.newsletterTitle || 'Weekly Update',
40
- newsletterCtaText: config.marketing?.newsletterCtaText || 'Learn More',
41
- newsletterUrl: config.marketing?.newsletterUrl || envOr(['FRAIM_NEWSLETTER_URL'], ''),
42
- issueRepoUrl: config.git.url || `https://github.com/${config.git.repoOwner}/${config.git.repoName}.git`,
43
- identityTokensCollection: config.database?.tokensCollection || 'Tokens',
44
- webAppUrl: config.marketing?.websiteUrl || envOr(['FRAIM_WEB_APP_URL'], 'http://localhost:3000'),
45
- chatUrl: config.marketing?.chatUrl || envOr(['FRAIM_CHAT_URL'], ''),
46
- azure: {
47
- prodAppName: envOr(['FRAIM_AZURE_PROD_APP_NAME'], 'fraim-app-prod'),
48
- prodResourceGroup: envOr(['FRAIM_AZURE_PROD_RESOURCE_GROUP'], 'fraim-prod-rg'),
49
- preprodAppName: envOr(['FRAIM_AZURE_PREPROD_APP_NAME'], 'fraim-app-pre-prod'),
50
- preprodResourceGroup: envOr(['FRAIM_AZURE_PREPROD_RESOURCE_GROUP'], 'fraim-pre-prod-rg'),
51
- localAppName: envOr(['FRAIM_AZURE_LOCAL_APP_NAME'], 'local'),
52
- localResourceGroup: envOr(['FRAIM_AZURE_LOCAL_RESOURCE_GROUP'], 'local')
53
- }
54
- };
55
-
56
- export function formatExecutiveDisplayName(executiveName: string): string {
57
- return config.persona.displayNamePattern.replace('{executiveName}', executiveName);
58
- }
59
-
60
- export function formatPersonaSignature(): string {
61
- return `With gratitude,\n${fraimConfig.personaThankYouSignature}\n${personaName} - Your AI Executive Assistant\n\n`;
62
- }
63
-