@the-agenticflow/openflows 0.1.2 → 0.1.5

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 (85) hide show
  1. package/.env.example +60 -0
  2. package/README.md +217 -0
  3. package/bin/LICENSE +21 -0
  4. package/bin/README.md +535 -0
  5. package/bin/agentflow-bin +0 -0
  6. package/bin/agentflow-dashboard-bin +0 -0
  7. package/bin/agentflow-doctor-bin +0 -0
  8. package/bin/agentflow-setup-bin +0 -0
  9. package/bin/openflows.js +285 -3
  10. package/bin/orchestration/agent/agents/forge.agent.md +110 -0
  11. package/bin/orchestration/agent/agents/lore.agent.md +27 -0
  12. package/bin/orchestration/agent/agents/nexus.agent.md +201 -0
  13. package/bin/orchestration/agent/agents/sentinel.agent.md +96 -0
  14. package/bin/orchestration/agent/agents/vessel.agent.md +38 -0
  15. package/bin/orchestration/agent/registry.json +10 -0
  16. package/bin/orchestration/agent/standards/CODING.md +22 -0
  17. package/bin/orchestration/agent/standards/REVIEW.md +15 -0
  18. package/bin/orchestration/agent/standards/SECURITY.md +72 -0
  19. package/bin/orchestration/plugin/commands/assign.md +45 -0
  20. package/bin/orchestration/plugin/commands/check-ci.md +26 -0
  21. package/bin/orchestration/plugin/commands/document-pr.md +32 -0
  22. package/bin/orchestration/plugin/commands/gate-approve.md +39 -0
  23. package/bin/orchestration/plugin/commands/handoff.md +75 -0
  24. package/bin/orchestration/plugin/commands/merge.md +47 -0
  25. package/bin/orchestration/plugin/commands/plan.md +66 -0
  26. package/bin/orchestration/plugin/commands/segment-done.md +50 -0
  27. package/bin/orchestration/plugin/commands/status-check.md +28 -0
  28. package/bin/orchestration/plugin/commands/status.md +94 -0
  29. package/bin/orchestration/plugin/commands/update-changelog.md +37 -0
  30. package/bin/orchestration/plugin/hooks/forge/post_write_lint.sh +76 -0
  31. package/bin/orchestration/plugin/hooks/forge/pre_bash_guard.sh +81 -0
  32. package/bin/orchestration/plugin/hooks/forge/pre_compact_handoff.sh +28 -0
  33. package/bin/orchestration/plugin/hooks/forge/pre_write_check.sh +77 -0
  34. package/bin/orchestration/plugin/hooks/forge/session_start.sh +59 -0
  35. package/bin/orchestration/plugin/hooks/forge/stop_require_artifact.sh +75 -0
  36. package/bin/orchestration/plugin/hooks/lore/session-start.sh +13 -0
  37. package/bin/orchestration/plugin/hooks/nexus/init-session.sh +23 -0
  38. package/bin/orchestration/plugin/hooks/nexus/log-decision.sh +10 -0
  39. package/bin/orchestration/plugin/hooks/sentinel/post_write_validate.sh +59 -0
  40. package/bin/orchestration/plugin/hooks/sentinel/pre_bash_readonly_guard.sh +107 -0
  41. package/bin/orchestration/plugin/hooks/sentinel/session_start.sh +74 -0
  42. package/bin/orchestration/plugin/hooks/sentinel/stop_require_eval.sh +57 -0
  43. package/bin/orchestration/plugin/hooks/vessel/log-merge-status.sh +7 -0
  44. package/bin/orchestration/plugin/hooks/vessel/session-start.sh +14 -0
  45. package/bin/orchestration/plugin/mcp/mcp.json.template +26 -0
  46. package/bin/orchestration/plugin/plugin.json +66 -0
  47. package/bin/orchestration/plugin/skills/forge-algorithmic-art.md +24 -0
  48. package/bin/orchestration/plugin/skills/forge-canvas-design.md +25 -0
  49. package/bin/orchestration/plugin/skills/forge-coding.md +161 -0
  50. package/bin/orchestration/plugin/skills/forge-frontend-design.md +30 -0
  51. package/bin/orchestration/plugin/skills/forge-mcp-builder.md +37 -0
  52. package/bin/orchestration/plugin/skills/forge-planning.md +102 -0
  53. package/bin/orchestration/plugin/skills/forge-skill-creator.md +25 -0
  54. package/bin/orchestration/plugin/skills/forge-web-artifacts-builder.md +29 -0
  55. package/bin/orchestration/plugin/skills/lore-brand-guidelines.md +33 -0
  56. package/bin/orchestration/plugin/skills/lore-changelog.md +69 -0
  57. package/bin/orchestration/plugin/skills/lore-doc-coauthoring.md +33 -0
  58. package/bin/orchestration/plugin/skills/lore-documentation.md +57 -0
  59. package/bin/orchestration/plugin/skills/lore-docx.md +20 -0
  60. package/bin/orchestration/plugin/skills/lore-pdf.md +20 -0
  61. package/bin/orchestration/plugin/skills/lore-pptx.md +23 -0
  62. package/bin/orchestration/plugin/skills/lore-theme-factory.md +20 -0
  63. package/bin/orchestration/plugin/skills/lore-xlsx.md +20 -0
  64. package/bin/orchestration/plugin/skills/nexus-doc-coauthoring.md +21 -0
  65. package/bin/orchestration/plugin/skills/nexus-internal-comms.md +28 -0
  66. package/bin/orchestration/plugin/skills/nexus-orchestration.md +63 -0
  67. package/bin/orchestration/plugin/skills/nexus-skill-creator.md +15 -0
  68. package/bin/orchestration/plugin/skills/nexus-slack-gif-creator.md +21 -0
  69. package/bin/orchestration/plugin/skills/nexus-triage.md +56 -0
  70. package/bin/orchestration/plugin/skills/nexus-xlsx.md +20 -0
  71. package/bin/orchestration/plugin/skills/sentinel-algorithmic-art.md +20 -0
  72. package/bin/orchestration/plugin/skills/sentinel-criteria.md +115 -0
  73. package/bin/orchestration/plugin/skills/sentinel-frontend-design.md +20 -0
  74. package/bin/orchestration/plugin/skills/sentinel-review.md +124 -0
  75. package/bin/orchestration/plugin/skills/sentinel-web-artifacts-builder.md +20 -0
  76. package/bin/orchestration/plugin/skills/sentinel-webapp-testing.md +34 -0
  77. package/bin/orchestration/plugin/skills/shared-claude-api.md +25 -0
  78. package/bin/orchestration/plugin/skills/vessel-ci-gate.md +68 -0
  79. package/bin/orchestration/plugin/skills/vessel-internal-comms.md +20 -0
  80. package/bin/orchestration/plugin/skills/vessel-mcp-builder.md +21 -0
  81. package/bin/orchestration/plugin/skills/vessel-merge-protocol.md +113 -0
  82. package/bin/orchestration/plugin/skills/vessel-pdf.md +20 -0
  83. package/bin/orchestration/plugin/skills/vessel-webapp-testing.md +34 -0
  84. package/package.json +12 -2
  85. package/scripts/install.js +212 -23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-agenticflow/openflows",
