@poolzin/pool-bot 2026.1.39 → 2026.2.1
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/assets/chrome-extension/README.md +3 -3
- package/assets/chrome-extension/background.js +5 -5
- package/assets/chrome-extension/manifest.json +3 -3
- package/assets/chrome-extension/options.html +4 -4
- package/assets/chrome-extension/options.js +1 -1
- package/dist/acp/client.js +3 -3
- package/dist/acp/types.js +1 -1
- package/dist/agents/agent-paths.js +3 -3
- package/dist/agents/auth-profiles/paths.js +3 -3
- package/dist/agents/bash-tools.exec.js +76 -25
- package/dist/agents/cli-runner/helpers.js +10 -12
- package/dist/agents/cli-runner.js +2 -2
- package/dist/agents/cloudflare-ai-gateway.js +31 -0
- package/dist/agents/compaction.js +16 -2
- package/dist/agents/context-window-guard.js +13 -10
- package/dist/agents/context.js +4 -4
- package/dist/agents/docs-path.js +1 -1
- package/dist/agents/identity.js +47 -7
- package/dist/agents/memory-search.js +25 -8
- package/dist/agents/minimax-vlm.js +1 -1
- package/dist/agents/model-auth.js +12 -1
- package/dist/agents/model-catalog.js +4 -4
- package/dist/agents/model-selection.js +31 -4
- package/dist/agents/models-config.js +3 -3
- package/dist/agents/models-config.providers.js +147 -39
- package/dist/agents/pi-embedded-block-chunker.js +117 -42
- package/dist/agents/pi-embedded-helpers/errors.js +183 -78
- package/dist/agents/pi-embedded-helpers/openai.js +1 -1
- package/dist/agents/pi-embedded-helpers.js +1 -1
- package/dist/agents/pi-embedded-runner/compact.js +9 -8
- package/dist/agents/pi-embedded-runner/model.js +63 -4
- package/dist/agents/pi-embedded-runner/run/attempt.js +27 -17
- package/dist/agents/pi-embedded-runner/run.js +203 -50
- package/dist/agents/pi-embedded-runner/system-prompt.js +10 -2
- package/dist/agents/pi-embedded-runner/tool-result-truncation.js +275 -0
- package/dist/agents/pi-embedded-runner/utils.js +1 -1
- package/dist/agents/pi-embedded-subscribe.js +118 -29
- package/dist/agents/pi-model-discovery.js +10 -0
- package/dist/agents/pi-tool-definition-adapter.js +50 -9
- package/dist/agents/pi-tools.before-tool-call.js +67 -0
- package/dist/agents/pi-tools.js +20 -10
- package/dist/agents/pi-tools.read.js +2 -2
- package/dist/agents/poolbot-tools.js +15 -10
- package/dist/agents/sandbox-paths.js +31 -0
- package/dist/agents/session-file-repair.js +83 -0
- package/dist/agents/session-tool-result-guard.js +94 -15
- package/dist/agents/session-transcript-repair.js +68 -0
- package/dist/agents/shell-utils.js +51 -0
- package/dist/agents/skills/bundled-context.js +23 -0
- package/dist/agents/skills/bundled-dir.js +41 -7
- package/dist/agents/skills/frontmatter.js +1 -1
- package/dist/agents/skills/workspace.js +2 -2
- package/dist/agents/skills-install.js +60 -23
- package/dist/agents/subagent-announce.js +79 -34
- package/dist/agents/system-prompt.js +28 -4
- package/dist/agents/together-models.js +127 -0
- package/dist/agents/tool-images.js +1 -1
- package/dist/agents/tool-policy.conformance.js +14 -0
- package/dist/agents/tool-policy.js +25 -1
- package/dist/agents/tools/browser-tool.js +3 -3
- package/dist/agents/tools/cron-tool.js +166 -19
- package/dist/agents/tools/discord-actions-presence.js +78 -0
- package/dist/agents/tools/image-tool.js +2 -2
- package/dist/agents/tools/memory-tool.js +93 -5
- package/dist/agents/tools/message-tool.js +56 -2
- package/dist/agents/tools/sessions-history-tool.js +69 -1
- package/dist/agents/tools/web-search.js +211 -42
- package/dist/agents/usage.js +23 -1
- package/dist/agents/workspace-run.js +67 -0
- package/dist/agents/workspace-templates.js +44 -0
- package/dist/auto-reply/command-auth.js +121 -6
- package/dist/auto-reply/commands-registry.data.js +1 -1
- package/dist/auto-reply/envelope.js +50 -72
- package/dist/auto-reply/reply/commands-compact.js +1 -0
- package/dist/auto-reply/reply/commands-context-report.js +3 -2
- package/dist/auto-reply/reply/commands-context.js +1 -0
- package/dist/auto-reply/reply/commands-models.js +107 -60
- package/dist/auto-reply/reply/commands-ptt.js +171 -0
- package/dist/auto-reply/reply/commands-session.js +2 -2
- package/dist/auto-reply/reply/get-reply-run.js +16 -5
- package/dist/auto-reply/reply/groups.js +1 -1
- package/dist/auto-reply/reply/inbound-context.js +9 -1
- package/dist/auto-reply/reply/inbound-meta.js +130 -0
- package/dist/auto-reply/reply/model-selection.js +3 -3
- package/dist/auto-reply/reply/untrusted-context.js +15 -0
- package/dist/auto-reply/status.js +1 -1
- package/dist/auto-reply/thinking.js +88 -43
- package/dist/browser/bridge-server.js +13 -0
- package/dist/browser/cdp.helpers.js +38 -24
- package/dist/browser/client-fetch.js +51 -8
- package/dist/browser/config.js +2 -11
- package/dist/browser/extension-relay.js +104 -43
- package/dist/browser/pw-ai.js +1 -1
- package/dist/browser/pw-session.js +143 -8
- package/dist/browser/pw-tools-core.interactions.js +125 -27
- package/dist/browser/pw-tools-core.responses.js +1 -1
- package/dist/browser/pw-tools-core.state.js +1 -1
- package/dist/browser/routes/agent.act.js +86 -41
- package/dist/browser/routes/dispatcher.js +4 -4
- package/dist/browser/screenshot.js +1 -1
- package/dist/browser/server-context.js +2 -2
- package/dist/browser/server.js +13 -0
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui.js +3 -3
- package/dist/channels/plugins/catalog.js +2 -2
- package/dist/channels/plugins/onboarding/imessage.js +1 -1
- package/dist/channels/plugins/onboarding/signal.js +1 -1
- package/dist/channels/plugins/onboarding/slack.js +4 -4
- package/dist/channels/plugins/onboarding/whatsapp.js +3 -3
- package/dist/channels/plugins/pairing-message.js +1 -1
- package/dist/channels/reply-prefix.js +8 -1
- package/dist/cli/browser-cli-extension.js +2 -2
- package/dist/cli/cron-cli/register.cron-add.js +61 -40
- package/dist/cli/cron-cli/register.cron-edit.js +60 -34
- package/dist/cli/cron-cli/shared.js +56 -41
- package/dist/cli/dns-cli.js +26 -14
- package/dist/cli/docs-cli.js +1 -1
- package/dist/cli/gateway-cli/dev.js +1 -1
- package/dist/cli/gateway-cli/register.js +37 -19
- package/dist/cli/memory-cli.js +30 -20
- package/dist/cli/nodes-cli/register.canvas.js +1 -1
- package/dist/cli/parse-bytes.js +37 -0
- package/dist/cli/plugins-cli.js +1 -1
- package/dist/cli/run-main.js +2 -2
- package/dist/cli/security-cli.js +1 -1
- package/dist/cli/tagline.js +1 -1
- package/dist/cli/update-cli.js +173 -52
- package/dist/cli/webhooks-cli.js +5 -5
- package/dist/commands/agent.js +1 -0
- package/dist/commands/agents.commands.add.js +1 -1
- package/dist/commands/auth-choice.apply.api-providers.js +305 -17
- package/dist/commands/auth-choice.apply.js +4 -1
- package/dist/commands/auth-choice.apply.plugin-provider.js +2 -2
- package/dist/commands/auth-choice.apply.xai.js +63 -0
- package/dist/commands/auth-choice.preferred-provider.js +7 -1
- package/dist/commands/configure.wizard.js +1 -1
- package/dist/commands/dashboard.js +1 -1
- package/dist/commands/docs.js +1 -1
- package/dist/commands/doctor-config-flow.js +61 -5
- package/dist/commands/doctor-gateway-services.js +3 -3
- package/dist/commands/doctor-state-migrations.js +1 -1
- package/dist/commands/doctor-update.js +3 -3
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/health.js +1 -1
- package/dist/commands/model-allowlist.js +29 -0
- package/dist/commands/model-picker.js +2 -1
- package/dist/commands/models/list.probe.js +2 -2
- package/dist/commands/models/list.registry.js +4 -4
- package/dist/commands/models/list.status-command.js +44 -24
- package/dist/commands/models/shared.js +15 -0
- package/dist/commands/onboard-auth.config-core.js +366 -28
- package/dist/commands/onboard-auth.credentials.js +71 -9
- package/dist/commands/onboard-auth.js +3 -3
- package/dist/commands/onboard-auth.models.js +26 -24
- package/dist/commands/onboard-custom.js +384 -0
- package/dist/commands/onboard-non-interactive/local/auth-choice-inference.js +35 -0
- package/dist/commands/onboard-non-interactive/local/auth-choice.js +146 -9
- package/dist/commands/onboard-skills.js +63 -38
- package/dist/commands/openai-model-default.js +41 -0
- package/dist/commands/status-all/report-lines.js +1 -1
- package/dist/commands/status.command.js +1 -1
- package/dist/commands/uninstall.js +3 -3
- package/dist/compat/legacy-names.js +1 -1
- package/dist/config/defaults.js +3 -2
- package/dist/config/io.js +3 -3
- package/dist/config/paths.js +136 -35
- package/dist/config/plugin-auto-enable.js +21 -5
- package/dist/config/redact-snapshot.js +153 -0
- package/dist/config/schema.field-metadata.js +590 -0
- package/dist/config/schema.js +3 -3
- package/dist/config/sessions/store.js +291 -23
- package/dist/config/types.memory.js +1 -0
- package/dist/config/version.js +4 -4
- package/dist/config/zod-schema.agent-defaults.js +3 -0
- package/dist/config/zod-schema.agent-runtime.js +13 -2
- package/dist/config/zod-schema.providers-core.js +142 -0
- package/dist/config/zod-schema.session.js +3 -0
- package/dist/cron/delivery.js +57 -0
- package/dist/cron/isolated-agent/delivery-target.js +18 -3
- package/dist/cron/isolated-agent/helpers.js +22 -5
- package/dist/cron/isolated-agent/run.js +171 -63
- package/dist/cron/isolated-agent/session.js +2 -0
- package/dist/cron/normalize.js +356 -28
- package/dist/cron/parse.js +10 -5
- package/dist/cron/run-log.js +35 -10
- package/dist/cron/schedule.js +41 -6
- package/dist/cron/service/jobs.js +208 -35
- package/dist/cron/service/ops.js +72 -16
- package/dist/cron/service/state.js +2 -0
- package/dist/cron/service/store.js +386 -14
- package/dist/cron/service/timer.js +390 -147
- package/dist/cron/session-reaper.js +86 -0
- package/dist/cron/store.js +23 -8
- package/dist/cron/validate-timestamp.js +43 -0
- package/dist/daemon/constants.js +7 -7
- package/dist/daemon/inspect.js +6 -6
- package/dist/daemon/systemd-unit.js +1 -1
- package/dist/discord/monitor/agent-components.js +438 -0
- package/dist/discord/monitor/allow-list.js +28 -5
- package/dist/discord/monitor/gateway-registry.js +29 -0
- package/dist/discord/monitor/native-command.js +44 -23
- package/dist/discord/monitor/sender-identity.js +45 -0
- package/dist/discord/pluralkit.js +27 -0
- package/dist/discord/send.outbound.js +92 -5
- package/dist/discord/send.shared.js +60 -23
- package/dist/discord/targets.js +84 -1
- package/dist/entry.js +15 -9
- package/dist/extensionAPI.js +8 -0
- package/dist/gateway/control-ui.js +8 -1
- package/dist/gateway/hooks-mapping.js +3 -0
- package/dist/gateway/hooks.js +65 -0
- package/dist/gateway/live-image-probe.js +1 -66
- package/dist/gateway/net.js +96 -31
- package/dist/gateway/node-command-policy.js +50 -15
- package/dist/gateway/openai-http.js +2 -2
- package/dist/gateway/openresponses-http.js +4 -4
- package/dist/gateway/origin-check.js +56 -0
- package/dist/gateway/protocol/client-info.js +9 -0
- package/dist/gateway/protocol/index.js +9 -2
- package/dist/gateway/protocol/schema/agents-models-skills.js +71 -1
- package/dist/gateway/protocol/schema/cron.js +22 -10
- package/dist/gateway/protocol/schema/protocol-schemas.js +16 -2
- package/dist/gateway/protocol/schema/sessions.js +12 -0
- package/dist/gateway/server/hooks.js +1 -1
- package/dist/gateway/server-broadcast.js +26 -9
- package/dist/gateway/server-chat.js +112 -23
- package/dist/gateway/server-discovery-runtime.js +10 -2
- package/dist/gateway/server-discovery.js +2 -2
- package/dist/gateway/server-http.js +110 -12
- package/dist/gateway/server-methods/agent-timestamp.js +60 -0
- package/dist/gateway/server-methods/agents.js +321 -2
- package/dist/gateway/server-methods/usage.js +559 -16
- package/dist/gateway/server-runtime-state.js +22 -8
- package/dist/gateway/server-startup-memory.js +16 -0
- package/dist/gateway/server.impl.js +7 -3
- package/dist/gateway/session-utils.fs.js +23 -25
- package/dist/gateway/session-utils.js +20 -10
- package/dist/gateway/sessions-patch.js +7 -22
- package/dist/gateway/test-helpers.server.js +35 -2
- package/dist/hooks/frontmatter.js +1 -1
- package/dist/hooks/hooks-status.js +1 -1
- package/dist/hooks/install.js +2 -2
- package/dist/hooks/loader.js +1 -1
- package/dist/hooks/workspace.js +3 -3
- package/dist/imessage/constants.js +2 -0
- package/dist/imessage/monitor/deliver.js +4 -1
- package/dist/imessage/monitor/monitor-provider.js +51 -1
- package/dist/index.js +2 -2
- package/dist/infra/bonjour-discovery.js +131 -70
- package/dist/infra/bonjour.js +3 -3
- package/dist/infra/control-ui-assets.js +134 -12
- package/dist/infra/errors.js +12 -0
- package/dist/infra/exec-approvals.js +266 -57
- package/dist/infra/format-time/format-datetime.js +79 -0
- package/dist/infra/format-time/format-duration.js +81 -0
- package/dist/infra/format-time/format-relative.js +80 -0
- package/dist/infra/heartbeat-runner.js +140 -49
- package/dist/infra/home-dir.js +54 -0
- package/dist/infra/net/fetch-guard.js +122 -0
- package/dist/infra/net/ssrf.js +65 -29
- package/dist/infra/outbound/abort.js +14 -0
- package/dist/infra/outbound/message-action-runner.js +77 -13
- package/dist/infra/outbound/outbound-session.js +143 -37
- package/dist/infra/path-env.js +3 -3
- package/dist/infra/poolbot-root.js +43 -1
- package/dist/infra/provider-usage.fetch.minimax.js +1 -1
- package/dist/infra/restart.js +1 -1
- package/dist/infra/session-cost-usage.js +631 -41
- package/dist/infra/state-migrations.js +317 -47
- package/dist/infra/tailscale.js +1 -1
- package/dist/infra/update-global.js +35 -0
- package/dist/infra/update-runner.js +149 -43
- package/dist/infra/warning-filter.js +65 -0
- package/dist/infra/widearea-dns.js +30 -9
- package/dist/logging/redact-identifier.js +12 -0
- package/dist/macos/relay.js +2 -2
- package/dist/media/fetch.js +81 -58
- package/dist/media/input-files.js +1 -1
- package/dist/media/mime.js +4 -0
- package/dist/media/png-encode.js +74 -0
- package/dist/media-understanding/apply.js +403 -3
- package/dist/media-understanding/attachments.js +38 -27
- package/dist/media-understanding/defaults.js +16 -0
- package/dist/media-understanding/providers/deepgram/audio.js +22 -14
- package/dist/media-understanding/providers/google/audio.js +24 -17
- package/dist/media-understanding/providers/google/video.js +24 -17
- package/dist/media-understanding/providers/image.js +4 -4
- package/dist/media-understanding/providers/index.js +4 -1
- package/dist/media-understanding/providers/openai/audio.js +22 -14
- package/dist/media-understanding/providers/shared.js +16 -11
- package/dist/media-understanding/providers/zai/index.js +6 -0
- package/dist/media-understanding/runner.js +158 -90
- package/dist/memory/backend-config.js +207 -0
- package/dist/memory/batch-voyage.js +277 -0
- package/dist/memory/embeddings-voyage.js +75 -0
- package/dist/memory/embeddings.js +29 -17
- package/dist/memory/internal.js +101 -18
- package/dist/memory/manager.js +155 -48
- package/dist/memory/search-manager.js +173 -0
- package/dist/memory/session-files.js +9 -3
- package/dist/memory/types.js +1 -0
- package/dist/node-host/runner.js +36 -26
- package/dist/node-host/with-timeout.js +27 -0
- package/dist/pairing/pairing-messages.js +1 -1
- package/dist/plugins/commands.js +5 -1
- package/dist/plugins/config-state.js +86 -7
- package/dist/plugins/discovery.js +1 -1
- package/dist/plugins/install.js +2 -2
- package/dist/plugins/source-display.js +51 -0
- package/dist/plugins/update.js +1 -1
- package/dist/process/exec.js +20 -2
- package/dist/routing/resolve-route.js +12 -0
- package/dist/routing/session-key.js +15 -0
- package/dist/runtime.js +2 -0
- package/dist/security/audit-extra.async.js +601 -0
- package/dist/security/audit-extra.js +2 -830
- package/dist/security/audit-extra.sync.js +505 -0
- package/dist/security/audit.js +2 -2
- package/dist/security/channel-metadata.js +34 -0
- package/dist/security/external-content.js +88 -6
- package/dist/security/skill-scanner.js +330 -0
- package/dist/sessions/session-key-utils.js +7 -0
- package/dist/shared/text/reasoning-tags.js +52 -7
- package/dist/signal/monitor/event-handler.js +80 -1
- package/dist/slack/monitor/media.js +85 -15
- package/dist/tailscale/detect.js +145 -0
- package/dist/telegram/bot/helpers.js +109 -28
- package/dist/telegram/bot-handlers.js +144 -3
- package/dist/telegram/bot-message-context.js +38 -11
- package/dist/telegram/bot-message-dispatch.js +48 -15
- package/dist/telegram/bot-native-commands.js +86 -29
- package/dist/telegram/bot.js +30 -29
- package/dist/telegram/model-buttons.js +163 -0
- package/dist/telegram/monitor.js +110 -85
- package/dist/telegram/send.js +129 -47
- package/dist/terminal/restore.js +45 -0
- package/dist/test-helpers/state-dir-env.js +16 -0
- package/dist/test-helpers/workspace.js +11 -0
- package/dist/test-utils/channel-plugins.js +82 -0
- package/dist/test-utils/ports.js +73 -0
- package/dist/tts/tts.js +12 -6
- package/dist/tui/tui-session-actions.js +166 -54
- package/dist/utils/fetch-timeout.js +20 -0
- package/dist/utils/normalize-secret-input.js +19 -0
- package/dist/utils/shell-argv.js +61 -0
- package/dist/utils/transcript-tools.js +58 -0
- package/dist/utils.js +55 -14
- package/dist/version.js +42 -5
- package/dist/web/qr-image.js +1 -61
- package/dist/wizard/onboarding.finalize.js +7 -7
- package/dist/wizard/onboarding.js +3 -3
- package/docs/RELEASE_WORKFOTS_COMPARISON.md +3 -3
- package/docs/_config.yml +2 -2
- package/docs/_layouts/default.html +9 -9
- package/docs/concepts/typebox.md +1 -1
- package/docs/docs.json +1 -1
- package/docs/northflank.mdx +7 -7
- package/docs/railway.mdx +3 -3
- package/docs/render.mdx +5 -5
- package/docs/start/lore.md +2 -2
- package/extensions/bluebubbles/index.ts +2 -2
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/bluebubbles/src/accounts.ts +8 -8
- package/extensions/bluebubbles/src/actions.test.ts +22 -22
- package/extensions/bluebubbles/src/actions.ts +5 -5
- package/extensions/bluebubbles/src/attachments.ts +2 -2
- package/extensions/bluebubbles/src/channel.ts +16 -16
- package/extensions/bluebubbles/src/chat.ts +2 -2
- package/extensions/bluebubbles/src/media-send.ts +2 -2
- package/extensions/bluebubbles/src/monitor.test.ts +46 -46
- package/extensions/bluebubbles/src/monitor.ts +5 -5
- package/extensions/bluebubbles/src/onboarding.ts +7 -7
- package/extensions/bluebubbles/src/reactions.ts +2 -2
- package/extensions/bluebubbles/src/send.ts +2 -2
- package/extensions/copilot-proxy/README.md +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/index.ts +2 -2
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/diagnostics-otel/src/service.ts +3 -3
- package/extensions/discord/index.ts +2 -2
- package/extensions/discord/package.json +1 -1
- package/extensions/google-antigravity-auth/README.md +1 -1
- package/extensions/google-antigravity-auth/index.ts +1 -1
- package/extensions/google-antigravity-auth/package.json +1 -1
- package/extensions/google-gemini-cli-auth/README.md +1 -1
- package/extensions/google-gemini-cli-auth/oauth.ts +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/index.ts +3 -3
- package/extensions/googlechat/package.json +1 -1
- package/extensions/googlechat/src/accounts.ts +8 -8
- package/extensions/googlechat/src/actions.ts +6 -6
- package/extensions/googlechat/src/channel.ts +21 -21
- package/extensions/googlechat/src/monitor.ts +8 -8
- package/extensions/googlechat/src/onboarding.ts +10 -10
- package/extensions/imessage/index.ts +2 -2
- package/extensions/imessage/package.json +1 -1
- package/extensions/line/index.ts +2 -2
- package/extensions/line/package.json +1 -1
- package/extensions/line/src/card-command.ts +2 -2
- package/extensions/line/src/channel.logout.test.ts +4 -4
- package/extensions/line/src/channel.sendPayload.test.ts +8 -8
- package/extensions/line/src/channel.ts +3 -3
- package/extensions/llm-task/README.md +3 -3
- package/extensions/llm-task/index.ts +2 -2
- package/extensions/llm-task/package.json +1 -1
- package/extensions/llm-task/src/llm-task-tool.ts +4 -4
- package/extensions/lobster/README.md +6 -6
- package/extensions/lobster/index.ts +2 -2
- package/extensions/lobster/src/lobster-tool.test.ts +4 -4
- package/extensions/lobster/src/lobster-tool.ts +2 -2
- package/extensions/matrix/index.ts +2 -2
- package/extensions/matrix/package.json +1 -1
- package/extensions/matrix/src/matrix/client/config.ts +1 -1
- package/extensions/matrix/src/matrix/monitor/handler.ts +1 -1
- package/extensions/matrix/src/onboarding.ts +1 -1
- package/extensions/mattermost/index.ts +2 -2
- package/extensions/mattermost/package.json +1 -1
- package/extensions/mattermost/src/mattermost/accounts.ts +8 -8
- package/extensions/mattermost/src/mattermost/monitor-helpers.ts +5 -5
- package/extensions/mattermost/src/mattermost/monitor.ts +2 -2
- package/extensions/mattermost/src/onboarding-helpers.ts +3 -3
- package/extensions/mattermost/src/onboarding.ts +2 -2
- package/extensions/memory-core/index.ts +2 -2
- package/extensions/memory-core/package.json +1 -1
- package/extensions/memory-lancedb/index.ts +3 -3
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/msteams/index.ts +2 -2
- package/extensions/msteams/package.json +1 -1
- package/extensions/msteams/src/channel.directory.test.ts +2 -2
- package/extensions/msteams/src/channel.ts +2 -2
- package/extensions/msteams/src/graph-upload.ts +4 -4
- package/extensions/msteams/src/monitor-handler.ts +2 -2
- package/extensions/msteams/src/monitor.ts +2 -2
- package/extensions/msteams/src/onboarding.ts +9 -9
- package/extensions/msteams/src/reply-dispatcher.ts +2 -2
- package/extensions/msteams/src/send-context.ts +2 -2
- package/extensions/msteams/src/send.ts +4 -4
- package/extensions/nextcloud-talk/index.ts +2 -2
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nextcloud-talk/src/channel.ts +7 -7
- package/extensions/nextcloud-talk/src/inbound.ts +7 -7
- package/extensions/nextcloud-talk/src/onboarding.ts +1 -1
- package/extensions/nostr/README.md +2 -2
- package/extensions/nostr/index.ts +5 -5
- package/extensions/nostr/package.json +1 -1
- package/extensions/nostr/src/types.ts +4 -4
- package/extensions/open-prose/index.ts +2 -2
- package/extensions/qwen-portal-auth/README.md +1 -1
- package/extensions/signal/index.ts +2 -2
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/index.ts +2 -2
- package/extensions/slack/package.json +1 -1
- package/extensions/telegram/index.ts +2 -2
- package/extensions/telegram/package.json +1 -1
- package/extensions/telegram/src/channel.ts +2 -2
- package/extensions/tlon/README.md +2 -2
- package/extensions/tlon/index.ts +2 -2
- package/extensions/tlon/package.json +1 -1
- package/extensions/tlon/src/channel.ts +13 -13
- package/extensions/tlon/src/monitor/index.ts +3 -3
- package/extensions/tlon/src/onboarding.ts +3 -3
- package/extensions/tlon/src/types.ts +3 -3
- package/extensions/twitch/README.md +1 -1
- package/extensions/twitch/index.ts +2 -2
- package/extensions/twitch/package.json +1 -1
- package/extensions/twitch/src/config.ts +3 -3
- package/extensions/twitch/src/monitor.ts +3 -3
- package/extensions/twitch/src/onboarding.ts +9 -9
- package/extensions/twitch/src/outbound.test.ts +2 -2
- package/extensions/twitch/src/plugin.test.ts +2 -2
- package/extensions/twitch/src/plugin.ts +8 -8
- package/extensions/twitch/src/send.test.ts +2 -2
- package/extensions/twitch/src/send.ts +4 -4
- package/extensions/twitch/src/token.test.ts +8 -8
- package/extensions/twitch/src/token.ts +3 -3
- package/extensions/twitch/src/twitch-client.ts +3 -3
- package/extensions/twitch/src/types.ts +3 -3
- package/extensions/twitch/src/utils/markdown.ts +1 -1
- package/extensions/voice-call/README.md +3 -3
- package/extensions/voice-call/package.json +1 -1
- package/extensions/voice-call/src/core-bridge.ts +2 -2
- package/extensions/voice-call/src/response-generator.ts +1 -1
- package/extensions/whatsapp/index.ts +2 -2
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zalo/README.md +1 -1
- package/extensions/zalo/index.ts +2 -2
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalo/src/accounts.ts +8 -8
- package/extensions/zalo/src/actions.ts +4 -4
- package/extensions/zalo/src/channel.directory.test.ts +2 -2
- package/extensions/zalo/src/channel.ts +18 -18
- package/extensions/zalo/src/monitor.ts +9 -9
- package/extensions/zalo/src/monitor.webhook.test.ts +2 -2
- package/extensions/zalo/src/onboarding.ts +24 -24
- package/extensions/zalo/src/send.ts +2 -2
- package/extensions/zalouser/README.md +2 -2
- package/extensions/zalouser/index.ts +2 -2
- package/extensions/zalouser/package.json +1 -1
- package/extensions/zalouser/src/accounts.ts +9 -9
- package/extensions/zalouser/src/channel.ts +24 -24
- package/extensions/zalouser/src/monitor.ts +4 -4
- package/extensions/zalouser/src/onboarding.ts +28 -28
- package/package.json +13 -251
- package/skills/nano-banana-pro/scripts/generate_image.py +1 -1
- package/skills/tmux/scripts/find-sessions.sh +1 -1
- package/CHANGELOG.md +0 -102
- package/README-header.png +0 -0
- package/git-hooks/pre-commit +0 -4
- package/scripts/format-staged.js +0 -148
- package/scripts/postinstall.js +0 -300
- package/scripts/setup-git-hooks.js +0 -96
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { resolveSessionTranscriptsDirForAgent } from "../config/sessions/paths.js";
|
|
4
|
+
import { redactSensitiveText } from "../logging/redact.js";
|
|
4
5
|
import { createSubsystemLogger } from "../logging/subsystem.js";
|
|
5
6
|
import { hashText } from "./internal.js";
|
|
6
7
|
const log = createSubsystemLogger("memory");
|
|
@@ -55,7 +56,9 @@ export async function buildSessionEntry(absPath) {
|
|
|
55
56
|
const raw = await fs.readFile(absPath, "utf-8");
|
|
56
57
|
const lines = raw.split("\n");
|
|
57
58
|
const collected = [];
|
|
58
|
-
|
|
59
|
+
const lineMap = [];
|
|
60
|
+
for (let jsonlIdx = 0; jsonlIdx < lines.length; jsonlIdx++) {
|
|
61
|
+
const line = lines[jsonlIdx];
|
|
59
62
|
if (!line.trim())
|
|
60
63
|
continue;
|
|
61
64
|
let record;
|
|
@@ -78,8 +81,10 @@ export async function buildSessionEntry(absPath) {
|
|
|
78
81
|
const text = extractSessionText(message.content);
|
|
79
82
|
if (!text)
|
|
80
83
|
continue;
|
|
84
|
+
const safe = redactSensitiveText(text, { mode: "tools" });
|
|
81
85
|
const label = message.role === "user" ? "User" : "Assistant";
|
|
82
|
-
collected.push(`${label}: ${
|
|
86
|
+
collected.push(`${label}: ${safe}`);
|
|
87
|
+
lineMap.push(jsonlIdx + 1);
|
|
83
88
|
}
|
|
84
89
|
const content = collected.join("\n");
|
|
85
90
|
return {
|
|
@@ -87,8 +92,9 @@ export async function buildSessionEntry(absPath) {
|
|
|
87
92
|
absPath,
|
|
88
93
|
mtimeMs: stat.mtimeMs,
|
|
89
94
|
size: stat.size,
|
|
90
|
-
hash: hashText(content),
|
|
95
|
+
hash: hashText(content + "\n" + lineMap.join(",")),
|
|
91
96
|
content,
|
|
97
|
+
lineMap,
|
|
92
98
|
};
|
|
93
99
|
}
|
|
94
100
|
catch (err) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/node-host/runner.js
CHANGED
|
@@ -13,14 +13,20 @@ import { createBrowserControlContext, startBrowserControlServiceFromConfig, } fr
|
|
|
13
13
|
import { createBrowserRouteDispatcher } from "../browser/routes/dispatcher.js";
|
|
14
14
|
import { detectMime } from "../media/mime.js";
|
|
15
15
|
import { resolveAgentConfig } from "../agents/agent-scope.js";
|
|
16
|
-
import {
|
|
16
|
+
import { ensurePoolbotCliOnPath } from "../infra/path-env.js";
|
|
17
17
|
import { VERSION } from "../version.js";
|
|
18
18
|
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../utils/message-channel.js";
|
|
19
19
|
import { ensureNodeHostConfig, saveNodeHostConfig } from "./config.js";
|
|
20
|
+
import { withTimeout } from "./with-timeout.js";
|
|
20
21
|
import { GatewayClient } from "../gateway/client.js";
|
|
21
22
|
function resolveExecSecurity(value) {
|
|
22
23
|
return value === "deny" || value === "allowlist" || value === "full" ? value : "allowlist";
|
|
23
24
|
}
|
|
25
|
+
function isCmdExeInvocation(argv) {
|
|
26
|
+
const bin = argv[0]?.trim().toLowerCase().replace(/\\/g, "/") ?? "";
|
|
27
|
+
const base = bin.split("/").pop() ?? "";
|
|
28
|
+
return base === "cmd" || base === "cmd.exe";
|
|
29
|
+
}
|
|
24
30
|
function resolveExecAsk(value) {
|
|
25
31
|
return value === "off" || value === "on-miss" || value === "always" ? value : "on-miss";
|
|
26
32
|
}
|
|
@@ -124,26 +130,6 @@ async function ensureBrowserControlService() {
|
|
|
124
130
|
})();
|
|
125
131
|
return browserControlReady;
|
|
126
132
|
}
|
|
127
|
-
async function withTimeout(promise, timeoutMs, label) {
|
|
128
|
-
const resolved = typeof timeoutMs === "number" && Number.isFinite(timeoutMs)
|
|
129
|
-
? Math.max(1, Math.floor(timeoutMs))
|
|
130
|
-
: undefined;
|
|
131
|
-
if (!resolved)
|
|
132
|
-
return await promise;
|
|
133
|
-
let timer;
|
|
134
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
135
|
-
timer = setTimeout(() => {
|
|
136
|
-
reject(new Error(`${label ?? "request"} timed out`));
|
|
137
|
-
}, resolved);
|
|
138
|
-
});
|
|
139
|
-
try {
|
|
140
|
-
return await Promise.race([promise, timeoutPromise]);
|
|
141
|
-
}
|
|
142
|
-
finally {
|
|
143
|
-
if (timer)
|
|
144
|
-
clearTimeout(timer);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
133
|
function isProfileAllowed(params) {
|
|
148
134
|
const { allowProfiles, profile } = params;
|
|
149
135
|
if (!allowProfiles.length)
|
|
@@ -296,7 +282,7 @@ function resolveEnvPath(env) {
|
|
|
296
282
|
return raw.split(path.delimiter).filter(Boolean);
|
|
297
283
|
}
|
|
298
284
|
function ensureNodePathEnv() {
|
|
299
|
-
|
|
285
|
+
ensurePoolbotCliOnPath({ pathEnv: process.env.PATH ?? "" });
|
|
300
286
|
const current = process.env.PATH ?? "";
|
|
301
287
|
if (current.trim())
|
|
302
288
|
return current;
|
|
@@ -422,7 +408,7 @@ export async function runNodeHost(opts) {
|
|
|
422
408
|
},
|
|
423
409
|
});
|
|
424
410
|
const skillBins = new SkillBinsCache(async () => {
|
|
425
|
-
const res =
|
|
411
|
+
const res = await client.request("skills.bins", {});
|
|
426
412
|
const bins = Array.isArray(res?.bins) ? res.bins.map((bin) => String(bin)) : [];
|
|
427
413
|
return bins;
|
|
428
414
|
});
|
|
@@ -562,7 +548,7 @@ async function handleInvoke(frame, client, skillBins) {
|
|
|
562
548
|
query[key] = typeof value === "string" ? value : String(value);
|
|
563
549
|
}
|
|
564
550
|
const dispatcher = createBrowserRouteDispatcher(createBrowserControlContext());
|
|
565
|
-
const response = await withTimeout(dispatcher.dispatch({
|
|
551
|
+
const response = await withTimeout((_signal) => dispatcher.dispatch({
|
|
566
552
|
method: method === "DELETE" ? "DELETE" : method === "POST" ? "POST" : "GET",
|
|
567
553
|
path,
|
|
568
554
|
query,
|
|
@@ -597,7 +583,9 @@ async function handleInvoke(frame, client, skillBins) {
|
|
|
597
583
|
return file;
|
|
598
584
|
}
|
|
599
585
|
catch (err) {
|
|
600
|
-
throw new Error(`browser proxy file read failed for ${p}: ${String(err)}
|
|
586
|
+
throw new Error(`browser proxy file read failed for ${p}: ${String(err)}`, {
|
|
587
|
+
cause: err,
|
|
588
|
+
});
|
|
601
589
|
}
|
|
602
590
|
}));
|
|
603
591
|
if (loaded.length > 0)
|
|
@@ -675,6 +663,7 @@ async function handleInvoke(frame, client, skillBins) {
|
|
|
675
663
|
env,
|
|
676
664
|
skillBins: bins,
|
|
677
665
|
autoAllowSkills,
|
|
666
|
+
platform: process.platform,
|
|
678
667
|
});
|
|
679
668
|
analysisOk = allowlistEval.analysisOk;
|
|
680
669
|
allowlistMatches = allowlistEval.allowlistMatches;
|
|
@@ -698,6 +687,14 @@ async function handleInvoke(frame, client, skillBins) {
|
|
|
698
687
|
security === "allowlist" && analysisOk ? allowlistEval.allowlistSatisfied : false;
|
|
699
688
|
segments = analysis.segments;
|
|
700
689
|
}
|
|
690
|
+
const isWindows = process.platform === "win32";
|
|
691
|
+
const cmdInvocation = rawCommand
|
|
692
|
+
? isCmdExeInvocation(segments[0]?.argv ?? [])
|
|
693
|
+
: isCmdExeInvocation(argv);
|
|
694
|
+
if (security === "allowlist" && isWindows && cmdInvocation) {
|
|
695
|
+
analysisOk = false;
|
|
696
|
+
allowlistSatisfied = false;
|
|
697
|
+
}
|
|
701
698
|
const useMacAppExec = process.platform === "darwin";
|
|
702
699
|
if (useMacAppExec) {
|
|
703
700
|
const approvalDecision = params.approvalDecision === "allow-once" || params.approvalDecision === "allow-always"
|
|
@@ -853,7 +850,20 @@ async function handleInvoke(frame, client, skillBins) {
|
|
|
853
850
|
});
|
|
854
851
|
return;
|
|
855
852
|
}
|
|
856
|
-
|
|
853
|
+
/* On Windows, avoid spawning via cmd.exe when the allowlist already approved
|
|
854
|
+
* a single-segment command — run the parsed argv directly instead. */
|
|
855
|
+
let execArgv = argv;
|
|
856
|
+
if (security === "allowlist" &&
|
|
857
|
+
isWindows &&
|
|
858
|
+
!approvedByAsk &&
|
|
859
|
+
rawCommand &&
|
|
860
|
+
analysisOk &&
|
|
861
|
+
allowlistSatisfied &&
|
|
862
|
+
segments.length === 1 &&
|
|
863
|
+
segments[0]?.argv.length > 0) {
|
|
864
|
+
execArgv = segments[0].argv;
|
|
865
|
+
}
|
|
866
|
+
const result = await runCommand(execArgv, params.cwd?.trim() || undefined, env, params.timeoutMs ?? undefined);
|
|
857
867
|
if (result.truncated) {
|
|
858
868
|
const suffix = "... (truncated)";
|
|
859
869
|
if (result.stderr.trim().length > 0) {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export async function withTimeout(work, timeoutMs, label) {
|
|
2
|
+
const resolved = typeof timeoutMs === "number" && Number.isFinite(timeoutMs)
|
|
3
|
+
? Math.max(1, Math.floor(timeoutMs))
|
|
4
|
+
: undefined;
|
|
5
|
+
if (!resolved) {
|
|
6
|
+
return await work(undefined);
|
|
7
|
+
}
|
|
8
|
+
const abortCtrl = new AbortController();
|
|
9
|
+
const timeoutError = new Error(`${label ?? "request"} timed out`);
|
|
10
|
+
const timer = setTimeout(() => abortCtrl.abort(timeoutError), resolved);
|
|
11
|
+
let abortListener;
|
|
12
|
+
const abortPromise = abortCtrl.signal.aborted
|
|
13
|
+
? Promise.reject(abortCtrl.signal.reason ?? timeoutError)
|
|
14
|
+
: new Promise((_, reject) => {
|
|
15
|
+
abortListener = () => reject(abortCtrl.signal.reason ?? timeoutError);
|
|
16
|
+
abortCtrl.signal.addEventListener("abort", abortListener, { once: true });
|
|
17
|
+
});
|
|
18
|
+
try {
|
|
19
|
+
return await Promise.race([work(abortCtrl.signal), abortPromise]);
|
|
20
|
+
}
|
|
21
|
+
finally {
|
|
22
|
+
clearTimeout(timer);
|
|
23
|
+
if (abortListener) {
|
|
24
|
+
abortCtrl.signal.removeEventListener("abort", abortListener);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
package/dist/plugins/commands.js
CHANGED
|
@@ -172,7 +172,7 @@ function sanitizeArgs(args) {
|
|
|
172
172
|
* specific use case. This function provides basic defense-in-depth sanitization.
|
|
173
173
|
*/
|
|
174
174
|
export async function executePluginCommand(params) {
|
|
175
|
-
const { command, args, senderId, channel, isAuthorizedSender, commandBody, config } = params;
|
|
175
|
+
const { command, args, senderId, channel, isAuthorizedSender, commandBody, config, from, to, accountId, messageThreadId, } = params;
|
|
176
176
|
// Check authorization
|
|
177
177
|
const requireAuth = command.requireAuth !== false; // Default to true
|
|
178
178
|
if (requireAuth && !isAuthorizedSender) {
|
|
@@ -188,6 +188,10 @@ export async function executePluginCommand(params) {
|
|
|
188
188
|
args: sanitizedArgs,
|
|
189
189
|
commandBody,
|
|
190
190
|
config,
|
|
191
|
+
from,
|
|
192
|
+
to,
|
|
193
|
+
accountId,
|
|
194
|
+
messageThreadId,
|
|
191
195
|
};
|
|
192
196
|
// Lock registry during execution to prevent concurrent modifications
|
|
193
197
|
registryLocked = true;
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import { defaultSlotIdForKey } from "./slots.js";
|
|
2
|
-
export const BUNDLED_ENABLED_BY_DEFAULT = new Set(
|
|
2
|
+
export const BUNDLED_ENABLED_BY_DEFAULT = new Set([
|
|
3
|
+
"device-pair",
|
|
4
|
+
"phone-control",
|
|
5
|
+
"talk-voice",
|
|
6
|
+
]);
|
|
3
7
|
const normalizeList = (value) => {
|
|
4
|
-
if (!Array.isArray(value))
|
|
8
|
+
if (!Array.isArray(value)) {
|
|
5
9
|
return [];
|
|
10
|
+
}
|
|
6
11
|
return value.map((entry) => (typeof entry === "string" ? entry.trim() : "")).filter(Boolean);
|
|
7
12
|
};
|
|
8
13
|
const normalizeSlotValue = (value) => {
|
|
9
|
-
if (typeof value !== "string")
|
|
14
|
+
if (typeof value !== "string") {
|
|
10
15
|
return undefined;
|
|
16
|
+
}
|
|
11
17
|
const trimmed = value.trim();
|
|
12
|
-
if (!trimmed)
|
|
18
|
+
if (!trimmed) {
|
|
13
19
|
return undefined;
|
|
14
|
-
|
|
20
|
+
}
|
|
21
|
+
if (trimmed.toLowerCase() === "none") {
|
|
15
22
|
return null;
|
|
23
|
+
}
|
|
16
24
|
return trimmed;
|
|
17
25
|
};
|
|
18
26
|
const normalizePluginEntries = (entries) => {
|
|
@@ -21,8 +29,9 @@ const normalizePluginEntries = (entries) => {
|
|
|
21
29
|
}
|
|
22
30
|
const normalized = {};
|
|
23
31
|
for (const [key, value] of Object.entries(entries)) {
|
|
24
|
-
if (!key.trim())
|
|
32
|
+
if (!key.trim()) {
|
|
25
33
|
continue;
|
|
34
|
+
}
|
|
26
35
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
27
36
|
normalized[key] = {};
|
|
28
37
|
continue;
|
|
@@ -48,6 +57,75 @@ export const normalizePluginsConfig = (config) => {
|
|
|
48
57
|
entries: normalizePluginEntries(config?.entries),
|
|
49
58
|
};
|
|
50
59
|
};
|
|
60
|
+
const hasExplicitMemorySlot = (plugins) => Boolean(plugins?.slots && Object.prototype.hasOwnProperty.call(plugins.slots, "memory"));
|
|
61
|
+
const hasExplicitMemoryEntry = (plugins) => Boolean(plugins?.entries && Object.prototype.hasOwnProperty.call(plugins.entries, "memory-core"));
|
|
62
|
+
const hasExplicitPluginConfig = (plugins) => {
|
|
63
|
+
if (!plugins) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
if (typeof plugins.enabled === "boolean") {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
if (Array.isArray(plugins.allow) && plugins.allow.length > 0) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
if (Array.isArray(plugins.deny) && plugins.deny.length > 0) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
if (plugins.load?.paths && Array.isArray(plugins.load.paths) && plugins.load.paths.length > 0) {
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
if (plugins.slots && Object.keys(plugins.slots).length > 0) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
if (plugins.entries && Object.keys(plugins.entries).length > 0) {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
return false;
|
|
85
|
+
};
|
|
86
|
+
export function applyTestPluginDefaults(cfg, env = process.env) {
|
|
87
|
+
if (!env.VITEST) {
|
|
88
|
+
return cfg;
|
|
89
|
+
}
|
|
90
|
+
const plugins = cfg.plugins;
|
|
91
|
+
const explicitConfig = hasExplicitPluginConfig(plugins);
|
|
92
|
+
if (explicitConfig) {
|
|
93
|
+
if (hasExplicitMemorySlot(plugins) || hasExplicitMemoryEntry(plugins)) {
|
|
94
|
+
return cfg;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
...cfg,
|
|
98
|
+
plugins: {
|
|
99
|
+
...plugins,
|
|
100
|
+
slots: {
|
|
101
|
+
...plugins?.slots,
|
|
102
|
+
memory: "none",
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
...cfg,
|
|
109
|
+
plugins: {
|
|
110
|
+
...plugins,
|
|
111
|
+
enabled: false,
|
|
112
|
+
slots: {
|
|
113
|
+
...plugins?.slots,
|
|
114
|
+
memory: "none",
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export function isTestDefaultMemorySlotDisabled(cfg, env = process.env) {
|
|
120
|
+
if (!env.VITEST) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
const plugins = cfg.plugins;
|
|
124
|
+
if (hasExplicitMemorySlot(plugins) || hasExplicitMemoryEntry(plugins)) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
51
129
|
export function resolveEnableState(id, origin, config) {
|
|
52
130
|
if (!config.enabled) {
|
|
53
131
|
return { enabled: false, reason: "plugins disabled" };
|
|
@@ -77,8 +155,9 @@ export function resolveEnableState(id, origin, config) {
|
|
|
77
155
|
return { enabled: true };
|
|
78
156
|
}
|
|
79
157
|
export function resolveMemorySlotDecision(params) {
|
|
80
|
-
if (params.kind !== "memory")
|
|
158
|
+
if (params.kind !== "memory") {
|
|
81
159
|
return { enabled: true };
|
|
160
|
+
}
|
|
82
161
|
if (params.slot === null) {
|
|
83
162
|
return { enabled: false, reason: "memory slot disabled" };
|
|
84
163
|
}
|
|
@@ -58,7 +58,7 @@ function addCandidate(params) {
|
|
|
58
58
|
packageVersion: manifest?.version?.trim() || undefined,
|
|
59
59
|
packageDescription: manifest?.description?.trim() || undefined,
|
|
60
60
|
packageDir: params.packageDir,
|
|
61
|
-
|
|
61
|
+
packagePoolbot: getPackageManifestMetadata(manifest ?? undefined),
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
function discoverInDirectory(params) {
|
package/dist/plugins/install.js
CHANGED
|
@@ -21,7 +21,7 @@ function safeDirName(input) {
|
|
|
21
21
|
function safeFileName(input) {
|
|
22
22
|
return safeDirName(input);
|
|
23
23
|
}
|
|
24
|
-
async function
|
|
24
|
+
async function ensurePoolbotExtensions(manifest) {
|
|
25
25
|
const extensions = manifest.poolbot?.extensions ?? manifest[LEGACY_MANIFEST_KEY]?.extensions;
|
|
26
26
|
if (!Array.isArray(extensions)) {
|
|
27
27
|
throw new Error("package.json missing poolbot.extensions");
|
|
@@ -56,7 +56,7 @@ async function installPluginFromPackageDir(params) {
|
|
|
56
56
|
}
|
|
57
57
|
let extensions;
|
|
58
58
|
try {
|
|
59
|
-
extensions = await
|
|
59
|
+
extensions = await ensurePoolbotExtensions(manifest);
|
|
60
60
|
}
|
|
61
61
|
catch (err) {
|
|
62
62
|
return { ok: false, error: String(err) };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { resolveConfigDir, shortenHomeInString } from "../utils.js";
|
|
3
|
+
import { resolveBundledPluginsDir } from "./bundled-dir.js";
|
|
4
|
+
function tryRelative(root, filePath) {
|
|
5
|
+
const rel = path.relative(root, filePath);
|
|
6
|
+
if (!rel || rel === ".") {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
if (rel === "..") {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
if (rel.startsWith(`..${path.sep}`) || rel.startsWith("../") || rel.startsWith("..\\")) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
if (path.isAbsolute(rel)) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
// Normalize to forward slashes for display (path.relative uses backslashes on Windows)
|
|
19
|
+
return rel.replaceAll("\\", "/");
|
|
20
|
+
}
|
|
21
|
+
export function resolvePluginSourceRoots(params) {
|
|
22
|
+
const stock = resolveBundledPluginsDir();
|
|
23
|
+
const global = path.join(resolveConfigDir(), "extensions");
|
|
24
|
+
const workspace = params.workspaceDir
|
|
25
|
+
? path.join(params.workspaceDir, ".poolbot", "extensions")
|
|
26
|
+
: undefined;
|
|
27
|
+
return { stock, global, workspace };
|
|
28
|
+
}
|
|
29
|
+
export function formatPluginSourceForTable(plugin, roots) {
|
|
30
|
+
const raw = plugin.source;
|
|
31
|
+
if (plugin.origin === "bundled" && roots.stock) {
|
|
32
|
+
const rel = tryRelative(roots.stock, raw);
|
|
33
|
+
if (rel) {
|
|
34
|
+
return { value: `stock:${rel}`, rootKey: "stock" };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (plugin.origin === "workspace" && roots.workspace) {
|
|
38
|
+
const rel = tryRelative(roots.workspace, raw);
|
|
39
|
+
if (rel) {
|
|
40
|
+
return { value: `workspace:${rel}`, rootKey: "workspace" };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (plugin.origin === "global" && roots.global) {
|
|
44
|
+
const rel = tryRelative(roots.global, raw);
|
|
45
|
+
if (rel) {
|
|
46
|
+
return { value: `global:${rel}`, rootKey: "global" };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// Keep this stable/pasteable; only ~-shorten.
|
|
50
|
+
return { value: shortenHomeInString(raw) };
|
|
51
|
+
}
|
package/dist/plugins/update.js
CHANGED
|
@@ -26,7 +26,7 @@ function resolveBundledPluginSources(params) {
|
|
|
26
26
|
const pluginId = manifest.manifest.id;
|
|
27
27
|
if (bundled.has(pluginId))
|
|
28
28
|
continue;
|
|
29
|
-
const npmSpec = candidate.
|
|
29
|
+
const npmSpec = candidate.packagePoolbot?.install?.npmSpec?.trim() ||
|
|
30
30
|
candidate.packageName?.trim() ||
|
|
31
31
|
undefined;
|
|
32
32
|
bundled.set(pluginId, {
|
package/dist/process/exec.js
CHANGED
|
@@ -5,6 +5,24 @@ import { danger, shouldLogVerbose } from "../globals.js";
|
|
|
5
5
|
import { logDebug, logError } from "../logger.js";
|
|
6
6
|
import { resolveCommandStdio } from "./spawn-utils.js";
|
|
7
7
|
const execFileAsync = promisify(execFile);
|
|
8
|
+
/**
|
|
9
|
+
* Resolves a command for Windows compatibility.
|
|
10
|
+
* On Windows, non-.exe commands (like npm, pnpm) require their .cmd extension.
|
|
11
|
+
*/
|
|
12
|
+
function resolveCommand(command) {
|
|
13
|
+
if (process.platform !== "win32")
|
|
14
|
+
return command;
|
|
15
|
+
const basename = path.basename(command).toLowerCase();
|
|
16
|
+
// Skip if already has an extension (.cmd, .exe, .bat, etc.)
|
|
17
|
+
const ext = path.extname(basename);
|
|
18
|
+
if (ext)
|
|
19
|
+
return command;
|
|
20
|
+
// Common npm-related commands that need .cmd extension on Windows
|
|
21
|
+
const cmdCommands = ["npm", "pnpm", "yarn", "npx"];
|
|
22
|
+
if (cmdCommands.includes(basename))
|
|
23
|
+
return `${command}.cmd`;
|
|
24
|
+
return command;
|
|
25
|
+
}
|
|
8
26
|
// Simple promise-wrapped execFile with optional verbosity logging.
|
|
9
27
|
export async function runExec(command, args, opts = 10_000) {
|
|
10
28
|
const options = typeof opts === "number"
|
|
@@ -15,7 +33,7 @@ export async function runExec(command, args, opts = 10_000) {
|
|
|
15
33
|
encoding: "utf8",
|
|
16
34
|
};
|
|
17
35
|
try {
|
|
18
|
-
const { stdout, stderr } = await execFileAsync(command, args, options);
|
|
36
|
+
const { stdout, stderr } = await execFileAsync(resolveCommand(command), args, options);
|
|
19
37
|
if (shouldLogVerbose()) {
|
|
20
38
|
if (stdout.trim())
|
|
21
39
|
logDebug(stdout.trim());
|
|
@@ -54,7 +72,7 @@ export async function runCommandWithTimeout(argv, optionsOrTimeout) {
|
|
|
54
72
|
resolvedEnv.npm_config_fund = "false";
|
|
55
73
|
}
|
|
56
74
|
const stdio = resolveCommandStdio({ hasInput, preferInherit: true });
|
|
57
|
-
const child = spawn(argv[0], argv.slice(1), {
|
|
75
|
+
const child = spawn(resolveCommand(argv[0]), argv.slice(1), {
|
|
58
76
|
stdio,
|
|
59
77
|
cwd,
|
|
60
78
|
env: resolvedEnv,
|
|
@@ -27,6 +27,7 @@ export function buildAgentSessionKey(params) {
|
|
|
27
27
|
agentId: params.agentId,
|
|
28
28
|
mainKey: DEFAULT_MAIN_KEY,
|
|
29
29
|
channel,
|
|
30
|
+
accountId: params.accountId,
|
|
30
31
|
peerKind: peer?.kind ?? "dm",
|
|
31
32
|
peerId: peer ? normalizeId(peer.id) || "unknown" : null,
|
|
32
33
|
dmScope: params.dmScope,
|
|
@@ -98,6 +99,7 @@ export function resolveAgentRoute(input) {
|
|
|
98
99
|
const sessionKey = buildAgentSessionKey({
|
|
99
100
|
agentId: resolvedAgentId,
|
|
100
101
|
channel,
|
|
102
|
+
accountId,
|
|
101
103
|
peer,
|
|
102
104
|
dmScope,
|
|
103
105
|
identityLinks,
|
|
@@ -120,6 +122,16 @@ export function resolveAgentRoute(input) {
|
|
|
120
122
|
if (peerMatch)
|
|
121
123
|
return choose(peerMatch.agentId, "binding.peer");
|
|
122
124
|
}
|
|
125
|
+
// Thread parent inheritance: if peer (thread) didn't match, check parent peer binding
|
|
126
|
+
const parentPeer = input.parentPeer
|
|
127
|
+
? { kind: input.parentPeer.kind, id: normalizeId(input.parentPeer.id) }
|
|
128
|
+
: null;
|
|
129
|
+
if (parentPeer && parentPeer.id) {
|
|
130
|
+
const parentPeerMatch = bindings.find((b) => matchesPeer(b.match, parentPeer));
|
|
131
|
+
if (parentPeerMatch) {
|
|
132
|
+
return choose(parentPeerMatch.agentId, "binding.peer.parent");
|
|
133
|
+
}
|
|
134
|
+
}
|
|
123
135
|
if (guildId) {
|
|
124
136
|
const guildMatch = bindings.find((b) => matchesGuild(b.match, guildId));
|
|
125
137
|
if (guildMatch)
|
|
@@ -38,6 +38,16 @@ export function resolveAgentIdFromSessionKey(sessionKey) {
|
|
|
38
38
|
const parsed = parseAgentSessionKey(sessionKey);
|
|
39
39
|
return normalizeAgentId(parsed?.agentId ?? DEFAULT_AGENT_ID);
|
|
40
40
|
}
|
|
41
|
+
export function classifySessionKeyShape(sessionKey) {
|
|
42
|
+
const raw = (sessionKey ?? "").trim();
|
|
43
|
+
if (!raw) {
|
|
44
|
+
return "missing";
|
|
45
|
+
}
|
|
46
|
+
if (parseAgentSessionKey(raw)) {
|
|
47
|
+
return "agent";
|
|
48
|
+
}
|
|
49
|
+
return raw.toLowerCase().startsWith("agent:") ? "malformed_agent" : "legacy_or_alias";
|
|
50
|
+
}
|
|
41
51
|
export function normalizeAgentId(value) {
|
|
42
52
|
const trimmed = (value ?? "").trim();
|
|
43
53
|
if (!trimmed)
|
|
@@ -99,6 +109,11 @@ export function buildAgentPeerSessionKey(params) {
|
|
|
99
109
|
if (linkedPeerId)
|
|
100
110
|
peerId = linkedPeerId;
|
|
101
111
|
peerId = peerId.toLowerCase();
|
|
112
|
+
if (dmScope === "per-account-channel-peer" && peerId) {
|
|
113
|
+
const channel = (params.channel ?? "").trim().toLowerCase() || "unknown";
|
|
114
|
+
const accountId = normalizeAccountId(params.accountId);
|
|
115
|
+
return `agent:${normalizeAgentId(params.agentId)}:${channel}:${accountId}:dm:${peerId}`;
|
|
116
|
+
}
|
|
102
117
|
if (dmScope === "per-channel-peer" && peerId) {
|
|
103
118
|
const channel = (params.channel ?? "").trim().toLowerCase() || "unknown";
|
|
104
119
|
return `agent:${normalizeAgentId(params.agentId)}:${channel}:dm:${peerId}`;
|
package/dist/runtime.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { clearActiveProgressLine } from "./terminal/progress-line.js";
|
|
2
|
+
import { restoreTerminalState } from "./terminal/restore.js";
|
|
2
3
|
export const defaultRuntime = {
|
|
3
4
|
log: (...args) => {
|
|
4
5
|
clearActiveProgressLine();
|
|
@@ -9,6 +10,7 @@ export const defaultRuntime = {
|
|
|
9
10
|
console.error(...args);
|
|
10
11
|
},
|
|
11
12
|
exit: (code) => {
|
|
13
|
+
restoreTerminalState("runtime exit");
|
|
12
14
|
process.exit(code);
|
|
13
15
|
throw new Error("unreachable"); // satisfies tests when mocked
|
|
14
16
|
},
|