openagentflow 0.1.3 → 0.1.4
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/cli/index.js +3 -2
- package/compiler/index.js +1 -0
- package/compiler/ir-generator.js +3 -1
- package/compiler/version.js +26 -0
- package/package.json +4 -1
package/cli/index.js
CHANGED
|
@@ -23,6 +23,7 @@ import { fileURLToPath } from 'url';
|
|
|
23
23
|
import { execSync, spawn } from 'child_process';
|
|
24
24
|
import os from 'os';
|
|
25
25
|
import { Compiler } from '../compiler/compiler.js';
|
|
26
|
+
import { VERSION } from '../compiler/version.js';
|
|
26
27
|
import { LangGraphAdapter } from '../adapters/langgraph/index.js';
|
|
27
28
|
import { resolveEnvHierarchy, setupAuth } from './env.js';
|
|
28
29
|
|
|
@@ -42,7 +43,7 @@ const colors = {
|
|
|
42
43
|
// ─── Helpers ───────────────────────────────────────────────────────────────────
|
|
43
44
|
|
|
44
45
|
function printBanner() {
|
|
45
|
-
console.log(`${colors.cyan}${colors.bold}OpenAgentFlow${colors.reset} ${colors.dim}
|
|
46
|
+
console.log(`${colors.cyan}${colors.bold}OpenAgentFlow${colors.reset} ${colors.dim}v${VERSION}${colors.reset}`);
|
|
46
47
|
console.log();
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -546,7 +547,7 @@ function main() {
|
|
|
546
547
|
}
|
|
547
548
|
|
|
548
549
|
if (rawArgs.includes('--version') || rawArgs.includes('-v')) {
|
|
549
|
-
console.log(
|
|
550
|
+
console.log(VERSION);
|
|
550
551
|
process.exit(0);
|
|
551
552
|
}
|
|
552
553
|
|
package/compiler/index.js
CHANGED
package/compiler/ir-generator.js
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAgentFlow Version Utility
|
|
3
|
+
*
|
|
4
|
+
* Dynamically loads and caches the current version from package.json
|
|
5
|
+
* to ensure a single source of truth across the compiler, CLI, and adapters.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { readFileSync } from 'fs';
|
|
9
|
+
import { resolve, dirname } from 'path';
|
|
10
|
+
import { fileURLToPath } from 'url';
|
|
11
|
+
|
|
12
|
+
let cachedVersion = null;
|
|
13
|
+
|
|
14
|
+
export function getVersion() {
|
|
15
|
+
if (cachedVersion !== null) return cachedVersion;
|
|
16
|
+
try {
|
|
17
|
+
const pkgPath = resolve(dirname(fileURLToPath(import.meta.url)), '..', 'package.json');
|
|
18
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
19
|
+
cachedVersion = pkg.version || '0.1.0';
|
|
20
|
+
} catch {
|
|
21
|
+
cachedVersion = '0.1.0';
|
|
22
|
+
}
|
|
23
|
+
return cachedVersion;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const VERSION = getVersion();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openagentflow",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "An open, portable specification for describing AI agent workflows using a human-readable text language.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "compiler/index.js",
|
|
@@ -24,6 +24,9 @@
|
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
26
|
"test": "node --test tests/**/*.test.js",
|
|
27
|
+
"test:update-snapshots": "node -e \"process.env.UPDATE_SNAPSHOTS='1'; import('./tests/snapshot.test.js')\"",
|
|
28
|
+
"preversion": "npm test",
|
|
29
|
+
"version": "npm run test:update-snapshots && git add tests/snapshots",
|
|
27
30
|
"oaf": "node cli/index.js"
|
|
28
31
|
},
|
|
29
32
|
"keywords": [
|