@johpaz/hive-agents 1.0.4 → 1.0.5
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 +3 -3
- package/dist/hive.js +4275 -3624
- package/dist/tool-worker.js +2 -1
- package/dist/ui/assets/A2UIPage-DTW79pyL.js +8 -0
- package/dist/ui/assets/AgentCreateForm-Bcp3HN8D.js +1 -0
- package/dist/ui/assets/AgentDetailPage-10XptMde.js +1 -0
- package/dist/ui/assets/AgentNewPage-CUt49rVS.js +1 -0
- package/dist/ui/assets/{AgentsPage-YZrDmgNI.js → AgentsPage-1_e1a9xa.js} +3 -3
- package/dist/ui/assets/{ApiClientPage-6a6KFwsQ.js → ApiClientPage-DHfIlSAg.js} +1 -1
- package/dist/ui/assets/ChannelsPage-BnCQAGZL.js +8 -0
- package/dist/ui/assets/DashboardPage-BsCCKHgg.js +6 -0
- package/dist/ui/assets/LoginPage-BaX6cAPa.js +1 -0
- package/dist/ui/assets/{LogsPage-8-H1OJs3.js → LogsPage-DiFBQt7o.js} +1 -1
- package/dist/ui/assets/MeetingPage-Bpv5zVXf.js +1 -0
- package/dist/ui/assets/{ModelSelector-CrgJQ7DG.js → ModelSelector-DfExlPzx.js} +1 -1
- package/dist/ui/assets/{NotFound-B06kVW7N.js → NotFound-C8HBdF73.js} +1 -1
- package/dist/ui/assets/Office3DPage-ChsGMapf.js +319 -0
- package/dist/ui/assets/ProvidersPage-B39pfWHf.js +1 -0
- package/dist/ui/assets/RecoverPage-C_Id9WM-.js +1 -0
- package/dist/ui/assets/SettingsPage-BgFqasyg.js +9 -0
- package/dist/ui/assets/SetupPage-YeJFfgbt.js +1 -0
- package/dist/ui/assets/Vignette-Cyi27LQH.js +4302 -0
- package/dist/ui/assets/VoicePage-Cp63Abj4.js +307 -0
- package/dist/ui/assets/VoicePage-uLWdtoD4.css +1 -0
- package/dist/ui/assets/{WebChatPage-Yahufnth.js → WebChatPage-DxFLWgtM.js} +2 -2
- package/dist/ui/assets/{agentCapabilities-Dg72UAFj.js → agentCapabilities-DOeepCty.js} +1 -1
- package/dist/ui/assets/{alert-DChoEVJw.js → alert-Cj4DpKv6.js} +1 -1
- package/dist/ui/assets/{badge-uRjRSt86.js → badge-DKpeVCpY.js} +1 -1
- package/dist/ui/assets/bia-4LFKOyxR.webp +0 -0
- package/dist/ui/assets/bia-BFcUpOu3.glb +0 -0
- package/dist/ui/assets/{card-DwQizslL.js → card-Cag15G4h.js} +1 -1
- package/dist/ui/assets/{dialog--mljnfAi.js → dialog-7E3EoEt3.js} +1 -1
- package/dist/ui/assets/{dist-js-CLxM1g2B.js → dist-js-Bg0g3vPS.js} +1 -1
- package/dist/ui/assets/dist-js-DwLn9F4C.js +1 -0
- package/dist/ui/assets/index-Bi8qEmrK.js +116 -0
- package/dist/ui/assets/index-D2UhaSb0.css +2 -0
- package/dist/ui/assets/{label-BceoUB2w.js → label-C6atPuIh.js} +1 -1
- package/dist/ui/assets/{square-psq7k_CB.js → mic-Rq4BxU1R.js} +1 -1
- package/dist/ui/assets/rotate-ccw-Dx92orJM.js +1 -0
- package/dist/ui/assets/{scroll-area-DMEaZZUp.js → scroll-area-CSoG2z53.js} +1 -1
- package/dist/ui/assets/{select-BBEBtcLm.js → select-DlCT21_r.js} +1 -1
- package/dist/ui/assets/{slider-DcmBdvYD.js → slider-Bb_PHFJT.js} +1 -1
- package/dist/ui/assets/square-CcWzRWyG.js +1 -0
- package/dist/ui/assets/{switch-CgiDezVR.js → switch-CUsGuBNi.js} +1 -1
- package/dist/ui/assets/{tabs-gUXIjjZv.js → tabs-Ckfc7DGG.js} +1 -1
- package/dist/ui/assets/{textarea-DedxQYBx.js → textarea-BH6pI9Ax.js} +1 -1
- package/dist/ui/assets/useAudioDevices-Dpr_hn6i.js +41 -0
- package/dist/ui/assets/useHiveAgentsModelLoad-CHmtvNp4.js +1 -0
- package/dist/ui/assets/{useProviders-CiLSc05q.js → useProviders-C7FA6z4M.js} +1 -1
- package/dist/ui/assets/volume-2-CBMYsuF3.js +1 -0
- package/dist/ui/assets/volume-x-vNFf2e4-.js +1 -0
- package/dist/ui/index.html +5 -5
- package/package.json +1 -1
- package/packages/cli/src/commands/doctor.ts +99 -44
- package/packages/cli/src/commands/onboard.ts +4 -2
- package/packages/core/src/agent/agent-catalog.ts +23 -23
- package/packages/core/src/agent/context-compiler.ts +1 -1
- package/packages/core/src/agent/conversation-store.ts +14 -1
- package/packages/core/src/agent/llm-client.ts +3 -3
- package/packages/core/src/agent/prompt-builder.ts +1 -1
- package/packages/core/src/agent/realtime-providers/gemini-live.ts +230 -0
- package/packages/core/src/agent/realtime-providers/index.ts +29 -0
- package/packages/core/src/agent/realtime-providers/interface.ts +108 -0
- package/packages/core/src/agent/skill-selector.ts +1 -1
- package/packages/core/src/agent/tool-selector.ts +1 -0
- package/packages/core/src/canvas/canvas-manager.ts +128 -26
- package/packages/core/src/config/loader.ts +6 -4
- package/packages/core/src/events/tool-narration.ts +1 -0
- package/packages/core/src/gateway/delegation-groups.ts +4 -4
- package/packages/core/src/gateway/initializer.ts +17 -10
- package/packages/core/src/gateway/realtime/bridge-tools.ts +392 -0
- package/packages/core/src/gateway/realtime/index.ts +249 -0
- package/packages/core/src/gateway/realtime/prompt.ts +137 -0
- package/packages/core/src/gateway/realtime/protocol.ts +60 -0
- package/packages/core/src/gateway/realtime/voice-session.ts +441 -0
- package/packages/core/src/gateway/routes/providers.ts +1 -1
- package/packages/core/src/gateway/routes/setup.ts +3 -3
- package/packages/core/src/gateway/server.ts +86 -1
- package/packages/core/src/gateway/slash-commands.ts +3 -1
- package/packages/core/src/storage/collections.ts +10 -1
- package/packages/core/src/storage/onboarding.ts +39 -39
- package/packages/core/src/storage/seed.ts +20 -2
- package/packages/core/src/tools/index.ts +1 -0
- package/packages/core/src/tools/web/browser-backend.ts +141 -44
- package/packages/core/src/tools/web/browser-click.ts +2 -2
- package/packages/core/src/tools/web/browser-extract.ts +2 -2
- package/packages/core/src/tools/web/browser-navigate.ts +2 -2
- package/packages/core/src/tools/web/browser-screenshot.ts +12 -5
- package/packages/core/src/tools/web/browser-script.ts +2 -2
- package/packages/core/src/tools/web/browser-service.ts +63 -384
- package/packages/core/src/tools/web/browser-session.ts +125 -0
- package/packages/core/src/tools/web/browser-type.ts +2 -2
- package/packages/core/src/tools/web/browser-wait.ts +2 -2
- package/packages/core/src/tools/web/computer-use.ts +553 -0
- package/packages/core/src/tools/web/index.ts +5 -1
- package/packages/core/src/tools/web/webview-backend.ts +439 -21
- package/dist/ui/assets/A2UIPage-7Ry5rHh9.js +0 -8
- package/dist/ui/assets/AgentCreateForm-Dh5W0q_t.js +0 -1
- package/dist/ui/assets/AgentDetailPage-CIoPjtsS.js +0 -1
- package/dist/ui/assets/AgentNewPage-BNsZcJQf.js +0 -1
- package/dist/ui/assets/ChannelsPage-Dice4dkJ.js +0 -8
- package/dist/ui/assets/DashboardPage-B9r0sc0F.js +0 -6
- package/dist/ui/assets/LoginPage-BkAAX_tu.js +0 -1
- package/dist/ui/assets/MeetingPage-14JoQo71.js +0 -1
- package/dist/ui/assets/Office3DPage-BMUZWkFS.js +0 -4614
- package/dist/ui/assets/ProvidersPage-BiL3QxCs.js +0 -1
- package/dist/ui/assets/RecoverPage-D1o8yxNz.js +0 -1
- package/dist/ui/assets/SettingsPage-GP8UwQIL.js +0 -9
- package/dist/ui/assets/SetupPage-B_gU1YQU.js +0 -1
- package/dist/ui/assets/dist-js-B0s_TDau.js +0 -1
- package/dist/ui/assets/index-BHHUQZJd.js +0 -116
- package/dist/ui/assets/index-CEFhf4dF.css +0 -2
- package/dist/ui/assets/useHiveAgentsModelLoad-C7bhWPDG.js +0 -1
- package/dist/ui/assets/volume-x-BDlMCDYT.js +0 -1
- /package/dist/ui/assets/{core-Sjunb8Z1.js → core-Dz04EE_8.js} +0 -0
- /package/dist/ui/assets/{gateway-url-BZj_2-jf.js → gateway-url-BzQV75Ig.js} +0 -0
- /package/dist/ui/assets/{search-ykSx-zZU.js → search-DB4w9YHW.js} +0 -0
- /package/dist/ui/assets/{send-DAhlz2i9.js → send-xi8HzUdc.js} +0 -0
- /package/dist/ui/assets/{settings-DL0REysC.js → settings-pV0cF8Kf.js} +0 -0
- /package/dist/ui/assets/{shield-BPZZhjCT.js → shield-nLNsomh_.js} +0 -0
- /package/dist/ui/assets/{sparkles-BViXTAh7.js → sparkles-CerRDYxk.js} +0 -0
- /package/dist/ui/assets/{terminal-CzxPKG-h.js → terminal-C2SUZUAD.js} +0 -0
- /package/dist/ui/assets/{trash-2-SgYCWiVk.js → trash-2-BZsMCfso.js} +0 -0
- /package/dist/ui/assets/{useOfficeModel-BAFasrg8.js → useOfficeModel-Cc5VkReZ.js} +0 -0
- /package/dist/ui/assets/{utils-SGUggNJc.js → utils-lc8H6VGT.js} +0 -0
- /package/dist/ui/assets/{vendor-router-Dsg8fxNQ.js → vendor-router-DCsSv_I7.js} +0 -0
- /package/dist/ui/assets/{wifi-CyPHteEm.js → wifi-DNv53AfN.js} +0 -0
- /package/dist/ui/assets/{zap-OVVrfEHr.js → zap-Yed86Sh8.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{b as n,x as r}from"./vendor-radix-DUug7irY.js";import{o as i}from"./vendor-query-Dj8xYhQD.js";import{t as a}from"./utils-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{b as n,x as r}from"./vendor-radix-DUug7irY.js";import{o as i}from"./vendor-query-Dj8xYhQD.js";import{t as a}from"./utils-lc8H6VGT.js";var o=e(t(),1),s=i(),c=o.forwardRef(({className:e,...t},i)=>(0,s.jsx)(n,{className:a(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50`,e),...t,ref:i,children:(0,s.jsx)(r,{className:a(`pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`)})}));c.displayName=n.displayName;export{c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{B as n,R as r,V as i,z as a}from"./vendor-radix-DUug7irY.js";import{o}from"./vendor-query-Dj8xYhQD.js";import{t as s}from"./utils-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{B as n,R as r,V as i,z as a}from"./vendor-radix-DUug7irY.js";import{o}from"./vendor-query-Dj8xYhQD.js";import{t as s}from"./utils-lc8H6VGT.js";var c=e(t(),1),l=o(),u=n,d=c.forwardRef(({className:e,...t},n)=>(0,l.jsx)(a,{ref:n,className:s(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,e),...t}));d.displayName=a.displayName;var f=c.forwardRef(({className:e,...t},n)=>(0,l.jsx)(i,{ref:n,className:s(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,e),...t}));f.displayName=i.displayName;var p=c.forwardRef(({className:e,...t},n)=>(0,l.jsx)(r,{ref:n,className:s(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,e),...t}));p.displayName=r.displayName;export{f as i,p as n,d as r,u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{o as n}from"./vendor-query-Dj8xYhQD.js";import{t as r}from"./utils-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{o as n}from"./vendor-query-Dj8xYhQD.js";import{t as r}from"./utils-lc8H6VGT.js";var i=e(t(),1),a=n(),o=i.forwardRef(({className:e,...t},n)=>(0,a.jsx)(`textarea`,{className:r(`flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),ref:n,...t}));o.displayName=`Textarea`;export{o as t};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{t as n}from"./createLucideIcon-BRaPSYgN.js";import{u as r}from"./vendor-router-DCsSv_I7.js";import{n as i,r as a}from"./gateway-url-BzQV75Ig.js";import{o}from"./index-Bi8qEmrK.js";var s=n(`Settings2`,[[`path`,{d:`M20 7h-9`,key:`3s1dr2`}],[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),c=e(t(),1);function l(){return typeof AudioContext<`u`&&`setSinkId`in AudioContext.prototype}async function u(){return f(`audioinput`)}async function d(){if(l()){let e=await f(`audiooutput`);return{lista:e,motivo:e.length?null:`El navegador todavía no reporta salidas. Concede el permiso de micrófono y vuelve a abrir esta pantalla.`}}if(!o())return{lista:[],motivo:`Este navegador no deja elegir la salida: se usa la del sistema.`};try{let{invoke:e}=await r(async()=>{let{invoke:e}=await import(`./core-Dz04EE_8.js`);return{invoke:e}},[]),t=await e(`audio_outputs`);return{lista:t,motivo:t.length?null:`El sistema no reportó ninguna salida de audio.`}}catch(e){return{lista:[],motivo:e?.message??String(e)}}}async function f(e){try{let t=(await navigator.mediaDevices.enumerateDevices()).filter(t=>t.kind===e),n=t.find(e=>e.deviceId===`default`)?.groupId;return t.filter(e=>e.deviceId!==`default`&&e.deviceId!==`communications`&&e.deviceId).map((t,r)=>({id:t.deviceId,nombre:t.label||`${e===`audioinput`?`Micrófono`:`Salida`} ${r+1}`,porDefecto:!!n&&t.groupId===n}))}catch{return[]}}async function p(e,t){if(l()){let n=t;return n?.setSinkId?(await n.setSinkId(e),!0):!1}if(!o())return!1;let{invoke:n}=await r(async()=>{let{invoke:e}=await import(`./core-Dz04EE_8.js`);return{invoke:e}},[]);return await n(`set_audio_output`,{id:e})>0}function m(e){let t=e.split(`|`)[1]??``;return/headphone|headset|hf-output/.test(t)?!1:/hdmi|speaker|spdif|tv|line-out/.test(t)}var h=16e3,g=24e3,_=640,ee=`
|
|
2
|
+
class PCMCapture extends AudioWorkletProcessor {
|
|
3
|
+
constructor(options) {
|
|
4
|
+
super();
|
|
5
|
+
this.target = options.processorOptions.targetRate;
|
|
6
|
+
this.frame = options.processorOptions.frameSamples;
|
|
7
|
+
this.ratio = sampleRate / this.target;
|
|
8
|
+
this.acc = [];
|
|
9
|
+
this.pos = 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
process(inputs) {
|
|
13
|
+
const input = inputs[0] && inputs[0][0];
|
|
14
|
+
if (!input) return true;
|
|
15
|
+
|
|
16
|
+
// Remuestreo lineal al vuelo: el navegador no siempre concede el sampleRate
|
|
17
|
+
// pedido (WebKitGTK, por ejemplo, entrega el del dispositivo).
|
|
18
|
+
while (this.pos < input.length) {
|
|
19
|
+
const idx = Math.floor(this.pos);
|
|
20
|
+
const frac = this.pos - idx;
|
|
21
|
+
const a = input[idx];
|
|
22
|
+
const b = idx + 1 < input.length ? input[idx + 1] : a;
|
|
23
|
+
this.acc.push(a + (b - a) * frac);
|
|
24
|
+
this.pos += this.ratio;
|
|
25
|
+
|
|
26
|
+
if (this.acc.length >= this.frame) {
|
|
27
|
+
const pcm = new Int16Array(this.acc.length);
|
|
28
|
+
for (let i = 0; i < this.acc.length; i++) {
|
|
29
|
+
const s = Math.max(-1, Math.min(1, this.acc[i]));
|
|
30
|
+
pcm[i] = s < 0 ? s * 0x8000 : s * 0x7fff;
|
|
31
|
+
}
|
|
32
|
+
this.port.postMessage(pcm.buffer, [pcm.buffer]);
|
|
33
|
+
this.acc = [];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
this.pos -= input.length;
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
registerProcessor('pcm-capture', PCMCapture);
|
|
41
|
+
`,te=700,ne=4e3,v=class{bins=new Uint8Array(128);analyser=null;raw=null;smoothedLevel=0;attach(e,t){let n=e.createAnalyser();return n.fftSize=512,n.smoothingTimeConstant=.72,n.minDecibels=-85,n.maxDecibels=-12,t.connect(n),this.analyser=n,this.raw=new Uint8Array(new ArrayBuffer(n.frequencyBinCount)),n}sample(){if(!this.analyser||!this.raw)return 0;this.analyser.getByteFrequencyData(this.raw);let e=Math.floor(this.raw.length*.62),t=0;for(let n=0;n<128;n++){let r=n/127,i=Math.min(e-1,Math.round(r**1.6*(e-1))),a=this.raw[i]??0;this.bins[n]=a,t+=a}let n=Math.min(1,t/32640*3.2);return this.smoothedLevel=n>this.smoothedLevel?this.smoothedLevel+(n-this.smoothedLevel)*.55:this.smoothedLevel+(n-this.smoothedLevel)*.12,this.smoothedLevel}detach(){try{this.analyser?.disconnect()}catch{}this.analyser=null,this.raw=null,this.bins.fill(0),this.smoothedLevel=0}},y=class{onFrame;deviceId;context=null;stream=null;node=null;source=null;spectrum=new v;constructor(e,t=null){this.onFrame=e,this.deviceId=t}async start(){this.stream=await x(this.deviceId),this.context=new AudioContext({sampleRate:h});let e=new Blob([ee],{type:`application/javascript`}),t=URL.createObjectURL(e);try{await this.context.audioWorklet.addModule(t)}finally{URL.revokeObjectURL(t)}this.node=new AudioWorkletNode(this.context,`pcm-capture`,{numberOfInputs:1,numberOfOutputs:0,processorOptions:{targetRate:h,frameSamples:_}}),this.node.port.onmessage=e=>this.onFrame(e.data),this.source=this.context.createMediaStreamSource(this.stream),this.source.connect(this.node),this.spectrum.attach(this.context,this.source),this.context.state!==`running`&&this.context.resume().catch(()=>{})}stop(){this.spectrum.detach(),this.node?.port.close(),this.node?.disconnect(),this.source?.disconnect(),this.stream?.getTracks().forEach(e=>e.stop()),this.context?.close(),this.node=null,this.source=null,this.stream=null,this.context=null}},b=class{context=null;nextStartAt=0;playing=new Set;bus=null;spectrum=new v;onIdle;hablaHasta=0;salidaId=null;salidaLista=!1;aplicandoSalida=!1;ultimoIntento=0;async resume(){this.context||(this.context=new AudioContext,this.bus=this.context.createGain(),this.bus.connect(this.context.destination),this.spectrum.attach(this.context,this.bus),this.context.addEventListener(`statechange`,()=>this.despertar())),this.context.state===`suspended`?await this.context.resume():this.despertar()}despertar(){let e=this.context;!e||e.state===`running`||e.state===`closed`||e.resume().catch(()=>{})}async usarSalida(e){this.salidaId=e,this.salidaLista=!1,this.ultimoIntento=0,await this.encaminar()}async encaminar(){if(!this.salidaId||this.salidaLista||this.aplicandoSalida)return;let e=Date.now();if(!(e-this.ultimoIntento<900)){this.ultimoIntento=e,this.aplicandoSalida=!0;try{this.salidaLista=await p(this.salidaId,this.context)}catch{}finally{this.aplicandoSalida=!1}}}enqueue(e){if(!this.context||!this.bus)return;this.encaminar();let t=new Int16Array(e);if(!t.length)return;let n=this.context.createBuffer(1,t.length,g),r=n.getChannelData(0);for(let e=0;e<t.length;e++)r[e]=t[e]/32768;let i=this.context.createBufferSource();i.buffer=n,i.connect(this.bus);let a=this.context.currentTime,o=Math.max(a+.02,this.nextStartAt);i.start(o),this.nextStartAt=o+n.duration;let s=Math.min(ne,Math.max(0,(this.nextStartAt-a)*1e3));this.hablaHasta=Math.max(this.hablaHasta,Date.now()+s+te),this.playing.add(i),i.onended=()=>{this.playing.delete(i),this.playing.size||this.onIdle?.()}}async probar(){if(await this.resume(),!this.context||!this.bus)return;this.encaminar();let e=this.context.currentTime+.05;for(let[t,n]of[660,990].entries()){let r=this.context.createOscillator(),i=this.context.createGain();r.type=`sine`,r.frequency.value=n;let a=e+t*.18;i.gain.setValueAtTime(0,a),i.gain.linearRampToValueAtTime(.16,a+.02),i.gain.setValueAtTime(.16,a+.12),i.gain.linearRampToValueAtTime(0,a+.17),r.connect(i),i.connect(this.bus),r.start(a),r.stop(a+.18)}}estaHablando(){return Date.now()<this.hablaHasta}interrupt(){this.hablaHasta=0;for(let e of this.playing)try{e.stop()}catch{}this.playing.clear(),this.nextStartAt=0}get isSpeaking(){return this.playing.size>0}stop(){this.interrupt(),this.hablaHasta=0,this.spectrum.detach();try{this.bus?.disconnect()}catch{}this.bus=null,this.context?.close(),this.context=null}};async function x(e){let t={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0};if(!e)return navigator.mediaDevices.getUserMedia({audio:t});try{return await navigator.mediaDevices.getUserMedia({audio:{...t,deviceId:{exact:e}}})}catch(e){let n=e?.name;if(n!==`OverconstrainedError`&&n!==`NotFoundError`)throw e;return navigator.mediaDevices.getUserMedia({audio:t})}}function S(e){switch(e?.name){case`NotAllowedError`:case`SecurityError`:return`Permiso de micrófono denegado. Habilítalo para este sitio y vuelve a intentar.`;case`NotFoundError`:case`OverconstrainedError`:return`No se encontró ningún micrófono conectado.`;case`NotReadableError`:return`Otra aplicación está usando el micrófono.`;default:return`No se pudo acceder al micrófono: ${e?.message??`error desconocido`}`}}var C=1,w=640,T=.6,E=class{onFrame;stream=null;video=null;canvas=null;timer=null;constructor(e){this.onFrame=e}get element(){return this.video}async start(){this.stream=await navigator.mediaDevices.getUserMedia({video:{width:{ideal:1280},height:{ideal:720},facingMode:`user`}});let e=document.createElement(`video`);e.srcObject=this.stream,e.muted=!0,e.playsInline=!0,await e.play(),this.video=e,this.canvas=document.createElement(`canvas`),this.timer=setInterval(()=>this.capture(),1e3/C)}capture(){let e=this.video,t=this.canvas;if(!e||!t||!e.videoWidth)return;let n=Math.min(1,w/e.videoWidth);t.width=Math.round(e.videoWidth*n),t.height=Math.round(e.videoHeight*n);let r=t.getContext(`2d`);if(!r)return;r.drawImage(e,0,0,t.width,t.height);let i=t.toDataURL(`image/jpeg`,T),a=i.slice(i.indexOf(`,`)+1);a&&this.onFrame(a,`image/jpeg`)}stop(){this.timer&&clearInterval(this.timer),this.timer=null,this.stream?.getTracks().forEach(e=>e.stop()),this.video&&=(this.video.srcObject=null,null),this.stream=null,this.canvas=null}};function D(e){switch(e?.name){case`NotAllowedError`:case`SecurityError`:return`Permiso de cámara denegado. Habilitalo para este sitio y volvé a intentar.`;case`NotFoundError`:case`OverconstrainedError`:return`No se encontró ninguna cámara conectada.`;case`NotReadableError`:return`Otra aplicación está usando la cámara.`;default:return`No se pudo acceder a la cámara: ${e?.message??`error desconocido`}`}}var O=1,k=1280,A=.72,j=class{onFrame;onEnded;stream=null;video=null;canvas=null;timer=null;constructor(e,t){this.onFrame=e,this.onEnded=t}get element(){return this.video}async start(){this.stream=await navigator.mediaDevices.getDisplayMedia({video:{frameRate:{ideal:1,max:5}},audio:!1});let[e]=this.stream.getVideoTracks();e&&e.addEventListener(`ended`,()=>{this.stop(),this.onEnded?.()});let t=document.createElement(`video`);t.srcObject=this.stream,t.muted=!0,t.playsInline=!0,await t.play(),this.video=t,this.canvas=document.createElement(`canvas`),this.timer=setInterval(()=>this.capture(),1e3/O)}capture(){let e=this.video,t=this.canvas;if(!e||!t||!e.videoWidth)return;let n=Math.min(1,k/e.videoWidth);t.width=Math.round(e.videoWidth*n),t.height=Math.round(e.videoHeight*n);let r=t.getContext(`2d`);if(!r)return;r.drawImage(e,0,0,t.width,t.height);let i=t.toDataURL(`image/jpeg`,A),a=i.slice(i.indexOf(`,`)+1);a&&this.onFrame(a,`image/jpeg`)}stop(){this.timer&&clearInterval(this.timer),this.timer=null,this.stream?.getTracks().forEach(e=>e.stop()),this.video&&=(this.video.srcObject=null,null),this.stream=null,this.canvas=null}};function re(e){switch(e?.name){case`NotAllowedError`:return`No se compartió ninguna pantalla.`;case`NotFoundError`:return`No hay ninguna pantalla o ventana disponible para compartir.`;case`NotReadableError`:return`El sistema no dejó capturar la pantalla. En Linux puede faltar el portal de escritorio.`;default:return`No se pudo compartir la pantalla: ${e?.message??`error desconocido`}`}}function ie(){return I?.element??null}function ae(){return L?.element??null}function M(){return{mic:P?.spectrum??null,player:F?.spectrum??null}}var N=null,P=null,F=null,I=null,L=null,R=[{id:`Kore`,nombre:`Kore`,nota:`Femenina, firme`},{id:`Aoede`,nombre:`Aoede`,nota:`Femenina, cálida`},{id:`Leda`,nombre:`Leda`,nota:`Femenina, juvenil`},{id:`Zephyr`,nombre:`Zephyr`,nota:`Femenina, luminosa`},{id:`Autonoe`,nombre:`Autonoe`,nota:`Femenina, serena`},{id:`Despina`,nombre:`Despina`,nota:`Femenina, suave`},{id:`Puck`,nombre:`Puck`,nota:`Masculina, animada`},{id:`Charon`,nombre:`Charon`,nota:`Masculina, grave`},{id:`Fenrir`,nombre:`Fenrir`,nota:`Masculina, enérgica`},{id:`Orus`,nombre:`Orus`,nota:`Masculina, neutra`}],z=[{id:`es-CO`,nombre:`Español (Colombia)`},{id:`es-MX`,nombre:`Español (México)`},{id:`es-AR`,nombre:`Español (Argentina)`},{id:`es-ES`,nombre:`Español (España)`},{id:`es-US`,nombre:`Español (EE. UU.)`},{id:`en-US`,nombre:`Inglés (EE. UU.)`},{id:`pt-BR`,nombre:`Portugués (Brasil)`}],B=[{id:`foto`,nombre:`Retrato (mejor acabado)`},{id:`modelo`,nombre:`Modelo 3D (se gira con el ratón)`}],V=`hive-voice-avatar`,H=`hive-voice-persona`,U=`hive-voice-language`,W=`hive-voice-output`,G=`hive-voice-input`,K=`hive-voice-speaker`;function q(){return typeof localStorage>`u`?{voice:R[0].id,language:z[0].id,output:``,input:``,speaker:!1}:{voice:localStorage.getItem(H)||R[0].id,language:localStorage.getItem(U)||z[0].id,output:localStorage.getItem(W)||``,input:localStorage.getItem(G)||``,speaker:localStorage.getItem(K)===`1`}}function J(e){typeof localStorage>`u`||(e.voice&&localStorage.setItem(H,e.voice),e.language&&localStorage.setItem(U,e.language),Y(W,e.output),Y(G,e.input),e.speaker!==void 0&&localStorage.setItem(K,e.speaker?`1`:`0`))}function Y(e,t){t!==void 0&&(t?localStorage.setItem(e,t):localStorage.removeItem(e))}function X(){if(typeof localStorage>`u`)return`modelo`;let e=localStorage.getItem(V);return e===`foto`||e===`modelo`?e:`modelo`}function oe(e){typeof localStorage<`u`&&localStorage.setItem(V,e)}function se(e,t,n,r){let a=new URL(`${i()}/realtime`);a.searchParams.set(`session`,e);let o=typeof localStorage<`u`?localStorage.getItem(`hive-auth-token`):null;return o&&a.searchParams.set(`token`,o),t&&a.searchParams.set(`voice`,t),n&&a.searchParams.set(`lang`,n),r&&a.searchParams.set(`altavoz`,`1`),a.toString()}var Z={inputTokens:0,outputTokens:0,totalTokens:0},Q=0,ce=a((e,t)=>({status:`idle`,error:null,model:null,voice:null,startedAt:null,transcripts:[],milestones:[],lastTool:null,working:!1,usage:Z,latencyMs:null,cameraOn:!1,cameraError:null,screenOn:!1,screenError:null,modoAltavoz:q().speaker,toggleCamera:async()=>{if(I){I.stop(),I=null,e({cameraOn:!1,cameraError:null});return}try{let t=new E((e,t)=>{N?.readyState===WebSocket.OPEN&&N.send(JSON.stringify({type:`video`,data:e,mimeType:t}))});await t.start(),I=t,e({cameraOn:!0,cameraError:null})}catch(t){I=null,e({cameraOn:!1,cameraError:D(t)})}},toggleScreen:async()=>{if(L){L.stop(),L=null,e({screenOn:!1,screenError:null});return}try{let t=new j((e,t)=>{N?.readyState===WebSocket.OPEN&&N.send(JSON.stringify({type:`video`,data:e,mimeType:t,source:`screen`}))},()=>{L=null,e({screenOn:!1})});await t.start(),L=t,e({screenOn:!0,screenError:null})}catch(t){L=null,e({screenOn:!1,screenError:re(t)})}},prepararAudio:()=>{F||(F=new b,F.onIdle=()=>{t().status===`speaking`&&e({status:`listening`})}),F.resume()},usarModoAltavoz:t=>{J({speaker:t}),e({modoAltavoz:t})},micCallado:()=>t().modoAltavoz&&!!F?.estaHablando(),usarSalida:async e=>{J({output:e}),e&&t().usarModoAltavoz(m(e)),await F?.usarSalida(e||null)},usarEntrada:async n=>{if(J({input:n}),!P)return;P.stop();let r=new y(e=>{t().modoAltavoz&&F?.estaHablando()||N?.readyState===WebSocket.OPEN&&N.send(e)},n||null);P=r;try{await r.start()}catch(t){P=null,e({status:`error`,error:S(t)})}},probarSalida:async()=>{t().prepararAudio();let e=q();e.output&&F?.usarSalida(e.output),await F?.probar()},start:async(n,r,i)=>{if(t().status!==`idle`&&t().status!==`error`)return;e({status:`connecting`,error:null,transcripts:[],milestones:[],lastTool:null,working:!1,usage:Z,latencyMs:null,startedAt:Date.now()}),t().prepararAudio();let a=q();a.output&&F?.usarSalida(a.output);try{if(await F?.resume(),!window.isSecureContext)throw Error(`El micrófono necesita una conexión segura (https o localhost).`);P=new y(e=>{t().modoAltavoz&&F?.estaHablando()||N?.readyState===WebSocket.OPEN&&N.send(e)},a.input||null),await P.start()}catch(n){t().stop(),e({status:`error`,error:S(n)});return}N=new WebSocket(se(n,r??a.voice,i??a.language,t().modoAltavoz)),N.binaryType=`arraybuffer`,N.onmessage=n=>{if(n.data instanceof ArrayBuffer){if(F?.enqueue(n.data),t().status===`listening`){let t=Q?Date.now()-Q:null;Q=0,e(t?{status:`speaking`,latencyMs:t}:{status:`speaking`})}return}let r;try{r=JSON.parse(n.data)}catch{return}switch(r.type){case`ready`:e({status:`listening`,model:r.model,voice:r.voice});break;case`transcript`:r.role===`user`&&(Q=Date.now()),e(e=>({transcripts:le(e.transcripts,r.role,r.text)}));break;case`narration`:e(e=>({milestones:[...e.milestones,{id:`${r.at}-${e.milestones.length}`,kind:r.kind,status:r.status,label:r.label,detail:r.detail??null,agent:r.agent??``,at:r.at}].slice(-60),working:r.kind!==`group_ready`&&r.kind!==`failed`}));break;case`usage`:e({usage:{inputTokens:r.inputTokens,outputTokens:r.outputTokens,totalTokens:r.totalTokens}});break;case`interrupted`:F?.interrupt(),e({status:`listening`});break;case`turn_complete`:F?.isSpeaking||e({status:`listening`});break;case`tool`:e({lastTool:r.name,working:r.name===`consultar_a_bee`});break;case`error`:e({status:`error`,error:r.error});break;case`closed`:t().stop();break}},N.onerror=()=>e({status:`error`,error:`Se perdió la conexión con la voz.`}),N.onclose=()=>{t().status!==`error`&&t().stop()}},stop:()=>{P?.stop(),F?.stop(),I?.stop(),I=null,L?.stop(),L=null;try{N?.close()}catch{}P=null,F=null,N=null,Q=0,e({status:`idle`,model:null,voice:null,lastTool:null,working:!1,startedAt:null,cameraOn:!1,cameraError:null,screenOn:!1,screenError:null})},sendText:e=>{N?.readyState===WebSocket.OPEN&&N.send(JSON.stringify({type:`text`,content:e}))},interrupt:()=>{F?.interrupt(),N?.readyState===WebSocket.OPEN&&N.send(JSON.stringify({type:`interrupt`}))}}));function le(e,t,n){let r=e[e.length-1];if(r&&r.role===t){let t=[...e];return t[t.length-1]={...r,text:r.text+n},t}return[...e,{role:t,text:n,at:Date.now()}].slice(-40)}var $=`hive-audio-devices`;function ue(){window.dispatchEvent(new Event($))}function de(){let[e,t]=(0,c.useState)([]),[n,r]=(0,c.useState)([]),[i,a]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=!0,n=()=>{u().then(n=>{e&&t(n)}),d().then(t=>{e&&(r(t.lista),a(t.motivo))})};return n(),navigator.mediaDevices?.addEventListener?.(`devicechange`,n),window.addEventListener($,n),()=>{e=!1,navigator.mediaDevices?.removeEventListener?.(`devicechange`,n),window.removeEventListener($,n)}},[]),{entradas:e,salidas:n,motivoSalidas:i}}function fe(e,t,n){let[r,i]=(0,c.useState)(0),a=(0,c.useRef)(0);return(0,c.useEffect)(()=>{if(!t){i(0);return}let r=!0,o=0,s=null,c=null,l=null,u=null,d=()=>{if(!r)return;let e=0;if(n)e=M().mic?.sample()??0;else if(l&&u){l.getByteFrequencyData(u);let t=0;for(let e of u)t+=e;e=Math.min(1,t/(u.length*255)*3.2)}a.current=e>a.current?a.current+(e-a.current)*.5:a.current+(e-a.current)*.12,i(a.current),o=requestAnimationFrame(d)};if(n)o=requestAnimationFrame(d);else{let t={echoCancellation:!0,noiseSuppression:!0};e&&(t.deviceId={exact:e}),navigator.mediaDevices.getUserMedia({audio:t}).then(e=>{if(!r){e.getTracks().forEach(e=>e.stop());return}s=e,ue(),c=new AudioContext,l=c.createAnalyser(),l.fftSize=512,l.smoothingTimeConstant=.7,c.createMediaStreamSource(e).connect(l),u=new Uint8Array(new ArrayBuffer(l.frequencyBinCount)),o=requestAnimationFrame(d)}).catch(()=>{})}return()=>{r=!1,cancelAnimationFrame(o),s?.getTracks().forEach(e=>e.stop()),c?.close(),a.current=0}},[e,t,n]),r}export{R as a,M as c,oe as d,J as f,z as i,X as l,s as m,fe as n,ie as o,ce as p,B as r,ae as s,de as t,q as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{y as n}from"./index-Bi8qEmrK.js";var r=e(t(),1),i=2500,a=48e4;function o(){let e=n(e=>e.loadHiveAgentsModel),t=n(e=>e.getHiveAgentsModelStatus),o=(0,r.useRef)(null);return{load:(0,r.useCallback)(async(n,r)=>{o.current&&(o.current.abort=!0);let s={abort:!1};o.current=s;let c=Date.now();try{await e(n,r)}catch{return!1}for(;!s.abort&&Date.now()-c<a;){try{let e=await t();if(e.loaded&&e.model?.name===n)return!0}catch{}await new Promise(e=>setTimeout(e,i))}return!1},[e,t]),cancel:(0,r.useCallback)(()=>{o.current&&=(o.current.abort=!0,null)},[])}}export{o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-BRaPSYgN.js";import"./index-
|
|
1
|
+
import{t as e}from"./createLucideIcon-BRaPSYgN.js";import"./index-Bi8qEmrK.js";var t=e(`Cpu`,[[`rect`,{width:`16`,height:`16`,x:`4`,y:`4`,rx:`2`,key:`14l7u7`}],[`rect`,{width:`6`,height:`6`,x:`9`,y:`9`,rx:`1`,key:`5aljv4`}],[`path`,{d:`M15 2v2`,key:`13l42r`}],[`path`,{d:`M15 20v2`,key:`15mkzm`}],[`path`,{d:`M2 15h2`,key:`1gxd5l`}],[`path`,{d:`M2 9h2`,key:`1bbxkp`}],[`path`,{d:`M20 15h2`,key:`19e6y8`}],[`path`,{d:`M20 9h2`,key:`19tzq7`}],[`path`,{d:`M9 2v2`,key:`165o2o`}],[`path`,{d:`M9 20v2`,key:`i2bqo8`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-BRaPSYgN.js";var t=e(`Volume2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-BRaPSYgN.js";var t=e(`VolumeX`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`line`,{x1:`22`,x2:`16`,y1:`9`,y2:`15`,key:`1ewh16`}],[`line`,{x1:`16`,x2:`22`,y1:`9`,y2:`15`,key:`5ykzw1`}]]);export{t};
|
package/dist/ui/index.html
CHANGED
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
<meta name="twitter:title" content="Hive">
|
|
24
24
|
<meta property="og:description" content="Hive Agents">
|
|
25
25
|
<meta name="twitter:description" content="Hive Agents">
|
|
26
|
-
<script type="module" crossorigin src="/assets/index-
|
|
26
|
+
<script type="module" crossorigin src="/assets/index-Bi8qEmrK.js"></script>
|
|
27
27
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-S-ySWqyJ.js">
|
|
28
28
|
<link rel="modulepreload" crossorigin href="/assets/vendor-charts-K3xcRl0X.js">
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-router-
|
|
29
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-router-DCsSv_I7.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/vendor-query-Dj8xYhQD.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/vendor-radix-DUug7irY.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/dist-CD_qfA30.js">
|
|
33
33
|
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon-BRaPSYgN.js">
|
|
34
34
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-DYyYpuMy.js">
|
|
35
|
-
<link rel="modulepreload" crossorigin href="/assets/utils-
|
|
36
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-url-
|
|
37
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
35
|
+
<link rel="modulepreload" crossorigin href="/assets/utils-lc8H6VGT.js">
|
|
36
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-url-BzQV75Ig.js">
|
|
37
|
+
<link rel="stylesheet" crossorigin href="/assets/index-D2UhaSb0.css">
|
|
38
38
|
</head>
|
|
39
39
|
|
|
40
40
|
<body>
|
package/package.json
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as p from "@clack/prompts";
|
|
2
1
|
import * as fs from "fs";
|
|
3
2
|
import * as path from "path";
|
|
4
3
|
import { execSync } from "child_process";
|
|
@@ -169,7 +168,7 @@ export async function doctor(): Promise<void> {
|
|
|
169
168
|
name: "Componentes",
|
|
170
169
|
status: "error",
|
|
171
170
|
message: `faltan: ${faltantes.join(", ")}`,
|
|
172
|
-
hint: "La base está incompleta.
|
|
171
|
+
hint: "La base está incompleta. Restaura una copia o reinicia para volver a sembrar.",
|
|
173
172
|
});
|
|
174
173
|
} else {
|
|
175
174
|
const bytes = dirSize(getDbFile());
|
|
@@ -181,22 +180,49 @@ export async function doctor(): Promise<void> {
|
|
|
181
180
|
});
|
|
182
181
|
}
|
|
183
182
|
|
|
184
|
-
//
|
|
183
|
+
// Datos reales: que los archivos existan y se puedan leer no prueba que
|
|
184
|
+
// haya algo adentro. Una base vacía abre perfecto y deja a Hive sin
|
|
185
|
+
// agentes, sin modelos y sin tools — que es la falla que el usuario ve
|
|
186
|
+
// como "no responde", no como "la BD está mal".
|
|
185
187
|
try {
|
|
186
|
-
|
|
188
|
+
// Sólo lectura: se abre la base tal como está. Sembrarla acá haría que
|
|
189
|
+
// el diagnóstico se aprobara a sí mismo, además de reescribir datos.
|
|
187
190
|
const { col } = await import("@johpaz/hive-agents-core/storage/hive");
|
|
188
|
-
await ensureHiveDb();
|
|
189
191
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
const esenciales = ["agents", "models", "providers", "tools", "skills"];
|
|
193
|
+
const conteos: Record<string, number> = {};
|
|
194
|
+
for (const nombre of esenciales) {
|
|
195
|
+
conteos[nombre] = await (await col(nombre)).count();
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const total = Object.values(conteos).reduce((a, b) => a + b, 0);
|
|
199
|
+
const vacias = esenciales.filter((nombre) => conteos[nombre] === 0);
|
|
200
|
+
const detalle = esenciales.map((nombre) => `${conteos[nombre]} ${nombre}`).join(", ");
|
|
201
|
+
|
|
202
|
+
if (total === 0) {
|
|
203
|
+
checks.push({
|
|
204
|
+
category: "Integridad",
|
|
205
|
+
name: "Datos",
|
|
206
|
+
status: "error",
|
|
207
|
+
message: "la base está vacía",
|
|
208
|
+
hint: "Arranca el gateway con 'hive start': siembra los datos por defecto al iniciar.",
|
|
209
|
+
});
|
|
210
|
+
} else if (vacias.length > 0) {
|
|
211
|
+
checks.push({
|
|
212
|
+
category: "Integridad",
|
|
213
|
+
name: "Datos",
|
|
214
|
+
status: "warn",
|
|
215
|
+
message: `${detalle} — sin registros en: ${vacias.join(", ")}`,
|
|
216
|
+
hint: "Ejecuta 'hive migrate' para volver a sembrar lo que falta.",
|
|
217
|
+
});
|
|
218
|
+
} else {
|
|
219
|
+
checks.push({
|
|
220
|
+
category: "Integridad",
|
|
221
|
+
name: "Datos",
|
|
222
|
+
status: "ok",
|
|
223
|
+
message: detalle,
|
|
224
|
+
});
|
|
193
225
|
}
|
|
194
|
-
checks.push({
|
|
195
|
-
category: "Integridad",
|
|
196
|
-
name: "Lectura",
|
|
197
|
-
status: "ok",
|
|
198
|
-
message: `${filas} filas leídas de 5 colecciones`,
|
|
199
|
-
});
|
|
200
226
|
} catch (e) {
|
|
201
227
|
const mensaje = (e as Error).message;
|
|
202
228
|
// "Cannot acquire lock" significa que otro proceso la tiene abierta —el
|
|
@@ -205,12 +231,12 @@ export async function doctor(): Promise<void> {
|
|
|
205
231
|
const enUso = /already open|acquire lock|locked/i.test(mensaje);
|
|
206
232
|
checks.push({
|
|
207
233
|
category: "Integridad",
|
|
208
|
-
name: "
|
|
234
|
+
name: "Datos",
|
|
209
235
|
status: enUso ? "warn" : "error",
|
|
210
236
|
message: enUso ? "en uso por otro proceso — no se pudo verificar" : `la base no se pudo leer: ${mensaje}`,
|
|
211
237
|
hint: enUso
|
|
212
|
-
? "
|
|
213
|
-
: "Puede haber quedado corrupta. Si
|
|
238
|
+
? "Detén el gateway (hive stop) y vuelve a correr el diagnóstico."
|
|
239
|
+
: "Puede haber quedado corrupta. Si tienes una copia de <HIVE_HOME>/data, restáurala.",
|
|
214
240
|
});
|
|
215
241
|
}
|
|
216
242
|
|
|
@@ -251,9 +277,7 @@ export async function doctor(): Promise<void> {
|
|
|
251
277
|
// Workspace — leer desde agents.workspace en la BD
|
|
252
278
|
let workspacePath: string | null = null;
|
|
253
279
|
try {
|
|
254
|
-
const { ensureHiveDb } = await import("@johpaz/hive-agents-core/storage/bootstrap");
|
|
255
280
|
const { col } = await import("@johpaz/hive-agents-core/storage/hive");
|
|
256
|
-
await ensureHiveDb();
|
|
257
281
|
const agentsCol = await col<{ role: string; workspace: string | null }>("agents");
|
|
258
282
|
const coordinator = (await agentsCol.findBy("role", "coordinator"))[0];
|
|
259
283
|
const ws = coordinator?.doc.workspace;
|
|
@@ -270,9 +294,7 @@ export async function doctor(): Promise<void> {
|
|
|
270
294
|
|
|
271
295
|
// Seed Data — verificar que los datos del seed estén actualizados
|
|
272
296
|
try {
|
|
273
|
-
const { ensureHiveDb } = await import("@johpaz/hive-agents-core/storage/bootstrap");
|
|
274
297
|
const { col } = await import("@johpaz/hive-agents-core/storage/hive");
|
|
275
|
-
await ensureHiveDb();
|
|
276
298
|
const { SEED_DATA } = await import("@johpaz/hive-agents-core/storage/seed");
|
|
277
299
|
|
|
278
300
|
// Tools: comparar count en BD vs seed
|
|
@@ -368,9 +390,7 @@ export async function doctor(): Promise<void> {
|
|
|
368
390
|
// para que una persona decida. Nada la resuelve automáticamente, así que
|
|
369
391
|
// se acumulan hasta que alguien las revisa — doctor las saca a la luz.
|
|
370
392
|
try {
|
|
371
|
-
const { ensureHiveDb } = await import("@johpaz/hive-agents-core/storage/bootstrap");
|
|
372
393
|
const { col } = await import("@johpaz/hive-agents-core/storage/hive");
|
|
373
|
-
await ensureHiveDb();
|
|
374
394
|
|
|
375
395
|
const proposalsCol = await col<{ status: string; type: string; agent_id: string }>("agentProposals");
|
|
376
396
|
const pending = (await proposalsCol.scan({})).filter(
|
|
@@ -406,25 +426,51 @@ export async function doctor(): Promise<void> {
|
|
|
406
426
|
});
|
|
407
427
|
}
|
|
408
428
|
|
|
409
|
-
// Navegador —
|
|
429
|
+
// Navegador — las browser tools necesitan un Chromium instalado.
|
|
410
430
|
try {
|
|
411
|
-
const { resolveBackendKind, isWebViewSupported, findChrome } =
|
|
412
|
-
"@johpaz/hive-agents-core/tools/web/browser-backend"
|
|
413
|
-
);
|
|
431
|
+
const { resolveBackendKind, isWebViewSupported, resolveWebViewEngine, findChrome, browserInstallHint } =
|
|
432
|
+
await import("@johpaz/hive-agents-core/tools/web/browser-backend");
|
|
414
433
|
const config = loadConfig();
|
|
415
|
-
|
|
434
|
+
// Con una config vieja (`backend: "agent-browser"`) esto deja el aviso en el log.
|
|
435
|
+
resolveBackendKind(config.tools?.browser?.backend);
|
|
416
436
|
|
|
417
|
-
if (
|
|
437
|
+
if (!isWebViewSupported()) {
|
|
418
438
|
checks.push({
|
|
419
439
|
category: "Navegador",
|
|
420
|
-
name: "
|
|
440
|
+
name: "Motor",
|
|
421
441
|
status: "error",
|
|
422
|
-
message: "
|
|
423
|
-
hint:
|
|
442
|
+
message: "no se encontró ningún navegador",
|
|
443
|
+
hint: browserInstallHint(),
|
|
444
|
+
});
|
|
445
|
+
} else if (resolveWebViewEngine() === "webkit") {
|
|
446
|
+
// Sin CDP: el snapshot cae al recorrido del DOM, no hay sesión persistente
|
|
447
|
+
// y computer_use_task vuelve a los eventos sintéticos.
|
|
448
|
+
checks.push({
|
|
449
|
+
category: "Navegador",
|
|
450
|
+
name: "Motor",
|
|
451
|
+
status: "warn",
|
|
452
|
+
message: "WebKit (sin CDP: sin sesión persistente ni clics reales)",
|
|
453
|
+
hint: "Instala Chrome o Chromium para tener el motor completo.",
|
|
424
454
|
});
|
|
425
455
|
} else {
|
|
426
|
-
|
|
427
|
-
|
|
456
|
+
checks.push({
|
|
457
|
+
category: "Navegador",
|
|
458
|
+
name: "Motor",
|
|
459
|
+
status: "ok",
|
|
460
|
+
message: `Bun.WebView · chrome (${findChrome()})`,
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// agent-browser se retiró: lo que dejó ocupando disco no lo borra el doctor.
|
|
465
|
+
const cacheViejo = path.join(getHiveDirConst(), "agent-browser");
|
|
466
|
+
if (fs.existsSync(cacheViejo)) {
|
|
467
|
+
checks.push({
|
|
468
|
+
category: "Navegador",
|
|
469
|
+
name: "Caché de agent-browser",
|
|
470
|
+
status: "warn",
|
|
471
|
+
message: "quedó el caché del backend retirado",
|
|
472
|
+
hint: `Ya no se usa; puedes borrar ${cacheViejo} (y ~/.cache/puppeteer si sólo lo usaba él).`,
|
|
473
|
+
});
|
|
428
474
|
}
|
|
429
475
|
} catch (e) {
|
|
430
476
|
checks.push({
|
|
@@ -460,20 +506,29 @@ export async function doctor(): Promise<void> {
|
|
|
460
506
|
const warns = checks.filter((c) => c.status === "warn");
|
|
461
507
|
|
|
462
508
|
if (errors.length > 0) {
|
|
509
|
+
// Acá se ofrecía ejecutar el onboarding. Ese comando ya no existe —la
|
|
510
|
+
// configuración inicial se hace desde la UI al arrancar el gateway—, así
|
|
511
|
+
// que preguntarlo dejaba el diagnóstico colgado esperando una respuesta
|
|
512
|
+
// que no llevaba a ninguna parte, y encima rompía cualquier uso en CI.
|
|
463
513
|
console.log(`❌ ${errors.length} error(es) encontrado(s)`);
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
message: "¿Deseas ejecutar el onboarding para reparar?",
|
|
467
|
-
initialValue: false,
|
|
468
|
-
});
|
|
469
|
-
|
|
470
|
-
if (fix) {
|
|
471
|
-
const { onboard } = await import("./onboard");
|
|
472
|
-
await onboard();
|
|
473
|
-
}
|
|
514
|
+
console.log(" Revisa las pistas 💡 de arriba. La configuración inicial se completa");
|
|
515
|
+
console.log(" arrancando el gateway con 'hive start' y abriendo la UI.");
|
|
474
516
|
} else if (warns.length > 0) {
|
|
475
517
|
console.log(`⚠️ ${warns.length} advertencia(s)`);
|
|
476
518
|
} else {
|
|
477
519
|
console.log("✅ Todo en orden");
|
|
478
520
|
}
|
|
521
|
+
|
|
522
|
+
// El diagnóstico terminó, pero el proceso no: quedan la base abierta y la
|
|
523
|
+
// conexión keep-alive del health check del gateway. Sin esto, `hive doctor`
|
|
524
|
+
// imprime todo y se cuelga para siempre — invisible a ojo, letal en un script.
|
|
525
|
+
try {
|
|
526
|
+
const { closeHiveDb } = await import("@johpaz/hive-agents-core/storage/hivedb");
|
|
527
|
+
closeHiveDb();
|
|
528
|
+
} catch {
|
|
529
|
+
/* la base ni se abrió */
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// Y sale con el veredicto: 1 si encontró errores, para que sirva en CI.
|
|
533
|
+
process.exit(errors.length > 0 ? 1 : 0);
|
|
479
534
|
}
|
|
@@ -97,7 +97,7 @@ const DEFAULT_MODELS: Record<string, string> = {
|
|
|
97
97
|
nvidia: "nvidia/nvidia/nemotron-3-super-120b-a12b",
|
|
98
98
|
"z-ai": "glm-5.2",
|
|
99
99
|
minimax: "MiniMax-M3",
|
|
100
|
-
hiveagents: "
|
|
100
|
+
hiveagents: "Qwen3.6-35B-A3B-UD-Q4_K_M.gguf",
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
const PROVIDER_BASE_URLS: Record<string, string> = {
|
|
@@ -208,7 +208,9 @@ const AVAILABLE_MODELS: Record<string, Array<{ value: string; label: string; hin
|
|
|
208
208
|
{ value: "MiniMax-M2.7", label: "MiniMax M2.7", hint: "200K contexto" },
|
|
209
209
|
],
|
|
210
210
|
hiveagents: [
|
|
211
|
-
{ value: "
|
|
211
|
+
{ value: "Qwen3.6-35B-A3B-UD-Q4_K_M.gguf", label: "Qwen3.6 35B MoE (Recomendado)", hint: "MoE 22.7GB — el más rápido: 62.7 t/s, carga en 8s" },
|
|
212
|
+
{ value: "Qwen3.8-27B-UD-Q4_K_XL.gguf", label: "Qwen3.8 27B Dense + MTP", hint: "Denso 17.9GB — 25.3 t/s, carga en 8s" },
|
|
213
|
+
{ value: "DeepSeek-V4-Flash-UD-IQ2_XXS-00001-of-00003.gguf", label: "DeepSeek V4 Flash 90 GB", hint: "MoE 90.9GB, sólo texto — 12.8 t/s y ~91s de carga" },
|
|
212
214
|
],
|
|
213
215
|
};
|
|
214
216
|
|
|
@@ -37,7 +37,7 @@ ${s.workflow.map((step, index) => `${index + 1}. ${step}`).join("\n")}
|
|
|
37
37
|
|
|
38
38
|
# QUÉ NO HACES
|
|
39
39
|
${s.prohibitions.map((rule) => `- ${rule}`).join("\n")}
|
|
40
|
-
- No
|
|
40
|
+
- No hablas con el usuario, no pedís confirmaciones directas y no delegas a otros agentes.
|
|
41
41
|
- No ampliás el alcance ni usás tools fuera del loadout autorizado.
|
|
42
42
|
- No declarás éxito sin evidencia comprobable para cada criterio.
|
|
43
43
|
|
|
@@ -72,10 +72,10 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
|
|
|
72
72
|
role: "Tu dominio es investigación web, contraste de fuentes y síntesis basada en evidencia.",
|
|
73
73
|
receives: "Una pregunta acotada, contexto relevante, restricciones de actualidad y criterios de aceptación.",
|
|
74
74
|
workflow: [
|
|
75
|
-
"Convertí la pregunta en consultas concretas y
|
|
76
|
-
"
|
|
75
|
+
"Convertí la pregunta en consultas concretas y busca fuentes primarias o autorizadas.",
|
|
76
|
+
"Lee las fuentes relevantes y separa hechos, inferencias y datos no confirmados.",
|
|
77
77
|
"Contrastá afirmaciones sensibles o discutidas con más de una fuente.",
|
|
78
|
-
"
|
|
78
|
+
"Entrega una síntesis concisa con referencias y fechas cuando sean relevantes.",
|
|
79
79
|
],
|
|
80
80
|
prohibitions: [...COMMON_PROHIBITIONS, "No automatizás formularios ni realizás acciones en sitios."],
|
|
81
81
|
quality: "Cada afirmación material debe poder rastrearse a una fuente accesible; los desacuerdos se presentan explícitamente.",
|
|
@@ -92,10 +92,10 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
|
|
|
92
92
|
role: "Tu dominio es navegación y automatización web renderizada.",
|
|
93
93
|
receives: "Una acción web autorizada, URL inicial, datos permitidos, estado final esperado y límites de seguridad.",
|
|
94
94
|
workflow: [
|
|
95
|
-
"
|
|
96
|
-
"Inspeccioná el estado antes de interactuar y
|
|
97
|
-
"
|
|
98
|
-
"
|
|
95
|
+
"Abre el sitio y verifica que corresponda al objetivo.",
|
|
96
|
+
"Inspeccioná el estado antes de interactuar y usa selectores estables.",
|
|
97
|
+
"Ejecuta solamente los clicks, escritura y esperas necesarios.",
|
|
98
|
+
"Verifica el estado final mediante extracción y captura de pantalla.",
|
|
99
99
|
],
|
|
100
100
|
prohibitions: [...COMMON_PROHIBITIONS, "No confirmás compras, envíos, borrados o publicaciones si el principal no autorizó explícitamente ese efecto."],
|
|
101
101
|
quality: "La entrega incluye URL final, estado observado y evidencia visual o estructurada posterior a la acción.",
|
|
@@ -112,10 +112,10 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
|
|
|
112
112
|
role: "Tu dominio es operaciones seguras sobre archivos y carpetas del workspace.",
|
|
113
113
|
receives: "Paths relativos o autorizados, contenido solicitado, operación exacta y estado final esperado.",
|
|
114
114
|
workflow: [
|
|
115
|
-
"
|
|
115
|
+
"Resuelve todos los paths contra el workspace y comprueba su estado inicial.",
|
|
116
116
|
"Aplicá la mínima operación necesaria sin tocar paths ajenos.",
|
|
117
117
|
"Volvé a leer o listar el resultado para comprobarlo.",
|
|
118
|
-
"
|
|
118
|
+
"Reporta paths exactos, cambios y evidencia de readback.",
|
|
119
119
|
],
|
|
120
120
|
prohibitions: [...COMMON_PROHIBITIONS, "No ejecutás comandos shell ni modificás repositorios fuera de la operación de archivos pedida."],
|
|
121
121
|
quality: "Todos los paths permanecen dentro del workspace y su contenido o ausencia final se comprueba después de la operación.",
|
|
@@ -134,10 +134,10 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
|
|
|
134
134
|
workflow: [
|
|
135
135
|
"Inspeccioná el repositorio, convenciones y estado antes de editar.",
|
|
136
136
|
"Determiná la causa o el diseño mínimo y modificá solo archivos pertinentes.",
|
|
137
|
-
"
|
|
138
|
-
"
|
|
137
|
+
"Ejecuta checks, tests o builds proporcionales al riesgo.",
|
|
138
|
+
"Entrega archivos cambiados, evidencia de validación y riesgos restantes.",
|
|
139
139
|
],
|
|
140
|
-
prohibitions: [...COMMON_PROHIBITIONS, "No sobrescribís cambios ajenos, no publicás y no
|
|
140
|
+
prohibitions: [...COMMON_PROHIBITIONS, "No sobrescribís cambios ajenos, no publicás y no delegas a subagentes CLI."],
|
|
141
141
|
quality: "El cambio satisface el comportamiento pedido, preserva compatibilidad y pasa las validaciones relevantes.",
|
|
142
142
|
routingExamples: ["implementar una función", "arreglar un bug", "ejecutar tests de un proyecto"],
|
|
143
143
|
tools: ["fs_*", "cli_exec"],
|
|
@@ -153,10 +153,10 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
|
|
|
153
153
|
role: "Tu dominio es lectura y generación de archivos Office estructurados.",
|
|
154
154
|
receives: "Archivo de entrada o especificación del documento, formato final, contenido y path autorizado.",
|
|
155
155
|
workflow: [
|
|
156
|
-
"Inspeccioná entradas y
|
|
156
|
+
"Inspeccioná entradas y confirma el formato solicitado.",
|
|
157
157
|
"Generá o extraé contenido preservando estructura y datos.",
|
|
158
|
-
"
|
|
159
|
-
"
|
|
158
|
+
"Comprueba que el archivo existe, no está vacío y puede reabrirse.",
|
|
159
|
+
"Entrega el path final, resumen de contenido y prueba de reapertura.",
|
|
160
160
|
],
|
|
161
161
|
prohibitions: [...COMMON_PROHIBITIONS, "No editás formatos binarios con tools genéricas de filesystem."],
|
|
162
162
|
quality: "El artefacto debe abrir sin error con la tool lectora correspondiente y contener la estructura solicitada.",
|
|
@@ -174,9 +174,9 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
|
|
|
174
174
|
receives: "Sesión, surfaceId, flujo solicitado, datos, acciones permitidas y criterios visuales.",
|
|
175
175
|
workflow: [
|
|
176
176
|
"Diseñá una jerarquía pequeña con IDs únicos y un root explícito.",
|
|
177
|
-
"
|
|
177
|
+
"Crea la superficie antes de enviar componentes.",
|
|
178
178
|
"Enviá componentes válidos y después el data model enlazado.",
|
|
179
|
-
"
|
|
179
|
+
"Comprueba acknowledgements, IDs y paths; liberá la superficie al cancelar.",
|
|
180
180
|
],
|
|
181
181
|
prohibitions: [...COMMON_PROHIBITIONS, "No interpretás acciones del usuario ni conversás; los eventos vuelven al principal."],
|
|
182
182
|
quality: "La superficie usa el catálogo v0.9, no tiene referencias rotas y sus bindings apuntan a paths válidos.",
|
|
@@ -194,9 +194,9 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
|
|
|
194
194
|
receives: "Una automatización que Hive debe ejecutar después, su horario o recurrencia, timezone, canal y comportamiento esperado.",
|
|
195
195
|
workflow: [
|
|
196
196
|
"Normalizá fecha, recurrencia y timezone sin cambiar la intención.",
|
|
197
|
-
"
|
|
197
|
+
"Crea o modificá únicamente el job solicitado.",
|
|
198
198
|
"Consultá el job persistido y su próxima ejecución.",
|
|
199
|
-
"
|
|
199
|
+
"Entrega ID, estado, timezone y next_run_at.",
|
|
200
200
|
],
|
|
201
201
|
prohibitions: [
|
|
202
202
|
...COMMON_PROHIBITIONS,
|
|
@@ -223,9 +223,9 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
|
|
|
223
223
|
receives: "Endpoint autorizado, método, headers permitidos, payload, status esperado y esquema relevante.",
|
|
224
224
|
workflow: [
|
|
225
225
|
"Validá método, host, payload y alcance antes del request.",
|
|
226
|
-
"
|
|
227
|
-
"
|
|
228
|
-
"
|
|
226
|
+
"Ejecuta una sola operación idempotente o explícitamente autorizada.",
|
|
227
|
+
"Comprueba status, headers y forma de la respuesta.",
|
|
228
|
+
"Entrega evidencia saneada sin secretos.",
|
|
229
229
|
],
|
|
230
230
|
prohibitions: [...COMMON_PROHIBITIONS, "No repetís mutaciones automáticamente ni cambiás método, host o payload para forzar éxito."],
|
|
231
231
|
quality: "El status y contrato observados coinciden con los criterios y la evidencia no contiene credenciales.",
|
|
@@ -596,7 +596,7 @@ export async function compileContext(opts: {
|
|
|
596
596
|
.filter((line): line is string => !!line)
|
|
597
597
|
|
|
598
598
|
if (causalLines.length > 0) {
|
|
599
|
-
systemPrompt += `\n\n# CAUSAL CONTEXT (decisiones y tool calls de este turno, previos a la compactación —
|
|
599
|
+
systemPrompt += `\n\n# CAUSAL CONTEXT (decisiones y tool calls de este turno, previos a la compactación — prioriza la conversación actual; úsalo solo para no repetir algo que ya funcionó o ya falló)\n${causalLines.join("\n")}\n`
|
|
600
600
|
log.info(`[context-compiler] [STEP-9d] ✅ Injected ${causalLines.length} causal context item(s)`)
|
|
601
601
|
}
|
|
602
602
|
} catch (err) {
|
|
@@ -45,13 +45,26 @@ export interface StoredMessage {
|
|
|
45
45
|
// stays clean and the wording can evolve without a migration.
|
|
46
46
|
|
|
47
47
|
export const INTERNAL_SOURCES: ReadonlySet<string> =
|
|
48
|
-
new Set(["task_complete", "delegation_summary", "legacy_internal"])
|
|
48
|
+
new Set(["task_complete", "delegation_summary", "legacy_internal", "realtime_chat"])
|
|
49
49
|
|
|
50
50
|
export function isInternalSource(source: string | null | undefined): boolean {
|
|
51
51
|
return !!source && INTERNAL_SOURCES.has(source)
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
export function formatInternalEvent(source: string, content: string): string {
|
|
55
|
+
// La charla hablada sí salió del usuario, pero la sesión de voz ya la
|
|
56
|
+
// respondió: es contexto, no trabajo por hacer. Sin esta distinción el
|
|
57
|
+
// coordinador leía cada frase suelta de una llamada como un pedido nuevo y
|
|
58
|
+
// delegaba una tarea por cada una.
|
|
59
|
+
if (source === "realtime_chat") {
|
|
60
|
+
return `<hive:voice_context>\n` +
|
|
61
|
+
`Fragmento de una conversación hablada que la voz de Hive YA respondió en el momento. ` +
|
|
62
|
+
`Es contexto de lo que vinieron hablando, NO un pedido pendiente: no ejecutes ni delegues nada por esto. ` +
|
|
63
|
+
`El trabajo real llega siempre como un mensaje aparte y explícito.\n\n` +
|
|
64
|
+
`${content}\n` +
|
|
65
|
+
`</hive:voice_context>`
|
|
66
|
+
}
|
|
67
|
+
|
|
55
68
|
return `<hive:internal_event source="${source}">\n` +
|
|
56
69
|
`Evento interno del sistema — NO es un mensaje del usuario. No lo cites literalmente, no expongas IDs internos (task_id, worker_id) ni JSON crudo. Respondé al usuario de forma natural y breve.\n\n` +
|
|
57
70
|
`${content}\n` +
|
|
@@ -217,16 +217,16 @@ export function describeProviderFailure(
|
|
|
217
217
|
if (status === 404 || status === 410) {
|
|
218
218
|
return `El modelo "${cleanModel}" ya no existe en ${provider} (HTTP ${status}). `
|
|
219
219
|
+ `El proveedor lo retiró de su catálogo; reintentar no sirve. `
|
|
220
|
-
+ `
|
|
220
|
+
+ `Elige otro modelo en Ajustes → Proveedores.`
|
|
221
221
|
}
|
|
222
222
|
if (status === 429) {
|
|
223
223
|
return `${provider} está limitando las peticiones (HTTP 429) y los reintentos tampoco pasaron. `
|
|
224
224
|
+ `Es el límite de uso de tu cuenta, no un problema del modelo: esperá unos minutos, `
|
|
225
|
-
+ `
|
|
225
|
+
+ `revisa tu cuota con el proveedor, o cambiá de modelo en Ajustes → Proveedores.`
|
|
226
226
|
}
|
|
227
227
|
if (status === 401 || status === 403) {
|
|
228
228
|
return `${provider} rechazó la API key (HTTP ${status}). `
|
|
229
|
-
+ `
|
|
229
|
+
+ `Revisa que siga siendo válida y tenga acceso a "${cleanModel}" en Ajustes → Proveedores.`
|
|
230
230
|
}
|
|
231
231
|
return (err as Error).message
|
|
232
232
|
}
|
|
@@ -136,7 +136,7 @@ export async function buildSystemPrompt(opts: BuildSystemPromptOpts): Promise<st
|
|
|
136
136
|
if (Object.keys(userData).length > 0) {
|
|
137
137
|
userSection += formatContext(userData) + "\n\n"
|
|
138
138
|
if (agent.role === "coordinator" && user.email) {
|
|
139
|
-
userSection += `Cuando el usuario diga "envíame", "mándame" o "a mi correo" sin indicar otro destinatario,
|
|
139
|
+
userSection += `Cuando el usuario diga "envíame", "mándame" o "a mi correo" sin indicar otro destinatario, usa CorreoPropio. Para terceras personas, resuelve su dirección por separado.\n\n`
|
|
140
140
|
}
|
|
141
141
|
} else {
|
|
142
142
|
userSection += `Usuario ID: ${userId}\n\n`
|