@johpaz/hive-agents 1.0.0 → 1.0.2
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/README.md +25 -11
- package/dist/hive.js +22498 -6889
- package/dist/tool-worker.js +6 -2
- package/dist/ui/assets/A2UIPage-BRpjnMss.js +8 -0
- package/dist/ui/assets/{AgentCreateForm-g1mQnIoJ.js → AgentCreateForm-ASjKD7Js.js} +1 -1
- package/dist/ui/assets/{AgentDetailPage-C3XkU4Ll.js → AgentDetailPage-bqJ-MS40.js} +1 -1
- package/dist/ui/assets/AgentNewPage-CPaf2C3u.js +1 -0
- package/dist/ui/assets/{AgentsPage-CNA778Eo.js → AgentsPage-BIpLG0V6.js} +1 -1
- package/dist/ui/assets/{ApiClientPage-t5DpKhmA.js → ApiClientPage-dRckcgrN.js} +1 -1
- package/dist/ui/assets/{ChannelsPage-yY6t0YTU.js → ChannelsPage-BX_hPtiN.js} +2 -2
- package/dist/ui/assets/{DashboardPage-BSeNSYg5.js → DashboardPage-KMaMaFf4.js} +2 -2
- package/dist/ui/assets/{LoginPage-eT5zDRDa.js → LoginPage-Zchu-f16.js} +1 -1
- package/dist/ui/assets/{LogsPage-Gczzzsdh.js → LogsPage-6Po7_T2u.js} +1 -1
- package/dist/ui/assets/{MeetingPage-Bu4aMMNR.js → MeetingPage-qrpYGVD-.js} +1 -1
- package/dist/ui/assets/{ModelSelector-nNOrW3te.js → ModelSelector-C8ny_pxu.js} +1 -1
- package/dist/ui/assets/{Office3DPage-B_iXEbyv.js → Office3DPage-BYwLMTCl.js} +2 -2
- package/dist/ui/assets/ProvidersPage-DP9v_1ko.js +1 -0
- package/dist/ui/assets/{RecoverPage-DMqSasKk.js → RecoverPage-BXwjLfap.js} +1 -1
- package/dist/ui/assets/SettingsPage-DD7GKtS6.js +9 -0
- package/dist/ui/assets/{SetupPage-DhcRbGgg.js → SetupPage-D7YX2io-.js} +1 -1
- package/dist/ui/assets/{WebChatPage-CWXjW4Hn.js → WebChatPage-C3cgimxd.js} +1 -1
- package/dist/ui/assets/{activity-CQuPevhB.js → activity-DZKL7dg4.js} +1 -1
- package/dist/ui/assets/{agentCapabilities-CDC6y91E.js → agentCapabilities-DuGs07XP.js} +1 -1
- package/dist/ui/assets/arrow-left-12JaXVoH.js +1 -0
- package/dist/ui/assets/arrow-right-Dbui5p0d.js +1 -0
- package/dist/ui/assets/arrow-up-right-CJBtXRrp.js +1 -0
- package/dist/ui/assets/{calendar-Be23hQGc.js → calendar-CkDsc4OJ.js} +1 -1
- package/dist/ui/assets/check-DxOMIDcl.js +1 -0
- package/dist/ui/assets/chevron-down-CObv-xyx.js +1 -0
- package/dist/ui/assets/chevron-left-C0mqwhLU.js +1 -0
- package/dist/ui/assets/chevron-right-jCt1h8Kw.js +1 -0
- package/dist/ui/assets/chevron-up-DX_5iw7O.js +1 -0
- package/dist/ui/assets/{circle-alert-BDVHxmAz.js → circle-alert-BkP6x0zQ.js} +1 -1
- package/dist/ui/assets/circle-check-CXC2AiMS.js +1 -0
- package/dist/ui/assets/{circle-x-Cb2Yer4s.js → circle-x-h4OJiHV3.js} +1 -1
- package/dist/ui/assets/{copy-33tZrzc9.js → copy-BtpYEEvV.js} +1 -1
- package/dist/ui/assets/{dialog-KOZKWbib.js → dialog-CO1WrPJc.js} +1 -1
- package/dist/ui/assets/{download-CiQqqXyz.js → download-aPuVaZik.js} +1 -1
- package/dist/ui/assets/{earth-DCvN7ynm.js → earth-sc8YJMc0.js} +1 -1
- package/dist/ui/assets/{ellipsis-vertical-BybFZDk2.js → ellipsis-vertical-DEBZJGzY.js} +1 -1
- package/dist/ui/assets/{external-link-0iNNBvZm.js → external-link-D_C_678M.js} +1 -1
- package/dist/ui/assets/{eye-C8sKSSkg.js → eye-BfN613fx.js} +1 -1
- package/dist/ui/assets/{file-text-DO8jqiJK.js → file-text-Bth5pPZX.js} +1 -1
- package/dist/ui/assets/gauge-DypSzSOE.js +1 -0
- package/dist/ui/assets/{history-BtTD1kDo.js → history-njH_sPSo.js} +1 -1
- package/dist/ui/assets/{index-Bejlp-R1.js → index-D-9yCvjP.js} +4 -4
- package/dist/ui/assets/index-wML8DaUo.css +2 -0
- package/dist/ui/assets/{info-mpk1tsNC.js → info-Def2ZFeP.js} +1 -1
- package/dist/ui/assets/{key-CoQ0qtXt.js → key-D8bkDl83.js} +1 -1
- package/dist/ui/assets/loader-circle-wLVzSdML.js +1 -0
- package/dist/ui/assets/{lock-open-Cd2aqwOd.js → lock-open-Cdopbw1b.js} +1 -1
- package/dist/ui/assets/{mail-BG0RYSkL.js → mail-BQ_YA9_b.js} +1 -1
- package/dist/ui/assets/{pause-Cme88_9s.js → pause-CvS_LzKx.js} +1 -1
- package/dist/ui/assets/{pencil-f1nJ1xhs.js → pencil-C3tPvnCk.js} +1 -1
- package/dist/ui/assets/play-C-oR-PMH.js +1 -0
- package/dist/ui/assets/plus-CF9No2td.js +1 -0
- package/dist/ui/assets/{radio-B5SpKJ-J.js → radio-dsaiFxuT.js} +1 -1
- package/dist/ui/assets/{refresh-cw-CroGQY62.js → refresh-cw-BmYQwOhh.js} +1 -1
- package/dist/ui/assets/search-CTONpTyl.js +1 -0
- package/dist/ui/assets/{select-BhbW0stK.js → select-BfRyBbi9.js} +1 -1
- package/dist/ui/assets/{send-D6whYpw-.js → send-C3o2wpLi.js} +1 -1
- package/dist/ui/assets/{settings-BX6q3MGB.js → settings-DEpdBuf2.js} +1 -1
- package/dist/ui/assets/{shield-BnGyu1xf.js → shield-gbUkSqfi.js} +1 -1
- package/dist/ui/assets/{sparkles-BcaOs_Jk.js → sparkles-Ccd1JZ3s.js} +1 -1
- package/dist/ui/assets/{square-ju5H8nrT.js → square-BrwQ6Mun.js} +1 -1
- package/dist/ui/assets/terminal-DP9j3HjM.js +1 -0
- package/dist/ui/assets/{trash-2-DjQXac_0.js → trash-2-CfCs7RhJ.js} +1 -1
- package/dist/ui/assets/{triangle-alert-B04mgMcg.js → triangle-alert-C3lWSnRr.js} +1 -1
- package/dist/ui/assets/{useHiveAgentsModelLoad-DT5-4CCj.js → useHiveAgentsModelLoad-D3s2U82M.js} +1 -1
- package/dist/ui/assets/{useProviders-DSX7eVsz.js → useProviders-B3rT_xU9.js} +1 -1
- package/dist/ui/assets/{volume-x-qnVxkRSM.js → volume-x-D2h9cyml.js} +1 -1
- package/dist/ui/assets/{wifi-BA1m2dGO.js → wifi-CGQECzu2.js} +1 -1
- package/dist/ui/assets/{zap-DT7cM7YS.js → zap-B1azpiE7.js} +1 -1
- package/dist/ui/index.html +8 -6
- package/dist/ui/logoblack.png +0 -0
- package/dist/ui/logocolor-dark.png +0 -0
- package/dist/ui/logocolorbg.png +0 -0
- package/dist/ui/logodoradobg.png +0 -0
- package/package.json +12 -8
- package/packages/cli/src/commands/doctor.ts +111 -0
- package/packages/cli/src/commands/onboard.ts +126 -59
- package/packages/cli/src/index.ts +23 -17
- package/packages/cli/src/ui-bundle.generated.ts +9 -92
- package/packages/core/src/agent/acceptance-checks.ts +172 -0
- package/packages/core/src/agent/agent-catalog.ts +1 -37
- package/packages/core/src/agent/agent-loop.ts +21 -2
- package/packages/core/src/agent/catalog-selector.ts +0 -1
- package/packages/core/src/agent/compaction.ts +16 -1
- package/packages/core/src/agent/context-compiler.ts +3 -1
- package/packages/core/src/agent/conversation-store.ts +1 -1
- package/packages/core/src/agent/delegation-runtime.ts +1 -8
- package/packages/core/src/agent/goal-runner.ts +111 -32
- package/packages/core/src/agent/index.ts +1 -1
- package/packages/core/src/agent/llm-client.ts +34 -2
- package/packages/core/src/agent/llm-providers/anthropic.ts +10 -7
- package/packages/core/src/agent/llm-providers/interface.ts +13 -2
- package/packages/core/src/agent/llm-providers/modelscope.ts +5 -0
- package/packages/core/src/agent/llm-providers/z-ai.ts +5 -0
- package/packages/core/src/agent/minimal-loadout.ts +1 -0
- package/packages/core/src/agent/proof-packet.ts +2 -11
- package/packages/core/src/agent/providers/index.ts +1 -1
- package/packages/core/src/agent/tool-selector.ts +25 -1
- package/packages/core/src/canvas/canvas-manager.ts +36 -7
- package/packages/core/src/canvas/emitter.ts +0 -44
- package/packages/core/src/channels/manager.ts +117 -25
- package/packages/core/src/channels/whatsapp.ts +6 -1
- package/packages/core/src/config/loader.ts +13 -1
- package/packages/core/src/events/channel-narration.ts +150 -0
- package/packages/core/src/events/tool-narration.ts +62 -0
- package/packages/core/src/gateway/channel-notify.ts +11 -7
- package/packages/core/src/gateway/delegation-groups.ts +24 -11
- package/packages/core/src/gateway/helpers/narration.ts +4 -62
- package/packages/core/src/gateway/helpers/ui-source.ts +67 -0
- package/packages/core/src/gateway/job-executors.ts +29 -67
- package/packages/core/src/gateway/resolver.ts +10 -2
- package/packages/core/src/gateway/routes/a2ui.ts +43 -0
- package/packages/core/src/gateway/routes/agents.ts +6 -6
- package/packages/core/src/gateway/routes/channels.ts +15 -1
- package/packages/core/src/gateway/routes/models.ts +69 -12
- package/packages/core/src/gateway/routes/providers.ts +110 -28
- package/packages/core/src/gateway/routes/runtime.ts +58 -0
- package/packages/core/src/gateway/routes/setup.ts +161 -90
- package/packages/core/src/gateway/routes/system.ts +8 -5
- package/packages/core/src/gateway/routes/voice.ts +3 -0
- package/packages/core/src/gateway/server.ts +74 -28
- package/packages/core/src/gateway/webchat-turn.ts +29 -5
- package/packages/core/src/index.ts +1 -1
- package/packages/core/src/storage/bootstrap.ts +13 -9
- package/packages/core/src/storage/collections.ts +12 -46
- package/packages/core/src/storage/crypto.ts +147 -58
- package/packages/core/src/storage/hivedb.ts +9 -0
- package/packages/core/src/storage/model-id.ts +53 -0
- package/packages/core/src/storage/onboarding.ts +36 -9
- package/packages/core/src/storage/seed.ts +283 -138
- package/packages/core/src/storage/usage.ts +61 -123
- package/packages/core/src/tools/agents/index.ts +199 -27
- package/packages/core/src/tools/index.ts +2 -1
- package/packages/core/src/tools/web/browser-backend.ts +129 -0
- package/packages/core/src/tools/web/browser-service.ts +75 -35
- package/packages/core/src/tools/web/webview-backend.ts +412 -0
- package/packages/core/src/voice/index.ts +108 -17
- package/packages/skills/src/bundled/agents/task_orchestrator/SKILL.md +2 -1
- package/packages/skills/src/bundled-data.generated.ts +2 -23
- package/dist/ui/assets/A2UIPage-D4nUFe5q.js +0 -8
- package/dist/ui/assets/AgentNewPage-CEkLeA79.js +0 -1
- package/dist/ui/assets/ProvidersPage-BupHs5yO.js +0 -1
- package/dist/ui/assets/SettingsPage-B6FTSkOn.js +0 -9
- package/dist/ui/assets/arrow-left-0EBE7nsF.js +0 -1
- package/dist/ui/assets/arrow-right-5QIaph-z.js +0 -1
- package/dist/ui/assets/arrow-up-right-DQQCY007.js +0 -1
- package/dist/ui/assets/check-Dp6tzwax.js +0 -1
- package/dist/ui/assets/chevron-down-33N886NY.js +0 -1
- package/dist/ui/assets/chevron-left-C6itJXh3.js +0 -1
- package/dist/ui/assets/chevron-right-CFodBS-b.js +0 -1
- package/dist/ui/assets/chevron-up-BvSmyBEs.js +0 -1
- package/dist/ui/assets/circle-check-BJWNbLuF.js +0 -1
- package/dist/ui/assets/gauge-BRGwuN8G.js +0 -1
- package/dist/ui/assets/index-XoTT41Hr.css +0 -2
- package/dist/ui/assets/loader-circle-BhqRN2nO.js +0 -1
- package/dist/ui/assets/play-CfYDHD6h.js +0 -1
- package/dist/ui/assets/plus-C5BxJeOX.js +0 -1
- package/dist/ui/assets/search-rfBcmohK.js +0 -1
- package/dist/ui/assets/terminal-Bjfu-TkS.js +0 -1
- package/packages/core/src/agent/acceptance-verifier.ts +0 -300
- package/packages/skills/src/bundled/agents/acceptance_verification/SKILL.md +0 -26
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { col, toIndexable, nextId } from "./hive"
|
|
2
2
|
import type { Collection } from "@johpaz/hive-db"
|
|
3
3
|
import { logger } from "../utils/logger"
|
|
4
|
+
import { catalogModelKey } from "./model-id"
|
|
5
|
+
import { invalidateModelPricingCache } from "./usage"
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Seed de datos predeterminados para Hive
|
|
@@ -11,7 +13,20 @@ import { logger } from "../utils/logger"
|
|
|
11
13
|
export interface SeedData {
|
|
12
14
|
tools: Array<{ id: string; name: string; category: string; description: string; enabled?: boolean }>
|
|
13
15
|
providers: Array<{ id: string; name: string; baseUrl?: string; category?: string }>
|
|
14
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Catálogo de modelos — única fuente de verdad, incluidos los precios.
|
|
18
|
+
*
|
|
19
|
+
* `id` es el nombre del modelo tal como lo llama su propietario. La clave real
|
|
20
|
+
* en la BD la deriva `catalogModelKey()` (storage/model-id.ts), que prefija a
|
|
21
|
+
* los providers revendedores para que dos servicios puedan ofrecer el mismo
|
|
22
|
+
* modelo sin pisarse.
|
|
23
|
+
*
|
|
24
|
+
* `inputPer1M` / `outputPer1M` son USD por millón de tokens y alimentan el
|
|
25
|
+
* costo del dashboard. Obligatorios en los modelos `llm`: omitirlos hace que
|
|
26
|
+
* el modelo aparezca gratis, que es indistinguible de un endpoint sin costo.
|
|
27
|
+
* Los endpoints realmente gratuitos (NVIDIA NIM, Ollama, HiveAgents) van con 0.
|
|
28
|
+
*/
|
|
29
|
+
models: Array<{ id: string; providerId: string; name: string; modelType: string; contextWindow?: number; capabilities?: string; inputPer1M?: number; outputPer1M?: number }>
|
|
15
30
|
mcpServers: Array<{ id: string; name: string; transport: string; command?: string; args?: string[]; builtin: boolean }>
|
|
16
31
|
channels: Array<{ id: string; type: string }>
|
|
17
32
|
ethics: Array<{ id: string; name: string; description: string; content: string; isDefault: boolean }>
|
|
@@ -76,6 +91,7 @@ export const SEED_DATA: SeedData = {
|
|
|
76
91
|
{ id: "agent_find", name: "agent_find", category: "agents", description: "Descubrir agentes worker disponibles: catálogo global del sistema y workers privados del usuario. No indica ejecución; para eso usar task_list. Sinónimos: buscar agente, encontrar worker, localizar agente" },
|
|
77
92
|
{ id: "agent_archive", name: "agent_archive", category: "agents", description: "Archivar o terminar un agente worker. Sinónimos: archivar agente, terminar worker, desactivar agente" },
|
|
78
93
|
{ id: "task_delegate", name: "task_delegate", category: "agents", description: "Delegar una tarea general a un agente worker específico. Sinónimos: delegar tarea, asignar worker, ejecutar por agente" },
|
|
94
|
+
{ id: "task_revise", name: "task_revise", category: "agents", description: "Devolver una tarea delegada a su worker con feedback cuando no cumple sus criterios de aceptación. Sinónimos: corregir tarea, devolver al worker, pedir corrección, reencolar tarea" },
|
|
79
95
|
{ id: "task_list", name: "task_list", category: "agents", description: "Listar ejecuciones reales de tareas delegadas del usuario, consultando tareas y jobs persistidos. Sinónimos: listar tareas activas, ver subagentes trabajando, ejecuciones reales" },
|
|
80
96
|
{ id: "task_status", name: "task_status", category: "agents", description: "Obtener estado de ejecución de tareas delegadas. Sinónimos: estado tarea delegada, verificar progreso, consultar tarea" },
|
|
81
97
|
{ id: "bus_publish", name: "bus_publish", category: "agents", description: "Publicar mensaje en el Agent Bus para comunicación worker-to-worker. Sinónimos: publicar mensaje, comunicar workers, enviar bus" },
|
|
@@ -125,26 +141,32 @@ export const SEED_DATA: SeedData = {
|
|
|
125
141
|
{ id: "qwen", name: "Qwen (Alibaba)", baseUrl: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1", category: "llm" },
|
|
126
142
|
{ id: "nvidia", name: "NVIDIA NIM", baseUrl: "https://integrate.api.nvidia.com/v1" },
|
|
127
143
|
{ id: "minimax", name: "MiniMax", baseUrl: "https://api.minimaxi.com/v1" },
|
|
144
|
+
{ id: "z-ai", name: "Z.ai (GLM)", baseUrl: "https://api.z.ai/api/paas/v4" },
|
|
145
|
+
// `.ai` (internacional), NO `.cn`. Son plataformas separadas con cuentas y
|
|
146
|
+
// tokens propios: un token internacional responde 401 en el endpoint chino.
|
|
147
|
+
// Confunde porque GET /v1/models da 200 en ambos — ese listado es público y
|
|
148
|
+
// no valida la key; el 401 recién aparece al invocar el modelo.
|
|
149
|
+
{ id: "modelscope", name: "ModelScope Qwen", baseUrl: "https://api-inference.modelscope.ai/v1" },
|
|
128
150
|
{ id: "opencode-go", name: "OpenCode Go", baseUrl: "https://opencode.ai/zen/go/v1" },
|
|
129
151
|
{ id: "piper", name: "Piper (Local TTS)", category: "tts" },
|
|
130
152
|
{ id: "hiveagents", name: "HiveAgents LLM (Cloudflare)", baseUrl: "https://llm.hiveagents.io/v1", category: "llm" },
|
|
131
153
|
],
|
|
132
154
|
|
|
133
155
|
models: [
|
|
134
|
-
// ── Anthropic (fuente:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
{ id: "claude-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
{ id: "gpt-5.
|
|
146
|
-
{ id: "gpt-5.
|
|
147
|
-
{ id: "
|
|
156
|
+
// ── Anthropic (fuente: platform.claude.com/docs/en/about-claude/models/overview) ──
|
|
157
|
+
// Generación actual (4.6/4.7/4.8 pasaron a "legacy"). Los IDs sin fecha ya son
|
|
158
|
+
// snapshots fijos, no alias evergreen.
|
|
159
|
+
{ id: "claude-opus-5", providerId: "anthropic", name: "Claude Opus 5", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "code", "reasoning"]), inputPer1M: 5, outputPer1M: 25 },
|
|
160
|
+
{ id: "claude-sonnet-5", providerId: "anthropic", name: "Claude Sonnet 5", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "code", "reasoning"]), inputPer1M: 3, outputPer1M: 15 },
|
|
161
|
+
{ id: "claude-fable-5", providerId: "anthropic", name: "Claude Fable 5", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "code", "reasoning"]), inputPer1M: 10, outputPer1M: 50 },
|
|
162
|
+
{ id: "claude-haiku-4-5-20251001", providerId: "anthropic", name: "Claude Haiku 4.5", modelType: "llm", contextWindow: 200000, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 1, outputPer1M: 5 },
|
|
163
|
+
|
|
164
|
+
// ── OpenAI (fuente: developers.openai.com/api/docs/models) ──
|
|
165
|
+
// Serie 5.6: Sol (frontier), Terra (equilibrio) y Luna (alto volumen / bajo costo).
|
|
166
|
+
// Las tres comparten 1.05M de contexto; se quitó la familia GPT-4o (2024).
|
|
167
|
+
{ id: "gpt-5.6-luna", providerId: "openai", name: "GPT-5.6 Luna", modelType: "llm", contextWindow: 1050000, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "code", "reasoning"]), inputPer1M: 0.1, outputPer1M: 0.6 },
|
|
168
|
+
{ id: "gpt-5.6-terra", providerId: "openai", name: "GPT-5.6 Terra", modelType: "llm", contextWindow: 1050000, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "code", "reasoning"]), inputPer1M: 1, outputPer1M: 6 },
|
|
169
|
+
{ id: "gpt-5.6-sol", providerId: "openai", name: "GPT-5.6 Sol", modelType: "llm", contextWindow: 1050000, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "code", "reasoning"]), inputPer1M: 5, outputPer1M: 30 },
|
|
148
170
|
// STT / TTS
|
|
149
171
|
{ id: "whisper-1", providerId: "openai", name: "Whisper 1", modelType: "stt", contextWindow: 0, capabilities: JSON.stringify(["transcription", "translation"]) },
|
|
150
172
|
{ id: "tts-1", providerId: "openai", name: "TTS-1", modelType: "tts", contextWindow: 0, capabilities: JSON.stringify(["tts", "speech"]) },
|
|
@@ -152,86 +174,94 @@ export const SEED_DATA: SeedData = {
|
|
|
152
174
|
{ id: "gpt-4o-mini-tts", providerId: "openai", name: "GPT-4o Mini TTS", modelType: "tts", contextWindow: 0, capabilities: JSON.stringify(["tts", "speech"]) },
|
|
153
175
|
{ id: "es_MX-claude-14947-epoch-high", providerId: "piper", name: "Piper Spanish (Claude)", modelType: "tts", contextWindow: 0, capabilities: JSON.stringify(["tts", "speech", "local"]) },
|
|
154
176
|
|
|
155
|
-
// ── Google Gemini (fuente:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
{ id: "gemini-3.
|
|
160
|
-
{ id: "gemini-3.
|
|
161
|
-
{ id: "gemini-3-flash-
|
|
162
|
-
{ id: "gemini-
|
|
163
|
-
{ id: "gemini-
|
|
164
|
-
{ id: "gemini-3-flash-preview", providerId: "gemini", name: "Gemini 3 Flash Preview", modelType: "llm", contextWindow: 1048576, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming"]) },
|
|
165
|
-
|
|
177
|
+
// ── Google Gemini (fuente: ai.google.dev/gemini-api/docs/models) ──
|
|
178
|
+
// Solo la generación 3.x: la familia 2.0 ya está apagada y la 2.5 quedó
|
|
179
|
+
// superada. `gemini-3.5-pro` y `gemini-3.1-flash-lite-preview` se quitaron:
|
|
180
|
+
// el primero no existe en el catálogo y el segundo ya salió de preview.
|
|
181
|
+
{ id: "gemini-3.6-flash", providerId: "gemini", name: "Gemini 3.6 Flash", modelType: "llm", contextWindow: 1048576, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 1.5, outputPer1M: 7.5 },
|
|
182
|
+
{ id: "gemini-3.5-flash", providerId: "gemini", name: "Gemini 3.5 Flash", modelType: "llm", contextWindow: 1048576, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 1.5, outputPer1M: 9 },
|
|
183
|
+
{ id: "gemini-3.5-flash-lite", providerId: "gemini", name: "Gemini 3.5 Flash Lite", modelType: "llm", contextWindow: 1048576, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming"]), inputPer1M: 0.3, outputPer1M: 2.5 },
|
|
184
|
+
{ id: "gemini-3.1-pro-preview", providerId: "gemini", name: "Gemini 3.1 Pro Preview", modelType: "llm", contextWindow: 1048576, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 2, outputPer1M: 12 },
|
|
185
|
+
{ id: "gemini-3.1-flash-lite", providerId: "gemini", name: "Gemini 3.1 Flash Lite", modelType: "llm", contextWindow: 1048576, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming"]), inputPer1M: 0.25, outputPer1M: 1.5 },
|
|
166
186
|
|
|
167
187
|
// TTS
|
|
168
188
|
{ id: "gemini-2.5-flash-preview-tts", providerId: "gemini", name: "Gemini 2.5 Flash TTS", modelType: "tts", contextWindow: 0, capabilities: JSON.stringify(["tts", "speech"]) },
|
|
169
189
|
{ id: "gemini-2.5-pro-preview-tts", providerId: "gemini", name: "Gemini 2.5 Pro TTS", modelType: "tts", contextWindow: 0, capabilities: JSON.stringify(["tts", "speech", "high_quality"]) },
|
|
170
190
|
|
|
171
191
|
// ── Mistral (fuente: openrouter.ai/mistralai + docs.mistral.ai) ──
|
|
172
|
-
{ id: "mistral-large-2512", providerId: "mistral", name: "Mistral Large 2512", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming"]) },
|
|
173
|
-
{ id: "devstral-2512", providerId: "mistral", name: "Devstral 2512", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]) },
|
|
174
|
-
{ id: "ministral-14b-2512", providerId: "mistral", name: "Ministral 14B", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]) },
|
|
175
|
-
{ id: "ministral-8b-2512", providerId: "mistral", name: "Ministral 8B", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]) },
|
|
176
|
-
{ id: "codestral-2508", providerId: "mistral", name: "Codestral 2508", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]) },
|
|
177
|
-
{ id: "mistral-small-3.2-24b-instruct", providerId: "mistral", name: "Mistral Small 3.2 24B", modelType: "llm", contextWindow: 131072, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]) },
|
|
192
|
+
{ id: "mistral-large-2512", providerId: "mistral", name: "Mistral Large 2512", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming"]), inputPer1M: 0.5, outputPer1M: 1.5 },
|
|
193
|
+
{ id: "devstral-2512", providerId: "mistral", name: "Devstral 2512", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]), inputPer1M: 0.4, outputPer1M: 2 },
|
|
194
|
+
{ id: "ministral-14b-2512", providerId: "mistral", name: "Ministral 14B", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]), inputPer1M: 0.2, outputPer1M: 0.2 },
|
|
195
|
+
{ id: "ministral-8b-2512", providerId: "mistral", name: "Ministral 8B", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]), inputPer1M: 0.15, outputPer1M: 0.15 },
|
|
196
|
+
{ id: "codestral-2508", providerId: "mistral", name: "Codestral 2508", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]), inputPer1M: 0.2, outputPer1M: 0.6 },
|
|
197
|
+
{ id: "mistral-small-3.2-24b-instruct", providerId: "mistral", name: "Mistral Small 3.2 24B", modelType: "llm", contextWindow: 131072, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]), inputPer1M: 0.1, outputPer1M: 0.3 },
|
|
178
198
|
// Aliases (siguen funcionando en la API de Mistral)
|
|
179
|
-
{ id: "mistral-large-latest", providerId: "mistral", name: "Mistral Large (latest)", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming"]) },
|
|
180
|
-
{ id: "codestral-latest", providerId: "mistral", name: "Codestral (latest)", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]) },
|
|
199
|
+
{ id: "mistral-large-latest", providerId: "mistral", name: "Mistral Large (latest)", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming"]), inputPer1M: 0.5, outputPer1M: 1.5 },
|
|
200
|
+
{ id: "codestral-latest", providerId: "mistral", name: "Codestral (latest)", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]), inputPer1M: 0.2, outputPer1M: 0.6 },
|
|
181
201
|
|
|
182
202
|
// ── DeepSeek (fuente: api-docs.deepseek.com/quick_start/pricing) ──
|
|
183
|
-
//
|
|
184
|
-
|
|
185
|
-
{ id: "deepseek-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
{ id: "
|
|
191
|
-
{ id: "
|
|
192
|
-
{ id: "
|
|
193
|
-
|
|
194
|
-
// ── OpenRouter
|
|
203
|
+
// V4 reemplazó a deepseek-chat/deepseek-reasoner (V3.2): 1M de contexto,
|
|
204
|
+
// 384K de salida máxima y tool calling en ambos.
|
|
205
|
+
{ id: "deepseek-v4-pro", providerId: "deepseek", name: "DeepSeek V4 Pro", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming", "code", "reasoning"]), inputPer1M: 0.435, outputPer1M: 0.87 },
|
|
206
|
+
{ id: "deepseek-v4-flash", providerId: "deepseek", name: "DeepSeek V4 Flash", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming", "code", "reasoning"]), inputPer1M: 0.14, outputPer1M: 0.28 },
|
|
207
|
+
|
|
208
|
+
// ── Kimi / Moonshot (fuente: platform.kimi.ai/docs/pricing/chat) ──
|
|
209
|
+
// La serie moonshot-v1-* se apaga el 2026-08-31; K2/K2.5 quedaron superadas.
|
|
210
|
+
{ id: "kimi-k3", providerId: "kimi", name: "Kimi K3", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "code", "reasoning"]), inputPer1M: 3, outputPer1M: 15 },
|
|
211
|
+
{ id: "kimi-k2.7-code", providerId: "kimi", name: "Kimi K2.7 Code", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "code"]), inputPer1M: 0.73, outputPer1M: 3.5 },
|
|
212
|
+
{ id: "kimi-k2.6", providerId: "kimi", name: "Kimi K2.6", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "code"]), inputPer1M: 0.6, outputPer1M: 3.41 },
|
|
213
|
+
|
|
214
|
+
// ── OpenRouter (fuente: GET https://openrouter.ai/api/v1/models) ──
|
|
215
|
+
// Solo modelos vivos con `tools` en supported_parameters y publicados desde
|
|
216
|
+
// 2025-07. contextWindow = context_length reportado por el propio catálogo.
|
|
195
217
|
// Anthropic
|
|
196
|
-
{ id: "anthropic/claude-opus-
|
|
197
|
-
{ id: "anthropic/claude-sonnet-
|
|
198
|
-
// OpenAI
|
|
199
|
-
{ id: "openai/gpt-5.
|
|
200
|
-
{ id: "openai/gpt-5.
|
|
201
|
-
{ id: "openai/gpt-5.
|
|
218
|
+
{ id: "anthropic/claude-opus-5", providerId: "openrouter", name: "Claude Opus 5 (OR)", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "code", "reasoning"]), inputPer1M: 5, outputPer1M: 25 },
|
|
219
|
+
{ id: "anthropic/claude-sonnet-5", providerId: "openrouter", name: "Claude Sonnet 5 (OR)", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "code", "reasoning"]), inputPer1M: 2, outputPer1M: 10 },
|
|
220
|
+
// OpenAI — la serie 5.6 se divide en Sol (flagship), Terra (equilibrado) y Luna (económico)
|
|
221
|
+
{ id: "openai/gpt-5.6-sol", providerId: "openrouter", name: "GPT-5.6 Sol (OR)", modelType: "llm", contextWindow: 1050000, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "code", "reasoning"]), inputPer1M: 5, outputPer1M: 30 },
|
|
222
|
+
{ id: "openai/gpt-5.6-terra", providerId: "openrouter", name: "GPT-5.6 Terra (OR)", modelType: "llm", contextWindow: 1050000, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "code"]), inputPer1M: 1, outputPer1M: 6 },
|
|
223
|
+
{ id: "openai/gpt-5.6-luna", providerId: "openrouter", name: "GPT-5.6 Luna (OR)", modelType: "llm", contextWindow: 1050000, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming"]), inputPer1M: 0.1, outputPer1M: 0.6 },
|
|
202
224
|
// Google
|
|
203
|
-
{ id: "google/gemini-3.
|
|
204
|
-
{ id: "google/gemini-3.
|
|
205
|
-
{ id: "google/gemini-3-
|
|
206
|
-
{ id: "google/gemini-2.5-flash", providerId: "openrouter", name: "Gemini 2.5 Flash (OR)", modelType: "llm", contextWindow: 1048576, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming"]) },
|
|
207
|
-
{ id: "google/gemini-3-flash-preview", providerId: "openrouter", name: "Gemini 3 Flash (OR)", modelType: "llm", contextWindow: 1048576, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming"]) },
|
|
208
|
-
// Meta Llama
|
|
209
|
-
{ id: "meta-llama/llama-3.3-70b-instruct", providerId: "openrouter", name: "Llama 3.3 70B", modelType: "llm", contextWindow: 128000, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]) },
|
|
210
|
-
{ id: "meta-llama/llama-4-maverick", providerId: "openrouter", name: "Llama 4 Maverick", modelType: "llm", contextWindow: 524288, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming"]) },
|
|
225
|
+
{ id: "google/gemini-3.6-flash", providerId: "openrouter", name: "Gemini 3.6 Flash (OR)", modelType: "llm", contextWindow: 1048576, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 1.5, outputPer1M: 7.5 },
|
|
226
|
+
{ id: "google/gemini-3.5-flash", providerId: "openrouter", name: "Gemini 3.5 Flash (OR)", modelType: "llm", contextWindow: 1048576, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 1.5, outputPer1M: 9 },
|
|
227
|
+
{ id: "google/gemini-3.1-pro-preview", providerId: "openrouter", name: "Gemini 3.1 Pro (OR)", modelType: "llm", contextWindow: 1048576, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 2, outputPer1M: 12 },
|
|
211
228
|
// DeepSeek
|
|
212
|
-
{ id: "deepseek/deepseek-
|
|
213
|
-
{ id: "deepseek/deepseek-
|
|
229
|
+
{ id: "deepseek/deepseek-v4-pro", providerId: "openrouter", name: "DeepSeek V4 Pro (OR)", modelType: "llm", contextWindow: 1048576, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming", "code", "reasoning"]), inputPer1M: 0.435, outputPer1M: 0.87 },
|
|
230
|
+
{ id: "deepseek/deepseek-v4-flash", providerId: "openrouter", name: "DeepSeek V4 Flash (OR)", modelType: "llm", contextWindow: 1048576, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming", "code"]), inputPer1M: 0.14, outputPer1M: 0.28 },
|
|
214
231
|
// Kimi
|
|
215
|
-
{ id: "moonshotai/kimi-
|
|
232
|
+
{ id: "moonshotai/kimi-k3", providerId: "openrouter", name: "Kimi K3 (OR)", modelType: "llm", contextWindow: 1048576, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "code", "reasoning"]), inputPer1M: 3, outputPer1M: 15 },
|
|
233
|
+
{ id: "moonshotai/kimi-k2.7-code", providerId: "openrouter", name: "Kimi K2.7 Code (OR)", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "code"]), inputPer1M: 0.73, outputPer1M: 3.5 },
|
|
234
|
+
// MiniMax
|
|
235
|
+
{ id: "minimax/minimax-m3", providerId: "openrouter", name: "MiniMax M3 (OR)", modelType: "llm", contextWindow: 1048576, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "code", "reasoning"]), inputPer1M: 0.3, outputPer1M: 1.2 },
|
|
236
|
+
// Z.ai / GLM
|
|
237
|
+
{ id: "z-ai/glm-5.2", providerId: "openrouter", name: "GLM 5.2 (OR)", modelType: "llm", contextWindow: 1048576, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming", "code", "reasoning"]), inputPer1M: 0.63, outputPer1M: 1.98 },
|
|
216
238
|
// Qwen
|
|
217
|
-
{ id: "qwen/qwen3.
|
|
218
|
-
{ id: "qwen/qwen3.
|
|
219
|
-
|
|
220
|
-
{ id: "
|
|
239
|
+
{ id: "qwen/qwen3.8-max", providerId: "openrouter", name: "Qwen3.8 Max (OR)", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 2, outputPer1M: 6 },
|
|
240
|
+
{ id: "qwen/qwen3.7-flash", providerId: "openrouter", name: "Qwen3.7 Flash (OR)", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]), inputPer1M: 0.03, outputPer1M: 0.13 },
|
|
241
|
+
// xAI
|
|
242
|
+
{ id: "x-ai/grok-4.5", providerId: "openrouter", name: "Grok 4.5 (OR)", modelType: "llm", contextWindow: 500000, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 2, outputPer1M: 6 },
|
|
243
|
+
// Mistral
|
|
244
|
+
{ id: "mistralai/mistral-medium-3-5", providerId: "openrouter", name: "Mistral Medium 3.5 (OR)", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming", "code"]), inputPer1M: 1.5, outputPer1M: 7.5 },
|
|
221
245
|
|
|
222
246
|
|
|
223
247
|
// ── Groq (fuente: console.groq.com/docs/models) ──
|
|
224
|
-
{ id: "llama-3.3-70b-versatile", providerId: "groq", name: "Llama 3.3 70B", modelType: "llm", contextWindow: 131072, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]) },
|
|
225
|
-
{ id: "llama-3.1-8b-instant", providerId: "groq", name: "Llama 3.1 8B Instant", modelType: "llm", contextWindow: 131072, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]) },
|
|
226
|
-
{ id: "openai/gpt-oss-120b", providerId: "groq", name: "GPT OSS 120B", modelType: "llm", contextWindow: 131072, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming", "code"]) },
|
|
227
|
-
{ id: "openai/gpt-oss-20b", providerId: "groq", name: "GPT OSS 20B", modelType: "llm", contextWindow: 131072, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]) },
|
|
228
|
-
{ id: "groq/compound", providerId: "groq", name: "Groq Compound", modelType: "llm", contextWindow: 131072, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]) },
|
|
229
|
-
{ id: "groq/compound-mini", providerId: "groq", name: "Groq Compound Mini", modelType: "llm", contextWindow: 131072, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]) },
|
|
230
|
-
{ id: "moonshotai/kimi-k2-instruct-0905", providerId: "groq", name: "Kimi K2 (Groq)", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming", "code"]) },
|
|
231
|
-
{ id: "qwen/qwen3-32b", providerId: "groq", name: "Qwen3 32B (Groq)", modelType: "llm", contextWindow: 128000, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming", "reasoning"]) },
|
|
248
|
+
{ id: "llama-3.3-70b-versatile", providerId: "groq", name: "Llama 3.3 70B", modelType: "llm", contextWindow: 131072, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]), inputPer1M: 0.59, outputPer1M: 0.79 },
|
|
249
|
+
{ id: "llama-3.1-8b-instant", providerId: "groq", name: "Llama 3.1 8B Instant", modelType: "llm", contextWindow: 131072, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]), inputPer1M: 0.05, outputPer1M: 0.08 },
|
|
250
|
+
{ id: "openai/gpt-oss-120b", providerId: "groq", name: "GPT OSS 120B", modelType: "llm", contextWindow: 131072, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming", "code"]), inputPer1M: 0.15, outputPer1M: 0.6 },
|
|
251
|
+
{ id: "openai/gpt-oss-20b", providerId: "groq", name: "GPT OSS 20B", modelType: "llm", contextWindow: 131072, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]), inputPer1M: 0.075, outputPer1M: 0.3 },
|
|
252
|
+
{ id: "groq/compound", providerId: "groq", name: "Groq Compound", modelType: "llm", contextWindow: 131072, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]), inputPer1M: 0, outputPer1M: 0 },
|
|
253
|
+
{ id: "groq/compound-mini", providerId: "groq", name: "Groq Compound Mini", modelType: "llm", contextWindow: 131072, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]), inputPer1M: 0, outputPer1M: 0 },
|
|
254
|
+
{ id: "moonshotai/kimi-k2-instruct-0905", providerId: "groq", name: "Kimi K2 (Groq)", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming", "code"]), inputPer1M: 0.45, outputPer1M: 2.2 },
|
|
255
|
+
{ id: "qwen/qwen3-32b", providerId: "groq", name: "Qwen3 32B (Groq)", modelType: "llm", contextWindow: 128000, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 0, outputPer1M: 0 },
|
|
232
256
|
{ id: "whisper-large-v3", providerId: "groq", name: "Whisper Large V3", modelType: "stt", contextWindow: 0, capabilities: JSON.stringify(["transcription"]) },
|
|
233
257
|
{ id: "whisper-large-v3-turbo", providerId: "groq", name: "Whisper Large V3 Turbo", modelType: "stt", contextWindow: 0, capabilities: JSON.stringify(["transcription"]) },
|
|
234
|
-
|
|
258
|
+
// Orpheus de Canopy Labs: reemplazan a playai-tts / playai-tts-arabic, que
|
|
259
|
+
// Groq deprecó en diciembre de 2025. Sólo aceptan response_format "wav".
|
|
260
|
+
{ id: "canopylabs/orpheus-v1-english", providerId: "groq", name: "Orpheus V1 English (Groq)", modelType: "tts", contextWindow: 0, capabilities: JSON.stringify(["tts", "speech", "expressive", "english"]) },
|
|
261
|
+
{ id: "canopylabs/orpheus-arabic-saudi", providerId: "groq", name: "Orpheus Arabic Saudi (Groq)", modelType: "tts", contextWindow: 0, capabilities: JSON.stringify(["tts", "speech", "arabic"]) },
|
|
262
|
+
// distil-whisper-large-v3-en salió del catálogo: Groq lo deprecó en favor de
|
|
263
|
+
// whisper-large-v3-turbo, así que la fila sólo servía para que el selector de
|
|
264
|
+
// STT del canal ofreciera un modelo que falla contra la API al transcribir.
|
|
235
265
|
|
|
236
266
|
// ── Ollama: models are detected at runtime via /api/setup/ollama-models and inserted dynamically ──
|
|
237
267
|
|
|
@@ -242,58 +272,91 @@ export const SEED_DATA: SeedData = {
|
|
|
242
272
|
{ id: "eleven_multilingual_v2", providerId: "elevenlabs", name: "Eleven Multilingual V2", modelType: "tts", contextWindow: 0, capabilities: JSON.stringify(["tts", "multilingual"]) },
|
|
243
273
|
{ id: "eleven_v3", providerId: "elevenlabs", name: "Eleven V3", modelType: "tts", contextWindow: 0, capabilities: JSON.stringify(["tts", "speech", "expressive"]) },
|
|
244
274
|
|
|
245
|
-
// ── Qwen (Alibaba DashScope) ──
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
{ id: "qwen3.
|
|
275
|
+
// ── Qwen (Alibaba DashScope / Model Studio) ──
|
|
276
|
+
// Serie 3.7 = generación actual. Los contextWindow salen del catálogo de
|
|
277
|
+
// OpenRouter, que enruta a los mismos modelos: el `qwen3.6-max-preview` que
|
|
278
|
+
// estaba sembrado con 32768 en realidad tiene 262144.
|
|
279
|
+
{ id: "qwen3.7-max", providerId: "qwen", name: "Qwen 3.7 Max", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 1.475, outputPer1M: 4.425 },
|
|
280
|
+
{ id: "qwen3.7-plus", providerId: "qwen", name: "Qwen 3.7 Plus", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 0.32, outputPer1M: 1.28 },
|
|
281
|
+
{ id: "qwen3.6-flash", providerId: "qwen", name: "Qwen 3.6 Flash", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]), inputPer1M: 0.1875, outputPer1M: 1.125 },
|
|
282
|
+
{ id: "qwen3.5-omni-plus", providerId: "qwen", name: "Qwen 3.5 Omni Plus", modelType: "llm", contextWindow: 131072, capabilities: JSON.stringify(["chat", "json_mode", "function_calling", "streaming"]), inputPer1M: 0.32, outputPer1M: 1.28 },
|
|
250
283
|
|
|
251
284
|
// ── Qwen (TTS) ──
|
|
252
285
|
{ id: "qwen3-tts-instruct-flash", providerId: "qwen", name: "Qwen TTS Instruct Flash", modelType: "tts", contextWindow: 0, capabilities: JSON.stringify(["tts", "speech"]) },
|
|
253
286
|
{ id: "qwen3-tts-flash", providerId: "qwen", name: "Qwen TTS Flash", modelType: "tts", contextWindow: 0, capabilities: JSON.stringify(["tts", "speech"]) },
|
|
254
287
|
{ id: "qwen-tts", providerId: "qwen", name: "Qwen TTS", modelType: "tts", contextWindow: 0, capabilities: JSON.stringify(["tts", "speech"]) },
|
|
255
288
|
|
|
256
|
-
// ── NVIDIA NIM (fuente:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
{ id: "
|
|
267
|
-
{ id: "
|
|
268
|
-
{ id: "
|
|
289
|
+
// ── NVIDIA NIM (fuente: GET https://integrate.api.nvidia.com/v1/models) ──
|
|
290
|
+
// Solo los mejores modelos agénticos (tool calling) del catálogo vivo. NVIDIA
|
|
291
|
+
// retira modelos del endpoint sin avisar y responde 410 Gone al llamarlos, así
|
|
292
|
+
// que esta lista se valida contra /v1/models — no contra la web de build.nvidia.com,
|
|
293
|
+
// que sigue mostrando fichas de modelos ya retirados. Verificado 2026-08-11.
|
|
294
|
+
// Nota: Qwen ya no tiene ningún modelo en el catálogo NVIDIA (todos retirados);
|
|
295
|
+
// para Qwen usar el provider `qwen` (DashScope) directamente.
|
|
296
|
+
// DeepSeek V4 Pro (deepseek-ai/deepseek-v4-pro) se sacó: devuelve 404
|
|
297
|
+
// "Function not found for account" en cuentas normales — no está habilitado
|
|
298
|
+
// de forma general aunque figure en el listado público de /v1/models.
|
|
299
|
+
{ id: "z-ai/glm-5.2", providerId: "nvidia", name: "GLM 5.2 (NVIDIA)", modelType: "llm", contextWindow: 200000, capabilities: JSON.stringify(["chat", "code", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 0, outputPer1M: 0 },
|
|
300
|
+
{ id: "moonshotai/kimi-k2.6", providerId: "nvidia", name: "Kimi K2.6 (NVIDIA)", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "code", "vision", "function_calling", "streaming", "reasoning"]), inputPer1M: 0, outputPer1M: 0 },
|
|
301
|
+
{ id: "minimaxai/minimax-m3", providerId: "nvidia", name: "MiniMax M3 (NVIDIA)", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "code", "vision", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 0, outputPer1M: 0 },
|
|
302
|
+
{ id: "nvidia/nemotron-3-ultra-550b-a55b", providerId: "nvidia", name: "Nemotron 3 Ultra 550B", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "code", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 0, outputPer1M: 0 },
|
|
303
|
+
{ id: "nvidia/nemotron-3-super-120b-a12b", providerId: "nvidia", name: "Nemotron 3 Super 120B", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "code", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 0, outputPer1M: 0 },
|
|
304
|
+
|
|
305
|
+
// ── ModelScope Qwen (fuente: GET https://api-inference.modelscope.ai/v1/models) ──
|
|
306
|
+
// Endpoint gratuito dentro de cuota (2000 llamadas/día, ≤500 por modelo), por
|
|
307
|
+
// eso todos van con precio 0 explícito y no vacío.
|
|
308
|
+
//
|
|
309
|
+
// Los Qwen-Ambassador son modelos no-públicos: se listan para cualquiera pero
|
|
310
|
+
// sólo los invoca una cuenta del programa de embajadores. Con otra cuenta el
|
|
311
|
+
// provider devuelve un error de autorización, que ahora llega al usuario como
|
|
312
|
+
// mensaje accionable en vez de guardarse como respuesta del agente.
|
|
313
|
+
// Verificados contra la API: chat, tool calling y streaming los tres.
|
|
314
|
+
{ id: "Qwen-Ambassador/Qwen3.8-Max", providerId: "modelscope", name: "Qwen3.8 Max (Embajador)", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "code", "vision", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 0, outputPer1M: 0 },
|
|
315
|
+
{ id: "Qwen-Ambassador/Qwen3.7-Max", providerId: "modelscope", name: "Qwen3.7 Max (Embajador)", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "code", "vision", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 0, outputPer1M: 0 },
|
|
316
|
+
{ id: "Qwen-Ambassador/Qwen3.7-Plus", providerId: "modelscope", name: "Qwen3.7 Plus (Embajador)", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "code", "vision", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 0, outputPer1M: 0 },
|
|
317
|
+
// Open-weight del mismo endpoint, para cuentas sin permiso de embajador.
|
|
318
|
+
{ id: "Qwen/Qwen3.5-397B-A17B", providerId: "modelscope", name: "Qwen3.5 397B (ModelScope)", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "code", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 0, outputPer1M: 0 },
|
|
319
|
+
{ id: "Qwen/Qwen3-Next-80B-A3B-Instruct", providerId: "modelscope", name: "Qwen3 Next 80B (ModelScope)", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "code", "json_mode", "function_calling", "streaming"]), inputPer1M: 0, outputPer1M: 0 },
|
|
320
|
+
{ id: "Qwen/Qwen3-Coder-30B-A3B-Instruct", providerId: "modelscope", name: "Qwen3 Coder 30B (ModelScope)", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "code", "json_mode", "function_calling", "streaming"]), inputPer1M: 0, outputPer1M: 0 },
|
|
321
|
+
{ id: "Qwen/Qwen3-VL-235B-A22B-Instruct", providerId: "modelscope", name: "Qwen3 VL 235B (ModelScope)", modelType: "llm", contextWindow: 131072, capabilities: JSON.stringify(["chat", "vision", "json_mode", "function_calling", "streaming"]), inputPer1M: 0, outputPer1M: 0 },
|
|
269
322
|
|
|
270
323
|
// ── MiniMax (fuente: platform.minimaxi.com) — OpenAI-compatible endpoint ──
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
{ id: "MiniMax-
|
|
274
|
-
{ id: "MiniMax-M2.
|
|
275
|
-
{ id: "MiniMax-M2.
|
|
324
|
+
// La M2.x tiene 204800 de contexto, no 1M: ese valor solo aplica a M3. Estaba
|
|
325
|
+
// mal y hacía que la compactación no disparara hasta muy pasado el límite real.
|
|
326
|
+
{ id: "MiniMax-M3", providerId: "minimax", name: "MiniMax M3", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "code", "vision", "function_calling", "streaming", "reasoning"]), inputPer1M: 0.3, outputPer1M: 1.2 },
|
|
327
|
+
{ id: "MiniMax-M2.7", providerId: "minimax", name: "MiniMax M2.7", modelType: "llm", contextWindow: 204800, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]), inputPer1M: 0.3, outputPer1M: 1.2 },
|
|
328
|
+
{ id: "MiniMax-M2.7-highspeed", providerId: "minimax", name: "MiniMax M2.7 Highspeed", modelType: "llm", contextWindow: 204800, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]), inputPer1M: 0.3, outputPer1M: 1.2 },
|
|
329
|
+
|
|
330
|
+
// ── Z.ai / GLM (fuente: docs.z.ai/guides/llm) — OpenAI-compatible endpoint ──
|
|
331
|
+
{ id: "glm-5.2", providerId: "z-ai", name: "GLM 5.2", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "code", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 0.63, outputPer1M: 1.98 },
|
|
332
|
+
{ id: "glm-5.1", providerId: "z-ai", name: "GLM 5.1", modelType: "llm", contextWindow: 204800, capabilities: JSON.stringify(["chat", "code", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 0.97, outputPer1M: 3.04 },
|
|
333
|
+
{ id: "glm-5", providerId: "z-ai", name: "GLM 5", modelType: "llm", contextWindow: 200000, capabilities: JSON.stringify(["chat", "code", "json_mode", "function_calling", "streaming", "reasoning"]), inputPer1M: 0.97, outputPer1M: 3.04 },
|
|
276
334
|
|
|
277
335
|
// ── OpenCode Go (fuente: opencode.ai) — OpenAI-compatible endpoint ──
|
|
278
|
-
{ id: "
|
|
279
|
-
{ id: "
|
|
280
|
-
{ id: "
|
|
281
|
-
{ id: "
|
|
282
|
-
{ id: "
|
|
283
|
-
{ id: "
|
|
284
|
-
{ id: "
|
|
285
|
-
{ id: "
|
|
286
|
-
{ id: "
|
|
287
|
-
{ id: "
|
|
288
|
-
{ id: "
|
|
289
|
-
{ id: "
|
|
290
|
-
{ id: "
|
|
291
|
-
{ id: "
|
|
336
|
+
{ id: "minimax-m3", providerId: "opencode-go", name: "MiniMax M3", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "code", "vision", "function_calling", "streaming", "reasoning"]), inputPer1M: 0, outputPer1M: 0 },
|
|
337
|
+
{ id: "minimax-m2.7", providerId: "opencode-go", name: "MiniMax M2.7", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]), inputPer1M: 0, outputPer1M: 0 },
|
|
338
|
+
{ id: "minimax-m2.5", providerId: "opencode-go", name: "MiniMax M2.5", modelType: "llm", contextWindow: 1000000, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]), inputPer1M: 0, outputPer1M: 0 },
|
|
339
|
+
{ id: "kimi-k2.6", providerId: "opencode-go", name: "Kimi K2.6", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]), inputPer1M: 0, outputPer1M: 0 },
|
|
340
|
+
{ id: "kimi-k2.5", providerId: "opencode-go", name: "Kimi K2.5", modelType: "llm", contextWindow: 262144, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]), inputPer1M: 0, outputPer1M: 0 },
|
|
341
|
+
{ id: "glm-5.1", providerId: "opencode-go", name: "GLM-5.1", modelType: "llm", contextWindow: 128000, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]), inputPer1M: 0, outputPer1M: 0 },
|
|
342
|
+
{ id: "glm-5", providerId: "opencode-go", name: "GLM-5", modelType: "llm", contextWindow: 128000, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]), inputPer1M: 0, outputPer1M: 0 },
|
|
343
|
+
{ id: "deepseek-v4-pro", providerId: "opencode-go", name: "DeepSeek V4 Pro", modelType: "llm", contextWindow: 128000, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming", "reasoning"]), inputPer1M: 0, outputPer1M: 0 },
|
|
344
|
+
{ id: "deepseek-v4-flash", providerId: "opencode-go", name: "DeepSeek V4 Flash", modelType: "llm", contextWindow: 128000, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]), inputPer1M: 0, outputPer1M: 0 },
|
|
345
|
+
{ id: "mimo-v2-pro", providerId: "opencode-go", name: "MiMo-V2 Pro", modelType: "llm", contextWindow: 128000, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming", "reasoning"]), inputPer1M: 0, outputPer1M: 0 },
|
|
346
|
+
{ id: "mimo-v2-omni", providerId: "opencode-go", name: "MiMo-V2 Omni", modelType: "llm", contextWindow: 128000, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]), inputPer1M: 0, outputPer1M: 0 },
|
|
347
|
+
{ id: "mimo-v2.5-pro", providerId: "opencode-go", name: "MiMo-V2.5 Pro", modelType: "llm", contextWindow: 128000, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming", "reasoning"]), inputPer1M: 0, outputPer1M: 0 },
|
|
348
|
+
{ id: "mimo-v2.5", providerId: "opencode-go", name: "MiMo-V2.5", modelType: "llm", contextWindow: 128000, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]), inputPer1M: 0, outputPer1M: 0 },
|
|
349
|
+
{ id: "hy3-preview", providerId: "opencode-go", name: "Hunyuan 3 Preview", modelType: "llm", contextWindow: 128000, capabilities: JSON.stringify(["chat", "code", "function_calling", "streaming"]), inputPer1M: 0, outputPer1M: 0 },
|
|
292
350
|
|
|
293
351
|
// ── HiveAgents (llama.cpp local servido vía Cloudflare) ──
|
|
294
352
|
// Modelo único recomendado para distribución Hive single-machine.
|
|
295
353
|
// Ver API.md para detalles de carga e inferencia.
|
|
296
|
-
|
|
354
|
+
//
|
|
355
|
+
// El id ES el nombre del archivo .gguf que sirve llama.cpp, así que cambia
|
|
356
|
+
// con cada bump del modelo. Al renombrarlo, el re-seed borra la fila vieja y
|
|
357
|
+
// crea la nueva desactivada, y desvincula a los agentes que apuntaban a la
|
|
358
|
+
// anterior: hay que volver a elegir el modelo en la UI una vez.
|
|
359
|
+
{ id: "Qwen3.6-35B-A3B-UD-Q4_K_M.gguf", providerId: "hiveagents", name: "Qwen3.6 35B MoE (Recomendado)", modelType: "llm", contextWindow: 50000, capabilities: JSON.stringify(["chat", "streaming", "reasoning", "function_calling"]), inputPer1M: 0, outputPer1M: 0 },
|
|
297
360
|
],
|
|
298
361
|
|
|
299
362
|
|
|
@@ -431,14 +494,36 @@ const RETIRED_SKILL_IDS = [
|
|
|
431
494
|
"mcp_lazy_operator",
|
|
432
495
|
];
|
|
433
496
|
|
|
497
|
+
// Modelos de voz que salieron del catálogo, con su reemplazo. Borrar la fila del
|
|
498
|
+
// seed no alcanza: el canal guarda el id del modelo en stt_provider/tts_provider,
|
|
499
|
+
// así que quedaría apuntando a una fila que ya no existe y la transcripción
|
|
500
|
+
// fallaría igual, sólo que con otro mensaje. Mapear a null desactiva la voz.
|
|
501
|
+
const RETIRED_VOICE_MODELS: Record<string, string | null> = {
|
|
502
|
+
// Groq lo deprecó en favor de turbo, que además cubre más idiomas.
|
|
503
|
+
"groq/distil-whisper-large-v3-en": "groq/whisper-large-v3-turbo",
|
|
504
|
+
};
|
|
505
|
+
|
|
434
506
|
const RETIRED_CATALOG_AGENT_IDS = [
|
|
435
507
|
"canvas_presenter",
|
|
436
508
|
// Kept only as an upgrade tombstone so existing installations remove the
|
|
437
509
|
// former generic MCP worker. New MCP specialists are user-owned and scoped
|
|
438
510
|
// persistently to one server.
|
|
439
511
|
"mcp_integration_operator",
|
|
512
|
+
// The independent verifier agent was replaced by deterministic acceptance
|
|
513
|
+
// checks (agent/acceptance-checks.ts) plus the coordinator judging the
|
|
514
|
+
// delivery itself in the closing turn — no extra agent loop per task.
|
|
515
|
+
"acceptance_verifier",
|
|
440
516
|
];
|
|
441
517
|
|
|
518
|
+
function parseSkillList(value: string | null | undefined): string[] {
|
|
519
|
+
try {
|
|
520
|
+
const parsed = value ? JSON.parse(value) : [];
|
|
521
|
+
return Array.isArray(parsed) ? parsed.filter((id): id is string => typeof id === "string") : [];
|
|
522
|
+
} catch {
|
|
523
|
+
return [];
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
|
|
442
527
|
const LEGACY_CRON_PERSONA = {
|
|
443
528
|
id: "schedule_automation_agent",
|
|
444
529
|
name: "Operador de agenda",
|
|
@@ -504,6 +589,15 @@ async function pruneRetired(): Promise<void> {
|
|
|
504
589
|
}
|
|
505
590
|
}
|
|
506
591
|
|
|
592
|
+
// The independent-verifier agent's audit trail is gone with it — no reader
|
|
593
|
+
// exists for the `verifications` collection anymore.
|
|
594
|
+
const verificationsCol = await col<{ id: string }>("verifications");
|
|
595
|
+
const staleVerifications = await verificationsCol.scan({});
|
|
596
|
+
for (const entry of staleVerifications) {
|
|
597
|
+
await verificationsCol.delete(entry.id);
|
|
598
|
+
removed++;
|
|
599
|
+
}
|
|
600
|
+
|
|
507
601
|
if (removed > 0) log.info(`[seed] 🗑️ Removed ${removed} retired capability row(s)`);
|
|
508
602
|
}
|
|
509
603
|
|
|
@@ -614,39 +708,50 @@ export async function seedAllData(): Promise<void> {
|
|
|
614
708
|
}
|
|
615
709
|
log.info(`[seed] ✅ ${providerCount} providers procesados`);
|
|
616
710
|
|
|
617
|
-
// 5️⃣ Models
|
|
618
|
-
//
|
|
619
|
-
|
|
711
|
+
// 5️⃣ Models — wipe & recreate.
|
|
712
|
+
//
|
|
713
|
+
// Actualizar el catálogo es editar SEED_DATA.models y arrancar: las filas de
|
|
714
|
+
// catálogo se borran enteras y se vuelven a crear, así ningún campo viejo
|
|
715
|
+
// (context_window, capabilities, precio) sobrevive a una entrada renombrada
|
|
716
|
+
// o corregida. Un upsert en sitio no daba esa garantía.
|
|
717
|
+
//
|
|
718
|
+
// Dos cosas sí se preservan a propósito:
|
|
719
|
+
// - enabled/active por id, para no desactivar el modelo que el usuario
|
|
720
|
+
// eligió cada vez que se publica un catálogo nuevo;
|
|
721
|
+
// - las filas source != "catalog" (Ollama tags, /v1/models), que no tienen
|
|
722
|
+
// origen canónico desde el que recrearse.
|
|
723
|
+
log.info("[seed] 🔄 Re-seeding models (wipe & recreate)...");
|
|
620
724
|
const modelsCol = await col<ModelDoc>("models");
|
|
621
|
-
const
|
|
725
|
+
const beforeWipe = await modelsCol.scan({});
|
|
726
|
+
|
|
727
|
+
const activationState = new Map(
|
|
728
|
+
beforeWipe.map((e) => [e.id, { enabled: e.doc.enabled, active: e.doc.active }])
|
|
729
|
+
);
|
|
730
|
+
|
|
731
|
+
let wipedModels = 0;
|
|
732
|
+
for (const row of beforeWipe) {
|
|
733
|
+
if (row.doc.source !== "catalog") continue;
|
|
734
|
+
await modelsCol.delete(row.id);
|
|
735
|
+
wipedModels++;
|
|
736
|
+
}
|
|
622
737
|
|
|
623
738
|
let modelCount = 0;
|
|
624
739
|
for (const model of SEED_DATA.models) {
|
|
625
|
-
const
|
|
626
|
-
|
|
627
|
-
|
|
740
|
+
const key = catalogModelKey(model.providerId, model.id);
|
|
741
|
+
const previous = activationState.get(key);
|
|
742
|
+
await modelsCol.put(key, {
|
|
743
|
+
id: key, provider_id: model.providerId, name: model.name,
|
|
628
744
|
model_type: model.modelType as ModelDoc["model_type"],
|
|
629
745
|
context_window: model.contextWindow || 0, capabilities: model.capabilities || null,
|
|
630
|
-
enabled:
|
|
746
|
+
enabled: previous?.enabled ?? true, active: previous?.active ?? false,
|
|
631
747
|
source: "catalog",
|
|
748
|
+
input_per_1m: model.inputPer1M ?? null,
|
|
749
|
+
output_per_1m: model.outputPer1M ?? null,
|
|
632
750
|
});
|
|
633
|
-
existingModels.delete(model.id);
|
|
634
751
|
modelCount++;
|
|
635
752
|
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
// provider (Ollama tags, /v1/models). Discovered rows have no canonical
|
|
639
|
-
// source to be re-created from, so they survive the reseed: purging them
|
|
640
|
-
// would unlink the model of every install that runs on a local Ollama.
|
|
641
|
-
let removedModels = 0;
|
|
642
|
-
for (const [staleId, stale] of existingModels) {
|
|
643
|
-
if (stale.doc.source !== "catalog") continue;
|
|
644
|
-
await modelsCol.delete(staleId);
|
|
645
|
-
removedModels++;
|
|
646
|
-
}
|
|
647
|
-
if (removedModels > 0) {
|
|
648
|
-
log.info(`[seed] 🗑️ Removed ${removedModels} model(s) no longer in the catalog.`);
|
|
649
|
-
}
|
|
753
|
+
log.info(`[seed] 🗑️ ${wipedModels} modelo(s) de catálogo borrados y recreados desde SEED_DATA`);
|
|
754
|
+
invalidateModelPricingCache();
|
|
650
755
|
|
|
651
756
|
// An agent pointing at a model that just got removed would otherwise keep
|
|
652
757
|
// a dangling model_id — unlink it so loadAgentConfigFromDB() falls back to
|
|
@@ -664,6 +769,28 @@ export async function seedAllData(): Promise<void> {
|
|
|
664
769
|
if (unlinkedCount > 0) {
|
|
665
770
|
log.info(`[seed] 🔗 Unlinked ${unlinkedCount} agent(s) from model(s) no longer in the catalog`);
|
|
666
771
|
}
|
|
772
|
+
|
|
773
|
+
// Los canales guardan el id del modelo de voz, no una FK: si el modelo salió
|
|
774
|
+
// del catálogo hay que repuntarlos a mano o la voz queda rota en silencio.
|
|
775
|
+
const voiceChannelsCol = await col<ChannelDoc>("channels");
|
|
776
|
+
let migratedVoice = 0;
|
|
777
|
+
for (const c of await voiceChannelsCol.scan({})) {
|
|
778
|
+
const patch: Partial<ChannelDoc> = {};
|
|
779
|
+
for (const field of ["stt_provider", "tts_provider"] as const) {
|
|
780
|
+
const current = c.doc[field];
|
|
781
|
+
if (current && current in RETIRED_VOICE_MODELS) {
|
|
782
|
+
patch[field] = RETIRED_VOICE_MODELS[current];
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
if (Object.keys(patch).length === 0) continue;
|
|
786
|
+
await voiceChannelsCol.put(c.id, { ...c.doc, ...patch }, { expectedVersion: c.version });
|
|
787
|
+
migratedVoice++;
|
|
788
|
+
log.info(`[seed] 🎙️ Canal ${c.id}: modelo de voz deprecado migrado ${JSON.stringify(patch)}`);
|
|
789
|
+
}
|
|
790
|
+
if (migratedVoice > 0) {
|
|
791
|
+
log.info(`[seed] 🎙️ ${migratedVoice} canal(es) repuntados a modelos de voz vigentes`);
|
|
792
|
+
}
|
|
793
|
+
|
|
667
794
|
log.info(`[seed] ✅ ${modelCount} models procesados`);
|
|
668
795
|
|
|
669
796
|
// 6️⃣ MCP servers
|
|
@@ -683,6 +810,7 @@ export async function seedAllData(): Promise<void> {
|
|
|
683
810
|
// rows. Existing user choices remain untouched; narrowly identified
|
|
684
811
|
// factory values from older releases are migrated in place.
|
|
685
812
|
let catalogAgentCount = 0;
|
|
813
|
+
let repairedCatalogSkills = 0;
|
|
686
814
|
for (const catalogAgent of createSeedCatalogAgents()) {
|
|
687
815
|
await putIfAbsent(agentsCol, catalogAgent.id, catalogAgent);
|
|
688
816
|
const existing = await agentsCol.get(catalogAgent.id);
|
|
@@ -699,6 +827,20 @@ export async function seedAllData(): Promise<void> {
|
|
|
699
827
|
if (reconciled.status === "archived") {
|
|
700
828
|
reconciled = { ...reconciled, status: "idle" };
|
|
701
829
|
}
|
|
830
|
+
|
|
831
|
+
// Catalog agents may survive upgrades with an older skills_json. Keep
|
|
832
|
+
// any user-added skills, but restore every canonical dependency so a
|
|
833
|
+
// worker cannot reach delegation with a stale/missing reference.
|
|
834
|
+
const currentSkills = parseSkillList(reconciled.skills_json);
|
|
835
|
+
const missingCatalogSkills = parseSkillList(catalogAgent.skills_json)
|
|
836
|
+
.filter((id) => !currentSkills.includes(id));
|
|
837
|
+
if (missingCatalogSkills.length > 0) {
|
|
838
|
+
reconciled = {
|
|
839
|
+
...reconciled,
|
|
840
|
+
skills_json: JSON.stringify([...currentSkills, ...missingCatalogSkills]),
|
|
841
|
+
};
|
|
842
|
+
repairedCatalogSkills += missingCatalogSkills.length;
|
|
843
|
+
}
|
|
702
844
|
if (JSON.stringify(reconciled) !== JSON.stringify(existing.doc)) {
|
|
703
845
|
await agentsCol.put(
|
|
704
846
|
existing.id,
|
|
@@ -709,6 +851,9 @@ export async function seedAllData(): Promise<void> {
|
|
|
709
851
|
catalogAgentCount++;
|
|
710
852
|
}
|
|
711
853
|
log.info(`[seed] ✅ ${catalogAgentCount} catalog agents ensured`);
|
|
854
|
+
if (repairedCatalogSkills > 0) {
|
|
855
|
+
log.info(`[seed] 🔧 Restauradas ${repairedCatalogSkills} dependencia(s) de skills en agentes de catálogo`);
|
|
856
|
+
}
|
|
712
857
|
|
|
713
858
|
// Catalog rows are born without a provider/model (no provider exists at
|
|
714
859
|
// first boot), and setup only runs once — so anything that arrives later
|
|
@@ -737,7 +882,7 @@ export async function seedAllData(): Promise<void> {
|
|
|
737
882
|
await putIfAbsent(channelsCol, channel.id, {
|
|
738
883
|
id: channel.id, user_id: toIndexable(null), type: channel.type, enabled: true, active: false,
|
|
739
884
|
status: "disconnected", last_active: null, voice_enabled: false, tts_enabled: false,
|
|
740
|
-
stt_provider: null, tts_provider: null, tts_voice_id: null, step_delivery_mode: "
|
|
885
|
+
stt_provider: null, tts_provider: null, tts_voice_id: null, step_delivery_mode: "milestones",
|
|
741
886
|
vision_enabled: false, ocr_provider: null, vision_provider: null, vision_model_id: null,
|
|
742
887
|
});
|
|
743
888
|
channelCount++;
|