openagentflow 0.1.1 → 0.1.3

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 (3) hide show
  1. package/README.md +8 -8
  2. package/cli/index.js +29 -7
  3. package/package.json +13 -1
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="https://raw.githubusercontent.com/OpenAgentFlow/OpenAgentFlow/main/docs/assets/oaf-logo.svg" alt="OpenAgentFlow Logo" width="160"/>
2
+ <img src="https://raw.githubusercontent.com/OpenAgentFlow/OpenAgentFlow/master/docs/assets/oaf-logo.svg" alt="OpenAgentFlow Logo" width="160"/>
3
3
  </p>
4
4
 
5
5
  # OpenAgentFlow
@@ -11,13 +11,13 @@
11
11
  [![Target Runtime: LangGraph](https://img.shields.io/badge/runtime-LangGraph%20Python-orange.svg)](#multi-llm--runtime-integration)
12
12
  [![LLM Providers: Gemini | OpenAI | Anthropic](https://img.shields.io/badge/LLMs-Gemini%20%7C%20OpenAI%20%7C%20Anthropic-purple.svg)](#multi-llm--runtime-integration)
13
13
  [![VS Code Extension](https://img.shields.io/badge/VS%20Code-Syntax%20Support-007ACC.svg?logo=visualstudiocode)](https://marketplace.visualstudio.com/items?itemName=OpenAgentFlow.openagentflow-support)
14
- [![Documentation](https://img.shields.io/badge/docs-complete-blue.svg)](https://github.com/OpenAgentFlow/OpenAgentFlow/blob/main/docs/index.md)
14
+ [![Documentation](https://img.shields.io/badge/docs-complete-blue.svg)](https://github.com/OpenAgentFlow/OpenAgentFlow/blob/master/docs/index.md)
15
15
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
16
16
 
17
17
  > *What OpenAPI is for REST APIs, OpenAgentFlow (`.oaf`) is for AI agent workflows.*
18
18
 
19
19
  <p align="center">
20
- <img src="https://raw.githubusercontent.com/OpenAgentFlow/OpenAgentFlow/main/docs/assets/demo.gif" alt="OpenAgentFlow Demo" width="800"/>
20
+ <img src="https://raw.githubusercontent.com/OpenAgentFlow/OpenAgentFlow/master/docs/assets/demo.gif" alt="OpenAgentFlow Demo" width="800"/>
21
21
  </p>
22
22
 
23
23
  ### ⚡ The 60-Second Example
@@ -150,16 +150,16 @@ If you prefer creating workflows from scratch in your own workspace without clon
150
150
  oaf run my-workflow.oaf --input data.json
151
151
  ```
152
152
 
153
- > 📖 **For the full guide, see [Documentation](https://github.com/OpenAgentFlow/OpenAgentFlow/blob/main/docs/index.md)**.
153
+ > 📖 **For the full guide, see [Documentation](https://github.com/OpenAgentFlow/OpenAgentFlow/blob/master/docs/index.md)**.
154
154
 
155
155
  ---
156
156
 
157
157
  ## 📖 Documentation
158
158
 
159
159
  The complete documentation is available in our GitHub `docs/` directory, including:
160
- * **[Language Reference](https://github.com/OpenAgentFlow/OpenAgentFlow/blob/main/docs/language/oaf-language.md):** Complete `.oaf` syntax.
161
- * **[Formal Specs](https://github.com/OpenAgentFlow/OpenAgentFlow/blob/main/spec/SPEC.md):** EBNF grammar, semantic rules, and IR schema.
162
- * **[API & CLI Ref](https://github.com/OpenAgentFlow/OpenAgentFlow/blob/main/docs/cli/cli-reference.md):** Programmatic API and command-line flags.
160
+ * **[Language Reference](https://github.com/OpenAgentFlow/OpenAgentFlow/blob/master/docs/language/oaf-language.md):** Complete `.oaf` syntax.
161
+ * **[Formal Specs](https://github.com/OpenAgentFlow/OpenAgentFlow/blob/master/spec/SPEC.md):** EBNF grammar, semantic rules, and IR schema.
162
+ * **[API & CLI Ref](https://github.com/OpenAgentFlow/OpenAgentFlow/blob/master/docs/cli/cli-reference.md):** Programmatic API and command-line flags.
163
163
 
164
164
  ---
165
165
 
@@ -253,7 +253,7 @@ When compiling to LangGraph, the runtime automatically manages providers. You ca
253
253
 
254
254
  ## 🤝 Contributing
255
255
 
256
- We welcome contributions from developers, researchers, and engineers! Whether you want to pick up a [`good first issue`](https://github.com/OpenAgentFlow/openagentflow/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22), help build our planned Phase 5 target adapters (**Microsoft AutoGen** or **CrewAI**), or propose language enhancements, please check out our detailed [Contributing Guide](https://github.com/OpenAgentFlow/OpenAgentFlow/blob/main/CONTRIBUTING.md) to get started.
256
+ We welcome contributions from developers, researchers, and engineers! Whether you want to pick up a [`good first issue`](https://github.com/OpenAgentFlow/openagentflow/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22), help build our planned Phase 5 target adapters (**Microsoft AutoGen** or **CrewAI**), or propose language enhancements, please check out our detailed [Contributing Guide](https://github.com/OpenAgentFlow/OpenAgentFlow/blob/master/CONTRIBUTING.md) to get started.
257
257
 
258
258
  ---
259
259
 
package/cli/index.js CHANGED
@@ -17,8 +17,9 @@
17
17
  * langgraph Generate executable LangGraph Python code
18
18
  */
19
19
 
20
- import { readFileSync, writeFileSync, existsSync, unlinkSync } from 'fs';
20
+ import { readFileSync, writeFileSync, existsSync, unlinkSync, realpathSync } from 'fs';
21
21
  import { resolve, basename, join } from 'path';
22
+ import { fileURLToPath } from 'url';
22
23
  import { execSync, spawn } from 'child_process';
23
24
  import os from 'os';
24
25
  import { Compiler } from '../compiler/compiler.js';
@@ -456,17 +457,27 @@ function cmdRun(filePath, flags, positional = []) {
456
457
  }
457
458
  }
458
459
 
459
- function getPythonCommand() {
460
+ export function getPythonCommand() {
460
461
  if (process.env.VIRTUAL_ENV) {
461
462
  const venvWin = join(process.env.VIRTUAL_ENV, 'Scripts', 'python.exe');
462
463
  const venvPosix = join(process.env.VIRTUAL_ENV, 'bin', 'python');
463
464
  if (existsSync(venvWin)) return venvWin;
464
465
  if (existsSync(venvPosix)) return venvPosix;
465
466
  }
466
- const localWin = join(process.cwd(), '.venv', 'Scripts', 'python.exe');
467
- const localPosix = join(process.cwd(), '.venv', 'bin', 'python');
468
- if (existsSync(localWin)) return localWin;
469
- if (existsSync(localPosix)) return localPosix;
467
+ for (const venvDir of ['.venv', 'venv']) {
468
+ const localWin = join(process.cwd(), venvDir, 'Scripts', 'python.exe');
469
+ const localPosix = join(process.cwd(), venvDir, 'bin', 'python');
470
+ if (existsSync(localWin)) return localWin;
471
+ if (existsSync(localPosix)) return localPosix;
472
+ }
473
+ for (const cmd of ['python3', 'python']) {
474
+ try {
475
+ execSync(`${cmd} --version`, { stdio: 'ignore' });
476
+ return cmd;
477
+ } catch (e) {
478
+ // try next
479
+ }
480
+ }
470
481
  return 'python';
471
482
  }
472
483
 
@@ -577,4 +588,15 @@ function main() {
577
588
  }
578
589
  }
579
590
 
580
- main();
591
+ let isMain = false;
592
+ try {
593
+ if (process.argv[1]) {
594
+ const argPath = realpathSync(resolve(process.argv[1]));
595
+ const modPath = realpathSync(resolve(fileURLToPath(import.meta.url)));
596
+ isMain = argPath === modPath;
597
+ }
598
+ } catch (e) {}
599
+
600
+ if (isMain) {
601
+ main();
602
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openagentflow",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
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",
@@ -37,6 +37,18 @@
37
37
  "openagentflow"
38
38
  ],
39
39
  "license": "MIT",
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "git+https://github.com/OpenAgentFlow/OpenAgentFlow.git"
43
+ },
44
+ "bugs": {
45
+ "url": "https://github.com/OpenAgentFlow/OpenAgentFlow/issues"
46
+ },
47
+ "homepage": "https://github.com/OpenAgentFlow/OpenAgentFlow#readme",
48
+ "publishConfig": {
49
+ "access": "public",
50
+ "provenance": true
51
+ },
40
52
  "engines": {
41
53
  "node": ">=18.0.0"
42
54
  }