fraim-framework 2.0.98 → 2.0.100

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/bin/fraim.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  /**
4
4
  * FRAIM Framework CLI Entry Point
@@ -5,15 +5,13 @@ const fs_1 = require("fs");
5
5
  const path_1 = require("path");
6
6
  class WorkflowParser {
7
7
  static extractMetadataBlock(content) {
8
- // Allow leading comments and whitespace before frontmatter
9
- const frontmatterMatch = content.match(/^[\s\S]*?---\r?\n([\s\S]+?)\r?\n---/);
8
+ const frontmatterMatch = content.match(/^---\r?\n([\s\S]+?)\r?\n---/);
10
9
  if (frontmatterMatch) {
11
10
  try {
12
- const startIndex = frontmatterMatch.index || 0;
13
11
  return {
14
12
  state: 'valid',
15
13
  metadata: JSON.parse(frontmatterMatch[1]),
16
- bodyStartIndex: startIndex + frontmatterMatch[0].length
14
+ bodyStartIndex: frontmatterMatch[0].length
17
15
  };
18
16
  }
19
17
  catch {
@@ -109,7 +107,7 @@ class WorkflowParser {
109
107
  overview = contentAfterMetadata;
110
108
  }
111
109
  const phases = new Map();
112
- const phaseSections = restOfContent.split(/^##\s+Phase:\s*/im);
110
+ const phaseSections = restOfContent.split(/^##\s+Phase:\s+/m);
113
111
  if (!metadata.phases) {
114
112
  metadata.phases = {};
115
113
  }
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  /**
4
4
  * FRAIM Framework - Smart Entry Point
@@ -22,7 +22,15 @@ function runCLI() {
22
22
  return;
23
23
  }
24
24
 
25
- // 2. Fallback to source version using tsx (Development)
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)
26
34
  if (fs.existsSync(srcPath)) {
27
35
  // We use spawnSync to run tsx so we don't have to require it in memory
28
36
  // if it's not needed, and it handles the process arguments correctly.
@@ -66,7 +74,7 @@ function runCLI() {
66
74
  module.exports = {
67
75
  FRAIM_INFO: {
68
76
  name: 'FRAIM',
69
- version: '2.0.93',
77
+ version: '2.0.98',
70
78
  repository: 'https://github.com/mathursrus/FRAIM'
71
79
  }
72
80
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fraim-framework",
3
- "version": "2.0.98",
3
+ "version": "2.0.100",
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": {
@@ -34,8 +34,12 @@
34
34
  "fraim:sync": "node index.js sync --local",
35
35
  "postinstall": "fraim sync --skip-updates || echo 'FRAIM setup skipped.'",
36
36
  "prepublishOnly": "npm run build",
37
- "release": "npm version patch && npm publish",
38
- "validate:registry": "tsx scripts/verify-registry-paths.ts && npm run validate:jobs && npm run validate:skills && npm run validate:platform-agnostic && npm run validate:template-namespaces && npm run validate:config-fallbacks && npm run validate:bootstrap-config-coverage && npm run validate:provider-action-mappings && npm run validate:fidelity && npm run validate:config-tokens && npm run validate:brain-mapping && npm run validate:template-syntax",
37
+ "release": "npm version patch && npm run publish-both",
38
+ "publish-both": "node scripts/publish-both.js",
39
+ "publish-fraim-only": "node scripts/publish-fraim.js",
40
+ "publish-both-manual": "node scripts/publish-both.js",
41
+ "validate:registry": "tsx scripts/verify-registry-paths.ts && npm run validate:jobs && npm run validate:skills && npm run validate:registry-references && npm run validate:platform-agnostic && npm run validate:template-namespaces && npm run validate:config-fallbacks && npm run validate:bootstrap-config-coverage && npm run validate:provider-action-mappings && npm run validate:fidelity && npm run validate:config-tokens && npm run validate:brain-mapping && npm run validate:template-syntax",
42
+ "validate:registry-references": "tsx scripts/validate-registry-references.ts",
39
43
  "validate:brain-mapping": "tsx scripts/validate-brain-mapping.ts",
40
44
  "validate:fraim-pro-assets": "tsx scripts/validate-fraim-pro-assets.ts",
41
45
  "validate:jobs": "tsx scripts/validate-jobs.ts",
@@ -1,83 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DeviceFlowService = void 0;
7
- const axios_1 = __importDefault(require("axios"));
8
- const chalk_1 = __importDefault(require("chalk"));
9
- class DeviceFlowService {
10
- constructor(config) {
11
- this.config = config;
12
- }
13
- /**
14
- * Start the Device Flow Login
15
- */
16
- async login() {
17
- console.log(chalk_1.default.blue('\nšŸ”— Starting Authentication...'));
18
- try {
19
- // 1. Request device and user codes
20
- const deviceCode = await this.requestDeviceCode();
21
- console.log(chalk_1.default.yellow('\nACTION REQUIRED:'));
22
- console.log(`1. Go to: ${chalk_1.default.cyan.underline(deviceCode.verification_uri)}`);
23
- console.log(`2. Enter the code: ${chalk_1.default.bold.green(deviceCode.user_code)}`);
24
- console.log(chalk_1.default.gray(`\nWaiting for authorization (expires in ${Math.floor(deviceCode.expires_in / 60)} minutes)...`));
25
- // 2. Poll for the access token
26
- const token = await this.pollForToken(deviceCode.device_code, deviceCode.interval);
27
- console.log(chalk_1.default.green('\nāœ… Authentication Successful!'));
28
- return token;
29
- }
30
- catch (error) {
31
- console.error(chalk_1.default.red(`\nāŒ Authentication failed: ${error.message}`));
32
- throw error;
33
- }
34
- }
35
- async requestDeviceCode() {
36
- const response = await axios_1.default.post(this.config.authUrl, {
37
- client_id: this.config.clientId,
38
- scope: this.config.scope
39
- }, {
40
- headers: { Accept: 'application/json' }
41
- });
42
- return response.data;
43
- }
44
- async pollForToken(deviceCode, interval) {
45
- let currentInterval = interval * 1000;
46
- return new Promise((resolve, reject) => {
47
- const poll = async () => {
48
- try {
49
- const response = await axios_1.default.post(this.config.tokenUrl, {
50
- client_id: this.config.clientId,
51
- device_code: deviceCode,
52
- grant_type: 'urn:ietf:params:oauth:grant-type:device_code'
53
- }, {
54
- headers: { Accept: 'application/json' }
55
- });
56
- if (response.data.access_token) {
57
- resolve(response.data.access_token);
58
- return;
59
- }
60
- if (response.data.error) {
61
- const error = response.data.error;
62
- if (error === 'authorization_pending') {
63
- // Keep polling
64
- setTimeout(poll, currentInterval);
65
- }
66
- else if (error === 'slow_down') {
67
- currentInterval += 5000;
68
- setTimeout(poll, currentInterval);
69
- }
70
- else {
71
- reject(new Error(response.data.error_description || error));
72
- }
73
- }
74
- }
75
- catch (error) {
76
- reject(error);
77
- }
78
- };
79
- setTimeout(poll, currentInterval);
80
- });
81
- }
82
- }
83
- exports.DeviceFlowService = DeviceFlowService;