@poolzin/pool-bot 2026.2.2 → 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.
Files changed (121) hide show
  1. package/dist/acp/server.js +2 -0
  2. package/dist/agents/agent-paths.js +3 -1
  3. package/dist/agents/anthropic-payload-log.js +2 -2
  4. package/dist/agents/bash-tools.exec.js +1 -1
  5. package/dist/agents/bash-tools.shared.js +2 -1
  6. package/dist/agents/cache-trace.js +5 -5
  7. package/dist/agents/cli-runner.js +1 -1
  8. package/dist/agents/live-auth-keys.js +2 -2
  9. package/dist/agents/pi-embedded-runner/session-manager-cache.js +1 -1
  10. package/dist/agents/pi-embedded-subscribe.raw-stream.js +2 -2
  11. package/dist/agents/sandbox/browser.js +5 -0
  12. package/dist/agents/shell-utils.js +1 -1
  13. package/dist/agents/skills/bundled-dir.js +1 -1
  14. package/dist/agents/synthetic-models.js +8 -0
  15. package/dist/agents/workspace.js +1 -1
  16. package/dist/auto-reply/reply/get-reply.js +1 -1
  17. package/dist/build-info.json +2 -2
  18. package/dist/canvas-host/server.js +1 -1
  19. package/dist/channels/plugins/catalog.js +1 -1
  20. package/dist/cli/banner.js +12 -12
  21. package/dist/cli/browser-cli-manage.js +10 -10
  22. package/dist/cli/browser-cli.js +1 -1
  23. package/dist/cli/channel-options.js +1 -1
  24. package/dist/cli/cli-name.js +1 -1
  25. package/dist/cli/command-format.js +1 -1
  26. package/dist/cli/daemon-cli/install.js +1 -1
  27. package/dist/cli/daemon-cli/shared.js +8 -3
  28. package/dist/cli/daemon-cli/status.gather.js +2 -2
  29. package/dist/cli/daemon-cli/status.print.js +3 -3
  30. package/dist/cli/gateway-cli/dev.js +1 -1
  31. package/dist/cli/gateway-cli/run.js +11 -6
  32. package/dist/cli/gateway-cli/shared.js +1 -1
  33. package/dist/cli/node-cli/daemon.js +2 -1
  34. package/dist/cli/profile.js +10 -4
  35. package/dist/cli/program/help.js +1 -1
  36. package/dist/cli/program/preaction.js +1 -1
  37. package/dist/cli/program/register.agent.js +4 -4
  38. package/dist/cli/program/register.onboard.js +1 -1
  39. package/dist/cli/program/register.setup.js +1 -1
  40. package/dist/cli/program/register.subclis.js +2 -2
  41. package/dist/cli/route.js +1 -1
  42. package/dist/cli/tagline.js +8 -8
  43. package/dist/cli/update-cli.js +12 -10
  44. package/dist/commands/auth-choice-options.js +104 -33
  45. package/dist/commands/configure.wizard.js +10 -10
  46. package/dist/commands/daemon-install-helpers.js +1 -1
  47. package/dist/commands/dashboard.js +1 -1
  48. package/dist/commands/doctor-format.js +3 -3
  49. package/dist/commands/doctor-gateway-daemon-flow.js +3 -3
  50. package/dist/commands/doctor-gateway-services.js +2 -2
  51. package/dist/commands/doctor-platform-notes.js +23 -8
  52. package/dist/commands/doctor-update.js +1 -1
  53. package/dist/commands/gateway-status/helpers.js +2 -2
  54. package/dist/commands/health.js +2 -2
  55. package/dist/commands/node-daemon-install-helpers.js +1 -1
  56. package/dist/commands/onboard-helpers.js +6 -6
  57. package/dist/commands/status-all.js +2 -2
  58. package/dist/commands/status.gateway-probe.js +2 -2
  59. package/dist/commands/status.scan.js +2 -2
  60. package/dist/config/io.js +5 -3
  61. package/dist/config/paths.js +15 -14
  62. package/dist/config/schema.field-metadata.js +1 -1
  63. package/dist/config/schema.js +1 -1
  64. package/dist/config/sessions/store.js +1 -1
  65. package/dist/daemon/inspect.js +1 -1
  66. package/dist/daemon/launchd.js +5 -5
  67. package/dist/daemon/node-service.js +14 -0
  68. package/dist/daemon/paths.js +2 -2
  69. package/dist/daemon/schtasks.js +6 -6
  70. package/dist/daemon/service-env.js +25 -5
  71. package/dist/daemon/systemd.js +6 -6
  72. package/dist/entry.js +3 -2
  73. package/dist/gateway/auth.js +3 -3
  74. package/dist/gateway/call.js +2 -2
  75. package/dist/gateway/server/ws-connection/message-handler.js +1 -1
  76. package/dist/gateway/server-browser.js +2 -2
  77. package/dist/gateway/server-constants.js +2 -2
  78. package/dist/gateway/server-cron.js +1 -1
  79. package/dist/gateway/server-discovery-runtime.js +2 -2
  80. package/dist/gateway/server-discovery.js +2 -2
  81. package/dist/gateway/server-reload-handlers.js +4 -4
  82. package/dist/gateway/server-runtime-config.js +2 -2
  83. package/dist/gateway/server-startup.js +4 -4
  84. package/dist/gateway/server.impl.js +3 -2
  85. package/dist/gateway/test-helpers.mocks.js +3 -0
  86. package/dist/gateway/test-helpers.server.js +60 -22
  87. package/dist/hooks/bundled-dir.js +1 -1
  88. package/dist/hooks/gmail-watcher.js +1 -1
  89. package/dist/infra/bonjour.js +1 -1
  90. package/dist/infra/diagnostic-flags.js +3 -2
  91. package/dist/infra/dotenv.js +1 -1
  92. package/dist/infra/gateway-lock.js +1 -1
  93. package/dist/infra/home-dir.js +1 -1
  94. package/dist/infra/path-env.js +2 -1
  95. package/dist/infra/restart.js +3 -3
  96. package/dist/infra/shell-env.js +3 -3
  97. package/dist/infra/state-migrations.js +3 -3
  98. package/dist/infra/system-presence.js +1 -1
  99. package/dist/infra/update-runner.js +1 -1
  100. package/dist/infra/widearea-dns.js +1 -1
  101. package/dist/macos/gateway-daemon.js +6 -4
  102. package/dist/macos/relay-smoke.js +1 -1
  103. package/dist/macos/relay.js +1 -1
  104. package/dist/media/image-ops.js +2 -2
  105. package/dist/memory/batch-gemini.js +1 -1
  106. package/dist/memory/embeddings-gemini.js +1 -1
  107. package/dist/node-host/runner.js +3 -2
  108. package/dist/plugins/bundled-dir.js +1 -1
  109. package/dist/plugins/manifest-registry.js +2 -2
  110. package/dist/security/audit-extra.sync.js +1 -1
  111. package/dist/security/audit.js +3 -2
  112. package/dist/telegram/accounts.js +1 -1
  113. package/dist/telegram/network-config.js +6 -4
  114. package/dist/test-helpers/state-dir-env.js +8 -0
  115. package/dist/tts/tts.js +1 -1
  116. package/dist/tui/gateway-chat.js +2 -1
  117. package/dist/utils.js +2 -2
  118. package/dist/version.js +1 -1
  119. package/dist/wizard/onboarding.finalize.js +1 -1
  120. package/dist/wizard/onboarding.js +2 -2
  121. package/package.json +1 -1
