hive-am 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/package.json +1 -1
  3. package/server/dist/http/routes/agents.js +21 -0
  4. package/server/dist/providers/opencode-server.js +45 -0
  5. package/server/dist/providers/opencode.js +50 -4
  6. package/server/dist/terminals.js +10 -2
  7. package/web/.next/BUILD_ID +1 -1
  8. package/web/.next/app-build-manifest.json +56 -56
  9. package/web/.next/app-path-routes-manifest.json +6 -6
  10. package/web/.next/build-manifest.json +2 -2
  11. package/web/.next/prerender-manifest.json +55 -55
  12. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  13. package/web/.next/server/app/_not-found.html +1 -1
  14. package/web/.next/server/app/_not-found.rsc +3 -3
  15. package/web/.next/server/app/agents/[id]/page.js +1 -1
  16. package/web/.next/server/app/agents/[id]/page_client-reference-manifest.js +1 -1
  17. package/web/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  18. package/web/.next/server/app/agents.html +1 -1
  19. package/web/.next/server/app/agents.rsc +4 -4
  20. package/web/.next/server/app/connections/page_client-reference-manifest.js +1 -1
  21. package/web/.next/server/app/connections.html +1 -1
  22. package/web/.next/server/app/connections.rsc +4 -4
  23. package/web/.next/server/app/index.html +1 -1
  24. package/web/.next/server/app/index.rsc +4 -4
  25. package/web/.next/server/app/page_client-reference-manifest.js +1 -1
  26. package/web/.next/server/app/relations/page_client-reference-manifest.js +1 -1
  27. package/web/.next/server/app/relations.html +1 -1
  28. package/web/.next/server/app/relations.rsc +4 -4
  29. package/web/.next/server/app/resources/[id]/page_client-reference-manifest.js +1 -1
  30. package/web/.next/server/app/resources/page_client-reference-manifest.js +1 -1
  31. package/web/.next/server/app/resources.html +1 -1
  32. package/web/.next/server/app/resources.rsc +4 -4
  33. package/web/.next/server/app/schedules/page_client-reference-manifest.js +1 -1
  34. package/web/.next/server/app/schedules.html +1 -1
  35. package/web/.next/server/app/schedules.rsc +4 -4
  36. package/web/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  37. package/web/.next/server/app/sessions.html +1 -1
  38. package/web/.next/server/app/sessions.rsc +4 -4
  39. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  40. package/web/.next/server/app/skills.html +1 -1
  41. package/web/.next/server/app/skills.rsc +4 -4
  42. package/web/.next/server/app/types/page_client-reference-manifest.js +1 -1
  43. package/web/.next/server/app/types.html +1 -1
  44. package/web/.next/server/app/types.rsc +4 -4
  45. package/web/.next/server/app-paths-manifest.json +6 -6
  46. package/web/.next/server/chunks/274.js +1 -1
  47. package/web/.next/server/chunks/612.js +1 -1
  48. package/web/.next/server/pages/404.html +1 -1
  49. package/web/.next/server/pages/500.html +1 -1
  50. package/web/.next/server/server-reference-manifest.json +1 -1
  51. package/web/.next/static/chunks/705-c7e75806f77b880c.js +1 -0
  52. package/web/.next/static/chunks/839-4aefe6e71be6e1ef.js +1 -0
  53. package/web/.next/static/chunks/app/agents/[id]/{page-4af6c246c4ca7a97.js → page-3faf40800981a736.js} +1 -1
  54. package/web/.next/static/chunks/app/layout-99620746d028dda8.js +1 -0
  55. package/web/.next/static/css/{dd4e32c285f75776.css → b7a03c62468f4263.css} +1 -1
  56. package/web/.next/trace +29 -29
  57. package/web/.next/static/chunks/705-a16e1fe09be1ac7f.js +0 -1
  58. package/web/.next/static/chunks/839-23c5508622fae942.js +0 -1
  59. package/web/.next/static/chunks/app/layout-87ebb70bd9cb8443.js +0 -1
  60. /package/web/.next/static/{p4S3i9kvO359GW91DQiHu → Bz7onClw1BajMUCwqpU8o}/_buildManifest.js +0 -0
  61. /package/web/.next/static/{p4S3i9kvO359GW91DQiHu → Bz7onClw1BajMUCwqpU8o}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{5506:(e,t,n)=>{"use strict";n.d(t,{Shell:()=>B});var l=n(94799),a=n(41463),s=n.n(a),r=n(43624),i=n(34023),o=n(84616),c=n(6261),d=n(29416),u=n(26701),h=n(74955);let m=(0,h.A)("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);var v=n(15223),k=n(54234),y=n(73784);let p=(0,h.A)("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);var b=n(68449),x=n(70283);let g=(0,h.A)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),f=(0,h.A)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);var j=n(48538),w=n(69654),A=n(86606);function N(){let[e,t]=(0,i.useState)(null),[n,a]=(0,i.useState)(null),s=(0,i.useRef)(null);return((0,i.useEffect)(()=>{let e,n=null,l=()=>{clearTimeout(e),n=null,t(null),a(null)},s=e=>e instanceof Element?e.closest("[title],[data-tip]"):null,r=function(a){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!a||a===n)return;l();let r=(e=>{var t,n;let l=e.getAttribute("title");return null!==l&&(e.removeAttribute("title"),l.trim()&&(e.dataset.tip=l,e.getAttribute("aria-label")||(null==(t=e.textContent)?void 0:t.trim())||e.setAttribute("aria-label",l))),null!=(n=e.dataset.tip)?n:""})(a);if(!r)return;n=a;let i=()=>{n===a&&a.isConnected&&t({text:r,rect:a.getBoundingClientRect()})};s?i():e=setTimeout(i,350)},i=e=>r(s(e.target)),o=e=>{n&&!(e.relatedTarget instanceof Node&&n.contains(e.relatedTarget))&&l()},c=e=>{let t=s(e.target);t&&t.matches(":focus-visible")&&r(t,!0)},d=e=>{"Escape"===e.key&&l()};return document.addEventListener("mouseover",i),document.addEventListener("mouseout",o),document.addEventListener("focusin",c),document.addEventListener("focusout",l),document.addEventListener("pointerdown",l,!0),document.addEventListener("keydown",d),window.addEventListener("scroll",l,!0),window.addEventListener("blur",l),()=>{l(),document.removeEventListener("mouseover",i),document.removeEventListener("mouseout",o),document.removeEventListener("focusin",c),document.removeEventListener("focusout",l),document.removeEventListener("pointerdown",l,!0),document.removeEventListener("keydown",d),window.removeEventListener("scroll",l,!0),window.removeEventListener("blur",l)}},[]),(0,i.useLayoutEffect)(()=>{if(!e||!s.current)return;let{width:t,height:n}=s.current.getBoundingClientRect(),l=e.rect.top-n-8<8;a({left:Math.min(Math.max(8,e.rect.left+e.rect.width/2-t/2),window.innerWidth-t-8),top:l?e.rect.bottom+8:e.rect.top-n-8,below:l})},[e]),e)?(0,l.jsx)("div",{ref:s,className:"tooltip",role:"tooltip","data-live":!0,"data-below":(null==n?void 0:n.below)?"1":void 0,style:n?{left:n.left,top:n.top}:{left:0,top:0,visibility:"hidden"},children:e.text}):null}var M=n(42162),E=n(19431),z=n(70665),C=n(92947),S=n(80306),L=n(12349),H=n(75010);n(21169);var _=n(69538);let T=(e,t)=>getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t,F=()=>({background:T("--bg-deep","#0c1411"),foreground:T("--ink","#e7eee9"),cursor:T("--honey","#e8a317"),cursorAccent:T("--bg-deep","#0c1411"),selectionBackground:"rgba(232,163,23,.35)"});function P(e){let{id:t,visible:a,onEnded:s}=e,{t:r}=(0,w.s9)(),o=(0,i.useRef)(null),c=(0,i.useRef)(null),d=(0,i.useRef)(a);return d.current=a,(0,i.useEffect)(()=>{let e=!1,l=null,a,i=!1,u=0,h=null,m=null,v=null,k=null,y=e=>{(null==l?void 0:l.readyState)===WebSocket.OPEN&&l.send(JSON.stringify(e))},p=()=>{var e;if(h&&m&&(null==(e=o.current)?void 0:e.offsetParent))try{m.fit(),y({t:"resize",cols:h.cols,rows:h.rows})}catch(e){}};return(async()=>{let[{Terminal:b},{FitAddon:x},{WebLinksAddon:g}]=await Promise.all([n.e(209).then(n.bind(n,75657)),n.e(97).then(n.bind(n,57097)),n.e(545).then(n.bind(n,90545))]);if(e||!o.current)return;h=new b({fontFamily:T("--font-mono","ui-monospace, monospace"),fontSize:13,lineHeight:1.15,cursorBlink:!0,scrollback:5e3,theme:F(),allowProposedApi:!1}),m=new x,h.loadAddon(m),h.loadAddon(new g),h.open(o.current),c.current={fit:p,focus:()=>null==h?void 0:h.focus()},d.current&&(p(),h.focus()),h.onData(e=>y({t:"in",d:e}));let f=()=>{var e;let t=null==h?void 0:h.getSelection();return t&&(null==(e=navigator.clipboard)||e.writeText(t).catch(()=>{})),!!t};h.onSelectionChange(()=>{f()}),h.attachCustomKeyEventHandler(e=>"keydown"!==e.type||!e.ctrlKey||!!e.altKey||!!e.metaKey||!("c"===e.key.toLowerCase()&&(e.shiftKey||(null==h?void 0:h.hasSelection())))||(f(),!1)),(v=new ResizeObserver(p)).observe(o.current),(k=new MutationObserver(()=>{h&&(h.options.theme=F())})).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});let j=()=>{var n;(l=new WebSocket("".concat("ws://".concat(location.hostname,":").concat(null!=(n=_.env.NEXT_PUBLIC_HIVE_WS_PORT)?n:4400,"/ws/terminal"),"?id=").concat(encodeURIComponent(t)))).onopen=()=>{u=0},l.onmessage=e=>{let t=JSON.parse(e.data);"init"===t.t?(h.reset(),p()):"out"===t.t?h.write(t.d):"exit"===t.t?(i=!0,h.write("\r\n\x1b[2m[".concat(r("dock.ended",{code:t.code}),"]\x1b[0m\r\n")),s(t.code)):"gone"===t.t&&(i=!0,h.write("\r\n\x1b[2m[".concat(r("dock.gone"),"]\x1b[0m\r\n")),s(null))},l.onclose=()=>{e||i||(a=setTimeout(j,Math.min(5e3,600*2**u++)))}};j()})(),()=>{e=!0,clearTimeout(a),null==v||v.disconnect(),null==k||k.disconnect(),null==l||l.close(),null==h||h.dispose(),c.current=null}},[t]),(0,i.useEffect)(()=>{if(a){let e=setTimeout(()=>{var e,t;null==(e=c.current)||e.fit(),null==(t=c.current)||t.focus()},30);return()=>clearTimeout(e)}},[a]),(0,l.jsx)("div",{className:"xterm-box",ref:o})}let R=e=>"dock-tab-".concat(e);function q(){var e;let{t}=(0,w.s9)(),n=(0,M.n)(),[a,s]=(0,i.useState)(null),r=(0,i.useRef)(null);(0,i.useEffect)(()=>{let e=e=>{r.current&&n.setHeight(r.current.h+(r.current.y-e.clientY))},t=()=>{r.current=null,document.body.style.userSelect=""};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t)}},[n]);let o=n.tabs.some(e=>e.key===n.active),c=null==(e=[...n.tabs].reverse().find(e=>"term"===e.kind))?void 0:e.cwd;return(0,l.jsxs)("section",{className:"dock",style:{height:n.height,display:n.open?void 0:"none"},"aria-hidden":!n.open,"aria-label":t("dock.title"),children:[(0,l.jsx)("div",{className:"dock-grip",onPointerDown:e=>{r.current={y:e.clientY,h:n.height},document.body.style.userSelect="none",e.preventDefault()},role:"separator","aria-orientation":"horizontal"}),(0,l.jsxs)("div",{className:"dock-bar",children:[(0,l.jsx)("div",{className:"dock-tabs",role:"tablist","aria-label":t("dock.title"),onKeyDown:e=>{var t;let l=n.tabs.map(e=>e.key),a=l.indexOf(null!=(t=n.active)?t:""),s=null;if("ArrowRight"===e.key)s=(a+1)%l.length;else if("ArrowLeft"===e.key)s=(a-1+l.length)%l.length;else if("Home"===e.key)s=0;else if("End"===e.key)s=l.length-1;else if("Delete"===e.key&&a>=0){e.preventDefault(),n.closeTab(l[a]);return}null!==s&&l.length&&(e.preventDefault(),n.setActive(l[s]),requestAnimationFrame(()=>{var e;return null==(e=document.getElementById(R(l[s])))?void 0:e.focus()}))},children:n.tabs.map(e=>{var a;let s=n.active===e.key,r=R(e.key);return(0,l.jsxs)("div",{className:"dock-tabwrap ".concat(s?"on":""),children:[(0,l.jsxs)("button",{id:r,type:"button",role:"tab","aria-selected":s,"aria-controls":"".concat(r,"-panel"),tabIndex:s||!o&&e===n.tabs[0]?0:-1,className:"dock-tab-btn",onClick:()=>n.setActive(e.key),title:"term"===e.kind?e.cwd:t("obj.logs"),children:["term"===e.kind?(0,l.jsx)(x.A,{size:14}):(0,l.jsx)(E.A,{size:14}),(0,l.jsx)("span",{className:"nm",children:e.title}),"term"===e.kind&&void 0!==e.ended&&(0,l.jsx)("i",{className:"odot off",title:t("dock.ended",{code:null!=(a=e.ended)?a:""})})]}),(0,l.jsx)("button",{type:"button",className:"dock-x",tabIndex:-1,onClick:()=>n.closeTab(e.key),"aria-label":"".concat(t("common.close"),": ").concat(e.title),children:(0,l.jsx)(z.A,{size:12})})]},e.key)})}),n.enabled&&(0,l.jsx)("button",{className:"btn ghost icon sm",onClick:()=>void n.openTerminal(c?{cwd:c}:{}),"aria-label":t("dock.new"),title:t("dock.new"),children:(0,l.jsx)(C.A,{size:15})}),n.enabled&&(0,l.jsx)("button",{className:"btn ghost icon sm",onClick:()=>s(null!=c?c:""),"aria-label":t("dock.inFolder"),title:t("dock.inFolder"),children:(0,l.jsx)(S.A,{size:15})}),(0,l.jsx)("span",{className:"grow"}),(0,l.jsx)("button",{className:"btn ghost icon sm",onClick:()=>n.setOpen(!1),"aria-label":t("dock.hide"),title:"".concat(t("dock.hide")," (Ctrl+`)"),children:(0,l.jsx)(L.A,{size:15})})]}),(0,l.jsxs)("div",{className:"dock-body",children:[n.error&&(0,l.jsx)("p",{className:"gx-note err gx-hint-row",role:"alert",children:n.error}),!n.enabled&&!n.tabs.length&&(0,l.jsx)("p",{className:"gx-note",children:t("dock.disabled")}),n.enabled&&!n.tabs.length&&!n.error&&(0,l.jsx)("p",{className:"gx-note",children:t("dock.empty")}),n.tabs.map(e=>(0,l.jsx)("div",{id:"".concat(R(e.key),"-panel"),role:"tabpanel","aria-labelledby":R(e.key),className:"dock-pane",hidden:n.active!==e.key,children:"term"===e.kind?(0,l.jsx)(P,{id:e.id,visible:n.open&&n.active===e.key,onEnded:t=>n.markEnded(e.key,t)}):n.open&&(0,l.jsx)("div",{className:"dock-logpane",children:(0,l.jsx)(H.I,{id:e.objectId,height:"100%"})})},e.key))]}),null!==a&&(0,l.jsxs)(A.aF,{title:t("dock.inFolder"),onClose:()=>s(null),children:[(0,l.jsx)(A.dR,{value:a,onChange:s,label:t("obj.f.folder"),hint:t("dock.folder.hint")}),(0,l.jsxs)("div",{className:"row confirm-actions",children:[(0,l.jsx)("button",{className:"btn ghost",onClick:()=>s(null),children:t("common.cancel")}),(0,l.jsx)("button",{className:"btn primary",disabled:!a.startsWith("/"),onClick:()=>{s(null),n.openTerminal({cwd:a})},children:t("dock.open")})]})]})]})}function O(){return(0,l.jsx)("img",{src:"/icon.png",width:34,height:34,alt:"","aria-hidden":!0,className:"brand-mark"})}function V(){let{locale:e,setLocale:t,t:n}=(0,w.s9)();return(0,l.jsxs)("div",{className:"lang-row",role:"group","aria-label":n("lang.label"),children:[(0,l.jsx)(o.A,{size:15,"aria-hidden":!0}),(0,l.jsx)("div",{className:"seg",children:w.YZ.map(n=>(0,l.jsx)("button",{type:"button","aria-pressed":e===n.id,lang:n.id,title:n.name,"aria-label":n.name,onClick:()=>t(n.id),children:n.short},n.id))})]})}function I(){let e=(0,r.usePathname)(),{t}=(0,w.s9)(),{agents:n,types:a,skills:o,connections:h,objects:A,connected:N}=(0,j.o0)(),E=(0,M.n)(),[z,C]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let e=document.documentElement,t=()=>C("dark"===e.dataset.theme);t();let n=new MutationObserver(t);return n.observe(e,{attributes:!0,attributeFilter:["data-theme"]}),()=>n.disconnect()},[]);let S=n.filter(e=>"running"===e.status).length,L=(t,n,a,r)=>{let i="/"===t?"/"===e:e.startsWith(t);return(0,l.jsxs)(s(),{href:t,className:"nav","aria-current":i?"page":void 0,children:[a,(0,l.jsx)("span",{className:"t",children:n}),void 0!==r&&(0,l.jsx)("span",{className:"count",children:r})]},t)};return(0,l.jsxs)("nav",{className:"rail","aria-label":t("nav.main"),children:[(0,l.jsxs)("div",{className:"brand",children:[(0,l.jsx)(O,{}),(0,l.jsxs)("div",{children:["hive-am",(0,l.jsx)("small",{children:t("app.tagline")})]})]}),(0,l.jsx)(V,{}),L("/",t("nav.colony"),(0,l.jsx)(c.A,{size:18}),S||void 0),L("/resources",t("nav.objects"),(0,l.jsx)(d.A,{size:18}),A.length||void 0),L("/agents",t("nav.agents"),(0,l.jsx)(u.A,{size:18}),n.length),L("/relations",t("nav.relations"),(0,l.jsx)(m,{size:18})),L("/connections",t("nav.connections"),(0,l.jsx)(v.A,{size:18}),h.length||void 0),L("/schedules",t("nav.schedules"),(0,l.jsx)(k.A,{size:18})),(0,l.jsx)("div",{className:"nav-label",children:t("nav.library")}),L("/types",t("nav.types"),(0,l.jsx)(y.A,{size:18}),a.length),L("/skills",t("nav.skills"),(0,l.jsx)(p,{size:18}),o.length),(0,l.jsx)("div",{className:"nav-label",children:t("nav.history")}),L("/sessions",t("nav.sessions"),(0,l.jsx)(b.A,{size:18})),(0,l.jsxs)("div",{className:"rail-foot",children:[(0,l.jsxs)("button",{type:"button",className:"nav",onClick:E.toggle,"aria-pressed":E.open,title:"".concat(t("dock.nav")," (Ctrl+`)"),children:[(0,l.jsx)(x.A,{size:18}),(0,l.jsx)("span",{className:"t",children:t("dock.nav")}),E.tabs.length>0&&(0,l.jsx)("span",{className:"count",children:E.tabs.length})]}),(0,l.jsxs)("div",{className:"conn",children:[(0,l.jsx)("i",{className:"dot ".concat(N?"ok":"err")}),t(N?"nav.connected":"nav.offline")]}),(0,l.jsxs)("button",{type:"button",className:"nav",onClick:()=>{let e=z?"light":"dark";document.documentElement.dataset.theme=e;try{localStorage.setItem("hive-theme",e)}catch(e){}},"aria-pressed":z,children:[z?(0,l.jsx)(g,{size:18}):(0,l.jsx)(f,{size:18}),(0,l.jsx)("span",{className:"t",children:t("nav.switchTheme")})]})]})]})}function B(e){let{children:t}=e;return(0,l.jsx)(w.CY,{children:(0,l.jsx)(j.Of,{children:(0,l.jsx)(M.$,{children:(0,l.jsxs)(A.l$,{children:[(0,l.jsx)(N,{}),(0,l.jsxs)("div",{className:"shell",children:[(0,l.jsx)(I,{}),(0,l.jsx)("main",{className:"main",children:t})]}),(0,l.jsx)(q,{})]})})})})}},6261:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});let l=(0,n(74955).A)("Hexagon",[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]])},15151:e=>{e.exports={style:{fontFamily:"'JetBrains Mono', 'JetBrains Mono Fallback'",fontStyle:"normal"},className:"__className_4dc837",variable:"__variable_4dc837"}},15223:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});let l=(0,n(74955).A)("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]])},19431:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});let l=(0,n(74955).A)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},21169:()=>{},26701:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});let l=(0,n(74955).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},29416:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});let l=(0,n(74955).A)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},39856:e=>{e.exports={style:{fontFamily:"'Bricolage Grotesque', 'Bricolage Grotesque Fallback'",fontStyle:"normal"},className:"__className_23d1a5",variable:"__variable_23d1a5"}},42162:(e,t,n)=>{"use strict";n.d(t,{$:()=>u,n:()=>o});var l=n(94799),a=n(34023),s=n(3749),r=n(69654);let i=(0,a.createContext)(null),o=()=>{let e=(0,a.useContext)(i);if(!e)throw Error("DockProvider missing");return e},c="hive-am.dock",d=e=>Math.max(140,Math.min(e,Math.round(.8*window.innerHeight)));function u(e){let{children:t}=e,{t:n}=(0,r.s9)(),[o,u]=(0,a.useState)(!1),[h,m]=(0,a.useState)(320),[v,k]=(0,a.useState)([]),[y,p]=(0,a.useState)(null),[b,x]=(0,a.useState)(!0),[g,f]=(0,a.useState)(""),j=(0,a.useRef)(!1);(0,a.useEffect)(()=>{try{var e;let t=JSON.parse(null!=(e=localStorage.getItem(c))?e:"{}");"number"==typeof t.height&&m(d(t.height)),t.open&&u(!0),"string"==typeof t.active&&p(t.active)}catch(e){}s.FH.get("/terminals").then(e=>{x(e.enabled),k(t=>[...e.terminals.map(e=>({key:"t:".concat(e.id),kind:"term",id:e.id,title:e.title,cwd:e.cwd,ended:e.alive?void 0:e.exitCode})),...t.filter(e=>"logs"===e.kind)]),p(t=>t&&e.terminals.some(e=>"t:".concat(e.id)===t)?t:e.terminals[0]?"t:".concat(e.terminals[0].id):t)}).catch(()=>void 0).finally(()=>{j.current=!0})},[]),(0,a.useEffect)(()=>{if(j.current)try{localStorage.setItem(c,JSON.stringify({open:o,height:h,active:y}))}catch(e){}},[o,h,y]),(0,a.useEffect)(()=>{document.documentElement.style.setProperty("--app-h",o?"calc(100vh - ".concat(h,"px)"):"100vh")},[o,h]);let w=(0,a.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f("");try{let t=await s.FH.post("/terminals",e),n={key:"t:".concat(t.id),kind:"term",id:t.id,title:t.title,cwd:t.cwd};k(e=>[...e,n]),p(n.key),u(!0)}catch(e){f(e instanceof Error?e.message:n("dock.failed")),u(!0)}},[n]),A=(0,a.useCallback)((e,t)=>{let n="l:".concat(e);k(l=>l.some(e=>e.key===n)?l:[...l,{key:n,kind:"logs",objectId:e,title:t}]),p(n),u(!0)},[]),N=(0,a.useCallback)(e=>{k(t=>{let n=t.find(t=>t.key===e);(null==n?void 0:n.kind)==="term"&&s.FH.del("/terminals/".concat(n.id)).catch(()=>void 0);let l=t.filter(t=>t.key!==e);return p(t=>{var n,a;return t===e?null!=(a=null==(n=l[l.length-1])?void 0:n.key)?a:null:t}),l})},[]),M=(0,a.useCallback)((e,t)=>k(n=>n.map(n=>n.key===e&&"term"===n.kind?{...n,ended:null!=t?t:0}:n)),[]),E=(0,a.useCallback)(()=>{if(o)return void u(!1);u(!0),!v.length&&b&&w()},[o,v.length,b,w]);(0,a.useEffect)(()=>{let e=e=>{!e.ctrlKey||e.altKey||e.metaKey||"`"!==e.key&&"Backquote"!==e.code||(e.preventDefault(),e.stopPropagation(),E())};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[E]);let z=(0,a.useMemo)(()=>({open:o,height:h,tabs:v,active:y,enabled:b,error:g,toggle:E,setOpen:u,setHeight:e=>m(d(e)),setActive:p,openTerminal:w,openLogs:A,closeTab:N,markEnded:M}),[o,h,v,y,b,g,E,w,A,N,M]);return(0,l.jsx)(i.Provider,{value:z,children:t})}},54234:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});let l=(0,n(74955).A)("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]])},64883:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});let l=(0,n(74955).A)("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]])},68449:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});let l=(0,n(74955).A)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},70283:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});let l=(0,n(74955).A)("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]])},73784:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});let l=(0,n(74955).A)("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]])},75010:(e,t,n)=>{"use strict";n.d(t,{I:()=>d});var l=n(94799),a=n(34023),s=n(98392),r=n(64883),i=n(3749),o=n(69654);let c=/\u001b\[[0-9;?]*[ -/]*[@-~]/g;function d(e){let{id:t,height:n=220}=e,{t:d}=(0,o.s9)(),[u,h]=(0,a.useState)(null),m=(0,a.useRef)(""),v=(0,a.useRef)(null),k=(0,a.useRef)(!0),[y,p]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=!1,n;h(null),m.current="",k.current=!0,p(!1);let l=async()=>{try{let n=m.current?"after=".concat(encodeURIComponent(m.current)):"tail=300",l=await i.FH.get("/objects/".concat(t,"/logs?").concat(n));if(e)return;m.current=l.cursor||m.current;let a=l.text.replace(c,"");h(e=>{let t=l.reset?"":null!=e?e:"";if(!a)return null!=e?e:"";let n=!t||t.endsWith("\n")||a.startsWith("\n")?t+a:"".concat(t,"\n").concat(a);return n.length>2e5?n.slice(n.length-2e5):n})}catch(e){}e||(n=setTimeout(l,1200))};return l(),()=>{e=!0,clearTimeout(n)}},[t]),(0,a.useEffect)(()=>{let e=v.current;e&&k.current&&(e.scrollTop=e.scrollHeight)},[u]),(0,l.jsxs)("div",{className:"logv",children:[(0,l.jsx)("pre",{ref:v,className:"logv-body mono",style:{height:n},onScroll:()=>{let e=v.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<24;k.current=t,p(!t)},tabIndex:0,children:null===u?d("git.loading"):u.trim()?u:d("obj.logs.empty")}),(0,l.jsxs)("div",{className:"logv-tools",children:[y&&(0,l.jsxs)("button",{className:"btn sm",onClick:()=>{let e=v.current;e&&(e.scrollTop=e.scrollHeight,k.current=!0,p(!1))},children:[(0,l.jsx)(s.A,{size:14}),d("obj.logs.bottom")]}),(0,l.jsx)("button",{className:"btn ghost icon sm",onClick:()=>h(""),"aria-label":d("obj.logs.clear"),title:d("obj.logs.clear"),children:(0,l.jsx)(r.A,{size:14})})]})]})}},80306:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});let l=(0,n(74955).A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},84616:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});let l=(0,n(74955).A)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},87968:()=>{},92605:(e,t,n)=>{Promise.resolve().then(n.bind(n,5506)),Promise.resolve().then(n.t.bind(n,39856,23)),Promise.resolve().then(n.t.bind(n,98682,23)),Promise.resolve().then(n.t.bind(n,15151,23)),Promise.resolve().then(n.t.bind(n,87968,23))},92947:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});let l=(0,n(74955).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},98392:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});let l=(0,n(74955).A)("ArrowDownToLine",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]])},98682:e=>{e.exports={style:{fontFamily:"'Hanken Grotesk', 'Hanken Grotesk Fallback'",fontStyle:"normal"},className:"__className_67a390",variable:"__variable_67a390"}}},e=>{e.O(0,[584,597,586,839,408,89,358],()=>e(e.s=92605)),_N_E=e.O()}]);