@poolzin/pool-bot 2026.3.22 → 2026.3.24

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.
Files changed (159) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/dist/.buildstamp +1 -1
  3. package/dist/acp/bindings-store.js +209 -0
  4. package/dist/acp/control-plane/runtime-cache.js +54 -0
  5. package/dist/acp/control-plane/runtime-options.js +215 -0
  6. package/dist/acp/control-plane/session-actor-queue.js +36 -0
  7. package/dist/acp/policy.js +52 -0
  8. package/dist/acp/runtime/errors.js +47 -0
  9. package/dist/acp/runtime/registry.js +86 -0
  10. package/dist/acp/runtime/types.js +1 -0
  11. package/dist/acp/translator.js +97 -0
  12. package/dist/agents/btw.js +280 -0
  13. package/dist/agents/failover-error.js +145 -47
  14. package/dist/agents/fast-mode.js +24 -0
  15. package/dist/agents/live-model-errors.js +23 -0
  16. package/dist/agents/model-auth-env-vars.js +44 -0
  17. package/dist/agents/model-auth-markers.js +69 -0
  18. package/dist/agents/models-config.providers.discovery.js +180 -0
  19. package/dist/agents/models-config.providers.static.js +480 -0
  20. package/dist/auto-reply/reply/typing-policy.js +15 -0
  21. package/dist/browser/browser-profile-manager.js +319 -0
  22. package/dist/browser/cdp-proxy-bypass.js +129 -0
  23. package/dist/browser/cdp-timeouts.js +41 -0
  24. package/dist/browser/chrome-extension-validator.js +406 -0
  25. package/dist/browser/chrome-mcp-snapshot.js +222 -0
  26. package/dist/browser/chrome-mcp.js +421 -0
  27. package/dist/browser/chrome-mcp.snapshot.js +133 -0
  28. package/dist/browser/errors.js +67 -0
  29. package/dist/browser/form-fields.js +22 -0
  30. package/dist/browser/output-atomic.js +44 -0
  31. package/dist/browser/profile-capabilities.js +47 -0
  32. package/dist/browser/safe-filename.js +25 -0
  33. package/dist/browser/snapshot-roles.js +60 -0
  34. package/dist/build-info.json +3 -3
  35. package/dist/channels/account-snapshot-fields.js +176 -0
  36. package/dist/channels/draft-stream-controls.js +89 -0
  37. package/dist/channels/inbound-debounce-policy.js +28 -0
  38. package/dist/channels/typing-lifecycle.js +39 -0
  39. package/dist/cli/program/command-registry.js +52 -0
  40. package/dist/commands/agent-binding.js +123 -0
  41. package/dist/commands/agents.commands.bind.js +280 -0
  42. package/dist/commands/backup-shared.js +186 -0
  43. package/dist/commands/backup-verify.js +236 -0
  44. package/dist/commands/backup.js +166 -0
  45. package/dist/commands/channel-account-context.js +15 -0
  46. package/dist/commands/channel-account.js +190 -0
  47. package/dist/commands/gateway-install-token.js +117 -0
  48. package/dist/commands/oauth-tls-preflight.js +121 -0
  49. package/dist/commands/ollama-setup.js +402 -0
  50. package/dist/commands/security-owner-only.js +86 -0
  51. package/dist/commands/self-hosted-provider-setup.js +207 -0
  52. package/dist/commands/session-store-targets.js +12 -0
  53. package/dist/commands/sessions-cleanup.js +97 -0
  54. package/dist/control-ui/assets/{index-Dvkl4Xlx.js → index-D7shnQwQ.js} +404 -388
  55. package/dist/control-ui/assets/index-D7shnQwQ.js.map +1 -0
  56. package/dist/control-ui/index.html +1 -1
  57. package/dist/cron/cron-filters.js +150 -0
  58. package/dist/cron/heartbeat-policy.js +26 -0
  59. package/dist/gateway/device-pairing-security.js +197 -0
  60. package/dist/gateway/event-deduplication.js +167 -0
  61. package/dist/gateway/hooks-mapping.js +46 -7
  62. package/dist/gateway/run-tracker.js +253 -0
  63. package/dist/gateway/server-methods/nodes.js +14 -0
  64. package/dist/gateway/websocket-preauth-security.js +188 -0
  65. package/dist/hooks/module-loader.js +28 -0
  66. package/dist/infra/agent-command-binding.js +144 -0
  67. package/dist/infra/backup.js +328 -0
  68. package/dist/infra/channel-account-context.js +173 -0
  69. package/dist/infra/errors.js +53 -13
  70. package/dist/infra/exec-approvals-security.js +217 -0
  71. package/dist/infra/security/command-analyzer.js +257 -0
  72. package/dist/infra/session-cleanup.js +143 -0
  73. package/dist/plugins/loader.js +16 -8
  74. package/dist/security/external-content.js +51 -1
  75. package/dist/sessions/session-costs.js +228 -0
  76. package/dist/shared/param-key.js +16 -0
  77. package/dist/shared/poll-params.js +58 -0
  78. package/dist/shared/polls.js +55 -0
  79. package/docs/DASHBOARD-GAP-ANALYSIS-AND-PLAN.md +430 -0
  80. package/docs/FEATURES.md +523 -0
  81. package/docs/FINAL-IMPLEMENTATION-REVIEW.md +274 -0
  82. package/docs/FINAL-IMPLEMENTATION-SUMMARY.md +356 -0
  83. package/docs/FINAL-PROFESSIONAL-EVALUATION.md +312 -0
  84. package/docs/IMPLEMENTATION-PRIORITY-EVALUATION.md +298 -0
  85. package/docs/IMPLEMENTATION-PROGRESS.md +237 -0
  86. package/docs/IMPLEMENTATION-REVIEW-PHASE1-2.md +381 -0
  87. package/docs/IMPLEMENTATION-REVIEW-PHASE4.md +389 -0
  88. package/docs/IMPLEMENTATION-REVIEW-PHASE5.md +420 -0
  89. package/docs/IMPLEMENTATION-REVIEW-PHASE6.md +422 -0
  90. package/docs/IMPLEMENTATION-REVIEW-PHASE7-FINAL.md +184 -0
  91. package/docs/MIKRODASH-ANALYSIS.md +412 -0
  92. package/docs/OPENCLAW-GAP-ANALYSIS-FINAL.md +431 -0
  93. package/docs/OPENCLAW-VS-POOLBOT-ANALYSIS.md +351 -0
  94. package/docs/PHASE-7-SUMMARY.md +144 -0
  95. package/docs/POOLBOT-OFFICE-PLAN.md +697 -0
  96. package/docs/PROJECT-FINAL-STATUS.md +237 -0
  97. package/docs/README.md +116 -0
  98. package/docs/REAL-IMPROVEMENTS-EVALUATION.md +477 -0
  99. package/docs/SECURITY-HARDENING-IMPLEMENTATION.md +161 -0
  100. package/docs/channels/googlechat.md +235 -206
  101. package/docs/channels/irc.md +332 -0
  102. package/docs/channels/nostr.md +255 -168
  103. package/docs/components/command-palette.md +166 -0
  104. package/docs/components/login-gate.md +219 -0
  105. package/docs/getting-started/installation.md +191 -0
  106. package/docs/getting-started/introduction.md +120 -0
  107. package/docs/improvements/USAGE-GUIDE.md +359 -0
  108. package/docs/plans/2026-03-15-openclaw-features-implementation.md +1632 -0
  109. package/docs/reference/deadcode-detection.md +72 -0
  110. package/extensions/acpx/node_modules/.bin/acpx +21 -0
  111. package/extensions/agency-agents/node_modules/.bin/vite +4 -4
  112. package/extensions/agency-agents/node_modules/.bin/vitest +2 -2
  113. package/extensions/googlechat/node_modules/.bin/tsc +21 -0
  114. package/extensions/googlechat/node_modules/.bin/tsserver +21 -0
  115. package/extensions/googlechat/node_modules/.bin/vitest +21 -0
  116. package/extensions/googlechat/package.json +11 -28
  117. package/extensions/googlechat/src/googlechat-channel.test.ts +60 -0
  118. package/extensions/googlechat/src/googlechat-channel.ts +120 -0
  119. package/extensions/googlechat/src/index.ts +14 -0
  120. package/extensions/irc/node_modules/.bin/tsc +21 -0
  121. package/extensions/irc/node_modules/.bin/tsserver +21 -0
  122. package/extensions/irc/node_modules/.bin/vitest +21 -0
  123. package/extensions/irc/package.json +16 -8
  124. package/extensions/irc/src/index.ts +14 -0
  125. package/extensions/irc/src/irc-channel.test.ts +43 -0
  126. package/extensions/irc/src/irc-channel.ts +191 -0
  127. package/extensions/keyed-async-queue/node_modules/.bin/tsc +21 -0
  128. package/extensions/keyed-async-queue/node_modules/.bin/tsserver +21 -0
  129. package/extensions/keyed-async-queue/node_modules/.bin/vitest +21 -0
  130. package/extensions/keyed-async-queue/package.json +20 -0
  131. package/extensions/keyed-async-queue/src/index.ts +14 -0
  132. package/extensions/keyed-async-queue/src/queue.test.ts +135 -0
  133. package/extensions/keyed-async-queue/src/queue.ts +200 -0
  134. package/extensions/memory-core/node_modules/.bin/tsc +21 -0
  135. package/extensions/memory-core/node_modules/.bin/tsserver +21 -0
  136. package/extensions/memory-core/node_modules/.bin/vitest +21 -0
  137. package/extensions/memory-core/package.json +11 -8
  138. package/extensions/memory-core/src/index.ts +14 -0
  139. package/extensions/memory-core/src/memory-manager.test.ts +124 -0
  140. package/extensions/memory-core/src/memory-manager.ts +186 -0
  141. package/extensions/nostr/node_modules/.bin/tsc +2 -2
  142. package/extensions/nostr/node_modules/.bin/tsserver +2 -2
  143. package/extensions/nostr/node_modules/.bin/vitest +21 -0
  144. package/extensions/nostr/package.json +15 -24
  145. package/extensions/nostr/src/index.ts +14 -0
  146. package/extensions/nostr/src/nostr-channel.test.ts +55 -0
  147. package/extensions/nostr/src/nostr-channel.ts +228 -0
  148. package/extensions/page-agent/node_modules/.bin/vitest +2 -2
  149. package/extensions/test-utils/node_modules/.bin/jiti +21 -0
  150. package/extensions/test-utils/node_modules/.bin/playwright +21 -0
  151. package/extensions/test-utils/node_modules/.bin/tsx +21 -0
  152. package/extensions/test-utils/node_modules/.bin/vite +21 -0
  153. package/extensions/test-utils/node_modules/.bin/vitest +21 -0
  154. package/extensions/test-utils/node_modules/.bin/yaml +21 -0
  155. package/extensions/xyops/node_modules/.bin/vitest +2 -2
  156. package/package.json +2 -1
  157. package/dist/control-ui/assets/index-Dvkl4Xlx.js.map +0 -1
  158. package/extensions/googlechat/node_modules/.bin/poolbot +0 -21
  159. package/extensions/memory-core/node_modules/.bin/poolbot +0 -21
