wolverine-ai 5.2.10 → 5.2.12
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/wolverine.js +51 -0
- package/package.json +4 -1
package/bin/wolverine.js
CHANGED
|
@@ -38,6 +38,7 @@ ${chalk.bold("Options:")}
|
|
|
38
38
|
--workers <n> Force specific worker count
|
|
39
39
|
--info Show system info and exit
|
|
40
40
|
--init Scan server/ and build context map (routes, DB, config, deps)
|
|
41
|
+
--restart Full restart (kills parent + children, re-launches fresh)
|
|
41
42
|
--x402-info Show x402 payment configuration
|
|
42
43
|
|
|
43
44
|
${chalk.bold("Configuration:")}
|
|
@@ -121,6 +122,56 @@ if (args.includes("--init")) {
|
|
|
121
122
|
process.exit(0);
|
|
122
123
|
}
|
|
123
124
|
|
|
125
|
+
// --restart: full framework restart (kills parent + all children, re-launches)
|
|
126
|
+
if (args.includes("--restart")) {
|
|
127
|
+
const fs = require("fs");
|
|
128
|
+
const { execSync, spawn } = require("child_process");
|
|
129
|
+
const pidPath = path.resolve(process.cwd(), ".wolverine", "wolverine.pid");
|
|
130
|
+
|
|
131
|
+
// Find and kill the running wolverine process
|
|
132
|
+
let killed = false;
|
|
133
|
+
if (fs.existsSync(pidPath)) {
|
|
134
|
+
const pid = parseInt(fs.readFileSync(pidPath, "utf-8").trim(), 10);
|
|
135
|
+
if (pid) {
|
|
136
|
+
try {
|
|
137
|
+
process.kill(pid, "SIGTERM");
|
|
138
|
+
console.log(chalk.yellow(` 🔄 Killed wolverine process ${pid}`));
|
|
139
|
+
killed = true;
|
|
140
|
+
} catch (e) {
|
|
141
|
+
if (e.code !== "ESRCH") console.log(chalk.gray(` ⚠️ Could not kill PID ${pid}: ${e.message}`));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Also kill any lingering child processes
|
|
147
|
+
try {
|
|
148
|
+
if (process.platform === "win32") {
|
|
149
|
+
execSync('taskkill /F /IM node.exe /FI "WINDOWTITLE eq wolverine*" 2>nul', { stdio: "ignore" });
|
|
150
|
+
} else {
|
|
151
|
+
execSync("pkill -f 'wolverine.js --single' 2>/dev/null; pkill -f 'error-hook.js' 2>/dev/null", { stdio: "ignore" });
|
|
152
|
+
}
|
|
153
|
+
} catch {}
|
|
154
|
+
|
|
155
|
+
// Wait for processes to die
|
|
156
|
+
const wait = killed ? 3000 : 1000;
|
|
157
|
+
setTimeout(() => {
|
|
158
|
+
// Find the script path from the old PID file's sibling args, or use default
|
|
159
|
+
const scriptPath = args[args.indexOf("--restart") + 1] || "server/index.js";
|
|
160
|
+
|
|
161
|
+
console.log(chalk.blue(` 🚀 Restarting: wolverine --single ${scriptPath}`));
|
|
162
|
+
const child = spawn(process.execPath, [__filename, "--single", scriptPath], {
|
|
163
|
+
cwd: process.cwd(),
|
|
164
|
+
detached: true,
|
|
165
|
+
stdio: "ignore",
|
|
166
|
+
env: process.env,
|
|
167
|
+
});
|
|
168
|
+
child.unref();
|
|
169
|
+
console.log(chalk.green(` ✅ Wolverine restarted (PID ${child.pid})`));
|
|
170
|
+
process.exit(0);
|
|
171
|
+
}, wait);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
|
|
124
175
|
// --update: safe framework update
|
|
125
176
|
if (args.includes("--update")) {
|
|
126
177
|
const { safeUpdate } = require("../src/skills/update");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wolverine-ai",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.12",
|
|
4
4
|
"description": "Self-healing Node.js server framework powered by AI. Catches crashes, diagnoses errors, generates fixes, verifies, and restarts — automatically.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -61,7 +61,10 @@
|
|
|
61
61
|
"openai": "^4.73.0"
|
|
62
62
|
},
|
|
63
63
|
"optionalDependencies": {
|
|
64
|
+
"@coinbase/cdp-sdk": "^1.46.1",
|
|
64
65
|
"@privy-io/server-auth": "1.14.0",
|
|
66
|
+
"@x402/core": "^2.9.0",
|
|
67
|
+
"@x402/evm": "^2.9.0",
|
|
65
68
|
"better-sqlite3": "^11.0.0",
|
|
66
69
|
"ethers": "^6.0.0",
|
|
67
70
|
"ioredis": "^5.0.0",
|