@johpaz/hive-agents 1.0.5 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/README.md +17 -11
  2. package/dist/hive.js +87295 -101789
  3. package/dist/tool-worker.js +13241 -17001
  4. package/dist/ui/assets/A2UIPage-F1sUdZV7.js +8 -0
  5. package/dist/ui/assets/{AgentCreateForm-Bcp3HN8D.js → AgentCreateForm-CN5Gb9UN.js} +1 -1
  6. package/dist/ui/assets/AgentDetailPage-CzBnoKtH.js +1 -0
  7. package/dist/ui/assets/AgentNewPage-AGDjfAVf.js +1 -0
  8. package/dist/ui/assets/AgentsPage-BgKr7pAZ.js +10 -0
  9. package/dist/ui/assets/{ApiClientPage-DHfIlSAg.js → ApiClientPage-Dq4nPse4.js} +2 -2
  10. package/dist/ui/assets/ChannelsPage-BuWItmp-.js +8 -0
  11. package/dist/ui/assets/DashboardPage-CB1aM87o.js +6 -0
  12. package/dist/ui/assets/{LoginPage-BaX6cAPa.js → LoginPage-DBvwBCG6.js} +1 -1
  13. package/dist/ui/assets/LogsPage-Bc-oTBwY.js +1 -0
  14. package/dist/ui/assets/MeetingPage-C2H5SxaQ.js +1 -0
  15. package/dist/ui/assets/ModelSelector-D0aJvoD9.js +1 -0
  16. package/dist/ui/assets/NotFound-PUg3gEO0.js +1 -0
  17. package/dist/ui/assets/{Office3DPage-C3SIzd2H.css → Office3DPage-31AMJ-LN.css} +1 -1
  18. package/dist/ui/assets/Office3DPage-D5vwZkJa.js +727 -0
  19. package/dist/ui/assets/ProvidersPage-BBBt4Hcz.js +1 -0
  20. package/dist/ui/assets/{RecoverPage-C_Id9WM-.js → RecoverPage-nq901JiE.js} +1 -1
  21. package/dist/ui/assets/SettingsPage-DQ5KZPAd.js +9 -0
  22. package/dist/ui/assets/SetupPage-DeIGn-Uf.js +1 -0
  23. package/dist/ui/assets/{Vignette-Cyi27LQH.js → Vignette-BcPWkNhm.js} +17 -17
  24. package/dist/ui/assets/VoicePage-DJYsOsaU.js +307 -0
  25. package/dist/ui/assets/WebChatPage-CRDN4OlP.js +29 -0
  26. package/dist/ui/assets/agentCapabilities-PfTEVxG1.js +1 -0
  27. package/dist/ui/assets/alert-CjiX20jI.js +1 -0
  28. package/dist/ui/assets/badge-B5AKge1b.js +1 -0
  29. package/dist/ui/assets/card-mTJ4oZbL.js +1 -0
  30. package/dist/ui/assets/conversationsStore-BIs0iMhp.js +1 -0
  31. package/dist/ui/assets/dialog-DdbsUCv9.js +1 -0
  32. package/dist/ui/assets/dist-js-Dh18rcg9.js +1 -0
  33. package/dist/ui/assets/{dist-js-Bg0g3vPS.js → dist-js-q7C_AB0j.js} +1 -1
  34. package/dist/ui/assets/index-BD7hBA1d.css +2 -0
  35. package/dist/ui/assets/index-CpzwBwPg.js +116 -0
  36. package/dist/ui/assets/label-D_fvqJyD.js +1 -0
  37. package/dist/ui/assets/lock-3IApZyVy.js +1 -0
  38. package/dist/ui/assets/pencil-L3Li7_pz.js +1 -0
  39. package/dist/ui/assets/scroll-area-CbH8FOo8.js +1 -0
  40. package/dist/ui/assets/select-v_3QBYrD.js +1 -0
  41. package/dist/ui/assets/slider-DXS4h1LB.js +1 -0
  42. package/dist/ui/assets/switch-ndx8VCpm.js +1 -0
  43. package/dist/ui/assets/tabs-epu-3Tl4.js +1 -0
  44. package/dist/ui/assets/textarea-BgZJFZTX.js +1 -0
  45. package/dist/ui/assets/useAudioDevices-yU-wu-kt.js +41 -0
  46. package/dist/ui/assets/{useHiveAgentsModelLoad-CHmtvNp4.js → useHiveAgentsModelLoad-29pOYRd9.js} +1 -1
  47. package/dist/ui/assets/useOfficeModel-BaDn7U-X.js +1 -0
  48. package/dist/ui/assets/{useProviders-C7FA6z4M.js → useProviders-CiBi4Dt6.js} +1 -1
  49. package/dist/ui/assets/vendor-react-kUOwxn0g.js +1 -0
  50. package/dist/ui/index.html +6 -6
  51. package/package.json +10 -6
  52. package/packages/cli/src/adapters/config.ts +11 -3
  53. package/packages/cli/src/commands/causal.ts +1 -1
  54. package/packages/cli/src/commands/doctor.ts +2 -2
  55. package/packages/cli/src/commands/onboard.ts +1 -1
  56. package/packages/core/src/agent/acceptance-checks.ts +25 -0
  57. package/packages/core/src/agent/agent-catalog.ts +53 -33
  58. package/packages/core/src/agent/agent-loop.ts +67 -14
  59. package/packages/core/src/agent/capability-search.ts +2 -1
  60. package/packages/core/src/agent/compaction.ts +19 -7
  61. package/packages/core/src/agent/context-compiler.ts +165 -27
  62. package/packages/core/src/agent/conversation-store.ts +12 -1
  63. package/packages/core/src/agent/goal-runner.ts +2 -2
  64. package/packages/core/src/agent/jev-decisions.ts +242 -0
  65. package/packages/core/src/agent/jev-planner.ts +293 -0
  66. package/packages/core/src/agent/llm-client.ts +27 -5
  67. package/packages/core/src/agent/llm-providers/ollama.ts +17 -4
  68. package/packages/core/src/agent/llm-providers/openai-compat-base.ts +27 -12
  69. package/packages/core/src/agent/llm-providers/opencode-go.ts +37 -0
  70. package/packages/core/src/agent/realtime-providers/gemini-live.ts +5 -2
  71. package/packages/core/src/agent/skill-selector.ts +4 -2
  72. package/packages/core/src/agent/thread-id.ts +71 -0
  73. package/packages/core/src/agent/thread-store.ts +230 -0
  74. package/packages/core/src/agent/tool-selector.ts +42 -0
  75. package/packages/core/src/agent/tracer.ts +2 -0
  76. package/packages/core/src/canvas/canvas-manager.ts +17 -1
  77. package/packages/core/src/canvas/emitter.ts +24 -0
  78. package/packages/core/src/channels/telegram.ts +19 -1
  79. package/packages/core/src/channels/webchat.ts +47 -45
  80. package/packages/core/src/config/loader.ts +3 -2
  81. package/packages/core/src/gateway/channel-notify.ts +24 -5
  82. package/packages/core/src/gateway/delegation-groups.ts +3 -3
  83. package/packages/core/src/gateway/delegation-notify.ts +34 -5
  84. package/packages/core/src/gateway/durable-queue.ts +22 -0
  85. package/packages/core/src/gateway/failure-notify.ts +8 -2
  86. package/packages/core/src/gateway/job-executors.ts +3 -3
  87. package/packages/core/src/gateway/realtime/bridge-tools.ts +106 -28
  88. package/packages/core/src/gateway/realtime/index.ts +63 -7
  89. package/packages/core/src/gateway/realtime/prompt.ts +45 -0
  90. package/packages/core/src/gateway/realtime/voice-session.ts +1 -0
  91. package/packages/core/src/gateway/resolver.ts +31 -4
  92. package/packages/core/src/gateway/routes/artifacts.ts +13 -0
  93. package/packages/core/src/gateway/routes/chat.ts +20 -4
  94. package/packages/core/src/gateway/routes/conversations.ts +121 -0
  95. package/packages/core/src/gateway/routes/providers.ts +15 -0
  96. package/packages/core/src/gateway/routes/setup.ts +22 -11
  97. package/packages/core/src/gateway/routes/system.ts +4 -2
  98. package/packages/core/src/gateway/routes/tts-local.ts +2 -1
  99. package/packages/core/src/gateway/server.ts +85 -12
  100. package/packages/core/src/gateway/slash-commands.ts +46 -10
  101. package/packages/core/src/gateway/tts/src/server.ts +2 -1
  102. package/packages/core/src/gateway/webchat-turn.ts +68 -10
  103. package/packages/core/src/index.ts +2 -0
  104. package/packages/core/src/scheduler/CronScheduler.ts +20 -8
  105. package/packages/core/src/scheduler/cron/cron-engine.test.ts +295 -0
  106. package/packages/core/src/scheduler/cron/expression.ts +165 -0
  107. package/packages/core/src/scheduler/cron/index.ts +10 -0
  108. package/packages/core/src/scheduler/cron/job.ts +340 -0
  109. package/packages/core/src/scheduler/cron/next-run.ts +121 -0
  110. package/packages/core/src/scheduler/cron/zoned-time.ts +139 -0
  111. package/packages/core/src/scheduler/integration.ts +16 -5
  112. package/packages/core/src/scheduler/types.ts +3 -18
  113. package/packages/core/src/storage/bootstrap.ts +24 -1
  114. package/packages/core/src/storage/collections.ts +29 -1
  115. package/packages/core/src/storage/crypto.ts +133 -40
  116. package/packages/core/src/storage/reconcile.ts +6 -1
  117. package/packages/core/src/storage/seed.ts +101 -7
  118. package/packages/core/src/storage/usage.ts +53 -1
  119. package/packages/core/src/tool-runtime/index.ts +19 -1
  120. package/packages/core/src/tools/a2ui/index.ts +65 -1
  121. package/packages/core/src/tools/agents/get-available-models.ts +3 -1
  122. package/packages/core/src/tools/code-agent/adapters.ts +110 -0
  123. package/packages/core/src/tools/code-agent/index.ts +193 -0
  124. package/packages/core/src/tools/core/index.ts +39 -4
  125. package/packages/core/src/tools/cron/index.ts +4 -4
  126. package/packages/core/src/tools/index.ts +9 -1
  127. package/packages/core/src/tools/office/office-escribir-xlsx.ts +2 -1
  128. package/packages/core/src/tools/office/office-leer-xlsx.ts +2 -1
  129. package/packages/core/src/tools/office/xlsx-loader.ts +19 -0
  130. package/packages/core/src/tools/web/browser-backend.ts +22 -2
  131. package/packages/core/src/tools/web/index.ts +4 -0
  132. package/packages/core/src/tools/web/obscura.ts +860 -0
  133. package/packages/core/src/tools/web/webview-backend.ts +168 -26
  134. package/packages/core/src/utils/port.ts +33 -0
  135. package/packages/core/src/voice/index.ts +2 -1
  136. package/packages/mcp/src/config.ts +2 -1
  137. package/packages/mcp/src/manager.ts +9 -0
  138. package/packages/mcp/src/transports/index.ts +42 -1
  139. package/packages/mcp/src/transports/sse.ts +11 -5
  140. package/packages/skills/src/bundled/a2ui/a2ui_dashboard/SKILL.md +2 -2
  141. package/packages/skills/src/bundled/a2ui/a2ui_form/SKILL.md +2 -2
  142. package/packages/skills/src/bundled/a2ui/a2ui_interactive/SKILL.md +4 -4
  143. package/packages/skills/src/bundled/agents/agent_spawner/SKILL.md +7 -7
  144. package/packages/skills/src/bundled/agents/memory_manager/SKILL.md +9 -9
  145. package/packages/skills/src/bundled/agents/research_and_remember/SKILL.md +8 -8
  146. package/packages/skills/src/bundled/agents/task_orchestrator/SKILL.md +8 -8
  147. package/packages/skills/src/bundled/artifacts/artifact_reader/SKILL.md +104 -0
  148. package/packages/skills/src/bundled/cli/cli_pipeline/SKILL.md +6 -6
  149. package/packages/skills/src/bundled/cli/cli_safe_exec/SKILL.md +5 -5
  150. package/packages/skills/src/bundled/cli/external_code_agent/SKILL.md +69 -0
  151. package/packages/skills/src/bundled/cron_manager/SKILL.md +29 -19
  152. package/packages/skills/src/bundled/cron_reminder/SKILL.md +5 -5
  153. package/packages/skills/src/bundled/filesystem/file_manager/SKILL.md +4 -4
  154. package/packages/skills/src/bundled/filesystem/file_read_and_summarize/SKILL.md +7 -7
  155. package/packages/skills/src/bundled/filesystem/file_writer/SKILL.md +10 -10
  156. package/packages/skills/src/bundled/search_knowledge/capability_discovery/SKILL.md +8 -8
  157. package/packages/skills/src/bundled/web/browser_automate/SKILL.md +21 -12
  158. package/packages/skills/src/bundled/web/browser_scrape/SKILL.md +28 -13
  159. package/packages/skills/src/bundled/web/obscura_browser/SKILL.md +69 -0
  160. package/packages/skills/src/bundled/web/web_monitor/SKILL.md +6 -6
  161. package/packages/skills/src/bundled/web/web_research/SKILL.md +5 -5
  162. package/packages/skills/src/bundled-data.generated.ts +845 -773
  163. package/dist/ui/assets/A2UIPage-DTW79pyL.js +0 -8
  164. package/dist/ui/assets/AgentDetailPage-10XptMde.js +0 -1
  165. package/dist/ui/assets/AgentNewPage-CUt49rVS.js +0 -1
  166. package/dist/ui/assets/AgentsPage-1_e1a9xa.js +0 -10
  167. package/dist/ui/assets/ChannelsPage-BnCQAGZL.js +0 -8
  168. package/dist/ui/assets/DashboardPage-BsCCKHgg.js +0 -6
  169. package/dist/ui/assets/LogsPage-DiFBQt7o.js +0 -1
  170. package/dist/ui/assets/MeetingPage-Bpv5zVXf.js +0 -1
  171. package/dist/ui/assets/ModelSelector-DfExlPzx.js +0 -1
  172. package/dist/ui/assets/NotFound-C8HBdF73.js +0 -1
  173. package/dist/ui/assets/Office3DPage-ChsGMapf.js +0 -319
  174. package/dist/ui/assets/ProvidersPage-B39pfWHf.js +0 -1
  175. package/dist/ui/assets/SettingsPage-BgFqasyg.js +0 -9
  176. package/dist/ui/assets/SetupPage-YeJFfgbt.js +0 -1
  177. package/dist/ui/assets/VoicePage-Cp63Abj4.js +0 -307
  178. package/dist/ui/assets/WebChatPage-DxFLWgtM.js +0 -29
  179. package/dist/ui/assets/agentCapabilities-DOeepCty.js +0 -1
  180. package/dist/ui/assets/alert-Cj4DpKv6.js +0 -1
  181. package/dist/ui/assets/badge-DKpeVCpY.js +0 -1
  182. package/dist/ui/assets/card-Cag15G4h.js +0 -1
  183. package/dist/ui/assets/dialog-7E3EoEt3.js +0 -1
  184. package/dist/ui/assets/dist-js-DwLn9F4C.js +0 -1
  185. package/dist/ui/assets/index-Bi8qEmrK.js +0 -116
  186. package/dist/ui/assets/index-D2UhaSb0.css +0 -2
  187. package/dist/ui/assets/label-C6atPuIh.js +0 -1
  188. package/dist/ui/assets/pencil-CUbpCfeG.js +0 -1
  189. package/dist/ui/assets/scroll-area-CSoG2z53.js +0 -1
  190. package/dist/ui/assets/select-DlCT21_r.js +0 -1
  191. package/dist/ui/assets/slider-Bb_PHFJT.js +0 -1
  192. package/dist/ui/assets/switch-CUsGuBNi.js +0 -1
  193. package/dist/ui/assets/tabs-Ckfc7DGG.js +0 -1
  194. package/dist/ui/assets/textarea-BH6pI9Ax.js +0 -1
  195. package/dist/ui/assets/useAudioDevices-Dpr_hn6i.js +0 -41
  196. package/dist/ui/assets/useOfficeModel-Cc5VkReZ.js +0 -1
  197. package/dist/ui/assets/vendor-react-DYyYpuMy.js +0 -1
  198. /package/dist/ui/assets/{core-Dz04EE_8.js → core-B_5cyOSV.js} +0 -0
  199. /package/dist/ui/assets/{download-D0aDV8Y_.js → download-BQXrpH0m.js} +0 -0
  200. /package/dist/ui/assets/{ellipsis-vertical-BOW_iEOO.js → ellipsis-vertical-D7uFJLGh.js} +0 -0
  201. /package/dist/ui/assets/{external-link-5cujQzfV.js → external-link-6oTH9pUM.js} +0 -0
  202. /package/dist/ui/assets/{eye-sRPY5qOa.js → eye-CxvxtQT5.js} +0 -0
  203. /package/dist/ui/assets/{file-text-DNSyNLUh.js → file-text-D5ZJEx3E.js} +0 -0
  204. /package/dist/ui/assets/{gateway-url-BzQV75Ig.js → gateway-url-BALS_wVh.js} +0 -0
  205. /package/dist/ui/assets/{gauge-C__zxC3_.js → gauge-CEu7PhTW.js} +0 -0
  206. /package/dist/ui/assets/{history-BHQWfE-7.js → history-DLK5rTlP.js} +0 -0
  207. /package/dist/ui/assets/{info-CG1VohyH.js → info-8ReWzubE.js} +0 -0
  208. /package/dist/ui/assets/{key-BC28VCjO.js → key-DPkOY-J0.js} +0 -0
  209. /package/dist/ui/assets/{lock-open-Bhp0UJlL.js → lock-open-v0EphssG.js} +0 -0
  210. /package/dist/ui/assets/{mail-Biwn8WrV.js → mail-vwCEHyhQ.js} +0 -0
  211. /package/dist/ui/assets/{mic-Rq4BxU1R.js → mic-CpDU_2as.js} +0 -0
  212. /package/dist/ui/assets/{pause-C2l5G2Py.js → pause-Cm9LzIZK.js} +0 -0
  213. /package/dist/ui/assets/{play-CMAscR3a.js → play-zqogwA2l.js} +0 -0
  214. /package/dist/ui/assets/{plus-DzvRxH4U.js → plus-Bm08ABhc.js} +0 -0
  215. /package/dist/ui/assets/{radio-DfGzov4y.js → radio-Cii1BjMt.js} +0 -0
  216. /package/dist/ui/assets/{refresh-cw-DZXu5FrG.js → refresh-cw-DXv3XgEt.js} +0 -0
  217. /package/dist/ui/assets/{rotate-ccw-Dx92orJM.js → rotate-ccw-LoM1AuqK.js} +0 -0
  218. /package/dist/ui/assets/{search-DB4w9YHW.js → search-BMwCI-pX.js} +0 -0
  219. /package/dist/ui/assets/{send-xi8HzUdc.js → send-D6fgWV7m.js} +0 -0
  220. /package/dist/ui/assets/{settings-pV0cF8Kf.js → settings-qV3kVkeG.js} +0 -0
  221. /package/dist/ui/assets/{shield-nLNsomh_.js → shield-CIarwBvx.js} +0 -0
  222. /package/dist/ui/assets/{sparkles-CerRDYxk.js → sparkles-DVvY6jDT.js} +0 -0
  223. /package/dist/ui/assets/{square-CcWzRWyG.js → square-D5zdNkAY.js} +0 -0
  224. /package/dist/ui/assets/{terminal-C2SUZUAD.js → terminal-BEcTK780.js} +0 -0
  225. /package/dist/ui/assets/{trash-2-BZsMCfso.js → trash-2-D6oziYAK.js} +0 -0
  226. /package/dist/ui/assets/{utils-lc8H6VGT.js → utils-DEmd_M8c.js} +0 -0
  227. /package/dist/ui/assets/{vendor-router-DCsSv_I7.js → vendor-router-DP84b3LQ.js} +0 -0
  228. /package/dist/ui/assets/{volume-2-CBMYsuF3.js → volume-2-EaA0JRvD.js} +0 -0
  229. /package/dist/ui/assets/{volume-x-vNFf2e4-.js → volume-x-CROXNMGT.js} +0 -0
  230. /package/dist/ui/assets/{wifi-DNv53AfN.js → wifi-BUJuOcgP.js} +0 -0
  231. /package/dist/ui/assets/{zap-Yed86Sh8.js → zap-DSoX9NDk.js} +0 -0
