@the-agenticflow/openflows 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.
package/README.md ADDED
@@ -0,0 +1,174 @@
1
+ # @the-agenticflow/openflows npm Package
2
+
3
+ ## Installation
4
+
5
+ ```bash
6
+ # Install globally
7
+ npm install -g @the-agenticflow/openflows
8
+
9
+ # Or use with npx (no install needed)
10
+ npx @the-agenticflow/openflows setup
11
+ ```
12
+
13
+ ## What Gets Installed
14
+
15
+ The post-install script (`scripts/install.js`) downloads platform-specific binaries from GitHub Releases:
16
+
17
+ 1. **Detects Platform**
18
+ - macOS: `x86_64-apple-darwin` or `aarch64-apple-darwin`
19
+ - Linux: `x86_64-unknown-linux-gnu/musl` or `aarch64-unknown-linux-gnu`
20
+
21
+ 2. **Downloads Binary**
22
+ - Fetches latest release from GitHub API
23
+ - Falls back to `v0.1.3` if API unavailable
24
+ - Downloads tarball containing:
25
+ - `agentflow` - Main orchestration binary
26
+ - `agentflow-setup` - Interactive TUI setup wizard
27
+ - `agentflow-dashboard` - Real-time monitoring TUI
28
+ - `agentflow-doctor` - System diagnostics tool
29
+ - `orchestration/` - Agent configurations
30
+ - `LICENSE` - MIT License
31
+
32
+ 3. **Extracts to Package**
33
+ - Extracts to `bin/` directory
34
+ - Renames binaries to `*-bin` for Node.js wrappers
35
+ - Sets executable permissions
36
+
37
+ ## Commands Available
38
+
39
+ ```bash
40
+ openflows # Start orchestration
41
+ openflows-setup # Run setup wizard
42
+ openflows-dashboard # Launch monitoring TUI
43
+ openflows-doctor # Run diagnostics
44
+ ```
45
+
46
+ ## Troubleshooting
47
+
48
+ ### Permission Denied (sudo install)
49
+
50
+ **Problem**: `EACCES: permission denied, open '/tmp/openflows-...'`
51
+
52
+ **Solution**: Fixed in v0.1.3 - install script now uses package-local `.tmp` directory instead of `/tmp`.
53
+
54
+ **Workaround for older versions**:
55
+ ```bash
56
+ # Install without sudo
57
+ mkdir -p ~/.npm-global
58
+ npm config set prefix '~/.npm-global'
59
+ echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
60
+ source ~/.bashrc
61
+ npm install -g @the-agenticflow/openflows
62
+ ```
63
+
64
+ ### Network Issues (DNS/API failures)
65
+
66
+ **Problem**: `getaddrinfo EAI_AGAIN api.github.com` or `undefined` in filename
67
+
68
+ **Solution**: Fixed in v0.1.3 - script now:
69
+ - Has timeout handling for GitHub API
70
+ - Falls back to known version `v0.1.3` if API fails
71
+ - Validates API response before using
72
+
73
+ **Manual fix**:
74
+ ```bash
75
+ # Build from source instead
76
+ git clone https://github.com/The-AgenticFlow/OpenFlows.git
77
+ cd OpenFlows
78
+ cargo build --release --bin agentflow-setup
79
+ sudo cp target/release/agentflow-setup /usr/local/bin/
80
+ ```
81
+
82
+ ### Binary Not Found
83
+
84
+ **Problem**: Command not found after install
85
+
86
+ **Solution**: Ensure `npm bin -g` is in your PATH
87
+ ```bash
88
+ # Check where global bins are installed
89
+ npm bin -g
90
+
91
+ # Add to PATH if needed
92
+ echo 'export PATH="$(npm bin -g):$PATH"' >> ~/.bashrc
93
+ source ~/.bashrc
94
+ ```
95
+
96
+ ## Publishing New Versions
97
+
98
+ When a new GitHub release is created:
99
+
100
+ 1. **Update package.json version**:
101
+ ```bash
102
+ cd packaging/npm
103
+ # Edit package.json: "version": "0.1.4"
104
+ ```
105
+
106
+ 2. **Update fallback version in install.js**:
107
+ ```javascript
108
+ // Line 126
109
+ tag = 'v0.1.4'; // Update fallback
110
+ ```
111
+
112
+ 3. **Test locally**:
113
+ ```bash
114
+ npm pack
115
+ npm install -g the-agenticflow-openflows-0.1.4.tgz
116
+ openflows-setup --help
117
+ ```
118
+
119
+ 4. **Publish to npm**:
120
+ ```bash
121
+ npm publish --access public
122
+ ```
123
+
124
+ ## Files Included in npm Package
125
+
126
+ ```
127
+ @the-agenticflow/openflows/
128
+ ├── package.json # Package metadata
129
+ ├── README.md # This file
130
+ ├── bin/
131
+ │ ├── openflows.js # Node.js wrapper
132
+ │ ├── openflows-setup.js # Node.js wrapper
133
+ │ ├── openflows-dashboard.js # Node.js wrapper
134
+ │ └── openflows-doctor.js # Node.js wrapper
135
+ └── scripts/
136
+ └── install.js # Post-install binary downloader
137
+ ```
138
+
139
+ ## Technical Details
140
+
141
+ ### Platform Detection Logic
142
+
143
+ ```javascript
144
+ // OS detection
145
+ darwin → apple-darwin
146
+ linux → unknown-linux-gnu OR unknown-linux-musl
147
+
148
+ // Architecture detection
149
+ x64 → x86_64
150
+ arm64 → aarch64
151
+
152
+ // Musl detection (Linux only)
153
+ ldd --version | grep -q musl → use musl variant
154
+ ```
155
+
156
+ ### Fallback Chain
157
+
158
+ 1. Try GitHub API for latest release
159
+ 2. If API fails → use hardcoded `v0.1.3`
160
+ 3. Download `gnu` variant
161
+ 4. If `gnu` fails on x86_64 Linux → try `musl` variant
162
+ 5. Extract and install
163
+
164
+ ### Binary Wrappers
165
+
166
+ Each command (`openflows`, `openflows-setup`, etc.) is a Node.js wrapper that:
167
+ - Calls the downloaded binary (`*-bin`)
168
+ - Passes through all arguments
169
+ - Inherits stdio for interactive TUI
170
+ - Exits with binary's exit code
171
+
172
+ ## License
173
+
174
+ MIT - see LICENSE file in downloaded tarball or GitHub repository.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  const { spawn } = require('child_process');
3
3
  const path = require('path');