3
- "version": "0.1.2",
3
+ "version": "0.1.5",
4
4
  "description": "Autonomous AI development team — turns GitHub issues into working PRs",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -21,7 +21,10 @@
21
21
  "autonomous",
22
22
  "development",
23
23
  "agents",
24
- "github"
24
+ "github",
25
+ "claude",
26
+ "fireworks",
27
+ "anthropic"
25
28
  ],
26
29
  "author": "The AgenticFlow Team",
27
30
  "license": "MIT",
@@ -29,6 +32,12 @@
29
32
  "url": "https://github.com/The-AgenticFlow/AgentFlow/issues"
30
33
  },
31
34
  "homepage": "https://openflows.dev",
35
+ "files": [
36
+ "bin/",
37
+ "scripts/",
38
+ "README.md",
39
+ ".env.example"
40
+ ],
32
41
  "engines": {
33
42
  "node": ">=18.0.0"
34
43
  },
@@ -40,6 +49,7 @@
40
49
  "x64",
41
50
  "arm64"
42
51
  ],
52
+ "dependencies": {},
43
53
  "optionalDependencies": {
44
54
  "@openflows/linux-x64-gnu": "0.1.0",
45
55
  "@openflows/linux-x64-musl": "0.1.0",
@@ -1,16 +1,22 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Post-install script: downloads the correct pre-built binary for the current platform.
3
+ * Post-install script for @the-agenticflow/openflows
4
+ *
5
+ * This script:
6
+ * 1. Downloads the correct pre-built binary for the current platform
7
+ * 2. Installs mcp-proxy (required for GitHub MCP connectivity)
8
+ * 3. Verifies all dependencies are ready
4
9
  */
5
10
  const https = require('https');
6
11
  const http = require('http');
7
12
  const fs = require('fs');
8
13
  const path = require('path');
9
14
  const os = require('os');
10
- const { execSync } = require('child_process');
15
+ const { execSync, spawn } = require('child_process');
11
16
 
12
17
  const REPO = 'The-AgenticFlow/AgentFlow';
13
18
  const BIN_DIR = path.join(__dirname, '..', 'bin');
19
+ const POSTINSTALL_LOG = path.join(__dirname, '..', '.postinstall-done');
14
20
 
15
21
  function detectPlatform() {
16
22
  const platform = os.platform();
@@ -92,38 +98,182 @@ function extractTarGz(tarPath, destDir) {
92
98
  });
93
99
  }