@@ -21,8 +21,13 @@
21
21
  */
22
22
 
23
23
  import { logger } from "../../utils/logger.ts";
24
- import { resolveWebViewEngine, type BrowserBackend, type ScreenshotOptions, type SnapshotOptions, type WebViewEngine } from "./browser-backend.ts";
25
- import { loadStoredCookies, sessionPersistenceEnabled, storeCookies } from "./browser-session.ts";
24
+ import { findChrome, resolveWebViewEngine, type BrowserBackend, type ScreenshotOptions, type SnapshotOptions, type WebViewEngine } from "./browser-backend.ts";
25
+ import {
26
+ loadStoredCookies,
27
+ sessionPersistenceEnabled,
28
+ storeCookies,
29
+ type StoredCookie,
30
+ } from "./browser-session.ts";
26
31
 
27
32
  const log = logger.child("webview-backend");
28
33
 
@@ -36,6 +41,85 @@ const SNAPSHOT_CHAR_LIMIT = 20_000;
36
41
  */
37
42
  const SESSION_SAVE_DEBOUNCE_MS = 3_000;
38
43
 
44
+ /** Intentos de restaurar la sesión dentro de una misma navegación, y la espera entre ellos. */
45
+ const RESTORE_INTENTOS = 3;
46
+ const RESTORE_ESPERA_MS = 150;
47
+
48
+ /** Navegaciones que pueden pagar un reintento antes de darse por vencido. */
49
+ const RESTORE_LLAMADAS = 2;
50
+
51
+ /** Identidad de una cookie: nombre + dominio + valor. */
52
+ const clave = (name: string, domain: string, value: string): string =>
53
+ JSON.stringify([name, domain, value]);
54
+
55
+ /**
56
+ * Cuántas de las cookies guardadas quedaron realmente en el navegador.
57
+ *
58
+ * `Network.setCookies` puede responder sin error y no dejar nada —el target
59
+ * todavía no está listo—, así que la única señal confiable es leer de vuelta.
60
+ * Se comparan nombre, dominio y valor: una cookie con el mismo nombre pero otro
61
+ * valor es una cookie vieja del perfil, no la sesión que se quería restaurar.
62
+ */
63
+ export function contarRestauradas(enElNavegador: unknown[] | undefined, esperadas: StoredCookie[]): number {
64
+ if (!Array.isArray(enElNavegador)) return 0;
65
+ const presentes = new Set(
66
+ enElNavegador
67
+ .filter((c): c is Record<string, unknown> => typeof c === "object" && c !== null)
68
+ .map((c) => clave(String(c.name), String(c.domain), String(c.value))),
69
+ );
70
+ return esperadas.filter((c) => presentes.has(clave(c.name, c.domain, c.value))).length;
71
+ }
72
+
73
+ /** Lo que la restauración necesita de una vista: navegar y hablar CDP. */
74
+ interface VistaRestaurable {
75
+ navigate(url: string): Promise<void>;
76
+ cdp(method: string, params?: Record<string, unknown>): Promise<unknown>;
77
+ }
78
+
79
+ /**
80
+ * Pone las cookies guardadas y comprueba que quedaran, reintentando.
81
+ *
82
+ * Vive fuera de la clase para poder probarla sin abrir un navegador: el motor
83
+ * real llega por `correr`, que es la cola de la vista.
84
+ */
85
+ export async function restaurarCookiesEnVista(
86
+ cookies: StoredCookie[],
87
+ correr: <T>(operacion: (vista: VistaRestaurable) => Promise<T>) => Promise<T>,
88
+ ): Promise<{ restaurada: boolean; puestas: number; intentos: number }> {
89
+ let intentos = 0;
90
+
91
+ for (let intento = 1; intento <= RESTORE_INTENTOS; intento++) {
92
+ intentos = intento;
93
+ try {
94
+ const puestas = await correr(async (vista) => {
95
+ // `about:blank` primero: `cdp()` no tiene sesión hasta que la vista
96
+ // navegó alguna vez, y las cookies tienen que estar antes del destino
97
+ // para que el primer request ya salga autenticado.
98
+ await vista.navigate("about:blank");
99
+ await vista.cdp("Network.setCookies", { cookies });
100
+ const leidas = (await vista.cdp("Network.getAllCookies")) as { cookies?: unknown[] };
101
+ return contarRestauradas(leidas?.cookies, cookies);
102
+ });
103
+ if (puestas > 0) {
104
+ log.info(`sesión del navegador restaurada (${puestas}/${cookies.length} cookies)`);
105
+ return { restaurada: true, puestas, intentos };
106
+ }
107
+ log.warn(
108
+ `el navegador no conservó ninguna de las ${cookies.length} cookies guardadas ` +
109
+ `(intento ${intento}/${RESTORE_INTENTOS})`,
110
+ );
111
+ } catch (err) {
112
+ log.warn(
113
+ `no se pudo restaurar la sesión (intento ${intento}/${RESTORE_INTENTOS}): ` +
114
+ `${(err as Error).message}`,
115
+ );
116
+ }
117
+ if (intento < RESTORE_INTENTOS) await Bun.sleep(RESTORE_ESPERA_MS);
118
+ }
119
+
120
+ return { restaurada: false, puestas: 0, intentos };
121
+ }
122
+
39
123
  /**
40
124
  * Tope para las operaciones que el motor puede dejar pendientes para siempre.
41
125
  *
@@ -382,6 +466,7 @@ export class WebViewBackend implements BrowserBackend {
382
466
  private axEnabled = false;
383
467
  /** La sesión guardada se restaura una sola vez, antes de la primera página. */
