@poolzin/pool-bot 2026.2.21 → 2026.2.22
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 +17 -0
- package/dist/agents/api-key-rotation.js +47 -0
- package/dist/agents/apply-patch-update.js +19 -9
- package/dist/agents/apply-patch.js +72 -47
- package/dist/agents/bash-tools.exec.js +141 -559
- package/dist/agents/cli-backends.js +49 -6
- package/dist/agents/cli-runner/helpers.js +69 -152
- package/dist/agents/cli-runner.js +70 -19
- package/dist/agents/identity.js +20 -1
- package/dist/agents/image-sanitization.js +9 -0
- package/dist/agents/live-auth-keys.js +123 -26
- package/dist/agents/live-model-filter.js +13 -4
- package/dist/agents/model-catalog.js +40 -9
- package/dist/agents/model-forward-compat.js +60 -23
- package/dist/agents/model-selection.js +134 -41
- package/dist/agents/pi-auth-json.js +2 -2
- package/dist/agents/pi-embedded-helpers/bootstrap.js +65 -15
- package/dist/agents/pi-embedded-helpers/errors.js +140 -15
- package/dist/agents/pi-embedded-helpers/images.js +22 -12
- package/dist/agents/pi-embedded-helpers.js +2 -2
- package/dist/agents/pi-embedded-runner/abort.js +10 -3
- package/dist/agents/pi-embedded-runner/compact.js +230 -32
- package/dist/agents/pi-embedded-runner/extra-params.js +203 -12
- package/dist/agents/pi-embedded-runner/google.js +109 -19
- package/dist/agents/pi-embedded-runner/history.js +35 -17
- package/dist/agents/pi-embedded-runner/run/attempt.js +386 -95
- package/dist/agents/pi-embedded-runner/run/images.js +81 -55
- package/dist/agents/pi-embedded-runner/run/payloads.js +89 -39
- package/dist/agents/pi-embedded-runner/run.js +193 -25
- package/dist/agents/pi-embedded-runner/run.overflow-compaction.mocks.shared.js +2 -2
- package/dist/agents/pi-embedded-runner/runs.js +17 -8
- package/dist/agents/pi-embedded-runner/tool-result-context-guard.js +262 -0
- package/dist/agents/pi-embedded-runner.js +1 -1
- package/dist/agents/pi-embedded-subscribe.handlers.tools.js +180 -10
- package/dist/agents/pi-embedded-subscribe.js +37 -0
- package/dist/agents/pi-embedded-subscribe.tools.js +127 -30
- package/dist/agents/pi-model-discovery.js +9 -2
- package/dist/agents/pi-tool-definition-adapter.js +60 -8
- package/dist/agents/pi-tools.before-tool-call.js +1 -1
- package/dist/agents/pi-tools.js +113 -94
- package/dist/agents/pi-tools.read.js +337 -38
- package/dist/agents/poolbot-tools.js +14 -5
- package/dist/agents/sandbox/docker.js +10 -5
- package/dist/agents/sandbox/registry.js +96 -46
- package/dist/agents/sandbox/sanitize-env-vars.js +82 -0
- package/dist/agents/sandbox-paths.js +43 -10
- package/dist/agents/session-tool-result-guard-wrapper.js +23 -11
- package/dist/agents/session-tool-result-guard.js +39 -39
- package/dist/agents/session-transcript-repair.js +36 -33
- package/dist/agents/session-write-lock.js +62 -44
- package/dist/agents/skills/frontmatter.js +49 -88
- package/dist/agents/skills/workspace.js +335 -28
- package/dist/agents/subagent-announce.js +508 -174
- package/dist/agents/subagent-registry.js +45 -4
- package/dist/agents/subagent-spawn.js +16 -33
- package/dist/agents/system-prompt-report.js +27 -10
- package/dist/agents/system-prompt.js +26 -32
- package/dist/agents/tool-call-id.js +69 -17
- package/dist/agents/tool-display-common.js +1 -1
- package/dist/agents/tool-images.js +64 -31
- package/dist/agents/tools/canvas-tool.js +17 -11
- package/dist/agents/tools/common.js +37 -19
- package/dist/agents/tools/cron-tool.js +40 -38
- package/dist/agents/tools/gateway.js +70 -2
- package/dist/agents/tools/message-tool.js +181 -40
- package/dist/agents/tools/nodes-tool.js +128 -36
- package/dist/agents/tools/nodes-utils.js +12 -38
- package/dist/agents/tools/session-status-tool.js +24 -71
- package/dist/agents/tools/sessions-helpers.js +38 -210
- package/dist/agents/tools/sessions-spawn-tool.js +28 -198
- package/dist/agents/tools/telegram-actions.js +58 -7
- package/dist/agents/tools/web-fetch-utils.js +112 -7
- package/dist/agents/tools/web-fetch.js +279 -175
- package/dist/agents/tools/web-shared.js +71 -8
- package/dist/agents/usage.js +25 -16
- package/dist/auto-reply/commands-registry.data.js +85 -11
- package/dist/auto-reply/dispatch.js +40 -21
- package/dist/auto-reply/reply/abort.js +102 -33
- package/dist/auto-reply/reply/commands-core.js +82 -33
- package/dist/auto-reply/reply/commands-export-session.js +1 -1
- package/dist/auto-reply/reply/commands-info.js +41 -12
- package/dist/auto-reply/reply/commands-subagents.js +352 -100
- package/dist/auto-reply/reply/commands-system-prompt.js +2 -2
- package/dist/auto-reply/reply/dispatch-from-config.js +100 -29
- package/dist/auto-reply/reply/elevated-unavailable.js +1 -1
- package/dist/auto-reply/reply/inbound-meta.js +12 -1
- package/dist/auto-reply/reply/mentions.js +18 -11
- package/dist/auto-reply/reply/normalize-reply.js +17 -8
- package/dist/auto-reply/reply/reply-dispatcher.js +62 -10
- package/dist/auto-reply/reply/session.js +102 -21
- package/dist/auto-reply/reply/streaming-directives.js +16 -5
- package/dist/auto-reply/status.js +73 -50
- package/dist/browser/extension-relay.js +3 -3
- package/dist/browser/http-auth.js +1 -1
- package/dist/browser/paths.js +2 -2
- package/dist/build-info.json +3 -3
- package/dist/channels/allowlist-match.js +20 -0
- package/dist/channels/allowlists/resolve-utils.js +65 -2
- package/dist/channels/chat-type.js +8 -4
- package/dist/channels/dock.js +127 -35
- package/dist/channels/draft-stream-loop.js +6 -2
- package/dist/channels/plugins/actions/telegram.js +42 -18
- package/dist/channels/plugins/allowlist-match.js +1 -1
- package/dist/channels/plugins/group-mentions.js +51 -41
- package/dist/channels/plugins/message-action-names.js +2 -0
- package/dist/channels/plugins/message-actions.js +24 -5
- package/dist/channels/plugins/normalize/discord.js +26 -4
- package/dist/channels/plugins/normalize/signal.js +35 -22
- package/dist/channels/plugins/onboarding/helpers.js +8 -26
- package/dist/channels/plugins/outbound/imessage.js +15 -14
- package/dist/channels/registry.js +20 -7
- package/dist/cli/acp-cli.js +7 -5
- package/dist/cli/browser-cli-extension.js +25 -12
- package/dist/cli/browser-cli-state.cookies-storage.js +25 -6
- package/dist/cli/browser-cli-state.js +101 -145
- package/dist/cli/command-options.js +28 -0
- package/dist/cli/completion-cli.js +6 -6
- package/dist/cli/cron-cli/register.cron-add.js +25 -1
- package/dist/cli/cron-cli/register.cron-edit.js +44 -0
- package/dist/cli/cron-cli/shared.js +7 -1
- package/dist/cli/daemon-cli/lifecycle-core.js +23 -21
- package/dist/cli/daemon-cli/lifecycle.js +23 -247
- package/dist/cli/daemon-cli/register-service-commands.js +25 -4
- package/dist/cli/daemon-cli.js +1 -0
- package/dist/cli/devices-cli.js +33 -20
- package/dist/cli/gateway-cli/register.js +37 -105
- package/dist/cli/gateway-cli/run.js +49 -11
- package/dist/cli/nodes-camera.js +59 -4
- package/dist/cli/nodes-cli/register.camera.js +27 -24
- package/dist/cli/nodes-cli/rpc.js +21 -38
- package/dist/cli/qr-cli.js +2 -2
- package/dist/cli/skills-cli.format.js +2 -2
- package/dist/cli/update-cli/progress.js +2 -2
- package/dist/cli/update-cli/restart-helper.js +28 -7
- package/dist/cli/update-cli/shared.js +7 -7
- package/dist/cli/update-cli/status.js +1 -1
- package/dist/cli/update-cli/update-command.js +14 -8
- package/dist/cli/update-cli/wizard.js +2 -2
- package/dist/cli/update-cli.js +21 -1027
- package/dist/commands/auth-choice.apply.anthropic.js +10 -2
- package/dist/commands/channels/add-mutators.js +3 -35
- package/dist/commands/channels/add.js +39 -51
- package/dist/commands/config-validation.js +1 -1
- package/dist/commands/configure.gateway-auth.js +52 -15
- package/dist/commands/configure.gateway.js +84 -40
- package/dist/commands/doctor-completion.js +3 -3
- package/dist/commands/doctor-config-flow.js +536 -16
- package/dist/commands/doctor-gateway-services.js +103 -79
- package/dist/commands/doctor-memory-search.js +9 -9
- package/dist/commands/doctor-platform-notes.js +57 -30
- package/dist/commands/doctor-prompter.js +26 -15
- package/dist/commands/doctor-session-locks.js +1 -1
- package/dist/commands/doctor.js +21 -9
- package/dist/commands/model-picker.js +120 -95
- package/dist/commands/models/set.js +2 -21
- package/dist/commands/models/shared.js +65 -37
- package/dist/commands/onboard-helpers.js +81 -39
- package/dist/commands/openai-codex-oauth.js +1 -1
- package/dist/commands/sessions.js +52 -53
- package/dist/commands/status.summary.js +52 -34
- package/dist/commands/test-wizard-helpers.js +2 -2
- package/dist/config/defaults.js +79 -42
- package/dist/config/group-policy.js +50 -18
- package/dist/config/includes.js +37 -10
- package/dist/config/schema.help.js +5 -4
- package/dist/config/schema.hints.js +2 -2
- package/dist/config/schema.labels.js +1 -0
- package/dist/config/sessions/group.js +12 -11
- package/dist/config/sessions/paths.js +137 -11
- package/dist/config/sessions/store.js +185 -65
- package/dist/config/sessions/types.js +15 -1
- package/dist/config/sessions.js +1 -0
- package/dist/config/telegram-custom-commands.js +3 -2
- package/dist/config/types.js +2 -0
- package/dist/config/zod-schema.agent-defaults.js +6 -27
- package/dist/config/zod-schema.agent-runtime.js +171 -79
- package/dist/config/zod-schema.providers-core.js +138 -65
- package/dist/config/zod-schema.session.js +49 -22
- package/dist/control-ui/assets/index-HRr1grwl.js.map +1 -1
- package/dist/cron/isolated-agent/run.js +224 -57
- package/dist/cron/normalize.js +48 -45
- package/dist/cron/run-log.js +14 -0
- package/dist/cron/service/jobs.js +190 -28
- package/dist/cron/service/normalize.js +29 -11
- package/dist/cron/service/store.js +30 -44
- package/dist/cron/service/timer.js +182 -96
- package/dist/cron/service.js +3 -0
- package/dist/cron/stagger.js +37 -0
- package/dist/daemon/inspect.js +132 -92
- package/dist/daemon/runtime-paths.js +25 -4
- package/dist/daemon/service-audit.js +47 -16
- package/dist/discord/accounts.js +23 -20
- package/dist/discord/monitor/agent-components.js +1115 -219
- package/dist/discord/monitor/allow-list.js +114 -34
- package/dist/discord/monitor/listeners.js +204 -97
- package/dist/discord/monitor/message-handler.js +21 -10
- package/dist/discord/monitor/message-handler.preflight.js +195 -101
- package/dist/discord/monitor/message-handler.process.js +384 -123
- package/dist/discord/monitor/message-utils.js +86 -23
- package/dist/discord/monitor/native-command.js +77 -57
- package/dist/discord/monitor/provider.js +122 -117
- package/dist/discord/monitor/reply-context.js +20 -16
- package/dist/discord/monitor/reply-delivery.js +40 -8
- package/dist/discord/monitor/rest-fetch.js +22 -0
- package/dist/discord/monitor/threading.js +117 -24
- package/dist/discord/send.js +2 -1
- package/dist/discord/send.outbound.js +124 -11
- package/dist/discord/send.shared.js +112 -72
- package/dist/discord/voice-message.js +3 -3
- package/dist/gateway/auth.js +119 -44
- package/dist/gateway/call.js +76 -34
- package/dist/gateway/channel-health-monitor.js +57 -50
- package/dist/gateway/client.js +63 -29
- package/dist/gateway/control-ui-contract.js +1 -1
- package/dist/gateway/gateway-config-prompts.shared.js +2 -2
- package/dist/gateway/net.js +109 -1
- package/dist/gateway/protocol/index.js +5 -8
- package/dist/gateway/protocol/schema/agent.js +19 -1
- package/dist/gateway/protocol/schema/channels.js +21 -0
- package/dist/gateway/protocol/schema/cron.js +43 -30
- package/dist/gateway/protocol/schema/protocol-schemas.js +6 -11
- package/dist/gateway/protocol/schema/sessions.js +5 -1
- package/dist/gateway/protocol/schema.js +0 -1
- package/dist/gateway/server/presence-events.js +12 -0
- package/dist/gateway/server/ws-connection/message-handler.js +203 -212
- package/dist/gateway/server/ws-connection.js +58 -21
- package/dist/gateway/server-broadcast.js +18 -13
- package/dist/gateway/server-cron.js +177 -10
- package/dist/gateway/server-methods/agent-job.js +131 -38
- package/dist/gateway/server-methods/send.js +60 -14
- package/dist/gateway/server-methods/sessions.js +160 -96
- package/dist/gateway/server-methods/system.js +5 -7
- package/dist/gateway/server-methods-list.js +8 -0
- package/dist/gateway/server-methods.js +24 -8
- package/dist/gateway/server-node-events.js +278 -68
- package/dist/gateway/session-utils.fs.js +316 -75
- package/dist/gateway/session-utils.js +224 -70
- package/dist/gateway/sessions-patch.js +63 -20
- package/dist/gateway/test-temp-config.js +1 -1
- package/dist/gateway/tools-invoke-http.js +118 -70
- package/dist/gateway/ws-log.js +135 -107
- package/dist/hooks/frontmatter.js +36 -82
- package/dist/hooks/install.js +149 -139
- package/dist/hooks/internal-hooks.js +29 -4
- package/dist/hooks/plugin-hooks.js +2 -1
- package/dist/imessage/monitor/deliver.js +10 -4
- package/dist/imessage/monitor/monitor-provider.js +138 -375
- package/dist/imessage/monitor/runtime.js +4 -8
- package/dist/imessage/send.js +65 -19
- package/dist/infra/exec-approvals-allowlist.js +7 -0
- package/dist/infra/exec-approvals.js +35 -920
- package/dist/infra/exec-safe-bin-trust.js +64 -0
- package/dist/infra/heartbeat-runner.js +207 -134
- package/dist/infra/heartbeat-wake.js +183 -22
- package/dist/infra/install-source-utils.js +47 -0
- package/dist/infra/net/ssrf.js +170 -36
- package/dist/infra/outbound/deliver.js +224 -58
- package/dist/infra/outbound/message-action-spec.js +12 -5
- package/dist/infra/outbound/outbound-session.js +27 -25
- package/dist/infra/poolbot-root.js +32 -22
- package/dist/infra/ports.js +14 -11
- package/dist/infra/skills-remote.js +48 -37
- package/dist/infra/system-events.js +25 -11
- package/dist/infra/system-presence.js +26 -33
- package/dist/infra/tmp-poolbot-dir.js +81 -2
- package/dist/infra/wsl.js +37 -1
- package/dist/line/bot-message-context.js +163 -191
- package/dist/logging/subsystem.js +59 -22
- package/dist/markdown/ir.js +124 -50
- package/dist/media/store.js +1 -1
- package/dist/media-understanding/runner.entries.js +42 -25
- package/dist/media-understanding/runner.js +53 -488
- package/dist/memory/embeddings-gemini.js +53 -38
- package/dist/memory/manager-embedding-ops.js +48 -69
- package/dist/pairing/pairing-store.js +178 -119
- package/dist/plugin-sdk/index.js +34 -6
- package/dist/plugins/hooks.js +135 -14
- package/dist/plugins/install.js +190 -152
- package/dist/polls.js +11 -0
- package/dist/routing/resolve-route.js +190 -56
- package/dist/routing/session-key.js +38 -22
- package/dist/runtime.js +35 -9
- package/dist/security/audit-channel.js +1 -1
- package/dist/sessions/session-key-utils.js +29 -11
- package/dist/shared/frontmatter.js +5 -5
- package/dist/shared/node-list-types.js +1 -0
- package/dist/shared/string-normalization.js +15 -0
- package/dist/signal/monitor/event-handler.js +68 -36
- package/dist/signal/send.js +29 -37
- package/dist/slack/monitor/allow-list.js +10 -11
- package/dist/slack/monitor/commands.js +14 -3
- package/dist/slack/monitor/events/interactions.js +4 -4
- package/dist/slack/monitor/media.js +224 -16
- package/dist/slack/monitor/message-handler/dispatch.js +247 -13
- package/dist/slack/monitor/message-handler/prepare.js +128 -45
- package/dist/slack/monitor/slash.js +357 -144
- package/dist/slack/streaming.js +77 -0
- package/dist/telegram/accounts.js +40 -13
- package/dist/telegram/allowed-updates.js +3 -0
- package/dist/telegram/bot/delivery.js +129 -66
- package/dist/telegram/bot/helpers.js +136 -122
- package/dist/telegram/bot-handlers.js +600 -339
- package/dist/telegram/bot-message-context.js +115 -73
- package/dist/telegram/bot-message-dispatch.js +235 -104
- package/dist/telegram/bot-native-command-menu.js +3 -1
- package/dist/telegram/bot-native-commands.js +213 -193
- package/dist/telegram/bot.js +24 -132
- package/dist/telegram/draft-stream.js +84 -75
- package/dist/telegram/format.js +150 -6
- package/dist/telegram/send.js +415 -255
- package/dist/telegram/targets.js +21 -2
- package/dist/telegram/update-offset-store.js +19 -3
- package/dist/terminal/restore.js +5 -2
- package/dist/test-utils/fetch-mock.js +5 -0
- package/dist/version.js +18 -5
- package/dist/web/auto-reply/monitor/broadcast.js +7 -3
- package/dist/web/auto-reply/monitor/on-message.js +6 -3
- package/dist/web/inbound/media.js +34 -8
- package/dist/web/inbound/monitor.js +34 -17
- package/dist/web/inbound/send-api.js +18 -17
- package/dist/web/outbound.js +12 -5
- package/dist/wizard/clack-prompter.js +40 -7
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/discord/package.json +1 -1
- package/extensions/feishu/package.json +1 -1
- package/extensions/google-antigravity-auth/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +5 -0
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +1 -1
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +5 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +5 -0
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/openai-codex-auth/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/package.json +1 -1
- package/extensions/telegram/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +5 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +5 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +5 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +5 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +1 -1
- package/skills/apple-reminders/SKILL.md +100 -49
- package/skills/coding-agent/SKILL.md +34 -28
- package/skills/github/SKILL.md +131 -16
- package/skills/imsg/SKILL.md +112 -15
- package/skills/openhue/SKILL.md +101 -19
- package/skills/tmux/SKILL.md +111 -79
- package/skills/weather/SKILL.md +88 -25
|
@@ -67,7 +67,7 @@ export function formatSkillsList(report, opts) {
|
|
|
67
67
|
}
|
|
68
68
|
if (skills.length === 0) {
|
|
69
69
|
const message = opts.eligible
|
|
70
|
-
? `No eligible skills found. Run \`${formatCliCommand("
|
|
70
|
+
? `No eligible skills found. Run \`${formatCliCommand("poolbot skills list")}\` to see all skills.`
|
|
71
71
|
: "No skills found.";
|
|
72
72
|
return appendClawHubHint(message, opts.json);
|
|
73
73
|
}
|
|
@@ -107,7 +107,7 @@ export function formatSkillInfo(report, skillName, opts) {
|
|
|
107
107
|
if (opts.json) {
|
|
108
108
|
return JSON.stringify({ error: "not found", skill: skillName }, null, 2);
|
|
109
109
|
}
|
|
110
|
-
return appendClawHubHint(`Skill "${skillName}" not found. Run \`${formatCliCommand("
|
|
110
|
+
return appendClawHubHint(`Skill "${skillName}" not found. Run \`${formatCliCommand("poolbot skills list")}\` to see available skills.`, opts.json);
|
|
111
111
|
}
|
|
112
112
|
if (opts.json) {
|
|
113
113
|
return JSON.stringify(skill, null, 2);
|
|
@@ -17,8 +17,8 @@ const STEP_LABELS = {
|
|
|
17
17
|
"ui:build": "Building UI assets",
|
|
18
18
|
"ui:build (post-doctor repair)": "Restoring missing UI assets",
|
|
19
19
|
"ui assets verify": "Validating UI assets",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
20
|
+
"poolbot doctor entry": "Checking doctor entrypoint",
|
|
21
|
+
"poolbot doctor": "Running doctor checks",
|
|
22
22
|
"git rev-parse HEAD (after)": "Verifying update",
|
|
23
23
|
"global update": "Updating via package manager",
|
|
24
24
|
"global install": "Installing global package",
|
|
@@ -16,6 +16,27 @@ function isBatchSafe(value) {
|
|
|
16
16
|
// Reject characters that have special meaning in batch: & | < > ^ % " ` $
|
|
17
17
|
return /^[A-Za-z0-9 _\-().]+$/.test(value);
|
|
18
18
|
}
|
|
19
|
+
function resolveSystemdUnit(env) {
|
|
20
|
+
const override = env.POOLBOT_SYSTEMD_UNIT?.trim();
|
|
21
|
+
if (override) {
|
|
22
|
+
return override.endsWith(".service") ? override : `${override}.service`;
|
|
23
|
+
}
|
|
24
|
+
return `${resolveGatewaySystemdServiceName(env.POOLBOT_PROFILE)}.service`;
|
|
25
|
+
}
|
|
26
|
+
function resolveLaunchdLabel(env) {
|
|
27
|
+
const override = env.POOLBOT_LAUNCHD_LABEL?.trim();
|
|
28
|
+
if (override) {
|
|
29
|
+
return override;
|
|
30
|
+
}
|
|
31
|
+
return resolveGatewayLaunchAgentLabel(env.POOLBOT_PROFILE);
|
|
32
|
+
}
|
|
33
|
+
function resolveWindowsTaskName(env) {
|
|
34
|
+
const override = env.POOLBOT_WINDOWS_TASK_NAME?.trim();
|
|
35
|
+
if (override) {
|
|
36
|
+
return override;
|
|
37
|
+
}
|
|
38
|
+
return resolveGatewayWindowsTaskName(env.POOLBOT_PROFILE);
|
|
39
|
+
}
|
|
19
40
|
/**
|
|
20
41
|
* Prepares a standalone script to restart the gateway service.
|
|
21
42
|
* This script is written to a temporary directory and does not depend on
|
|
@@ -30,9 +51,9 @@ export async function prepareRestartScript(env = process.env) {
|
|
|
30
51
|
let filename = "";
|
|
31
52
|
try {
|
|
32
53
|
if (platform === "linux") {
|
|
33
|
-
const
|
|
34
|
-
const escaped = shellEscape(
|
|
35
|
-
filename = `
|
|
54
|
+
const unitName = resolveSystemdUnit(env);
|
|
55
|
+
const escaped = shellEscape(unitName);
|
|
56
|
+
filename = `poolbot-restart-${timestamp}.sh`;
|
|
36
57
|
scriptContent = `#!/bin/sh
|
|
37
58
|
# Standalone restart script — survives parent process termination.
|
|
38
59
|
# Wait briefly to ensure file locks are released after update.
|
|
@@ -43,11 +64,11 @@ rm -f "$0"
|
|
|
43
64
|
`;
|
|
44
65
|
}
|
|
45
66
|
else if (platform === "darwin") {
|
|
46
|
-
const label =
|
|
67
|
+
const label = resolveLaunchdLabel(env);
|
|
47
68
|
const escaped = shellEscape(label);
|
|
48
69
|
// Fallback to 501 if getuid is not available (though it should be on macOS)
|
|
49
70
|
const uid = process.getuid ? process.getuid() : 501;
|
|
50
|
-
filename = `
|
|
71
|
+
filename = `poolbot-restart-${timestamp}.sh`;
|
|
51
72
|
scriptContent = `#!/bin/sh
|
|
52
73
|
# Standalone restart script — survives parent process termination.
|
|
53
74
|
# Wait briefly to ensure file locks are released after update.
|
|
@@ -58,11 +79,11 @@ rm -f "$0"
|
|
|
58
79
|
`;
|
|
59
80
|
}
|
|
60
81
|
else if (platform === "win32") {
|
|
61
|
-
const taskName =
|
|
82
|
+
const taskName = resolveWindowsTaskName(env);
|
|
62
83
|
if (!isBatchSafe(taskName)) {
|
|
63
84
|
return null;
|
|
64
85
|
}
|
|
65
|
-
filename = `
|
|
86
|
+
filename = `poolbot-restart-${timestamp}.bat`;
|
|
66
87
|
scriptContent = `@echo off
|
|
67
88
|
REM Standalone restart script — survives parent process termination.
|
|
68
89
|
REM Wait briefly to ensure file locks are released after update.
|
|
@@ -3,7 +3,7 @@ import fs from "node:fs/promises";
|
|
|
3
3
|
import os from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { resolveStateDir } from "../../config/paths.js";
|
|
6
|
-
import {
|
|
6
|
+
import { resolvePoolBotPackageRoot } from "../../infra/poolbot-root.js";
|
|
7
7
|
import { readPackageName, readPackageVersion } from "../../infra/package-json.js";
|
|
8
8
|
import { trimLogTail } from "../../infra/restart-sentinel.js";
|
|
9
9
|
import { parseSemver } from "../../infra/runtime-guard.js";
|
|
@@ -13,7 +13,7 @@ import { runCommandWithTimeout } from "../../process/exec.js";
|
|
|
13
13
|
import { defaultRuntime } from "../../runtime.js";
|
|
14
14
|
import { theme } from "../../terminal/theme.js";
|
|
15
15
|
import { pathExists } from "../../utils.js";
|
|
16
|
-
const POOLBOT_REPO_URL = "https://github.com/
|
|
16
|
+
const POOLBOT_REPO_URL = "https://github.com/poolbot/poolbot.git";
|
|
17
17
|
const MAX_LOG_CHARS = 8000;
|
|
18
18
|
export const DEFAULT_PACKAGE_NAME = "poolbot";
|
|
19
19
|
const CORE_PACKAGE_NAMES = new Set([DEFAULT_PACKAGE_NAME]);
|
|
@@ -25,8 +25,8 @@ export function normalizeTag(value) {
|
|
|
25
25
|
if (!trimmed) {
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
|
-
if (trimmed.startsWith("
|
|
29
|
-
return trimmed.slice("
|
|
28
|
+
if (trimmed.startsWith("poolbot@")) {
|
|
29
|
+
return trimmed.slice("poolbot@".length);
|
|
30
30
|
}
|
|
31
31
|
if (trimmed.startsWith(`${DEFAULT_PACKAGE_NAME}@`)) {
|
|
32
32
|
return trimmed.slice(`${DEFAULT_PACKAGE_NAME}@`.length);
|
|
@@ -90,7 +90,7 @@ export function resolveNodeRunner() {
|
|
|
90
90
|
return "node";
|
|
91
91
|
}
|
|
92
92
|
export async function resolveUpdateRoot() {
|
|
93
|
-
return ((await
|
|
93
|
+
return ((await resolvePoolBotPackageRoot({
|
|
94
94
|
moduleUrl: import.meta.url,
|
|
95
95
|
argv1: process.argv[1],
|
|
96
96
|
cwd: process.cwd(),
|
|
@@ -143,7 +143,7 @@ export async function ensureGitCheckout(params) {
|
|
|
143
143
|
if (!(await isGitCheckout(params.dir))) {
|
|
144
144
|
const empty = await isEmptyDir(params.dir);
|
|
145
145
|
if (!empty) {
|
|
146
|
-
throw new Error(`POOLBOT_GIT_DIR points at a non-git directory: ${params.dir}. Set POOLBOT_GIT_DIR to an empty folder or an
|
|
146
|
+
throw new Error(`POOLBOT_GIT_DIR points at a non-git directory: ${params.dir}. Set POOLBOT_GIT_DIR to an empty folder or an poolbot checkout.`);
|
|
147
147
|
}
|
|
148
148
|
return await runUpdateStep({
|
|
149
149
|
name: "git clone",
|
|
@@ -173,7 +173,7 @@ export async function resolveGlobalManager(params) {
|
|
|
173
173
|
return byPresence ?? "npm";
|
|
174
174
|
}
|
|
175
175
|
export async function tryWriteCompletionCache(root, jsonMode) {
|
|
176
|
-
const binPath = path.join(root, "
|
|
176
|
+
const binPath = path.join(root, "poolbot.mjs");
|
|
177
177
|
if (!(await pathExists(binPath))) {
|
|
178
178
|
return;
|
|
179
179
|
}
|
|
@@ -79,7 +79,7 @@ export async function updateStatusCommand(opts) {
|
|
|
79
79
|
Value: updateAvailability.available ? theme.warn(`available · ${updateLine}`) : updateLine,
|
|
80
80
|
},
|
|
81
81
|
];
|
|
82
|
-
defaultRuntime.log(theme.heading("
|
|
82
|
+
defaultRuntime.log(theme.heading("Pool Bot update status"));
|
|
83
83
|
defaultRuntime.log("");
|
|
84
84
|
defaultRuntime.log(renderTable({
|
|
85
85
|
width: tableWidth,
|
|
@@ -75,7 +75,7 @@ async function tryInstallShellCompletion(opts) {
|
|
|
75
75
|
});
|
|
76
76
|
if (isCancel(shouldInstall) || !shouldInstall) {
|
|
77
77
|
if (!opts.skipPrompt) {
|
|
78
|
-
defaultRuntime.log(theme.muted(`Skipped. Run \`${replaceCliName(formatCliCommand("
|
|
78
|
+
defaultRuntime.log(theme.muted(`Skipped. Run \`${replaceCliName(formatCliCommand("poolbot completion --install"), CLI_NAME)}\` later to enable.`));
|
|
79
79
|
}
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
@@ -288,9 +288,10 @@ async function maybeRestartService(params) {
|
|
|
288
288
|
}
|
|
289
289
|
try {
|
|
290
290
|
let restarted = false;
|
|
291
|
+
let restartInitiated = false;
|
|
291
292
|
if (params.restartScriptPath) {
|
|
292
293
|
await runRestartScript(params.restartScriptPath);
|
|
293
|
-
|
|
294
|
+
restartInitiated = true;
|
|
294
295
|
}
|
|
295
296
|
else {
|
|
296
297
|
restarted = await runDaemonRestart();
|
|
@@ -312,11 +313,16 @@ async function maybeRestartService(params) {
|
|
|
312
313
|
delete process.env.POOLBOT_UPDATE_IN_PROGRESS;
|
|
313
314
|
}
|
|
314
315
|
}
|
|
316
|
+
if (!params.opts.json && restartInitiated) {
|
|
317
|
+
defaultRuntime.log(theme.success("Daemon restart initiated."));
|
|
318
|
+
defaultRuntime.log(theme.muted(`Verify with \`${replaceCliName(formatCliCommand("poolbot gateway status"), CLI_NAME)}\` once the gateway is back.`));
|
|
319
|
+
defaultRuntime.log("");
|
|
320
|
+
}
|
|
315
321
|
}
|
|
316
322
|
catch (err) {
|
|
317
323
|
if (!params.opts.json) {
|
|
318
324
|
defaultRuntime.log(theme.warn(`Daemon restart failed: ${String(err)}`));
|
|
319
|
-
defaultRuntime.log(theme.muted(`You may need to restart the service manually: ${replaceCliName(formatCliCommand("
|
|
325
|
+
defaultRuntime.log(theme.muted(`You may need to restart the service manually: ${replaceCliName(formatCliCommand("poolbot gateway restart"), CLI_NAME)}`));
|
|
320
326
|
}
|
|
321
327
|
}
|
|
322
328
|
return;
|
|
@@ -324,10 +330,10 @@ async function maybeRestartService(params) {
|
|
|
324
330
|
if (!params.opts.json) {
|
|
325
331
|
defaultRuntime.log("");
|
|
326
332
|
if (params.result.mode === "npm" || params.result.mode === "pnpm") {
|
|
327
|
-
defaultRuntime.log(theme.muted(`Tip: Run \`${replaceCliName(formatCliCommand("
|
|
333
|
+
defaultRuntime.log(theme.muted(`Tip: Run \`${replaceCliName(formatCliCommand("poolbot doctor"), CLI_NAME)}\`, then \`${replaceCliName(formatCliCommand("poolbot gateway restart"), CLI_NAME)}\` to apply updates to a running gateway.`));
|
|
328
334
|
}
|
|
329
335
|
else {
|
|
330
|
-
defaultRuntime.log(theme.muted(`Tip: Run \`${replaceCliName(formatCliCommand("
|
|
336
|
+
defaultRuntime.log(theme.muted(`Tip: Run \`${replaceCliName(formatCliCommand("poolbot gateway restart"), CLI_NAME)}\` to apply updates to a running gateway.`));
|
|
331
337
|
}
|
|
332
338
|
}
|
|
333
339
|
}
|
|
@@ -427,7 +433,7 @@ export async function updateCommand(opts) {
|
|
|
427
433
|
}
|
|
428
434
|
const showProgress = !opts.json && process.stdout.isTTY;
|
|
429
435
|
if (!opts.json) {
|
|
430
|
-
defaultRuntime.log(theme.heading("Updating
|
|
436
|
+
defaultRuntime.log(theme.heading("Updating Pool Bot..."));
|
|
431
437
|
defaultRuntime.log("");
|
|
432
438
|
}
|
|
433
439
|
const { progress, stop } = createUpdateProgress(showProgress);
|
|
@@ -477,8 +483,8 @@ export async function updateCommand(opts) {
|
|
|
477
483
|
defaultRuntime.log(theme.warn("Skipped: working directory has uncommitted changes. Commit or stash them first."));
|
|
478
484
|
}
|
|
479
485
|
if (result.reason === "not-git-install") {
|
|
480
|
-
defaultRuntime.log(theme.warn(`Skipped: this
|
|
481
|
-
defaultRuntime.log(theme.muted(`Examples: \`${replaceCliName("npm i -g
|
|
486
|
+
defaultRuntime.log(theme.warn(`Skipped: this Pool Bot install isn't a git checkout, and the package manager couldn't be detected. Update via your package manager, then run \`${replaceCliName(formatCliCommand("poolbot doctor"), CLI_NAME)}\` and \`${replaceCliName(formatCliCommand("poolbot gateway restart"), CLI_NAME)}\`.`));
|
|
487
|
+
defaultRuntime.log(theme.muted(`Examples: \`${replaceCliName("npm i -g poolbot@latest", CLI_NAME)}\` or \`${replaceCliName("pnpm add -g poolbot@latest", CLI_NAME)}\``));
|
|
482
488
|
}
|
|
483
489
|
defaultRuntime.exit(0);
|
|
484
490
|
return;
|
|
@@ -15,7 +15,7 @@ const selectStyled = (params) => select({
|
|
|
15
15
|
});
|
|
16
16
|
export async function updateWizardCommand(opts = {}) {
|
|
17
17
|
if (!process.stdin.isTTY) {
|
|
18
|
-
defaultRuntime.error("Update wizard requires a TTY. Use `
|
|
18
|
+
defaultRuntime.error("Update wizard requires a TTY. Use `poolbot update --channel <stable|beta|dev>` instead.");
|
|
19
19
|
defaultRuntime.exit(1);
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
@@ -91,7 +91,7 @@ export async function updateWizardCommand(opts = {}) {
|
|
|
91
91
|
if (dirExists) {
|
|
92
92
|
const empty = await isEmptyDir(gitDir);
|
|
93
93
|
if (!empty) {
|
|
94
|
-
defaultRuntime.error(`POOLBOT_GIT_DIR points at a non-git directory: ${gitDir}. Set POOLBOT_GIT_DIR to an empty folder or an
|
|
94
|
+
defaultRuntime.error(`POOLBOT_GIT_DIR points at a non-git directory: ${gitDir}. Set POOLBOT_GIT_DIR to an empty folder or an poolbot checkout.`);
|
|
95
95
|
defaultRuntime.exit(1);
|
|
96
96
|
return;
|
|
97
97
|
}
|