4
- const binaryPath = path.join(__dirname, '..', 'bin', 'openflows-dashboard-bin');
4
+ const binaryPath = path.join(__dirname, '..', 'bin', 'agentflow-dashboard-bin');
5
5
  const proc = spawn(binaryPath, process.argv.slice(2), { stdio: 'inherit' });
6
6
  proc.on('exit', (code) => process.exit(code));
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  const { spawn } = require('child_process');
3
3
  const path = require('path');
4
- const binaryPath = path.join(__dirname, '..', 'bin', 'openflows-setup-bin');
4
+ const binaryPath = path.join(__dirname, '..', 'bin', 'agentflow-setup-bin');
5
5
  const proc = spawn(binaryPath, process.argv.slice(2), { stdio: 'inherit' });
6
6
  proc.on('exit', (code) => process.exit(code));
package/bin/openflows.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  const { spawn } = require('child_process');
3
3
  const path = require('path');
4
- const binaryPath = path.join(__dirname, '..', 'bin', 'openflows-bin');
4
+ const binaryPath = path.join(__dirname, '..', 'bin', 'agentflow-bin');
5
5
  const proc = spawn(binaryPath, process.argv.slice(2), { stdio: 'inherit' });
6
6
  proc.on('exit', (code) => process.exit(code));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-agenticflow/openflows",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Autonomous AI development team — turns GitHub issues into working PRs",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -16,18 +16,35 @@
16
16
  "type": "git",
17
17
  "url": "git+https://github.com/The-AgenticFlow/AgentFlow.git"
18
18
  },
19
- "keywords": ["ai", "autonomous", "development", "agents", "github"],
19
+ "keywords": [
20
+ "ai",
21
+ "autonomous",
22
+ "development",
23
+ "agents",
24
+ "github"
25
+ ],
20
26
  "author": "The AgenticFlow Team",
21
27
  "license": "MIT",
22
28
  "bugs": {
23
29
  "url": "https://github.com/The-AgenticFlow/AgentFlow/issues"
24
30
  },
25
31
  "homepage": "https://openflows.dev",
32
+ "files": [
33
+ "bin/",
34
+ "scripts/",
35
+ "README.md"
36
+ ],
26
37
  "engines": {
27
38
  "node": ">=18.0.0"
28
39
  },