@@ -0,0 +1,480 @@
1
+ import { KILOCODE_BASE_URL, KILOCODE_DEFAULT_CONTEXT_WINDOW, KILOCODE_DEFAULT_COST, KILOCODE_DEFAULT_MAX_TOKENS, KILOCODE_MODEL_CATALOG, } from "../providers/kilocode-shared.js";
2
+ import { buildBytePlusModelDefinition, BYTEPLUS_BASE_URL, BYTEPLUS_MODEL_CATALOG, BYTEPLUS_CODING_BASE_URL, BYTEPLUS_CODING_MODEL_CATALOG, } from "./byteplus-models.js";
3
+ import { buildDoubaoModelDefinition, DOUBAO_BASE_URL, DOUBAO_MODEL_CATALOG, DOUBAO_CODING_BASE_URL, DOUBAO_CODING_MODEL_CATALOG, } from "./doubao-models.js";
4
+ import { buildSyntheticModelDefinition, SYNTHETIC_BASE_URL, SYNTHETIC_MODEL_CATALOG, } from "./synthetic-models.js";
5
+ import { TOGETHER_BASE_URL, TOGETHER_MODEL_CATALOG, buildTogetherModelDefinition, } from "./together-models.js";
6
+ const MINIMAX_PORTAL_BASE_URL = "https://api.minimax.io/anthropic";
7
+ const MINIMAX_DEFAULT_MODEL_ID = "MiniMax-M2.5";
8
+ const MINIMAX_DEFAULT_VISION_MODEL_ID = "MiniMax-VL-01";
9
+ const MINIMAX_DEFAULT_CONTEXT_WINDOW = 200000;
10
+ const MINIMAX_DEFAULT_MAX_TOKENS = 8192;
11
+ const MINIMAX_API_COST = {
12
+ input: 0.3,
13
+ output: 1.2,
14
+ cacheRead: 0.03,
15
+ cacheWrite: 0.12,
16
+ };
17
+ function buildMinimaxModel(params) {
18
+ return {
19
+ id: params.id,
20
+ name: params.name,
21
+ reasoning: params.reasoning,
22
+ input: params.input,
23
+ cost: MINIMAX_API_COST,
24
+ contextWindow: MINIMAX_DEFAULT_CONTEXT_WINDOW,
25
+ maxTokens: MINIMAX_DEFAULT_MAX_TOKENS,
26
+ };
27
+ }
28
+ function buildMinimaxTextModel(params) {
29
+ return buildMinimaxModel({ ...params, input: ["text"] });
30
+ }
31
+ const XIAOMI_BASE_URL = "https://api.xiaomimimo.com/anthropic";
32
+ export const XIAOMI_DEFAULT_MODEL_ID = "mimo-v2-flash";
33
+ const XIAOMI_DEFAULT_CONTEXT_WINDOW = 262144;
34
+ const XIAOMI_DEFAULT_MAX_TOKENS = 8192;
35
+ const XIAOMI_DEFAULT_COST = {
36
+ input: 0,
37
+ output: 0,
38
+ cacheRead: 0,
39
+ cacheWrite: 0,
40
+ };
41
+ const MOONSHOT_BASE_URL = "https://api.moonshot.ai/v1";
42
+ const MOONSHOT_DEFAULT_MODEL_ID = "kimi-k2.5";
43
+ const MOONSHOT_DEFAULT_CONTEXT_WINDOW = 256000;
44
+ const MOONSHOT_DEFAULT_MAX_TOKENS = 8192;
45
+ const MOONSHOT_DEFAULT_COST = {
46
+ input: 0,
47
+ output: 0,
48
+ cacheRead: 0,
49
+ cacheWrite: 0,
50
+ };
51
+ const KIMI_CODING_BASE_URL = "https://api.kimi.com/coding/";
52
+ const KIMI_CODING_USER_AGENT = "claude-code/0.1.0";
53
+ const KIMI_CODING_DEFAULT_MODEL_ID = "k2p5";
54
+ const KIMI_CODING_DEFAULT_CONTEXT_WINDOW = 262144;
55
+ const KIMI_CODING_DEFAULT_MAX_TOKENS = 32768;
56
+ const KIMI_CODING_DEFAULT_COST = {
57
+ input: 0,
58
+ output: 0,
59
+ cacheRead: 0,
60
+ cacheWrite: 0,
61
+ };
62
+ const QWEN_PORTAL_BASE_URL = "https://portal.qwen.ai/v1";
63
+ const QWEN_PORTAL_DEFAULT_CONTEXT_WINDOW = 128000;
64
+ const QWEN_PORTAL_DEFAULT_MAX_TOKENS = 8192;
65
+ const QWEN_PORTAL_DEFAULT_COST = {
66
+ input: 0,
67
+ output: 0,
68
+ cacheRead: 0,
69
+ cacheWrite: 0,
70
+ };
71
+ const OPENROUTER_BASE_URL = "https://openrouter.ai/api/v1";
72
+ const OPENROUTER_DEFAULT_MODEL_ID = "auto";
73
+ const OPENROUTER_DEFAULT_CONTEXT_WINDOW = 200000;
74
+ const OPENROUTER_DEFAULT_MAX_TOKENS = 8192;
75
+ const OPENROUTER_DEFAULT_COST = {
76
+ input: 0,
77
+ output: 0,
78
+ cacheRead: 0,
79
+ cacheWrite: 0,
80
+ };
81
+ export const QIANFAN_BASE_URL = "https://qianfan.baidubce.com/v2";
82
+ export const QIANFAN_DEFAULT_MODEL_ID = "deepseek-v3.2";
83
+ const QIANFAN_DEFAULT_CONTEXT_WINDOW = 98304;
84
+ const QIANFAN_DEFAULT_MAX_TOKENS = 32768;
85
+ const QIANFAN_DEFAULT_COST = {
86
+ input: 0,
87
+ output: 0,
88
+ cacheRead: 0,
89
+ cacheWrite: 0,
90
+ };
91
+ export const MODELSTUDIO_BASE_URL = "https://coding-intl.dashscope.aliyuncs.com/v1";
92
+ export const MODELSTUDIO_DEFAULT_MODEL_ID = "qwen3.5-plus";
93
+ const MODELSTUDIO_DEFAULT_COST = {
94
+ input: 0,
95
+ output: 0,
96
+ cacheRead: 0,
97
+ cacheWrite: 0,
98
+ };
99
+ const MODELSTUDIO_MODEL_CATALOG = [
100
+ {
101
+ id: "qwen3.5-plus",
102
+ name: "qwen3.5-plus",
103
+ reasoning: false,
104
+ input: ["text", "image"],
105
+ cost: MODELSTUDIO_DEFAULT_COST,
106
+ contextWindow: 1_000_000,
107
+ maxTokens: 65_536,
108
+ },
109
+ {
110
+ id: "qwen3-max-2026-01-23",
111
+ name: "qwen3-max-2026-01-23",
112
+ reasoning: false,
113
+ input: ["text"],
114
+ cost: MODELSTUDIO_DEFAULT_COST,
115
+ contextWindow: 262_144,
116
+ maxTokens: 65_536,
117
+ },
118
+ {
119
+ id: "qwen3-coder-next",
120
+ name: "qwen3-coder-next",
121
+ reasoning: false,
122
+ input: ["text"],
123
+ cost: MODELSTUDIO_DEFAULT_COST,
124
+ contextWindow: 262_144,
125
+ maxTokens: 65_536,
126
+ },
127
+ {
128
+ id: "qwen3-coder-plus",
129
+ name: "qwen3-coder-plus",
130
+ reasoning: false,
131
+ input: ["text"],
132
+ cost: MODELSTUDIO_DEFAULT_COST,
133
+ contextWindow: 1_000_000,
134
+ maxTokens: 65_536,
135
+ },
136
+ {
137
+ id: "MiniMax-M2.5",
138
+ name: "MiniMax-M2.5",
139
+ reasoning: true,
140
+ input: ["text"],
141
+ cost: MODELSTUDIO_DEFAULT_COST,
142
+ contextWindow: 1_000_000,
143
+ maxTokens: 65_536,
144
+ },
145
+ {
146
+ id: "glm-5",
147
+ name: "glm-5",
148
+ reasoning: false,
149
+ input: ["text"],
150
+ cost: MODELSTUDIO_DEFAULT_COST,
151
+ contextWindow: 202_752,
152
+ maxTokens: 16_384,
153
+ },
154
+ {
155
+ id: "glm-4.7",
156
+ name: "glm-4.7",
157
+ reasoning: false,
158
+ input: ["text"],
159
+ cost: MODELSTUDIO_DEFAULT_COST,
160
+ contextWindow: 202_752,
161
+ maxTokens: 16_384,
162
+ },
163
+ {
164
+ id: "kimi-k2.5",
165
+ name: "kimi-k2.5",
166
+ reasoning: false,
167
+ input: ["text", "image"],
168
+ cost: MODELSTUDIO_DEFAULT_COST,
169
+ contextWindow: 262_144,
170
+ maxTokens: 32_768,
171
+ },
172
+ ];
173
+ const NVIDIA_BASE_URL = "https://integrate.api.nvidia.com/v1";
174
+ const NVIDIA_DEFAULT_MODEL_ID = "nvidia/llama-3.1-nemotron-70b-instruct";
175
+ const NVIDIA_DEFAULT_CONTEXT_WINDOW = 131072;
176
+ const NVIDIA_DEFAULT_MAX_TOKENS = 4096;
177
+ const NVIDIA_DEFAULT_COST = {
178
+ input: 0,
179
+ output: 0,
180
+ cacheRead: 0,
181
+ cacheWrite: 0,
182
+ };
183
+ const OPENAI_CODEX_BASE_URL = "https://chatgpt.com/backend-api";
184
+ export function buildMinimaxProvider() {
185
+ return {
186
+ baseUrl: MINIMAX_PORTAL_BASE_URL,
187
+ api: "anthropic-messages",
188
+ authHeader: true,
189
+ models: [
190
+ buildMinimaxModel({
191
+ id: MINIMAX_DEFAULT_VISION_MODEL_ID,
192
+ name: "MiniMax VL 01",
193
+ reasoning: false,
194
+ input: ["text", "image"],
195
+ }),
196
+ buildMinimaxTextModel({
197
+ id: "MiniMax-M2.5",
198
+ name: "MiniMax M2.5",
199
+ reasoning: true,
200
+ }),
201
+ buildMinimaxTextModel({
202
+ id: "MiniMax-M2.5-highspeed",
203
+ name: "MiniMax M2.5 Highspeed",
204
+ reasoning: true,
205
+ }),
206
+ ],
207
+ };
208
+ }
209
+ export function buildMinimaxPortalProvider() {
210
+ return {
211
+ baseUrl: MINIMAX_PORTAL_BASE_URL,
212
+ api: "anthropic-messages",
213
+ authHeader: true,
214
+ models: [
215
+ buildMinimaxModel({
216
+ id: MINIMAX_DEFAULT_VISION_MODEL_ID,
217
+ name: "MiniMax VL 01",
218
+ reasoning: false,
219
+ input: ["text", "image"],
220
+ }),
221
+ buildMinimaxTextModel({
222
+ id: MINIMAX_DEFAULT_MODEL_ID,
223
+ name: "MiniMax M2.5",
224
+ reasoning: true,
225
+ }),
226
+ buildMinimaxTextModel({
227
+ id: "MiniMax-M2.5-highspeed",
228
+ name: "MiniMax M2.5 Highspeed",
229
+ reasoning: true,
230
+ }),
231
+ ],
232
+ };
233
+ }
234
+ export function buildMoonshotProvider() {
235
+ return {
236
+ baseUrl: MOONSHOT_BASE_URL,
237
+ api: "openai-completions",
238
+ models: [
239
+ {
240
+ id: MOONSHOT_DEFAULT_MODEL_ID,
241
+ name: "Kimi K2.5",
242
+ reasoning: false,
243
+ input: ["text", "image"],
244
+ cost: MOONSHOT_DEFAULT_COST,
245
+ contextWindow: MOONSHOT_DEFAULT_CONTEXT_WINDOW,
246
+ maxTokens: MOONSHOT_DEFAULT_MAX_TOKENS,
247
+ },
248
+ ],
249
+ };
250
+ }
251
+ export function buildKimiCodingProvider() {
252
+ return {
253
+ baseUrl: KIMI_CODING_BASE_URL,
254
+ api: "anthropic-messages",
255
+ headers: {
256
+ "User-Agent": KIMI_CODING_USER_AGENT,
257
+ },
258
+ models: [
259
+ {
260
+ id: KIMI_CODING_DEFAULT_MODEL_ID,
261
+ name: "Kimi for Coding",
262
+ reasoning: true,
263
+ input: ["text", "image"],
264
+ cost: KIMI_CODING_DEFAULT_COST,
265
+ contextWindow: KIMI_CODING_DEFAULT_CONTEXT_WINDOW,
266
+ maxTokens: KIMI_CODING_DEFAULT_MAX_TOKENS,
267
+ },
268
+ ],
269
+ };
270
+ }
271
+ export function buildQwenPortalProvider() {
272
+ return {
273
+ baseUrl: QWEN_PORTAL_BASE_URL,
274
+ api: "openai-completions",
275
+ models: [
276
+ {
277
+ id: "coder-model",
278
+ name: "Qwen Coder",
279
+ reasoning: false,
280
+ input: ["text"],
281
+ cost: QWEN_PORTAL_DEFAULT_COST,
282
+ contextWindow: QWEN_PORTAL_DEFAULT_CONTEXT_WINDOW,
283
+ maxTokens: QWEN_PORTAL_DEFAULT_MAX_TOKENS,
284
+ },
285
+ {
286
+ id: "vision-model",
287
+ name: "Qwen Vision",
288
+ reasoning: false,
289
+ input: ["text", "image"],
290
+ cost: QWEN_PORTAL_DEFAULT_COST,
291
+ contextWindow: QWEN_PORTAL_DEFAULT_CONTEXT_WINDOW,
292
+ maxTokens: QWEN_PORTAL_DEFAULT_MAX_TOKENS,
293
+ },
294
+ ],
295
+ };
296
+ }
297
+ export function buildSyntheticProvider() {
298
+ return {
299
+ baseUrl: SYNTHETIC_BASE_URL,
300
+ api: "anthropic-messages",
301
+ models: SYNTHETIC_MODEL_CATALOG.map(buildSyntheticModelDefinition),
302
+ };
303
+ }
304
+ export function buildDoubaoProvider() {
305
+ return {
306
+ baseUrl: DOUBAO_BASE_URL,
307
+ api: "openai-completions",
308
+ models: DOUBAO_MODEL_CATALOG.map(buildDoubaoModelDefinition),
309
+ };
310
+ }
311
+ export function buildDoubaoCodingProvider() {
312
+ return {
313
+ baseUrl: DOUBAO_CODING_BASE_URL,
314
+ api: "openai-completions",
315
+ models: DOUBAO_CODING_MODEL_CATALOG.map(buildDoubaoModelDefinition),
316
+ };
317
+ }
318
+ export function buildBytePlusProvider() {
319
+ return {
320
+ baseUrl: BYTEPLUS_BASE_URL,
321
+ api: "openai-completions",
322
+ models: BYTEPLUS_MODEL_CATALOG.map(buildBytePlusModelDefinition),
323
+ };
324
+ }
325
+ export function buildBytePlusCodingProvider() {
326
+ return {
327
+ baseUrl: BYTEPLUS_CODING_BASE_URL,
328
+ api: "openai-completions",
329
+ models: BYTEPLUS_CODING_MODEL_CATALOG.map(buildBytePlusModelDefinition),
330
+ };
331
+ }
332
+ export function buildXiaomiProvider() {
333
+ return {
334
+ baseUrl: XIAOMI_BASE_URL,
335
+ api: "anthropic-messages",
336
+ models: [
337
+ {
338
+ id: XIAOMI_DEFAULT_MODEL_ID,
339
+ name: "Xiaomi MiMo V2 Flash",
340
+ reasoning: false,
341
+ input: ["text"],
342
+ cost: XIAOMI_DEFAULT_COST,
343
+ contextWindow: XIAOMI_DEFAULT_CONTEXT_WINDOW,
344
+ maxTokens: XIAOMI_DEFAULT_MAX_TOKENS,
345
+ },
346
+ ],
347
+ };
348
+ }
349
+ export function buildTogetherProvider() {
350
+ return {
351
+ baseUrl: TOGETHER_BASE_URL,
352
+ api: "openai-completions",
353
+ models: TOGETHER_MODEL_CATALOG.map(buildTogetherModelDefinition),
354
+ };
355
+ }
356
+ export function buildOpenrouterProvider() {
357
+ return {
358
+ baseUrl: OPENROUTER_BASE_URL,
359
+ api: "openai-completions",
360
+ models: [
361
+ {
362
+ id: OPENROUTER_DEFAULT_MODEL_ID,
363
+ name: "OpenRouter Auto",
364
+ reasoning: false,
365
+ input: ["text", "image"],
366
+ cost: OPENROUTER_DEFAULT_COST,
367
+ contextWindow: OPENROUTER_DEFAULT_CONTEXT_WINDOW,
368
+ maxTokens: OPENROUTER_DEFAULT_MAX_TOKENS,
369
+ },
370
+ {
371
+ id: "openrouter/hunter-alpha",
372
+ name: "Hunter Alpha",
373
+ reasoning: true,
374
+ input: ["text"],
375
+ cost: OPENROUTER_DEFAULT_COST,
376
+ contextWindow: 1048576,
377
+ maxTokens: 65536,
378
+ },
379
+ {
380
+ id: "openrouter/healer-alpha",
381
+ name: "Healer Alpha",
382
+ reasoning: true,
383
+ input: ["text", "image"],
384
+ cost: OPENROUTER_DEFAULT_COST,
385
+ contextWindow: 262144,
386
+ maxTokens: 65536,
387
+ },
388
+ ],
389
+ };
390
+ }
391
+ export function buildOpenAICodexProvider() {
392
+ return {
393
+ baseUrl: OPENAI_CODEX_BASE_URL,
394
+ api: "openai-codex-responses",
395
+ models: [],
396
+ };
397
+ }
398
+ export function buildQianfanProvider() {
399
+ return {
400
+ baseUrl: QIANFAN_BASE_URL,
401
+ api: "openai-completions",
402
+ models: [
403
+ {
404
+ id: QIANFAN_DEFAULT_MODEL_ID,
405
+ name: "DEEPSEEK V3.2",
406
+ reasoning: true,
407
+ input: ["text"],
408
+ cost: QIANFAN_DEFAULT_COST,
409
+ contextWindow: QIANFAN_DEFAULT_CONTEXT_WINDOW,
410
+ maxTokens: QIANFAN_DEFAULT_MAX_TOKENS,
411
+ },
412
+ {
413
+ id: "ernie-5.0-thinking-preview",
414
+ name: "ERNIE-5.0-Thinking-Preview",
415
+ reasoning: true,
416
+ input: ["text", "image"],
417
+ cost: QIANFAN_DEFAULT_COST,
418
+ contextWindow: 119000,
419
+ maxTokens: 64000,
420
+ },
421
+ ],
422
+ };
423
+ }
424
+ export function buildModelStudioProvider() {
425
+ return {
426
+ baseUrl: MODELSTUDIO_BASE_URL,
427
+ api: "openai-completions",
428
+ models: MODELSTUDIO_MODEL_CATALOG.map((model) => ({ ...model })),
429
+ };
430
+ }
431
+ export function buildNvidiaProvider() {
432
+ return {
433
+ baseUrl: NVIDIA_BASE_URL,
434
+ api: "openai-completions",
435
+ models: [
436
+ {
437
+ id: NVIDIA_DEFAULT_MODEL_ID,
438
+ name: "NVIDIA Llama 3.1 Nemotron 70B Instruct",
439
+ reasoning: false,
440
+ input: ["text"],
441
+ cost: NVIDIA_DEFAULT_COST,
442
+ contextWindow: NVIDIA_DEFAULT_CONTEXT_WINDOW,
443
+ maxTokens: NVIDIA_DEFAULT_MAX_TOKENS,
444
+ },
445
+ {
446
+ id: "meta/llama-3.3-70b-instruct",
447
+ name: "Meta Llama 3.3 70B Instruct",
448
+ reasoning: false,
449
+ input: ["text"],
450
+ cost: NVIDIA_DEFAULT_COST,
451
+ contextWindow: 131072,
452
+ maxTokens: 4096,
453
+ },
454
+ {
455
+ id: "nvidia/mistral-nemo-minitron-8b-8k-instruct",
456
+ name: "NVIDIA Mistral NeMo Minitron 8B Instruct",
457
+ reasoning: false,
458
+ input: ["text"],
459
+ cost: NVIDIA_DEFAULT_COST,
460
+ contextWindow: 8192,
461
+ maxTokens: 2048,
462
+ },
463
+ ],
464
+ };
465
+ }
466
+ export function buildKilocodeProvider() {
467
+ return {
468
+ baseUrl: KILOCODE_BASE_URL,
469
+ api: "openai-completions",
470
+ models: KILOCODE_MODEL_CATALOG.map((model) => ({
471
+ id: model.id,
472
+ name: model.name,
473
+ reasoning: model.reasoning,
474
+ input: model.input,
475
+ cost: KILOCODE_DEFAULT_COST,
476
+ contextWindow: model.contextWindow ?? KILOCODE_DEFAULT_CONTEXT_WINDOW,
477
+ maxTokens: model.maxTokens ?? KILOCODE_DEFAULT_MAX_TOKENS,
478
+ })),
479
+ };
480
+ }
@@ -0,0 +1,15 @@
1
+ import { INTERNAL_MESSAGE_CHANNEL } from "../../utils/message-channel.js";
2
+ export function resolveRunTypingPolicy(params) {
3
+ const typingPolicy = params.isHeartbeat
4
+ ? "heartbeat"
5
+ : params.originatingChannel === INTERNAL_MESSAGE_CHANNEL
6
+ ? "internal_webchat"
7
+ : params.systemEvent
8
+ ? "system_event"
9
+ : (params.requestedPolicy ?? "auto");
10
+ const suppressTyping = params.suppressTyping === true ||
11
+ typingPolicy === "heartbeat" ||
12
+ typingPolicy === "system_event" ||
13
+ typingPolicy === "internal_webchat";
14
+ return { typingPolicy, suppressTyping };
15
+ }