fraim-framework 2.0.100 → 2.0.102

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/index.js CHANGED
@@ -1,85 +1,85 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * FRAIM Framework - Smart Entry Point
5
- * This file handles both production (dist/) and development (src/) environments.
6
- */
7
-
8
- const path = require('path');
9
- const fs = require('fs');
10
- const { spawnSync } = require('child_process');
11
-
12
- /**
13
- * Runs the CLI using either the compiled JS or the source TS via tsx
14
- */
15
- function runCLI() {
16
- const distPath = path.join(__dirname, 'dist', 'src', 'cli', 'fraim.js');
17
- const srcPath = path.join(__dirname, 'src', 'cli', 'fraim.ts');
18
-
19
- // 1. Check if we have a compiled version (Production / CI)
20
- if (fs.existsSync(distPath)) {
21
- require(distPath);
22
- return;
23
- }
24
-
25
- // 2. Explicitly fail in production if dist/ is missing
26
- if (process.env.NODE_ENV === 'production') {
27
- console.error('❌ FRAIM Error: Production build (dist/) not found.');
28
- console.error('In production environments, you must run the compiled version.');
29
- console.error(`Expected: ${distPath}`);
30
- process.exit(1);
31
- }
32
-
33
- // 3. Fallback to source version using tsx (Development)
34
- if (fs.existsSync(srcPath)) {
35
- // We use spawnSync to run tsx so we don't have to require it in memory
36
- // if it's not needed, and it handles the process arguments correctly.
37
- //
38
- // IMPORTANT FIX: Directory names with spaces and dashes (e.g., "FRAIM - Issue 166")
39
- // cause argument parsing issues on Windows when shell: true is used.
40
- // Without quoting, a path like "C:\...\FRAIM - Issue 166\src\cli\fraim.ts" gets
41
- // split into multiple arguments, with the dash interpreted as a command flag,
42
- // resulting in "error: unknown command '-'".
43
- //
44
- // Solution: On Windows with shell: true, quote paths containing spaces.
45
- // On Unix with shell: false, pass the path unquoted (spawnSync handles it correctly).
46
- const isWindows = process.platform === 'win32';
47
-
48
- // On Windows with shell, quote paths with spaces to prevent shell misinterpretation
49
- // On Unix without shell, pass path as-is (spawnSync handles spaces correctly)
50
- const processedSrcPath = (isWindows && srcPath.includes(' '))
51
- ? `"${srcPath}"`
52
- : srcPath;
53
-
54
- const result = spawnSync(
55
- 'npx',
56
- ['tsx', processedSrcPath, ...process.argv.slice(2)],
57
- {
58
- stdio: 'inherit',
59
- shell: isWindows, // Windows needs shell for npx, Unix doesn't
60
- windowsHide: true
61
- }
62
- );
63
- process.exit(result.status || 0);
64
- }
65
-
66
- console.error('❌ FRAIM Error: Could not find CLI entry point.');
67
- console.error('Expected one of:');
68
- console.error(` - ${distPath}`);
69
- console.error(` - ${srcPath}`);
70
- process.exit(1);
71
- }
72
-
73
- // Global programmatic exports
74
- module.exports = {
75
- FRAIM_INFO: {
76
- name: 'FRAIM',
77
- version: '2.0.98',
78
- repository: 'https://github.com/mathursrus/FRAIM'
79
- }
80
- };
81
-
82
- // If this file is run directly (via npx or global link), run the CLI
83
- if (require.main === module) {
84
- runCLI();
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * FRAIM Framework - Smart Entry Point
5
+ * This file handles both production (dist/) and development (src/) environments.
6
+ */
7
+
8
+ const path = require('path');
9
+ const fs = require('fs');
10
+ const { spawnSync } = require('child_process');
11
+
12
+ /**
13
+ * Runs the CLI using either the compiled JS or the source TS via tsx
14
+ */
15
+ function runCLI() {
16
+ const distPath = path.join(__dirname, 'dist', 'src', 'cli', 'fraim.js');
17
+ const srcPath = path.join(__dirname, 'src', 'cli', 'fraim.ts');
18
+
19
+ // 1. Check if we have a compiled version (Production / CI)
20
+ if (fs.existsSync(distPath)) {
21
+ require(distPath);
22
+ return;
23
+ }
24
+
25
+ // 2. Explicitly fail in production if dist/ is missing
26
+ if (process.env.NODE_ENV === 'production') {
27
+ console.error('❌ FRAIM Error: Production build (dist/) not found.');
28
+ console.error('In production environments, you must run the compiled version.');
29
+ console.error(`Expected: ${distPath}`);
30
+ process.exit(1);
31
+ }
32
+
33
+ // 3. Fallback to source version using tsx (Development)
34
+ if (fs.existsSync(srcPath)) {
35
+ // We use spawnSync to run tsx so we don't have to require it in memory
36
+ // if it's not needed, and it handles the process arguments correctly.
37
+ //
38
+ // IMPORTANT FIX: Directory names with spaces and dashes (e.g., "FRAIM - Issue 166")
39
+ // cause argument parsing issues on Windows when shell: true is used.
40
+ // Without quoting, a path like "C:\...\FRAIM - Issue 166\src\cli\fraim.ts" gets
41
+ // split into multiple arguments, with the dash interpreted as a command flag,
42
+ // resulting in "error: unknown command '-'".
43
+ //
44
+ // Solution: On Windows with shell: true, quote paths containing spaces.
45
+ // On Unix with shell: false, pass the path unquoted (spawnSync handles it correctly).
46
+ const isWindows = process.platform === 'win32';
47
+
48
+ // On Windows with shell, quote paths with spaces to prevent shell misinterpretation
49
+ // On Unix without shell, pass path as-is (spawnSync handles spaces correctly)
50
+ const processedSrcPath = (isWindows && srcPath.includes(' '))
51
+ ? `"${srcPath}"`
52
+ : srcPath;
53
+
54
+ const result = spawnSync(
55
+ 'npx',
56
+ ['tsx', processedSrcPath, ...process.argv.slice(2)],
57
+ {
58
+ stdio: 'inherit',
59
+ shell: isWindows, // Windows needs shell for npx, Unix doesn't
60
+ windowsHide: true
61
+ }
62
+ );
63
+ process.exit(result.status || 0);
64
+ }
65
+
66
+ console.error('❌ FRAIM Error: Could not find CLI entry point.');
67
+ console.error('Expected one of:');
68
+ console.error(` - ${distPath}`);
69
+ console.error(` - ${srcPath}`);
70
+ process.exit(1);
71
+ }
72
+
73
+ // Global programmatic exports
74
+ module.exports = {
75
+ FRAIM_INFO: {
76
+ name: 'FRAIM',
77
+ version: '2.0.98',
78
+ repository: 'https://github.com/mathursrus/FRAIM'
79
+ }
80
+ };
81
+
82
+ // If this file is run directly (via npx or global link), run the CLI
83
+ if (require.main === module) {
84
+ runCLI();
85
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fraim-framework",
3
- "version": "2.0.100",
3
+ "version": "2.0.102",
4
4
  "description": "FRAIM v2: Framework for Rigor-based AI Management - Transform from solo developer to AI manager orchestrating production-ready code with enterprise-grade discipline",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -16,9 +16,10 @@
16
16
  "test-all": "npm run test && npm run test:isolated && npm run test:ui",
17
17
  "test": "node scripts/test-with-server.js",
18
18
  "test:isolated": "npx tsx --test --test-reporter=spec tests/isolated/test-*.ts",
19
- "test:smoke": "node scripts/test-with-server.js tests/test-*.ts --tags=smoke",
19
+ "test:smoke": "node scripts/test-with-server.js --tags=smoke",
20
20
  "test:stripe": "node scripts/test-with-server.js tests/test-stripe-payment-complete.ts",
21
21
  "test:stripe:ui": "playwright test tests/ui/test-payment-ui.spec.ts",
22
+ "test:perf": "node scripts/test-with-server.js tests/performance/analytics-perf.ts",
22
23
  "test:ui": "playwright test",
23
24
  "test:ui:headed": "playwright test --headed",
24
25
  "start:fraim": "tsx src/fraim-mcp-server.ts",
@@ -26,6 +27,7 @@
26
27
  "serve:website": "node fraim-pro/serve.js",
27
28
  "watch:fraimlogs": "tsx scripts/watch-fraim-logs.ts > prodlogs.log 2>&1",
28
29
  "manage-keys": "tsx scripts/fraim/manage-keys.ts",
30
+ "manage-teams": "tsx scripts/fraim/manage-teams.ts",
29
31
  "partner-discounts": "tsx scripts/fraim/manage-partner-discounts.ts",
30
32
  "fix-key": "tsx scripts/fraim/fix-expired-key.ts",
31
33
  "setup-stripe-webhook": "tsx scripts/fraim/setup-stripe-webhook.ts",
@@ -89,6 +91,7 @@
89
91
  "@types/cors": "^2.8.19",
90
92
  "@types/express": "^5.0.6",
91
93
  "@types/node": "^20.0.0",
94
+ "@types/node-fetch": "^2.6.13",
92
95
  "@types/prompts": "^2.4.9",
93
96
  "@types/semver": "^7.7.1",
94
97
  "fast-glob": "^3.3.3",
@@ -119,6 +122,7 @@
119
122
  "access": "public"
120
123
  },
121
124
  "dependencies": {
125
+ "@octokit/rest": "^22.0.1",
122
126
  "adm-zip": "^0.5.16",
123
127
  "axios": "^1.7.0",
124
128
  "chalk": "4.1.2",
@@ -128,6 +132,7 @@
128
132
  "express": "^5.2.1",
129
133
  "mongodb": "^7.0.0",
130
134
  "node-edge-tts": "^1.2.10",
135
+ "nodemailer": "^8.0.3",
131
136
  "prompts": "^2.4.2",
132
137
  "resend": "^6.9.3",
133
138
  "semver": "^7.7.4",