29
- "os": ["darwin", "linux"],
30
- "cpu": ["x64", "arm64"],
40
+ "os": [
41
+ "darwin",
42
+ "linux"
43
+ ],
44
+ "cpu": [
45
+ "x64",
46
+ "arm64"
47
+ ],
31
48
  "optionalDependencies": {
32
49
  "@openflows/linux-x64-gnu": "0.1.0",
33
50
  "@openflows/linux-x64-musl": "0.1.0",
@@ -101,27 +101,55 @@ async function main() {
101
101
  fs.mkdirSync(BIN_DIR, { recursive: true });
102
102
  }
103
103
 
104
- // Get latest release tag
105
- const tag = await new Promise((resolve, reject) => {
106
- https.get(`https://api.github.com/repos/${REPO}/releases/latest`, {
107
- headers: { 'User-Agent': 'openflows-npm-installer' }
108
- }, (res) => {
109
- let data = '';
110
- res.on('data', (chunk) => data += chunk);
111
- res.on('end', () => {
112
- try {
113
- const json = JSON.parse(data);
114
- resolve(json.tag_name);
115
- } catch {
116
- reject(new Error('Failed to parse release info'));
104
+ // Get latest release tag with better error handling
105
+ let tag;
106
+ try {
107
+ tag = await new Promise((resolve, reject) => {
108
+ const req = https.get(`https://api.github.com/repos/${REPO}/releases/latest`, {
109
+ headers: {
110
+ 'User-Agent': 'openflows-npm-installer',
111
+ 'Accept': 'application/vnd.github.v3+json'
112
+ }
113
+ }, (res) => {
114
+ if (res.statusCode !== 200) {
115
+ reject(new Error(`GitHub API returned ${res.statusCode}`));
116
+ return;
117
117
  }
118
+ let data = '';
119
+ res.on('data', (chunk) => data += chunk);
120
+ res.on('end', () => {
121
+ try {
122
+ const json = JSON.parse(data);
123
+ if (!json.tag_name) {
124
+ reject(new Error('No tag_name in release response'));
125
+ } else {
126
+ resolve(json.tag_name);
127
+ }
128
+ } catch (parseErr) {
129
+ reject(new Error(`Failed to parse release info: ${parseErr.message}`));
130
+ }
131
+ });
118
132
  });
119
- }).on('error', reject);
120
- });
133
+ req.on('error', reject);
134
+ req.setTimeout(30000, () => {
135
+ req.destroy();
136
+ reject(new Error('GitHub API request timeout'));
137
+ });
138
+ });
139
+ } catch (apiErr) {
140
+ console.error(`[@the-agenticflow/openflows] GitHub API error: ${apiErr.message}`);
141
+ console.error('[@the-agenticflow/openflows] Falling back to latest known version: v0.1.3');
142
+ tag = 'v0.1.3';
143
+ }
121
144
 
122
145
  const archiveName = `openflows-${tag}-${platform}.tar.gz`;
123
146
  const downloadUrl = `https://github.com/${REPO}/releases/download/${tag}/${archiveName}`;
124
- const tmpFile = path.join(os.tmpdir(), archiveName);
147
+ // Use package's temp directory instead of system /tmp to avoid permission issues
148
+ const tmpDir = path.join(__dirname, '..', '.tmp');
149
+ if (!fs.existsSync(tmpDir)) {
150
+ fs.mkdirSync(tmpDir, { recursive: true });
151
+ }
152
+ const tmpFile = path.join(tmpDir, archiveName);
125
153
 
126
154
  try {
127
155
  await download(downloadUrl, tmpFile);
@@ -131,7 +159,7 @@ async function main() {
131
159
  if (platform === 'x86_64-unknown-linux-gnu') {
132
160
  const muslArchiveName = `openflows-${tag}-x86_64-unknown-linux-musl.tar.gz`;
133
161
  const muslDownloadUrl = `https://github.com/${REPO}/releases/download/${tag}/${muslArchiveName}`;
134
- const muslTmpFile = path.join(os.tmpdir(), muslArchiveName);
162
+ const muslTmpFile = path.join(tmpDir, muslArchiveName);
135
163
  console.log(`[@the-agenticflow/openflows] Trying musl fallback...`);
136
164
  await download(muslDownloadUrl, muslTmpFile);
137
165
  await extractTarGz(muslTmpFile, BIN_DIR);
@@ -155,6 +183,14 @@ async function main() {
155
183
  if (fs.existsSync(tmpFile)) {
156
184
  fs.unlinkSync(tmpFile);
157
185
  }
186
+ // Clean up temp directory if empty
187
+ try {
188
+ if (fs.existsSync(tmpDir) && fs.readdirSync(tmpDir).length === 0) {
189
+ fs.rmdirSync(tmpDir);
190
+ }
191
+ } catch (cleanupErr) {
192
+ // Ignore cleanup errors
193
+ }
158
194
  console.log(`[openflows] Installation complete!`);
159
195
  }
160
196