@@ -91,8 +91,8 @@ export function resolveAuthForTarget(cfg, target, overrides) {
91
91
  password: password.length > 0 ? password : undefined,
92
92
  };
93
93
  }
94
- const envToken = process.env.CLAWDBOT_GATEWAY_TOKEN?.trim() || "";
95
- const envPassword = process.env.CLAWDBOT_GATEWAY_PASSWORD?.trim() || "";
94
+ const envToken = process.env.POOLBOT_GATEWAY_TOKEN?.trim() || process.env.CLAWDBOT_GATEWAY_TOKEN?.trim() || "";
95
+ const envPassword = process.env.POOLBOT_GATEWAY_PASSWORD?.trim() || process.env.CLAWDBOT_GATEWAY_PASSWORD?.trim() || "";
96
96
  const cfgToken = typeof cfg.gateway?.auth?.token === "string" ? cfg.gateway.auth.token.trim() : "";
97
97
  const cfgPassword = typeof cfg.gateway?.auth?.password === "string" ? cfg.gateway.auth.password.trim() : "";
98
98
  return {
@@ -14,7 +14,7 @@ import { normalizeAgentId } from "../routing/session-key.js";
14
14
  import { theme } from "../terminal/theme.js";
15
15
  const DEFAULT_TIMEOUT_MS = 10_000;
16
16
  const debugHealth = (...args) => {
17
- if (isTruthyEnvValue(process.env.CLAWDBOT_DEBUG_HEALTH)) {
17
+ if (isTruthyEnvValue(process.env.POOLBOT_DEBUG_HEALTH || process.env.CLAWDBOT_DEBUG_HEALTH)) {
18
18
  console.warn("[health:debug]", ...args);
19
19
  }
20
20
  };
@@ -420,7 +420,7 @@ export async function healthCommand(opts, runtime) {
420
420
  runtime.log(JSON.stringify(summary, null, 2));
421
421
  }
422
422
  else {
423
- const debugEnabled = isTruthyEnvValue(process.env.CLAWDBOT_DEBUG_HEALTH);
423
+ const debugEnabled = isTruthyEnvValue(process.env.POOLBOT_DEBUG_HEALTH || process.env.CLAWDBOT_DEBUG_HEALTH);
424
424
  if (opts.verbose) {
425
425
  const details = buildGatewayConnectionDetails({ config: cfg });
426
426
  runtime.log(info("Gateway connection:"));
@@ -29,7 +29,7 @@ export async function buildNodeInstallPlan(params) {
29
29
  }
30
30
  const environment = buildNodeServiceEnvironment({ env: params.env });
31
31
  const description = formatNodeServiceDescription({
32
- version: environment.CLAWDBOT_SERVICE_VERSION,
32
+ version: environment.POOLBOT_SERVICE_VERSION || environment.CLAWDBOT_SERVICE_VERSION,
33
33
  });
34
34
  return { programArguments, workingDirectory, environment, description };
35
35
  }
@@ -53,12 +53,12 @@ export function randomToken() {
53
53
  }
54
54
  export function printWizardHeader(runtime) {
55
55
  const header = [
56
- "░████░█░░░░░█████░█░░░█░███░░████░░████░░▀█▀",
57
- "█░░░░░█░░░░░█░░░█░█░█░█░█░░█░█░░░█░█░░░█░░█░",
58
- "█░░░░░█░░░░░█████░█░█░█░█░░█░████░░█░░░█░░█░",
59
- "█░░░░░█░░░░░█░░░█░█░█░█░█░░█░█░░█░░█░░░█░░█░",
60
- "░████░█████░█░░░█░░█░█░░███░░████░░░███░░░█░",
61
- " 🦞 FRESH DAILY 🦞",
56
+ "████░░░███░░░███░░█░░░░████░░░███░░▀█▀",
57
+ "█░░░█░█░░░█░█░░░█░█░░░░█░░░█░█░░░█░░█░",
58
+ "████░░█░░░█░█░░░█░█░░░░████░░█░░░█░░█░",
59
+ "█░░░░░█░░░█░█░░░█░█░░░░█░░░█░█░░░█░░█░",
60
+ "█░░░░░░███░░░███░░█████░████░░░███░░░█░",
61
+ " 🎱 RACK 'EM UP 🎱",
62
62
  ].join("\n");
63
63
  runtime.log(header);
64
64
  }
@@ -118,9 +118,9 @@ export async function statusAllCommand(runtime, opts) {
118
118
  ? typeof remote?.token === "string" && remote.token.trim()
119
119
  ? remote.token.trim()
120
120
  : undefined
121
- : process.env.CLAWDBOT_GATEWAY_TOKEN?.trim() ||
121
+ : process.env.POOLBOT_GATEWAY_TOKEN?.trim() || process.env.CLAWDBOT_GATEWAY_TOKEN?.trim() ||
122
122
  (typeof authToken === "string" && authToken.trim() ? authToken.trim() : undefined);
123
- const password = process.env.CLAWDBOT_GATEWAY_PASSWORD?.trim() ||
123
+ const password = process.env.POOLBOT_GATEWAY_PASSWORD?.trim() || process.env.CLAWDBOT_GATEWAY_PASSWORD?.trim() ||
124
124
  (mode === "remote"
125
125
  ? typeof remote?.password === "string" && remote.password.trim()
126
126
  ? remote.password.trim()
@@ -7,9 +7,9 @@ export function resolveGatewayProbeAuth(cfg) {
7
7
  ? typeof remote?.token === "string" && remote.token.trim().length > 0
8
8
  ? remote.token.trim()
9
9
  : undefined
10
- : process.env.CLAWDBOT_GATEWAY_TOKEN?.trim() ||
10
+ : process.env.POOLBOT_GATEWAY_TOKEN?.trim() || process.env.CLAWDBOT_GATEWAY_TOKEN?.trim() ||
11
11
  (typeof authToken === "string" && authToken.trim().length > 0 ? authToken.trim() : undefined);
12
- const password = process.env.CLAWDBOT_GATEWAY_PASSWORD?.trim() ||
12
+ const password = process.env.POOLBOT_GATEWAY_PASSWORD?.trim() || process.env.CLAWDBOT_GATEWAY_PASSWORD?.trim() ||
13
13
  (isRemoteMode
14
14
  ? typeof remote?.password === "string" && remote.password.trim().length > 0
15
15
  ? remote.password.trim()
@@ -86,8 +86,8 @@ export async function scanStatus(opts, _runtime) {
86
86
  progress.setLabel("Summarizing channels…");
87
87
  const channels = await buildChannelsTable(cfg, {
88
88
  // Show token previews in regular status; keep `status --all` redacted.
89
- // Set `CLAWDBOT_SHOW_SECRETS=0` to force redaction.
90
- showSecrets: process.env.CLAWDBOT_SHOW_SECRETS?.trim() !== "0",
89
+ // Set `POOLBOT_SHOW_SECRETS=0` (or `CLAWDBOT_SHOW_SECRETS=0`) to force redaction.
90
+ showSecrets: (process.env.POOLBOT_SHOW_SECRETS?.trim() ?? process.env.CLAWDBOT_SHOW_SECRETS?.trim()) !== "0",
91
91
  });
92
92
  progress.tick();
93
93
  progress.setLabel("Checking memory…");
package/dist/config/io.js CHANGED
@@ -34,6 +34,8 @@ const SHELL_ENV_EXPECTED_KEYS = [
34
34
  "DISCORD_BOT_TOKEN",
35
35
  "SLACK_BOT_TOKEN",
36
36
  "SLACK_APP_TOKEN",
37
+ "POOLBOT_GATEWAY_TOKEN",
38
+ "POOLBOT_GATEWAY_PASSWORD",
37
39
  "CLAWDBOT_GATEWAY_TOKEN",
38
40
  "CLAWDBOT_GATEWAY_PASSWORD",
39
41
  ];
@@ -436,12 +438,12 @@ export function createConfigIO(overrides = {}) {
436
438
  };
437
439
  }
438
440
  // NOTE: These wrappers intentionally do *not* cache the resolved config path at
439
- // module scope. `CLAWDBOT_CONFIG_PATH` (and friends) are expected to work even
441
+ // module scope. `POOLBOT_CONFIG_PATH` / `CLAWDBOT_CONFIG_PATH` (and friends) are expected to work even
440
442
  // when set after the module has been imported (tests, one-off scripts, etc.).
441
443
  const DEFAULT_CONFIG_CACHE_MS = 200;
442
444
  let configCache = null;
443
445
  function resolveConfigCacheMs(env) {
444
- const raw = env.CLAWDBOT_CONFIG_CACHE_MS?.trim();
446
+ const raw = env.POOLBOT_CONFIG_CACHE_MS?.trim() || env.CLAWDBOT_CONFIG_CACHE_MS?.trim();
445
447
  if (raw === "" || raw === "0")
446
448
  return 0;
447
449
  if (!raw)
@@ -452,7 +454,7 @@ function resolveConfigCacheMs(env) {
452
454
  return Math.max(0, parsed);
453
455
  }
454
456
  function shouldUseConfigCache(env) {
455
- if (env.CLAWDBOT_DISABLE_CONFIG_CACHE?.trim())
457
+ if (env.POOLBOT_DISABLE_CONFIG_CACHE?.trim() || env.CLAWDBOT_DISABLE_CONFIG_CACHE?.trim())
456
458
  return false;
457
459
  return resolveConfigCacheMs(env) > 0;
458
460
  }
@@ -3,14 +3,15 @@ import os from "node:os";
3
3
  import path from "node:path";
4
4
  import { expandHomePrefix, resolveRequiredHomeDir } from "../infra/home-dir.js";
5
5
  /**
6
- * Nix mode detection: When CLAWDBOT_NIX_MODE=1, the gateway is running under Nix.
6
+ * Nix mode detection: When POOLBOT_NIX_MODE=1 (or legacy CLAWDBOT_NIX_MODE=1),
7
+ * the gateway is running under Nix.
7
8
  * In this mode:
8
9
  * - No auto-install flows should be attempted
9
10
  * - Missing dependencies should produce actionable Nix-specific error messages
10
11
  * - Config is managed externally (read-only from Nix perspective)
11
12
  */
12
13
  export function resolveIsNixMode(env = process.env) {
13
- return env.CLAWDBOT_NIX_MODE === "1";
14
+ return (env.POOLBOT_NIX_MODE ?? env.CLAWDBOT_NIX_MODE) === "1";
14
15
  }
15
16
  export const isNixMode = resolveIsNixMode();
16
17
  const LEGACY_STATE_DIRNAMES = [".clawdbot", ".moltbot", ".moldbot"];
@@ -20,7 +21,7 @@ const LEGACY_CONFIG_FILENAMES = ["clawdbot.json", "moltbot.json", "moldbot.json"
20
21
  function resolveDefaultHomeDir() {
21
22
  return resolveRequiredHomeDir(process.env, os.homedir);
22
23
  }
23
- /** Build a homedir thunk that respects CLAWDBOT_HOME for the given env. */
24
+ /** Build a homedir thunk that respects POOLBOT_HOME / CLAWDBOT_HOME for the given env. */
24
25
  function envHomedir(env) {
25
26
  return () => resolveRequiredHomeDir(env, os.homedir);
26
27
  }
@@ -41,12 +42,12 @@ export function resolveNewStateDir(homedir = resolveDefaultHomeDir) {
41
42
  }
42
43
  /**
43
44
  * State directory for mutable data (sessions, logs, caches).
44
- * Can be overridden via MOLTBOT_STATE_DIR (preferred) or CLAWDBOT_STATE_DIR (legacy).
45
+ * Can be overridden via POOLBOT_STATE_DIR (preferred), MOLTBOT_STATE_DIR, or CLAWDBOT_STATE_DIR (legacy).
45
46
  * Default: ~/.poolbot
46
47
  */
47
48
  export function resolveStateDir(env = process.env, homedir = envHomedir(env)) {
48
49
  const effectiveHomedir = () => resolveRequiredHomeDir(env, homedir);
49
- const override = env.MOLTBOT_STATE_DIR?.trim() || env.CLAWDBOT_STATE_DIR?.trim();
50
+ const override = env.POOLBOT_STATE_DIR?.trim() || env.MOLTBOT_STATE_DIR?.trim() || env.CLAWDBOT_STATE_DIR?.trim();
50
51
  if (override) {
51
52
  return resolveUserPath(override, env, effectiveHomedir);
52
53
  }
@@ -87,11 +88,11 @@ function resolveUserPath(input, env = process.env, homedir = envHomedir(env)) {
87
88
  export const STATE_DIR = resolveStateDir();
88
89
  /**
89
90
  * Config file path (JSON5).
90
- * Can be overridden via MOLTBOT_CONFIG_PATH (preferred) or CLAWDBOT_CONFIG_PATH (legacy).
91
+ * Can be overridden via POOLBOT_CONFIG_PATH (preferred), MOLTBOT_CONFIG_PATH, or CLAWDBOT_CONFIG_PATH (legacy).
91
92
  * Default: ~/.poolbot/poolbot.json (or $*_STATE_DIR/poolbot.json)
92
93
  */
93
94
  export function resolveCanonicalConfigPath(env = process.env, stateDir = resolveStateDir(env, envHomedir(env))) {
94
- const override = env.MOLTBOT_CONFIG_PATH?.trim() || env.CLAWDBOT_CONFIG_PATH?.trim();
95
+ const override = env.POOLBOT_CONFIG_PATH?.trim() || env.MOLTBOT_CONFIG_PATH?.trim() || env.CLAWDBOT_CONFIG_PATH?.trim();
95
96
  if (override) {
96
97
  return resolveUserPath(override, env, envHomedir(env));
97
98
  }
@@ -120,11 +121,11 @@ export function resolveConfigPathCandidate(env = process.env, homedir = envHomed
120
121
  * Active config path (prefers existing config files).
121
122
  */
122
123
  export function resolveConfigPath(env = process.env, stateDir = resolveStateDir(env, envHomedir(env)), homedir = envHomedir(env)) {
123
- const override = env.MOLTBOT_CONFIG_PATH?.trim() || env.CLAWDBOT_CONFIG_PATH?.trim();
124
+ const override = env.POOLBOT_CONFIG_PATH?.trim() || env.MOLTBOT_CONFIG_PATH?.trim() || env.CLAWDBOT_CONFIG_PATH?.trim();
124
125
  if (override) {
125
126
  return resolveUserPath(override, env, homedir);
126
127
  }
127
- const stateOverride = env.MOLTBOT_STATE_DIR?.trim() || env.CLAWDBOT_STATE_DIR?.trim();
128
+ const stateOverride = env.POOLBOT_STATE_DIR?.trim() || env.MOLTBOT_STATE_DIR?.trim() || env.CLAWDBOT_STATE_DIR?.trim();
128
129
  const candidates = [
129
130
  path.join(stateDir, CONFIG_FILENAME),
130
131
  ...LEGACY_CONFIG_FILENAMES.map((name) => path.join(stateDir, name)),
@@ -156,12 +157,12 @@ export const CONFIG_PATH = resolveConfigPathCandidate();
156
157
  */
157
158
  export function resolveDefaultConfigCandidates(env = process.env, homedir = envHomedir(env)) {
158
159
  const effectiveHomedir = () => resolveRequiredHomeDir(env, homedir);
159
- const explicit = env.MOLTBOT_CONFIG_PATH?.trim() || env.CLAWDBOT_CONFIG_PATH?.trim();
160
+ const explicit = env.POOLBOT_CONFIG_PATH?.trim() || env.MOLTBOT_CONFIG_PATH?.trim() || env.CLAWDBOT_CONFIG_PATH?.trim();
160
161
  if (explicit) {
161
162
  return [resolveUserPath(explicit, env, effectiveHomedir)];
162
163
  }
163
164
  const candidates = [];
164
- const poolbotStateDir = env.MOLTBOT_STATE_DIR?.trim() || env.CLAWDBOT_STATE_DIR?.trim();
165
+ const poolbotStateDir = env.POOLBOT_STATE_DIR?.trim() || env.MOLTBOT_STATE_DIR?.trim() || env.CLAWDBOT_STATE_DIR?.trim();
165
166
  if (poolbotStateDir) {
166
167
  const resolved = resolveUserPath(poolbotStateDir, env, effectiveHomedir);
167
168
  candidates.push(path.join(resolved, CONFIG_FILENAME));
@@ -190,11 +191,11 @@ const OAUTH_FILENAME = "oauth.json";
190
191
  * OAuth credentials storage directory.
191
192
  *
192
193
  * Precedence:
193
- * - `CLAWDBOT_OAUTH_DIR` (explicit override)
194
+ * - `POOLBOT_OAUTH_DIR` / `CLAWDBOT_OAUTH_DIR` (explicit override)
194
195
  * - `$*_STATE_DIR/credentials` (canonical server/default)
195
196
  */
196
197
  export function resolveOAuthDir(env = process.env, stateDir = resolveStateDir(env, envHomedir(env))) {
197
- const override = env.CLAWDBOT_OAUTH_DIR?.trim();
198
+ const override = env.POOLBOT_OAUTH_DIR?.trim() || env.CLAWDBOT_OAUTH_DIR?.trim();
198
199
  if (override) {
199
200
  return resolveUserPath(override, env, envHomedir(env));
200
201
  }
@@ -204,7 +205,7 @@ export function resolveOAuthPath(env = process.env, stateDir = resolveStateDir(e
204
205
  return path.join(resolveOAuthDir(env, stateDir), OAUTH_FILENAME);
205
206
  }
206
207
  export function resolveGatewayPort(cfg, env = process.env) {
207
- const envRaw = env.CLAWDBOT_GATEWAY_PORT?.trim();
208
+ const envRaw = (env.POOLBOT_GATEWAY_PORT ?? env.CLAWDBOT_GATEWAY_PORT)?.trim();
208
209
  if (envRaw) {
209
210
  const parsed = Number.parseInt(envRaw, 10);
210
211
  if (Number.isFinite(parsed) && parsed > 0) {
@@ -376,7 +376,7 @@ export const FIELD_HELP = {
376
376
  "nodeHost.browserProxy.allowProfiles": "Optional allowlist of browser profile names exposed via the node proxy.",
377
377
  "diagnostics.flags": 'Enable targeted diagnostics logs by flag (e.g. ["telegram.http"]). Supports wildcards like "telegram.*" or "*".',
378
378
  "diagnostics.cacheTrace.enabled": "Log cache trace snapshots for embedded agent runs (default: false).",
379
- "diagnostics.cacheTrace.filePath": "JSONL output path for cache trace logs (default: $CLAWDBOT_STATE_DIR/logs/cache-trace.jsonl).",
379
+ "diagnostics.cacheTrace.filePath": "JSONL output path for cache trace logs (default: $POOLBOT_STATE_DIR/logs/cache-trace.jsonl).",
380
380
  "diagnostics.cacheTrace.includeMessages": "Include full message payloads in trace output (default: true).",
381
381
  "diagnostics.cacheTrace.includePrompt": "Include prompt text in trace output (default: true).",
382
382
  "diagnostics.cacheTrace.includeSystem": "Include system prompt in trace output (default: true).",
@@ -341,7 +341,7 @@ const FIELD_HELP = {
341
341
  "nodeHost.browserProxy.allowProfiles": "Optional allowlist of browser profile names exposed via the node proxy.",
342
342
  "diagnostics.flags": 'Enable targeted diagnostics logs by flag (e.g. ["telegram.http"]). Supports wildcards like "telegram.*" or "*".',
343
343
  "diagnostics.cacheTrace.enabled": "Log cache trace snapshots for embedded agent runs (default: false).",
344
- "diagnostics.cacheTrace.filePath": "JSONL output path for cache trace logs (default: $CLAWDBOT_STATE_DIR/logs/cache-trace.jsonl).",
344
+ "diagnostics.cacheTrace.filePath": "JSONL output path for cache trace logs (default: $POOLBOT_STATE_DIR/logs/cache-trace.jsonl).",
345
345
  "diagnostics.cacheTrace.includeMessages": "Include full message payloads in trace output (default: true).",
346
346
  "diagnostics.cacheTrace.includePrompt": "Include prompt text in trace output (default: true).",
347
347
  "diagnostics.cacheTrace.includeSystem": "Include system prompt in trace output (default: true).",
@@ -18,7 +18,7 @@ function isSessionStoreRecord(value) {
18
18
  }
19
19
  function getSessionStoreTtl() {
20
20
  return resolveCacheTtlMs({
21
- envValue: process.env.CLAWDBOT_SESSION_CACHE_TTL_MS,
21
+ envValue: process.env.POOLBOT_SESSION_CACHE_TTL_MS || process.env.CLAWDBOT_SESSION_CACHE_TTL_MS,
22
22
  defaultTtlMs: DEFAULT_SESSION_STORE_TTL_MS,
23
23
  });
24
24
  }
@@ -6,7 +6,7 @@ import { GATEWAY_SERVICE_KIND, GATEWAY_SERVICE_MARKER, LEGACY_GATEWAY_LAUNCH_AGE
6
6
  const EXTRA_MARKERS = ["poolbot"];
7
7
  const execFileAsync = promisify(execFile);
8
8
  export function renderGatewayServiceCleanupHints(env = process.env) {
9
- const profile = env.CLAWDBOT_PROFILE;
9
+ const profile = env.POOLBOT_PROFILE || env.CLAWDBOT_PROFILE;
10
10
  switch (process.platform) {
11
11
  case "darwin": {
12
12
  const label = resolveGatewayLaunchAgentLabel(profile);
@@ -14,10 +14,10 @@ const formatLine = (label, value) => {
14
14
  return `${colorize(rich, theme.muted, `${label}:`)} ${colorize(rich, theme.command, value)}`;
15
15
  };
16
16
  function resolveLaunchAgentLabel(args) {
17
- const envLabel = args?.env?.CLAWDBOT_LAUNCHD_LABEL?.trim();
17
+ const envLabel = args?.env?.POOLBOT_LAUNCHD_LABEL?.trim() || args?.env?.CLAWDBOT_LAUNCHD_LABEL?.trim();
18
18
  if (envLabel)
19
19
  return envLabel;
20
- return resolveGatewayLaunchAgentLabel(args?.env?.CLAWDBOT_PROFILE);
20
+ return resolveGatewayLaunchAgentLabel(args?.env?.POOLBOT_PROFILE ?? args?.env?.CLAWDBOT_PROFILE);
21
21
  }
22
22
  function resolveLaunchAgentPlistPathForLabel(env, label) {
23
23
  const home = toPosixPath(resolveHomeDir(env));
@@ -30,7 +30,7 @@ export function resolveLaunchAgentPlistPath(env) {
30
30
  export function resolveGatewayLogPaths(env) {
31
31
  const stateDir = resolveGatewayStateDir(env);
32
32
  const logDir = path.join(stateDir, "logs");
33
- const prefix = env.CLAWDBOT_LOG_PREFIX?.trim() || "gateway";
33
+ const prefix = env.POOLBOT_LOG_PREFIX?.trim() || env.CLAWDBOT_LOG_PREFIX?.trim() || "gateway";
34
34
  return {
35
35
  logDir,
36
36
  stdoutPath: path.join(logDir, `${prefix}.log`),
@@ -277,8 +277,8 @@ export async function installLaunchAgent({ env, stdout, programArguments, workin
277
277
  await fs.mkdir(path.dirname(plistPath), { recursive: true });
278
278
  const serviceDescription = description ??
279
279
  formatGatewayServiceDescription({
280
- profile: env.CLAWDBOT_PROFILE,
281
- version: environment?.CLAWDBOT_SERVICE_VERSION ?? env.CLAWDBOT_SERVICE_VERSION,
280
+ profile: env.POOLBOT_PROFILE ?? env.CLAWDBOT_PROFILE,
281
+ version: environment?.POOLBOT_SERVICE_VERSION ?? environment?.CLAWDBOT_SERVICE_VERSION ?? env.POOLBOT_SERVICE_VERSION ?? env.CLAWDBOT_SERVICE_VERSION,
282
282
  });
283
283
  const plist = buildLaunchAgentPlist({
284
284
  label,
@@ -3,6 +3,13 @@ import { NODE_SERVICE_KIND, NODE_SERVICE_MARKER, NODE_WINDOWS_TASK_SCRIPT_NAME,
3
3
  function withNodeServiceEnv(env) {
4
4
  return {
5
5
  ...env,
6
+ POOLBOT_LAUNCHD_LABEL: resolveNodeLaunchAgentLabel(),
7
+ POOLBOT_SYSTEMD_UNIT: resolveNodeSystemdServiceName(),
8
+ POOLBOT_WINDOWS_TASK_NAME: resolveNodeWindowsTaskName(),
9
+ POOLBOT_TASK_SCRIPT_NAME: NODE_WINDOWS_TASK_SCRIPT_NAME,
10
+ POOLBOT_LOG_PREFIX: "node",
11
+ POOLBOT_SERVICE_MARKER: NODE_SERVICE_MARKER,
12
+ POOLBOT_SERVICE_KIND: NODE_SERVICE_KIND,
6
13
  CLAWDBOT_LAUNCHD_LABEL: resolveNodeLaunchAgentLabel(),
7
14
  CLAWDBOT_SYSTEMD_UNIT: resolveNodeSystemdServiceName(),
8
15
  CLAWDBOT_WINDOWS_TASK_NAME: resolveNodeWindowsTaskName(),
@@ -18,6 +25,13 @@ function withNodeInstallEnv(args) {
18
25
  env: withNodeServiceEnv(args.env),
19
26
  environment: {
20
27
  ...args.environment,
28
+ POOLBOT_LAUNCHD_LABEL: resolveNodeLaunchAgentLabel(),
29
+ POOLBOT_SYSTEMD_UNIT: resolveNodeSystemdServiceName(),
30
+ POOLBOT_WINDOWS_TASK_NAME: resolveNodeWindowsTaskName(),
31
+ POOLBOT_TASK_SCRIPT_NAME: NODE_WINDOWS_TASK_SCRIPT_NAME,
32
+ POOLBOT_LOG_PREFIX: "node",
33
+ POOLBOT_SERVICE_MARKER: NODE_SERVICE_MARKER,
34
+ POOLBOT_SERVICE_KIND: NODE_SERVICE_KIND,
21
35
  CLAWDBOT_LAUNCHD_LABEL: resolveNodeLaunchAgentLabel(),
22
36
  CLAWDBOT_SYSTEMD_UNIT: resolveNodeSystemdServiceName(),
23
37
  CLAWDBOT_WINDOWS_TASK_NAME: resolveNodeWindowsTaskName(),
@@ -24,12 +24,12 @@ export function resolveUserPathWithHome(input, home) {
24
24
  return path.resolve(trimmed);
25
25
  }
26
26
  export function resolveGatewayStateDir(env) {
27
- const override = env.CLAWDBOT_STATE_DIR?.trim();
27
+ const override = env.POOLBOT_STATE_DIR?.trim() || env.CLAWDBOT_STATE_DIR?.trim();
28
28
  if (override) {
29
29
  const home = override.startsWith("~") ? resolveHomeDir(env) : undefined;
30
30
  return resolveUserPathWithHome(override, home);
31
31
  }
32
32
  const home = resolveHomeDir(env);
33
- const suffix = resolveGatewayProfileSuffix(env.CLAWDBOT_PROFILE);
33
+ const suffix = resolveGatewayProfileSuffix(env.POOLBOT_PROFILE ?? env.CLAWDBOT_PROFILE);
34
34
  return path.join(home, `.poolbot${suffix}`);
35
35
  }
@@ -12,16 +12,16 @@ const formatLine = (label, value) => {
12
12
  return `${colorize(rich, theme.muted, `${label}:`)} ${colorize(rich, theme.command, value)}`;
13
13
  };
14
14
  function resolveTaskName(env) {
15
- const override = env.CLAWDBOT_WINDOWS_TASK_NAME?.trim();
15
+ const override = env.POOLBOT_WINDOWS_TASK_NAME?.trim() || env.CLAWDBOT_WINDOWS_TASK_NAME?.trim();
16
16
  if (override)
17
17
  return override;
18
- return resolveGatewayWindowsTaskName(env.CLAWDBOT_PROFILE);
18
+ return resolveGatewayWindowsTaskName(env.POOLBOT_PROFILE ?? env.CLAWDBOT_PROFILE);
19
19
  }
20
20
  export function resolveTaskScriptPath(env) {
21
- const override = env.CLAWDBOT_TASK_SCRIPT?.trim();
21
+ const override = env.POOLBOT_TASK_SCRIPT?.trim() || env.CLAWDBOT_TASK_SCRIPT?.trim();
22
22
  if (override)
23
23
  return override;
24
- const scriptName = env.CLAWDBOT_TASK_SCRIPT_NAME?.trim() || "gateway.cmd";
24
+ const scriptName = env.POOLBOT_TASK_SCRIPT_NAME?.trim() || env.CLAWDBOT_TASK_SCRIPT_NAME?.trim() || "gateway.cmd";
25
25
  const stateDir = resolveGatewayStateDir(env);
26
26
  return path.join(stateDir, scriptName);
27
27
  }
@@ -185,8 +185,8 @@ export async function installScheduledTask({ env, stdout, programArguments, work
185
185
  await fs.mkdir(path.dirname(scriptPath), { recursive: true });
186
186
  const taskDescription = description ??
187
187
  formatGatewayServiceDescription({
188
- profile: env.CLAWDBOT_PROFILE,
189
- version: environment?.CLAWDBOT_SERVICE_VERSION ?? env.CLAWDBOT_SERVICE_VERSION,
188
+ profile: env.POOLBOT_PROFILE ?? env.CLAWDBOT_PROFILE,
189
+ version: environment?.POOLBOT_SERVICE_VERSION ?? environment?.CLAWDBOT_SERVICE_VERSION ?? env.POOLBOT_SERVICE_VERSION ?? env.CLAWDBOT_SERVICE_VERSION,
190
190
  });
191
191
  const script = buildTaskScript({
192
192
  description: taskDescription,
@@ -90,22 +90,32 @@ export function buildMinimalServicePath(options = {}) {
90
90
  }
91
91
  export function buildServiceEnvironment(params) {
92
92
  const { env, port, token, launchdLabel } = params;
93
- const profile = env.CLAWDBOT_PROFILE;
93
+ const profile = env.POOLBOT_PROFILE ?? env.CLAWDBOT_PROFILE;
94
94
  const resolvedLaunchdLabel = launchdLabel ||
95
95
  (process.platform === "darwin" ? resolveGatewayLaunchAgentLabel(profile) : undefined);
96
96
  const systemdUnit = `${resolveGatewaySystemdServiceName(profile)}.service`;
97
97
  return {
98
98
  HOME: env.HOME,
99
99
  PATH: buildMinimalServicePath({ env }),
100
+ POOLBOT_PROFILE: profile,
100
101
  CLAWDBOT_PROFILE: profile,
101
- CLAWDBOT_STATE_DIR: env.CLAWDBOT_STATE_DIR,
102
- CLAWDBOT_CONFIG_PATH: env.CLAWDBOT_CONFIG_PATH,
102
+ POOLBOT_STATE_DIR: env.POOLBOT_STATE_DIR ?? env.CLAWDBOT_STATE_DIR,
103
+ CLAWDBOT_STATE_DIR: env.POOLBOT_STATE_DIR ?? env.CLAWDBOT_STATE_DIR,
104
+ POOLBOT_CONFIG_PATH: env.POOLBOT_CONFIG_PATH ?? env.CLAWDBOT_CONFIG_PATH,
105
+ CLAWDBOT_CONFIG_PATH: env.POOLBOT_CONFIG_PATH ?? env.CLAWDBOT_CONFIG_PATH,
106
+ POOLBOT_GATEWAY_PORT: String(port),
103
107
  CLAWDBOT_GATEWAY_PORT: String(port),
108
+ POOLBOT_GATEWAY_TOKEN: token,
104
109
  CLAWDBOT_GATEWAY_TOKEN: token,
110
+ POOLBOT_LAUNCHD_LABEL: resolvedLaunchdLabel,
105
111
  CLAWDBOT_LAUNCHD_LABEL: resolvedLaunchdLabel,
112
+ POOLBOT_SYSTEMD_UNIT: systemdUnit,
106
113
  CLAWDBOT_SYSTEMD_UNIT: systemdUnit,
114
+ POOLBOT_SERVICE_MARKER: GATEWAY_SERVICE_MARKER,
107
115
  CLAWDBOT_SERVICE_MARKER: GATEWAY_SERVICE_MARKER,
116
+ POOLBOT_SERVICE_KIND: GATEWAY_SERVICE_KIND,
108
117
  CLAWDBOT_SERVICE_KIND: GATEWAY_SERVICE_KIND,
118
+ POOLBOT_SERVICE_VERSION: VERSION,
109
119
  CLAWDBOT_SERVICE_VERSION: VERSION,
110
120
  };
111
121
  }
@@ -114,15 +124,25 @@ export function buildNodeServiceEnvironment(params) {
114
124
  return {
115
125
  HOME: env.HOME,
116
126
  PATH: buildMinimalServicePath({ env }),
117
- CLAWDBOT_STATE_DIR: env.CLAWDBOT_STATE_DIR,
118
- CLAWDBOT_CONFIG_PATH: env.CLAWDBOT_CONFIG_PATH,
127
+ POOLBOT_STATE_DIR: env.POOLBOT_STATE_DIR ?? env.CLAWDBOT_STATE_DIR,
128
+ CLAWDBOT_STATE_DIR: env.POOLBOT_STATE_DIR ?? env.CLAWDBOT_STATE_DIR,
129
+ POOLBOT_CONFIG_PATH: env.POOLBOT_CONFIG_PATH ?? env.CLAWDBOT_CONFIG_PATH,
130
+ CLAWDBOT_CONFIG_PATH: env.POOLBOT_CONFIG_PATH ?? env.CLAWDBOT_CONFIG_PATH,
131
+ POOLBOT_LAUNCHD_LABEL: resolveNodeLaunchAgentLabel(),
119
132
  CLAWDBOT_LAUNCHD_LABEL: resolveNodeLaunchAgentLabel(),
133
+ POOLBOT_SYSTEMD_UNIT: resolveNodeSystemdServiceName(),
120
134
  CLAWDBOT_SYSTEMD_UNIT: resolveNodeSystemdServiceName(),
135
+ POOLBOT_WINDOWS_TASK_NAME: resolveNodeWindowsTaskName(),
121
136
  CLAWDBOT_WINDOWS_TASK_NAME: resolveNodeWindowsTaskName(),
137
+ POOLBOT_TASK_SCRIPT_NAME: NODE_WINDOWS_TASK_SCRIPT_NAME,
122
138
  CLAWDBOT_TASK_SCRIPT_NAME: NODE_WINDOWS_TASK_SCRIPT_NAME,
139
+ POOLBOT_LOG_PREFIX: "node",
123
140
  CLAWDBOT_LOG_PREFIX: "node",
141
+ POOLBOT_SERVICE_MARKER: NODE_SERVICE_MARKER,
124
142
  CLAWDBOT_SERVICE_MARKER: NODE_SERVICE_MARKER,
143
+ POOLBOT_SERVICE_KIND: NODE_SERVICE_KIND,
125
144
  CLAWDBOT_SERVICE_KIND: NODE_SERVICE_KIND,
145
+ POOLBOT_SERVICE_VERSION: VERSION,
126
146
  CLAWDBOT_SERVICE_VERSION: VERSION,
127
147
  };
128
148
  }
@@ -19,11 +19,11 @@ function resolveSystemdUnitPathForName(env, name) {
19
19
  return path.posix.join(home, ".config", "systemd", "user", `${name}.service`);
20
20
  }
21
21
  function resolveSystemdServiceName(env) {
22
- const override = env.CLAWDBOT_SYSTEMD_UNIT?.trim();
22
+ const override = env.POOLBOT_SYSTEMD_UNIT?.trim() || env.CLAWDBOT_SYSTEMD_UNIT?.trim();
23
23
  if (override) {
24
24
  return override.endsWith(".service") ? override.slice(0, -".service".length) : override;
25
25
  }
26
- return resolveGatewaySystemdServiceName(env.CLAWDBOT_PROFILE);
26
+ return resolveGatewaySystemdServiceName(env.POOLBOT_PROFILE ?? env.CLAWDBOT_PROFILE);
27
27
  }
28
28
  function resolveSystemdUnitPath(env) {
29
29
  return resolveSystemdUnitPathForName(env, resolveSystemdServiceName(env));
@@ -152,8 +152,8 @@ export async function installSystemdService({ env, stdout, programArguments, wor
152
152
  await fs.mkdir(path.dirname(unitPath), { recursive: true });
153
153
  const serviceDescription = description ??
154
154
  formatGatewayServiceDescription({
155
- profile: env.CLAWDBOT_PROFILE,
156
- version: environment?.CLAWDBOT_SERVICE_VERSION ?? env.CLAWDBOT_SERVICE_VERSION,
155
+ profile: env.POOLBOT_PROFILE ?? env.CLAWDBOT_PROFILE,
156
+ version: environment?.POOLBOT_SERVICE_VERSION ?? environment?.CLAWDBOT_SERVICE_VERSION ?? env.POOLBOT_SERVICE_VERSION ?? env.CLAWDBOT_SERVICE_VERSION,
157
157
  });
158
158
  const unit = buildSystemdUnit({
159
159
  description: serviceDescription,
@@ -162,7 +162,7 @@ export async function installSystemdService({ env, stdout, programArguments, wor
162
162
  environment,
163
163
  });
164
164
  await fs.writeFile(unitPath, unit, "utf8");
165
- const serviceName = resolveGatewaySystemdServiceName(env.CLAWDBOT_PROFILE);
165
+ const serviceName = resolveGatewaySystemdServiceName(env.POOLBOT_PROFILE ?? env.CLAWDBOT_PROFILE);
166
166
  const unitName = `${serviceName}.service`;
167
167
  const reload = await execSystemctl(["--user", "daemon-reload"]);
168
168
  if (reload.code !== 0) {
@@ -183,7 +183,7 @@ export async function installSystemdService({ env, stdout, programArguments, wor
183
183
  }
184
184
  export async function uninstallSystemdService({ env, stdout, }) {
185
185
  await assertSystemdAvailable();
186
- const serviceName = resolveGatewaySystemdServiceName(env.CLAWDBOT_PROFILE);
186
+ const serviceName = resolveGatewaySystemdServiceName(env.POOLBOT_PROFILE ?? env.CLAWDBOT_PROFILE);
187
187
  const unitName = `${serviceName}.service`;
188
188
  await execSystemctl(["--user", "disable", "--now", unitName]);
189
189
  const unitPath = resolveSystemdUnitPath(env);
package/dist/entry.js CHANGED
@@ -25,13 +25,14 @@ function hasExperimentalWarningSuppressed() {
25
25
  return false;
26
26
  }
27
27
  function ensureExperimentalWarningSuppressed() {
28
- if (isTruthyEnvValue(process.env.CLAWDBOT_NO_RESPAWN))
28
+ if (isTruthyEnvValue(process.env.POOLBOT_NO_RESPAWN) || isTruthyEnvValue(process.env.CLAWDBOT_NO_RESPAWN))
29
29
  return false;
30
- if (isTruthyEnvValue(process.env.CLAWDBOT_NODE_OPTIONS_READY))
30
+ if (isTruthyEnvValue(process.env.POOLBOT_NODE_OPTIONS_READY) || isTruthyEnvValue(process.env.CLAWDBOT_NODE_OPTIONS_READY))
31
31
  return false;
32
32
  if (hasExperimentalWarningSuppressed())
33
33
  return false;
34
34
  // Respawn guard (and keep recursion bounded if something goes wrong).
35
+ process.env.POOLBOT_NODE_OPTIONS_READY = "1";
35
36
  process.env.CLAWDBOT_NODE_OPTIONS_READY = "1";
36
37
  // Pass flag as a Node CLI option, not via NODE_OPTIONS (--disable-warning is disallowed in NODE_OPTIONS).
37
38
  const child = spawn(process.execPath, [EXPERIMENTAL_WARNING_FLAG, ...process.execArgv, ...process.argv.slice(1)], {
@@ -127,8 +127,8 @@ async function resolveVerifiedTailscaleUser(params) {
127
127
  export function resolveGatewayAuth(params) {
128
128
  const authConfig = params.authConfig ?? {};
129
129
  const env = params.env ?? process.env;
130
- const token = authConfig.token ?? env.CLAWDBOT_GATEWAY_TOKEN ?? undefined;
131
- const password = authConfig.password ?? env.CLAWDBOT_GATEWAY_PASSWORD ?? undefined;
130
+ const token = authConfig.token ?? env.POOLBOT_GATEWAY_TOKEN ?? env.CLAWDBOT_GATEWAY_TOKEN ?? undefined;
131
+ const password = authConfig.password ?? env.POOLBOT_GATEWAY_PASSWORD ?? env.CLAWDBOT_GATEWAY_PASSWORD ?? undefined;
132
132
  const mode = authConfig.mode ?? (password ? "password" : "token");
133
133
  const allowTailscale = authConfig.allowTailscale ?? (params.tailscaleMode === "serve" && mode !== "password");
134
134
  return {
@@ -142,7 +142,7 @@ export function assertGatewayAuthConfigured(auth) {
142
142
  if (auth.mode === "token" && !auth.token) {
143
143
  if (auth.allowTailscale)
144
144
  return;
145
- throw new Error("gateway auth mode is token, but no token was configured (set gateway.auth.token or CLAWDBOT_GATEWAY_TOKEN)");
145
+ throw new Error("gateway auth mode is token, but no token was configured (set gateway.auth.token or POOLBOT_GATEWAY_TOKEN)");
146
146
  }
147
147
  if (auth.mode === "password" && !auth.password) {
148
148
  throw new Error("gateway auth mode is password, but no password was configured");
@@ -95,14 +95,14 @@ export async function callGateway(opts) {
95
95
  ? typeof remote?.token === "string" && remote.token.trim().length > 0
96
96
  ? remote.token.trim()
97
97
  : undefined
98
- : process.env.CLAWDBOT_GATEWAY_TOKEN?.trim() ||
98
+ : process.env.POOLBOT_GATEWAY_TOKEN?.trim() || process.env.CLAWDBOT_GATEWAY_TOKEN?.trim() ||
99
99
  (typeof authToken === "string" && authToken.trim().length > 0
100
100
  ? authToken.trim()
101
101
  : undefined));
102
102
  const password = (typeof opts.password === "string" && opts.password.trim().length > 0
103
103
  ? opts.password.trim()
104
104
  : undefined) ||
105
- process.env.CLAWDBOT_GATEWAY_PASSWORD?.trim() ||
105
+ process.env.POOLBOT_GATEWAY_PASSWORD?.trim() || process.env.CLAWDBOT_GATEWAY_PASSWORD?.trim() ||
106
106
  (isRemoteMode
107
107
  ? typeof remote?.password === "string" && remote.password.trim().length > 0
108
108
  ? remote.password.trim()
@@ -642,7 +642,7 @@ export function attachGatewayWsMessageHandler(params) {
642
642
  type: "hello-ok",
643
643
  protocol: PROTOCOL_VERSION,
644
644
  server: {
645
- version: process.env.CLAWDBOT_VERSION ?? process.env.npm_package_version ?? "dev",
645
+ version: process.env.POOLBOT_VERSION ?? process.env.CLAWDBOT_VERSION ?? process.env.npm_package_version ?? "dev",
646
646
  commit: process.env.GIT_COMMIT,
647
647
  host: os.hostname(),
648
648
  connId,
@@ -1,10 +1,10 @@
1
1
  import { isTruthyEnvValue } from "../infra/env.js";
2
2
  export async function startBrowserControlServerIfEnabled() {
3
- if (isTruthyEnvValue(process.env.CLAWDBOT_SKIP_BROWSER_CONTROL_SERVER))
3
+ if (isTruthyEnvValue(process.env.POOLBOT_SKIP_BROWSER_CONTROL_SERVER || process.env.CLAWDBOT_SKIP_BROWSER_CONTROL_SERVER))
4
4
  return null;
5
5
  // Lazy import: keeps startup fast, but still bundles for the embedded
6
6
  // gateway (bun --compile) via the static specifier path.
7
- const override = process.env.CLAWDBOT_BROWSER_CONTROL_MODULE?.trim();
7
+ const override = (process.env.POOLBOT_BROWSER_CONTROL_MODULE?.trim() || process.env.CLAWDBOT_BROWSER_CONTROL_MODULE?.trim());
8
8
  const mod = override ? await import(override) : await import("../browser/control-service.js");
9
9
  const start = typeof mod
10
10
  .startBrowserControlServiceFromConfig === "function"
@@ -16,8 +16,8 @@ export const __setMaxChatHistoryMessagesBytesForTest = (value) => {
16
16
  };
17
17
  export const DEFAULT_HANDSHAKE_TIMEOUT_MS = 10_000;
18
18
  export const getHandshakeTimeoutMs = () => {
19
- if (process.env.VITEST && process.env.CLAWDBOT_TEST_HANDSHAKE_TIMEOUT_MS) {
20
- const parsed = Number(process.env.CLAWDBOT_TEST_HANDSHAKE_TIMEOUT_MS);
19
+ if (process.env.VITEST && (process.env.POOLBOT_TEST_HANDSHAKE_TIMEOUT_MS || process.env.CLAWDBOT_TEST_HANDSHAKE_TIMEOUT_MS)) {
20
+ const parsed = Number(process.env.POOLBOT_TEST_HANDSHAKE_TIMEOUT_MS || process.env.CLAWDBOT_TEST_HANDSHAKE_TIMEOUT_MS);
21
21
  if (Number.isFinite(parsed) && parsed > 0)
22
22
  return parsed;
23
23
  }
@@ -14,7 +14,7 @@ import { defaultRuntime } from "../runtime.js";
14
14
  export function buildGatewayCronService(params) {
15
15
  const cronLogger = getChildLogger({ module: "cron" });
16
16
  const storePath = resolveCronStorePath(params.cfg.cron?.store);
17
- const cronEnabled = process.env.CLAWDBOT_SKIP_CRON !== "1" && params.cfg.cron?.enabled !== false;
17
+ const cronEnabled = process.env.POOLBOT_SKIP_CRON !== "1" && process.env.CLAWDBOT_SKIP_CRON !== "1" && params.cfg.cron?.enabled !== false;
18
18
  const resolveCronAgent = (requested) => {
19
19
  const runtimeConfig = loadConfig();
20
20
  const normalized = typeof requested === "string" && requested.trim() ? normalizeAgentId(requested) : undefined;
@@ -7,7 +7,7 @@ export async function startGatewayDiscovery(params) {
7
7
  const mdnsMode = params.mdnsMode ?? "minimal";
8
8
  // mDNS can be disabled via config (mdnsMode: off) or env var.
9
9
  const bonjourEnabled = mdnsMode !== "off" &&
10
- process.env.CLAWDBOT_DISABLE_BONJOUR !== "1" &&
10
+ process.env.POOLBOT_DISABLE_BONJOUR !== "1" && process.env.CLAWDBOT_DISABLE_BONJOUR !== "1" &&
11
11
  process.env.NODE_ENV !== "test" &&
12
12
  !process.env.VITEST;
13
13
  const mdnsMinimal = mdnsMode !== "full";
@@ -16,7 +16,7 @@ export async function startGatewayDiscovery(params) {
16
16
  const tailnetDns = needsTailnetDns
17
17
  ? await resolveTailnetDnsHint({ enabled: tailscaleEnabled })
18
18
  : undefined;
19
- const sshPortEnv = mdnsMinimal ? undefined : process.env.CLAWDBOT_SSH_PORT?.trim();
19
+ const sshPortEnv = mdnsMinimal ? undefined : (process.env.POOLBOT_SSH_PORT?.trim() || process.env.CLAWDBOT_SSH_PORT?.trim());
20
20
  const sshPortParsed = sshPortEnv ? Number.parseInt(sshPortEnv, 10) : NaN;
21
21
  const sshPort = Number.isFinite(sshPortParsed) && sshPortParsed > 0 ? sshPortParsed : undefined;
22
22
  const cliPath = mdnsMinimal ? undefined : resolveBonjourCliPath();