qclaw-cli 0.3.1 → 0.3.2
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/CONTRIBUTING.md +1 -1
- package/README.aiclaw.md +1 -1
- package/README.aliclaw.md +1 -1
- package/README.amazonclaw.md +12 -0
- package/README.amzclaw.md +12 -0
- package/README.anthropicclaw.md +12 -0
- package/README.appleclaw.md +12 -0
- package/README.autoopenclaw.md +1 -1
- package/README.awsclaw.md +12 -0
- package/README.bdclaw.md +12 -0
- package/README.blclaw.md +12 -0
- package/README.bytclaw.md +12 -0
- package/README.claw-open.md +1 -1
- package/README.clawjs.md +1 -1
- package/README.coclaw.md +12 -0
- package/README.copaw.md +12 -0
- package/README.ddclaw.md +12 -0
- package/README.duclaw.md +12 -0
- package/README.dyclaw.md +12 -0
- package/README.easyclaw.md +12 -0
- package/README.fastclaw.md +1 -1
- package/README.fbclaw.md +12 -0
- package/README.googleclaw.md +12 -0
- package/README.hwclaw.md +12 -0
- package/README.jdclaw.md +12 -0
- package/README.kimiclaw.md +12 -0
- package/README.ksclaw.md +12 -0
- package/README.maxclaw.md +12 -0
- package/README.md +1 -1
- package/README.megaclaw.md +1 -1
- package/README.metaclaw.md +12 -0
- package/README.miclaw.md +12 -0
- package/README.msclaw.md +12 -0
- package/README.mtclaw.md +12 -0
- package/README.nflxclaw.md +12 -0
- package/README.nvdaclaw.md +12 -0
- package/README.open-claw.md +1 -1
- package/README.openaiclaw.md +12 -0
- package/README.openclaw-cli.md +1 -1
- package/README.openclaw-daemon.md +1 -1
- package/README.openclaw-gateway.md +1 -1
- package/README.openclaw-health.md +1 -1
- package/README.openclaw-helper.md +1 -1
- package/README.openclaw-install.md +1 -1
- package/README.openclaw-manage.md +1 -1
- package/README.openclaw-monitor.md +1 -1
- package/README.openclaw-run.md +1 -1
- package/README.openclaw-service.md +1 -1
- package/README.openclaw-setup.md +1 -1
- package/README.openclaw-start.md +1 -1
- package/README.openclaw-tools.md +1 -1
- package/README.openclaw-upgrade.md +1 -1
- package/README.openclaw-utils.md +1 -1
- package/README.openclaw-watch.md +1 -1
- package/README.pddclaw.md +12 -0
- package/README.qclaw-cli.md +1 -1
- package/README.qclaw.md +1 -1
- package/README.smartclaw.md +1 -1
- package/README.ttclaw.md +12 -0
- package/README.txclaw.md +12 -0
- package/README.uberclaw.md +12 -0
- package/README.volclaw.md +1 -1
- package/README.wxclaw.md +12 -0
- package/README.xclaw.md +12 -0
- package/README.zh-CN.md +2 -2
- package/README.zhclaw.md +12 -0
- package/dist/{chunk-LIZ6XXW3.js → chunk-U6JVOA5H.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/{server-ZYSNFLSO.js → server-GHEIPQJV.js} +1 -1
- package/package.json +3 -3
- package/README.md.bak +0 -242
- package/app-dist/main.js +0 -300
- package/app-dist/package.json +0 -3
- package/app-dist/server-process.js +0 -95
- package/assets/demo.gif +0 -0
- package/assets/welcome.png +0 -0
- package/demo.tape +0 -28
- package/homebrew/README.md +0 -37
- package/homebrew/openclaw-cli.rb +0 -22
- package/homebrew/openclaw-doctor.rb +0 -26
- package/package.aiclaw.json +0 -25
- package/package.aliclaw.json +0 -25
- package/package.autoopenclaw.json +0 -25
- package/package.claw-open.json +0 -25
- package/package.clawjs.json +0 -25
- package/package.fastclaw.json +0 -25
- package/package.json.bak +0 -51
- package/package.megaclaw.json +0 -25
- package/package.open-claw.json +0 -25
- package/package.openclaw-cli.json +0 -51
- package/package.openclaw-daemon.json +0 -51
- package/package.openclaw-gateway.json +0 -51
- package/package.openclaw-health.json +0 -51
- package/package.openclaw-helper.json +0 -51
- package/package.openclaw-install.json +0 -51
- package/package.openclaw-manage.json +0 -51
- package/package.openclaw-monitor.json +0 -51
- package/package.openclaw-run.json +0 -51
- package/package.openclaw-service.json +0 -51
- package/package.openclaw-setup.json +0 -51
- package/package.openclaw-start.json +0 -51
- package/package.openclaw-tools.json +0 -51
- package/package.openclaw-upgrade.json +0 -50
- package/package.openclaw-utils.json +0 -51
- package/package.openclaw-watch.json +0 -51
- package/package.qclaw-cli.json +0 -25
- package/package.qclaw.json +0 -25
- package/package.smartclaw.json +0 -25
- package/package.volclaw.json +0 -25
- package/scripts/post-app-compile.cjs +0 -3
- package/scripts/post-app-compile.js +0 -7
- package/scripts/publish.sh +0 -120
- package/scripts/publish.sh.bak +0 -63
package/app-dist/main.js
DELETED
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const electron_1 = require("electron");
|
|
37
|
-
const path = __importStar(require("node:path"));
|
|
38
|
-
const http = __importStar(require("node:http"));
|
|
39
|
-
// ── Constants ──────────────────────────────────────────────────────────────
|
|
40
|
-
const DASHBOARD_PORT = 9090;
|
|
41
|
-
const DASHBOARD_URL = `http://localhost:${DASHBOARD_PORT}`;
|
|
42
|
-
const HEALTH_INTERVAL_MS = 30000;
|
|
43
|
-
// In dev: __dirname = app-dist/, script is app-dist/server-process.js
|
|
44
|
-
// In packaged: __dirname = .../app.asar/app-dist/, script is same
|
|
45
|
-
const SERVER_SCRIPT = path.join(__dirname, "server-process.js");
|
|
46
|
-
// Icon paths (relative to app bundle Resources or dev project root)
|
|
47
|
-
const ICON_PATH = path.join(electron_1.app.isPackaged
|
|
48
|
-
? path.join(process.resourcesPath, "assets/icon.iconset/icon_16x16@2x.png")
|
|
49
|
-
: path.join(__dirname, "../assets/icon.iconset/icon_16x16@2x.png"));
|
|
50
|
-
// ── State ──────────────────────────────────────────────────────────────────
|
|
51
|
-
let tray = null;
|
|
52
|
-
let mainWindow = null;
|
|
53
|
-
let serverProc = null;
|
|
54
|
-
let isHealthy = true;
|
|
55
|
-
// ── Server lifecycle ───────────────────────────────────────────────────────
|
|
56
|
-
/** Check if dashboard server is already running on the port */
|
|
57
|
-
function isServerRunning() {
|
|
58
|
-
return new Promise((resolve) => {
|
|
59
|
-
http.get(`${DASHBOARD_URL}/api/status`, { timeout: 1000 }, (res) => {
|
|
60
|
-
resolve(res.statusCode === 200);
|
|
61
|
-
}).on("error", () => resolve(false))
|
|
62
|
-
.on("timeout", () => resolve(false));
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
function isPortInUse(port) {
|
|
66
|
-
return new Promise((resolve) => {
|
|
67
|
-
http.get(`http://127.0.0.1:${port}/api/status`, { timeout: 1000 }, (res) => {
|
|
68
|
-
resolve(res.statusCode === 200);
|
|
69
|
-
}).on("error", () => resolve(false));
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
function findCLI() {
|
|
73
|
-
// Try env PATH first, then common nvm paths
|
|
74
|
-
const { execSync } = require("node:child_process");
|
|
75
|
-
try {
|
|
76
|
-
return execSync("which openclaw-doctor", { encoding: "utf-8" }).trim();
|
|
77
|
-
}
|
|
78
|
-
catch { }
|
|
79
|
-
const home = process.env.HOME ?? "";
|
|
80
|
-
const candidates = [
|
|
81
|
-
`${home}/.nvm/versions/node/v24.14.0/bin/openclaw-doctor`,
|
|
82
|
-
`${home}/.nvm/versions/node/v22.13.0/bin/openclaw-doctor`,
|
|
83
|
-
`/usr/local/bin/openclaw-doctor`,
|
|
84
|
-
`/opt/homebrew/bin/openclaw-doctor`,
|
|
85
|
-
];
|
|
86
|
-
const { existsSync } = require("node:fs");
|
|
87
|
-
return candidates.find(existsSync) ?? null;
|
|
88
|
-
}
|
|
89
|
-
async function startServer() {
|
|
90
|
-
if (await isPortInUse(DASHBOARD_PORT)) {
|
|
91
|
-
console.log("[app] dashboard already running, reusing");
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const cli = findCLI();
|
|
95
|
-
if (!cli) {
|
|
96
|
-
console.error("[app] openclaw-doctor CLI not found — install with: npm install -g openclaw-doctor");
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
// Use system node (not Electron's node) to run the CLI
|
|
100
|
-
const { spawnSync: _ss, spawn } = require("node:child_process");
|
|
101
|
-
// Find system node
|
|
102
|
-
let nodeExec = "/usr/local/bin/node";
|
|
103
|
-
try {
|
|
104
|
-
const nvmNode = _ss("bash", ["-lc", "which node"], { encoding: "utf-8" });
|
|
105
|
-
if (nvmNode.stdout?.trim())
|
|
106
|
-
nodeExec = nvmNode.stdout.trim();
|
|
107
|
-
}
|
|
108
|
-
catch { }
|
|
109
|
-
console.log(`[app] Starting: ${nodeExec} ${cli} monitor`);
|
|
110
|
-
serverProc = spawn(nodeExec, [cli, "monitor"], {
|
|
111
|
-
env: { ...process.env, PATH: `/usr/local/bin:/opt/homebrew/bin:${process.env.PATH}` },
|
|
112
|
-
stdio: "pipe",
|
|
113
|
-
});
|
|
114
|
-
serverProc.stderr?.on("data", (d) => console.error("[monitor]", d.toString().trim()));
|
|
115
|
-
serverProc.stdout?.on("data", (d) => console.log("[monitor]", d.toString().trim()));
|
|
116
|
-
serverProc.on("exit", (code) => {
|
|
117
|
-
console.log(`[app] monitor exited (code ${code}), retry in 3s`);
|
|
118
|
-
serverProc = null;
|
|
119
|
-
setTimeout(startServer, 3000);
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
async function ensureServer() {
|
|
123
|
-
// If already running (e.g. openclaw-doctor watch --dashboard), reuse it
|
|
124
|
-
const already = await isServerRunning();
|
|
125
|
-
if (already) {
|
|
126
|
-
console.log("[app] Dashboard server already running, reusing existing instance");
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
startServer();
|
|
130
|
-
await waitForServer();
|
|
131
|
-
}
|
|
132
|
-
function waitForServer(retries = 20) {
|
|
133
|
-
return new Promise((resolve, reject) => {
|
|
134
|
-
let attempts = 0;
|
|
135
|
-
const check = () => {
|
|
136
|
-
http
|
|
137
|
-
.get(`${DASHBOARD_URL}/api/status`, { timeout: 2000 }, (res) => {
|
|
138
|
-
if (res.statusCode === 200)
|
|
139
|
-
return resolve();
|
|
140
|
-
retry();
|
|
141
|
-
})
|
|
142
|
-
.on("error", retry);
|
|
143
|
-
};
|
|
144
|
-
const retry = () => {
|
|
145
|
-
if (++attempts >= retries)
|
|
146
|
-
return reject(new Error("Dashboard server did not start"));
|
|
147
|
-
setTimeout(check, 500);
|
|
148
|
-
};
|
|
149
|
-
check();
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
// ── Window ─────────────────────────────────────────────────────────────────
|
|
153
|
-
function createWindow() {
|
|
154
|
-
mainWindow = new electron_1.BrowserWindow({
|
|
155
|
-
width: 1024,
|
|
156
|
-
height: 720,
|
|
157
|
-
minWidth: 800,
|
|
158
|
-
minHeight: 600,
|
|
159
|
-
title: "OpenClaw Doctor",
|
|
160
|
-
backgroundColor: "#050810",
|
|
161
|
-
webPreferences: { contextIsolation: true },
|
|
162
|
-
show: false,
|
|
163
|
-
});
|
|
164
|
-
mainWindow.loadURL(DASHBOARD_URL);
|
|
165
|
-
mainWindow.once("ready-to-show", () => mainWindow?.show());
|
|
166
|
-
mainWindow.on("close", (e) => {
|
|
167
|
-
e.preventDefault();
|
|
168
|
-
mainWindow?.hide();
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
function showWindow() {
|
|
172
|
-
if (!mainWindow)
|
|
173
|
-
createWindow();
|
|
174
|
-
else {
|
|
175
|
-
mainWindow.show();
|
|
176
|
-
mainWindow.focus();
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
// ── Tray ───────────────────────────────────────────────────────────────────
|
|
180
|
-
function buildTrayMenu() {
|
|
181
|
-
return electron_1.Menu.buildFromTemplate([
|
|
182
|
-
{
|
|
183
|
-
label: "OpenClaw Doctor",
|
|
184
|
-
enabled: false,
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
label: `Status: ${isHealthy ? "🟢 HEALTHY" : "🔴 UNREACHABLE"}`,
|
|
188
|
-
enabled: false,
|
|
189
|
-
},
|
|
190
|
-
{ type: "separator" },
|
|
191
|
-
{ label: "Open Dashboard", click: () => showWindow() },
|
|
192
|
-
{ label: "Open in Browser", click: () => electron_1.shell.openExternal(DASHBOARD_URL) },
|
|
193
|
-
{ type: "separator" },
|
|
194
|
-
{
|
|
195
|
-
label: "Restart Gateway",
|
|
196
|
-
click: async () => {
|
|
197
|
-
try {
|
|
198
|
-
await fetch(`${DASHBOARD_URL}/api/restart`, { method: "POST" });
|
|
199
|
-
}
|
|
200
|
-
catch { }
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
label: "Run Doctor Fix",
|
|
205
|
-
click: async () => {
|
|
206
|
-
try {
|
|
207
|
-
await fetch(`${DASHBOARD_URL}/api/doctor`, { method: "POST" });
|
|
208
|
-
}
|
|
209
|
-
catch { }
|
|
210
|
-
},
|
|
211
|
-
},
|
|
212
|
-
{ type: "separator" },
|
|
213
|
-
{
|
|
214
|
-
label: "Start at Login",
|
|
215
|
-
type: "checkbox",
|
|
216
|
-
checked: electron_1.app.getLoginItemSettings().openAtLogin,
|
|
217
|
-
click: (item) => {
|
|
218
|
-
electron_1.app.setLoginItemSettings({ openAtLogin: item.checked });
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
{ type: "separator" },
|
|
222
|
-
{ label: "Quit", click: () => electron_1.app.exit(0) },
|
|
223
|
-
]);
|
|
224
|
-
}
|
|
225
|
-
function createTray() {
|
|
226
|
-
let icon;
|
|
227
|
-
try {
|
|
228
|
-
icon = electron_1.nativeImage.createFromPath(ICON_PATH);
|
|
229
|
-
// Mark as template for macOS menubar (auto dark/light adaptation)
|
|
230
|
-
icon.setTemplateImage(true);
|
|
231
|
-
}
|
|
232
|
-
catch {
|
|
233
|
-
icon = electron_1.nativeImage.createEmpty();
|
|
234
|
-
}
|
|
235
|
-
tray = new electron_1.Tray(icon);
|
|
236
|
-
tray.setToolTip("OpenClaw Doctor — starting...");
|
|
237
|
-
tray.setContextMenu(buildTrayMenu());
|
|
238
|
-
tray.on("double-click", () => showWindow());
|
|
239
|
-
}
|
|
240
|
-
function updateTray(healthy) {
|
|
241
|
-
if (!tray)
|
|
242
|
-
return;
|
|
243
|
-
isHealthy = healthy;
|
|
244
|
-
tray.setToolTip(`OpenClaw Doctor — ${healthy ? "HEALTHY" : "UNREACHABLE"}`);
|
|
245
|
-
tray.setContextMenu(buildTrayMenu());
|
|
246
|
-
}
|
|
247
|
-
// ── Health polling ─────────────────────────────────────────────────────────
|
|
248
|
-
async function pollHealth() {
|
|
249
|
-
try {
|
|
250
|
-
const res = await fetch(`${DASHBOARD_URL}/api/status`);
|
|
251
|
-
const data = (await res.json());
|
|
252
|
-
const wasHealthy = isHealthy;
|
|
253
|
-
updateTray(data.healthy);
|
|
254
|
-
if (!data.healthy && wasHealthy) {
|
|
255
|
-
new electron_1.Notification({
|
|
256
|
-
title: "OpenClaw Doctor",
|
|
257
|
-
body: "Gateway is down — attempting auto-restart...",
|
|
258
|
-
}).show();
|
|
259
|
-
}
|
|
260
|
-
else if (data.healthy && !wasHealthy) {
|
|
261
|
-
new electron_1.Notification({
|
|
262
|
-
title: "OpenClaw Doctor",
|
|
263
|
-
body: "Gateway is back online ✓",
|
|
264
|
-
}).show();
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
catch {
|
|
268
|
-
updateTray(false);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
// ── App lifecycle ──────────────────────────────────────────────────────────
|
|
272
|
-
electron_1.app.on("ready", async () => {
|
|
273
|
-
// macOS: don't show in Dock
|
|
274
|
-
if (process.platform === "darwin")
|
|
275
|
-
electron_1.app.dock?.hide();
|
|
276
|
-
createTray();
|
|
277
|
-
try {
|
|
278
|
-
await ensureServer();
|
|
279
|
-
}
|
|
280
|
-
catch {
|
|
281
|
-
console.warn("[app] server warmup timed out, opening anyway");
|
|
282
|
-
}
|
|
283
|
-
createWindow();
|
|
284
|
-
await pollHealth();
|
|
285
|
-
setInterval(pollHealth, HEALTH_INTERVAL_MS);
|
|
286
|
-
});
|
|
287
|
-
electron_1.app.on("window-all-closed", () => {
|
|
288
|
-
// Keep app alive in tray (do nothing — don't quit)
|
|
289
|
-
});
|
|
290
|
-
electron_1.app.on("activate", () => {
|
|
291
|
-
showWindow();
|
|
292
|
-
});
|
|
293
|
-
// Prevent second instance
|
|
294
|
-
const gotLock = electron_1.app.requestSingleInstanceLock();
|
|
295
|
-
if (!gotLock) {
|
|
296
|
-
electron_1.app.quit();
|
|
297
|
-
}
|
|
298
|
-
else {
|
|
299
|
-
electron_1.app.on("second-instance", () => showWindow());
|
|
300
|
-
}
|
package/app-dist/package.json
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
/**
|
|
37
|
-
* Forked by Electron main process.
|
|
38
|
-
* Starts the dashboard HTTP server directly using Node's http module.
|
|
39
|
-
* This file is compiled to CommonJS and runs as a standalone child process.
|
|
40
|
-
*/
|
|
41
|
-
const http = __importStar(require("node:http"));
|
|
42
|
-
const fs = __importStar(require("node:fs"));
|
|
43
|
-
const path = __importStar(require("node:path"));
|
|
44
|
-
const cp = __importStar(require("node:child_process"));
|
|
45
|
-
const PORT = Number(process.env.DASHBOARD_PORT ?? 9090);
|
|
46
|
-
// Find openclaw-doctor CLI (the installed npm package)
|
|
47
|
-
function findOpenclawDoctor() {
|
|
48
|
-
// 1. Check if there's a global install
|
|
49
|
-
try {
|
|
50
|
-
const which = cp.execSync("which openclaw-doctor", { encoding: "utf-8" }).trim();
|
|
51
|
-
if (which)
|
|
52
|
-
return which;
|
|
53
|
-
}
|
|
54
|
-
catch { }
|
|
55
|
-
// 2. Check common paths
|
|
56
|
-
const candidates = [
|
|
57
|
-
"/usr/local/bin/openclaw-doctor",
|
|
58
|
-
"/opt/homebrew/bin/openclaw-doctor",
|
|
59
|
-
path.join(process.env.HOME ?? "", ".nvm/versions/node/v24.14.0/bin/openclaw-doctor"),
|
|
60
|
-
path.join(process.env.HOME ?? "", ".nvm/versions/node/v22.13.0/bin/openclaw-doctor"),
|
|
61
|
-
];
|
|
62
|
-
for (const c of candidates) {
|
|
63
|
-
if (fs.existsSync(c))
|
|
64
|
-
return c;
|
|
65
|
-
}
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
// Strategy: spawn openclaw-doctor monitor as a subprocess
|
|
69
|
-
const cli = findOpenclawDoctor();
|
|
70
|
-
if (cli) {
|
|
71
|
-
console.log(`[server-process] Starting via CLI: ${cli} monitor`);
|
|
72
|
-
const child = cp.spawn(process.execPath, [cli, "monitor"], {
|
|
73
|
-
env: { ...process.env },
|
|
74
|
-
stdio: "inherit",
|
|
75
|
-
});
|
|
76
|
-
child.on("exit", (code) => {
|
|
77
|
-
console.log(`[server-process] CLI exited (${code})`);
|
|
78
|
-
process.exit(code ?? 1);
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
// Fallback: minimal inline HTTP server returning status
|
|
83
|
-
console.warn("[server-process] openclaw-doctor CLI not found, starting fallback server");
|
|
84
|
-
const server = http.createServer((req, res) => {
|
|
85
|
-
if (req.url === "/api/status") {
|
|
86
|
-
res.writeHead(200, { "Content-Type": "application/json" });
|
|
87
|
-
res.end(JSON.stringify({ healthy: false, gateway: false, channels: [], agents: [], durationMs: 0, error: "CLI not found" }));
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
res.writeHead(200, { "Content-Type": "text/html" });
|
|
91
|
-
res.end("<h1>OpenClaw Doctor</h1><p>CLI not found. Please install openclaw-doctor.</p>");
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
server.listen(PORT, () => console.log(`[server-process] Fallback server on :${PORT}`));
|
|
95
|
-
}
|
package/assets/demo.gif
DELETED
|
Binary file
|
package/assets/welcome.png
DELETED
|
Binary file
|
package/demo.tape
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
Output assets/demo.gif
|
|
2
|
-
|
|
3
|
-
Set Shell "bash"
|
|
4
|
-
Set FontSize 14
|
|
5
|
-
Set Width 900
|
|
6
|
-
Set Height 500
|
|
7
|
-
Set Theme "Catppuccin Mocha"
|
|
8
|
-
Set Padding 20
|
|
9
|
-
|
|
10
|
-
# Show the tool
|
|
11
|
-
Type "openclaw-doctor status" Sleep 500ms Enter
|
|
12
|
-
Sleep 3s
|
|
13
|
-
|
|
14
|
-
# Start background monitoring
|
|
15
|
-
Type "openclaw-doctor watch -d" Sleep 500ms Enter
|
|
16
|
-
Sleep 3s
|
|
17
|
-
|
|
18
|
-
# Check again to show it's running
|
|
19
|
-
Type "openclaw-doctor status" Sleep 500ms Enter
|
|
20
|
-
Sleep 3s
|
|
21
|
-
|
|
22
|
-
# Show logs
|
|
23
|
-
Type "openclaw-doctor logs --doctor" Sleep 500ms Enter
|
|
24
|
-
Sleep 3s
|
|
25
|
-
|
|
26
|
-
# Stop
|
|
27
|
-
Type "openclaw-doctor unwatch" Sleep 500ms Enter
|
|
28
|
-
Sleep 2s
|
package/homebrew/README.md
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# Homebrew Tap — OpenClaw
|
|
2
|
-
|
|
3
|
-
This directory contains Homebrew formulas for OpenClaw tools.
|
|
4
|
-
|
|
5
|
-
## Setup
|
|
6
|
-
|
|
7
|
-
1. Create a new GitHub repo: `Sobranier/homebrew-openclaw`
|
|
8
|
-
2. Copy the `.rb` files from this directory into `Formula/` in that repo
|
|
9
|
-
3. After creating a GitHub Release (e.g. `v0.3.0`), update the `sha256` in each formula:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
curl -sL https://github.com/Sobranier/openclaw-doctor/archive/refs/tags/v0.3.0.tar.gz | shasum -a 256
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Installation (once published)
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
brew tap Sobranier/openclaw
|
|
19
|
-
brew install openclaw-cli
|
|
20
|
-
|
|
21
|
-
# Or the doctor alias (backward compat)
|
|
22
|
-
brew install openclaw-doctor
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Update formula on new release
|
|
26
|
-
|
|
27
|
-
When you publish a new version:
|
|
28
|
-
|
|
29
|
-
1. Update `url` version tag in both `.rb` files
|
|
30
|
-
2. Recalculate `sha256`:
|
|
31
|
-
```bash
|
|
32
|
-
curl -sL https://github.com/Sobranier/openclaw-doctor/archive/refs/tags/vX.X.X.tar.gz | shasum -a 256
|
|
33
|
-
```
|
|
34
|
-
3. Update `sha256` in both `.rb` files
|
|
35
|
-
4. Commit and push to `homebrew-openclaw` repo
|
|
36
|
-
|
|
37
|
-
> Tip: Add this to `scripts/publish.sh` to automate the sha256 update.
|
package/homebrew/openclaw-cli.rb
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
class OpenclasCli < Formula
|
|
2
|
-
desc "CLI and health-watch daemon for OpenClaw AI assistant gateway"
|
|
3
|
-
homepage "https://github.com/Sobranier/openclaw-doctor"
|
|
4
|
-
url "https://github.com/Sobranier/openclaw-doctor/archive/refs/tags/v0.3.0.tar.gz"
|
|
5
|
-
sha256 "REPLACE_WITH_SHA256_AFTER_RELEASE"
|
|
6
|
-
license "MIT"
|
|
7
|
-
head "https://github.com/Sobranier/openclaw-doctor.git", branch: "main"
|
|
8
|
-
|
|
9
|
-
depends_on "node"
|
|
10
|
-
|
|
11
|
-
def install
|
|
12
|
-
system "npm", "install", *std_npm_args
|
|
13
|
-
# Install the openclaw-cli binary
|
|
14
|
-
bin.install_symlink Dir["#{libexec}/bin/openclaw-cli"]
|
|
15
|
-
# Also provide openclaw-doctor alias for backward compatibility
|
|
16
|
-
bin.install_symlink Dir["#{libexec}/bin/openclaw-cli"] => "openclaw-doctor"
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
test do
|
|
20
|
-
assert_match version.to_s, shell_output("#{bin}/openclaw-cli --version")
|
|
21
|
-
end
|
|
22
|
-
end
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# openclaw-doctor is an alias for openclaw-cli.
|
|
2
|
-
# The main formula is openclaw-cli — install that instead:
|
|
3
|
-
#
|
|
4
|
-
# brew install Sobranier/openclaw/openclaw-cli
|
|
5
|
-
#
|
|
6
|
-
class OpenclawDoctor < Formula
|
|
7
|
-
desc "Alias for openclaw-cli — health-watch daemon for OpenClaw gateway"
|
|
8
|
-
homepage "https://github.com/Sobranier/openclaw-doctor"
|
|
9
|
-
url "https://github.com/Sobranier/openclaw-doctor/archive/refs/tags/v0.3.0.tar.gz"
|
|
10
|
-
sha256 "REPLACE_WITH_SHA256_AFTER_RELEASE"
|
|
11
|
-
license "MIT"
|
|
12
|
-
|
|
13
|
-
depends_on "node"
|
|
14
|
-
# Recommend the primary formula
|
|
15
|
-
deprecated_unless "openclaw-cli is now the primary package; this formula is kept for backward compatibility."
|
|
16
|
-
|
|
17
|
-
def install
|
|
18
|
-
system "npm", "install", *std_npm_args
|
|
19
|
-
bin.install_symlink Dir["#{libexec}/bin/openclaw-cli"] => "openclaw-doctor"
|
|
20
|
-
bin.install_symlink Dir["#{libexec}/bin/openclaw-cli"]
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
test do
|
|
24
|
-
assert_match version.to_s, shell_output("#{bin}/openclaw-doctor --version")
|
|
25
|
-
end
|
|
26
|
-
end
|
package/package.aiclaw.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "aiclaw",
|
|
3
|
-
"version": "0.3.1",
|
|
4
|
-
"description": "CLI and health-watch daemon for OpenClaw AI assistant gateway",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"openclaw",
|
|
7
|
-
"cli",
|
|
8
|
-
"ai",
|
|
9
|
-
"daemon",
|
|
10
|
-
"health-check"
|
|
11
|
-
],
|
|
12
|
-
"main": "./dist/index.js",
|
|
13
|
-
"bin": {
|
|
14
|
-
"aiclaw": "./dist/index.js"
|
|
15
|
-
},
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "https://github.com/Sobranier/openclaw-doctor.git"
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://github.com/Sobranier/openclaw-doctor",
|
|
22
|
-
"engines": {
|
|
23
|
-
"node": ">=22"
|
|
24
|
-
}
|
|
25
|
-
}
|
package/package.aliclaw.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "aliclaw",
|
|
3
|
-
"version": "0.3.1",
|
|
4
|
-
"description": "CLI and health-watch daemon for OpenClaw AI assistant gateway",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"openclaw",
|
|
7
|
-
"cli",
|
|
8
|
-
"ai",
|
|
9
|
-
"daemon",
|
|
10
|
-
"health-check"
|
|
11
|
-
],
|
|
12
|
-
"main": "./dist/index.js",
|
|
13
|
-
"bin": {
|
|
14
|
-
"aliclaw": "./dist/index.js"
|
|
15
|
-
},
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "https://github.com/Sobranier/openclaw-doctor.git"
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://github.com/Sobranier/openclaw-doctor",
|
|
22
|
-
"engines": {
|
|
23
|
-
"node": ">=22"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "autoopenclaw",
|
|
3
|
-
"version": "0.3.1",
|
|
4
|
-
"description": "CLI and health-watch daemon for OpenClaw AI assistant gateway",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"openclaw",
|
|
7
|
-
"cli",
|
|
8
|
-
"ai",
|
|
9
|
-
"daemon",
|
|
10
|
-
"health-check"
|
|
11
|
-
],
|
|
12
|
-
"main": "./dist/index.js",
|
|
13
|
-
"bin": {
|
|
14
|
-
"autoopenclaw": "./dist/index.js"
|
|
15
|
-
},
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "https://github.com/Sobranier/openclaw-doctor.git"
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://github.com/Sobranier/openclaw-doctor",
|
|
22
|
-
"engines": {
|
|
23
|
-
"node": ">=22"
|
|
24
|
-
}
|
|
25
|
-
}
|
package/package.claw-open.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "claw-open",
|
|
3
|
-
"version": "0.3.1",
|
|
4
|
-
"description": "CLI and health-watch daemon for OpenClaw AI assistant gateway",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"openclaw",
|
|
7
|
-
"cli",
|
|
8
|
-
"ai",
|
|
9
|
-
"daemon",
|
|
10
|
-
"health-check"
|
|
11
|
-
],
|
|
12
|
-
"main": "./dist/index.js",
|
|
13
|
-
"bin": {
|
|
14
|
-
"claw-open": "./dist/index.js"
|
|
15
|
-
},
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "https://github.com/Sobranier/openclaw-doctor.git"
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://github.com/Sobranier/openclaw-doctor",
|
|
22
|
-
"engines": {
|
|
23
|
-
"node": ">=22"
|
|
24
|
-
}
|
|
25
|
-
}
|
package/package.clawjs.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "clawjs",
|
|
3
|
-
"version": "0.3.1",
|
|
4
|
-
"description": "CLI and health-watch daemon for OpenClaw AI assistant gateway",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"openclaw",
|
|
7
|
-
"cli",
|
|
8
|
-
"ai",
|
|
9
|
-
"daemon",
|
|
10
|
-
"health-check"
|
|
11
|
-
],
|
|
12
|
-
"main": "./dist/index.js",
|
|
13
|
-
"bin": {
|
|
14
|
-
"clawjs": "./dist/index.js"
|
|
15
|
-
},
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "https://github.com/Sobranier/openclaw-doctor.git"
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://github.com/Sobranier/openclaw-doctor",
|
|
22
|
-
"engines": {
|
|
23
|
-
"node": ">=22"
|
|
24
|
-
}
|
|
25
|
-
}
|
package/package.fastclaw.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "fastclaw",
|
|
3
|
-
"version": "0.3.1",
|
|
4
|
-
"description": "CLI and health-watch daemon for OpenClaw AI assistant gateway",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"openclaw",
|
|
7
|
-
"cli",
|
|
8
|
-
"ai",
|
|
9
|
-
"daemon",
|
|
10
|
-
"health-check"
|
|
11
|
-
],
|
|
12
|
-
"main": "./dist/index.js",
|
|
13
|
-
"bin": {
|
|
14
|
-
"fastclaw": "./dist/index.js"
|
|
15
|
-
},
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "https://github.com/Sobranier/openclaw-doctor.git"
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://github.com/Sobranier/openclaw-doctor",
|
|
22
|
-
"engines": {
|
|
23
|
-
"node": ">=22"
|
|
24
|
-
}
|
|
25
|
-
}
|