@poolzin/pool-bot 2026.2.1 → 2026.2.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/CHANGELOG.md +118 -0
- package/README-header.png +0 -0
- package/dist/acp/server.js +2 -0
- package/dist/agents/agent-paths.js +3 -1
- package/dist/agents/anthropic-payload-log.js +2 -2
- package/dist/agents/bash-tools.exec.js +1 -1
- package/dist/agents/bash-tools.shared.js +2 -1
- package/dist/agents/cache-trace.js +5 -5
- package/dist/agents/cli-runner.js +1 -1
- package/dist/agents/context.js +1 -1
- package/dist/agents/live-auth-keys.js +2 -2
- package/dist/agents/model-catalog.js +1 -1
- package/dist/agents/pi-embedded-runner/compact.js +7 -10
- package/dist/agents/pi-embedded-runner/model.js +1 -1
- package/dist/agents/pi-embedded-runner/session-manager-cache.js +1 -1
- package/dist/agents/pi-embedded-subscribe.raw-stream.js +2 -2
- package/dist/agents/sandbox/browser.js +5 -0
- package/dist/agents/shell-utils.js +1 -1
- package/dist/agents/skills/bundled-dir.js +1 -1
- package/dist/agents/synthetic-models.js +8 -0
- package/dist/agents/tools/image-tool.js +1 -1
- package/dist/agents/workspace.js +1 -1
- package/dist/auto-reply/envelope.js +52 -38
- package/dist/auto-reply/reply/get-reply.js +1 -1
- package/dist/auto-reply/reply/mentions.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/canvas-host/a2ui/index.html +28 -28
- package/dist/canvas-host/server.js +1 -1
- package/dist/channels/plugins/catalog.js +1 -1
- package/dist/cli/banner.js +12 -12
- package/dist/cli/browser-cli-manage.js +10 -10
- package/dist/cli/browser-cli.js +1 -1
- package/dist/cli/channel-options.js +1 -1
- package/dist/cli/cli-name.js +1 -1
- package/dist/cli/command-format.js +1 -1
- package/dist/cli/daemon-cli/install.js +1 -1
- package/dist/cli/daemon-cli/shared.js +8 -3
- package/dist/cli/daemon-cli/status.gather.js +2 -2
- package/dist/cli/daemon-cli/status.print.js +3 -3
- package/dist/cli/gateway-cli/dev.js +1 -1
- package/dist/cli/gateway-cli/run.js +11 -6
- package/dist/cli/gateway-cli/shared.js +1 -1
- package/dist/cli/node-cli/daemon.js +2 -1
- package/dist/cli/profile.js +10 -4
- package/dist/cli/program/help.js +1 -1
- package/dist/cli/program/preaction.js +1 -1
- package/dist/cli/program/register.agent.js +4 -4
- package/dist/cli/program/register.onboard.js +1 -1
- package/dist/cli/program/register.setup.js +1 -1
- package/dist/cli/program/register.subclis.js +2 -2
- package/dist/cli/route.js +1 -1
- package/dist/cli/tagline.js +8 -8
- package/dist/cli/update-cli.js +12 -10
- package/dist/commands/auth-choice-options.js +104 -33
- package/dist/commands/auth-choice.apply.oauth.js +1 -1
- package/dist/commands/configure.wizard.js +10 -10
- package/dist/commands/daemon-install-helpers.js +1 -1
- package/dist/commands/dashboard.js +1 -1
- package/dist/commands/doctor-format.js +3 -3
- package/dist/commands/doctor-gateway-daemon-flow.js +3 -3
- package/dist/commands/doctor-gateway-services.js +2 -2
- package/dist/commands/doctor-platform-notes.js +23 -8
- package/dist/commands/doctor-update.js +1 -1
- package/dist/commands/gateway-status/helpers.js +2 -2
- package/dist/commands/health.js +2 -2
- package/dist/commands/models/list.registry.js +1 -1
- package/dist/commands/node-daemon-install-helpers.js +1 -1
- package/dist/commands/onboard-helpers.js +6 -6
- package/dist/commands/status-all.js +2 -2
- package/dist/commands/status.gateway-probe.js +2 -2
- package/dist/commands/status.scan.js +2 -2
- package/dist/compat/legacy-names.js +2 -0
- package/dist/config/io.js +5 -3
- package/dist/config/paths.js +15 -14
- package/dist/config/schema.field-metadata.js +1 -1
- package/dist/config/schema.js +1 -1
- package/dist/config/sessions/store.js +1 -1
- package/dist/control-ui/assets/{index-CIRDm-Lu.css → index-CSfXd2LO.css} +1 -1
- package/dist/control-ui/assets/{index-CmNMuoem.js → index-HRr1grwl.js} +446 -413
- package/dist/control-ui/assets/index-HRr1grwl.js.map +1 -0
- package/dist/control-ui/index.html +4 -4
- package/dist/cron/isolated-agent/run.js +1 -0
- package/dist/daemon/inspect.js +1 -1
- package/dist/daemon/launchd.js +5 -5
- package/dist/daemon/node-service.js +14 -0
- package/dist/daemon/paths.js +2 -2
- package/dist/daemon/schtasks.js +6 -6
- package/dist/daemon/service-env.js +25 -5
- package/dist/daemon/systemd.js +6 -6
- package/dist/entry.js +3 -2
- package/dist/gateway/auth.js +3 -3
- package/dist/gateway/call.js +2 -2
- package/dist/gateway/server/ws-connection/message-handler.js +1 -1
- package/dist/gateway/server-browser.js +2 -2
- package/dist/gateway/server-constants.js +2 -2
- package/dist/gateway/server-cron.js +1 -1
- package/dist/gateway/server-discovery-runtime.js +2 -2
- package/dist/gateway/server-discovery.js +2 -2
- package/dist/gateway/server-reload-handlers.js +4 -4
- package/dist/gateway/server-runtime-config.js +2 -2
- package/dist/gateway/server-startup.js +4 -4
- package/dist/gateway/server.impl.js +3 -2
- package/dist/gateway/test-helpers.mocks.js +14 -7
- package/dist/gateway/test-helpers.server.js +60 -22
- package/dist/hooks/bundled-dir.js +1 -1
- package/dist/hooks/gmail-watcher.js +1 -1
- package/dist/infra/bonjour.js +1 -1
- package/dist/infra/diagnostic-flags.js +3 -2
- package/dist/infra/dotenv.js +1 -1
- package/dist/infra/format-time/format-datetime.js +1 -1
- package/dist/infra/gateway-lock.js +1 -1
- package/dist/infra/home-dir.js +1 -1
- package/dist/infra/path-env.js +2 -1
- package/dist/infra/restart.js +3 -3
- package/dist/infra/shell-env.js +3 -3
- package/dist/infra/state-migrations.js +3 -3
- package/dist/infra/system-presence.js +1 -1
- package/dist/infra/update-runner.js +1 -1
- package/dist/infra/widearea-dns.js +1 -1
- package/dist/macos/gateway-daemon.js +6 -4
- package/dist/macos/relay-smoke.js +1 -1
- package/dist/macos/relay.js +1 -1
- package/dist/media/image-ops.js +2 -2
- package/dist/media/store.js +2 -0
- package/dist/media-understanding/providers/image.js +1 -1
- package/dist/memory/batch-gemini.js +1 -1
- package/dist/memory/embeddings-gemini.js +1 -1
- package/dist/node-host/runner.js +3 -2
- package/dist/plugins/bundled-dir.js +1 -1
- package/dist/plugins/manifest-registry.js +2 -2
- package/dist/security/audit-extra.sync.js +1 -1
- package/dist/security/audit.js +3 -2
- package/dist/telegram/accounts.js +1 -1
- package/dist/telegram/bot-message-dispatch.js +6 -2
- package/dist/telegram/network-config.js +6 -4
- package/dist/test-helpers/state-dir-env.js +8 -0
- package/dist/tts/tts.js +1 -1
- package/dist/tui/gateway-chat.js +2 -1
- package/dist/utils.js +2 -2
- package/dist/version.js +1 -1
- package/dist/wizard/clack-prompter.js +9 -6
- package/dist/wizard/onboarding.finalize.js +1 -1
- package/dist/wizard/onboarding.js +2 -2
- package/extensions/googlechat/node_modules/.bin/poolbot +21 -0
- package/extensions/googlechat/package.json +2 -2
- package/extensions/line/node_modules/.bin/poolbot +21 -0
- package/extensions/line/package.json +1 -1
- package/extensions/matrix/node_modules/.bin/poolbot +21 -0
- package/extensions/matrix/package.json +1 -1
- package/extensions/memory-core/node_modules/.bin/poolbot +21 -0
- package/extensions/memory-core/package.json +4 -1
- package/extensions/twitch/node_modules/.bin/poolbot +21 -0
- package/extensions/twitch/package.json +1 -1
- package/package.json +183 -24
- package/dist/control-ui/assets/index-CmNMuoem.js.map +0 -1
|
@@ -52,25 +52,37 @@ export async function writeSessionStore(params) {
|
|
|
52
52
|
async function setupGatewayTestHome() {
|
|
53
53
|
previousHome = process.env.HOME;
|
|
54
54
|
previousUserProfile = process.env.USERPROFILE;
|
|
55
|
-
previousStateDir = process.env.CLAWDBOT_STATE_DIR;
|
|
56
|
-
previousConfigPath = process.env.CLAWDBOT_CONFIG_PATH;
|
|
57
|
-
previousSkipBrowserControl =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
previousStateDir = process.env.POOLBOT_STATE_DIR ?? process.env.CLAWDBOT_STATE_DIR;
|
|
56
|
+
previousConfigPath = process.env.POOLBOT_CONFIG_PATH ?? process.env.CLAWDBOT_CONFIG_PATH;
|
|
57
|
+
previousSkipBrowserControl =
|
|
58
|
+
process.env.POOLBOT_SKIP_BROWSER_CONTROL_SERVER ??
|
|
59
|
+
process.env.CLAWDBOT_SKIP_BROWSER_CONTROL_SERVER;
|
|
60
|
+
previousSkipGmailWatcher =
|
|
61
|
+
process.env.POOLBOT_SKIP_GMAIL_WATCHER ?? process.env.CLAWDBOT_SKIP_GMAIL_WATCHER;
|
|
62
|
+
previousSkipCanvasHost =
|
|
63
|
+
process.env.POOLBOT_SKIP_CANVAS_HOST ?? process.env.CLAWDBOT_SKIP_CANVAS_HOST;
|
|
64
|
+
previousBundledPluginsDir =
|
|
65
|
+
process.env.POOLBOT_BUNDLED_PLUGINS_DIR ?? process.env.CLAWDBOT_BUNDLED_PLUGINS_DIR;
|
|
61
66
|
tempHome = await fs.mkdtemp(path.join(os.tmpdir(), "poolbot-gateway-home-"));
|
|
62
67
|
process.env.HOME = tempHome;
|
|
63
68
|
process.env.USERPROFILE = tempHome;
|
|
69
|
+
process.env.POOLBOT_STATE_DIR = path.join(tempHome, ".poolbot");
|
|
64
70
|
process.env.CLAWDBOT_STATE_DIR = path.join(tempHome, ".poolbot");
|
|
71
|
+
delete process.env.POOLBOT_CONFIG_PATH;
|
|
65
72
|
delete process.env.CLAWDBOT_CONFIG_PATH;
|
|
66
73
|
}
|
|
67
74
|
function applyGatewaySkipEnv() {
|
|
75
|
+
process.env.POOLBOT_SKIP_BROWSER_CONTROL_SERVER = "1";
|
|
68
76
|
process.env.CLAWDBOT_SKIP_BROWSER_CONTROL_SERVER = "1";
|
|
77
|
+
process.env.POOLBOT_SKIP_GMAIL_WATCHER = "1";
|
|
69
78
|
process.env.CLAWDBOT_SKIP_GMAIL_WATCHER = "1";
|
|
79
|
+
process.env.POOLBOT_SKIP_CANVAS_HOST = "1";
|
|
70
80
|
process.env.CLAWDBOT_SKIP_CANVAS_HOST = "1";
|
|
71
|
-
|
|
81
|
+
const bundledDir = tempHome
|
|
72
82
|
? path.join(tempHome, "poolbot-test-no-bundled-extensions")
|
|
73
83
|
: "poolbot-test-no-bundled-extensions";
|
|
84
|
+
process.env.POOLBOT_BUNDLED_PLUGINS_DIR = bundledDir;
|
|
85
|
+
process.env.CLAWDBOT_BUNDLED_PLUGINS_DIR = bundledDir;
|
|
74
86
|
}
|
|
75
87
|
async function resetGatewayTestState(options) {
|
|
76
88
|
// Some tests intentionally use fake timers; ensure they don't leak into gateway suites.
|
|
@@ -131,30 +143,54 @@ async function cleanupGatewayTestHome(options) {
|
|
|
131
143
|
delete process.env.USERPROFILE;
|
|
132
144
|
else
|
|
133
145
|
process.env.USERPROFILE = previousUserProfile;
|
|
134
|
-
if (previousStateDir === undefined)
|
|
146
|
+
if (previousStateDir === undefined) {
|
|
147
|
+
delete process.env.POOLBOT_STATE_DIR;
|
|
135
148
|
delete process.env.CLAWDBOT_STATE_DIR;
|
|
136
|
-
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
process.env.POOLBOT_STATE_DIR = previousStateDir;
|
|
137
152
|
process.env.CLAWDBOT_STATE_DIR = previousStateDir;
|
|
138
|
-
|
|
153
|
+
}
|
|
154
|
+
if (previousConfigPath === undefined) {
|
|
155
|
+
delete process.env.POOLBOT_CONFIG_PATH;
|
|
139
156
|
delete process.env.CLAWDBOT_CONFIG_PATH;
|
|
140
|
-
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
process.env.POOLBOT_CONFIG_PATH = previousConfigPath;
|
|
141
160
|
process.env.CLAWDBOT_CONFIG_PATH = previousConfigPath;
|
|
142
|
-
|
|
161
|
+
}
|
|
162
|
+
if (previousSkipBrowserControl === undefined) {
|
|
163
|
+
delete process.env.POOLBOT_SKIP_BROWSER_CONTROL_SERVER;
|
|
143
164
|
delete process.env.CLAWDBOT_SKIP_BROWSER_CONTROL_SERVER;
|
|
144
|
-
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
process.env.POOLBOT_SKIP_BROWSER_CONTROL_SERVER = previousSkipBrowserControl;
|
|
145
168
|
process.env.CLAWDBOT_SKIP_BROWSER_CONTROL_SERVER = previousSkipBrowserControl;
|
|
146
|
-
|
|
169
|
+
}
|
|
170
|
+
if (previousSkipGmailWatcher === undefined) {
|
|
171
|
+
delete process.env.POOLBOT_SKIP_GMAIL_WATCHER;
|
|
147
172
|
delete process.env.CLAWDBOT_SKIP_GMAIL_WATCHER;
|
|
148
|
-
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
process.env.POOLBOT_SKIP_GMAIL_WATCHER = previousSkipGmailWatcher;
|
|
149
176
|
process.env.CLAWDBOT_SKIP_GMAIL_WATCHER = previousSkipGmailWatcher;
|
|
150
|
-
|
|
177
|
+
}
|
|
178
|
+
if (previousSkipCanvasHost === undefined) {
|
|
179
|
+
delete process.env.POOLBOT_SKIP_CANVAS_HOST;
|
|
151
180
|
delete process.env.CLAWDBOT_SKIP_CANVAS_HOST;
|
|
152
|
-
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
process.env.POOLBOT_SKIP_CANVAS_HOST = previousSkipCanvasHost;
|
|
153
184
|
process.env.CLAWDBOT_SKIP_CANVAS_HOST = previousSkipCanvasHost;
|
|
154
|
-
|
|
185
|
+
}
|
|
186
|
+
if (previousBundledPluginsDir === undefined) {
|
|
187
|
+
delete process.env.POOLBOT_BUNDLED_PLUGINS_DIR;
|
|
155
188
|
delete process.env.CLAWDBOT_BUNDLED_PLUGINS_DIR;
|
|
156
|
-
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
process.env.POOLBOT_BUNDLED_PLUGINS_DIR = previousBundledPluginsDir;
|
|
157
192
|
process.env.CLAWDBOT_BUNDLED_PLUGINS_DIR = previousBundledPluginsDir;
|
|
193
|
+
}
|
|
158
194
|
}
|
|
159
195
|
if (options.restoreEnv && tempHome) {
|
|
160
196
|
await fs.rm(tempHome, {
|
|
@@ -238,7 +274,7 @@ export async function startGatewayServer(port, opts) {
|
|
|
238
274
|
}
|
|
239
275
|
export async function startServerWithClient(token, opts) {
|
|
240
276
|
let port = await getFreePort();
|
|
241
|
-
const prev = process.env.CLAWDBOT_GATEWAY_TOKEN;
|
|
277
|
+
const prev = process.env.POOLBOT_GATEWAY_TOKEN ?? process.env.CLAWDBOT_GATEWAY_TOKEN;
|
|
242
278
|
if (typeof token === "string") {
|
|
243
279
|
testState.gatewayAuth = { mode: "token", token };
|
|
244
280
|
}
|
|
@@ -247,9 +283,11 @@ export async function startServerWithClient(token, opts) {
|
|
|
247
283
|
? testState.gatewayAuth.token
|
|
248
284
|
: undefined);
|
|
249
285
|
if (fallbackToken === undefined) {
|
|
286
|
+
delete process.env.POOLBOT_GATEWAY_TOKEN;
|
|
250
287
|
delete process.env.CLAWDBOT_GATEWAY_TOKEN;
|
|
251
288
|
}
|
|
252
289
|
else {
|
|
290
|
+
process.env.POOLBOT_GATEWAY_TOKEN = fallbackToken;
|
|
253
291
|
process.env.CLAWDBOT_GATEWAY_TOKEN = fallbackToken;
|
|
254
292
|
}
|
|
255
293
|
let server = null;
|
|
@@ -309,12 +347,12 @@ export async function connectReq(ws, opts) {
|
|
|
309
347
|
? undefined
|
|
310
348
|
: typeof testState.gatewayAuth?.token === "string"
|
|
311
349
|
? (testState.gatewayAuth.token ?? undefined)
|
|
312
|
-
: process.env.CLAWDBOT_GATEWAY_TOKEN;
|
|
350
|
+
: (process.env.POOLBOT_GATEWAY_TOKEN ?? process.env.CLAWDBOT_GATEWAY_TOKEN);
|
|
313
351
|
const defaultPassword = opts?.skipDefaultAuth === true
|
|
314
352
|
? undefined
|
|
315
353
|
: typeof testState.gatewayAuth?.password === "string"
|
|
316
354
|
? (testState.gatewayAuth.password ?? undefined)
|
|
317
|
-
: process.env.CLAWDBOT_GATEWAY_PASSWORD;
|
|
355
|
+
: (process.env.POOLBOT_GATEWAY_PASSWORD ?? process.env.CLAWDBOT_GATEWAY_PASSWORD);
|
|
318
356
|
const token = opts?.token ?? defaultToken;
|
|
319
357
|
const password = opts?.password ?? defaultPassword;
|
|
320
358
|
const requestedScopes = Array.isArray(opts?.scopes) ? opts?.scopes : [];
|
|
@@ -2,7 +2,7 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
export function resolveBundledHooksDir() {
|
|
5
|
-
const override = process.env.CLAWDBOT_BUNDLED_HOOKS_DIR?.trim();
|
|
5
|
+
const override = process.env.POOLBOT_BUNDLED_HOOKS_DIR?.trim() || process.env.CLAWDBOT_BUNDLED_HOOKS_DIR?.trim();
|
|
6
6
|
if (override)
|
|
7
7
|
return override;
|
|
8
8
|
// bun --compile: ship a sibling `hooks/bundled/` next to the executable.
|
|
@@ -78,7 +78,7 @@ function spawnGogServe(cfg) {
|
|
|
78
78
|
return;
|
|
79
79
|
if (addressInUse) {
|
|
80
80
|
log.warn("gog serve failed to bind (address already in use); stopping restarts. " +
|
|
81
|
-
"Another watcher is likely running. Set
|
|
81
|
+
"Another watcher is likely running. Set POOLBOT_SKIP_GMAIL_WATCHER=1 or stop the other process.");
|
|
82
82
|
watcherProcess = null;
|
|
83
83
|
return;
|
|
84
84
|
}
|
package/dist/infra/bonjour.js
CHANGED
|
@@ -6,7 +6,7 @@ import { formatBonjourError } from "./bonjour-errors.js";
|
|
|
6
6
|
import { isTruthyEnvValue } from "./env.js";
|
|
7
7
|
import { registerUnhandledRejectionHandler } from "./unhandled-rejections.js";
|
|
8
8
|
function isDisabledByEnv() {
|
|
9
|
-
if (isTruthyEnvValue(process.env.CLAWDBOT_DISABLE_BONJOUR))
|
|
9
|
+
if (isTruthyEnvValue(process.env.POOLBOT_DISABLE_BONJOUR ?? process.env.CLAWDBOT_DISABLE_BONJOUR))
|
|
10
10
|
return true;
|
|
11
11
|
if (process.env.NODE_ENV === "test")
|
|
12
12
|
return true;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const DIAGNOSTICS_ENV = "
|
|
1
|
+
const DIAGNOSTICS_ENV = "POOLBOT_DIAGNOSTICS";
|
|
2
|
+
const DIAGNOSTICS_ENV_LEGACY = "CLAWDBOT_DIAGNOSTICS";
|
|
2
3
|
function normalizeFlag(value) {
|
|
3
4
|
return value.trim().toLowerCase();
|
|
4
5
|
}
|
|
@@ -32,7 +33,7 @@ function uniqueFlags(flags) {
|
|
|
32
33
|
}
|
|
33
34
|
export function resolveDiagnosticFlags(cfg, env = process.env) {
|
|
34
35
|
const configFlags = Array.isArray(cfg?.diagnostics?.flags) ? cfg?.diagnostics?.flags : [];
|
|
35
|
-
const envFlags = parseEnvFlags(env[DIAGNOSTICS_ENV]);
|
|
36
|
+
const envFlags = parseEnvFlags(env[DIAGNOSTICS_ENV] ?? env[DIAGNOSTICS_ENV_LEGACY]);
|
|
36
37
|
return uniqueFlags([...configFlags, ...envFlags]);
|
|
37
38
|
}
|
|
38
39
|
export function matchesDiagnosticFlag(flag, enabledFlags) {
|
package/dist/infra/dotenv.js
CHANGED
|
@@ -6,7 +6,7 @@ export function loadDotEnv(opts) {
|
|
|
6
6
|
const quiet = opts?.quiet ?? true;
|
|
7
7
|
// Load from process CWD first (dotenv default).
|
|
8
8
|
dotenv.config({ quiet });
|
|
9
|
-
// Then load global fallback: ~/.poolbot/.env (or
|
|
9
|
+
// Then load global fallback: ~/.poolbot/.env (or POOLBOT_STATE_DIR/.env),
|
|
10
10
|
// without overriding any env vars already present.
|
|
11
11
|
const globalEnvPath = path.join(resolveConfigDir(process.env), ".env");
|
|
12
12
|
if (!fs.existsSync(globalEnvPath))
|
|
@@ -66,7 +66,7 @@ export function formatZonedTimestamp(date, options) {
|
|
|
66
66
|
const min = pick("minute");
|
|
67
67
|
const sec = options?.displaySeconds ? pick("second") : undefined;
|
|
68
68
|
const tz = [...parts]
|
|
69
|
-
.
|
|
69
|
+
.toReversed()
|
|
70
70
|
.find((part) => part.type === "timeZoneName")
|
|
71
71
|
?.value?.trim();
|
|
72
72
|
if (!yyyy || !mm || !dd || !hh || !min) {
|
|
@@ -126,7 +126,7 @@ function resolveGatewayLockPath(env) {
|
|
|
126
126
|
export async function acquireGatewayLock(opts = {}) {
|
|
127
127
|
const env = opts.env ?? process.env;
|
|
128
128
|
const allowInTests = opts.allowInTests === true;
|
|
129
|
-
if (env.CLAWDBOT_ALLOW_MULTI_GATEWAY === "1" ||
|
|
129
|
+
if ((env.POOLBOT_ALLOW_MULTI_GATEWAY ?? env.CLAWDBOT_ALLOW_MULTI_GATEWAY) === "1" ||
|
|
130
130
|
(!allowInTests && (env.VITEST || env.NODE_ENV === "test"))) {
|
|
131
131
|
return null;
|
|
132
132
|
}
|
package/dist/infra/home-dir.js
CHANGED
|
@@ -9,7 +9,7 @@ export function resolveEffectiveHomeDir(env = process.env, homedir = os.homedir)
|
|
|
9
9
|
return raw ? path.resolve(raw) : undefined;
|
|
10
10
|
}
|
|
11
11
|
function resolveRawHomeDir(env, homedir) {
|
|
12
|
-
const explicitHome = normalize(env.CLAWDBOT_HOME);
|
|
12
|
+
const explicitHome = normalize(env.POOLBOT_HOME) ?? normalize(env.CLAWDBOT_HOME);
|
|
13
13
|
if (explicitHome) {
|
|
14
14
|
if (explicitHome === "~" || explicitHome.startsWith("~/") || explicitHome.startsWith("~\\")) {
|
|
15
15
|
const fallbackHome = normalize(env.HOME) ?? normalize(env.USERPROFILE) ?? normalizeSafe(homedir);
|
package/dist/infra/path-env.js
CHANGED
|
@@ -80,8 +80,9 @@ function candidateBinDirs(opts) {
|
|
|
80
80
|
* under launchd/minimal environments (and inside the macOS app bundle).
|
|
81
81
|
*/
|
|
82
82
|
export function ensurePoolbotCliOnPath(opts = {}) {
|
|
83
|
-
if (isTruthyEnvValue(process.env.CLAWDBOT_PATH_BOOTSTRAPPED))
|
|
83
|
+
if (isTruthyEnvValue(process.env.POOLBOT_PATH_BOOTSTRAPPED ?? process.env.CLAWDBOT_PATH_BOOTSTRAPPED))
|
|
84
84
|
return;
|
|
85
|
+
process.env.POOLBOT_PATH_BOOTSTRAPPED = "1";
|
|
85
86
|
process.env.CLAWDBOT_PATH_BOOTSTRAPPED = "1";
|
|
86
87
|
const existing = opts.pathEnv ?? process.env.PATH ?? "";
|
|
87
88
|
const prepend = candidateBinDirs(opts);
|
package/dist/infra/restart.js
CHANGED
|
@@ -78,7 +78,7 @@ export function triggerPoolbotRestart() {
|
|
|
78
78
|
const tried = [];
|
|
79
79
|
if (process.platform !== "darwin") {
|
|
80
80
|
if (process.platform === "linux") {
|
|
81
|
-
const unit = normalizeSystemdUnit(process.env.CLAWDBOT_SYSTEMD_UNIT, process.env.CLAWDBOT_PROFILE);
|
|
81
|
+
const unit = normalizeSystemdUnit(process.env.POOLBOT_SYSTEMD_UNIT ?? process.env.CLAWDBOT_SYSTEMD_UNIT, process.env.POOLBOT_PROFILE ?? process.env.CLAWDBOT_PROFILE);
|
|
82
82
|
const userArgs = ["--user", "restart", unit];
|
|
83
83
|
tried.push(`systemctl ${userArgs.join(" ")}`);
|
|
84
84
|
const userRestart = spawnSync("systemctl", userArgs, {
|
|
@@ -109,8 +109,8 @@ export function triggerPoolbotRestart() {
|
|
|
109
109
|
detail: "unsupported platform restart",
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
const label = process.env.CLAWDBOT_LAUNCHD_LABEL ||
|
|
113
|
-
resolveGatewayLaunchAgentLabel(process.env.CLAWDBOT_PROFILE);
|
|
112
|
+
const label = process.env.POOLBOT_LAUNCHD_LABEL || process.env.CLAWDBOT_LAUNCHD_LABEL ||
|
|
113
|
+
resolveGatewayLaunchAgentLabel(process.env.POOLBOT_PROFILE ?? process.env.CLAWDBOT_PROFILE);
|
|
114
114
|
const uid = typeof process.getuid === "function" ? process.getuid() : undefined;
|
|
115
115
|
const target = uid !== undefined ? `gui/${uid}/${label}` : label;
|
|
116
116
|
const args = ["kickstart", "-k", target];
|
package/dist/infra/shell-env.js
CHANGED
|
@@ -72,13 +72,13 @@ export function loadShellEnvFallback(opts) {
|
|
|
72
72
|
return { ok: true, applied };
|
|
73
73
|
}
|
|
74
74
|
export function shouldEnableShellEnvFallback(env) {
|
|
75
|
-
return isTruthyEnvValue(env.CLAWDBOT_LOAD_SHELL_ENV);
|
|
75
|
+
return isTruthyEnvValue(env.POOLBOT_LOAD_SHELL_ENV) || isTruthyEnvValue(env.CLAWDBOT_LOAD_SHELL_ENV);
|
|
76
76
|
}
|
|
77
77
|
export function shouldDeferShellEnvFallback(env) {
|
|
78
|
-
return isTruthyEnvValue(env.CLAWDBOT_DEFER_SHELL_ENV_FALLBACK);
|
|
78
|
+
return isTruthyEnvValue(env.POOLBOT_DEFER_SHELL_ENV_FALLBACK) || isTruthyEnvValue(env.CLAWDBOT_DEFER_SHELL_ENV_FALLBACK);
|
|
79
79
|
}
|
|
80
80
|
export function resolveShellEnvFallbackTimeoutMs(env) {
|
|
81
|
-
const raw = env.CLAWDBOT_SHELL_ENV_TIMEOUT_MS?.trim();
|
|
81
|
+
const raw = env.POOLBOT_SHELL_ENV_TIMEOUT_MS?.trim() || env.CLAWDBOT_SHELL_ENV_TIMEOUT_MS?.trim();
|
|
82
82
|
if (!raw)
|
|
83
83
|
return DEFAULT_TIMEOUT_MS;
|
|
84
84
|
const parsed = Number.parseInt(raw, 10);
|
|
@@ -324,7 +324,7 @@ export async function autoMigrateLegacyStateDir(params) {
|
|
|
324
324
|
}
|
|
325
325
|
autoMigrateStateDirChecked = true;
|
|
326
326
|
const env = params.env ?? process.env;
|
|
327
|
-
if (env.CLAWDBOT_STATE_DIR?.trim()) {
|
|
327
|
+
if (env.POOLBOT_STATE_DIR?.trim() || env.CLAWDBOT_STATE_DIR?.trim()) {
|
|
328
328
|
return { migrated: false, skipped: true, changes: [], warnings: [] };
|
|
329
329
|
}
|
|
330
330
|
const homedir = params.homedir ?? os.homedir;
|
|
@@ -439,7 +439,7 @@ export async function autoMigrateLegacyStateDir(params) {
|
|
|
439
439
|
}
|
|
440
440
|
catch (rollbackErr) {
|
|
441
441
|
warnings.push(`State dir moved but failed to link legacy path (${legacyDir ?? "unknown"} → ${targetDir}): ${String(fallbackErr)}`);
|
|
442
|
-
warnings.push(`Rollback failed; set
|
|
442
|
+
warnings.push(`Rollback failed; set POOLBOT_STATE_DIR=${targetDir} to avoid split state: ${String(rollbackErr)}`);
|
|
443
443
|
changes.push(`State dir: ${legacyDir ?? "unknown"} → ${targetDir}`);
|
|
444
444
|
}
|
|
445
445
|
}
|
|
@@ -726,7 +726,7 @@ export async function autoMigrateLegacyState(params) {
|
|
|
726
726
|
homedir: params.homedir,
|
|
727
727
|
log: params.log,
|
|
728
728
|
});
|
|
729
|
-
if (env.CLAWDBOT_AGENT_DIR?.trim() || env.PI_CODING_AGENT_DIR?.trim()) {
|
|
729
|
+
if (env.POOLBOT_AGENT_DIR?.trim() || env.CLAWDBOT_AGENT_DIR?.trim() || env.PI_CODING_AGENT_DIR?.trim()) {
|
|
730
730
|
return {
|
|
731
731
|
migrated: stateDirResult.migrated,
|
|
732
732
|
skipped: true,
|
|
@@ -33,7 +33,7 @@ function resolvePrimaryIPv4() {
|
|
|
33
33
|
function initSelfPresence() {
|
|
34
34
|
const host = os.hostname();
|
|
35
35
|
const ip = resolvePrimaryIPv4() ?? undefined;
|
|
36
|
-
const version = process.env.CLAWDBOT_VERSION ?? process.env.npm_package_version ?? "unknown";
|
|
36
|
+
const version = process.env.POOLBOT_VERSION ?? process.env.CLAWDBOT_VERSION ?? process.env.npm_package_version ?? "unknown";
|
|
37
37
|
const modelIdentifier = (() => {
|
|
38
38
|
const p = os.platform();
|
|
39
39
|
if (p === "darwin") {
|
|
@@ -560,7 +560,7 @@ export async function runGatewayUpdate(opts = {}) {
|
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
562
|
const doctorArgv = [process.execPath, doctorEntry, "doctor", "--non-interactive"];
|
|
563
|
-
const doctorStep = await runStep(step("poolbot doctor", doctorArgv, gitRoot, { CLAWDBOT_UPDATE_IN_PROGRESS: "1" }));
|
|
563
|
+
const doctorStep = await runStep(step("poolbot doctor", doctorArgv, gitRoot, { POOLBOT_UPDATE_IN_PROGRESS: "1", CLAWDBOT_UPDATE_IN_PROGRESS: "1" }));
|
|
564
564
|
steps.push(doctorStep);
|
|
565
565
|
const uiIndexHealth = await resolveControlUiDistIndexHealth({ root: gitRoot });
|
|
566
566
|
if (!uiIndexHealth.exists) {
|
|
@@ -11,7 +11,7 @@ export function normalizeWideAreaDomain(raw) {
|
|
|
11
11
|
}
|
|
12
12
|
export function resolveWideAreaDiscoveryDomain(params) {
|
|
13
13
|
const env = params?.env ?? process.env;
|
|
14
|
-
const candidate = params?.configDomain ?? env.CLAWDBOT_WIDE_AREA_DOMAIN ?? null;
|
|
14
|
+
const candidate = params?.configDomain ?? env.POOLBOT_WIDE_AREA_DOMAIN ?? env.CLAWDBOT_WIDE_AREA_DOMAIN ?? null;
|
|
15
15
|
return normalizeWideAreaDomain(candidate);
|
|
16
16
|
}
|
|
17
17
|
function zoneFilenameForDomain(domain) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
const BUNDLED_VERSION = (typeof __CLAWDBOT_VERSION__ === "string" && __CLAWDBOT_VERSION__) ||
|
|
4
|
-
process.env.CLAWDBOT_BUNDLED_VERSION ||
|
|
4
|
+
process.env.POOLBOT_BUNDLED_VERSION || process.env.CLAWDBOT_BUNDLED_VERSION ||
|
|
5
5
|
"0.0.0";
|
|
6
6
|
function argValue(args, flag) {
|
|
7
7
|
const idx = args.indexOf(flag);
|
|
@@ -47,7 +47,7 @@ async function main() {
|
|
|
47
47
|
setGatewayWsLogStyle(wsLogStyle);
|
|
48
48
|
const cfg = loadConfig();
|
|
49
49
|
const portRaw = argValue(args, "--port") ??
|
|
50
|
-
process.env.CLAWDBOT_GATEWAY_PORT ??
|
|
50
|
+
process.env.POOLBOT_GATEWAY_PORT ?? process.env.CLAWDBOT_GATEWAY_PORT ??
|
|
51
51
|
(typeof cfg.gateway?.port === "number" ? String(cfg.gateway.port) : "") ??
|
|
52
52
|
"18789";
|
|
53
53
|
const port = Number.parseInt(portRaw, 10);
|
|
@@ -56,7 +56,7 @@ async function main() {
|
|
|
56
56
|
process.exit(1);
|
|
57
57
|
}
|
|
58
58
|
const bindRaw = argValue(args, "--bind") ??
|
|
59
|
-
process.env.CLAWDBOT_GATEWAY_BIND ??
|
|
59
|
+
process.env.POOLBOT_GATEWAY_BIND ?? process.env.CLAWDBOT_GATEWAY_BIND ??
|
|
60
60
|
cfg.gateway?.bind ??
|
|
61
61
|
"loopback";
|
|
62
62
|
const bind = bindRaw === "loopback" ||
|
|
@@ -71,8 +71,10 @@ async function main() {
|
|
|
71
71
|
process.exit(1);
|
|
72
72
|
}
|
|
73
73
|
const token = argValue(args, "--token");
|
|
74
|
-
if (token)
|
|
74
|
+
if (token) {
|
|
75
|
+
process.env.POOLBOT_GATEWAY_TOKEN = token;
|
|
75
76
|
process.env.CLAWDBOT_GATEWAY_TOKEN = token;
|
|
77
|
+
}
|
|
76
78
|
let server = null;
|
|
77
79
|
let lock = null;
|
|
78
80
|
let shuttingDown = false;
|
|
@@ -13,7 +13,7 @@ export function parseRelaySmokeTest(args, env) {
|
|
|
13
13
|
return "qr";
|
|
14
14
|
// Back-compat: only run env-based smoke mode when no CLI args are present,
|
|
15
15
|
// to avoid surprising early-exit when users set env vars globally.
|
|
16
|
-
if (args.length === 0 && (env.CLAWDBOT_SMOKE_QR === "1" || env.CLAWDBOT_SMOKE === "qr")) {
|
|
16
|
+
if (args.length === 0 && (env.POOLBOT_SMOKE_QR === "1" || env.CLAWDBOT_SMOKE_QR === "1" || env.POOLBOT_SMOKE === "qr" || env.CLAWDBOT_SMOKE === "qr")) {
|
|
17
17
|
return "qr";
|
|
18
18
|
}
|
|
19
19
|
return null;
|
package/dist/macos/relay.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
const BUNDLED_VERSION = (typeof __CLAWDBOT_VERSION__ === "string" && __CLAWDBOT_VERSION__) ||
|
|
4
|
-
process.env.CLAWDBOT_BUNDLED_VERSION ||
|
|
4
|
+
process.env.POOLBOT_BUNDLED_VERSION || process.env.CLAWDBOT_BUNDLED_VERSION ||
|
|
5
5
|
"0.0.0";
|
|
6
6
|
function hasFlag(args, flag) {
|
|
7
7
|
return args.includes(flag);
|
package/dist/media/image-ops.js
CHANGED
|
@@ -6,8 +6,8 @@ function isBun() {
|
|
|
6
6
|
return typeof process.versions.bun === "string";
|
|
7
7
|
}
|
|
8
8
|
function prefersSips() {
|
|
9
|
-
return (process.env.CLAWDBOT_IMAGE_BACKEND === "sips" ||
|
|
10
|
-
(process.env.CLAWDBOT_IMAGE_BACKEND !== "sharp" && isBun() && process.platform === "darwin"));
|
|
9
|
+
return ((process.env.POOLBOT_IMAGE_BACKEND || process.env.CLAWDBOT_IMAGE_BACKEND) === "sips" ||
|
|
10
|
+
((process.env.POOLBOT_IMAGE_BACKEND || process.env.CLAWDBOT_IMAGE_BACKEND) !== "sharp" && isBun() && process.platform === "darwin"));
|
|
11
11
|
}
|
|
12
12
|
async function loadSharp() {
|
|
13
13
|
const mod = (await import("sharp"));
|
package/dist/media/store.js
CHANGED
|
@@ -3,6 +3,7 @@ import { createWriteStream } from "node:fs";
|
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import { request as httpRequest } from "node:http";
|
|
5
5
|
import { request as httpsRequest } from "node:https";
|
|
6
|
+
import os from "node:os";
|
|
6
7
|
import path from "node:path";
|
|
7
8
|
import { pipeline } from "node:stream/promises";
|
|
8
9
|
import { resolveConfigDir } from "../utils.js";
|
|
@@ -24,6 +25,7 @@ const DEFAULT_TTL_MS = 2 * 60 * 1000; // 2 minutes
|
|
|
24
25
|
const SAFE_PATHS = [
|
|
25
26
|
"/tmp",
|
|
26
27
|
"/var/tmp",
|
|
28
|
+
os.tmpdir(), // OS-specific temp directory (e.g. /private/var/folders/... on macOS)
|
|
27
29
|
process.cwd(), // Current working directory
|
|
28
30
|
resolveConfigDir(), // PoolBot config directory
|
|
29
31
|
];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { complete } from "@mariozechner/pi-ai";
|
|
2
|
-
import { discoverAuthStorage, discoverModels } from "
|
|
2
|
+
import { discoverAuthStorage, discoverModels } from "../../agents/pi-model-discovery.js";
|
|
3
3
|
import { getApiKeyForModel, requireApiKey } from "../../agents/model-auth.js";
|
|
4
4
|
import { ensurePoolbotModelsJson } from "../../agents/models-config.js";
|
|
5
5
|
import { minimaxUnderstandImage } from "../../agents/minimax-vlm.js";
|
|
@@ -2,7 +2,7 @@ import { createSubsystemLogger } from "../logging/subsystem.js";
|
|
|
2
2
|
import { isTruthyEnvValue } from "../infra/env.js";
|
|
3
3
|
import { hashText } from "./internal.js";
|
|
4
4
|
const GEMINI_BATCH_MAX_REQUESTS = 50000;
|
|
5
|
-
const debugEmbeddings = isTruthyEnvValue(process.env.CLAWDBOT_DEBUG_MEMORY_EMBEDDINGS);
|
|
5
|
+
const debugEmbeddings = isTruthyEnvValue(process.env.POOLBOT_DEBUG_MEMORY_EMBEDDINGS || process.env.CLAWDBOT_DEBUG_MEMORY_EMBEDDINGS);
|
|
6
6
|
const log = createSubsystemLogger("memory/embeddings");
|
|
7
7
|
const debugLog = (message, meta) => {
|
|
8
8
|
if (!debugEmbeddings)
|
|
@@ -3,7 +3,7 @@ import { isTruthyEnvValue } from "../infra/env.js";
|
|
|
3
3
|
import { createSubsystemLogger } from "../logging/subsystem.js";
|
|
4
4
|
const DEFAULT_GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
|
|
5
5
|
export const DEFAULT_GEMINI_EMBEDDING_MODEL = "gemini-embedding-001";
|
|
6
|
-
const debugEmbeddings = isTruthyEnvValue(process.env.CLAWDBOT_DEBUG_MEMORY_EMBEDDINGS);
|
|
6
|
+
const debugEmbeddings = isTruthyEnvValue(process.env.POOLBOT_DEBUG_MEMORY_EMBEDDINGS || process.env.CLAWDBOT_DEBUG_MEMORY_EMBEDDINGS);
|
|
7
7
|
const log = createSubsystemLogger("memory/embeddings");
|
|
8
8
|
const debugLog = (message, meta) => {
|
|
9
9
|
if (!debugEmbeddings)
|
package/dist/node-host/runner.js
CHANGED
|
@@ -354,9 +354,10 @@ export async function runNodeHost(opts) {
|
|
|
354
354
|
const resolvedBrowser = resolveBrowserConfig(cfg.browser, cfg);
|
|
355
355
|
const browserProxyEnabled = browserProxy.enabled && resolvedBrowser.enabled;
|
|
356
356
|
const isRemoteMode = cfg.gateway?.mode === "remote";
|
|
357
|
-
const token = process.env.CLAWDBOT_GATEWAY_TOKEN?.trim() ||
|
|
357
|
+
const token = process.env.POOLBOT_GATEWAY_TOKEN?.trim() || process.env.CLAWDBOT_GATEWAY_TOKEN?.trim() ||
|
|
358
358
|
(isRemoteMode ? cfg.gateway?.remote?.token : cfg.gateway?.auth?.token);
|
|
359
|
-
const password = process.env.
|
|
359
|
+
const password = process.env.POOLBOT_GATEWAY_PASSWORD?.trim() ||
|
|
360
|
+
process.env.CLAWDBOT_GATEWAY_PASSWORD?.trim() ||
|
|
360
361
|
(isRemoteMode ? cfg.gateway?.remote?.password : cfg.gateway?.auth?.password);
|
|
361
362
|
const host = gateway.host ?? "127.0.0.1";
|
|
362
363
|
const port = gateway.port ?? 18789;
|
|
@@ -2,7 +2,7 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
export function resolveBundledPluginsDir() {
|
|
5
|
-
const override = process.env.CLAWDBOT_BUNDLED_PLUGINS_DIR?.trim();
|
|
5
|
+
const override = process.env.POOLBOT_BUNDLED_PLUGINS_DIR?.trim() || process.env.CLAWDBOT_BUNDLED_PLUGINS_DIR?.trim();
|
|
6
6
|
if (override)
|
|
7
7
|
return override;
|
|
8
8
|
// bun --compile: ship a sibling `extensions/` next to the executable.
|
|
@@ -6,7 +6,7 @@ import { loadPluginManifest } from "./manifest.js";
|
|
|
6
6
|
const registryCache = new Map();
|
|
7
7
|
const DEFAULT_MANIFEST_CACHE_MS = 200;
|
|
8
8
|
function resolveManifestCacheMs(env) {
|
|
9
|
-
const raw = env.CLAWDBOT_PLUGIN_MANIFEST_CACHE_MS?.trim();
|
|
9
|
+
const raw = env.POOLBOT_PLUGIN_MANIFEST_CACHE_MS?.trim() || env.CLAWDBOT_PLUGIN_MANIFEST_CACHE_MS?.trim();
|
|
10
10
|
if (raw === "" || raw === "0")
|
|
11
11
|
return 0;
|
|
12
12
|
if (!raw)
|
|
@@ -17,7 +17,7 @@ function resolveManifestCacheMs(env) {
|
|
|
17
17
|
return Math.max(0, parsed);
|
|
18
18
|
}
|
|
19
19
|
function shouldUseManifestCache(env) {
|
|
20
|
-
const disabled = env.CLAWDBOT_DISABLE_PLUGIN_MANIFEST_CACHE?.trim();
|
|
20
|
+
const disabled = env.POOLBOT_DISABLE_PLUGIN_MANIFEST_CACHE?.trim() || env.CLAWDBOT_DISABLE_PLUGIN_MANIFEST_CACHE?.trim();
|
|
21
21
|
if (disabled)
|
|
22
22
|
return false;
|
|
23
23
|
return resolveManifestCacheMs(env) > 0;
|
|
@@ -272,7 +272,7 @@ export function collectSecretsInConfigFindings(cfg) {
|
|
|
272
272
|
severity: "warn",
|
|
273
273
|
title: "Gateway password is stored in config",
|
|
274
274
|
detail: "gateway.auth.password is set in the config file; prefer environment variables for secrets when possible.",
|
|
275
|
-
remediation: "Prefer
|
|
275
|
+
remediation: "Prefer POOLBOT_GATEWAY_PASSWORD (env) and remove gateway.auth.password from disk.",
|
|
276
276
|
});
|
|
277
277
|
}
|
|
278
278
|
const hooksToken = typeof cfg.hooks?.token === "string" ? cfg.hooks.token.trim() : "";
|
package/dist/security/audit.js
CHANGED
|
@@ -664,9 +664,10 @@ async function maybeProbeGateway(params) {
|
|
|
664
664
|
? typeof remote?.token === "string" && remote.token.trim()
|
|
665
665
|
? remote.token.trim()
|
|
666
666
|
: undefined
|
|
667
|
-
: process.env.CLAWDBOT_GATEWAY_TOKEN?.trim() ||
|
|
667
|
+
: process.env.POOLBOT_GATEWAY_TOKEN?.trim() || process.env.CLAWDBOT_GATEWAY_TOKEN?.trim() ||
|
|
668
668
|
(typeof authToken === "string" && authToken.trim() ? authToken.trim() : undefined);
|
|
669
|
-
const password = process.env.
|
|
669
|
+
const password = process.env.POOLBOT_GATEWAY_PASSWORD?.trim() ||
|
|
670
|
+
process.env.CLAWDBOT_GATEWAY_PASSWORD?.trim() ||
|
|
670
671
|
(mode === "remote"
|
|
671
672
|
? typeof remote?.password === "string" && remote.password.trim()
|
|
672
673
|
? remote.password.trim()
|
|
@@ -3,7 +3,7 @@ import { listBoundAccountIds, resolveDefaultAgentBoundAccountId } from "../routi
|
|
|
3
3
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../routing/session-key.js";
|
|
4
4
|
import { resolveTelegramToken } from "./token.js";
|
|
5
5
|
const debugAccounts = (...args) => {
|
|
6
|
-
if (isTruthyEnvValue(process.env.CLAWDBOT_DEBUG_TELEGRAM_ACCOUNTS)) {
|
|
6
|
+
if (isTruthyEnvValue(process.env.POOLBOT_DEBUG_TELEGRAM_ACCOUNTS || process.env.CLAWDBOT_DEBUG_TELEGRAM_ACCOUNTS)) {
|
|
7
7
|
console.warn("[telegram:accounts]", ...args);
|
|
8
8
|
}
|
|
9
9
|
};
|
|
@@ -172,7 +172,10 @@ export const dispatchTelegramMessage = async ({ context, bot, cfg, runtime, repl
|
|
|
172
172
|
? ctxPayload.ReplyToBody.trim() || undefined
|
|
173
173
|
: undefined;
|
|
174
174
|
void _replyQuoteText;
|
|
175
|
-
const
|
|
175
|
+
const deliveryState = {
|
|
176
|
+
delivered: false,
|
|
177
|
+
};
|
|
178
|
+
const { queuedFinal, counts } = await dispatchReplyWithBufferedBlockDispatcher({
|
|
176
179
|
ctx: ctxPayload,
|
|
177
180
|
cfg,
|
|
178
181
|
dispatcherOptions: {
|
|
@@ -197,6 +200,7 @@ export const dispatchTelegramMessage = async ({ context, bot, cfg, runtime, repl
|
|
|
197
200
|
onVoiceRecording: sendRecordVoice,
|
|
198
201
|
linkPreview: telegramCfg.linkPreview,
|
|
199
202
|
});
|
|
203
|
+
deliveryState.delivered = true;
|
|
200
204
|
},
|
|
201
205
|
onError: (err, info) => {
|
|
202
206
|
runtime.error?.(danger(`telegram ${info.kind} reply failed: ${String(err)}`));
|
|
@@ -230,7 +234,7 @@ export const dispatchTelegramMessage = async ({ context, bot, cfg, runtime, repl
|
|
|
230
234
|
});
|
|
231
235
|
draftStream?.stop();
|
|
232
236
|
let sentFallback = false;
|
|
233
|
-
if (!
|
|
237
|
+
if (!deliveryState.delivered && (counts.tool + counts.block + counts.final) > 0) {
|
|
234
238
|
try {
|
|
235
239
|
await deliverReplies({
|
|
236
240
|
replies: [{ text: EMPTY_RESPONSE_FALLBACK }],
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import process from "node:process";
|
|
2
2
|
import { isTruthyEnvValue } from "../infra/env.js";
|
|
3
|
-
export const TELEGRAM_DISABLE_AUTO_SELECT_FAMILY_ENV = "
|
|
4
|
-
export const TELEGRAM_ENABLE_AUTO_SELECT_FAMILY_ENV = "
|
|
3
|
+
export const TELEGRAM_DISABLE_AUTO_SELECT_FAMILY_ENV = "POOLBOT_TELEGRAM_DISABLE_AUTO_SELECT_FAMILY";
|
|
4
|
+
export const TELEGRAM_ENABLE_AUTO_SELECT_FAMILY_ENV = "POOLBOT_TELEGRAM_ENABLE_AUTO_SELECT_FAMILY";
|
|
5
|
+
const TELEGRAM_DISABLE_AUTO_SELECT_FAMILY_ENV_LEGACY = "CLAWDBOT_TELEGRAM_DISABLE_AUTO_SELECT_FAMILY";
|
|
6
|
+
const TELEGRAM_ENABLE_AUTO_SELECT_FAMILY_ENV_LEGACY = "CLAWDBOT_TELEGRAM_ENABLE_AUTO_SELECT_FAMILY";
|
|
5
7
|
export function resolveTelegramAutoSelectFamilyDecision(params) {
|
|
6
8
|
const env = params?.env ?? process.env;
|
|
7
9
|
const nodeMajor = typeof params?.nodeMajor === "number"
|
|
8
10
|
? params.nodeMajor
|
|
9
11
|
: Number(process.versions.node.split(".")[0]);
|
|
10
|
-
if (isTruthyEnvValue(env[TELEGRAM_ENABLE_AUTO_SELECT_FAMILY_ENV])) {
|
|
12
|
+
if (isTruthyEnvValue(env[TELEGRAM_ENABLE_AUTO_SELECT_FAMILY_ENV]) || isTruthyEnvValue(env[TELEGRAM_ENABLE_AUTO_SELECT_FAMILY_ENV_LEGACY])) {
|
|
11
13
|
return { value: true, source: `env:${TELEGRAM_ENABLE_AUTO_SELECT_FAMILY_ENV}` };
|
|
12
14
|
}
|
|
13
|
-
if (isTruthyEnvValue(env[TELEGRAM_DISABLE_AUTO_SELECT_FAMILY_ENV])) {
|
|
15
|
+
if (isTruthyEnvValue(env[TELEGRAM_DISABLE_AUTO_SELECT_FAMILY_ENV]) || isTruthyEnvValue(env[TELEGRAM_DISABLE_AUTO_SELECT_FAMILY_ENV_LEGACY])) {
|
|
14
16
|
return { value: false, source: `env:${TELEGRAM_DISABLE_AUTO_SELECT_FAMILY_ENV}` };
|
|
15
17
|
}
|
|
16
18
|
if (typeof params?.network?.autoSelectFamily === "boolean") {
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
export function snapshotStateDirEnv() {
|
|
2
2
|
return {
|
|
3
|
+
poolbotStateDir: process.env.POOLBOT_STATE_DIR,
|
|
3
4
|
clawdbotStateDir: process.env.CLAWDBOT_STATE_DIR,
|
|
4
5
|
};
|
|
5
6
|
}
|
|
6
7
|
export function restoreStateDirEnv(snapshot) {
|
|
8
|
+
if (snapshot.poolbotStateDir === undefined) {
|
|
9
|
+
delete process.env.POOLBOT_STATE_DIR;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
process.env.POOLBOT_STATE_DIR = snapshot.poolbotStateDir;
|
|
13
|
+
}
|
|
7
14
|
if (snapshot.clawdbotStateDir === undefined) {
|
|
8
15
|
delete process.env.CLAWDBOT_STATE_DIR;
|
|
9
16
|
}
|
|
@@ -12,5 +19,6 @@ export function restoreStateDirEnv(snapshot) {
|
|
|
12
19
|
}
|
|
13
20
|
}
|
|
14
21
|
export function setStateDirEnv(stateDir) {
|
|
22
|
+
process.env.POOLBOT_STATE_DIR = stateDir;
|
|
15
23
|
process.env.CLAWDBOT_STATE_DIR = stateDir;
|
|
16
24
|
}
|
package/dist/tts/tts.js
CHANGED
|
@@ -141,7 +141,7 @@ export function resolveTtsConfig(cfg) {
|
|
|
141
141
|
export function resolveTtsPrefsPath(config) {
|
|
142
142
|
if (config.prefsPath?.trim())
|
|
143
143
|
return resolveUserPath(config.prefsPath.trim());
|
|
144
|
-
const envPath = process.env.CLAWDBOT_TTS_PREFS?.trim();
|
|
144
|
+
const envPath = process.env.POOLBOT_TTS_PREFS?.trim() || process.env.CLAWDBOT_TTS_PREFS?.trim();
|
|
145
145
|
if (envPath)
|
|
146
146
|
return resolveUserPath(envPath);
|
|
147
147
|
return path.join(CONFIG_DIR, "settings", "tts.json");
|