fraim-framework 2.0.54 → 2.0.55

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.
@@ -21,14 +21,25 @@ async function generateDigest(targetPath) {
21
21
  return crypto_1.default.createHash('md5').update(content).digest('hex');
22
22
  }
23
23
  if (stats.isDirectory()) {
24
- const files = fs_1.default.readdirSync(targetPath, { recursive: true });
25
- const hashes = [];
26
- for (const file of files.sort()) {
27
- const fullPath = path_1.default.join(targetPath, file);
28
- if (fs_1.default.statSync(fullPath).isFile()) {
29
- const content = fs_1.default.readFileSync(fullPath);
30
- hashes.push(crypto_1.default.createHash('md5').update(content).digest('hex'));
24
+ const getAllFiles = (dir) => {
25
+ const entries = fs_1.default.readdirSync(dir, { withFileTypes: true });
26
+ let files = [];
27
+ for (const entry of entries) {
28
+ const fullPath = path_1.default.join(dir, entry.name);
29
+ if (entry.isDirectory()) {
30
+ files = files.concat(getAllFiles(fullPath));
31
+ }
32
+ else {
33
+ files.push(fullPath);
34
+ }
31
35
  }
36
+ return files;
37
+ };
38
+ const allFiles = getAllFiles(targetPath);
39
+ const hashes = [];
40
+ for (const file of allFiles.sort()) {
41
+ const content = fs_1.default.readFileSync(file);
42
+ hashes.push(crypto_1.default.createHash('md5').update(content).digest('hex'));
32
43
  }
33
44
  return crypto_1.default.createHash('md5').update(hashes.join('')).digest('hex');
34
45
  }
@@ -58,9 +58,6 @@ const path_1 = require("path");
58
58
  (0, node_assert_1.default)((0, fs_1.existsSync)(phasePath), `Phase file ${phase} should exist`);
59
59
  });
60
60
  });
61
- (0, node_test_1.it)('should have output directory structure', () => {
62
- (0, node_assert_1.default)((0, fs_1.existsSync)(outputPath), 'Output directory should exist');
63
- });
64
61
  });
65
62
  (0, node_test_1.describe)('Template Content Validation', () => {
66
63
  (0, node_test_1.it)('should have properly structured customer persona template', () => {
package/index.js CHANGED
@@ -1,67 +1,56 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * FRAIM Framework - Main Entry Point
5
- * Framework for Rigor-based AI Management
6
- * Where humans become AI managers through rigorous methodology
4
+ * FRAIM Framework - Smart Entry Point
5
+ * This file handles both production (dist/) and development (src/) environments.
7
6
  */
8
7
 
9
8
  const path = require('path');
10
9
  const fs = require('fs');
10
+ const { spawnSync } = require('child_process');
11
11
 
12
- // Import the CLI
13
- const { main } = require('./bin/fraim.js');
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');
14
18
 
15
- // Export the main function for programmatic use
16
- module.exports = { main };
19
+ // 1. Check if we have a compiled version (Production / CI)
20
+ if (fs.existsSync(distPath)) {
21
+ require(distPath);
22
+ return;
23
+ }
17
24
 
18
- // If this file is run directly, execute the CLI
19
- if (require.main === module) {
20
- main();
25
+ // 2. Fallback to source version using tsx (Development)
26
+ if (fs.existsSync(srcPath)) {
27
+ // We use spawnSync to run tsx so we don't have to require it in memory
28
+ // if it's not needed, and it handles the process arguments correctly.
29
+ const result = spawnSync('npx', ['tsx', srcPath, ...process.argv.slice(2)], {
30
+ stdio: 'inherit',
31
+ shell: true,
32
+ windowsHide: true
33
+ });
34
+ process.exit(result.status || 0);
35
+ }
36
+
37
+ console.error('❌ FRAIM Error: Could not find CLI entry point.');
38
+ console.error('Expected one of:');
39
+ console.error(` - ${distPath}`);
40
+ console.error(` - ${srcPath}`);
41
+ process.exit(1);
21
42
  }
22
43
 
23
- // Framework information
24
- module.exports.FRAIM_INFO = {
25
- name: 'FRAIM',
26
- fullName: 'Framework for Rigor-based AI Management',
27
- version: '1.0.0',
28
- description: 'Where humans become AI managers through rigorous methodology',
29
- methodology: 'RIGOR',
30
- principles: [
31
- 'Reviews: Structured feedback and approval processes',
32
- 'Isolation: Agents don\'t interfere with each others\' work *unless* you explicitly ask them to',
33
- 'GitOps: Git as the single source of truth and the glue between you and your agents',
34
- 'Observability: Complete visibility into AI activities',
35
- 'Retrospectives: Continuous learning from mistakes and positive experiences'
36
- ],
37
- supportedAgents: ['cursor', 'claude', 'windsurf'],
38
- repository: 'https://github.com/mathursrus/FRAIM',
39
- note: 'All rules and workflows have been tested and proven in real project environments',
40
-
41
- // New structure information
42
- structure: {
43
- rules: '/rules/',
44
- workflows: '/workflows/',
45
- templates: '/templates/',
46
- scripts: '/scripts/',
47
- github: '/.github/'
48
- },
49
-
50
- // Centralized rules
51
- centralizedRules: [
52
- 'integrity-and-test-ethics.md',
53
- 'simplicity.md',
54
- 'architecture.md',
55
- 'continuous-learning.md',
56
- 'successful-debugging-patterns.md'
57
- ],
58
-
59
- // Workflow templates
60
- workflowTemplates: [
61
- 'design.md',
62
- 'implement.md',
63
- 'test.md',
64
- 'resolve.md',
65
- 'retrospect.md'
66
- ]
67
- };
44
+ // Global programmatic exports
45
+ module.exports = {
46
+ FRAIM_INFO: {
47
+ name: 'FRAIM',
48
+ version: '2.0.54',
49
+ repository: 'https://github.com/mathursrus/FRAIM'
50
+ }
51
+ };
52
+
53
+ // If this file is run directly (via npx or global link), run the CLI
54
+ if (require.main === module) {
55
+ runCLI();
56
+ }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "fraim-framework",
3
- "version": "2.0.54",
3
+ "version": "2.0.55",
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": {
7
- "fraim": "./bin/fraim.js",
8
- "fraim-setup": "./bin/fraim.js"
7
+ "fraim": "./index.js",
8
+ "fraim-setup": "./index.js"
9
9
  },
10
10
  "scripts": {
11
11
  "setup": "node setup.js",
@@ -19,8 +19,8 @@
19
19
  "watch:fraimlogs": "tsx scripts/watch-fraim-logs.ts",
20
20
  "manage-keys": "tsx scripts/fraim/manage-keys.ts",
21
21
  "view-signups": "tsx scripts/view-signups.ts",
22
- "fraim:init": "npm run build && node bin/fraim.js init",
23
- "fraim:sync": "node bin/fraim.js sync",
22
+ "fraim:init": "npm run build && node index.js init",
23
+ "fraim:sync": "node index.js sync",
24
24
  "postinstall": "fraim sync --skip-updates || echo 'FRAIM setup skipped.'",
25
25
  "prepublishOnly": "npm run build",
26
26
  "release": "npm version patch && npm publish",