@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,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PoolbotPluginApi } from "poolbot/plugin-sdk";
|
|
2
2
|
import { emptyPluginConfigSchema } from "poolbot/plugin-sdk";
|
|
3
3
|
|
|
4
4
|
import { googlechatDock, googlechatPlugin } from "./src/channel.js";
|
|
@@ -8,9 +8,9 @@ import { setGoogleChatRuntime } from "./src/runtime.js";
|
|
|
8
8
|
const plugin = {
|
|
9
9
|
id: "googlechat",
|
|
10
10
|
name: "Google Chat",
|
|
11
|
-
description: "
|
|
11
|
+
description: "Poolbot Google Chat channel plugin",
|
|
12
12
|
configSchema: emptyPluginConfigSchema(),
|
|
13
|
-
register(api:
|
|
13
|
+
register(api: PoolbotPluginApi) {
|
|
14
14
|
setGoogleChatRuntime(api.runtime);
|
|
15
15
|
api.registerChannel({ plugin: googlechatPlugin, dock: googlechatDock });
|
|
16
16
|
api.registerHttpHandler(handleGoogleChatWebhookRequest);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PoolbotConfig } from "poolbot/plugin-sdk";
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "poolbot/plugin-sdk";
|
|
3
3
|
|
|
4
4
|
import type { GoogleChatAccountConfig, GoogleChatConfig } from "./types.config.js";
|
|
@@ -18,19 +18,19 @@ export type ResolvedGoogleChatAccount = {
|
|
|
18
18
|
const ENV_SERVICE_ACCOUNT = "GOOGLE_CHAT_SERVICE_ACCOUNT";
|
|
19
19
|
const ENV_SERVICE_ACCOUNT_FILE = "GOOGLE_CHAT_SERVICE_ACCOUNT_FILE";
|
|
20
20
|
|
|
21
|
-
function listConfiguredAccountIds(cfg:
|
|
21
|
+
function listConfiguredAccountIds(cfg: PoolbotConfig): string[] {
|
|
22
22
|
const accounts = (cfg.channels?.["googlechat"] as GoogleChatConfig | undefined)?.accounts;
|
|
23
23
|
if (!accounts || typeof accounts !== "object") return [];
|
|
24
24
|
return Object.keys(accounts).filter(Boolean);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export function listGoogleChatAccountIds(cfg:
|
|
27
|
+
export function listGoogleChatAccountIds(cfg: PoolbotConfig): string[] {
|
|
28
28
|
const ids = listConfiguredAccountIds(cfg);
|
|
29
29
|
if (ids.length === 0) return [DEFAULT_ACCOUNT_ID];
|
|
30
30
|
return ids.sort((a, b) => a.localeCompare(b));
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export function resolveDefaultGoogleChatAccountId(cfg:
|
|
33
|
+
export function resolveDefaultGoogleChatAccountId(cfg: PoolbotConfig): string {
|
|
34
34
|
const channel = cfg.channels?.["googlechat"] as GoogleChatConfig | undefined;
|
|
35
35
|
if (channel?.defaultAccount?.trim()) return channel.defaultAccount.trim();
|
|
36
36
|
const ids = listGoogleChatAccountIds(cfg);
|
|
@@ -39,7 +39,7 @@ export function resolveDefaultGoogleChatAccountId(cfg: MoltbotConfig): string {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
function resolveAccountConfig(
|
|
42
|
-
cfg:
|
|
42
|
+
cfg: PoolbotConfig,
|
|
43
43
|
accountId: string,
|
|
44
44
|
): GoogleChatAccountConfig | undefined {
|
|
45
45
|
const accounts = (cfg.channels?.["googlechat"] as GoogleChatConfig | undefined)?.accounts;
|
|
@@ -48,7 +48,7 @@ function resolveAccountConfig(
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
function mergeGoogleChatAccountConfig(
|
|
51
|
-
cfg:
|
|
51
|
+
cfg: PoolbotConfig,
|
|
52
52
|
accountId: string,
|
|
53
53
|
): GoogleChatAccountConfig {
|
|
54
54
|
const raw = (cfg.channels?.["googlechat"] ?? {}) as GoogleChatConfig;
|
|
@@ -104,7 +104,7 @@ function resolveCredentialsFromConfig(params: {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
export function resolveGoogleChatAccount(params: {
|
|
107
|
-
cfg:
|
|
107
|
+
cfg: PoolbotConfig;
|
|
108
108
|
accountId?: string | null;
|
|
109
109
|
}): ResolvedGoogleChatAccount {
|
|
110
110
|
const accountId = normalizeAccountId(params.accountId);
|
|
@@ -126,7 +126,7 @@ export function resolveGoogleChatAccount(params: {
|
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
export function listEnabledGoogleChatAccounts(cfg:
|
|
129
|
+
export function listEnabledGoogleChatAccounts(cfg: PoolbotConfig): ResolvedGoogleChatAccount[] {
|
|
130
130
|
return listGoogleChatAccountIds(cfg)
|
|
131
131
|
.map((accountId) => resolveGoogleChatAccount({ cfg, accountId }))
|
|
132
132
|
.filter((account) => account.enabled);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ChannelMessageActionAdapter,
|
|
3
3
|
ChannelMessageActionName,
|
|
4
|
-
|
|
4
|
+
PoolbotConfig,
|
|
5
5
|
} from "poolbot/plugin-sdk";
|
|
6
6
|
import {
|
|
7
7
|
createActionGate,
|
|
@@ -24,13 +24,13 @@ import { resolveGoogleChatOutboundSpace } from "./targets.js";
|
|
|
24
24
|
|
|
25
25
|
const providerId = "googlechat";
|
|
26
26
|
|
|
27
|
-
function listEnabledAccounts(cfg:
|
|
27
|
+
function listEnabledAccounts(cfg: PoolbotConfig) {
|
|
28
28
|
return listEnabledGoogleChatAccounts(cfg).filter(
|
|
29
29
|
(account) => account.enabled && account.credentialSource !== "none",
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
function isReactionsEnabled(accounts: ReturnType<typeof listEnabledAccounts>, cfg:
|
|
33
|
+
function isReactionsEnabled(accounts: ReturnType<typeof listEnabledAccounts>, cfg: PoolbotConfig) {
|
|
34
34
|
for (const account of accounts) {
|
|
35
35
|
const gate = createActionGate(
|
|
36
36
|
(account.config.actions ?? (cfg.channels?.["googlechat"] as { actions?: unknown })?.actions) as Record<
|
|
@@ -49,11 +49,11 @@ function resolveAppUserNames(account: { config: { botUser?: string | null } }) {
|
|
|
49
49
|
|
|
50
50
|
export const googlechatMessageActions: ChannelMessageActionAdapter = {
|
|
51
51
|
listActions: ({ cfg }) => {
|
|
52
|
-
const accounts = listEnabledAccounts(cfg as
|
|
52
|
+
const accounts = listEnabledAccounts(cfg as PoolbotConfig);
|
|
53
53
|
if (accounts.length === 0) return [];
|
|
54
54
|
const actions = new Set<ChannelMessageActionName>([]);
|
|
55
55
|
actions.add("send");
|
|
56
|
-
if (isReactionsEnabled(accounts, cfg as
|
|
56
|
+
if (isReactionsEnabled(accounts, cfg as PoolbotConfig)) {
|
|
57
57
|
actions.add("react");
|
|
58
58
|
actions.add("reactions");
|
|
59
59
|
}
|
|
@@ -69,7 +69,7 @@ export const googlechatMessageActions: ChannelMessageActionAdapter = {
|
|
|
69
69
|
},
|
|
70
70
|
handleAction: async ({ action, params, cfg, accountId }) => {
|
|
71
71
|
const account = resolveGoogleChatAccount({
|
|
72
|
-
cfg: cfg as
|
|
72
|
+
cfg: cfg as PoolbotConfig,
|
|
73
73
|
accountId,
|
|
74
74
|
});
|
|
75
75
|
if (account.credentialSource === "none") {
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
type ChannelDock,
|
|
16
16
|
type ChannelMessageActionAdapter,
|
|
17
17
|
type ChannelPlugin,
|
|
18
|
-
type
|
|
18
|
+
type PoolbotConfig,
|
|
19
19
|
} from "poolbot/plugin-sdk";
|
|
20
20
|
import { GoogleChatConfigSchema } from "poolbot/plugin-sdk";
|
|
21
21
|
|
|
@@ -59,7 +59,7 @@ export const googlechatDock: ChannelDock = {
|
|
|
59
59
|
outbound: { textChunkLimit: 4000 },
|
|
60
60
|
config: {
|
|
61
61
|
resolveAllowFrom: ({ cfg, accountId }) =>
|
|
62
|
-
(resolveGoogleChatAccount({ cfg: cfg as
|
|
62
|
+
(resolveGoogleChatAccount({ cfg: cfg as PoolbotConfig, accountId }).config.dm?.allowFrom ??
|
|
63
63
|
[]
|
|
64
64
|
).map((entry) => String(entry)),
|
|
65
65
|
formatAllowFrom: ({ allowFrom }) =>
|
|
@@ -103,7 +103,7 @@ export const googlechatPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
|
|
|
103
103
|
idLabel: "googlechatUserId",
|
|
104
104
|
normalizeAllowEntry: (entry) => formatAllowFromEntry(entry),
|
|
105
105
|
notifyApproval: async ({ cfg, id }) => {
|
|
106
|
-
const account = resolveGoogleChatAccount({ cfg: cfg as
|
|
106
|
+
const account = resolveGoogleChatAccount({ cfg: cfg as PoolbotConfig });
|
|
107
107
|
if (account.credentialSource === "none") return;
|
|
108
108
|
const user = normalizeGoogleChatTarget(id) ?? id;
|
|
109
109
|
const target = isGoogleChatUserTarget(user) ? user : `users/${user}`;
|
|
@@ -129,13 +129,13 @@ export const googlechatPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
|
|
|
129
129
|
reload: { configPrefixes: ["channels.googlechat"] },
|
|
130
130
|
configSchema: buildChannelConfigSchema(GoogleChatConfigSchema),
|
|
131
131
|
config: {
|
|
132
|
-
listAccountIds: (cfg) => listGoogleChatAccountIds(cfg as
|
|
132
|
+
listAccountIds: (cfg) => listGoogleChatAccountIds(cfg as PoolbotConfig),
|
|
133
133
|
resolveAccount: (cfg, accountId) =>
|
|
134
|
-
resolveGoogleChatAccount({ cfg: cfg as
|
|
135
|
-
defaultAccountId: (cfg) => resolveDefaultGoogleChatAccountId(cfg as
|
|
134
|
+
resolveGoogleChatAccount({ cfg: cfg as PoolbotConfig, accountId }),
|
|
135
|
+
defaultAccountId: (cfg) => resolveDefaultGoogleChatAccountId(cfg as PoolbotConfig),
|
|
136
136
|
setAccountEnabled: ({ cfg, accountId, enabled }) =>
|
|
137
137
|
setAccountEnabledInConfigSection({
|
|
138
|
-
cfg: cfg as
|
|
138
|
+
cfg: cfg as PoolbotConfig,
|
|
139
139
|
sectionKey: "googlechat",
|
|
140
140
|
accountId,
|
|
141
141
|
enabled,
|
|
@@ -143,7 +143,7 @@ export const googlechatPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
|
|
|
143
143
|
}),
|
|
144
144
|
deleteAccount: ({ cfg, accountId }) =>
|
|
145
145
|
deleteAccountFromConfigSection({
|
|
146
|
-
cfg: cfg as
|
|
146
|
+
cfg: cfg as PoolbotConfig,
|
|
147
147
|
sectionKey: "googlechat",
|
|
148
148
|
accountId,
|
|
149
149
|
clearBaseFields: [
|
|
@@ -167,7 +167,7 @@ export const googlechatPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
|
|
|
167
167
|
}),
|
|
168
168
|
resolveAllowFrom: ({ cfg, accountId }) =>
|
|
169
169
|
(resolveGoogleChatAccount({
|
|
170
|
-
cfg: cfg as
|
|
170
|
+
cfg: cfg as PoolbotConfig,
|
|
171
171
|
accountId,
|
|
172
172
|
}).config.dm?.allowFrom ?? []
|
|
173
173
|
).map((entry) => String(entry)),
|
|
@@ -181,7 +181,7 @@ export const googlechatPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
|
|
|
181
181
|
resolveDmPolicy: ({ cfg, accountId, account }) => {
|
|
182
182
|
const resolvedAccountId = accountId ?? account.accountId ?? DEFAULT_ACCOUNT_ID;
|
|
183
183
|
const useAccountPath = Boolean(
|
|
184
|
-
(cfg as
|
|
184
|
+
(cfg as PoolbotConfig).channels?.["googlechat"]?.accounts?.[resolvedAccountId],
|
|
185
185
|
);
|
|
186
186
|
const allowFromPath = useAccountPath
|
|
187
187
|
? `channels.googlechat.accounts.${resolvedAccountId}.dm.`
|
|
@@ -231,7 +231,7 @@ export const googlechatPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
|
|
|
231
231
|
self: async () => null,
|
|
232
232
|
listPeers: async ({ cfg, accountId, query, limit }) => {
|
|
233
233
|
const account = resolveGoogleChatAccount({
|
|
234
|
-
cfg: cfg as
|
|
234
|
+
cfg: cfg as PoolbotConfig,
|
|
235
235
|
accountId,
|
|
236
236
|
});
|
|
237
237
|
const q = query?.trim().toLowerCase() || "";
|
|
@@ -251,7 +251,7 @@ export const googlechatPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
|
|
|
251
251
|
},
|
|
252
252
|
listGroups: async ({ cfg, accountId, query, limit }) => {
|
|
253
253
|
const account = resolveGoogleChatAccount({
|
|
254
|
-
cfg: cfg as
|
|
254
|
+
cfg: cfg as PoolbotConfig,
|
|
255
255
|
accountId,
|
|
256
256
|
});
|
|
257
257
|
const groups = account.config.groups ?? {};
|
|
@@ -291,7 +291,7 @@ export const googlechatPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
|
|
|
291
291
|
resolveAccountId: ({ accountId }) => normalizeAccountId(accountId),
|
|
292
292
|
applyAccountName: ({ cfg, accountId, name }) =>
|
|
293
293
|
applyAccountNameToChannelSection({
|
|
294
|
-
cfg: cfg as
|
|
294
|
+
cfg: cfg as PoolbotConfig,
|
|
295
295
|
channelKey: "googlechat",
|
|
296
296
|
accountId,
|
|
297
297
|
name,
|
|
@@ -307,7 +307,7 @@ export const googlechatPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
|
|
|
307
307
|
},
|
|
308
308
|
applyAccountConfig: ({ cfg, accountId, input }) => {
|
|
309
309
|
const namedConfig = applyAccountNameToChannelSection({
|
|
310
|
-
cfg: cfg as
|
|
310
|
+
cfg: cfg as PoolbotConfig,
|
|
311
311
|
channelKey: "googlechat",
|
|
312
312
|
accountId,
|
|
313
313
|
name: input.name,
|
|
@@ -315,7 +315,7 @@ export const googlechatPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
|
|
|
315
315
|
const next =
|
|
316
316
|
accountId !== DEFAULT_ACCOUNT_ID
|
|
317
317
|
? migrateBaseNameToDefaultAccount({
|
|
318
|
-
cfg: namedConfig as
|
|
318
|
+
cfg: namedConfig as PoolbotConfig,
|
|
319
319
|
channelKey: "googlechat",
|
|
320
320
|
})
|
|
321
321
|
: namedConfig;
|
|
@@ -348,7 +348,7 @@ export const googlechatPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
|
|
|
348
348
|
...configPatch,
|
|
349
349
|
},
|
|
350
350
|
},
|
|
351
|
-
} as
|
|
351
|
+
} as PoolbotConfig;
|
|
352
352
|
}
|
|
353
353
|
return {
|
|
354
354
|
...next,
|
|
@@ -367,7 +367,7 @@ export const googlechatPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
|
|
|
367
367
|
},
|
|
368
368
|
},
|
|
369
369
|
},
|
|
370
|
-
} as
|
|
370
|
+
} as PoolbotConfig;
|
|
371
371
|
},
|
|
372
372
|
},
|
|
373
373
|
outbound: {
|
|
@@ -414,7 +414,7 @@ export const googlechatPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
|
|
|
414
414
|
},
|
|
415
415
|
sendText: async ({ cfg, to, text, accountId, replyToId, threadId }) => {
|
|
416
416
|
const account = resolveGoogleChatAccount({
|
|
417
|
-
cfg: cfg as
|
|
417
|
+
cfg: cfg as PoolbotConfig,
|
|
418
418
|
accountId,
|
|
419
419
|
});
|
|
420
420
|
const space = await resolveGoogleChatOutboundSpace({ account, target: to });
|
|
@@ -436,14 +436,14 @@ export const googlechatPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
|
|
|
436
436
|
throw new Error("Google Chat mediaUrl is required.");
|
|
437
437
|
}
|
|
438
438
|
const account = resolveGoogleChatAccount({
|
|
439
|
-
cfg: cfg as
|
|
439
|
+
cfg: cfg as PoolbotConfig,
|
|
440
440
|
accountId,
|
|
441
441
|
});
|
|
442
442
|
const space = await resolveGoogleChatOutboundSpace({ account, target: to });
|
|
443
443
|
const thread = (threadId ?? replyToId ?? undefined) as string | undefined;
|
|
444
444
|
const runtime = getGoogleChatRuntime();
|
|
445
445
|
const maxBytes = resolveChannelMediaMaxBytes({
|
|
446
|
-
cfg: cfg as
|
|
446
|
+
cfg: cfg as PoolbotConfig,
|
|
447
447
|
resolveChannelLimitMb: ({ cfg, accountId }) =>
|
|
448
448
|
(cfg.channels?.["googlechat"] as { accounts?: Record<string, { mediaMaxMb?: number }>; mediaMaxMb?: number } | undefined)
|
|
449
449
|
?.accounts?.[accountId]?.mediaMaxMb ??
|
|
@@ -560,7 +560,7 @@ export const googlechatPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
|
|
|
560
560
|
});
|
|
561
561
|
const unregister = await startGoogleChatMonitor({
|
|
562
562
|
account,
|
|
563
|
-
config: ctx.cfg as
|
|
563
|
+
config: ctx.cfg as PoolbotConfig,
|
|
564
564
|
runtime: ctx.runtime,
|
|
565
565
|
abortSignal: ctx.abortSignal,
|
|
566
566
|
webhookPath: account.config.webhookPath,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { PoolbotConfig } from "poolbot/plugin-sdk";
|
|
4
4
|
import { resolveMentionGatingWithBypass } from "poolbot/plugin-sdk";
|
|
5
5
|
|
|
6
6
|
import {
|
|
@@ -30,7 +30,7 @@ export type GoogleChatRuntimeEnv = {
|
|
|
30
30
|
|
|
31
31
|
export type GoogleChatMonitorOptions = {
|
|
32
32
|
account: ResolvedGoogleChatAccount;
|
|
33
|
-
config:
|
|
33
|
+
config: PoolbotConfig;
|
|
34
34
|
runtime: GoogleChatRuntimeEnv;
|
|
35
35
|
abortSignal: AbortSignal;
|
|
36
36
|
webhookPath?: string;
|
|
@@ -42,7 +42,7 @@ type GoogleChatCoreRuntime = ReturnType<typeof getGoogleChatRuntime>;
|
|
|
42
42
|
|
|
43
43
|
type WebhookTarget = {
|
|
44
44
|
account: ResolvedGoogleChatAccount;
|
|
45
|
-
config:
|
|
45
|
+
config: PoolbotConfig;
|
|
46
46
|
runtime: GoogleChatRuntimeEnv;
|
|
47
47
|
core: GoogleChatCoreRuntime;
|
|
48
48
|
path: string;
|
|
@@ -357,24 +357,24 @@ function extractMentionInfo(annotations: GoogleChatAnnotation[], botUser?: strin
|
|
|
357
357
|
* Resolve bot display name with fallback chain:
|
|
358
358
|
* 1. Account config name
|
|
359
359
|
* 2. Agent name from config
|
|
360
|
-
* 3. "
|
|
360
|
+
* 3. "Poolbot" as generic fallback
|
|
361
361
|
*/
|
|
362
362
|
function resolveBotDisplayName(params: {
|
|
363
363
|
accountName?: string;
|
|
364
364
|
agentId: string;
|
|
365
|
-
config:
|
|
365
|
+
config: PoolbotConfig;
|
|
366
366
|
}): string {
|
|
367
367
|
const { accountName, agentId, config } = params;
|
|
368
368
|
if (accountName?.trim()) return accountName.trim();
|
|
369
369
|
const agent = config.agents?.list?.find((a) => a.id === agentId);
|
|
370
370
|
if (agent?.name?.trim()) return agent.name.trim();
|
|
371
|
-
return "
|
|
371
|
+
return "Poolbot";
|
|
372
372
|
}
|
|
373
373
|
|
|
374
374
|
async function processMessageWithPipeline(params: {
|
|
375
375
|
event: GoogleChatEvent;
|
|
376
376
|
account: ResolvedGoogleChatAccount;
|
|
377
|
-
config:
|
|
377
|
+
config: PoolbotConfig;
|
|
378
378
|
runtime: GoogleChatRuntimeEnv;
|
|
379
379
|
core: GoogleChatCoreRuntime;
|
|
380
380
|
statusSink?: (patch: { lastInboundAt?: number; lastOutboundAt?: number }) => void;
|
|
@@ -726,7 +726,7 @@ async function deliverGoogleChatReply(params: {
|
|
|
726
726
|
spaceId: string;
|
|
727
727
|
runtime: GoogleChatRuntimeEnv;
|
|
728
728
|
core: GoogleChatCoreRuntime;
|
|
729
|
-
config:
|
|
729
|
+
config: PoolbotConfig;
|
|
730
730
|
statusSink?: (patch: { lastInboundAt?: number; lastOutboundAt?: number }) => void;
|
|
731
731
|
typingMessageName?: string;
|
|
732
732
|
}): Promise<void> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PoolbotConfig, DmPolicy } from "poolbot/plugin-sdk";
|
|
2
2
|
import {
|
|
3
3
|
addWildcardAllowFrom,
|
|
4
4
|
formatDocsLink,
|
|
@@ -22,7 +22,7 @@ const channel = "googlechat" as const;
|
|
|
22
22
|
const ENV_SERVICE_ACCOUNT = "GOOGLE_CHAT_SERVICE_ACCOUNT";
|
|
23
23
|
const ENV_SERVICE_ACCOUNT_FILE = "GOOGLE_CHAT_SERVICE_ACCOUNT_FILE";
|
|
24
24
|
|
|
25
|
-
function setGoogleChatDmPolicy(cfg:
|
|
25
|
+
function setGoogleChatDmPolicy(cfg: PoolbotConfig, policy: DmPolicy) {
|
|
26
26
|
const allowFrom =
|
|
27
27
|
policy === "open"
|
|
28
28
|
? addWildcardAllowFrom(cfg.channels?.["googlechat"]?.dm?.allowFrom)
|
|
@@ -51,9 +51,9 @@ function parseAllowFromInput(raw: string): string[] {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
async function promptAllowFrom(params: {
|
|
54
|
-
cfg:
|
|
54
|
+
cfg: PoolbotConfig;
|
|
55
55
|
prompter: WizardPrompter;
|
|
56
|
-
}): Promise<
|
|
56
|
+
}): Promise<PoolbotConfig> {
|
|
57
57
|
const current = params.cfg.channels?.["googlechat"]?.dm?.allowFrom ?? [];
|
|
58
58
|
const entry = await params.prompter.text({
|
|
59
59
|
message: "Google Chat allowFrom (user id or email)",
|
|
@@ -91,10 +91,10 @@ const dmPolicy: ChannelOnboardingDmPolicy = {
|
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
function applyAccountConfig(params: {
|
|
94
|
-
cfg:
|
|
94
|
+
cfg: PoolbotConfig;
|
|
95
95
|
accountId: string;
|
|
96
96
|
patch: Record<string, unknown>;
|
|
97
|
-
}):
|
|
97
|
+
}): PoolbotConfig {
|
|
98
98
|
const { cfg, accountId, patch } = params;
|
|
99
99
|
if (accountId === DEFAULT_ACCOUNT_ID) {
|
|
100
100
|
return {
|
|
@@ -130,10 +130,10 @@ function applyAccountConfig(params: {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
async function promptCredentials(params: {
|
|
133
|
-
cfg:
|
|
133
|
+
cfg: PoolbotConfig;
|
|
134
134
|
prompter: WizardPrompter;
|
|
135
135
|
accountId: string;
|
|
136
|
-
}): Promise<
|
|
136
|
+
}): Promise<PoolbotConfig> {
|
|
137
137
|
const { cfg, prompter, accountId } = params;
|
|
138
138
|
const envReady =
|
|
139
139
|
accountId === DEFAULT_ACCOUNT_ID &&
|
|
@@ -184,10 +184,10 @@ async function promptCredentials(params: {
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
async function promptAudience(params: {
|
|
187
|
-
cfg:
|
|
187
|
+
cfg: PoolbotConfig;
|
|
188
188
|
prompter: WizardPrompter;
|
|
189
189
|
accountId: string;
|
|
190
|
-
}): Promise<
|
|
190
|
+
}): Promise<PoolbotConfig> {
|
|
191
191
|
const account = resolveGoogleChatAccount({
|
|
192
192
|
cfg: params.cfg,
|
|
193
193
|
accountId: params.accountId,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PoolbotPluginApi } from "poolbot/plugin-sdk";
|
|
2
2
|
import { emptyPluginConfigSchema } from "poolbot/plugin-sdk";
|
|
3
3
|
|
|
4
4
|
import { imessagePlugin } from "./src/channel.js";
|
|
@@ -9,7 +9,7 @@ const plugin = {
|
|
|
9
9
|
name: "iMessage",
|
|
10
10
|
description: "iMessage channel plugin",
|
|
11
11
|
configSchema: emptyPluginConfigSchema(),
|
|
12
|
-
register(api:
|
|
12
|
+
register(api: PoolbotPluginApi) {
|
|
13
13
|
setIMessageRuntime(api.runtime);
|
|
14
14
|
api.registerChannel({ plugin: imessagePlugin });
|
|
15
15
|
},
|
package/extensions/line/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PoolbotPluginApi } from "poolbot/plugin-sdk";
|
|
2
2
|
import { emptyPluginConfigSchema } from "poolbot/plugin-sdk";
|
|
3
3
|
|
|
4
4
|
import { linePlugin } from "./src/channel.js";
|
|
@@ -10,7 +10,7 @@ const plugin = {
|
|
|
10
10
|
name: "LINE",
|
|
11
11
|
description: "LINE Messaging API channel plugin",
|
|
12
12
|
configSchema: emptyPluginConfigSchema(),
|
|
13
|
-
register(api:
|
|
13
|
+
register(api: PoolbotPluginApi) {
|
|
14
14
|
setLineRuntime(api.runtime);
|
|
15
15
|
api.registerChannel({ plugin: linePlugin });
|
|
16
16
|
registerLineCardCommand(api);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PoolbotPluginApi, LineChannelData, ReplyPayload } from "poolbot/plugin-sdk";
|
|
2
2
|
import {
|
|
3
3
|
createActionCard,
|
|
4
4
|
createImageCard,
|
|
@@ -150,7 +150,7 @@ function parseCardArgs(argsStr: string): {
|
|
|
150
150
|
return result;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
export function registerLineCardCommand(api:
|
|
153
|
+
export function registerLineCardCommand(api: PoolbotPluginApi): void {
|
|
154
154
|
api.registerCommand({
|
|
155
155
|
name: "card",
|
|
156
156
|
description: "Send a rich card message (LINE).",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
-
import type {
|
|
2
|
+
import type { PoolbotConfig, PluginRuntime } from "poolbot/plugin-sdk";
|
|
3
3
|
import { linePlugin } from "./channel.js";
|
|
4
4
|
import { setLineRuntime } from "./runtime.js";
|
|
5
5
|
|
|
@@ -12,7 +12,7 @@ type LineRuntimeMocks = {
|
|
|
12
12
|
|
|
13
13
|
function createRuntime(): { runtime: PluginRuntime; mocks: LineRuntimeMocks } {
|
|
14
14
|
const writeConfigFile = vi.fn(async () => {});
|
|
15
|
-
const resolveLineAccount = vi.fn(({ cfg, accountId }: { cfg:
|
|
15
|
+
const resolveLineAccount = vi.fn(({ cfg, accountId }: { cfg: PoolbotConfig; accountId?: string }) => {
|
|
16
16
|
const lineConfig = (cfg.channels?.line ?? {}) as {
|
|
17
17
|
tokenFile?: string;
|
|
18
18
|
secretFile?: string;
|
|
@@ -48,7 +48,7 @@ describe("linePlugin gateway.logoutAccount", () => {
|
|
|
48
48
|
const { runtime, mocks } = createRuntime();
|
|
49
49
|
setLineRuntime(runtime);
|
|
50
50
|
|
|
51
|
-
const cfg:
|
|
51
|
+
const cfg: PoolbotConfig = {
|
|
52
52
|
channels: {
|
|
53
53
|
line: {
|
|
54
54
|
tokenFile: "/tmp/token",
|
|
@@ -71,7 +71,7 @@ describe("linePlugin gateway.logoutAccount", () => {
|
|
|
71
71
|
const { runtime, mocks } = createRuntime();
|
|
72
72
|
setLineRuntime(runtime);
|
|
73
73
|
|
|
74
|
-
const cfg:
|
|
74
|
+
const cfg: PoolbotConfig = {
|
|
75
75
|
channels: {
|
|
76
76
|
line: {
|
|
77
77
|
accounts: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it, vi } from "vitest";
|
|
2
|
-
import type {
|
|
2
|
+
import type { PoolbotConfig, PluginRuntime } from "poolbot/plugin-sdk";
|
|
3
3
|
import { linePlugin } from "./channel.js";
|
|
4
4
|
import { setLineRuntime } from "./runtime.js";
|
|
5
5
|
|
|
@@ -33,7 +33,7 @@ function createRuntime(): { runtime: PluginRuntime; mocks: LineRuntimeMocks } {
|
|
|
33
33
|
const sendMessageLine = vi.fn(async () => ({ messageId: "m-media", chatId: "c1" }));
|
|
34
34
|
const chunkMarkdownText = vi.fn((text: string) => [text]);
|
|
35
35
|
const resolveTextChunkLimit = vi.fn(() => 123);
|
|
36
|
-
const resolveLineAccount = vi.fn(({ cfg, accountId }: { cfg:
|
|
36
|
+
const resolveLineAccount = vi.fn(({ cfg, accountId }: { cfg: PoolbotConfig; accountId?: string }) => {
|
|
37
37
|
const resolved = accountId ?? "default";
|
|
38
38
|
const lineConfig = (cfg.channels?.line ?? {}) as {
|
|
39
39
|
accounts?: Record<string, Record<string, unknown>>;
|
|
@@ -90,7 +90,7 @@ describe("linePlugin outbound.sendPayload", () => {
|
|
|
90
90
|
it("sends flex message without dropping text", async () => {
|
|
91
91
|
const { runtime, mocks } = createRuntime();
|
|
92
92
|
setLineRuntime(runtime);
|
|
93
|
-
const cfg = { channels: { line: {} } } as
|
|
93
|
+
const cfg = { channels: { line: {} } } as PoolbotConfig;
|
|
94
94
|
|
|
95
95
|
const payload = {
|
|
96
96
|
text: "Now playing:",
|
|
@@ -121,7 +121,7 @@ describe("linePlugin outbound.sendPayload", () => {
|
|
|
121
121
|
it("sends template message without dropping text", async () => {
|
|
122
122
|
const { runtime, mocks } = createRuntime();
|
|
123
123
|
setLineRuntime(runtime);
|
|
124
|
-
const cfg = { channels: { line: {} } } as
|
|
124
|
+
const cfg = { channels: { line: {} } } as PoolbotConfig;
|
|
125
125
|
|
|
126
126
|
const payload = {
|
|
127
127
|
text: "Choose one:",
|
|
@@ -157,7 +157,7 @@ describe("linePlugin outbound.sendPayload", () => {
|
|
|
157
157
|
it("attaches quick replies when no text chunks are present", async () => {
|
|
158
158
|
const { runtime, mocks } = createRuntime();
|
|
159
159
|
setLineRuntime(runtime);
|
|
160
|
-
const cfg = { channels: { line: {} } } as
|
|
160
|
+
const cfg = { channels: { line: {} } } as PoolbotConfig;
|
|
161
161
|
|
|
162
162
|
const payload = {
|
|
163
163
|
channelData: {
|
|
@@ -197,7 +197,7 @@ describe("linePlugin outbound.sendPayload", () => {
|
|
|
197
197
|
it("sends media before quick-reply text so buttons stay visible", async () => {
|
|
198
198
|
const { runtime, mocks } = createRuntime();
|
|
199
199
|
setLineRuntime(runtime);
|
|
200
|
-
const cfg = { channels: { line: {} } } as
|
|
200
|
+
const cfg = { channels: { line: {} } } as PoolbotConfig;
|
|
201
201
|
|
|
202
202
|
const payload = {
|
|
203
203
|
text: "Hello",
|
|
@@ -235,7 +235,7 @@ describe("linePlugin outbound.sendPayload", () => {
|
|
|
235
235
|
it("uses configured text chunk limit for payloads", async () => {
|
|
236
236
|
const { runtime, mocks } = createRuntime();
|
|
237
237
|
setLineRuntime(runtime);
|
|
238
|
-
const cfg = { channels: { line: { textChunkLimit: 123 } } } as
|
|
238
|
+
const cfg = { channels: { line: { textChunkLimit: 123 } } } as PoolbotConfig;
|
|
239
239
|
|
|
240
240
|
const payload = {
|
|
241
241
|
text: "Hello world",
|
|
@@ -295,7 +295,7 @@ describe("linePlugin groups.resolveRequireMention", () => {
|
|
|
295
295
|
},
|
|
296
296
|
},
|
|
297
297
|
},
|
|
298
|
-
} as
|
|
298
|
+
} as PoolbotConfig;
|
|
299
299
|
|
|
300
300
|
const requireMention = linePlugin.groups.resolveRequireMention({
|
|
301
301
|
cfg,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
LineConfigSchema,
|
|
5
5
|
processLineMessage,
|
|
6
6
|
type ChannelPlugin,
|
|
7
|
-
type
|
|
7
|
+
type PoolbotConfig,
|
|
8
8
|
type LineConfig,
|
|
9
9
|
type LineChannelData,
|
|
10
10
|
type ResolvedLineAccount,
|
|
@@ -53,7 +53,7 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = {
|
|
|
53
53
|
if (!account.channelAccessToken) {
|
|
54
54
|
throw new Error("LINE channel access token not configured");
|
|
55
55
|
}
|
|
56
|
-
await line.pushMessageLine(id, "
|
|
56
|
+
await line.pushMessageLine(id, "Poolbot: your access has been approved.", {
|
|
57
57
|
channelAccessToken: account.channelAccessToken,
|
|
58
58
|
});
|
|
59
59
|
},
|
|
@@ -639,7 +639,7 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = {
|
|
|
639
639
|
},
|
|
640
640
|
logoutAccount: async ({ accountId, cfg }) => {
|
|
641
641
|
const envToken = process.env.LINE_CHANNEL_ACCESS_TOKEN?.trim() ?? "";
|
|
642
|
-
const nextCfg = { ...cfg } as
|
|
642
|
+
const nextCfg = { ...cfg } as PoolbotConfig;
|
|
643
643
|
const lineConfig = (cfg.channels?.line ?? {}) as LineConfig;
|
|
644
644
|
const nextLine = { ...lineConfig };
|
|
645
645
|
let cleared = false;
|
|
@@ -4,7 +4,7 @@ Adds an **optional** agent tool `llm-task` for running **JSON-only** LLM tasks
|
|
|
4
4
|
(drafting, summarizing, classifying) with optional JSON Schema validation.
|
|
5
5
|
|
|
6
6
|
Designed to be called from workflow engines (for example, Lobster via
|
|
7
|
-
`clawd.invoke --each`) without adding new
|
|
7
|
+
`clawd.invoke --each`) without adding new Pool-Bot code per workflow.
|
|
8
8
|
|
|
9
9
|
## Enable
|
|
10
10
|
|
|
@@ -89,8 +89,8 @@ Returns `details.json` containing the parsed JSON (and validates against
|
|
|
89
89
|
|
|
90
90
|
## Bundled extension note
|
|
91
91
|
|
|
92
|
-
This extension depends on
|
|
93
|
-
It is intended to ship as a **bundled**
|
|
92
|
+
This extension depends on Pool-Bot internal modules (the embedded agent runner).
|
|
93
|
+
It is intended to ship as a **bundled** Pool-Bot extension (like `lobster`) and
|
|
94
94
|
be enabled via `plugins.entries` + tool allowlists.
|
|
95
95
|
|
|
96
96
|
It is **not** currently designed to be copied into
|