@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.
- package/README.md +17 -11
- package/dist/hive.js +87295 -101789
- package/dist/tool-worker.js +13241 -17001
- package/dist/ui/assets/A2UIPage-F1sUdZV7.js +8 -0
- package/dist/ui/assets/{AgentCreateForm-Bcp3HN8D.js → AgentCreateForm-CN5Gb9UN.js} +1 -1
- package/dist/ui/assets/AgentDetailPage-CzBnoKtH.js +1 -0
- package/dist/ui/assets/AgentNewPage-AGDjfAVf.js +1 -0
- package/dist/ui/assets/AgentsPage-BgKr7pAZ.js +10 -0
- package/dist/ui/assets/{ApiClientPage-DHfIlSAg.js → ApiClientPage-Dq4nPse4.js} +2 -2
- package/dist/ui/assets/ChannelsPage-BuWItmp-.js +8 -0
- package/dist/ui/assets/DashboardPage-CB1aM87o.js +6 -0
- package/dist/ui/assets/{LoginPage-BaX6cAPa.js → LoginPage-DBvwBCG6.js} +1 -1
- package/dist/ui/assets/LogsPage-Bc-oTBwY.js +1 -0
- package/dist/ui/assets/MeetingPage-C2H5SxaQ.js +1 -0
- package/dist/ui/assets/ModelSelector-D0aJvoD9.js +1 -0
- package/dist/ui/assets/NotFound-PUg3gEO0.js +1 -0
- package/dist/ui/assets/{Office3DPage-C3SIzd2H.css → Office3DPage-31AMJ-LN.css} +1 -1
- package/dist/ui/assets/Office3DPage-D5vwZkJa.js +727 -0
- package/dist/ui/assets/ProvidersPage-BBBt4Hcz.js +1 -0
- package/dist/ui/assets/{RecoverPage-C_Id9WM-.js → RecoverPage-nq901JiE.js} +1 -1
- package/dist/ui/assets/SettingsPage-DQ5KZPAd.js +9 -0
- package/dist/ui/assets/SetupPage-DeIGn-Uf.js +1 -0
- package/dist/ui/assets/{Vignette-Cyi27LQH.js → Vignette-BcPWkNhm.js} +17 -17
- package/dist/ui/assets/VoicePage-DJYsOsaU.js +307 -0
- package/dist/ui/assets/WebChatPage-CRDN4OlP.js +29 -0
- package/dist/ui/assets/agentCapabilities-PfTEVxG1.js +1 -0
- package/dist/ui/assets/alert-CjiX20jI.js +1 -0
- package/dist/ui/assets/badge-B5AKge1b.js +1 -0
- package/dist/ui/assets/card-mTJ4oZbL.js +1 -0
- package/dist/ui/assets/conversationsStore-BIs0iMhp.js +1 -0
- package/dist/ui/assets/dialog-DdbsUCv9.js +1 -0
- package/dist/ui/assets/dist-js-Dh18rcg9.js +1 -0
- package/dist/ui/assets/{dist-js-Bg0g3vPS.js → dist-js-q7C_AB0j.js} +1 -1
- package/dist/ui/assets/index-BD7hBA1d.css +2 -0
- package/dist/ui/assets/index-CpzwBwPg.js +116 -0
- package/dist/ui/assets/label-D_fvqJyD.js +1 -0
- package/dist/ui/assets/lock-3IApZyVy.js +1 -0
- package/dist/ui/assets/pencil-L3Li7_pz.js +1 -0
- package/dist/ui/assets/scroll-area-CbH8FOo8.js +1 -0
- package/dist/ui/assets/select-v_3QBYrD.js +1 -0
- package/dist/ui/assets/slider-DXS4h1LB.js +1 -0
- package/dist/ui/assets/switch-ndx8VCpm.js +1 -0
- package/dist/ui/assets/tabs-epu-3Tl4.js +1 -0
- package/dist/ui/assets/textarea-BgZJFZTX.js +1 -0
- package/dist/ui/assets/useAudioDevices-yU-wu-kt.js +41 -0
- package/dist/ui/assets/{useHiveAgentsModelLoad-CHmtvNp4.js → useHiveAgentsModelLoad-29pOYRd9.js} +1 -1
- package/dist/ui/assets/useOfficeModel-BaDn7U-X.js +1 -0
- package/dist/ui/assets/{useProviders-C7FA6z4M.js → useProviders-CiBi4Dt6.js} +1 -1
- package/dist/ui/assets/vendor-react-kUOwxn0g.js +1 -0
- package/dist/ui/index.html +6 -6
- package/package.json +10 -6
- package/packages/cli/src/adapters/config.ts +11 -3
- package/packages/cli/src/commands/causal.ts +1 -1
- package/packages/cli/src/commands/doctor.ts +2 -2
- package/packages/cli/src/commands/onboard.ts +1 -1
- package/packages/core/src/agent/acceptance-checks.ts +25 -0
- package/packages/core/src/agent/agent-catalog.ts +53 -33
- package/packages/core/src/agent/agent-loop.ts +67 -14
- package/packages/core/src/agent/capability-search.ts +2 -1
- package/packages/core/src/agent/compaction.ts +19 -7
- package/packages/core/src/agent/context-compiler.ts +165 -27
- package/packages/core/src/agent/conversation-store.ts +12 -1
- package/packages/core/src/agent/goal-runner.ts +2 -2
- package/packages/core/src/agent/jev-decisions.ts +242 -0
- package/packages/core/src/agent/jev-planner.ts +293 -0
- package/packages/core/src/agent/llm-client.ts +27 -5
- package/packages/core/src/agent/llm-providers/ollama.ts +17 -4
- package/packages/core/src/agent/llm-providers/openai-compat-base.ts +27 -12
- package/packages/core/src/agent/llm-providers/opencode-go.ts +37 -0
- package/packages/core/src/agent/realtime-providers/gemini-live.ts +5 -2
- package/packages/core/src/agent/skill-selector.ts +4 -2
- package/packages/core/src/agent/thread-id.ts +71 -0
- package/packages/core/src/agent/thread-store.ts +230 -0
- package/packages/core/src/agent/tool-selector.ts +42 -0
- package/packages/core/src/agent/tracer.ts +2 -0
- package/packages/core/src/canvas/canvas-manager.ts +17 -1
- package/packages/core/src/canvas/emitter.ts +24 -0
- package/packages/core/src/channels/telegram.ts +19 -1
- package/packages/core/src/channels/webchat.ts +47 -45
- package/packages/core/src/config/loader.ts +3 -2
- package/packages/core/src/gateway/channel-notify.ts +24 -5
- package/packages/core/src/gateway/delegation-groups.ts +3 -3
- package/packages/core/src/gateway/delegation-notify.ts +34 -5
- package/packages/core/src/gateway/durable-queue.ts +22 -0
- package/packages/core/src/gateway/failure-notify.ts +8 -2
- package/packages/core/src/gateway/job-executors.ts +3 -3
- package/packages/core/src/gateway/realtime/bridge-tools.ts +106 -28
- package/packages/core/src/gateway/realtime/index.ts +63 -7
- package/packages/core/src/gateway/realtime/prompt.ts +45 -0
- package/packages/core/src/gateway/realtime/voice-session.ts +1 -0
- package/packages/core/src/gateway/resolver.ts +31 -4
- package/packages/core/src/gateway/routes/artifacts.ts +13 -0
- package/packages/core/src/gateway/routes/chat.ts +20 -4
- package/packages/core/src/gateway/routes/conversations.ts +121 -0
- package/packages/core/src/gateway/routes/providers.ts +15 -0
- package/packages/core/src/gateway/routes/setup.ts +22 -11
- package/packages/core/src/gateway/routes/system.ts +4 -2
- package/packages/core/src/gateway/routes/tts-local.ts +2 -1
- package/packages/core/src/gateway/server.ts +85 -12
- package/packages/core/src/gateway/slash-commands.ts +46 -10
- package/packages/core/src/gateway/tts/src/server.ts +2 -1
- package/packages/core/src/gateway/webchat-turn.ts +68 -10
- package/packages/core/src/index.ts +2 -0
- package/packages/core/src/scheduler/CronScheduler.ts +20 -8
- package/packages/core/src/scheduler/cron/cron-engine.test.ts +295 -0
- package/packages/core/src/scheduler/cron/expression.ts +165 -0
- package/packages/core/src/scheduler/cron/index.ts +10 -0
- package/packages/core/src/scheduler/cron/job.ts +340 -0
- package/packages/core/src/scheduler/cron/next-run.ts +121 -0
- package/packages/core/src/scheduler/cron/zoned-time.ts +139 -0
- package/packages/core/src/scheduler/integration.ts +16 -5
- package/packages/core/src/scheduler/types.ts +3 -18
- package/packages/core/src/storage/bootstrap.ts +24 -1
- package/packages/core/src/storage/collections.ts +29 -1
- package/packages/core/src/storage/crypto.ts +133 -40
- package/packages/core/src/storage/reconcile.ts +6 -1
- package/packages/core/src/storage/seed.ts +101 -7
- package/packages/core/src/storage/usage.ts +53 -1
- package/packages/core/src/tool-runtime/index.ts +19 -1
- package/packages/core/src/tools/a2ui/index.ts +65 -1
- package/packages/core/src/tools/agents/get-available-models.ts +3 -1
- package/packages/core/src/tools/code-agent/adapters.ts +110 -0
- package/packages/core/src/tools/code-agent/index.ts +193 -0
- package/packages/core/src/tools/core/index.ts +39 -4
- package/packages/core/src/tools/cron/index.ts +4 -4
- package/packages/core/src/tools/index.ts +9 -1
- package/packages/core/src/tools/office/office-escribir-xlsx.ts +2 -1
- package/packages/core/src/tools/office/office-leer-xlsx.ts +2 -1
- package/packages/core/src/tools/office/xlsx-loader.ts +19 -0
- package/packages/core/src/tools/web/browser-backend.ts +22 -2
- package/packages/core/src/tools/web/index.ts +4 -0
- package/packages/core/src/tools/web/obscura.ts +860 -0
- package/packages/core/src/tools/web/webview-backend.ts +168 -26
- package/packages/core/src/utils/port.ts +33 -0
- package/packages/core/src/voice/index.ts +2 -1
- package/packages/mcp/src/config.ts +2 -1
- package/packages/mcp/src/manager.ts +9 -0
- package/packages/mcp/src/transports/index.ts +42 -1
- package/packages/mcp/src/transports/sse.ts +11 -5
- package/packages/skills/src/bundled/a2ui/a2ui_dashboard/SKILL.md +2 -2
- package/packages/skills/src/bundled/a2ui/a2ui_form/SKILL.md +2 -2
- package/packages/skills/src/bundled/a2ui/a2ui_interactive/SKILL.md +4 -4
- package/packages/skills/src/bundled/agents/agent_spawner/SKILL.md +7 -7
- package/packages/skills/src/bundled/agents/memory_manager/SKILL.md +9 -9
- package/packages/skills/src/bundled/agents/research_and_remember/SKILL.md +8 -8
- package/packages/skills/src/bundled/agents/task_orchestrator/SKILL.md +8 -8
- package/packages/skills/src/bundled/artifacts/artifact_reader/SKILL.md +104 -0
- package/packages/skills/src/bundled/cli/cli_pipeline/SKILL.md +6 -6
- package/packages/skills/src/bundled/cli/cli_safe_exec/SKILL.md +5 -5
- package/packages/skills/src/bundled/cli/external_code_agent/SKILL.md +69 -0
- package/packages/skills/src/bundled/cron_manager/SKILL.md +29 -19
- package/packages/skills/src/bundled/cron_reminder/SKILL.md +5 -5
- package/packages/skills/src/bundled/filesystem/file_manager/SKILL.md +4 -4
- package/packages/skills/src/bundled/filesystem/file_read_and_summarize/SKILL.md +7 -7
- package/packages/skills/src/bundled/filesystem/file_writer/SKILL.md +10 -10
- package/packages/skills/src/bundled/search_knowledge/capability_discovery/SKILL.md +8 -8
- package/packages/skills/src/bundled/web/browser_automate/SKILL.md +21 -12
- package/packages/skills/src/bundled/web/browser_scrape/SKILL.md +28 -13
- package/packages/skills/src/bundled/web/obscura_browser/SKILL.md +69 -0
- package/packages/skills/src/bundled/web/web_monitor/SKILL.md +6 -6
- package/packages/skills/src/bundled/web/web_research/SKILL.md +5 -5
- package/packages/skills/src/bundled-data.generated.ts +845 -773
- package/dist/ui/assets/A2UIPage-DTW79pyL.js +0 -8
- package/dist/ui/assets/AgentDetailPage-10XptMde.js +0 -1
- package/dist/ui/assets/AgentNewPage-CUt49rVS.js +0 -1
- package/dist/ui/assets/AgentsPage-1_e1a9xa.js +0 -10
- package/dist/ui/assets/ChannelsPage-BnCQAGZL.js +0 -8
- package/dist/ui/assets/DashboardPage-BsCCKHgg.js +0 -6
- package/dist/ui/assets/LogsPage-DiFBQt7o.js +0 -1
- package/dist/ui/assets/MeetingPage-Bpv5zVXf.js +0 -1
- package/dist/ui/assets/ModelSelector-DfExlPzx.js +0 -1
- package/dist/ui/assets/NotFound-C8HBdF73.js +0 -1
- package/dist/ui/assets/Office3DPage-ChsGMapf.js +0 -319
- package/dist/ui/assets/ProvidersPage-B39pfWHf.js +0 -1
- package/dist/ui/assets/SettingsPage-BgFqasyg.js +0 -9
- package/dist/ui/assets/SetupPage-YeJFfgbt.js +0 -1
- package/dist/ui/assets/VoicePage-Cp63Abj4.js +0 -307
- package/dist/ui/assets/WebChatPage-DxFLWgtM.js +0 -29
- package/dist/ui/assets/agentCapabilities-DOeepCty.js +0 -1
- package/dist/ui/assets/alert-Cj4DpKv6.js +0 -1
- package/dist/ui/assets/badge-DKpeVCpY.js +0 -1
- package/dist/ui/assets/card-Cag15G4h.js +0 -1
- package/dist/ui/assets/dialog-7E3EoEt3.js +0 -1
- package/dist/ui/assets/dist-js-DwLn9F4C.js +0 -1
- package/dist/ui/assets/index-Bi8qEmrK.js +0 -116
- package/dist/ui/assets/index-D2UhaSb0.css +0 -2
- package/dist/ui/assets/label-C6atPuIh.js +0 -1
- package/dist/ui/assets/pencil-CUbpCfeG.js +0 -1
- package/dist/ui/assets/scroll-area-CSoG2z53.js +0 -1
- package/dist/ui/assets/select-DlCT21_r.js +0 -1
- package/dist/ui/assets/slider-Bb_PHFJT.js +0 -1
- package/dist/ui/assets/switch-CUsGuBNi.js +0 -1
- package/dist/ui/assets/tabs-Ckfc7DGG.js +0 -1
- package/dist/ui/assets/textarea-BH6pI9Ax.js +0 -1
- package/dist/ui/assets/useAudioDevices-Dpr_hn6i.js +0 -41
- package/dist/ui/assets/useOfficeModel-Cc5VkReZ.js +0 -1
- package/dist/ui/assets/vendor-react-DYyYpuMy.js +0 -1
- /package/dist/ui/assets/{core-Dz04EE_8.js → core-B_5cyOSV.js} +0 -0
- /package/dist/ui/assets/{download-D0aDV8Y_.js → download-BQXrpH0m.js} +0 -0
- /package/dist/ui/assets/{ellipsis-vertical-BOW_iEOO.js → ellipsis-vertical-D7uFJLGh.js} +0 -0
- /package/dist/ui/assets/{external-link-5cujQzfV.js → external-link-6oTH9pUM.js} +0 -0
- /package/dist/ui/assets/{eye-sRPY5qOa.js → eye-CxvxtQT5.js} +0 -0
- /package/dist/ui/assets/{file-text-DNSyNLUh.js → file-text-D5ZJEx3E.js} +0 -0
- /package/dist/ui/assets/{gateway-url-BzQV75Ig.js → gateway-url-BALS_wVh.js} +0 -0
- /package/dist/ui/assets/{gauge-C__zxC3_.js → gauge-CEu7PhTW.js} +0 -0
- /package/dist/ui/assets/{history-BHQWfE-7.js → history-DLK5rTlP.js} +0 -0
- /package/dist/ui/assets/{info-CG1VohyH.js → info-8ReWzubE.js} +0 -0
- /package/dist/ui/assets/{key-BC28VCjO.js → key-DPkOY-J0.js} +0 -0
- /package/dist/ui/assets/{lock-open-Bhp0UJlL.js → lock-open-v0EphssG.js} +0 -0
- /package/dist/ui/assets/{mail-Biwn8WrV.js → mail-vwCEHyhQ.js} +0 -0
- /package/dist/ui/assets/{mic-Rq4BxU1R.js → mic-CpDU_2as.js} +0 -0
- /package/dist/ui/assets/{pause-C2l5G2Py.js → pause-Cm9LzIZK.js} +0 -0
- /package/dist/ui/assets/{play-CMAscR3a.js → play-zqogwA2l.js} +0 -0
- /package/dist/ui/assets/{plus-DzvRxH4U.js → plus-Bm08ABhc.js} +0 -0
- /package/dist/ui/assets/{radio-DfGzov4y.js → radio-Cii1BjMt.js} +0 -0
- /package/dist/ui/assets/{refresh-cw-DZXu5FrG.js → refresh-cw-DXv3XgEt.js} +0 -0
- /package/dist/ui/assets/{rotate-ccw-Dx92orJM.js → rotate-ccw-LoM1AuqK.js} +0 -0
- /package/dist/ui/assets/{search-DB4w9YHW.js → search-BMwCI-pX.js} +0 -0
- /package/dist/ui/assets/{send-xi8HzUdc.js → send-D6fgWV7m.js} +0 -0
- /package/dist/ui/assets/{settings-pV0cF8Kf.js → settings-qV3kVkeG.js} +0 -0
- /package/dist/ui/assets/{shield-nLNsomh_.js → shield-CIarwBvx.js} +0 -0
- /package/dist/ui/assets/{sparkles-CerRDYxk.js → sparkles-DVvY6jDT.js} +0 -0
- /package/dist/ui/assets/{square-CcWzRWyG.js → square-D5zdNkAY.js} +0 -0
- /package/dist/ui/assets/{terminal-C2SUZUAD.js → terminal-BEcTK780.js} +0 -0
- /package/dist/ui/assets/{trash-2-BZsMCfso.js → trash-2-D6oziYAK.js} +0 -0
- /package/dist/ui/assets/{utils-lc8H6VGT.js → utils-DEmd_M8c.js} +0 -0
- /package/dist/ui/assets/{vendor-router-DCsSv_I7.js → vendor-router-DP84b3LQ.js} +0 -0
- /package/dist/ui/assets/{volume-2-CBMYsuF3.js → volume-2-EaA0JRvD.js} +0 -0
- /package/dist/ui/assets/{volume-x-vNFf2e4-.js → volume-x-CROXNMGT.js} +0 -0
- /package/dist/ui/assets/{wifi-DNv53AfN.js → wifi-BUJuOcgP.js} +0 -0
- /package/dist/ui/assets/{zap-Yed86Sh8.js → zap-DSoX9NDk.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{L as n}from"./vendor-radix-DUug7irY.js";import{t as r}from"./vendor-react-kUOwxn0g.js";import{o as i}from"./vendor-query-Dj8xYhQD.js";import{t as a}from"./dist-CD_qfA30.js";import{t as o}from"./utils-DEmd_M8c.js";var s=r(),c=e(t(),1),l=i(),u=a(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),d=c.forwardRef((e,t)=>{let r=(0,s.c)(9),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let c;r[3]===i?c=r[4]:(c=o(u(),i),r[3]=i,r[4]=c);let d;return r[5]!==a||r[6]!==t||r[7]!==c?(d=(0,l.jsx)(n,{ref:t,className:c,...a}),r[5]=a,r[6]=t,r[7]=c,r[8]=d):d=r[8],d});d.displayName=n.displayName;export{d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-BRaPSYgN.js";var t=e(`Lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-BRaPSYgN.js";var t=e(`Pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{J as n,K as r,X as i,Y as a,q as o}from"./vendor-radix-DUug7irY.js";import{t as s}from"./vendor-react-kUOwxn0g.js";import{o as c}from"./vendor-query-Dj8xYhQD.js";import{t as l}from"./utils-DEmd_M8c.js";var u=s(),d=e(t(),1),f=c(),p=d.forwardRef((e,t)=>{let n=(0,u.c)(15),a,s,c;n[0]===e?(a=n[1],s=n[2],c=n[3]):({className:s,children:a,...c}=e,n[0]=e,n[1]=a,n[2]=s,n[3]=c);let d;n[4]===s?d=n[5]:(d=l(`relative overflow-hidden`,s),n[4]=s,n[5]=d);let p;n[6]===a?p=n[7]:(p=(0,f.jsx)(i,{className:`h-full w-full rounded-[inherit]`,children:a}),n[6]=a,n[7]=p);let h,g;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,f.jsx)(m,{}),g=(0,f.jsx)(r,{}),n[8]=h,n[9]=g):(h=n[8],g=n[9]);let _;return n[10]!==c||n[11]!==t||n[12]!==d||n[13]!==p?(_=(0,f.jsxs)(o,{ref:t,className:d,...c,children:[p,h,g]}),n[10]=c,n[11]=t,n[12]=d,n[13]=p,n[14]=_):_=n[14],_});p.displayName=o.displayName;var m=d.forwardRef((e,t)=>{let r=(0,u.c)(14),i,o,s;r[0]===e?(i=r[1],o=r[2],s=r[3]):({className:i,orientation:s,...o}=e,r[0]=e,r[1]=i,r[2]=o,r[3]=s);let c=s===void 0?`vertical`:s,d=c===`vertical`&&`h-full w-2.5 border-l border-l-transparent p-[1px]`,p=c===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent p-[1px]`,m;r[4]!==i||r[5]!==d||r[6]!==p?(m=l(`flex touch-none select-none transition-colors`,d,p,i),r[4]=i,r[5]=d,r[6]=p,r[7]=m):m=r[7];let h;r[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,f.jsx)(a,{className:`relative flex-1 rounded-full bg-border`}),r[8]=h):h=r[8];let g;return r[9]!==c||r[10]!==o||r[11]!==t||r[12]!==m?(g=(0,f.jsx)(n,{ref:t,orientation:c,className:m,...o,children:h}),r[9]=c,r[10]=o,r[11]=t,r[12]=m,r[13]=g):g=r[13],g});m.displayName=n.displayName;export{p as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{A as n,C as r,D as i,E as a,F as o,I as s,M as c,N as l,O as u,P as d,S as f,T as p,j as m,k as h,w as g}from"./vendor-radix-DUug7irY.js";import{t as _}from"./vendor-react-kUOwxn0g.js";import{o as v}from"./vendor-query-Dj8xYhQD.js";import{t as y}from"./check-C8pw-7Fx.js";import{t as b}from"./chevron-down-8GjmTjLR.js";import{t as x}from"./chevron-up-DZrzJIW8.js";import{t as S}from"./utils-DEmd_M8c.js";var C=_(),w=e(t(),1),T=v(),E=n,D=r,O=o,k=w.forwardRef((e,t)=>{let n=(0,C.c)(12),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=S(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 cursor-pointer`,i),n[4]=i,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,T.jsx)(g,{asChild:!0,children:(0,T.jsx)(b,{className:`h-4 w-4 opacity-50`})}),n[6]=s):s=n[6];let c;return n[7]!==r||n[8]!==a||n[9]!==t||n[10]!==o?(c=(0,T.jsxs)(d,{ref:t,className:o,...a,children:[r,s]}),n[7]=r,n[8]=a,n[9]=t,n[10]=o,n[11]=c):c=n[11],c});k.displayName=d.displayName;var A=w.forwardRef((e,t)=>{let n=(0,C.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=S(`flex cursor-default items-center justify-center py-1`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,T.jsx)(x,{className:`h-4 w-4`}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,T.jsx)(c,{ref:t,className:a,...i,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});A.displayName=c.displayName;var j=w.forwardRef((e,t)=>{let n=(0,C.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=S(`flex cursor-default items-center justify-center py-1`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,T.jsx)(b,{className:`h-4 w-4`}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,T.jsx)(m,{ref:t,className:a,...i,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});j.displayName=m.displayName;var M=w.forwardRef((e,t)=>{let n=(0,C.c)(23),r,i,a,o,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],c=n[5]):({className:i,children:r,position:o,align:c,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=c);let l=o===void 0?`popper`:o,u=c===void 0?`center`:c,d=l===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,p;n[6]!==i||n[7]!==d?(p=S(`relative z-[10001] max-h-[--radix-select-content-available-height] min-w-[8rem] origin-[--radix-select-content-transform-origin] overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,d,i),n[6]=i,n[7]=d,n[8]=p):p=n[8];let m;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,T.jsx)(A,{}),n[9]=m):m=n[9];let g=l===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`,_;n[10]===g?_=n[11]:(_=S(`p-1`,g),n[10]=g,n[11]=_);let v;n[12]!==r||n[13]!==_?(v=(0,T.jsx)(s,{className:_,children:r}),n[12]=r,n[13]=_,n[14]=v):v=n[14];let y;n[15]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,T.jsx)(j,{}),n[15]=y):y=n[15];let b;return n[16]!==u||n[17]!==l||n[18]!==a||n[19]!==t||n[20]!==p||n[21]!==v?(b=(0,T.jsx)(h,{children:(0,T.jsxs)(f,{ref:t,className:p,position:l,align:u,...a,children:[m,v,y]})}),n[16]=u,n[17]=l,n[18]=a,n[19]=t,n[20]=p,n[21]=v,n[22]=b):b=n[22],b});M.displayName=f.displayName;var N=w.forwardRef((e,t)=>{let n=(0,C.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=S(`py-1.5 pl-8 pr-2 text-sm font-semibold`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,T.jsx)(u,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});N.displayName=u.displayName;var P=w.forwardRef((e,t)=>{let n=(0,C.c)(14),r,o,s;n[0]===e?(r=n[1],o=n[2],s=n[3]):({className:o,children:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s);let c;n[4]===o?c=n[5]:(c=S(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground`,o),n[4]=o,n[5]=c);let l;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,T.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,T.jsx)(a,{children:(0,T.jsx)(y,{className:`h-4 w-4`})})}),n[6]=l):l=n[6];let u;n[7]===r?u=n[8]:(u=(0,T.jsx)(i,{children:r}),n[7]=r,n[8]=u);let d;return n[9]!==s||n[10]!==t||n[11]!==c||n[12]!==u?(d=(0,T.jsxs)(p,{ref:t,className:c,...s,children:[l,u]}),n[9]=s,n[10]=t,n[11]=c,n[12]=u,n[13]=d):d=n[13],d});P.displayName=p.displayName;var F=w.forwardRef((e,t)=>{let n=(0,C.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=S(`-mx-1 my-1 h-px bg-muted`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,T.jsx)(l,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});F.displayName=l.displayName;export{N as a,P as i,M as n,k as o,D as r,O as s,E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{G as n,H as r,U as i,W as a}from"./vendor-radix-DUug7irY.js";import{t as o}from"./vendor-react-kUOwxn0g.js";import{o as s}from"./vendor-query-Dj8xYhQD.js";import{t as c}from"./createLucideIcon-BRaPSYgN.js";import{t as l}from"./utils-DEmd_M8c.js";var u=c(`Ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),d=o(),f=e(t(),1),p=s(),m=f.forwardRef((e,t)=>{let o=(0,d.c)(11),s,c;o[0]===e?(s=o[1],c=o[2]):({className:s,...c}=e,o[0]=e,o[1]=s,o[2]=c);let u;o[3]===s?u=o[4]:(u=l(`relative flex w-full touch-none select-none items-center`,s),o[3]=s,o[4]=u);let f,m;o[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,p.jsx)(n,{className:`relative h-2 w-full grow overflow-hidden rounded-full bg-secondary`,children:(0,p.jsx)(r,{className:`absolute h-full bg-primary`})}),m=(0,p.jsx)(a,{className:`block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`}),o[5]=f,o[6]=m):(f=o[5],m=o[6]);let h;return o[7]!==c||o[8]!==t||o[9]!==u?(h=(0,p.jsxs)(i,{ref:t,className:u,...c,children:[f,m]}),o[7]=c,o[8]=t,o[9]=u,o[10]=h):h=o[10],h});m.displayName=i.displayName;export{u as n,m as t};
|
|
@@ -0,0 +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{t as i}from"./vendor-react-kUOwxn0g.js";import{o as a}from"./vendor-query-Dj8xYhQD.js";import{t as o}from"./utils-DEmd_M8c.js";var s=i(),c=e(t(),1),l=a(),u=c.forwardRef((e,t)=>{let i=(0,s.c)(10),a,c;i[0]===e?(a=i[1],c=i[2]):({className:a,...c}=e,i[0]=e,i[1]=a,i[2]=c);let u;i[3]===a?u=i[4]:(u=o(`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`,a),i[3]=a,i[4]=u);let d;i[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,l.jsx)(r,{className:o(`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`)}),i[5]=d):d=i[5];let f;return i[6]!==c||i[7]!==t||i[8]!==u?(f=(0,l.jsx)(n,{className:u,...c,ref:t,children:d}),i[6]=c,i[7]=t,i[8]=u,i[9]=f):f=i[9],f});u.displayName=n.displayName;export{u as t};
|
|
@@ -0,0 +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{t as o}from"./vendor-react-kUOwxn0g.js";import{o as s}from"./vendor-query-Dj8xYhQD.js";import{t as c}from"./utils-DEmd_M8c.js";var l=o(),u=e(t(),1),d=s(),f=n,p=u.forwardRef((e,t)=>{let n=(0,l.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let o;n[3]===r?o=n[4]:(o=c(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,r),n[3]=r,n[4]=o);let s;return n[5]!==i||n[6]!==t||n[7]!==o?(s=(0,d.jsx)(a,{ref:t,className:o,...i}),n[5]=i,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});p.displayName=a.displayName;var m=u.forwardRef((e,t)=>{let n=(0,l.c)(9),r,a;n[0]===e?(r=n[1],a=n[2]):({className:r,...a}=e,n[0]=e,n[1]=r,n[2]=a);let o;n[3]===r?o=n[4]:(o=c(`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`,r),n[3]=r,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,d.jsx)(i,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});m.displayName=i.displayName;var h=u.forwardRef((e,t)=>{let n=(0,l.c)(9),i,a;n[0]===e?(i=n[1],a=n[2]):({className:i,...a}=e,n[0]=e,n[1]=i,n[2]=a);let o;n[3]===i?o=n[4]:(o=c(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,i),n[3]=i,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,d.jsx)(r,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});h.displayName=r.displayName;export{m as i,h as n,p as r,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
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"./vendor-react-kUOwxn0g.js";import{o as r}from"./vendor-query-Dj8xYhQD.js";import{t as i}from"./utils-DEmd_M8c.js";var a=n(),o=e(t(),1),s=r(),c=o.forwardRef((e,t)=>{let n=(0,a.c)(9),r,o;n[0]===e?(r=n[1],o=n[2]):({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o);let c;n[3]===r?c=n[4]:(c=i(`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`,r),n[3]=r,n[4]=c);let l;return n[5]!==o||n[6]!==t||n[7]!==c?(l=(0,s.jsx)(`textarea`,{className:c,ref:t,...o}),n[5]=o,n[6]=t,n[7]=c,n[8]=l):l=n[8],l});c.displayName=`Textarea`;export{c 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"./vendor-react-kUOwxn0g.js";import{t as r}from"./createLucideIcon-BRaPSYgN.js";import{u as i}from"./vendor-router-DP84b3LQ.js";import{n as a,r as o}from"./gateway-url-BALS_wVh.js";import{o as s}from"./index-CpzwBwPg.js";import{t as c}from"./conversationsStore-BIs0iMhp.js";var l=r(`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`}]]),u=e(t(),1),d=n();function f(){return typeof AudioContext<`u`&&`setSinkId`in AudioContext.prototype}async function p(){return h(`audioinput`)}async function m(){if(f()){let e=await h(`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(!s())return{lista:[],motivo:`Este navegador no deja elegir la salida: se usa la del sistema.`};try{let{invoke:e}=await i(async()=>{let{invoke:e}=await import(`./core-B_5cyOSV.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 h(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 g(e,t){if(f()){let n=t;return n?.setSinkId?(await n.setSinkId(e),!0):!1}if(!s())return!1;let{invoke:n}=await i(async()=>{let{invoke:e}=await import(`./core-B_5cyOSV.js`);return{invoke:e}},[]);return await n(`set_audio_output`,{id:e})>0}function _(e){let t=e.split(`|`)[1]??``;return/headphone|headset|hf-output/.test(t)?!1:/hdmi|speaker|spdif|tv|line-out/.test(t)}var v=16e3,y=24e3,b=640,x=`
|
|
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
|
+
`,S=700,C=4e3,w=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}},T=class{onFrame;deviceId;context=null;stream=null;node=null;source=null;spectrum=new w;constructor(e,t=null){this.onFrame=e,this.deviceId=t}async start(){this.stream=await D(this.deviceId),this.context=new AudioContext({sampleRate:v});let e=new Blob([x],{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:v,frameSamples:b}}),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}},E=class{context=null;nextStartAt=0;playing=new Set;bus=null;spectrum=new w;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 g(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,y),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(C,Math.max(0,(this.nextStartAt-a)*1e3));this.hablaHasta=Math.max(this.hablaHasta,Date.now()+s+S),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 D(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 O(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 k=1,A=640,ee=.6,te=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/k)}capture(){let e=this.video,t=this.canvas;if(!e||!t||!e.videoWidth)return;let n=Math.min(1,A/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`,ee),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 ne(e){switch(e?.name){case`NotAllowedError`:case`SecurityError`:return`Permiso de cámara denegado. Habilítalo para este sitio y vuelve 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 re=1,ie=1280,ae=.72,oe=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/re)}capture(){let e=this.video,t=this.canvas;if(!e||!t||!e.videoWidth)return;let n=Math.min(1,ie/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`,ae),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 se(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 ce(){return I?.element??null}function j(){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 le(){if(typeof localStorage>`u`)return`modelo`;let e=localStorage.getItem(V);return e===`foto`||e===`modelo`?e:`modelo`}function ue(e){typeof localStorage<`u`&&localStorage.setItem(V,e)}function de(e,t,n,r,i){let o=new URL(`${a()}/realtime`);o.searchParams.set(`session`,e);let s=typeof localStorage<`u`?localStorage.getItem(`hive-auth-token`):null;return s&&o.searchParams.set(`token`,s),t&&o.searchParams.set(`voice`,t),n&&o.searchParams.set(`lang`,n),r&&o.searchParams.set(`altavoz`,`1`),i&&o.searchParams.set(`conv`,i),o.toString()}var X={inputTokens:0,outputTokens:0,totalTokens:0},Z=0,fe=o((e,t)=>({status:`idle`,error:null,model:null,voice:null,startedAt:null,transcripts:[],milestones:[],lastTool:null,working:!1,usage:X,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 te((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:ne(t)})}},toggleScreen:async()=>{if(L){L.stop(),L=null,e({screenOn:!1,screenError:null});return}try{let t=new oe((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:se(t)})}},prepararAudio:()=>{F||(F=new E,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(_(e)),await F?.usarSalida(e||null)},usarEntrada:async n=>{if(J({input:n}),!P)return;P.stop();let r=new T(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:O(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:X,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 T(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:O(n)});return}N=new WebSocket(de(n,r??a.voice,i??a.language,t().modoAltavoz,c.getState().activeId)),N.binaryType=`arraybuffer`,N.onmessage=n=>{if(n.data instanceof ArrayBuffer){if(F?.enqueue(n.data),t().status===`listening`){let t=Z?Date.now()-Z:null;Z=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`&&(Z=Date.now()),e(e=>({transcripts:pe(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,Z=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 pe(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 Q=`hive-audio-devices`;function me(){window.dispatchEvent(new Event(Q))}function he(){let e=(0,d.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,u.useState)(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=[],e[1]=i):i=e[1];let[a,o]=(0,u.useState)(i),[s,c]=(0,u.useState)(null),l,f;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=!0,t=()=>{p().then(t=>{e&&r(t)}),m().then(t=>{e&&(o(t.lista),c(t.motivo))})};return t(),navigator.mediaDevices?.addEventListener?.(`devicechange`,t),window.addEventListener(Q,t),()=>{e=!1,navigator.mediaDevices?.removeEventListener?.(`devicechange`,t),window.removeEventListener(Q,t)}},f=[],e[2]=l,e[3]=f):(l=e[2],f=e[3]),(0,u.useEffect)(l,f);let h;return e[4]!==n||e[5]!==s||e[6]!==a?(h={entradas:n,salidas:a,motivoSalidas:s},e[4]=n,e[5]=s,e[6]=a,e[7]=h):h=e[7],h}function ge(e,t,n){let r=(0,d.c)(5),[i,a]=(0,u.useState)(0),o=(0,u.useRef)(0),s,c;return r[0]!==t||r[1]!==e||r[2]!==n?(s=()=>{if(!t){a(0);return}let r=!0,i=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)}o.current=e>o.current?o.current+(e-o.current)*.5:o.current+(e-o.current)*.12,a(o.current),i=requestAnimationFrame(d)};if(n)i=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(ve);return}s=e,me(),c=new AudioContext,l=c.createAnalyser(),l.fftSize=512,l.smoothingTimeConstant=.7,c.createMediaStreamSource(e).connect(l),u=new Uint8Array(new ArrayBuffer(l.frequencyBinCount)),i=requestAnimationFrame(d)}).catch(_e)}return()=>{r=!1,cancelAnimationFrame(i),s?.getTracks().forEach($),c?.close(),o.current=0}},c=[e,t,n],r[0]=t,r[1]=e,r[2]=n,r[3]=s,r[4]=c):(s=r[3],c=r[4]),(0,u.useEffect)(s,c),i}function $(e){return e.stop()}function _e(){}function ve(e){return e.stop()}export{R as a,M as c,ue as d,J as f,z as i,le as l,l as m,ge as n,ce as o,fe as p,B as r,j as s,he as t,q as u};
|
package/dist/ui/assets/{useHiveAgentsModelLoad-CHmtvNp4.js → useHiveAgentsModelLoad-29pOYRd9.js}
RENAMED
|
@@ -1 +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-
|
|
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-CpzwBwPg.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./vendor-react-kUOwxn0g.js";import{t}from"./createLucideIcon-BRaPSYgN.js";var n=t(`Diamond`,[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]),r=e();function i(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return t%360}function a(e){return`hsl(${i(e)}, 68%, 58%)`}function o(e){let t=e%5,n=Math.floor(e/5);return{x:12+t*19,y:48+n*34}}function s(e){let t=[];for(let n of e)n.edgeType!==`delegates`&&n.edgeType!==`reviews`||t.push({id:n.id,kind:n.edgeType,sourceId:n.source,targetId:n.target,taskId:n.data?.taskId??null,taskName:n.data?.taskName??null});return t}function c(e){return e.filter(e=>e.role===`worker`)}var l={tool_call:3,thinking:2,stuck:2,idle:1};function u(e){return e===`archived`?`archived`:e===`tool_call`||e===`thinking`||e===`stuck`?e:e===`error`||e===`failed`?`stuck`:`idle`}function d(e,t,n){let i=(0,r.c)(23),l;i[0]===n?l=i[1]:(l=n===void 0?[]:n,i[0]=n,i[1]=l);let d=l,m;i[2]===e?m=i[3]:(m=e.find(p),i[2]=e,i[3]=m);let h=m,g;if(i[4]!==h?.id||i[5]!==t){let e;i[7]===h?.id?e=i[8]:(e=e=>e.type===`agent`&&(e.id===h?.id||e.data?.role===`coordinator`),i[7]=h?.id,i[8]=e),g=t.find(e),i[4]=h?.id,i[5]=t,i[6]=g}else g=i[6];let _=g,v;i[9]!==h||i[10]!==_?(v=h?{id:h.id,name:h.name,description:h.description,type:`agent`,status:_?.status??h.status,data:{..._?.data??{},role:`coordinator`}}:_,i[9]=h,i[10]=_,i[11]=v):v=i[11];let y=v,b;if(i[12]!==e||i[13]!==t){let n=c(e),r;i[15]===t?r=i[16]:(r=(e,n)=>{let r=t.filter(t=>t.type===`agent`&&t.id===e.id),i=o(n),s=a(e.id);if(e.status===`archived`)return{agent:e,state:`archived`,currentTool:null,currentTask:null,taskId:null,delegatedBy:null,workerCount:0,position:i,color:s};if(!e.enabled)return{agent:e,state:`disabled`,currentTool:null,currentTask:null,taskId:null,delegatedBy:null,workerCount:0,position:i,color:s};let c=r.slice().sort(f)[0];return{agent:e,state:c?u(c.status):`idle`,currentTool:c?.data?.currentTool??null,currentTask:c?.data?.currentTask??null,taskId:c?.data?.taskId??null,delegatedBy:c?.data?.delegatedBy??null,workerCount:r.length,position:i,color:s}},i[15]=t,i[16]=r),b=n.map(r),i[12]=e,i[13]=t,i[14]=b}else b=i[14];let x=b,S;i[17]===d?S=i[18]:(S=s(d),i[17]=d,i[18]=S);let C=S,w;return i[19]!==y||i[20]!==x||i[21]!==C?(w={coordinator:y,desks:x,interactions:C},i[19]=y,i[20]=x,i[21]=C,i[22]=w):w=i[22],w}function f(e,t){return(l[t.status]??0)-(l[e.status]??0)}function p(e){return e.role===`coordinator`}export{n,d 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-CpzwBwPg.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"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{At as n}from"./vendor-radix-DUug7irY.js";var r=e((e=>{var t=n();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),i=e(((e,n)=>{var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of o(t))!c.call(e,s)&&s!==n&&i(e,s,{get:()=>t[s],enumerable:!(r=a(t,s))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)),f=e=>u(i({},`__esModule`,{value:!0}),e),p={};l(p,{$dispatcherGuard:()=>T,$makeReadOnly:()=>D,$reset:()=>E,$structuralCheck:()=>P,c:()=>b,clearRenderCounterRegistry:()=>k,renderCounterRegistry:()=>O,useRenderCounter:()=>M}),n.exports=f(p);var m=d(t()),{useRef:h,useEffect:g,isValidElement:_}=m,v=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE??m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,y=Symbol.for(`react.memo_cache_sentinel`),b=typeof m.__COMPILER_RUNTIME?.c==`function`?m.__COMPILER_RUNTIME.c:function(e){return m.useMemo(()=>{let t=Array(e);for(let n=0;n<e;n++)t[n]=y;return t[y]=!0,t},[])},x={};[`readContext`,`useCallback`,`useContext`,`useEffect`,`useImperativeHandle`,`useInsertionEffect`,`useLayoutEffect`,`useMemo`,`useReducer`,`useRef`,`useState`,`useDebugValue`,`useDeferredValue`,`useTransition`,`useMutableSource`,`useSyncExternalStore`,`useId`,`unstable_isNewReconciler`,`getCacheSignal`,`getCacheForType`,`useCacheRefresh`].forEach(e=>{x[e]=()=>{throw Error(`[React] Unexpected React hook call (${e}) from a React compiled function. Check that all hooks are called directly and named according to convention ('use[A-Z]') `)}});var S=null;x.useMemoCache=e=>{if(S==null)throw Error(`React Compiler internal invariant violation: unexpected null dispatcher`);return S.useMemoCache(e)};function C(e){return v.ReactCurrentDispatcher.current=e,v.ReactCurrentDispatcher.current}var w=[];function T(e){let t=v.ReactCurrentDispatcher.current;if(e===0){if(w.push(t),w.length===1&&(S=t),t===x)throw Error(`[React] Unexpected call to custom hook or component from a React compiled function. Check that (1) all hooks are called directly and named according to convention ('use[A-Z]') and (2) components are returned as JSX instead of being directly invoked.`);C(x)}else if(e===1){let e=w.pop();if(e==null)throw Error(`React Compiler internal error: unexpected null in guard stack`);w.length===0&&(S=null),C(e)}else if(e===2)w.push(t),C(S);else if(e===3){let e=w.pop();if(e==null)throw Error(`React Compiler internal error: unexpected null in guard stack`);C(e)}else throw Error(`React Compiler internal error: unreachable block`+e)}function E(e){for(let t=0;t<e.length;t++)e[t]=y}function D(){throw Error(`TODO: implement $makeReadOnly in react-compiler-runtime`)}var O=new Map;function k(){for(let e of O.values())e.forEach(e=>{e.count=0})}function A(e,t){let n=O.get(e);n??(n=new Set,O.set(e,n)),n.add(t)}function j(e,t){O.get(e)?.delete(t)}function M(e){let t=h(null);t.current!=null&&(t.current.count+=1),g(()=>{if(t.current==null){let n={count:0};A(e,n),t.current=n}return()=>{t.current!==null&&j(e,t.current)}})}var N=new Set;function P(e,t,n,r,i,a){function o(e,t,o,s){let c=`${r}:${a} [${i}] ${n}${o} changed from ${e} to ${t} at depth ${s}`;N.has(c)||(N.add(c),console.error(c))}function s(e,t,n,r){if(!(r>2)&&e!==t)if(typeof e!=typeof t)o(`type ${typeof e}`,`type ${typeof t}`,n,r);else if(typeof e==`object`){let i=Array.isArray(e),a=Array.isArray(t);if(e===null&&t!==null)o(`null`,`type ${typeof t}`,n,r);else if(t===null)o(`type ${typeof e}`,`null`,n,r);else if(e instanceof Map)if(!(t instanceof Map))o(`Map instance`,`other value`,n,r);else if(e.size!==t.size)o(`Map instance with size ${e.size}`,`Map instance with size ${t.size}`,n,r);else for(let[i,a]of e)t.has(i)?s(a,t.get(i),`${n}.get(${i})`,r+1):o(`Map instance with key ${i}`,`Map instance without key ${i}`,n,r);else if(t instanceof Map)o(`other value`,`Map instance`,n,r);else if(e instanceof Set)if(!(t instanceof Set))o(`Set instance`,`other value`,n,r);else if(e.size!==t.size)o(`Set instance with size ${e.size}`,`Set instance with size ${t.size}`,n,r);else for(let i of t)e.has(i)||o(`Set instance without element ${i}`,`Set instance with element ${i}`,n,r);else if(t instanceof Set)o(`other value`,`Set instance`,n,r);else if(i||a)if(i!==a)o(`type ${i?`array`:`object`}`,`type ${a?`array`:`object`}`,n,r);else if(e.length!==t.length)o(`array with length ${e.length}`,`array with length ${t.length}`,n,r);else for(let i=0;i<e.length;i++)s(e[i],t[i],`${n}[${i}]`,r+1);else if(_(e)||_(t))_(e)===_(t)?e.type===t.type?s(e.props,t.props,`[props of ${n}]`,r+1):o(`React element of type ${e.type}`,`React element of type ${t.type}`,n,r):o(`type ${_(e)?`React element`:`object`}`,`type ${_(t)?`React element`:`object`}`,n,r);else{for(let i in t)i in e||o(`object without key ${i}`,`object with key ${i}`,n,r);for(let i in e)i in t?s(e[i],t[i],`${n}.${i}`,r+1):o(`object with key ${i}`,`object without key ${i}`,n,r)}}else if(typeof e==`function`)return;else isNaN(e)||isNaN(t)?isNaN(e)!==isNaN(t)&&o(`${isNaN(e)?`NaN`:`non-NaN value`}`,`${isNaN(t)?`NaN`:`non-NaN value`}`,n,r):e!==t&&o(e,t,n,r)}s(e,t,``,0)}}));export{r as n,i as 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-CpzwBwPg.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-DP84b3LQ.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
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-react-
|
|
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-
|
|
34
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-react-kUOwxn0g.js">
|
|
35
|
+
<link rel="modulepreload" crossorigin href="/assets/utils-DEmd_M8c.js">
|
|
36
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-url-BALS_wVh.js">
|
|
37
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BD7hBA1d.css">
|
|
38
38
|
</head>
|
|
39
39
|
|
|
40
40
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johpaz/hive-agents",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Tu colmena de agentes IA. Local-first. Multi-canal. Open source. Construido desde Colombia para el mundo.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"bin": {
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
},
|
|
9
9
|
"main": "packages/core/src/index.ts",
|
|
10
10
|
"types": "packages/core/src/index.ts",
|
|
11
|
+
"engines": {
|
|
12
|
+
"bun": ">=1.4.2"
|
|
13
|
+
},
|
|
11
14
|
"workspaces": [
|
|
12
15
|
"packages/*"
|
|
13
16
|
],
|
|
@@ -19,6 +22,8 @@
|
|
|
19
22
|
"./agent/context-compiler": "./packages/core/src/agent/context-compiler.ts",
|
|
20
23
|
"./agent/prompt-builder": "./packages/core/src/agent/prompt-builder.ts",
|
|
21
24
|
"./agent/conversation-store": "./packages/core/src/agent/conversation-store.ts",
|
|
25
|
+
"./agent/thread-id": "./packages/core/src/agent/thread-id.ts",
|
|
26
|
+
"./agent/thread-store": "./packages/core/src/agent/thread-store.ts",
|
|
22
27
|
"./agent/tool-selector": "./packages/core/src/agent/tool-selector.ts",
|
|
23
28
|
"./agent/skill-selector": "./packages/core/src/agent/skill-selector.ts",
|
|
24
29
|
"./agent/playbook-selector": "./packages/core/src/agent/playbook-selector.ts",
|
|
@@ -108,7 +113,7 @@
|
|
|
108
113
|
"build": "bun scripts/build-npm-package.ts",
|
|
109
114
|
"build:binary": "bun --cwd=packages/hive-ui run build && bun packages/cli/scripts/generate-ui-bundle.ts && bun scripts/build-gateway.ts --target bun-linux-x64 --outfile dist/hive-binary",
|
|
110
115
|
"prepublishOnly": "bun scripts/verify-package.ts",
|
|
111
|
-
"test": "bun test tests --timeout 15000",
|
|
116
|
+
"test": "bun test --parallel tests --timeout 15000",
|
|
112
117
|
"test:ci": "bun test tests --coverage",
|
|
113
118
|
"test:ui": "bun --cwd=packages/hive-ui run test",
|
|
114
119
|
"docs:generate": "bun scripts/generate-docs.ts",
|
|
@@ -127,13 +132,12 @@
|
|
|
127
132
|
"@anthropic-ai/sdk": "^0.74.0",
|
|
128
133
|
"@clack/prompts": "^0.5.0",
|
|
129
134
|
"@google/genai": "^1.43.0",
|
|
130
|
-
"@johpaz/hive-db": "0.
|
|
135
|
+
"@johpaz/hive-db": "0.6.1",
|
|
131
136
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
132
137
|
"@slack/bolt": "^4.7.2",
|
|
133
|
-
"@vitejs/plugin-react": "^
|
|
138
|
+
"@vitejs/plugin-react": "^6.1.1",
|
|
134
139
|
"@whiskeysockets/baileys": "7.0.0-rc11",
|
|
135
140
|
"async-mutex": "^0.5.0",
|
|
136
|
-
"croner": "^10.0.1",
|
|
137
141
|
"discord.js": "^14.26.4",
|
|
138
142
|
"grammy": "^1.42.0",
|
|
139
143
|
"groq-sdk": "^0.37.0",
|
|
@@ -146,7 +150,7 @@
|
|
|
146
150
|
"zod": "^4.4.3"
|
|
147
151
|
},
|
|
148
152
|
"devDependencies": {
|
|
149
|
-
"@types/bun": "^1.
|
|
153
|
+
"@types/bun": "^1.4.1",
|
|
150
154
|
"@types/jsonwebtoken": "^9.0.10",
|
|
151
155
|
"@types/react": "^18.3.23",
|
|
152
156
|
"typescript": "7.0.2"
|
|
@@ -103,14 +103,22 @@ export function mergeEnv(...envs: Array<Record<string, string>>): Record<string,
|
|
|
103
103
|
* Find a free port starting from the given port
|
|
104
104
|
*/
|
|
105
105
|
export async function findFreePort(startPort: number, maxAttempts: number = 100): Promise<number> {
|
|
106
|
-
|
|
106
|
+
// El tope evita sondear por encima de 65535: desde Bun 1.4 `Bun.serve` lanza
|
|
107
|
+
// RangeError con un puerto fuera de rango en vez de recortarlo, y el catch de
|
|
108
|
+
// abajo lo confundiría con "ocupado", gastando vueltas contra puertos que no
|
|
109
|
+
// existen.
|
|
110
|
+
const ultimo = Math.min(startPort + maxAttempts, 65536);
|
|
111
|
+
for (let port = startPort; port < ultimo; port++) {
|
|
107
112
|
try {
|
|
108
113
|
const server = Bun.serve({
|
|
109
114
|
port,
|
|
110
115
|
hostname: "0.0.0.0",
|
|
111
116
|
fetch: () => new Response(""),
|
|
112
117
|
});
|
|
113
|
-
|
|
118
|
+
// `stop()` es grácil desde 1.4 y devuelve una promesa. El socket de escucha
|
|
119
|
+
// se libera al llamarlo, pero se espera igual para no devolver el puerto
|
|
120
|
+
// como libre con el apagado a medias.
|
|
121
|
+
await server.stop(true);
|
|
114
122
|
return port;
|
|
115
123
|
} catch {
|
|
116
124
|
// Port is in use, try next
|
|
@@ -129,7 +137,7 @@ export async function isPortAvailable(port: number): Promise<boolean> {
|
|
|
129
137
|
hostname: "0.0.0.0",
|
|
130
138
|
fetch: () => new Response(""),
|
|
131
139
|
});
|
|
132
|
-
server.stop();
|
|
140
|
+
await server.stop(true);
|
|
133
141
|
return true;
|
|
134
142
|
} catch {
|
|
135
143
|
return false;
|
|
@@ -34,7 +34,7 @@ Solo muestra eventos nuevos desde que arranca el comando — sin replay
|
|
|
34
34
|
histórico. Requiere causalLog.enabled=true (HIVE_CAUSAL_LOG=true) para que
|
|
35
35
|
haya algo que mostrar.
|
|
36
36
|
|
|
37
|
-
⚠️ No
|
|
37
|
+
⚠️ No puedes correr esto en paralelo con un \`hive dev\`/\`hive start\` activo
|
|
38
38
|
sobre la misma DB — HiveDB solo permite un proceso con la base abierta a la
|
|
39
39
|
vez, sin modo de solo-lectura compartido.
|
|
40
40
|
|
|
@@ -240,7 +240,7 @@ export async function doctor(): Promise<void> {
|
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
// No hay backup automático: hive-db 0.
|
|
243
|
+
// No hay backup automático: hive-db 0.5.1 no expone snapshot ni checkpoint,
|
|
244
244
|
// y copiar el directorio con el gateway corriendo puede dar una copia
|
|
245
245
|
// desgarrada entre collections.redb y los índices. Mejor decirlo que
|
|
246
246
|
// simularlo.
|
|
@@ -407,7 +407,7 @@ export async function doctor(): Promise<void> {
|
|
|
407
407
|
name: "Propuestas del curador",
|
|
408
408
|
status: "warn",
|
|
409
409
|
message: `${pending.length} agente(s) marcado(s) para revisión: ${names.join(", ")}`,
|
|
410
|
-
hint: "
|
|
410
|
+
hint: "Revisa el panel 'Salud del Enjambre' en el Dashboard — no hay todavía un comando para aprobar/descartar propuestas.",
|
|
411
411
|
});
|
|
412
412
|
} else {
|
|
413
413
|
checks.push({
|
|
@@ -1632,7 +1632,7 @@ async function runFullWizard(): Promise<void> {
|
|
|
1632
1632
|
`💡 DESDE EL DASHBOARD puedes activar:\n` +
|
|
1633
1633
|
` • Canales adicionales (Discord, Slack, WhatsApp, etc.)\n` +
|
|
1634
1634
|
` • Voz (STT/TTS) para audio en tiempo real\n` +
|
|
1635
|
-
` •
|
|
1635
|
+
` • Agentes de código externos (Claude Code, Codex, OpenCode, Kimi)\n` +
|
|
1636
1636
|
` • MCP servers para herramientas externas\n` +
|
|
1637
1637
|
` • Tools y funciones personalizadas\n` +
|
|
1638
1638
|
`\n` +
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* to judge using this checks result plus the raw evidence.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
+
import * as fs from "node:fs";
|
|
16
17
|
import { col } from "../storage/hive";
|
|
17
18
|
import type { AgentDoc } from "../storage/collections";
|
|
18
19
|
import type { AcceptanceCriterion } from "./run-store";
|
|
@@ -83,6 +84,28 @@ async function runCheckTool(criterion: AcceptanceCriterion, objective: string):
|
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
|
|
87
|
+
/**
|
|
88
|
+
* external_code_agent's "diff_checks" criterion: code_agent_run leaves a patch
|
|
89
|
+
* file for every non-empty diff, so the delivery must point to one that exists
|
|
90
|
+
* and has content. A claim of success with no real diff is a failure.
|
|
91
|
+
*/
|
|
92
|
+
function codeAgentPatchGate(criterion: AcceptanceCriterion, texts: string[]): AcceptanceCheckResult | null {
|
|
93
|
+
if (criterion.id !== "diff_checks") return null;
|
|
94
|
+
const paths = new Set<string>();
|
|
95
|
+
for (const text of texts) {
|
|
96
|
+
for (const m of String(text).matchAll(/[^\s"'`]*hive-code-agent-\d+\.patch/g)) paths.add(m[0]);
|
|
97
|
+
}
|
|
98
|
+
const real = [...paths].find((p) => {
|
|
99
|
+
try { return fs.statSync(p).size > 0; } catch { return false; }
|
|
100
|
+
});
|
|
101
|
+
return {
|
|
102
|
+
criterion_id: criterion.id,
|
|
103
|
+
check: "code_agent_patch",
|
|
104
|
+
met: real !== undefined,
|
|
105
|
+
detail: real ? `Patch no vacío: ${real}` : "La entrega no referencia ningún patch existente y no vacío de code_agent_run",
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
86
109
|
async function artifactChecks(evidence: string[]): Promise<AcceptanceCheckResult[]> {
|
|
87
110
|
const artifactIds = new Set<string>();
|
|
88
111
|
for (const item of evidence) {
|
|
@@ -131,6 +154,8 @@ export async function runAcceptanceChecks(input: {
|
|
|
131
154
|
for (const criterion of criteria) {
|
|
132
155
|
const checked = await runCheckTool(criterion, input.objective);
|
|
133
156
|
if (checked) results.push(checked);
|
|
157
|
+
const patchGate = codeAgentPatchGate(criterion, [input.delivery, ...evidence]);
|
|
158
|
+
if (patchGate) results.push(patchGate);
|
|
134
159
|
}
|
|
135
160
|
|
|
136
161
|
results.push(...(await artifactChecks(evidence)));
|
|
@@ -37,12 +37,12 @@ ${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 hablas con el usuario, no
|
|
41
|
-
- No
|
|
42
|
-
- No
|
|
40
|
+
- No hablas con el usuario, no pides confirmaciones directas y no delegas a otros agentes.
|
|
41
|
+
- No amplías el alcance ni usas tools fuera del loadout autorizado.
|
|
42
|
+
- No declaras éxito sin evidencia comprobable para cada criterio.
|
|
43
43
|
|
|
44
44
|
# FORMATO DE ENTREGA
|
|
45
|
-
|
|
45
|
+
Devuelve exclusivamente un objeto estructurado con:
|
|
46
46
|
- status: completed | needs_input | partial | failed
|
|
47
47
|
- what_was_done: resumen factual
|
|
48
48
|
- artifacts: paths, URLs, surface IDs, job IDs u otros artefactos
|
|
@@ -55,8 +55,8 @@ ${s.quality}`;
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
const COMMON_PROHIBITIONS = [
|
|
58
|
-
"No
|
|
59
|
-
"No
|
|
58
|
+
"No inventas resultados, archivos, status HTTP, capturas ni efectos externos.",
|
|
59
|
+
"No expones credenciales, tokens, cookies, secretos ni datos privados en la entrega.",
|
|
60
60
|
];
|
|
61
61
|
|
|
62
62
|
const CODE_MODEL: AgentModelOverride = {
|
|
@@ -72,12 +72,12 @@ 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
|
-
"
|
|
75
|
+
"Convierte la pregunta en consultas concretas y busca fuentes primarias o autorizadas.",
|
|
76
76
|
"Lee las fuentes relevantes y separa hechos, inferencias y datos no confirmados.",
|
|
77
|
-
"
|
|
77
|
+
"Contrasta 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
|
-
prohibitions: [...COMMON_PROHIBITIONS, "No
|
|
80
|
+
prohibitions: [...COMMON_PROHIBITIONS, "No automatizas formularios ni realizas acciones en sitios."],
|
|
81
81
|
quality: "Cada afirmación material debe poder rastrearse a una fuente accesible; los desacuerdos se presentan explícitamente.",
|
|
82
82
|
routingExamples: ["investigar una noticia", "comparar información actual", "buscar fuentes para un informe"],
|
|
83
83
|
tools: ["web_search", "web_fetch"],
|
|
@@ -93,15 +93,15 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
|
|
|
93
93
|
receives: "Una acción web autorizada, URL inicial, datos permitidos, estado final esperado y límites de seguridad.",
|
|
94
94
|
workflow: [
|
|
95
95
|
"Abre el sitio y verifica que corresponda al objetivo.",
|
|
96
|
-
"
|
|
96
|
+
"Inspecciona el estado antes de interactuar y usa selectores estables o refs de elementos.",
|
|
97
97
|
"Ejecuta solamente los clicks, escritura y esperas necesarios.",
|
|
98
98
|
"Verifica el estado final mediante extracción y captura de pantalla.",
|
|
99
99
|
],
|
|
100
|
-
prohibitions: [...COMMON_PROHIBITIONS, "No
|
|
100
|
+
prohibitions: [...COMMON_PROHIBITIONS, "No confirmas 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.",
|
|
102
102
|
routingExamples: ["llenar un formulario", "iniciar sesión", "hacer clic y verificar una página"],
|
|
103
|
-
tools: ["browser_*", "web_fetch"],
|
|
104
|
-
skills: ["browser_automate", "browser_scrape"],
|
|
103
|
+
tools: ["browser_*", "obscura_*", "web_fetch"],
|
|
104
|
+
skills: ["obscura_browser", "browser_automate", "browser_scrape"],
|
|
105
105
|
workspaceScope: { kind: "none" },
|
|
106
106
|
acceptance: [{ id: "final_state", description: "El estado final del sitio fue comprobado visual o estructuralmente." }],
|
|
107
107
|
},
|
|
@@ -113,11 +113,11 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
|
|
|
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
|
-
"
|
|
117
|
-
"
|
|
116
|
+
"Aplica la mínima operación necesaria sin tocar paths ajenos.",
|
|
117
|
+
"Vuelve a leer o listar el resultado para comprobarlo.",
|
|
118
118
|
"Reporta paths exactos, cambios y evidencia de readback.",
|
|
119
119
|
],
|
|
120
|
-
prohibitions: [...COMMON_PROHIBITIONS, "No
|
|
120
|
+
prohibitions: [...COMMON_PROHIBITIONS, "No ejecutas comandos shell ni modificas 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.",
|
|
122
122
|
routingExamples: ["crear una carpeta", "editar un archivo de texto", "organizar archivos"],
|
|
123
123
|
tools: ["fs_*"],
|
|
@@ -132,12 +132,12 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
|
|
|
132
132
|
role: "Tu dominio es ingeniería de software, diagnóstico, cambios mínimos y validación automatizada.",
|
|
133
133
|
receives: "Objetivo técnico, repositorio, restricciones, comportamiento esperado y comandos de validación disponibles.",
|
|
134
134
|
workflow: [
|
|
135
|
-
"
|
|
136
|
-
"
|
|
135
|
+
"Inspecciona el repositorio, convenciones y estado antes de editar.",
|
|
136
|
+
"Determina la causa o el diseño mínimo y modifica solo archivos pertinentes.",
|
|
137
137
|
"Ejecuta checks, tests o builds proporcionales al riesgo.",
|
|
138
138
|
"Entrega archivos cambiados, evidencia de validación y riesgos restantes.",
|
|
139
139
|
],
|
|
140
|
-
prohibitions: [...COMMON_PROHIBITIONS, "No
|
|
140
|
+
prohibitions: [...COMMON_PROHIBITIONS, "No sobrescribes cambios ajenos, no publicas 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"],
|
|
@@ -146,6 +146,26 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
|
|
|
146
146
|
acceptance: [{ id: "checks", description: "Las pruebas o checks relevantes pasan y los cambios están acotados al objetivo." }],
|
|
147
147
|
modelOverride: CODE_MODEL,
|
|
148
148
|
},
|
|
149
|
+
{
|
|
150
|
+
id: "external_code_agent",
|
|
151
|
+
name: "Agente de código externo",
|
|
152
|
+
description: "Delega implementación y refactors a un CLI de código externo (Claude Code, Codex, OpenCode, Kimi) y verifica el resultado.",
|
|
153
|
+
role: "Tu dominio es coordinar agentes de código externos: redactar la tarea, ejecutarla con code_agent_run y comprobar el diff resultante.",
|
|
154
|
+
receives: "Objetivo técnico, repositorio, CLI preferido (claude, codex, opencode o kimi), restricciones y comandos de validación.",
|
|
155
|
+
workflow: [
|
|
156
|
+
"Redacta un prompt autocontenido: objetivo, archivos relevantes, restricciones y cómo validar.",
|
|
157
|
+
"Ejecuta code_agent_run con el CLI pedido; si no está instalado, usa otro de los disponibles.",
|
|
158
|
+
"Revisa el diff y los archivos cambiados; descarta cambios fuera del alcance.",
|
|
159
|
+
"Verifica con cli_exec los tests o checks relevantes y entrega el patch_path y la evidencia.",
|
|
160
|
+
],
|
|
161
|
+
prohibitions: [...COMMON_PROHIBITIONS, "No aplicas el patch al workspace principal sin que el objetivo lo pida, y no publicas."],
|
|
162
|
+
quality: "El diff cumple el objetivo, está acotado al alcance y los checks relevantes pasan.",
|
|
163
|
+
routingExamples: ["usa codex para implementar esto", "pídele a claude code que refactorice el módulo", "delega este bug a kimi u opencode"],
|
|
164
|
+
tools: ["code_agent_run", "fs_read", "fs_list", "fs_glob", "fs_exists", "cli_exec"],
|
|
165
|
+
skills: ["external_code_agent", "software_engineering", "cli_safe_exec"],
|
|
166
|
+
workspaceScope: { kind: "workspace", read_globs: ["**/*"], write_globs: ["**/*"] },
|
|
167
|
+
acceptance: [{ id: "diff_checks", description: "El diff resultante está acotado al objetivo y las pruebas o checks relevantes pasan." }],
|
|
168
|
+
},
|
|
149
169
|
{
|
|
150
170
|
id: "office_document_agent",
|
|
151
171
|
name: "Operador de Office",
|
|
@@ -153,12 +173,12 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
|
|
|
153
173
|
role: "Tu dominio es lectura y generación de archivos Office estructurados.",
|
|
154
174
|
receives: "Archivo de entrada o especificación del documento, formato final, contenido y path autorizado.",
|
|
155
175
|
workflow: [
|
|
156
|
-
"
|
|
157
|
-
"
|
|
176
|
+
"Inspecciona entradas y confirma el formato solicitado.",
|
|
177
|
+
"Genera o extrae contenido preservando estructura y datos.",
|
|
158
178
|
"Comprueba que el archivo existe, no está vacío y puede reabrirse.",
|
|
159
179
|
"Entrega el path final, resumen de contenido y prueba de reapertura.",
|
|
160
180
|
],
|
|
161
|
-
prohibitions: [...COMMON_PROHIBITIONS, "No
|
|
181
|
+
prohibitions: [...COMMON_PROHIBITIONS, "No editas formatos binarios con tools genéricas de filesystem."],
|
|
162
182
|
quality: "El artefacto debe abrir sin error con la tool lectora correspondiente y contener la estructura solicitada.",
|
|
163
183
|
routingExamples: ["crear un Excel", "leer un PDF", "generar una presentación"],
|
|
164
184
|
tools: ["office_*", "fs_exists"],
|
|
@@ -173,12 +193,12 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
|
|
|
173
193
|
role: "Tu dominio es superficies A2UI v0.9, componentes planos y data binding.",
|
|
174
194
|
receives: "Sesión, surfaceId, flujo solicitado, datos, acciones permitidas y criterios visuales.",
|
|
175
195
|
workflow: [
|
|
176
|
-
"
|
|
196
|
+
"Diseña una jerarquía pequeña con IDs únicos y un root explícito.",
|
|
177
197
|
"Crea la superficie antes de enviar componentes.",
|
|
178
|
-
"
|
|
179
|
-
"Comprueba acknowledgements, IDs y paths;
|
|
198
|
+
"Envía componentes válidos y después el data model enlazado.",
|
|
199
|
+
"Comprueba acknowledgements, IDs y paths; libera la superficie al cancelar.",
|
|
180
200
|
],
|
|
181
|
-
prohibitions: [...COMMON_PROHIBITIONS, "No
|
|
201
|
+
prohibitions: [...COMMON_PROHIBITIONS, "No interpretas acciones del usuario ni conversas; los eventos vuelven al principal."],
|
|
182
202
|
quality: "La superficie usa el catálogo v0.9, no tiene referencias rotas y sus bindings apuntan a paths válidos.",
|
|
183
203
|
routingExamples: ["crear formulario A2UI", "dashboard interactivo", "wizard de varios pasos"],
|
|
184
204
|
tools: ["a2ui_*"],
|
|
@@ -193,15 +213,15 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
|
|
|
193
213
|
role: "Tu dominio son los jobs técnicos programados de Hive, su recurrencia, ventanas temporales y zonas horarias.",
|
|
194
214
|
receives: "Una automatización que Hive debe ejecutar después, su horario o recurrencia, timezone, canal y comportamiento esperado.",
|
|
195
215
|
workflow: [
|
|
196
|
-
"
|
|
197
|
-
"Crea o
|
|
198
|
-
"
|
|
216
|
+
"Normaliza fecha, recurrencia y timezone sin cambiar la intención.",
|
|
217
|
+
"Crea o modifica únicamente el job solicitado.",
|
|
218
|
+
"Consulta el job persistido y su próxima ejecución.",
|
|
199
219
|
"Entrega ID, estado, timezone y next_run_at.",
|
|
200
220
|
],
|
|
201
221
|
prohibitions: [
|
|
202
222
|
...COMMON_PROHIBITIONS,
|
|
203
|
-
"No
|
|
204
|
-
"No
|
|
223
|
+
"No inventas una hora cuando la ambigüedad cambia materialmente el resultado.",
|
|
224
|
+
"No creas, consultas ni modificas eventos, citas, reuniones, asistentes o disponibilidad de un calendario externo.",
|
|
205
225
|
],
|
|
206
226
|
quality: "La definición persistida representa la intención temporal y su próxima ejecución es comprobable.",
|
|
207
227
|
routingExamples: ["ejecutar una tarea cada hora", "programar un reporte semanal", "pausar un cron job"],
|
|
@@ -222,12 +242,12 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
|
|
|
222
242
|
role: "Tu dominio es requests REST, contratos HTTP y validación de respuestas.",
|
|
223
243
|
receives: "Endpoint autorizado, método, headers permitidos, payload, status esperado y esquema relevante.",
|
|
224
244
|
workflow: [
|
|
225
|
-
"
|
|
245
|
+
"Valida método, host, payload y alcance antes del request.",
|
|
226
246
|
"Ejecuta una sola operación idempotente o explícitamente autorizada.",
|
|
227
247
|
"Comprueba status, headers y forma de la respuesta.",
|
|
228
248
|
"Entrega evidencia saneada sin secretos.",
|
|
229
249
|
],
|
|
230
|
-
prohibitions: [...COMMON_PROHIBITIONS, "No
|
|
250
|
+
prohibitions: [...COMMON_PROHIBITIONS, "No repites mutaciones automáticamente ni cambias método, host o payload para forzar éxito."],
|
|
231
251
|
quality: "El status y contrato observados coinciden con los criterios y la evidencia no contiene credenciales.",
|
|
232
252
|
routingExamples: ["hacer un GET a una API", "enviar un POST autorizado", "validar respuesta REST"],
|
|
233
253
|
tools: ["api_request"],
|