agentic-factory-bridge 1.0.1 → 1.0.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.
- package/bin/cli.js +3 -3
- package/bridge.js +12 -4
- package/package.json +2 -3
package/bin/cli.js
CHANGED
|
@@ -126,7 +126,7 @@ async function setup() {
|
|
|
126
126
|
console.log('');
|
|
127
127
|
console.log(' Next steps:');
|
|
128
128
|
console.log(' 1. Run: agentic-factory-bridge start');
|
|
129
|
-
console.log(' 2. Open https://atos-agentic-factory.onrender.com');
|
|
129
|
+
console.log(' 2. Open https://atos-agentic-factory-qzwe.onrender.com');
|
|
130
130
|
console.log(' 3. Click "Refresh detection" on the OpenCode page');
|
|
131
131
|
console.log('');
|
|
132
132
|
}
|
|
@@ -202,7 +202,7 @@ async function status() {
|
|
|
202
202
|
function checkCommand(cmd) {
|
|
203
203
|
return new Promise((resolve) => {
|
|
204
204
|
const check = process.platform === 'win32' ? 'where' : 'which';
|
|
205
|
-
const proc = spawn(check, [cmd], { stdio: ['pipe', 'pipe', 'pipe'], shell:
|
|
205
|
+
const proc = spawn(check, [cmd], { stdio: ['pipe', 'pipe', 'pipe'], shell: true });
|
|
206
206
|
proc.on('close', (code) => resolve(code === 0));
|
|
207
207
|
proc.on('error', () => resolve(false));
|
|
208
208
|
});
|
|
@@ -213,7 +213,7 @@ function runCommand(cmd, args, timeout) {
|
|
|
213
213
|
const proc = spawn(cmd, args, {
|
|
214
214
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
215
215
|
timeout,
|
|
216
|
-
shell:
|
|
216
|
+
shell: true,
|
|
217
217
|
});
|
|
218
218
|
let stdout = '';
|
|
219
219
|
let stderr = '';
|
package/bridge.js
CHANGED
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
const express = require('express');
|
|
32
32
|
const cors = require('cors');
|
|
33
33
|
const crypto = require('crypto');
|
|
34
|
-
const { v4: uuidv4 } = require('uuid');
|
|
35
34
|
const { spawn } = require('child_process');
|
|
36
35
|
const http = require('http');
|
|
37
36
|
const https = require('https');
|
|
@@ -51,7 +50,7 @@ const OPENCODE_PATH = process.env.OPENCODE_PATH || 'opencode';
|
|
|
51
50
|
const BRIDGE_SECRET = process.env.BRIDGE_SECRET || crypto.randomBytes(32).toString('hex');
|
|
52
51
|
const CORS_ORIGIN =
|
|
53
52
|
process.env.BRIDGE_CORS_ORIGIN ||
|
|
54
|
-
'http://localhost:4200,https://atos-agentic-factory.onrender.com';
|
|
53
|
+
'http://localhost:4200,https://atos-agentic-factory.onrender.com,https://atos-agentic-factory-qzwe.onrender.com';
|
|
55
54
|
|
|
56
55
|
// Rate limiting configuration
|
|
57
56
|
const RATE_LIMITS = {
|
|
@@ -298,6 +297,15 @@ function runOpenCode(prompt, model) {
|
|
|
298
297
|
const app = express();
|
|
299
298
|
|
|
300
299
|
const allowedOrigins = CORS_ORIGIN.split(',').map((o) => o.trim());
|
|
300
|
+
|
|
301
|
+
// Private Network Access (Chrome 94+) — handle preflight BEFORE cors middleware
|
|
302
|
+
app.use((req, res, next) => {
|
|
303
|
+
if (req.method === 'OPTIONS' && req.headers['access-control-request-private-network']) {
|
|
304
|
+
res.set('Access-Control-Allow-Private-Network', 'true');
|
|
305
|
+
}
|
|
306
|
+
next();
|
|
307
|
+
});
|
|
308
|
+
|
|
301
309
|
app.use(
|
|
302
310
|
cors({
|
|
303
311
|
origin: (origin, callback) => {
|
|
@@ -309,7 +317,7 @@ app.use(
|
|
|
309
317
|
}),
|
|
310
318
|
);
|
|
311
319
|
|
|
312
|
-
// Private Network Access
|
|
320
|
+
// Private Network Access — also set on regular responses
|
|
313
321
|
app.use((_req, res, next) => {
|
|
314
322
|
res.set('Access-Control-Allow-Private-Network', 'true');
|
|
315
323
|
next();
|
|
@@ -503,7 +511,7 @@ function checkCommandExists(command) {
|
|
|
503
511
|
const versionProc = spawn(command, ['--version'], {
|
|
504
512
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
505
513
|
timeout: 10000,
|
|
506
|
-
shell:
|
|
514
|
+
shell: true,
|
|
507
515
|
});
|
|
508
516
|
let versionOut = '';
|
|
509
517
|
versionProc.stdout.on('data', (d) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-factory-bridge",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Local bridge for Atos Agentic Factory — connects the marketplace to OpenCode CLI on your machine",
|
|
5
5
|
"main": "bridge.js",
|
|
6
6
|
"bin": {
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"express": "^4.21.0",
|
|
24
|
-
"cors": "^2.8.5"
|
|
25
|
-
"uuid": "^9.0.0"
|
|
24
|
+
"cors": "^2.8.5"
|
|
26
25
|
},
|
|
27
26
|
"engines": {
|
|
28
27
|
"node": ">=18.0.0"
|