@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
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>
|
|
6
|
+
<title>Poolbot Control</title>
|
|
7
7
|
<meta name="color-scheme" content="dark light" />
|
|
8
8
|
<link rel="icon" href="./favicon.ico" sizes="any" />
|
|
9
|
-
<script type="module" crossorigin src="./assets/index-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
9
|
+
<script type="module" crossorigin src="./assets/index-HRr1grwl.js"></script>
|
|
10
|
+
<link rel="stylesheet" crossorigin href="./assets/index-CSfXd2LO.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
|
-
<
|
|
13
|
+
<poolbot-app></poolbot-app>
|
|
14
14
|
</body>
|
|
15
15
|
</html>
|
|
@@ -458,6 +458,7 @@ export async function runCronIsolatedAgentTurn(params) {
|
|
|
458
458
|
startedAt: runStartedAt,
|
|
459
459
|
endedAt: runEndedAt,
|
|
460
460
|
outcome: { status: "ok" },
|
|
461
|
+
announceType: "cron job",
|
|
461
462
|
});
|
|
462
463
|
if (!didAnnounce) {
|
|
463
464
|
const message = "cron announce delivery failed";
|
package/dist/daemon/inspect.js
CHANGED
|
@@ -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);
|
package/dist/daemon/launchd.js
CHANGED
|
@@ -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(),
|
package/dist/daemon/paths.js
CHANGED
|
@@ -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
|
}
|
package/dist/daemon/schtasks.js
CHANGED
|
@@ -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
|
-
|
|
102
|
-
|
|
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
|
-
|
|
118
|
-
|
|
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
|
}
|
package/dist/daemon/systemd.js
CHANGED
|
@@ -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)], {
|
package/dist/gateway/auth.js
CHANGED
|
@@ -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
|
|
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");
|
package/dist/gateway/call.js
CHANGED
|
@@ -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();
|
|
@@ -12,7 +12,7 @@ export function formatBonjourInstanceName(displayName) {
|
|
|
12
12
|
}
|
|
13
13
|
export function resolveBonjourCliPath(opts = {}) {
|
|
14
14
|
const env = opts.env ?? process.env;
|
|
15
|
-
const envPath = env.CLAWDBOT_CLI_PATH?.trim();
|
|
15
|
+
const envPath = env.POOLBOT_CLI_PATH?.trim() || env.CLAWDBOT_CLI_PATH?.trim();
|
|
16
16
|
if (envPath)
|
|
17
17
|
return envPath;
|
|
18
18
|
const statSync = opts.statSync ?? fs.statSync;
|
|
@@ -45,7 +45,7 @@ export function resolveBonjourCliPath(opts = {}) {
|
|
|
45
45
|
}
|
|
46
46
|
export async function resolveTailnetDnsHint(opts) {
|
|
47
47
|
const env = opts?.env ?? process.env;
|
|
48
|
-
const envRaw = env.CLAWDBOT_TAILNET_DNS?.trim();
|
|
48
|
+
const envRaw = env.POOLBOT_TAILNET_DNS?.trim() || env.CLAWDBOT_TAILNET_DNS?.trim();
|
|
49
49
|
const envValue = envRaw && envRaw.length > 0 ? envRaw.replace(/\.$/, "") : "";
|
|
50
50
|
if (envValue)
|
|
51
51
|
return envValue;
|
|
@@ -48,7 +48,7 @@ export function createGatewayReloadHandlers(params) {
|
|
|
48
48
|
}
|
|
49
49
|
if (plan.restartGmailWatcher) {
|
|
50
50
|
await stopGmailWatcher().catch(() => { });
|
|
51
|
-
if (!isTruthyEnvValue(process.env.CLAWDBOT_SKIP_GMAIL_WATCHER)) {
|
|
51
|
+
if (!isTruthyEnvValue(process.env.POOLBOT_SKIP_GMAIL_WATCHER || process.env.CLAWDBOT_SKIP_GMAIL_WATCHER)) {
|
|
52
52
|
try {
|
|
53
53
|
const gmailResult = await startGmailWatcher(nextConfig);
|
|
54
54
|
if (gmailResult.started) {
|
|
@@ -65,13 +65,13 @@ export function createGatewayReloadHandlers(params) {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
else {
|
|
68
|
-
params.logHooks.info("skipping gmail watcher restart (
|
|
68
|
+
params.logHooks.info("skipping gmail watcher restart (POOLBOT_SKIP_GMAIL_WATCHER=1)");
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
if (plan.restartChannels.size > 0) {
|
|
72
|
-
if (isTruthyEnvValue(process.env.CLAWDBOT_SKIP_CHANNELS) ||
|
|
72
|
+
if (isTruthyEnvValue(process.env.POOLBOT_SKIP_CHANNELS || process.env.CLAWDBOT_SKIP_CHANNELS) ||
|
|
73
73
|
isTruthyEnvValue(process.env.CLAWDBOT_SKIP_PROVIDERS)) {
|
|
74
|
-
params.logChannels.info("skipping channel reload (CLAWDBOT_SKIP_CHANNELS=1 or CLAWDBOT_SKIP_PROVIDERS=1)");
|
|
74
|
+
params.logChannels.info("skipping channel reload (POOLBOT_SKIP_CHANNELS=1 / CLAWDBOT_SKIP_CHANNELS=1 or CLAWDBOT_SKIP_PROVIDERS=1)");
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
77
|
const restartChannel = async (name) => {
|
|
@@ -39,13 +39,13 @@ export async function resolveGatewayRuntimeConfig(params) {
|
|
|
39
39
|
const canvasHostEnabled = process.env.CLAWDBOT_SKIP_CANVAS_HOST !== "1" && params.cfg.canvasHost?.enabled !== false;
|
|
40
40
|
assertGatewayAuthConfigured(resolvedAuth);
|
|
41
41
|
if (tailscaleMode === "funnel" && authMode !== "password") {
|
|
42
|
-
throw new Error("tailscale funnel requires gateway auth mode=password (set gateway.auth.password or
|
|
42
|
+
throw new Error("tailscale funnel requires gateway auth mode=password (set gateway.auth.password or POOLBOT_GATEWAY_PASSWORD)");
|
|
43
43
|
}
|
|
44
44
|
if (tailscaleMode !== "off" && !isLoopbackHost(bindHost)) {
|
|
45
45
|
throw new Error("tailscale serve/funnel requires gateway bind=loopback (127.0.0.1)");
|
|
46
46
|
}
|
|
47
47
|
if (!isLoopbackHost(bindHost) && !hasSharedSecret) {
|
|
48
|
-
throw new Error(`refusing to bind gateway to ${bindHost}:${params.port} without auth (set gateway.auth.token/password, or set
|
|
48
|
+
throw new Error(`refusing to bind gateway to ${bindHost}:${params.port} without auth (set gateway.auth.token/password, or set POOLBOT_GATEWAY_TOKEN/POOLBOT_GATEWAY_PASSWORD)`);
|
|
49
49
|
}
|
|
50
50
|
return {
|
|
51
51
|
bindHost,
|
|
@@ -18,7 +18,7 @@ export async function startGatewaySidecars(params) {
|
|
|
18
18
|
params.logBrowser.error(`server failed to start: ${String(err)}`);
|
|
19
19
|
}
|
|
20
20
|
// Start Gmail watcher if configured (hooks.gmail.account).
|
|
21
|
-
if (!isTruthyEnvValue(process.env.CLAWDBOT_SKIP_GMAIL_WATCHER)) {
|
|
21
|
+
if (!isTruthyEnvValue(process.env.POOLBOT_SKIP_GMAIL_WATCHER || process.env.CLAWDBOT_SKIP_GMAIL_WATCHER)) {
|
|
22
22
|
try {
|
|
23
23
|
const gmailResult = await startGmailWatcher(params.cfg);
|
|
24
24
|
if (gmailResult.started) {
|
|
@@ -75,8 +75,8 @@ export async function startGatewaySidecars(params) {
|
|
|
75
75
|
params.logHooks.error(`failed to load hooks: ${String(err)}`);
|
|
76
76
|
}
|
|
77
77
|
// Launch configured channels so gateway replies via the surface the message came from.
|
|
78
|
-
// Tests can opt out via CLAWDBOT_SKIP_CHANNELS (or legacy CLAWDBOT_SKIP_PROVIDERS).
|
|
79
|
-
const skipChannels = isTruthyEnvValue(process.env.CLAWDBOT_SKIP_CHANNELS) ||
|
|
78
|
+
// Tests can opt out via POOLBOT_SKIP_CHANNELS / CLAWDBOT_SKIP_CHANNELS (or legacy CLAWDBOT_SKIP_PROVIDERS).
|
|
79
|
+
const skipChannels = isTruthyEnvValue(process.env.POOLBOT_SKIP_CHANNELS || process.env.CLAWDBOT_SKIP_CHANNELS) ||
|
|
80
80
|
isTruthyEnvValue(process.env.CLAWDBOT_SKIP_PROVIDERS);
|
|
81
81
|
if (!skipChannels) {
|
|
82
82
|
try {
|
|
@@ -87,7 +87,7 @@ export async function startGatewaySidecars(params) {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
else {
|
|
90
|
-
params.logChannels.info("skipping channel start (CLAWDBOT_SKIP_CHANNELS=1 or CLAWDBOT_SKIP_PROVIDERS=1)");
|
|
90
|
+
params.logChannels.info("skipping channel start (POOLBOT_SKIP_CHANNELS=1 / CLAWDBOT_SKIP_CHANNELS=1 or CLAWDBOT_SKIP_PROVIDERS=1)");
|
|
91
91
|
}
|
|
92
92
|
if (params.cfg.hooks?.internal?.enabled) {
|
|
93
93
|
setTimeout(() => {
|
|
@@ -66,13 +66,14 @@ const logWsControl = log.child("ws");
|
|
|
66
66
|
const canvasRuntime = runtimeForLogger(logCanvas);
|
|
67
67
|
export async function startGatewayServer(port = 18789, opts = {}) {
|
|
68
68
|
// Ensure all default port derivations (browser/canvas) see the actual runtime port.
|
|
69
|
+
process.env.POOLBOT_GATEWAY_PORT = String(port);
|
|
69
70
|
process.env.CLAWDBOT_GATEWAY_PORT = String(port);
|
|
70
71
|
logAcceptedEnvOption({
|
|
71
|
-
key: "
|
|
72
|
+
key: "POOLBOT_RAW_STREAM",
|
|
72
73
|
description: "raw stream logging enabled",
|
|
73
74
|
});
|
|
74
75
|
logAcceptedEnvOption({
|
|
75
|
-
key: "
|
|
76
|
+
key: "POOLBOT_RAW_STREAM_PATH",
|
|
76
77
|
description: "raw stream log path override",
|
|
77
78
|
});
|
|
78
79
|
let configSnapshot = await readConfigFileSnapshot();
|
|
@@ -167,6 +167,7 @@ const testConfigRoot = {
|
|
|
167
167
|
};
|
|
168
168
|
export const setTestConfigRoot = (root) => {
|
|
169
169
|
testConfigRoot.value = root;
|
|
170
|
+
process.env.POOLBOT_CONFIG_PATH = path.join(root, "poolbot.json");
|
|
170
171
|
process.env.CLAWDBOT_CONFIG_PATH = path.join(root, "poolbot.json");
|
|
171
172
|
};
|
|
172
173
|
export const testTailnetIPv4 = hoisted.testTailnetIPv4;
|
|
@@ -197,17 +198,21 @@ export const testState = {
|
|
|
197
198
|
export const testIsNixMode = hoisted.testIsNixMode;
|
|
198
199
|
export const sessionStoreSaveDelayMs = hoisted.sessionStoreSaveDelayMs;
|
|
199
200
|
export const embeddedRunMock = hoisted.embeddedRunMock;
|
|
200
|
-
vi.mock("
|
|
201
|
-
const actual = await vi.importActual("
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
discoverModels: (...args) => {
|
|
201
|
+
vi.mock("../agents/pi-model-discovery.js", async () => {
|
|
202
|
+
const actual = await vi.importActual("../agents/pi-model-discovery.js");
|
|
203
|
+
class MockModelRegistry extends actual.ModelRegistry {
|
|
204
|
+
getAll() {
|
|
205
205
|
if (!piSdkMock.enabled) {
|
|
206
|
-
return
|
|
206
|
+
return super.getAll();
|
|
207
207
|
}
|
|
208
208
|
piSdkMock.discoverCalls += 1;
|
|
209
|
+
// Cast to expected type for testing purposes
|
|
209
210
|
return piSdkMock.models;
|
|
210
|
-
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return {
|
|
214
|
+
...actual,
|
|
215
|
+
ModelRegistry: MockModelRegistry,
|
|
211
216
|
};
|
|
212
217
|
});
|
|
213
218
|
vi.mock("../cron/isolated-agent.js", () => ({
|
|
@@ -498,5 +503,7 @@ vi.mock("../cli/deps.js", async () => {
|
|
|
498
503
|
}),
|
|
499
504
|
};
|
|
500
505
|
});
|
|
506
|
+
process.env.POOLBOT_SKIP_CHANNELS = "1";
|
|
501
507
|
process.env.CLAWDBOT_SKIP_CHANNELS = "1";
|
|
508
|
+
process.env.POOLBOT_SKIP_CRON = "1";
|
|
502
509
|
process.env.CLAWDBOT_SKIP_CRON = "1";
|