@poolzin/pool-bot 2026.1.39 → 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 +93 -5
- package/dist/agents/tools/web-search.js +1 -1
- 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/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-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.memory.js +1 -0
- package/dist/config/version.js +4 -4
- package/dist/daemon/constants.js +7 -7
- package/dist/daemon/inspect.js +6 -6
- package/dist/daemon/systemd-unit.js +1 -1
- 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 -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/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/manager.js +1 -0
- 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/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 -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,3 +1,4 @@
|
|
|
1
|
+
import { QIANFAN_BASE_URL, QIANFAN_DEFAULT_MODEL_ID } from "../agents/models-config.providers.js";
|
|
1
2
|
export const DEFAULT_MINIMAX_BASE_URL = "https://api.minimax.io/v1";
|
|
2
3
|
export const MINIMAX_API_BASE_URL = "https://api.minimax.io/anthropic";
|
|
3
4
|
export const MINIMAX_HOSTED_MODEL_ID = "MiniMax-M2.1";
|
|
@@ -5,17 +6,15 @@ export const MINIMAX_HOSTED_MODEL_REF = `minimax/${MINIMAX_HOSTED_MODEL_ID}`;
|
|
|
5
6
|
export const DEFAULT_MINIMAX_CONTEXT_WINDOW = 200000;
|
|
6
7
|
export const DEFAULT_MINIMAX_MAX_TOKENS = 8192;
|
|
7
8
|
export const MOONSHOT_BASE_URL = "https://api.moonshot.ai/v1";
|
|
8
|
-
export const
|
|
9
|
+
export const MOONSHOT_CN_BASE_URL = "https://api.moonshot.cn/v1";
|
|
10
|
+
export const MOONSHOT_DEFAULT_MODEL_ID = "kimi-k2.5";
|
|
9
11
|
export const MOONSHOT_DEFAULT_MODEL_REF = `moonshot/${MOONSHOT_DEFAULT_MODEL_ID}`;
|
|
10
12
|
export const MOONSHOT_DEFAULT_CONTEXT_WINDOW = 256000;
|
|
11
13
|
export const MOONSHOT_DEFAULT_MAX_TOKENS = 8192;
|
|
12
|
-
export const
|
|
13
|
-
export const
|
|
14
|
-
export
|
|
15
|
-
export const
|
|
16
|
-
export const KIMI_CODE_MAX_TOKENS = 32768;
|
|
17
|
-
export const KIMI_CODE_HEADERS = { "User-Agent": "KimiCLI/0.77" };
|
|
18
|
-
export const KIMI_CODE_COMPAT = { supportsDeveloperRole: false };
|
|
14
|
+
export const KIMI_CODING_MODEL_ID = "k2p5";
|
|
15
|
+
export const KIMI_CODING_MODEL_REF = `kimi-coding/${KIMI_CODING_MODEL_ID}`;
|
|
16
|
+
export { QIANFAN_BASE_URL, QIANFAN_DEFAULT_MODEL_ID };
|
|
17
|
+
export const QIANFAN_DEFAULT_MODEL_REF = `qianfan/${QIANFAN_DEFAULT_MODEL_ID}`;
|
|
19
18
|
// Pricing: MiniMax doesn't publish public rates. Override in models.json for accurate costs.
|
|
20
19
|
export const MINIMAX_API_COST = {
|
|
21
20
|
input: 15,
|
|
@@ -41,12 +40,6 @@ export const MOONSHOT_DEFAULT_COST = {
|
|
|
41
40
|
cacheRead: 0,
|
|
42
41
|
cacheWrite: 0,
|
|
43
42
|
};
|
|
44
|
-
export const KIMI_CODE_DEFAULT_COST = {
|
|
45
|
-
input: 0,
|
|
46
|
-
output: 0,
|
|
47
|
-
cacheRead: 0,
|
|
48
|
-
cacheWrite: 0,
|
|
49
|
-
};
|
|
50
43
|
const MINIMAX_MODEL_CATALOG = {
|
|
51
44
|
"MiniMax-M2.1": { name: "MiniMax M2.1", reasoning: false },
|
|
52
45
|
"MiniMax-M2.1-lightning": {
|
|
@@ -77,7 +70,7 @@ export function buildMinimaxApiModelDefinition(modelId) {
|
|
|
77
70
|
export function buildMoonshotModelDefinition() {
|
|
78
71
|
return {
|
|
79
72
|
id: MOONSHOT_DEFAULT_MODEL_ID,
|
|
80
|
-
name: "Kimi K2
|
|
73
|
+
name: "Kimi K2.5",
|
|
81
74
|
reasoning: false,
|
|
82
75
|
input: ["text"],
|
|
83
76
|
cost: MOONSHOT_DEFAULT_COST,
|
|
@@ -85,16 +78,25 @@ export function buildMoonshotModelDefinition() {
|
|
|
85
78
|
maxTokens: MOONSHOT_DEFAULT_MAX_TOKENS,
|
|
86
79
|
};
|
|
87
80
|
}
|
|
88
|
-
export
|
|
81
|
+
export const XAI_BASE_URL = "https://api.x.ai/v1";
|
|
82
|
+
export const XAI_DEFAULT_MODEL_ID = "grok-4";
|
|
83
|
+
export const XAI_DEFAULT_MODEL_REF = `xai/${XAI_DEFAULT_MODEL_ID}`;
|
|
84
|
+
export const XAI_DEFAULT_CONTEXT_WINDOW = 131072;
|
|
85
|
+
export const XAI_DEFAULT_MAX_TOKENS = 8192;
|
|
86
|
+
export const XAI_DEFAULT_COST = {
|
|
87
|
+
input: 0,
|
|
88
|
+
output: 0,
|
|
89
|
+
cacheRead: 0,
|
|
90
|
+
cacheWrite: 0,
|
|
91
|
+
};
|
|
92
|
+
export function buildXaiModelDefinition() {
|
|
89
93
|
return {
|
|
90
|
-
id:
|
|
91
|
-
name: "
|
|
92
|
-
reasoning:
|
|
94
|
+
id: XAI_DEFAULT_MODEL_ID,
|
|
95
|
+
name: "Grok 4",
|
|
96
|
+
reasoning: false,
|
|
93
97
|
input: ["text"],
|
|
94
|
-
cost:
|
|
95
|
-
contextWindow:
|
|
96
|
-
maxTokens:
|
|
97
|
-
headers: KIMI_CODE_HEADERS,
|
|
98
|
-
compat: KIMI_CODE_COMPAT,
|
|
98
|
+
cost: XAI_DEFAULT_COST,
|
|
99
|
+
contextWindow: XAI_DEFAULT_CONTEXT_WINDOW,
|
|
100
|
+
maxTokens: XAI_DEFAULT_MAX_TOKENS,
|
|
99
101
|
};
|
|
100
102
|
}
|
|
@@ -4,7 +4,7 @@ import { parseDurationMs } from "../../../cli/parse-duration.js";
|
|
|
4
4
|
import { upsertSharedEnvVar } from "../../../infra/env-file.js";
|
|
5
5
|
import { buildTokenProfileId, validateAnthropicSetupToken } from "../../auth-token.js";
|
|
6
6
|
import { applyGoogleGeminiModelDefault } from "../../google-gemini-model-default.js";
|
|
7
|
-
import { applyAuthProfileConfig, applyKimiCodeConfig, applyMinimaxApiConfig, applyMinimaxConfig, applyMoonshotConfig, applyOpencodeZenConfig, applyOpenrouterConfig, applySyntheticConfig, applyVeniceConfig, applyVercelAiGatewayConfig, applyZaiConfig, setAnthropicApiKey, setGeminiApiKey,
|
|
7
|
+
import { applyAuthProfileConfig, applyCloudflareAiGatewayConfig, applyKimiCodeConfig, applyMinimaxApiConfig, applyMinimaxConfig, applyMoonshotConfig, applyMoonshotConfigCn, applyOpencodeZenConfig, applyOpenrouterConfig, applyQianfanConfig, applySyntheticConfig, applyTogetherConfig, applyVeniceConfig, applyVercelAiGatewayConfig, applyXaiConfig, applyXiaomiConfig, applyZaiConfig, setAnthropicApiKey, setCloudflareAiGatewayConfig, setGeminiApiKey, setKimiCodingApiKey, setMinimaxApiKey, setMoonshotApiKey, setOpencodeZenApiKey, setOpenrouterApiKey, setQianfanApiKey, setSyntheticApiKey, setTogetherApiKey, setVeniceApiKey, setVercelAiGatewayApiKey, setXaiApiKey, setXiaomiApiKey, setZaiApiKey, } from "../../onboard-auth.js";
|
|
8
8
|
import { resolveNonInteractiveApiKey } from "../api-keys.js";
|
|
9
9
|
import { shortenHomePath } from "../../../utils.js";
|
|
10
10
|
export async function applyNonInteractiveAuthChoice(params) {
|
|
@@ -216,22 +216,42 @@ export async function applyNonInteractiveAuthChoice(params) {
|
|
|
216
216
|
});
|
|
217
217
|
return applyMoonshotConfig(nextConfig);
|
|
218
218
|
}
|
|
219
|
+
if (authChoice === "moonshot-api-key-cn") {
|
|
220
|
+
const resolved = await resolveNonInteractiveApiKey({
|
|
221
|
+
provider: "moonshot",
|
|
222
|
+
cfg: baseConfig,
|
|
223
|
+
flagValue: opts.moonshotApiKey,
|
|
224
|
+
flagName: "--moonshot-api-key",
|
|
225
|
+
envVar: "MOONSHOT_API_KEY",
|
|
226
|
+
runtime,
|
|
227
|
+
});
|
|
228
|
+
if (!resolved)
|
|
229
|
+
return null;
|
|
230
|
+
if (resolved.source !== "profile")
|
|
231
|
+
await setMoonshotApiKey(resolved.key);
|
|
232
|
+
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
233
|
+
profileId: "moonshot:default",
|
|
234
|
+
provider: "moonshot",
|
|
235
|
+
mode: "api_key",
|
|
236
|
+
});
|
|
237
|
+
return applyMoonshotConfigCn(nextConfig);
|
|
238
|
+
}
|
|
219
239
|
if (authChoice === "kimi-code-api-key") {
|
|
220
240
|
const resolved = await resolveNonInteractiveApiKey({
|
|
221
|
-
provider: "kimi-
|
|
241
|
+
provider: "kimi-coding",
|
|
222
242
|
cfg: baseConfig,
|
|
223
243
|
flagValue: opts.kimiCodeApiKey,
|
|
224
244
|
flagName: "--kimi-code-api-key",
|
|
225
|
-
envVar: "
|
|
245
|
+
envVar: "KIMI_API_KEY",
|
|
226
246
|
runtime,
|
|
227
247
|
});
|
|
228
248
|
if (!resolved)
|
|
229
249
|
return null;
|
|
230
250
|
if (resolved.source !== "profile")
|
|
231
|
-
await
|
|
251
|
+
await setKimiCodingApiKey(resolved.key);
|
|
232
252
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
233
|
-
profileId: "kimi-
|
|
234
|
-
provider: "kimi-
|
|
253
|
+
profileId: "kimi-coding:default",
|
|
254
|
+
provider: "kimi-coding",
|
|
235
255
|
mode: "api_key",
|
|
236
256
|
});
|
|
237
257
|
return applyKimiCodeConfig(nextConfig);
|
|
@@ -276,6 +296,120 @@ export async function applyNonInteractiveAuthChoice(params) {
|
|
|
276
296
|
});
|
|
277
297
|
return applyVeniceConfig(nextConfig);
|
|
278
298
|
}
|
|
299
|
+
if (authChoice === "xiaomi-api-key") {
|
|
300
|
+
const resolved = await resolveNonInteractiveApiKey({
|
|
301
|
+
provider: "xiaomi",
|
|
302
|
+
cfg: baseConfig,
|
|
303
|
+
flagValue: opts.xiaomiApiKey,
|
|
304
|
+
flagName: "--xiaomi-api-key",
|
|
305
|
+
envVar: "XIAOMI_API_KEY",
|
|
306
|
+
runtime,
|
|
307
|
+
});
|
|
308
|
+
if (!resolved)
|
|
309
|
+
return null;
|
|
310
|
+
if (resolved.source !== "profile")
|
|
311
|
+
await setXiaomiApiKey(resolved.key);
|
|
312
|
+
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
313
|
+
profileId: "xiaomi:default",
|
|
314
|
+
provider: "xiaomi",
|
|
315
|
+
mode: "api_key",
|
|
316
|
+
});
|
|
317
|
+
return applyXiaomiConfig(nextConfig);
|
|
318
|
+
}
|
|
319
|
+
if (authChoice === "xai-api-key") {
|
|
320
|
+
const resolved = await resolveNonInteractiveApiKey({
|
|
321
|
+
provider: "xai",
|
|
322
|
+
cfg: baseConfig,
|
|
323
|
+
flagValue: opts.xaiApiKey,
|
|
324
|
+
flagName: "--xai-api-key",
|
|
325
|
+
envVar: "XAI_API_KEY",
|
|
326
|
+
runtime,
|
|
327
|
+
});
|
|
328
|
+
if (!resolved)
|
|
329
|
+
return null;
|
|
330
|
+
if (resolved.source !== "profile")
|
|
331
|
+
setXaiApiKey(resolved.key);
|
|
332
|
+
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
333
|
+
profileId: "xai:default",
|
|
334
|
+
provider: "xai",
|
|
335
|
+
mode: "api_key",
|
|
336
|
+
});
|
|
337
|
+
return applyXaiConfig(nextConfig);
|
|
338
|
+
}
|
|
339
|
+
if (authChoice === "qianfan-api-key") {
|
|
340
|
+
const resolved = await resolveNonInteractiveApiKey({
|
|
341
|
+
provider: "qianfan",
|
|
342
|
+
cfg: baseConfig,
|
|
343
|
+
flagValue: opts.qianfanApiKey,
|
|
344
|
+
flagName: "--qianfan-api-key",
|
|
345
|
+
envVar: "QIANFAN_API_KEY",
|
|
346
|
+
runtime,
|
|
347
|
+
});
|
|
348
|
+
if (!resolved)
|
|
349
|
+
return null;
|
|
350
|
+
if (resolved.source !== "profile")
|
|
351
|
+
setQianfanApiKey(resolved.key);
|
|
352
|
+
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
353
|
+
profileId: "qianfan:default",
|
|
354
|
+
provider: "qianfan",
|
|
355
|
+
mode: "api_key",
|
|
356
|
+
});
|
|
357
|
+
return applyQianfanConfig(nextConfig);
|
|
358
|
+
}
|
|
359
|
+
if (authChoice === "cloudflare-ai-gateway-api-key") {
|
|
360
|
+
const accountId = opts.cloudflareAiGatewayAccountId?.trim() ?? "";
|
|
361
|
+
const gatewayId = opts.cloudflareAiGatewayGatewayId?.trim() ?? "";
|
|
362
|
+
if (!accountId || !gatewayId) {
|
|
363
|
+
runtime.error([
|
|
364
|
+
'Auth choice "cloudflare-ai-gateway-api-key" requires Account ID and Gateway ID.',
|
|
365
|
+
"Use --cloudflare-ai-gateway-account-id and --cloudflare-ai-gateway-gateway-id.",
|
|
366
|
+
].join("\n"));
|
|
367
|
+
runtime.exit(1);
|
|
368
|
+
return null;
|
|
369
|
+
}
|
|
370
|
+
const resolved = await resolveNonInteractiveApiKey({
|
|
371
|
+
provider: "cloudflare-ai-gateway",
|
|
372
|
+
cfg: baseConfig,
|
|
373
|
+
flagValue: opts.cloudflareAiGatewayApiKey,
|
|
374
|
+
flagName: "--cloudflare-ai-gateway-api-key",
|
|
375
|
+
envVar: "CLOUDFLARE_AI_GATEWAY_API_KEY",
|
|
376
|
+
runtime,
|
|
377
|
+
});
|
|
378
|
+
if (!resolved)
|
|
379
|
+
return null;
|
|
380
|
+
if (resolved.source !== "profile") {
|
|
381
|
+
await setCloudflareAiGatewayConfig(accountId, gatewayId, resolved.key);
|
|
382
|
+
}
|
|
383
|
+
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
384
|
+
profileId: "cloudflare-ai-gateway:default",
|
|
385
|
+
provider: "cloudflare-ai-gateway",
|
|
386
|
+
mode: "api_key",
|
|
387
|
+
});
|
|
388
|
+
return applyCloudflareAiGatewayConfig(nextConfig, {
|
|
389
|
+
accountId,
|
|
390
|
+
gatewayId,
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
if (authChoice === "together-api-key") {
|
|
394
|
+
const resolved = await resolveNonInteractiveApiKey({
|
|
395
|
+
provider: "together",
|
|
396
|
+
cfg: baseConfig,
|
|
397
|
+
flagValue: opts.togetherApiKey,
|
|
398
|
+
flagName: "--together-api-key",
|
|
399
|
+
envVar: "TOGETHER_API_KEY",
|
|
400
|
+
runtime,
|
|
401
|
+
});
|
|
402
|
+
if (!resolved)
|
|
403
|
+
return null;
|
|
404
|
+
if (resolved.source !== "profile")
|
|
405
|
+
await setTogetherApiKey(resolved.key);
|
|
406
|
+
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
407
|
+
profileId: "together:default",
|
|
408
|
+
provider: "together",
|
|
409
|
+
mode: "api_key",
|
|
410
|
+
});
|
|
411
|
+
return applyTogetherConfig(nextConfig);
|
|
412
|
+
}
|
|
279
413
|
if (authChoice === "minimax-cloud" ||
|
|
280
414
|
authChoice === "minimax-api" ||
|
|
281
415
|
authChoice === "minimax-api-lightning") {
|
|
@@ -88,7 +88,7 @@ export async function buildStatusAllReportLines(params) {
|
|
|
88
88
|
rows: agentRows,
|
|
89
89
|
});
|
|
90
90
|
const lines = [];
|
|
91
|
-
lines.push(heading("
|
|
91
|
+
lines.push(heading("Poolbot status --all"));
|
|
92
92
|
lines.push("");
|
|
93
93
|
lines.push(heading("Overview"));
|
|
94
94
|
lines.push(overview.trimEnd());
|
|
@@ -271,7 +271,7 @@ export async function statusCommand(opts, runtime) {
|
|
|
271
271
|
Value: `${summary.sessions.count} active · default ${defaults.model ?? "unknown"}${defaultCtx} · ${storeLabel}`,
|
|
272
272
|
},
|
|
273
273
|
];
|
|
274
|
-
runtime.log(theme.heading("
|
|
274
|
+
runtime.log(theme.heading("Poolbot status"));
|
|
275
275
|
runtime.log("");
|
|
276
276
|
runtime.log(theme.heading("Overview"));
|
|
277
277
|
runtime.log(renderTable({
|
|
@@ -59,9 +59,9 @@ async function stopAndUninstallService(runtime) {
|
|
|
59
59
|
async function removeMacApp(runtime, dryRun) {
|
|
60
60
|
if (process.platform !== "darwin")
|
|
61
61
|
return;
|
|
62
|
-
await removePath("/Applications/
|
|
62
|
+
await removePath("/Applications/Poolbot.app", runtime, {
|
|
63
63
|
dryRun,
|
|
64
|
-
label: "/Applications/
|
|
64
|
+
label: "/Applications/Poolbot.app",
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
export async function uninstallCommand(runtime, opts) {
|
|
@@ -91,7 +91,7 @@ export async function uninstallCommand(runtime, opts) {
|
|
|
91
91
|
{
|
|
92
92
|
value: "app",
|
|
93
93
|
label: "macOS app",
|
|
94
|
-
hint: "/Applications/
|
|
94
|
+
hint: "/Applications/Poolbot.app",
|
|
95
95
|
},
|
|
96
96
|
],
|
|
97
97
|
initialValues: ["service", "state", "workspace"],
|
|
@@ -2,4 +2,4 @@ export const LEGACY_PROJECT_NAME = "poolbot";
|
|
|
2
2
|
export const LEGACY_MANIFEST_KEY = LEGACY_PROJECT_NAME;
|
|
3
3
|
export const LEGACY_PLUGIN_MANIFEST_FILENAME = `${LEGACY_PROJECT_NAME}.plugin.json`;
|
|
4
4
|
export const LEGACY_CANVAS_HANDLER_NAME = `${LEGACY_PROJECT_NAME}CanvasA2UIAction`;
|
|
5
|
-
export const LEGACY_MACOS_APP_SOURCES_DIR = "apps/macos/Sources/
|
|
5
|
+
export const LEGACY_MACOS_APP_SOURCES_DIR = "apps/macos/Sources/Pool-Bot";
|
package/dist/config/io.js
CHANGED
|
@@ -15,7 +15,7 @@ import { normalizeConfigPaths } from "./normalize-paths.js";
|
|
|
15
15
|
import { resolveConfigPath, resolveDefaultConfigCandidates, resolveStateDir } from "./paths.js";
|
|
16
16
|
import { applyConfigOverrides } from "./runtime-overrides.js";
|
|
17
17
|
import { validateConfigObjectWithPlugins } from "./validation.js";
|
|
18
|
-
import {
|
|
18
|
+
import { comparePoolbotVersions } from "./version.js";
|
|
19
19
|
// Re-export for backwards compatibility
|
|
20
20
|
export { CircularIncludeError, ConfigIncludeError } from "./includes.js";
|
|
21
21
|
export { MissingEnvVarError } from "./env-substitution.js";
|
|
@@ -103,11 +103,11 @@ function warnIfConfigFromFuture(cfg, logger) {
|
|
|
103
103
|
const touched = cfg.meta?.lastTouchedVersion;
|
|
104
104
|
if (!touched)
|
|
105
105
|
return;
|
|
106
|
-
const cmp =
|
|
106
|
+
const cmp = comparePoolbotVersions(VERSION, touched);
|
|
107
107
|
if (cmp === null)
|
|
108
108
|
return;
|
|
109
109
|
if (cmp < 0) {
|
|
110
|
-
logger.warn(`Config was last written by a newer
|
|
110
|
+
logger.warn(`Config was last written by a newer Poolbot (${touched}); current version is ${VERSION}.`);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
function applyConfigEnv(cfg, env) {
|
package/dist/config/schema.js
CHANGED
|
@@ -315,7 +315,7 @@ const FIELD_LABELS = {
|
|
|
315
315
|
"plugins.installs.*.installedAt": "Plugin Install Time",
|
|
316
316
|
};
|
|
317
317
|
const FIELD_HELP = {
|
|
318
|
-
"meta.lastTouchedVersion": "Auto-set when
|
|
318
|
+
"meta.lastTouchedVersion": "Auto-set when Poolbot writes the config.",
|
|
319
319
|
"meta.lastTouchedAt": "ISO timestamp of the last config write (auto-set).",
|
|
320
320
|
"update.channel": 'Update channel for git + npm installs ("stable", "beta", or "dev").',
|
|
321
321
|
"update.checkOnStart": "Check for npm updates when the gateway starts (default: true).",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/config/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const VERSION_RE = /^v?(\d+)\.(\d+)\.(\d+)(?:-(\d+))?/;
|
|
2
|
-
export function
|
|
2
|
+
export function parsePoolbotVersion(raw) {
|
|
3
3
|
if (!raw)
|
|
4
4
|
return null;
|
|
5
5
|
const match = raw.trim().match(VERSION_RE);
|
|
@@ -13,9 +13,9 @@ export function parseMoltbotVersion(raw) {
|
|
|
13
13
|
revision: revision ? Number.parseInt(revision, 10) : 0,
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
export function
|
|
17
|
-
const parsedA =
|
|
18
|
-
const parsedB =
|
|
16
|
+
export function comparePoolbotVersions(a, b) {
|
|
17
|
+
const parsedA = parsePoolbotVersion(a);
|
|
18
|
+
const parsedB = parsePoolbotVersion(b);
|
|
19
19
|
if (!parsedA || !parsedB)
|
|
20
20
|
return null;
|
|
21
21
|
if (parsedA.major !== parsedB.major)
|
package/dist/daemon/constants.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Default service labels (for backward compatibility and when no profile specified)
|
|
2
2
|
export const GATEWAY_LAUNCH_AGENT_LABEL = "com.poolbot.gateway";
|
|
3
3
|
export const GATEWAY_SYSTEMD_SERVICE_NAME = "poolbot-gateway";
|
|
4
|
-
export const GATEWAY_WINDOWS_TASK_NAME = "
|
|
4
|
+
export const GATEWAY_WINDOWS_TASK_NAME = "Poolbot Gateway";
|
|
5
5
|
export const GATEWAY_SERVICE_MARKER = "poolbot";
|
|
6
6
|
export const GATEWAY_SERVICE_KIND = "gateway";
|
|
7
7
|
export const NODE_LAUNCH_AGENT_LABEL = "com.poolbot.node";
|
|
8
8
|
export const NODE_SYSTEMD_SERVICE_NAME = "poolbot-node";
|
|
9
|
-
export const NODE_WINDOWS_TASK_NAME = "
|
|
9
|
+
export const NODE_WINDOWS_TASK_NAME = "Poolbot Node";
|
|
10
10
|
export const NODE_SERVICE_MARKER = "poolbot";
|
|
11
11
|
export const NODE_SERVICE_KIND = "node";
|
|
12
12
|
export const NODE_WINDOWS_TASK_SCRIPT_NAME = "node.cmd";
|
|
@@ -40,7 +40,7 @@ export function resolveGatewayWindowsTaskName(profile) {
|
|
|
40
40
|
const normalized = normalizeGatewayProfile(profile);
|
|
41
41
|
if (!normalized)
|
|
42
42
|
return GATEWAY_WINDOWS_TASK_NAME;
|
|
43
|
-
return `
|
|
43
|
+
return `Poolbot Gateway (${normalized})`;
|
|
44
44
|
}
|
|
45
45
|
export function formatGatewayServiceDescription(params) {
|
|
46
46
|
const profile = normalizeGatewayProfile(params?.profile);
|
|
@@ -51,8 +51,8 @@ export function formatGatewayServiceDescription(params) {
|
|
|
51
51
|
if (version)
|
|
52
52
|
parts.push(`v${version}`);
|
|
53
53
|
if (parts.length === 0)
|
|
54
|
-
return "
|
|
55
|
-
return `
|
|
54
|
+
return "Poolbot Gateway";
|
|
55
|
+
return `Poolbot Gateway (${parts.join(", ")})`;
|
|
56
56
|
}
|
|
57
57
|
export function resolveNodeLaunchAgentLabel() {
|
|
58
58
|
return NODE_LAUNCH_AGENT_LABEL;
|
|
@@ -66,6 +66,6 @@ export function resolveNodeWindowsTaskName() {
|
|
|
66
66
|
export function formatNodeServiceDescription(params) {
|
|
67
67
|
const version = params?.version?.trim();
|
|
68
68
|
if (!version)
|
|
69
|
-
return "
|
|
70
|
-
return `
|
|
69
|
+
return "Poolbot Node Host";
|
|
70
|
+
return `Poolbot Node Host (v${version})`;
|
|
71
71
|
}
|
package/dist/daemon/inspect.js
CHANGED
|
@@ -44,7 +44,7 @@ function hasGatewayServiceMarker(content) {
|
|
|
44
44
|
lower.includes("poolbot_service_kind") &&
|
|
45
45
|
lower.includes(GATEWAY_SERVICE_KIND.toLowerCase()));
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function isPoolbotGatewayLaunchdService(label, contents) {
|
|
48
48
|
if (hasGatewayServiceMarker(contents))
|
|
49
49
|
return true;
|
|
50
50
|
const lowerContents = contents.toLowerCase();
|
|
@@ -52,14 +52,14 @@ function isMoltbotGatewayLaunchdService(label, contents) {
|
|
|
52
52
|
return false;
|
|
53
53
|
return label.startsWith("com.poolbot.");
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function isPoolbotGatewaySystemdService(name, contents) {
|
|
56
56
|
if (hasGatewayServiceMarker(contents))
|
|
57
57
|
return true;
|
|
58
58
|
if (!name.startsWith("poolbot-gateway"))
|
|
59
59
|
return false;
|
|
60
60
|
return contents.toLowerCase().includes("gateway");
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function isPoolbotGatewayTaskName(name) {
|
|
63
63
|
const normalized = name.trim().toLowerCase();
|
|
64
64
|
if (!normalized)
|
|
65
65
|
return false;
|
|
@@ -107,7 +107,7 @@ async function scanLaunchdDir(params) {
|
|
|
107
107
|
const label = tryExtractPlistLabel(contents) ?? labelFromName;
|
|
108
108
|
if (isIgnoredLaunchdLabel(label))
|
|
109
109
|
continue;
|
|
110
|
-
if (
|
|
110
|
+
if (isPoolbotGatewayLaunchdService(label, contents))
|
|
111
111
|
continue;
|
|
112
112
|
results.push({
|
|
113
113
|
platform: "darwin",
|
|
@@ -143,7 +143,7 @@ async function scanSystemdDir(params) {
|
|
|
143
143
|
}
|
|
144
144
|
if (!containsMarker(contents))
|
|
145
145
|
continue;
|
|
146
|
-
if (
|
|
146
|
+
if (isPoolbotGatewaySystemdService(name, contents))
|
|
147
147
|
continue;
|
|
148
148
|
results.push({
|
|
149
149
|
platform: "linux",
|
|
@@ -291,7 +291,7 @@ export async function findExtraGatewayServices(env, opts = {}) {
|
|
|
291
291
|
const name = task.name.trim();
|
|
292
292
|
if (!name)
|
|
293
293
|
continue;
|
|
294
|
-
if (
|
|
294
|
+
if (isPoolbotGatewayTaskName(name))
|
|
295
295
|
continue;
|
|
296
296
|
if (LEGACY_GATEWAY_WINDOWS_TASK_NAMES.includes(name))
|
|
297
297
|
continue;
|
|
@@ -13,7 +13,7 @@ function renderEnvLines(env) {
|
|
|
13
13
|
}
|
|
14
14
|
export function buildSystemdUnit({ description, programArguments, workingDirectory, environment, }) {
|
|
15
15
|
const execStart = programArguments.map(systemdEscapeArg).join(" ");
|
|
16
|
-
const descriptionLine = `Description=${description?.trim() || "
|
|
16
|
+
const descriptionLine = `Description=${description?.trim() || "Poolbot Gateway"}`;
|
|
17
17
|
const workingDirLine = workingDirectory
|
|
18
18
|
? `WorkingDirectory=${systemdEscapeArg(workingDirectory)}`
|
|
19
19
|
: null;
|
|
@@ -1,69 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const CRC_TABLE = (() => {
|
|
3
|
-
const table = new Uint32Array(256);
|
|
4
|
-
for (let i = 0; i < 256; i += 1) {
|
|
5
|
-
let c = i;
|
|
6
|
-
for (let k = 0; k < 8; k += 1) {
|
|
7
|
-
c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
|
|
8
|
-
}
|
|
9
|
-
table[i] = c >>> 0;
|
|
10
|
-
}
|
|
11
|
-
return table;
|
|
12
|
-
})();
|
|
13
|
-
function crc32(buf) {
|
|
14
|
-
let crc = 0xffffffff;
|
|
15
|
-
for (let i = 0; i < buf.length; i += 1) {
|
|
16
|
-
crc = CRC_TABLE[(crc ^ buf[i]) & 0xff] ^ (crc >>> 8);
|
|
17
|
-
}
|
|
18
|
-
return (crc ^ 0xffffffff) >>> 0;
|
|
19
|
-
}
|
|
20
|
-
function pngChunk(type, data) {
|
|
21
|
-
const typeBuf = Buffer.from(type, "ascii");
|
|
22
|
-
const len = Buffer.alloc(4);
|
|
23
|
-
len.writeUInt32BE(data.length, 0);
|
|
24
|
-
const crc = crc32(Buffer.concat([typeBuf, data]));
|
|
25
|
-
const crcBuf = Buffer.alloc(4);
|
|
26
|
-
crcBuf.writeUInt32BE(crc, 0);
|
|
27
|
-
return Buffer.concat([len, typeBuf, data, crcBuf]);
|
|
28
|
-
}
|
|
29
|
-
function encodePngRgba(buffer, width, height) {
|
|
30
|
-
const stride = width * 4;
|
|
31
|
-
const raw = Buffer.alloc((stride + 1) * height);
|
|
32
|
-
for (let row = 0; row < height; row += 1) {
|
|
33
|
-
const rawOffset = row * (stride + 1);
|
|
34
|
-
raw[rawOffset] = 0; // filter: none
|
|
35
|
-
buffer.copy(raw, rawOffset + 1, row * stride, row * stride + stride);
|
|
36
|
-
}
|
|
37
|
-
const compressed = deflateSync(raw);
|
|
38
|
-
const signature = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
|
|
39
|
-
const ihdr = Buffer.alloc(13);
|
|
40
|
-
ihdr.writeUInt32BE(width, 0);
|
|
41
|
-
ihdr.writeUInt32BE(height, 4);
|
|
42
|
-
ihdr[8] = 8; // bit depth
|
|
43
|
-
ihdr[9] = 6; // color type RGBA
|
|
44
|
-
ihdr[10] = 0; // compression
|
|
45
|
-
ihdr[11] = 0; // filter
|
|
46
|
-
ihdr[12] = 0; // interlace
|
|
47
|
-
return Buffer.concat([
|
|
48
|
-
signature,
|
|
49
|
-
pngChunk("IHDR", ihdr),
|
|
50
|
-
pngChunk("IDAT", compressed),
|
|
51
|
-
pngChunk("IEND", Buffer.alloc(0)),
|
|
52
|
-
]);
|
|
53
|
-
}
|
|
54
|
-
function fillPixel(buf, x, y, width, r, g, b, a = 255) {
|
|
55
|
-
if (x < 0 || y < 0)
|
|
56
|
-
return;
|
|
57
|
-
if (x >= width)
|
|
58
|
-
return;
|
|
59
|
-
const idx = (y * width + x) * 4;
|
|
60
|
-
if (idx < 0 || idx + 3 >= buf.length)
|
|
61
|
-
return;
|
|
62
|
-
buf[idx] = r;
|
|
63
|
-
buf[idx + 1] = g;
|
|
64
|
-
buf[idx + 2] = b;
|
|
65
|
-
buf[idx + 3] = a;
|
|
66
|
-
}
|
|
1
|
+
import { encodePngRgba, fillPixel } from "../media/png-encode.js";
|
|
67
2
|
const GLYPH_ROWS_5X7 = {
|
|
68
3
|
"0": [0b01110, 0b10001, 0b10011, 0b10101, 0b11001, 0b10001, 0b01110],
|
|
69
4
|
"1": [0b00100, 0b01100, 0b00100, 0b00100, 0b00100, 0b00100, 0b01110],
|
|
@@ -167,7 +167,7 @@ export async function handleOpenAiHttpRequest(req, res, opts) {
|
|
|
167
167
|
.map((p) => (typeof p.text === "string" ? p.text : ""))
|
|
168
168
|
.filter(Boolean)
|
|
169
169
|
.join("\n\n")
|
|
170
|
-
: "No response from
|
|
170
|
+
: "No response from Poolbot.";
|
|
171
171
|
sendJson(res, 200, {
|
|
172
172
|
id: runId,
|
|
173
173
|
object: "chat.completion",
|
|
@@ -275,7 +275,7 @@ export async function handleOpenAiHttpRequest(req, res, opts) {
|
|
|
275
275
|
.map((p) => (typeof p.text === "string" ? p.text : ""))
|
|
276
276
|
.filter(Boolean)
|
|
277
277
|
.join("\n\n")
|
|
278
|
-
: "No response from
|
|
278
|
+
: "No response from Poolbot.";
|
|
279
279
|
sawAssistantDelta = true;
|
|
280
280
|
writeSse(res, {
|
|
281
281
|
id: runId,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OpenResponses HTTP Handler
|
|
3
3
|
*
|
|
4
|
-
* Implements the OpenResponses `/v1/responses` endpoint for
|
|
4
|
+
* Implements the OpenResponses `/v1/responses` endpoint for Poolbot Gateway.
|
|
5
5
|
*
|
|
6
6
|
* @see https://www.open-responses.com/
|
|
7
7
|
*/
|
|
@@ -405,7 +405,7 @@ export async function handleOpenResponsesHttpRequest(req, res, opts) {
|
|
|
405
405
|
.map((p) => (typeof p.text === "string" ? p.text : ""))
|
|
406
406
|
.filter(Boolean)
|
|
407
407
|
.join("\n\n")
|
|
408
|
-
: "No response from
|
|
408
|
+
: "No response from Poolbot.";
|
|
409
409
|
const response = createResponseResource({
|
|
410
410
|
id: responseId,
|
|
411
411
|
model,
|
|
@@ -543,7 +543,7 @@ export async function handleOpenResponsesHttpRequest(req, res, opts) {
|
|
|
543
543
|
if (evt.stream === "lifecycle") {
|
|
544
544
|
const phase = evt.data?.phase;
|
|
545
545
|
if (phase === "end" || phase === "error") {
|
|
546
|
-
const finalText = accumulatedText || "No response from
|
|
546
|
+
const finalText = accumulatedText || "No response from Poolbot.";
|
|
547
547
|
const finalStatus = phase === "error" ? "failed" : "completed";
|
|
548
548
|
requestFinalize(finalStatus, finalText);
|
|
549
549
|
}
|
|
@@ -647,7 +647,7 @@ export async function handleOpenResponsesHttpRequest(req, res, opts) {
|
|
|
647
647
|
.map((p) => (typeof p.text === "string" ? p.text : ""))
|
|
648
648
|
.filter(Boolean)
|
|
649
649
|
.join("\n\n")
|
|
650
|
-
: "No response from
|
|
650
|
+
: "No response from Poolbot.";
|
|
651
651
|
accumulatedText = content;
|
|
652
652
|
sawAssistantDelta = true;
|
|
653
653
|
writeSseEvent(res, {
|
|
@@ -5,10 +5,10 @@ import { runExec } from "../process/exec.js";
|
|
|
5
5
|
export function formatBonjourInstanceName(displayName) {
|
|
6
6
|
const trimmed = displayName.trim();
|
|
7
7
|
if (!trimmed)
|
|
8
|
-
return "
|
|
8
|
+
return "Poolbot";
|
|
9
9
|
if (/poolbot/i.test(trimmed))
|
|
10
10
|
return trimmed;
|
|
11
|
-
return `${trimmed} (
|
|
11
|
+
return `${trimmed} (Poolbot)`;
|
|
12
12
|
}
|
|
13
13
|
export function resolveBonjourCliPath(opts = {}) {
|
|
14
14
|
const env = opts.env ?? process.env;
|
|
@@ -36,7 +36,7 @@ export function createHooksRequestHandler(opts) {
|
|
|
36
36
|
if (fromQuery) {
|
|
37
37
|
logHooks.warn("Hook token provided via query parameter is deprecated for security reasons. " +
|
|
38
38
|
"Tokens in URLs appear in logs, browser history, and referrer headers. " +
|
|
39
|
-
"Use Authorization: Bearer <token> or X-
|
|
39
|
+
"Use Authorization: Bearer <token> or X-Poolbot-Token header instead.");
|
|
40
40
|
}
|
|
41
41
|
if (req.method !== "POST") {
|
|
42
42
|
res.statusCode = 405;
|
|
@@ -12,7 +12,7 @@ import { clearAgentRunContext, onAgentEvent } from "../infra/agent-events.js";
|
|
|
12
12
|
import { onHeartbeatEvent } from "../infra/heartbeat-events.js";
|
|
13
13
|
import { startHeartbeatRunner } from "../infra/heartbeat-runner.js";
|
|
14
14
|
import { getMachineDisplayName } from "../infra/machine-name.js";
|
|
15
|
-
import {
|
|
15
|
+
import { ensurePoolbotCliOnPath } from "../infra/path-env.js";
|
|
16
16
|
import { primeRemoteSkillsCache, refreshRemoteBinsForConnectedNodes, setSkillsRemoteRegistry, } from "../infra/skills-remote.js";
|
|
17
17
|
import { scheduleGatewayUpdateCheck } from "../infra/update-startup.js";
|
|
18
18
|
import { setGatewaySigusr1RestartPolicy } from "../infra/restart.js";
|
|
@@ -50,7 +50,7 @@ import { loadGatewayTlsRuntime } from "./server/tls.js";
|
|
|
50
50
|
import { createWizardSessionTracker } from "./server-wizard-sessions.js";
|
|
51
51
|
import { attachGatewayWsHandlers } from "./server-ws-runtime.js";
|
|
52
52
|
export { __resetModelCatalogCacheForTest } from "./server-model-catalog.js";
|
|
53
|
-
|
|
53
|
+
ensurePoolbotCliOnPath();
|
|
54
54
|
const log = createSubsystemLogger("gateway");
|
|
55
55
|
const logCanvas = log.child("canvas");
|
|
56
56
|
const logDiscovery = log.child("discovery");
|
|
@@ -52,7 +52,7 @@ function parseFrontmatterBool(value, fallback) {
|
|
|
52
52
|
const parsed = parseBooleanValue(value);
|
|
53
53
|
return parsed === undefined ? fallback : parsed;
|
|
54
54
|
}
|
|
55
|
-
export function
|
|
55
|
+
export function resolvePoolbotMetadata(frontmatter) {
|
|
56
56
|
const raw = getFrontmatterValue(frontmatter, "metadata");
|
|
57
57
|
if (!raw)
|
|
58
58
|
return undefined;
|