94
100
 
101
+ /**
102
+ * Install mcp-proxy - required for GitHub MCP connectivity
103
+ *
104
+ * mcp-proxy is a Python tool from PyPI (sparfenyuk/mcp-proxy)
105
+ * It bridges stdio to HTTP MCP servers like GitHub Copilot's MCP endpoint.
106
+ *
107
+ * Strategy:
108
+ * 1. Check if mcp-proxy is already available
109
+ * 2. Install via uv (fast) or pipx (alternative)
110
+ * 3. Fall back to Docker mode instructions if Python tools unavailable
111
+ */
112
+ async function ensureMcpProxy() {
113
+ console.log(`[openflows] Checking mcp-proxy installation...`);
114
+
115
+ // Check if already installed
116
+ try {
117
+ execSync('which mcp-proxy', { stdio: 'pipe' });
118
+ console.log(`[openflows] ✓ mcp-proxy already installed`);
119
+ return true;
120
+ } catch {
121
+ // Not installed, proceed with installation
122
+ }
123
+
124
+ console.log(`[openflows] Installing mcp-proxy (required for GitHub MCP)...`);
125
+
126
+ // Try uv first (fastest)
127
+ try {
128
+ execSync('which uv', { stdio: 'pipe' });
129
+ console.log(`[openflows] Installing via uv...`);
130
+ execSync('uv tool install mcp-proxy', {
131
+ stdio: 'inherit',
132
+ timeout: 120000
133
+ });
134
+ console.log(`[openflows] ✓ mcp-proxy installed via uv`);
135
+ return true;
136
+ } catch (err) {
137
+ // uv failed or not available
138
+ }
139
+
140
+ // Try pipx as alternative
141
+ try {
142
+ execSync('which pipx', { stdio: 'pipe' });
143
+ console.log(`[openflows] Installing via pipx...`);
144
+ execSync('pipx install mcp-proxy', {
145
+ stdio: 'inherit',
146
+ timeout: 120000
147
+ });
148
+ console.log(`[openflows] ✓ mcp-proxy installed via pipx`);
149
+ return true;
150
+ } catch (err) {
151
+ // pipx failed or not available
152
+ }
153
+
154
+ // Try pip3 as last resort
155
+ try {
156
+ execSync('which pip3', { stdio: 'pipe' });
157
+ console.log(`[openflows] Installing via pip3...`);
158
+ execSync('pip3 install --user mcp-proxy', {
159
+ stdio: 'inherit',
160
+ timeout: 120000
161
+ });
162
+ console.log(`[openflows] ✓ mcp-proxy installed via pip3`);
163
+ return true;
164
+ } catch (err) {
165
+ // pip3 failed or not available
166
+ }
167
+
168
+ console.warn(`[openflows] ⚠ Could not install mcp-proxy automatically.`);
169
+ console.warn(`[openflows] Please install manually:`);
170
+ console.warn(`[openflows] uv tool install mcp-proxy`);
171
+ console.warn(`[openflows] Or use Docker mode:`);
172
+ console.warn(`[openflows] export GITHUB_MCP_TYPE=docker`);
173
+ return false;
174
+ }
175
+
176
+ /**
177
+ * Check if essential tools are available
178
+ */
179
+ function checkPrerequisites() {
180
+ const checks = [
181
+ { name: 'git', cmd: 'git --version' },
182
+ { name: 'node', cmd: 'node --version' },
183
+ ];
184
+
185
+ console.log(`[openflows] Checking prerequisites...`);
186
+
187
+ let allPassed = true;
188
+ for (const check of checks) {
189
+ try {
190
+ execSync(check.cmd, { stdio: 'pipe' });
191
+ console.log(`[openflows] ✓ ${check.name} available`);
192
+ } catch {
193
+ console.warn(`[openflows] ✗ ${check.name} not found - please install it`);
194
+ allPassed = false;
195
+ }
196
+ }
197
+
198
+ return allPassed;
199
+ }
200
+
95
201
  async function main() {
202
+ // Skip postinstall if already done (e.g., during npm link)
203
+ if (fs.existsSync(POSTINSTALL_LOG)) {
204
+ const age = Date.now() - fs.statSync(POSTINSTALL_LOG).mtimeMs;
205
+ if (age < 60000) { // Less than 1 minute old
206
+ console.log(`[openflows] Postinstall already completed, skipping...`);
207
+ return;
208
+ }
209
+ }
210
+
96
211
  const platform = detectPlatform();
97
- console.log(`[@the-agenticflow/openflows] Downloading binary for ${platform}...`);
212
+ console.log(``);
213
+ console.log(`╔══════════════════════════════════════════════╗`);
214
+ console.log(`║ OpenFlows Installation ║`);
215
+ console.log(`║ Autonomous AI Development Team ║`);
216
+ console.log(`╚══════════════════════════════════════════════╝`);
217
+ console.log(``);
218
+ console.log(`[openflows] Platform: ${platform}`);
98
219
 
99
220
  // Ensure bin directory exists
100
221
  if (!fs.existsSync(BIN_DIR)) {
101
222
  fs.mkdirSync(BIN_DIR, { recursive: true });
102
223
  }
103
224
 
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'));
225
+ // Get latest release tag with better error handling
226
+ let tag;
227
+ try {
228
+ tag = await new Promise((resolve, reject) => {
229
+ const req = https.get(`https://api.github.com/repos/${REPO}/releases/latest`, {
230
+ headers: {
231
+ 'User-Agent': 'openflows-npm-installer',
232
+ 'Accept': 'application/vnd.github.v3+json'
233
+ }
234
+ }, (res) => {
235
+ if (res.statusCode !== 200) {
236
+ reject(new Error(`GitHub API returned ${res.statusCode}`));
237
+ return;
117
238
  }
239
+ let data = '';
240
+ res.on('data', (chunk) => data += chunk);
241
+ res.on('end', () => {
242
+ try {
243
+ const json = JSON.parse(data);
244
+ if (!json.tag_name) {
245
+ reject(new Error('No tag_name in release response'));
246
+ } else {
247
+ resolve(json.tag_name);
248
+ }
249
+ } catch (parseErr) {
250
+ reject(new Error(`Failed to parse release info: ${parseErr.message}`));
251
+ }
252
+ });
118
253
  });
119
- }).on('error', reject);
120
- });
254
+ req.on('error', reject);
255
+ req.setTimeout(30000, () => {
256
+ req.destroy();
257
+ reject(new Error('GitHub API request timeout'));
258
+ });
259
+ });
260
+ } catch (apiErr) {
261
+ console.error(`[openflows] GitHub API error: ${apiErr.message}`);
262
+ console.error('[openflows] Falling back to latest known version: v0.1.3');
263
+ tag = 'v0.1.3';
264
+ }
121
265
 
