snow-flow 3.0.7 ā 3.0.9
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/dist/cli.js +7 -0
- package/dist/utils/snow-oauth.js +53 -16
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -3733,6 +3733,13 @@ SNOW_FLOW_STRATEGY=development
|
|
|
3733
3733
|
# Maximum number of agents
|
|
3734
3734
|
SNOW_FLOW_MAX_AGENTS=5
|
|
3735
3735
|
|
|
3736
|
+
# ===========================================
|
|
3737
|
+
# Claude Code API Integration (30 minutes)
|
|
3738
|
+
# ===========================================
|
|
3739
|
+
# API timeout for Claude Code integration - 30 minutes
|
|
3740
|
+
# This ensures Snow-Flow works smoothly with Claude Code's extended operation timeouts
|
|
3741
|
+
API_TIMEOUT_MS=1800000
|
|
3742
|
+
|
|
3736
3743
|
# ===========================================
|
|
3737
3744
|
# Timeout Configuration (v3.0.1+)
|
|
3738
3745
|
# ===========================================
|
package/dist/utils/snow-oauth.js
CHANGED
|
@@ -279,25 +279,62 @@ class ServiceNowOAuth {
|
|
|
279
279
|
console.log('š Please open the authorization URL in your browser...');
|
|
280
280
|
console.log('ā³ Waiting for OAuth callback...');
|
|
281
281
|
// Auto-open browser if possible
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
282
|
+
// Try to auto-open browser if not in headless environment
|
|
283
|
+
const isCodespaces = process.env.CODESPACES === 'true';
|
|
284
|
+
const isContainer = process.env.CONTAINER === 'true' || (0, fs_1.existsSync)('/.dockerenv');
|
|
285
|
+
const isHeadless = isCodespaces || isContainer || process.env.CI === 'true';
|
|
286
|
+
if (!isHeadless) {
|
|
287
|
+
try {
|
|
288
|
+
const { spawn } = require('child_process');
|
|
289
|
+
const authUrl = this.generateAuthUrl(this.credentials.instance, this.credentials.clientId, redirectUri);
|
|
290
|
+
let browserProcess;
|
|
291
|
+
// Try to open browser based on platform
|
|
292
|
+
if (process.platform === 'darwin') {
|
|
293
|
+
browserProcess = spawn('open', [authUrl], { detached: true, stdio: 'ignore' });
|
|
294
|
+
}
|
|
295
|
+
else if (process.platform === 'win32') {
|
|
296
|
+
browserProcess = spawn('cmd', ['/c', 'start', authUrl], { detached: true, stdio: 'ignore' });
|
|
297
|
+
}
|
|
298
|
+
else if (process.platform === 'linux') {
|
|
299
|
+
// Try multiple Linux browser openers
|
|
300
|
+
const openers = ['xdg-open', 'gnome-open', 'kde-open', 'sensible-browser'];
|
|
301
|
+
for (const opener of openers) {
|
|
302
|
+
try {
|
|
303
|
+
browserProcess = spawn(opener, [authUrl], { detached: true, stdio: 'ignore' });
|
|
304
|
+
break; // If successful, stop trying
|
|
305
|
+
}
|
|
306
|
+
catch (e) {
|
|
307
|
+
// Try next opener
|
|
308
|
+
continue;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
console.log('ā ļø Unknown OS:', process.platform);
|
|
314
|
+
}
|
|
315
|
+
// Prevent the spawn from keeping the process alive
|
|
316
|
+
if (browserProcess && browserProcess.unref) {
|
|
317
|
+
browserProcess.unref();
|
|
318
|
+
}
|
|
294
319
|
}
|
|
295
|
-
|
|
296
|
-
|
|
320
|
+
catch (err) {
|
|
321
|
+
// Silently fail - user can manually open URL
|
|
322
|
+
console.log('\nš Browser auto-open failed. Please manually copy and open the URL above.');
|
|
297
323
|
}
|
|
298
324
|
}
|
|
299
|
-
|
|
300
|
-
console.log('
|
|
325
|
+
else {
|
|
326
|
+
console.log('\nš³ Running in headless environment (Codespaces/Container/CI)');
|
|
327
|
+
console.log('š Please manually copy and open the authorization URL above in your browser.');
|
|
328
|
+
if (isCodespaces) {
|
|
329
|
+
console.log('\nš” TIP for GitHub Codespaces:');
|
|
330
|
+
console.log(' 1. Copy the authorization URL above');
|
|
331
|
+
console.log(' 2. Open it in a new browser tab');
|
|
332
|
+
console.log(' 3. After authorizing, you\'ll be redirected to localhost:3005');
|
|
333
|
+
console.log(' 4. Copy the FULL redirect URL from your browser');
|
|
334
|
+
console.log(' 5. Open a new Codespaces terminal and run:');
|
|
335
|
+
console.log(' curl "http://localhost:3005/callback?code=YOUR_CODE&state=YOUR_STATE"');
|
|
336
|
+
console.log(' 6. Or use port forwarding in Codespaces to make port 3005 accessible');
|
|
337
|
+
}
|
|
301
338
|
}
|
|
302
339
|
});
|
|
303
340
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snow-flow",
|
|
3
|
-
"version": "3.0.
|
|
4
|
-
"description": "Snow-Flow v3.0.
|
|
3
|
+
"version": "3.0.9",
|
|
4
|
+
"description": "Snow-Flow v3.0.9: CODESPACES & CONTAINER SUPPORT! Fixed OAuth authentication for GitHub Codespaces, Docker containers, and headless environments. Intelligent browser opening with fallback for all platforms (macOS, Windows, Linux). No more xdg-open crashes! Includes manual auth instructions for restricted environments. Plus all v3.0.8 features: Claude Code 30-min timeout, deployment fixes, universal verification. 100+ MCP tools for complete ServiceNow automation.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"bin": {
|