agent-window 1.4.2 → 1.4.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/package.json +1 -1
- package/src/bot.js +19 -1
- package/src/core/config.js +1 -0
package/package.json
CHANGED
package/src/bot.js
CHANGED
|
@@ -45,7 +45,7 @@ import config from './core/config.js';
|
|
|
45
45
|
const NODE_VERSION = process.version;
|
|
46
46
|
const NODE_MAJOR = parseInt(NODE_VERSION.slice(1).split('.')[0]);
|
|
47
47
|
|
|
48
|
-
if (NODE_MAJOR >= 23) {
|
|
48
|
+
if (ENFORCE_NODE_VERSION && NODE_MAJOR >= 23) {
|
|
49
49
|
console.error('\n' + '='.repeat(70));
|
|
50
50
|
console.error('⚠️ CRITICAL: Node.js v23+ is not compatible with AgentWindow!');
|
|
51
51
|
console.error('='.repeat(70));
|
|
@@ -61,9 +61,26 @@ if (NODE_MAJOR >= 23) {
|
|
|
61
61
|
console.error(' Using Homebrew: brew install node@20');
|
|
62
62
|
console.error(' 2. Reinstall global packages: npm install -g agent-window');
|
|
63
63
|
console.error(' 3. Restart your bots');
|
|
64
|
+
console.error('\n📖 To disable this check, add to your config.json:');
|
|
65
|
+
console.error(' { "workspace": { "enforceNodeVersion": false } }');
|
|
64
66
|
console.error('\n📖 See: https://nodejs.org/en/download/releases');
|
|
65
67
|
console.error('='.repeat(70) + '\n');
|
|
66
68
|
process.exit(1);
|
|
69
|
+
} else if (NODE_MAJOR >= 23) {
|
|
70
|
+
// Warning only (if check is disabled)
|
|
71
|
+
console.warn('\n' + '='.repeat(70));
|
|
72
|
+
console.warn('⚠️ WARNING: Node.js v23 detected!');
|
|
73
|
+
console.warn('='.repeat(70));
|
|
74
|
+
console.warn(`Current version: ${NODE_VERSION}`);
|
|
75
|
+
console.warn('Recommended versions: Node.js v18 LTS or v20 LTS');
|
|
76
|
+
console.warn('');
|
|
77
|
+
console.warn('⚠️ Node.js v23 may cause compatibility issues.');
|
|
78
|
+
console.warn('✅ Version check is disabled in config (enforceNodeVersion: false)');
|
|
79
|
+
console.warn(' Bot will continue, but issues may occur.');
|
|
80
|
+
console.warn('');
|
|
81
|
+
console.warn('To enable strict checking, remove "enforceNodeVersion: false" from config');
|
|
82
|
+
console.warn('Or install Node.js v20 LTS for best stability.');
|
|
83
|
+
console.warn('='.repeat(70) + '\n');
|
|
67
84
|
}
|
|
68
85
|
|
|
69
86
|
// Extract commonly used config values for convenience
|
|
@@ -75,6 +92,7 @@ const CHANNEL_SESSIONS_FILE = config.paths.sessions;
|
|
|
75
92
|
const PENDING_DIR = config.paths.pending;
|
|
76
93
|
const HOOK_DIR = config.paths.hooks;
|
|
77
94
|
const USE_DOCKER = config.workspace.useDocker; // Whether to use Docker or run locally
|
|
95
|
+
const ENFORCE_NODE_VERSION = config.workspace.enforceNodeVersion; // Whether to enforce Node.js version check
|
|
78
96
|
const CONTAINER_NAME = config.workspace.containerName;
|
|
79
97
|
const DOCKER_IMAGE = config.workspace.dockerImage;
|
|
80
98
|
|
package/src/core/config.js
CHANGED
|
@@ -82,6 +82,7 @@ function loadConfig() {
|
|
|
82
82
|
workspace: {
|
|
83
83
|
projectDir: expandPath(fileConfig.PROJECT_DIR) || process.cwd(),
|
|
84
84
|
useDocker: fileConfig.workspace?.useDocker !== false, // Default to true for backward compatibility
|
|
85
|
+
enforceNodeVersion: fileConfig.workspace?.enforceNodeVersion !== false, // Default to true for safety
|
|
85
86
|
containerName: fileConfig.workspace?.containerName || 'claude-discord-bot',
|
|
86
87
|
dockerImage: fileConfig.workspace?.dockerImage || 'claude-sandbox',
|
|
87
88
|
portMappings: fileConfig.workspace?.portMappings || [],
|