@poolzin/pool-bot 2026.4.1 → 2026.4.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/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins-cli.d.ts","sourceRoot":"","sources":["../../src/cli/plugins-cli.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBzC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAsGF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"plugins-cli.d.ts","sourceRoot":"","sources":["../../src/cli/plugins-cli.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBzC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAsGF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,QAolBlD"}
|
package/dist/cli/plugins-cli.js
CHANGED
|
@@ -612,35 +612,19 @@ export function registerPluginsCli(program) {
|
|
|
612
612
|
});
|
|
613
613
|
plugins
|
|
614
614
|
.command("doctor")
|
|
615
|
-
.description("
|
|
616
|
-
.action(() => {
|
|
615
|
+
.description("Health checks + quick fixes for the gateway and channels")
|
|
616
|
+
.action(async () => {
|
|
617
|
+
// Plugin check
|
|
617
618
|
const report = buildPluginStatusReport();
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
}
|
|
624
|
-
const lines = [];
|
|
625
|
-
if (errors.length > 0) {
|
|
626
|
-
lines.push(theme.error("Plugin errors:"));
|
|
627
|
-
for (const entry of errors) {
|
|
628
|
-
lines.push(`- ${entry.id}: ${entry.error ?? "failed to load"} (${entry.source})`);
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
if (diags.length > 0) {
|
|
632
|
-
if (lines.length > 0) {
|
|
633
|
-
lines.push("");
|
|
634
|
-
}
|
|
635
|
-
lines.push(theme.warn("Diagnostics:"));
|
|
636
|
-
for (const diag of diags) {
|
|
637
|
-
const target = diag.pluginId ? `${diag.pluginId}: ` : "";
|
|
638
|
-
lines.push(`- ${target}${diag.message}`);
|
|
619
|
+
const pluginErrors = report.plugins.filter((p) => p.status === "error");
|
|
620
|
+
if (pluginErrors.length > 0) {
|
|
621
|
+
console.log("\nPlugin errors:");
|
|
622
|
+
for (const entry of pluginErrors) {
|
|
623
|
+
console.log(` ❌ ${entry.id}: ${entry.error ?? "failed to load"} (${entry.source})`);
|
|
639
624
|
}
|
|
640
625
|
}
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
defaultRuntime.log(lines.join("\n"));
|
|
626
|
+
// Full doctor
|
|
627
|
+
const { doctorCommand } = await import("../commands/doctor-runtime.js");
|
|
628
|
+
await doctorCommand();
|
|
645
629
|
});
|
|
646
630
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-runtime.d.ts","sourceRoot":"","sources":["../../src/commands/doctor-runtime.ts"],"names":[],"mappings":"AAsBA,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAkKnD"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pool Bot Doctor
|
|
3
|
+
* Health checks and quick fixes for the gateway and channels.
|
|
4
|
+
*/
|
|
5
|
+
import fs from "node:fs";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
function resolveHomeDir() {
|
|
8
|
+
return process.env.HOME || process.env.USERPROFILE || "/tmp";
|
|
9
|
+
}
|
|
10
|
+
function resolveConfigDir() {
|
|
11
|
+
return path.join(resolveHomeDir(), ".poolbot");
|
|
12
|
+
}
|
|
13
|
+
export async function doctorCommand() {
|
|
14
|
+
console.log("\nPool Bot Doctor\n");
|
|
15
|
+
const checks = [];
|
|
16
|
+
const configDir = resolveConfigDir();
|
|
17
|
+
// 1. Config directory
|
|
18
|
+
if (fs.existsSync(configDir)) {
|
|
19
|
+
checks.push({ name: "Config directory", status: "pass", message: configDir });
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
checks.push({
|
|
23
|
+
name: "Config directory",
|
|
24
|
+
status: "warn",
|
|
25
|
+
message: `${configDir} not found`,
|
|
26
|
+
fix: "Run: poolbot setup",
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
// 2. Config file
|
|
30
|
+
const configPath = path.join(configDir, "config.yaml");
|
|
31
|
+
if (fs.existsSync(configPath)) {
|
|
32
|
+
checks.push({ name: "Config file", status: "pass", message: "Found" });
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
checks.push({
|
|
36
|
+
name: "Config file",
|
|
37
|
+
status: "warn",
|
|
38
|
+
message: "config.yaml not found",
|
|
39
|
+
fix: "Run: poolbot configure",
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
// 3. Gateway auth
|
|
43
|
+
const tokenEnv = process.env.OPENCLAW_GATEWAY_TOKEN || process.env.POOLBOT_GATEWAY_TOKEN;
|
|
44
|
+
if (tokenEnv) {
|
|
45
|
+
checks.push({ name: "Gateway token", status: "pass", message: "Set via env" });
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
checks.push({
|
|
49
|
+
name: "Gateway token",
|
|
50
|
+
status: "warn",
|
|
51
|
+
message: "No gateway token found",
|
|
52
|
+
fix: "Run: poolbot configure or set POOLBOT_GATEWAY_TOKEN",
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
// 4. API keys
|
|
56
|
+
const providers = [
|
|
57
|
+
{ name: "Anthropic", env: "ANTHROPIC_API_KEY" },
|
|
58
|
+
{ name: "OpenAI", env: "OPENAI_API_KEY" },
|
|
59
|
+
{ name: "Google", env: "GOOGLE_API_KEY" },
|
|
60
|
+
{ name: "Groq", env: "GROQ_API_KEY" },
|
|
61
|
+
];
|
|
62
|
+
let hasAnyProvider = false;
|
|
63
|
+
for (const p of providers) {
|
|
64
|
+
if (process.env[p.env]) {
|
|
65
|
+
checks.push({ name: `${p.name} API key`, status: "pass", message: "Configured" });
|
|
66
|
+
hasAnyProvider = true;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (!hasAnyProvider) {
|
|
70
|
+
checks.push({
|
|
71
|
+
name: "AI Provider",
|
|
72
|
+
status: "warn",
|
|
73
|
+
message: "No API keys configured",
|
|
74
|
+
fix: "Set at least one: ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_API_KEY",
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
// 5. Gateway connection
|
|
78
|
+
const gatewayUrl = process.env.OPENCLAW_GATEWAY_URL || process.env.POOLBOT_GATEWAY_URL;
|
|
79
|
+
if (gatewayUrl) {
|
|
80
|
+
try {
|
|
81
|
+
const controller = new AbortController();
|
|
82
|
+
const timeout = setTimeout(() => controller.abort(), 3000);
|
|
83
|
+
const res = await fetch(`${gatewayUrl}/health`, { signal: controller.signal });
|
|
84
|
+
clearTimeout(timeout);
|
|
85
|
+
if (res.ok) {
|
|
86
|
+
checks.push({ name: "Gateway connection", status: "pass", message: `Reachable at ${gatewayUrl}` });
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
checks.push({
|
|
90
|
+
name: "Gateway connection",
|
|
91
|
+
status: "warn",
|
|
92
|
+
message: `Gateway returned ${res.status}`,
|
|
93
|
+
fix: "Check gateway logs: poolbot gateway logs",
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
checks.push({
|
|
99
|
+
name: "Gateway connection",
|
|
100
|
+
status: "fail",
|
|
101
|
+
message: `Cannot reach ${gatewayUrl}`,
|
|
102
|
+
fix: "Start gateway: poolbot gateway start",
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
checks.push({
|
|
108
|
+
name: "Gateway connection",
|
|
109
|
+
status: "warn",
|
|
110
|
+
message: "No gateway URL configured",
|
|
111
|
+
fix: "Set POOLBOT_GATEWAY_URL or run: poolbot gateway start",
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
// 6. Node.js version
|
|
115
|
+
const nodeVersion = process.version;
|
|
116
|
+
const major = parseInt(nodeVersion.replace("v", "").split(".")[0], 10);
|
|
117
|
+
if (major >= 22) {
|
|
118
|
+
checks.push({ name: "Node.js version", status: "pass", message: nodeVersion });
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
checks.push({
|
|
122
|
+
name: "Node.js version",
|
|
123
|
+
status: "fail",
|
|
124
|
+
message: `${nodeVersion} (requires >= 22)`,
|
|
125
|
+
fix: "Upgrade Node.js to v22+",
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
// 7. Sessions directory
|
|
129
|
+
const sessionsDir = path.join(configDir, "sessions");
|
|
130
|
+
if (fs.existsSync(sessionsDir)) {
|
|
131
|
+
const files = fs.readdirSync(sessionsDir);
|
|
132
|
+
checks.push({ name: "Sessions", status: "pass", message: `${files.length} sessions` });
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
checks.push({ name: "Sessions", status: "pass", message: "No sessions yet" });
|
|
136
|
+
}
|
|
137
|
+
// 8. Plugins
|
|
138
|
+
try {
|
|
139
|
+
const pluginsDir = path.join(process.cwd(), "extensions");
|
|
140
|
+
if (fs.existsSync(pluginsDir)) {
|
|
141
|
+
const plugins = fs.readdirSync(pluginsDir).filter((d) => {
|
|
142
|
+
const pkgPath = path.join(pluginsDir, d, "package.json");
|
|
143
|
+
return fs.existsSync(pkgPath);
|
|
144
|
+
});
|
|
145
|
+
checks.push({ name: "Extensions", status: "pass", message: `${plugins.length} extensions loaded` });
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
checks.push({ name: "Extensions", status: "warn", message: "Could not scan extensions" });
|
|
150
|
+
}
|
|
151
|
+
// Print results
|
|
152
|
+
const passCount = checks.filter((c) => c.status === "pass").length;
|
|
153
|
+
const warnCount = checks.filter((c) => c.status === "warn").length;
|
|
154
|
+
const failCount = checks.filter((c) => c.status === "fail").length;
|
|
155
|
+
for (const check of checks) {
|
|
156
|
+
const icon = check.status === "pass" ? "✅" : check.status === "warn" ? "⚠️" : "❌";
|
|
157
|
+
console.log(` ${icon} ${check.name}: ${check.message}`);
|
|
158
|
+
if (check.fix) {
|
|
159
|
+
console.log(` → ${check.fix}`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
console.log(`\n Summary: ${passCount} passed, ${warnCount} warnings, ${failCount} failed\n`);
|
|
163
|
+
if (failCount > 0) {
|
|
164
|
+
console.log(" Run the suggested fixes above, then run: poolbot doctor\n");
|
|
165
|
+
}
|
|
166
|
+
else if (warnCount > 0) {
|
|
167
|
+
console.log(" System is functional but could be improved. See warnings above.\n");
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
console.log(" All checks passed! System is healthy.\n");
|
|
171
|
+
}
|
|
172
|
+
}
|