384
468
  private sessionRestored = false;
469
+ private restoreFallidos = 0;
385
470
  private saveTimer: ReturnType<typeof setTimeout> | null = null;
386
471
 
387
472
  constructor(
@@ -400,6 +485,8 @@ export class WebViewBackend implements BrowserBackend {
400
485
  return (this.engine ?? this.options.engine ?? resolveWebViewEngine()) === "chrome";
401
486
  }
402
487
 
488
+ private pendingResize: { width: number; height: number } | null = null;
489
+
403
490
  private ensureView(): BunWebView {
404
491
  if (this.view) return this.view;
405
492
 
@@ -420,9 +507,17 @@ export class WebViewBackend implements BrowserBackend {
420
507
  // motor chrome intenta CONECTARSE a un Chrome que ya esté corriendo, y esa
421
508
  // ruta abre un diálogo "Allow remote debugging?" que cuelga el proceso
422
509
  // esperando un click que en un servidor no llega nunca.
510
+ // `path` evita que Bun elija por su cuenta un Chrome que no puede arrancar
511
+ // (el wrapper de flatpak, por ejemplo): usa el mismo que ya detectó Hive.
512
+ const chromePath = engine === "chrome" ? findChrome() : null;
423
513
  const backend =
424
514
  engine === "chrome"
425
- ? { type: "chrome" as const, url: false as const, stderr: "ignore" as const }
515
+ ? {
516
+ type: "chrome" as const,
517
+ url: false as const,
518
+ stderr: "ignore" as const,
519
+ ...(chromePath ? { path: chromePath } : {}),
520
+ }
426
521
  : ("webkit" as const);
427
522
 
428
523
  // Sin `url` inicial a propósito: construir con uno deja una navegación
@@ -435,16 +530,28 @@ export class WebViewBackend implements BrowserBackend {
435
530
  height: this.options.height ?? 800,
436
531
  });
437
532
  this.engine = engine;
533
+ // Algunos Chrome (131, por ejemplo) ignoran width/height del constructor y
534
+ // abren en ~780x493; tras la primera operación se fija el tamaño pedido con resize().
535
+ this.pendingResize = { width: this.options.width ?? 1280, height: this.options.height ?? 800 };
438
536
  log.info(`✅ WebView abierto (motor: ${engine}, in-process)`);
439
537
  return this.view;
440
538
  }
441
539
 
442
540
  /** Serializa: cada operación espera a que termine la anterior. */
443
541
  private run<T>(operation: (view: BunWebView) => Promise<T>): Promise<T> {
444
- const next = this.queue.then(
445
- () => operation(this.ensureView()),
446
- () => operation(this.ensureView()),
447
- );
542
+ const prepared = async () => {
543
+ const view = this.ensureView();
544
+ const size = this.pendingResize;
545
+ const result = await operation(view);
546
+ // Después de la primera operación: el resize anterior a la primera
547
+ // navegación se pierde, porque Chrome crea el target recién ahí.
548
+ if (size) {
549
+ this.pendingResize = null;
550
+ await view.resize(size.width, size.height).catch(() => undefined);
551
+ }
552
+ return result;
553
+ };
554
+ const next = this.queue.then(prepared, prepared);
448
555
  // La cola no debe romperse porque una operación haya fallado.
449
556
  this.queue = next.catch(() => undefined);
450
557
  return next;
@@ -511,23 +618,37 @@ export class WebViewBackend implements BrowserBackend {
511
618
  */
512
619
  private async restoreSession(): Promise<void> {
513
620
  if (this.sessionRestored) return;
514
- this.sessionRestored = true;
515
- if (!sessionPersistenceEnabled(this.options.persistSession) || !this.hasCdp) return;
621
+ if (!sessionPersistenceEnabled(this.options.persistSession) || !this.hasCdp) {
622
+ this.sessionRestored = true;
623
+ return;
624
+ }
516
625
 
517
- try {
518
- const cookies = await loadStoredCookies();
519
- if (!cookies.length) return;
626
+ const cookies = await loadStoredCookies();
627
+ if (!cookies.length) {
628
+ this.sessionRestored = true;
629
+ return;
630
+ }
520
631
 
521
- await this.run(async (view) => {
522
- await view.navigate("about:blank");
523
- await view.cdp("Network.setCookies", { cookies });
524
- });
525
- log.info(`sesión del navegador restaurada (${cookies.length} cookies)`);
526
- } catch (err) {
527
- // Una sesión que no se pudo restaurar es un login perdido, no un fallo de
528
- // la navegación: el agente sigue, sólo que deslogueado.
529
- log.warn(`no se pudo restaurar la sesión: ${(err as Error).message}`);
632
+ // Chrome recién abierto no siempre tiene la sesión CDP lista: `setCookies`
633
+ // falla, o responde bien y la cookie no queda puesta. Antes se daba por
634
+ // restaurada igual y el agente navegaba deslogueado sin que nada fallara
635
+ // (así se caía este test en CI, de forma intermitente). Ahora se comprueba
636
+ // leyendo de vuelta y se reintenta.
637
+ const { restaurada } = await restaurarCookiesEnVista(cookies, (op) => this.run(op));
638
+ if (restaurada) {
639
+ this.sessionRestored = true;
640
+ return;
530
641
  }
642
+
643
+ // Sin marcar `sessionRestored`: el próximo navigate vuelve a intentarlo, que
644
+ // para entonces la vista ya está caliente. Después de `RESTORE_LLAMADAS` se
645
+ // deja de insistir para no pagar un about:blank en cada navegación.
646
+ this.restoreFallidos++;
647
+ if (this.restoreFallidos >= RESTORE_LLAMADAS) this.sessionRestored = true;
648
+ log.warn(
649
+ `sesión del navegador NO restaurada (${cookies.length} cookies guardadas): ` +
650
+ "el agente navega deslogueado",
651
+ );
531
652
  }
532
653
 
533
654
  /** Agenda un volcado de cookies; las llamadas seguidas se funden en una. */
@@ -547,24 +668,45 @@ export class WebViewBackend implements BrowserBackend {
547
668
  * Vuelca la sesión ya, sin esperar la ventana del debounce. Lo usan el
548
669
  * apagado ordenado y los tests; el camino normal es `scheduleSessionSave()`.
549
670
  */
671
+ /**
672
+ * Guarda la sesión ahora y falla si no puede.
673
+ *
674
+ * A diferencia del guardado periódico, aquí alguien pidió expresamente que la
675
+ * sesión quede en disco, así que callarse un fallo convierte el problema en
676
+ * "la cookie no aparece" mucho más tarde y en otro sitio — que es justo cómo
677
+ * se vivió desde una integración continua, sin forma de saber la causa.
678
+ */
550
679
  async flushSession(): Promise<void> {
551
680
  if (this.saveTimer) {
552
681
  clearTimeout(this.saveTimer);
553
682
  this.saveTimer = null;
554
683
  }
555
- await this.saveSession();
684
+ await this.saveSession(true);
556
685
  }
557
686
 
558
- private async saveSession(): Promise<void> {
559
- if (!this.view) return;
560
- if (!sessionPersistenceEnabled(this.options.persistSession) || !this.hasCdp) return;
687
+ private async saveSession(estricto = false): Promise<void> {
688
+ const rendirse = (motivo: string) => {
689
+ if (estricto) throw new Error(`no se pudo guardar la sesión: ${motivo}`);
690
+ };
691
+ if (!this.view) return rendirse("no hay ninguna vista abierta");
692
+ // Apagada por configuración: no hay nada que guardar y tampoco un problema
693
+ // que contar. Sólo se protesta cuando debía guardar y no pudo.
694
+ if (!sessionPersistenceEnabled(this.options.persistSession)) return;
695
+ if (!this.hasCdp) {
696
+ return rendirse(`el motor «${this.engine ?? this.options.engine ?? "?"}» no expone CDP`);
697
+ }
561
698
  try {
562
699
  const res = (await this.run((view) => view.cdp("Network.getAllCookies"))) as {
563
700
  cookies?: unknown[];
564
701
  };
565
- const guardadas = await storeCookies(res?.cookies ?? []);
702
+ const cookies = res?.cookies ?? [];
703
+ const guardadas = await storeCookies(cookies);
566
704
  if (guardadas) log.debug(`sesión del navegador guardada (${guardadas} cookies)`);
705
+ else if (estricto && cookies.length === 0) {
706
+ throw new Error("el navegador no reportó ninguna cookie");
707
+ }
567
708
  } catch (err) {
709
+ if (estricto) throw err;
568
710
  log.warn(`no se pudo guardar la sesión: ${(err as Error).message}`);
569
711
  }
570
712
  }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Resolución de puertos desde el entorno.
3
+ *
4
+ * Bun 1.4 endureció `Bun.serve`: un puerto fuera de `[0, 65535]` —o `NaN`, que
5
+ * es lo que devuelve `parseInt("no-es-un-numero")`— ahora lanza `RangeError` en
6
+ * vez de recortar el valor. Un `HIVE_PORT` mal escrito dejó de degradar y pasó a
7
+ * tumbar el arranque con una excepción sin capturar:
8
+ *
9
+ * RangeError: The value of "options.port" is out of range.
10
+ * It must be an integer. Received NaN
11
+ *
12
+ * Este helper vuelve a la degradación explícita: avisa y sigue con el puerto por
13
+ * defecto, que para una variable de entorno mal tipeada es el comportamiento
14
+ * útil. El `0` se deja pasar a propósito: `Bun.serve` lo interpreta como "asigna
15
+ * un puerto libre" y hay código que se apoya en eso.
16
+ *
17
+ * Avisa con `console.warn` y no con el logger del proyecto a propósito: esto lo
18
+ * usa `config/loader.ts`, y el logger importa `config/loader.ts` para saber
19
+ * dónde escribir. Importarlo acá cierra el ciclo y rompe con "Cannot access
20
+ * 'logger' before initialization". Además, cuando se resuelve un puerto el
21
+ * logger todavía no está configurado.
22
+ */
23
+
24
+ export function resolvePort(raw: unknown, fallback: number): number {
25
+ if (raw === undefined || raw === null || raw === "") return fallback
26
+
27
+ const n = typeof raw === "number" ? raw : Number(String(raw).trim())
28
+ if (!Number.isInteger(n) || n < 0 || n > 65535) {
29
+ console.warn(`[config] Puerto inválido ${JSON.stringify(raw)}; se usa ${fallback}`)
30
+ return fallback
31
+ }
32
+ return n
33
+ }
@@ -1,3 +1,4 @@
1
+ import { resolvePort } from "../utils/port";
1
2
  import { col } from "../storage/hive";
2
3
  import type { ChannelDoc, ModelDoc } from "../storage/collections";
3
4
  import { loadProviderApiKey } from "../storage/crypto";
@@ -311,7 +312,7 @@ class VoiceService {
311
312
 
312
313
  private async speakWithPiper(text: string, voiceId?: string): Promise<AudioOutput> {
313
314
  const cleanText = cleanTextForTTS(text);
314
- const port = Number(process.env.TTS_PORT ?? 5500);
315
+ const port = resolvePort(process.env.TTS_PORT, 5500);
315
316
  const res = await fetch(`http://localhost:${port}/tts`, {
316
317
  method: "POST",
317
318
  headers: { "Content-Type": "application/json" },
@@ -3,7 +3,8 @@ export interface MCPConfig {
3
3
  }
4
4
 
5
5
  export interface MCPServerConfig {
6
- transport: "stdio" | "sse" | "websocket";
6
+ /** "http" es Streamable HTTP, el transporte remoto estándar de MCP. "sse" es el HTTP+SSE original, de dos endpoints. */
7
+ transport: "stdio" | "sse" | "websocket" | "http";
7
8
  enabled?: boolean;
8
9
  command?: string;
9
10
  args?: string[];
@@ -185,6 +185,15 @@ export class MCPClientManager {
185
185
  });
186
186
  }
187
187
 
188
+ case "http": {
189
+ const url = state.config.url;
190
+ if (!url) throw new Error("Streamable HTTP transport requires 'url' config");
191
+ return createTransport({
192
+ type: "http",
193
+ http: { url, headers: state.config.headers },
194
+ });
195
+ }
196
+
188
197
  default:
189
198
  throw new Error(`Unknown transport type: ${transportType}`);
190
199
  }
@@ -1,4 +1,5 @@
1
1
  import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
2
+ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
2
3
  import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
3
4
 
4
5
  // CORRECCIÓN 1 — quitar extensión .ts de los imports
@@ -18,13 +19,35 @@ export interface StdioTransportConfig {
18
19
  env?: Record<string, string>;
19
20
  }
20
21
 
21
- export type TransportType = "stdio" | "sse" | "websocket";
22
+ /**
23
+ * Streamable HTTP: el transporte remoto ESTÁNDAR de MCP hoy.
24
+ *
25
+ * No es lo mismo que `sse`. Aquel es el transporte HTTP+SSE original, de dos
26
+ * endpoints (un GET que abre el stream y un POST aparte para enviar), que la
27
+ * especificación reemplazó por éste: un único endpoint que acepta POST y
28
+ * devuelve JSON o un stream SSE según haga falta.
29
+ *
30
+ * Sin este caso, un servidor MCP remoto moderno es inalcanzable: no expone el
31
+ * `/sse` de dos endpoints que espera `SSETransport` y la conexión muere en un
32
+ * 404.
33
+ */
34
+ export interface HttpTransportConfig {
35
+ /** URL del endpoint MCP, normalmente terminado en `/mcp`. */
36
+ url: string;
37
+ /** Cabeceras extra en cada petición — típicamente la autorización. */
38
+ headers?: Record<string, string>;
39
+ /** Sesión previa a reanudar, si el servidor emitió un id de sesión. */
40
+ sessionId?: string;
41
+ }
42
+
43
+ export type TransportType = "stdio" | "sse" | "websocket" | "http";
22
44
 
23
45
  export interface TransportOptions {
24
46
  type: TransportType;
25
47
  stdio?: StdioTransportConfig;
26
48
  sse?: SSETransportConfig;
27
49
  websocket?: WebSocketTransportConfig;
50
+ http?: HttpTransportConfig;
28
51
  }
29
52
 
30
53
  export function createTransport(options: TransportOptions): Transport {
@@ -58,6 +81,24 @@ export function createTransport(options: TransportOptions): Transport {
58
81
  return new WebSocketTransport(options.websocket);
59
82
  }
60
83
 
84
+ case "http": {
85
+ if (!options.http) {
86
+ throw new Error("http config required for Streamable HTTP transport");
87
+ }
88
+ // La implementación la pone el SDK oficial de MCP, que ya es dependencia
89
+ // nuestra: no hay nada que reescribir acá, sólo faltaba el caso.
90
+ let url: URL;
91
+ try {
92
+ url = new URL(options.http.url);
93
+ } catch {
94
+ throw new Error(`Invalid MCP endpoint URL: ${options.http.url}`);
95
+ }
96
+ return new StreamableHTTPClientTransport(url, {
97
+ requestInit: options.http.headers ? { headers: options.http.headers } : undefined,
98
+ sessionId: options.http.sessionId,
99
+ });
100
+ }
101
+
61
102
  default: {
62
103
  // exhaustive check — TypeScript avisa si falta un caso
63
104
  const _exhaustive: never = options.type;
@@ -96,11 +96,17 @@ export class SSETransport implements Transport {
96
96
  this.sessionId = sessionId;
97
97
  }
98
98
 
99
- // Track cookies for session affinity (important for n8n/proxies)
100
- const setCookie = response.headers.get("set-cookie");
101
- if (setCookie) {
102
- // Simple cookie extraction: just keep the keys and values
103
- const newCookies = setCookie.split(',').map(c => c.split(';')[0].trim());
99
+ // Track cookies for session affinity (important for n8n/proxies).
100
+ //
101
+ // `getSetCookie()` y no `get("set-cookie")`: Set-Cookie es la única cabecera
102
+ // que puede repetirse sin combinarse, y `get()` devuelve las repeticiones
103
+ // unidas con ", " (Bun 1.4 lo alineó con la spec de Fetch). Partir eso por
104
+ // coma rompe cualquier cookie cuyo valor lleve una —`Expires=Wed, 09 Jun
105
+ // 2027 10:18:14 GMT` es el caso de todos los días— y dejaba fragmentos como
106
+ // "09 Jun 2027 10:18:14 GMT" haciéndose pasar por cookies.
107
+ const setCookies = response.headers.getSetCookie();
108
+ if (setCookies.length > 0) {
109
+ const newCookies = setCookies.map(c => c.split(";")[0].trim());
104
110
  this.cookies = [...new Set([...this.cookies, ...newCookies])];
105
111
  }
106
112
  }
@@ -93,10 +93,10 @@ output_format:
93
93
  max_length: "Structured JSON components"
94
94
 
95
95
  examples:
96
- - user_input: "mostrá el dashboard del proyecto"
96
+ - user_input: "muestra el dashboard del proyecto"
97
97
  expected_behavior: "a2ui_create_surface(surfaceId:'project_dash', theme:{primaryColor:'#10B981'}) → a2ui_update_components with Row[Column[Card[metrics]],Column[tasks]] → a2ui_update_data_model(path:'/', value:{metrics:{...}})"
98
98
 
99
- - user_input: "actualizá las métricas del dashboard"
99
+ - user_input: "actualiza las métricas del dashboard"
100
100
  expected_behavior: "a2ui_update_data_model(surfaceId:'project_dash', path:'/metrics/completionRate', value:75)"
101
101
 
102
102
  - user_input: "show a real-time dashboard with server metrics"
@@ -82,13 +82,13 @@ output_format:
82
82
  max_length: "Structured JSON components"
83
83
 
84
84
  examples:
85
- - user_input: "creá un formulario de contacto"
85
+ - user_input: "crea un formulario de contacto"
86
86
  expected_behavior: "a2ui_create_surface(surfaceId:'contact_form', theme:{primaryColor:'#3B82F6',agentDisplayName:'Asistente'}) → a2ui_update_components(surfaceId:'contact_form', components:[root,Column,hdr,name_fld,email_fld,msg_fld,submit_btn]) → a2ui_update_data_model(surfaceId:'contact_form', path:'/form', value:{name:'',email:'',message:''})"
87
87
 
88
88
  - user_input: "I need a signup form with email validation"
89
89
  expected_behavior: "a2ui_create_surface → a2ui_update_components with TextField({value:{path:'/form/email'}, checks:[{call:'required',...},{call:'email',...}]}) → a2ui_update_data_model"
90
90
 
91
- - user_input: "creá un formulario multi-paso"
91
+ - user_input: "crea un formulario multi-paso"
92
92
  expected_behavior: "a2ui_create_surface → a2ui_update_components with Tabs+Column per step → a2ui_update_data_model for all fields"
93
93
  ---
94
94
 
@@ -96,13 +96,13 @@ output_format:
96
96
  max_length: "Structured JSON components"
97
97
 
98
98
  examples:
99
- - user_input: "creá un asistente de reserva"
99
+ - user_input: "crea un asistente de reserva"
100
100
  expected_behavior: "a2ui_create_surface(surfaceId:'booking', theme:{primaryColor:'#8B5CF6'}) → a2ui_update_components with Tabs[step1:service, step2:datetime, step3:confirm] → a2ui_update_data_model(path:'/', value:{service:'', date:'', time:''})"
101
101
 
102
102
  - user_input: "I need a multi-step onboarding flow"
103
103
  expected_behavior: "a2ui_create_surface → a2ui_update_components with Column[step indicator, step content, nav buttons] → a2ui_update_data_model with empty state → on action: a2ui_update_components for next step"
104
104
 
105
- - user_input: "creá un wizard con selección de opciones"
105
+ - user_input: "crea un wizard con selección de opciones"
106
106
  expected_behavior: "a2ui_create_surface → a2ui_update_components with ChoicePicker for options, Button for navigation → a2ui_update_data_model with initial state"
107
107
  ---
108
108
 
@@ -154,7 +154,7 @@ Para crear flujos interactivos multi-paso usando A2UI v0.9. Usar cuando se neces
154
154
  {title: "Confirmar", child: "step3"}
155
155
  ]},
156
156
  {id: "step1", component: "Column", children: ["svc_label", "svc_picker"]},
157
- {id: "svc_label", component: "Text", text: "Seleccioná un servicio", variant: "h3"},
157
+ {id: "svc_label", component: "Text", text: "Selecciona un servicio", variant: "h3"},
158
158
  {id: "svc_picker", component: "ChoicePicker", variant: "mutuallyExclusive", options: [...], value: {path: "/data/service"}},
159
159
  // ... más pasos
160
160
  ]
@@ -168,7 +168,7 @@ Para crear flujos interactivos multi-paso usando A2UI v0.9. Usar cuando se neces
168
168
  {id: "confirm_btn", component: "Button", child: "confirm_btn_text", action: {}},
169
169
  {id: "confirm_btn_text", component: "Text", text: "Confirmar Reserva"},
170
170
  {id: "confirm_dialog", component: "Column", children: ["confirm_msg", "confirm_yes", "confirm_no"]},
171
- {id: "confirm_msg", component: "Text", text: "¿Confirmás tu reserva?"},
171
+ {id: "confirm_msg", component: "Text", text: "¿Confirmas tu reserva?"},
172
172
  {id: "confirm_yes", component: "Button", child: "yes_text", variant: "primary", action: {event: {name: "confirm_booking", context: {service: {path: "/data/service"}}}}},
173
173
  {id: "yes_text", component: "Text", text: "Sí, confirmar"},
174
174
  {id: "confirm_no", component: "Button", child: "no_text", variant: "borderless", action: {event: {name: "cancel"}}}},
@@ -12,17 +12,17 @@ tools: [get_available_models, agent_find, agent_create, agent_archive]
12
12
 
13
13
  # Structured skill fields
14
14
  triggers:
15
- - "creá un agente"
15
+ - "crea un agente"
16
16
  - "create agent"
17
- - "creá un worker"
17
+ - "crea un worker"
18
18
  - "create worker"
19
19
  - "nuevo agente"
20
20
  - "new agent"
21
21
  - "agente especializado"
22
22
  - "specialized agent"
23
- - "buscá un agente"
23
+ - "busca un agente"
24
24
  - "find agent"
25
- - "archivá agente"
25
+ - "archiva agente"
26
26
  - "archive agent"
27
27
  - "worker inactivo"
28
28
  - "inactive worker"
@@ -93,13 +93,13 @@ output_format:
93
93
  max_length: "Agent creation/management summary"
94
94
 
95
95
  examples:
96
- - user_input: "creá un agente para investigación web"
96
+ - user_input: "crea un agente para investigación web"
97
97
  expected_behavior: "agent_find('researcher') → if not exists, agent_create({ name: 'ai_researcher', tools: ['web_search', 'web_fetch'] })"
98
98
 
99
99
  - user_input: "hay un worker para escribir contenido"
100
100
  expected_behavior: "agent_find({ search: 'writer' }) → return existing writer agents"
101
101
 
102
- - user_input: "archivá los agentes inactivos"
102
+ - user_input: "archiva los agentes inactivos"
103
103
  expected_behavior: "Confirm the exact user-selected workers → agent_archive only those IDs"
104
104
  ---
105
105
 
@@ -128,7 +128,7 @@ Para crear nuevos workers especializados o gestionar el ciclo de vida de agents
128
128
  3. **Si no existe** → `get_available_models({ capabilities })` — seleccionar modelo óptimo
129
129
  4. **Crear** → `agent_create({...})` con providerId y modelId seleccionados
130
130
 
131
- Para MCP, incluí `mcp_server_id` y creá un agente por servidor. La tool rechaza duplicados y nunca debe llamarse antes de la confirmación del usuario.
131
+ Para MCP, incluye `mcp_server_id` y crea un agente por servidor. La tool rechaza duplicados y nunca debe llamarse antes de la confirmación del usuario.
132
132
 
133
133
  ### Create Agent Config
134
134
  ```javascript
@@ -13,19 +13,19 @@ tools: [memory_write, memory_read, memory_list, memory_search, memory_delete]
13
13
 
14
14
  # Structured skill fields
15
15
  triggers:
16
- - "guardá en memoria"
16
+ - "guarda en memoria"
17
17
  - "save to memory"
18
- - "recordá esto"
18
+ - "recuerda esto"
19
19
  - "remember this"
20
- - "leé la memoria"
20
+ - "lee la memoria"
21
21
  - "read memory"
22
22
  - "qué hay en memoria"
23
23
  - "what's in memory"
24
- - "buscá en memoria"
24
+ - "busca en memoria"
25
25
  - "search memory"
26
26
  - "lista las memorias"
27
27
  - "list memories"
28
- - "eliminá de memoria"
28
+ - "elimina de memoria"
29
29
  - "delete from memory"
30
30
  - "preferencias"
31
31
  - "preferences"
@@ -73,7 +73,7 @@ output_format:
73
73
  max_length: "1000 characters per entry"
74
74
 
75
75
  examples:
76
- - user_input: "guardá en memoria que prefiero TypeScript"
76
+ - user_input: "guarda en memoria que prefiero TypeScript"
77
77
  expected_behavior: "memory_write({ title: 'Preferencias de Desarrollo', content: 'El usuario prefiere TypeScript' })"
78
78
 
79
79
  - user_input: "qué guardaste sobre mis preferencias"
@@ -82,7 +82,7 @@ examples:
82
82
  - user_input: "lista todas las memorias"
83
83
  expected_behavior: "memory_list({}) → return all memory titles"
84
84
 
85
- - user_input: "buscá en memoria información sobre la DB"
85
+ - user_input: "busca en memoria información sobre la DB"
86
86
  expected_behavior: "memory_search({ query: 'DB database' }) → return relevant entries"
87
87
  ---
88
88
 
@@ -97,9 +97,9 @@ Para guardar, recuperar, buscar, listar o eliminar información persistente entr
97
97
  | Tool | Qué hace | Cuándo usarla |
98
98
  |------|----------|---------------|
99
99
  | `memory_write` | Almacena con título único | Guardar preferencias, datos |
100
- | `memory_read` | Recupera por título exacto | Cuando conocés el título |
100
+ | `memory_read` | Recupera por título exacto | Cuando conoces el título |
101
101
  | `memory_list` | Lista todos los títulos | Explorar qué hay guardado |
102
- | `memory_search` | Busca por keywords | Cuando no recordás título exacto |
102
+ | `memory_search` | Busca por keywords | Cuando no recuerdas título exacto |
103
103
  | `memory_delete` | Elimina entrada | Limpiar datos obsoletos |
104
104
 
105
105
  ## Workflow
@@ -13,15 +13,15 @@ tools: [web_search, web_fetch, memory_write]
13
13
 
14
14
  # Structured skill fields
15
15
  triggers:
16
- - "investigá y guardá"
16
+ - "investiga y guarda"
17
17
  - "research and save"
18
- - "buscá y recordá"
18
+ - "busca y recuerda"
19
19
  - "find and remember"
20
- - "aprendé sobre"
20
+ - "aprende sobre"
21
21
  - "learn about"
22
- - "estudiá esto"
22
+ - "estudia esto"
23
23
  - "study this"
24
- - "documentate y guardá"
24
+ - "documéntate y guarda"
25
25
  - "research and store"
26
26
 
27
27
  preferred_agents: []
@@ -74,13 +74,13 @@ output_format:
74
74
  max_length: "Comprehensive but concise knowledge entry"
75
75
 
76
76
  examples:
77
- - user_input: "investigá y guardá información sobre transformers en ML"
77
+ - user_input: "investiga y guarda información sobre transformers en ML"
78
78
  expected_behavior: "web_search → web_fetch top sources → synthesize → memory_write({ title: 'Transformers ML', content: '...' })"
79
79
 
80
- - user_input: "aprendé sobre las mejores prácticas de React 2025"
80
+ - user_input: "aprende sobre las mejores prácticas de React 2025"
81
81
  expected_behavior: "Search 'React best practices 2025' → fetch docs → synthesize → memory_write"
82
82
 
83
- - user_input: "buscá y recordá las tendencias de IA actuales"
83
+ - user_input: "busca y recuerda las tendencias de IA actuales"
84
84
  expected_behavior: "Search 'AI trends 2025' → fetch multiple sources → compile trends → memory_write"
85
85
  ---
86
86