122
266
  const archiveName = `openflows-${tag}-${platform}.tar.gz`;
123
267
  const downloadUrl = `https://github.com/${REPO}/releases/download/${tag}/${archiveName}`;
124
- const tmpFile = path.join(os.tmpdir(), archiveName);
268
+ // Use package's temp directory instead of system /tmp to avoid permission issues
269
+ const tmpDir = path.join(__dirname, '..', '.tmp');
270
+ if (!fs.existsSync(tmpDir)) {
271
+ fs.mkdirSync(tmpDir, { recursive: true });
272
+ }
273
+ const tmpFile = path.join(tmpDir, archiveName);
125
274
 
126
275
  try {
276
+ console.log(`[openflows] Downloading binary for ${platform}...`);
127
277
  await download(downloadUrl, tmpFile);
128
278
  await extractTarGz(tmpFile, BIN_DIR);
129
279
  } catch (err) {
@@ -131,8 +281,8 @@ async function main() {
131
281
  if (platform === 'x86_64-unknown-linux-gnu') {
132
282
  const muslArchiveName = `openflows-${tag}-x86_64-unknown-linux-musl.tar.gz`;
133
283
  const muslDownloadUrl = `https://github.com/${REPO}/releases/download/${tag}/${muslArchiveName}`;
134
- const muslTmpFile = path.join(os.tmpdir(), muslArchiveName);
135
- console.log(`[@the-agenticflow/openflows] Trying musl fallback...`);
284
+ const muslTmpFile = path.join(tmpDir, muslArchiveName);
285
+ console.log(`[openflows] Trying musl fallback...`);
136
286
  await download(muslDownloadUrl, muslTmpFile);
137
287
  await extractTarGz(muslTmpFile, BIN_DIR);
138
288
  fs.unlinkSync(muslTmpFile);
@@ -155,7 +305,46 @@ async function main() {
155
305
  if (fs.existsSync(tmpFile)) {
156
306
  fs.unlinkSync(tmpFile);
157
307
  }
158
- console.log(`[openflows] Installation complete!`);
308
+ // Clean up temp directory if empty
309
+ try {
310
+ if (fs.existsSync(tmpDir) && fs.readdirSync(tmpDir).length === 0) {
311
+ fs.rmdirSync(tmpDir);
312
+ }
313
+ } catch (cleanupErr) {
314
+ // Ignore cleanup errors
315
+ }
316
+
317
+ console.log(`[openflows] ✓ Binaries installed`);
318
+
319
+ // Install mcp-proxy
320
+ await ensureMcpProxy();
321
+
322
+ // Check prerequisites
323
+ checkPrerequisites();
324
+
325
+ // Mark postinstall as done
326
+ fs.writeFileSync(POSTINSTALL_LOG, new Date().toISOString());
327
+
328
+ console.log(``);
329
+ console.log(`╔══════════════════════════════════════════════╗`);
330
+ console.log(`║ Installation Complete! ║`);
331
+ console.log(`╚══════════════════════════════════════════════╝`);
332
+ console.log(``);
333
+ console.log(` Available commands:`);
334
+ console.log(` openflows - Start orchestration`);
335
+ console.log(` openflows-setup - Guided setup wizard`);
336
+ console.log(` openflows-dashboard - Live monitoring TUI`);
337
+ console.log(` openflows-doctor - Diagnostic checks`);
338
+ console.log(``);
339
+ console.log(` Quick start:`);
340
+ console.log(` 1. openflows-setup # Configure API keys`);
341
+ console.log(` 2. openflows # Start the autonomous team`);
342
+ console.log(``);
343
+ console.log(` Docs: https://openflows.dev`);
344
+ console.log(``);
159
345
  }
160
346
 
161
- main();
347
+ main().catch(err => {
348
+ console.error('[openflows] Installation failed:', err.message);
349
+ process.exit(1);
350
+ });