@poolzin/pool-bot 2026.1.38 → 2026.2.0
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/cli-runner/helpers.js +1 -1
- 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/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 +10 -4
- package/dist/agents/models-config.js +3 -3
- package/dist/agents/models-config.providers.js +147 -39
- package/dist/agents/pi-embedded-helpers/openai.js +1 -1
- package/dist/agents/pi-embedded-runner/compact.js +8 -8
- package/dist/agents/pi-embedded-runner/model.js +2 -2
- package/dist/agents/pi-embedded-runner/run/attempt.js +6 -6
- package/dist/agents/pi-embedded-runner/run.js +4 -4
- 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-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 +10 -5
- package/dist/agents/pi-tools.read.js +2 -2
- package/dist/agents/session-file-repair.js +83 -0
- package/dist/agents/session-transcript-repair.js +68 -0
- package/dist/agents/skills/frontmatter.js +1 -1
- package/dist/agents/skills/workspace.js +2 -2
- 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.js +1 -1
- package/dist/agents/tools/browser-tool.js +3 -3
- package/dist/agents/tools/image-tool.js +2 -2
- package/dist/agents/tools/memory-tool.js +94 -7
- package/dist/agents/tools/web-search.js +1 -1
- package/dist/agents/workspace.js +1 -5
- package/dist/auto-reply/commands-registry.data.js +1 -1
- package/dist/auto-reply/reply/commands-context-report.js +2 -2
- package/dist/auto-reply/reply/commands-session.js +2 -2
- package/dist/auto-reply/reply/get-reply-run.js +14 -4
- package/dist/auto-reply/reply/groups.js +1 -1
- package/dist/auto-reply/reply/inbound-context.js +4 -0
- package/dist/auto-reply/reply/inbound-meta.js +130 -0
- package/dist/auto-reply/reply/untrusted-context.js +15 -0
- package/dist/auto-reply/status.js +1 -1
- package/dist/browser/client-fetch.js +1 -1
- package/dist/browser/config.js +1 -1
- package/dist/browser/extension-relay.js +3 -3
- package/dist/browser/server-context.js +2 -2
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui.js +3 -3
- package/dist/channels/plugins/agent-tools/whatsapp-login.js +1 -17
- 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/cli/browser-cli-extension.js +2 -2
- package/dist/cli/docs-cli.js +1 -1
- package/dist/cli/gateway-cli/dev.js +1 -1
- package/dist/cli/memory-cli.js +25 -15
- package/dist/cli/nodes-cli/register.canvas.js +1 -1
- 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 +4 -4
- package/dist/cli/webhooks-cli.js +5 -5
- 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-gateway-services.js +3 -3
- package/dist/commands/doctor-state-integrity.js +2 -14
- package/dist/commands/doctor-update.js +3 -3
- package/dist/commands/doctor.js +1 -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 +2 -2
- 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-non-interactive/local/auth-choice.js +140 -6
- 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/io.js +3 -3
- package/dist/config/schema.js +1 -1
- package/dist/config/types.js +0 -1
- package/dist/config/types.memory.js +1 -0
- package/dist/config/version.js +4 -4
- package/dist/config/zod-schema.js +0 -6
- 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/message-handler.process.js +6 -4
- package/dist/gateway/client.js +0 -14
- package/dist/gateway/live-image-probe.js +1 -66
- package/dist/gateway/openai-http.js +2 -2
- package/dist/gateway/openresponses-http.js +4 -4
- package/dist/gateway/server-discovery.js +2 -2
- package/dist/gateway/server-http.js +1 -1
- package/dist/gateway/server.impl.js +2 -6
- 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/index.js +2 -2
- package/dist/infra/bonjour.js +3 -3
- package/dist/infra/path-env.js +3 -3
- package/dist/infra/provider-usage.fetch.minimax.js +1 -1
- package/dist/infra/restart.js +1 -1
- package/dist/infra/tailscale.js +1 -1
- package/dist/macos/relay.js +2 -2
- 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/providers/image.js +2 -2
- package/dist/memory/backend-config.js +207 -0
- package/dist/memory/embeddings.js +1 -1
- package/dist/memory/index.js +0 -5
- package/dist/memory/manager.js +3 -25
- package/dist/memory/types.js +1 -0
- package/dist/node-host/runner.js +2 -2
- package/dist/pairing/pairing-messages.js +1 -1
- package/dist/plugins/discovery.js +1 -1
- package/dist/plugins/install.js +2 -2
- package/dist/plugins/update.js +1 -1
- package/dist/security/audit.js +2 -2
- package/dist/shared/text/reasoning-tags.js +52 -7
- package/dist/slack/monitor/message-handler/prepare.js +10 -4
- package/dist/slack/monitor/slash.js +10 -4
- package/dist/tailscale/detect.js +146 -0
- package/dist/telegram/bot-message-context.js +1 -1
- 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/utils/shell-argv.js +61 -0
- package/dist/utils.js +10 -0
- 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 -4
- 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 -250
- package/skills/nano-banana-pro/scripts/generate_image.py +1 -1
- package/skills/tmux/scripts/find-sessions.sh +1 -1
- package/CHANGELOG.md +0 -200
- 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
- package/skills/webgpu-threejs-tsl/REFERENCE.md +0 -283
- package/skills/webgpu-threejs-tsl/SKILL.md +0 -91
- package/skills/webgpu-threejs-tsl/docs/compute-shaders.md +0 -404
- package/skills/webgpu-threejs-tsl/docs/core-concepts.md +0 -453
- package/skills/webgpu-threejs-tsl/docs/materials.md +0 -353
- package/skills/webgpu-threejs-tsl/docs/post-processing.md +0 -434
- package/skills/webgpu-threejs-tsl/docs/wgsl-integration.md +0 -324
- package/skills/webgpu-threejs-tsl/examples/basic-setup.js +0 -87
- package/skills/webgpu-threejs-tsl/examples/custom-material.js +0 -170
- package/skills/webgpu-threejs-tsl/examples/earth-shader.js +0 -292
- package/skills/webgpu-threejs-tsl/examples/particle-system.js +0 -259
- package/skills/webgpu-threejs-tsl/examples/post-processing.js +0 -199
- package/skills/webgpu-threejs-tsl/templates/compute-shader.js +0 -305
- package/skills/webgpu-threejs-tsl/templates/webgpu-project.js +0 -276
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Pool-Bot Chrome Extension (Browser Relay)
|
|
2
2
|
|
|
3
|
-
Purpose: attach
|
|
3
|
+
Purpose: attach Pool-Bot to an existing Chrome tab so the Gateway can automate it (via the local CDP relay server).
|
|
4
4
|
|
|
5
5
|
## Dev / load unpacked
|
|
6
6
|
|
|
7
|
-
1. Build/run
|
|
7
|
+
1. Build/run Pool-Bot Gateway with browser control enabled.
|
|
8
8
|
2. Ensure the relay server is reachable at `http://127.0.0.1:18792/` (default).
|
|
9
9
|
3. Install the extension to a stable path:
|
|
10
10
|
|
|
@@ -114,7 +114,7 @@ function onRelayClosed(reason) {
|
|
|
114
114
|
setBadge(tabId, 'connecting')
|
|
115
115
|
void chrome.action.setTitle({
|
|
116
116
|
tabId,
|
|
117
|
-
title: '
|
|
117
|
+
title: 'Poolbot Browser Relay: disconnected (click to re-attach)',
|
|
118
118
|
})
|
|
119
119
|
}
|
|
120
120
|
tabs.clear()
|
|
@@ -225,7 +225,7 @@ async function attachTab(tabId, opts = {}) {
|
|
|
225
225
|
tabBySession.set(sessionId, tabId)
|
|
226
226
|
void chrome.action.setTitle({
|
|
227
227
|
tabId,
|
|
228
|
-
title: '
|
|
228
|
+
title: 'Poolbot Browser Relay: attached (click to detach)',
|
|
229
229
|
})
|
|
230
230
|
|
|
231
231
|
if (!opts.skipAttachedEvent) {
|
|
@@ -278,7 +278,7 @@ async function detachTab(tabId, reason) {
|
|
|
278
278
|
setBadge(tabId, 'off')
|
|
279
279
|
void chrome.action.setTitle({
|
|
280
280
|
tabId,
|
|
281
|
-
title: '
|
|
281
|
+
title: 'Poolbot Browser Relay (click to attach/detach)',
|
|
282
282
|
})
|
|
283
283
|
}
|
|
284
284
|
|
|
@@ -297,7 +297,7 @@ async function connectOrToggleForActiveTab() {
|
|
|
297
297
|
setBadge(tabId, 'connecting')
|
|
298
298
|
void chrome.action.setTitle({
|
|
299
299
|
tabId,
|
|
300
|
-
title: '
|
|
300
|
+
title: 'Poolbot Browser Relay: connecting to local relay…',
|
|
301
301
|
})
|
|
302
302
|
|
|
303
303
|
try {
|
|
@@ -308,7 +308,7 @@ async function connectOrToggleForActiveTab() {
|
|
|
308
308
|
setBadge(tabId, 'error')
|
|
309
309
|
void chrome.action.setTitle({
|
|
310
310
|
tabId,
|
|
311
|
-
title: '
|
|
311
|
+
title: 'Poolbot Browser Relay: relay not running (open options for setup)',
|
|
312
312
|
})
|
|
313
313
|
void maybeOpenHelpOnce()
|
|
314
314
|
// Extra breadcrumbs in chrome://extensions service worker logs.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": 3,
|
|
3
|
-
"name": "
|
|
3
|
+
"name": "Poolbot Browser Relay",
|
|
4
4
|
"version": "0.1.0",
|
|
5
|
-
"description": "Attach
|
|
5
|
+
"description": "Attach Poolbot to your existing Chrome tab via a local CDP relay server.",
|
|
6
6
|
"icons": {
|
|
7
7
|
"16": "icons/icon16.png",
|
|
8
8
|
"32": "icons/icon32.png",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"host_permissions": ["http://127.0.0.1/*", "http://localhost/*"],
|
|
14
14
|
"background": { "service_worker": "background.js", "type": "module" },
|
|
15
15
|
"action": {
|
|
16
|
-
"default_title": "
|
|
16
|
+
"default_title": "Poolbot Browser Relay (click to attach/detach)",
|
|
17
17
|
"default_icon": {
|
|
18
18
|
"16": "icons/icon16.png",
|
|
19
19
|
"32": "icons/icon32.png",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<title>
|
|
6
|
+
<title>Poolbot Browser Relay</title>
|
|
7
7
|
<style>
|
|
8
8
|
:root {
|
|
9
9
|
color-scheme: light dark;
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
<img src="icons/icon128.png" alt="" />
|
|
159
159
|
</div>
|
|
160
160
|
<div>
|
|
161
|
-
<h1>
|
|
161
|
+
<h1>Poolbot Browser Relay</h1>
|
|
162
162
|
<p class="subtitle">Click the toolbar button on a tab to attach / detach.</p>
|
|
163
163
|
</div>
|
|
164
164
|
</header>
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
<h2>Getting started</h2>
|
|
169
169
|
<p>
|
|
170
170
|
If you see a red <code>!</code> badge on the extension icon, the relay server is not reachable.
|
|
171
|
-
Start
|
|
171
|
+
Start Poolbot’s browser relay on this machine (Gateway or node host), then click the toolbar button again.
|
|
172
172
|
</p>
|
|
173
173
|
<p>
|
|
174
174
|
Full guide (install, remote Gateway, security): <a href="https://docs.molt.bot/tools/chrome-extension" target="_blank" rel="noreferrer">docs.molt.bot/tools/chrome-extension</a>
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
</div>
|
|
185
185
|
<div class="hint">
|
|
186
186
|
Default: <code>18792</code>. Extension connects to: <code id="relay-url">http://127.0.0.1:<port>/</code>.
|
|
187
|
-
Only change this if your
|
|
187
|
+
Only change this if your Poolbot profile uses a different <code>cdpUrl</code> port.
|
|
188
188
|
</div>
|
|
189
189
|
<div class="status" id="status"></div>
|
|
190
190
|
</div>
|
|
@@ -31,7 +31,7 @@ async function checkRelayReachable(port) {
|
|
|
31
31
|
} catch {
|
|
32
32
|
setStatus(
|
|
33
33
|
'error',
|
|
34
|
-
`Relay not reachable at ${url}. Start
|
|
34
|
+
`Relay not reachable at ${url}. Start Poolbot’s browser relay on this machine, then click the toolbar button again.`,
|
|
35
35
|
)
|
|
36
36
|
} finally {
|
|
37
37
|
clearTimeout(t)
|
package/dist/acp/client.js
CHANGED
|
@@ -2,7 +2,7 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import * as readline from "node:readline";
|
|
3
3
|
import { Readable, Writable } from "node:stream";
|
|
4
4
|
import { ClientSideConnection, PROTOCOL_VERSION, ndJsonStream, } from "@agentclientprotocol/sdk";
|
|
5
|
-
import {
|
|
5
|
+
import { ensurePoolbotCliOnPath } from "../infra/path-env.js";
|
|
6
6
|
function toArgs(value) {
|
|
7
7
|
if (!value)
|
|
8
8
|
return [];
|
|
@@ -50,7 +50,7 @@ export async function createAcpClient(opts = {}) {
|
|
|
50
50
|
const cwd = opts.cwd ?? process.cwd();
|
|
51
51
|
const verbose = Boolean(opts.verbose);
|
|
52
52
|
const log = verbose ? (msg) => console.error(`[acp-client] ${msg}`) : () => { };
|
|
53
|
-
|
|
53
|
+
ensurePoolbotCliOnPath({ cwd });
|
|
54
54
|
const serverCommand = opts.serverCommand ?? "poolbot";
|
|
55
55
|
const serverArgs = buildServerArgs(opts);
|
|
56
56
|
log(`spawning: ${serverCommand} ${serverArgs.join(" ")}`);
|
|
@@ -107,7 +107,7 @@ export async function runAcpClientInteractive(opts = {}) {
|
|
|
107
107
|
input: process.stdin,
|
|
108
108
|
output: process.stdout,
|
|
109
109
|
});
|
|
110
|
-
console.log("
|
|
110
|
+
console.log("Poolbot ACP client");
|
|
111
111
|
console.log(`Session: ${sessionId}`);
|
|
112
112
|
console.log('Type a prompt, or "exit" to quit.\n');
|
|
113
113
|
const prompt = () => {
|
package/dist/acp/types.js
CHANGED
|
@@ -2,15 +2,15 @@ import path from "node:path";
|
|
|
2
2
|
import { resolveStateDir } from "../config/paths.js";
|
|
3
3
|
import { DEFAULT_AGENT_ID } from "../routing/session-key.js";
|
|
4
4
|
import { resolveUserPath } from "../utils.js";
|
|
5
|
-
export function
|
|
5
|
+
export function resolvePoolbotAgentDir() {
|
|
6
6
|
const override = process.env.CLAWDBOT_AGENT_DIR?.trim() || process.env.PI_CODING_AGENT_DIR?.trim();
|
|
7
7
|
if (override)
|
|
8
8
|
return resolveUserPath(override);
|
|
9
9
|
const defaultAgentDir = path.join(resolveStateDir(), "agents", DEFAULT_AGENT_ID, "agent");
|
|
10
10
|
return resolveUserPath(defaultAgentDir);
|
|
11
11
|
}
|
|
12
|
-
export function
|
|
13
|
-
const dir =
|
|
12
|
+
export function ensurePoolbotAgentEnv() {
|
|
13
|
+
const dir = resolvePoolbotAgentDir();
|
|
14
14
|
if (!process.env.CLAWDBOT_AGENT_DIR)
|
|
15
15
|
process.env.CLAWDBOT_AGENT_DIR = dir;
|
|
16
16
|
if (!process.env.PI_CODING_AGENT_DIR)
|
|
@@ -2,14 +2,14 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { saveJsonFile } from "../../infra/json-file.js";
|
|
4
4
|
import { resolveUserPath } from "../../utils.js";
|
|
5
|
-
import {
|
|
5
|
+
import { resolvePoolbotAgentDir } from "../agent-paths.js";
|
|
6
6
|
import { AUTH_PROFILE_FILENAME, AUTH_STORE_VERSION, LEGACY_AUTH_FILENAME } from "./constants.js";
|
|
7
7
|
export function resolveAuthStorePath(agentDir) {
|
|
8
|
-
const resolved = resolveUserPath(agentDir ??
|
|
8
|
+
const resolved = resolveUserPath(agentDir ?? resolvePoolbotAgentDir());
|
|
9
9
|
return path.join(resolved, AUTH_PROFILE_FILENAME);
|
|
10
10
|
}
|
|
11
11
|
export function resolveLegacyAuthStorePath(agentDir) {
|
|
12
|
-
const resolved = resolveUserPath(agentDir ??
|
|
12
|
+
const resolved = resolveUserPath(agentDir ?? resolvePoolbotAgentDir());
|
|
13
13
|
return path.join(resolved, LEGACY_AUTH_FILENAME);
|
|
14
14
|
}
|
|
15
15
|
export function resolveAuthStorePathForDisplay(agentDir) {
|
|
@@ -74,7 +74,7 @@ function tokenToRegex(token) {
|
|
|
74
74
|
return parts.join("\\S+");
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
|
-
* Cleanup suspended
|
|
77
|
+
* Cleanup suspended Poolbot CLI processes that have accumulated.
|
|
78
78
|
* Only cleans up if there are more than the threshold (default: 10).
|
|
79
79
|
*/
|
|
80
80
|
export async function cleanupSuspendedCliProcesses(backend, threshold = 10) {
|
|
@@ -4,7 +4,7 @@ import { shouldLogVerbose } from "../globals.js";
|
|
|
4
4
|
import { createSubsystemLogger } from "../logging/subsystem.js";
|
|
5
5
|
import { runCommandWithTimeout } from "../process/exec.js";
|
|
6
6
|
import { resolveUserPath } from "../utils.js";
|
|
7
|
-
import {
|
|
7
|
+
import { resolvePoolbotDocsPath } from "./docs-path.js";
|
|
8
8
|
import { resolveSessionAgentIds } from "./agent-scope.js";
|
|
9
9
|
import { makeBootstrapWarn, resolveBootstrapContextForRun } from "./bootstrap-files.js";
|
|
10
10
|
import { resolveCliBackendConfig } from "./cli-backends.js";
|
|
@@ -45,7 +45,7 @@ export async function runCliAgent(params) {
|
|
|
45
45
|
const heartbeatPrompt = sessionAgentId === defaultAgentId
|
|
46
46
|
? resolveHeartbeatPrompt(params.config?.agents?.defaults?.heartbeat?.prompt)
|
|
47
47
|
: undefined;
|
|
48
|
-
const docsPath = await
|
|
48
|
+
const docsPath = await resolvePoolbotDocsPath({
|
|
49
49
|
workspaceDir,
|
|
50
50
|
argv1: process.argv[1],
|
|
51
51
|
cwd: process.cwd(),
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const CLOUDFLARE_AI_GATEWAY_PROVIDER_ID = "cloudflare-ai-gateway";
|
|
2
|
+
export const CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_ID = "claude-sonnet-4-5";
|
|
3
|
+
export const CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_REF = `${CLOUDFLARE_AI_GATEWAY_PROVIDER_ID}/${CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_ID}`;
|
|
4
|
+
export const CLOUDFLARE_AI_GATEWAY_DEFAULT_CONTEXT_WINDOW = 200_000;
|
|
5
|
+
export const CLOUDFLARE_AI_GATEWAY_DEFAULT_MAX_TOKENS = 64_000;
|
|
6
|
+
export const CLOUDFLARE_AI_GATEWAY_DEFAULT_COST = {
|
|
7
|
+
input: 3,
|
|
8
|
+
output: 15,
|
|
9
|
+
cacheRead: 0.3,
|
|
10
|
+
cacheWrite: 3.75,
|
|
11
|
+
};
|
|
12
|
+
export function buildCloudflareAiGatewayModelDefinition(params) {
|
|
13
|
+
const id = params?.id?.trim() || CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_ID;
|
|
14
|
+
return {
|
|
15
|
+
id,
|
|
16
|
+
name: params?.name ?? "Claude Sonnet 4.5",
|
|
17
|
+
reasoning: params?.reasoning ?? true,
|
|
18
|
+
input: params?.input ?? ["text", "image"],
|
|
19
|
+
cost: CLOUDFLARE_AI_GATEWAY_DEFAULT_COST,
|
|
20
|
+
contextWindow: CLOUDFLARE_AI_GATEWAY_DEFAULT_CONTEXT_WINDOW,
|
|
21
|
+
maxTokens: CLOUDFLARE_AI_GATEWAY_DEFAULT_MAX_TOKENS,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export function resolveCloudflareAiGatewayBaseUrl(params) {
|
|
25
|
+
const accountId = params.accountId.trim();
|
|
26
|
+
const gatewayId = params.gatewayId.trim();
|
|
27
|
+
if (!accountId || !gatewayId) {
|
|
28
|
+
return "";
|
|
29
|
+
}
|
|
30
|
+
return `https://gateway.ai.cloudflare.com/v1/${accountId}/${gatewayId}/anthropic`;
|
|
31
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { estimateTokens, generateSummary } from "@mariozechner/pi-coding-agent";
|
|
2
2
|
import { DEFAULT_CONTEXT_TOKENS } from "./defaults.js";
|
|
3
|
+
import { repairToolUseResultPairing } from "./session-transcript-repair.js";
|
|
3
4
|
export const BASE_CHUNK_RATIO = 0.4;
|
|
4
5
|
export const MIN_CHUNK_RATIO = 0.15;
|
|
5
6
|
export const SAFETY_MARGIN = 1.2; // 20% buffer for estimateTokens() inaccuracy
|
|
@@ -208,11 +209,24 @@ export function pruneHistoryForContextShare(params) {
|
|
|
208
209
|
if (chunks.length <= 1)
|
|
209
210
|
break;
|
|
210
211
|
const [dropped, ...rest] = chunks;
|
|
212
|
+
const flatRest = rest.flat();
|
|
213
|
+
// After dropping a chunk, repair tool_use/tool_result pairing to handle
|
|
214
|
+
// orphaned tool_results (whose tool_use was in the dropped chunk).
|
|
215
|
+
// repairToolUseResultPairing drops orphaned tool_results, preventing
|
|
216
|
+
// "unexpected tool_use_id" errors from Anthropic's API.
|
|
217
|
+
const repairReport = repairToolUseResultPairing(flatRest);
|
|
218
|
+
const repairedKept = repairReport.messages;
|
|
219
|
+
// Track orphaned tool_results as dropped (they were in kept but their tool_use was dropped)
|
|
220
|
+
const orphanedCount = repairReport.droppedOrphanCount;
|
|
211
221
|
droppedChunks += 1;
|
|
212
|
-
droppedMessages += dropped.length;
|
|
222
|
+
droppedMessages += dropped.length + orphanedCount;
|
|
213
223
|
droppedTokens += estimateMessagesTokens(dropped);
|
|
224
|
+
// Note: We don't have the actual orphaned messages to add to droppedMessagesList
|
|
225
|
+
// since repairToolUseResultPairing doesn't return them. This is acceptable since
|
|
226
|
+
// the dropped messages are used for summarization, and orphaned tool_results
|
|
227
|
+
// without their tool_use context aren't useful for summarization anyway.
|
|
214
228
|
allDroppedMessages.push(...dropped);
|
|
215
|
-
keptMessages =
|
|
229
|
+
keptMessages = repairedKept;
|
|
216
230
|
}
|
|
217
231
|
return {
|
|
218
232
|
messages: keptMessages,
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
export const CONTEXT_WINDOW_HARD_MIN_TOKENS = 16_000;
|
|
2
2
|
export const CONTEXT_WINDOW_WARN_BELOW_TOKENS = 32_000;
|
|
3
3
|
function normalizePositiveInt(value) {
|
|
4
|
-
if (typeof value !== "number" || !Number.isFinite(value))
|
|
4
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
5
5
|
return null;
|
|
6
|
+
}
|
|
6
7
|
const int = Math.floor(value);
|
|
7
8
|
return int > 0 ? int : null;
|
|
8
9
|
}
|
|
9
10
|
export function resolveContextWindowInfo(params) {
|
|
10
|
-
const fromModel = normalizePositiveInt(params.modelContextWindow);
|
|
11
|
-
if (fromModel)
|
|
12
|
-
return { tokens: fromModel, source: "model" };
|
|
13
11
|
const fromModelsConfig = (() => {
|
|
14
12
|
const providers = params.cfg?.models?.providers;
|
|
15
13
|
const providerEntry = providers?.[params.provider];
|
|
@@ -17,12 +15,17 @@ export function resolveContextWindowInfo(params) {
|
|
|
17
15
|
const match = models.find((m) => m?.id === params.modelId);
|
|
18
16
|
return normalizePositiveInt(match?.contextWindow);
|
|
19
17
|
})();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
const fromModel = normalizePositiveInt(params.modelContextWindow);
|
|
19
|
+
const baseInfo = fromModelsConfig
|
|
20
|
+
? { tokens: fromModelsConfig, source: "modelsConfig" }
|
|
21
|
+
: fromModel
|
|
22
|
+
? { tokens: fromModel, source: "model" }
|
|
23
|
+
: { tokens: Math.floor(params.defaultTokens), source: "default" };
|
|
24
|
+
const capTokens = normalizePositiveInt(params.cfg?.agents?.defaults?.contextTokens);
|
|
25
|
+
if (capTokens && capTokens < baseInfo.tokens) {
|
|
26
|
+
return { tokens: capTokens, source: "agentContextTokens" };
|
|
27
|
+
}
|
|
28
|
+
return baseInfo;
|
|
26
29
|
}
|
|
27
30
|
export function evaluateContextWindowGuard(params) {
|
|
28
31
|
const warnBelow = Math.max(1, Math.floor(params.warnBelowTokens ?? CONTEXT_WINDOW_WARN_BELOW_TOKENS));
|
package/dist/agents/context.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// Lazy-load pi-coding-agent model metadata so we can infer context windows when
|
|
2
2
|
// the agent reports a model id. This includes custom models.json entries.
|
|
3
3
|
import { loadConfig } from "../config/config.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { resolvePoolbotAgentDir } from "./agent-paths.js";
|
|
5
|
+
import { ensurePoolbotModelsJson } from "./models-config.js";
|
|
6
6
|
const MODEL_CACHE = new Map();
|
|
7
7
|
const loadPromise = (async () => {
|
|
8
8
|
try {
|
|
9
9
|
const { discoverAuthStorage, discoverModels } = await import("@mariozechner/pi-coding-agent");
|
|
10
10
|
const cfg = loadConfig();
|
|
11
|
-
await
|
|
12
|
-
const agentDir =
|
|
11
|
+
await ensurePoolbotModelsJson(cfg);
|
|
12
|
+
const agentDir = resolvePoolbotAgentDir();
|
|
13
13
|
const authStorage = discoverAuthStorage(agentDir);
|
|
14
14
|
const modelRegistry = discoverModels(authStorage, agentDir);
|
|
15
15
|
const models = modelRegistry.getAll();
|
package/dist/agents/docs-path.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { resolvePoolBotPackageRoot } from "../infra/poolbot-root.js";
|
|
4
|
-
export async function
|
|
4
|
+
export async function resolvePoolbotDocsPath(params) {
|
|
5
5
|
const workspaceDir = params.workspaceDir?.trim();
|
|
6
6
|
if (workspaceDir) {
|
|
7
7
|
const workspaceDocs = path.join(workspaceDir, "docs");
|
|
@@ -199,22 +199,33 @@ export function resolveEnvApiKey(provider) {
|
|
|
199
199
|
if (normalized === "qwen-portal") {
|
|
200
200
|
return pick("QWEN_OAUTH_TOKEN") ?? pick("QWEN_PORTAL_API_KEY");
|
|
201
201
|
}
|
|
202
|
+
if (normalized === "minimax-portal") {
|
|
203
|
+
return pick("MINIMAX_OAUTH_TOKEN") ?? pick("MINIMAX_API_KEY");
|
|
204
|
+
}
|
|
205
|
+
if (normalized === "kimi-coding") {
|
|
206
|
+
return pick("KIMI_API_KEY") ?? pick("KIMICODE_API_KEY");
|
|
207
|
+
}
|
|
202
208
|
const envMap = {
|
|
203
209
|
openai: "OPENAI_API_KEY",
|
|
204
210
|
google: "GEMINI_API_KEY",
|
|
211
|
+
voyage: "VOYAGE_API_KEY",
|
|
205
212
|
groq: "GROQ_API_KEY",
|
|
206
213
|
deepgram: "DEEPGRAM_API_KEY",
|
|
207
214
|
cerebras: "CEREBRAS_API_KEY",
|
|
208
215
|
xai: "XAI_API_KEY",
|
|
209
216
|
openrouter: "OPENROUTER_API_KEY",
|
|
210
217
|
"vercel-ai-gateway": "AI_GATEWAY_API_KEY",
|
|
218
|
+
"cloudflare-ai-gateway": "CLOUDFLARE_AI_GATEWAY_API_KEY",
|
|
211
219
|
moonshot: "MOONSHOT_API_KEY",
|
|
212
|
-
"kimi-code": "KIMICODE_API_KEY",
|
|
213
220
|
minimax: "MINIMAX_API_KEY",
|
|
221
|
+
xiaomi: "XIAOMI_API_KEY",
|
|
214
222
|
synthetic: "SYNTHETIC_API_KEY",
|
|
215
223
|
venice: "VENICE_API_KEY",
|
|
216
224
|
mistral: "MISTRAL_API_KEY",
|
|
217
225
|
opencode: "OPENCODE_API_KEY",
|
|
226
|
+
together: "TOGETHER_API_KEY",
|
|
227
|
+
qianfan: "QIANFAN_API_KEY",
|
|
228
|
+
ollama: "OLLAMA_API_KEY",
|
|
218
229
|
};
|
|
219
230
|
const envVar = envMap[normalized];
|
|
220
231
|
if (!envVar)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { loadConfig } from "../config/config.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { resolvePoolbotAgentDir } from "./agent-paths.js";
|
|
3
|
+
import { ensurePoolbotModelsJson } from "./models-config.js";
|
|
4
4
|
let modelCatalogPromise = null;
|
|
5
5
|
let hasLoggedModelCatalogError = false;
|
|
6
6
|
const defaultImportPiSdk = () => import("@mariozechner/pi-coding-agent");
|
|
@@ -30,13 +30,13 @@ export async function loadModelCatalog(params) {
|
|
|
30
30
|
});
|
|
31
31
|
try {
|
|
32
32
|
const cfg = params?.config ?? loadConfig();
|
|
33
|
-
await
|
|
33
|
+
await ensurePoolbotModelsJson(cfg);
|
|
34
34
|
// IMPORTANT: keep the dynamic import *inside* the try/catch.
|
|
35
35
|
// If this fails once (e.g. during a pnpm install that temporarily swaps node_modules),
|
|
36
36
|
// we must not poison the cache with a rejected promise (otherwise all channel handlers
|
|
37
37
|
// will keep failing until restart).
|
|
38
38
|
const piSdk = await importPiSdk();
|
|
39
|
-
const agentDir =
|
|
39
|
+
const agentDir = resolvePoolbotAgentDir();
|
|
40
40
|
const authStorage = piSdk.discoverAuthStorage(agentDir);
|
|
41
41
|
const registry = piSdk.discoverModels(authStorage, agentDir);
|
|
42
42
|
const entries = Array.isArray(registry) ? registry : registry.getAll();
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { normalizeGoogleModelId } from "./models-config.providers.js";
|
|
2
2
|
import { resolveAgentModelPrimary } from "./agent-scope.js";
|
|
3
3
|
import { DEFAULT_MODEL, DEFAULT_PROVIDER } from "./defaults.js";
|
|
4
|
+
const ANTHROPIC_MODEL_ALIASES = {
|
|
5
|
+
"opus-4.6": "claude-opus-4-6",
|
|
6
|
+
"opus-4.5": "claude-opus-4-5",
|
|
7
|
+
"sonnet-4.5": "claude-sonnet-4-5",
|
|
8
|
+
};
|
|
4
9
|
function normalizeAliasKey(value) {
|
|
5
10
|
return value.trim().toLowerCase();
|
|
6
11
|
}
|
|
@@ -15,6 +20,8 @@ export function normalizeProviderId(provider) {
|
|
|
15
20
|
return "opencode";
|
|
16
21
|
if (normalized === "qwen")
|
|
17
22
|
return "qwen-portal";
|
|
23
|
+
if (normalized === "kimi-code")
|
|
24
|
+
return "kimi-coding";
|
|
18
25
|
return normalized;
|
|
19
26
|
}
|
|
20
27
|
export function isCliProvider(provider, cfg) {
|
|
@@ -31,10 +38,9 @@ function normalizeAnthropicModelId(model) {
|
|
|
31
38
|
if (!trimmed)
|
|
32
39
|
return trimmed;
|
|
33
40
|
const lower = trimmed.toLowerCase();
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return "claude-sonnet-4-5";
|
|
41
|
+
const aliased = ANTHROPIC_MODEL_ALIASES[lower];
|
|
42
|
+
if (aliased)
|
|
43
|
+
return aliased;
|
|
38
44
|
return trimmed;
|
|
39
45
|
}
|
|
40
46
|
function normalizeProviderModelId(provider, model) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { loadConfig } from "../config/config.js";
|
|
4
|
-
import {
|
|
4
|
+
import { resolvePoolbotAgentDir } from "./agent-paths.js";
|
|
5
5
|
import { normalizeProviders, resolveImplicitBedrockProvider, resolveImplicitCopilotProvider, resolveImplicitProviders, } from "./models-config.providers.js";
|
|
6
6
|
const DEFAULT_MODE = "merge";
|
|
7
7
|
function isRecord(value) {
|
|
@@ -57,9 +57,9 @@ async function readJson(pathname) {
|
|
|
57
57
|
return null;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
export async function
|
|
60
|
+
export async function ensurePoolbotModelsJson(config, agentDirOverride) {
|
|
61
61
|
const cfg = config ?? loadConfig();
|
|
62
|
-
const agentDir = agentDirOverride?.trim() ? agentDirOverride.trim() :
|
|
62
|
+
const agentDir = agentDirOverride?.trim() ? agentDirOverride.trim() : resolvePoolbotAgentDir();
|
|
63
63
|
const explicitProviders = (cfg.models?.providers ?? {});
|
|
64
64
|
const implicitProviders = await resolveImplicitProviders({ agentDir });
|
|
65
65
|
const providers = mergeProviders({
|