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
@@ -1,4 +1,4 @@
1
- (()=>{var a={};a.id=969,a.ids=[969],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1708:a=>{"use strict";a.exports=require("node:process")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3936:(a,b,c)=>{"use strict";c.d(b,{kh:()=>n,rs:()=>o,z6:()=>l});var d=c(55322),e=c(17027),f=c(37322),g=c(60570),h=c(93884),i=c(61162),j=c(54842),k=c(5207);function l(){let[a,b]=(0,e.useState)(null),c=(0,e.useRef)(void 0),g=(0,e.useRef)(!1);g.current=!!a;let h=(0,e.useCallback)((a,d,e)=>{clearTimeout(c.current);let f=()=>b({id:a,rect:d.getBoundingClientRect()});e||g.current?f():c.current=setTimeout(f,280)},[]),i=(0,e.useCallback)(()=>{clearTimeout(c.current),b(null)},[]);return{bind:(0,e.useCallback)(a=>({onMouseEnter:b=>h(a,b.currentTarget,!1),onMouseLeave:i,onFocus:b=>{b.currentTarget.matches(":focus-visible")&&h(a,b.currentTarget,!0)},onBlur:i,onClick:i}),[h,i]),node:a&&"undefined"!=typeof document?(0,f.createPortal)((0,d.jsx)(p,{anchor:a}),document.body):null}}function m({label:a,children:b}){return(0,d.jsxs)("div",{className:"ap-row",children:[(0,d.jsx)("dt",{children:a}),(0,d.jsx)("dd",{children:b})]})}function n({agent:a,hideColony:b=!1}){let{t:c}=(0,h.s9)(),e=(0,g.Tu)(a=>a.agents),f=(0,g.Tu)(a=>a.colonies).find(b=>b.id===a.colony_id),l=(0,j.E)((0,g.M_)(a.id)),n=a.worker_ids.map(a=>e.find(b=>b.id===a)?.name).filter(Boolean),o=e.filter(b=>"orchestrator"===b.role&&b.worker_ids.includes(a.id)).map(a=>a.name),p=a=>a.length>4?`${a.slice(0,4).join(", ")} ${c("hover.more",{count:a.length-4})}`:a.join(", ");return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"ap-head",children:[(0,d.jsx)(k._h,{agent:a}),(0,d.jsxs)("div",{className:"grow",children:[(0,d.jsx)("b",{className:"ap-name",children:a.name}),(0,d.jsxs)("div",{className:"row gap-s wrap mt-s",children:[(0,d.jsx)(k.PW,{role:a.role}),(0,d.jsx)(k.P5,{status:a.status})]})]})]}),(0,d.jsx)("p",{className:`ap-desc ${a.description?"":"muted"}`,children:a.description||c("switcher.noDescription")}),l&&(0,d.jsxs)("div",{className:"ap-now",children:[(0,d.jsx)("i",{className:"dot run"}),l]}),(0,d.jsxs)("dl",{className:"ap-rows",children:[(0,d.jsxs)(m,{label:c("form.provider"),children:[i.xq[a.provider].label,a.model?` \xb7 ${a.model}`:` \xb7 ${c("model.cliDefault")}`]}),(0,d.jsx)(m,{label:c("inherit.permissions"),children:(0,i.Ck)(a.effective.permission)}),(0,d.jsxs)(m,{label:c("colony.folder"),children:[(0,d.jsx)("span",{className:"mono",children:(0,i._1)(a.effective.cwd)}),a.effective.inherited.includes("cwd")&&(0,d.jsxs)("span",{className:"muted",children:[" \xb7 ",c("colony.fromColony")]})]}),!b&&(0,d.jsx)(m,{label:c("form.colony"),children:f?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("i",{className:"cdot",style:{background:f.color||"var(--honey)"}}),f.name]}):(0,d.jsx)("span",{className:"muted",children:c("common.noColony")})}),"orchestrator"===a.role?(0,d.jsx)(m,{label:c("form.team"),children:n.length?p(n):(0,d.jsx)("span",{className:"muted",children:c("colony.noWorkers")})}):(0,d.jsx)(m,{label:c("rel.directedBy"),children:o.length?p(o):(0,d.jsx)("span",{className:"muted",children:c("hover.noOrchestrator")})}),(0,d.jsx)(m,{label:c("colony.session"),children:(0,d.jsx)("span",{className:"mono",children:a.session_id?`${a.session_id.slice(0,12)}…`:c("colony.noSession")})}),(0,d.jsxs)(m,{label:c("agents.col.updated"),children:[(0,i.KN)(a.updated_at),!!a.queued&&a.queued>0&&(0,d.jsxs)("span",{className:"muted",children:[" \xb7 ",c("queue.count",{count:a.queued})]})]})]})]})}function o({target:a,width:b=310,pinned:c=!1,onClose:g,children:h,label:i}){let j=(0,e.useRef)(null),[k,l]=(0,e.useState)(null);return((0,e.useCallback)(()=>{if(!a)return;let c=j.current?.offsetHeight??0,d=a instanceof DOMRect?a:a.getBoundingClientRect(),e=d.right+12+b+8<=window.innerWidth?"right":"left",f="right"===e?d.right+12:Math.max(8,d.left-12-b),g=Math.min(Math.max(8,d.top+d.height/2-c/2),Math.max(8,window.innerHeight-c-8));l(a=>a&&a.left===f&&a.top===g&&a.side===e?a:{left:f,top:g,side:e})},[a,b]),a&&"undefined"!=typeof document)?(0,f.createPortal)((0,d.jsx)("div",{ref:j,className:`ap-card ${c?"pinned":""} ${k?.side??"right"}`,role:c?"complementary":"tooltip","aria-label":i,style:{left:k?.left??-9999,top:k?.top??-9999,width:b,visibility:k?"visible":"hidden"},children:h}),document.body):null}function p({anchor:a}){let b=(0,g.fJ)(a.id);return b?(0,d.jsx)(o,{target:a.rect,children:(0,d.jsx)(n,{agent:b})}):null}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},23124:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(51537).A)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},26530:(a,b,c)=>{Promise.resolve().then(c.bind(c,27769))},26713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},27769:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(85972).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/agents/[id]/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/agents/[id]/page.tsx","default")},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31096:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>bo});var d=c(55322),e=c(97984),f=c(93674),g=c(17027),h=c(91705),i=c.n(h),j=c(66252),k=c(61222),l=c(38550),m=c(89667),n=c(93351),o=c(60570),p=c(7371),q=c(61162),r=c(73269),s=c(90634),t=c(48612),u=c(51537);let v=(0,u.A)("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var w=c(40413),x=c(33165);let y=(0,u.A)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);var z=c(30257),A=c(78574),B=c(18869),C=c(30584),D=c(93884);function E({agent:a,session:b}){let{t:c}=(0,D.s9)(),{finished:e,live:f}=(0,o.o0)(),[h,i]=(0,g.useState)(null),[j,k]=(0,g.useState)(!1);e[a.id];let l=f[a.id];if(!h||0===h.turns&&!l)return null;let m=l?.usage,n=(0,C.RP)(h.usage)+(m?(0,C.RP)({input:m.input??0,output:m.output??0,cacheRead:m.cacheRead??0,cacheWrite:m.cacheWrite??0}):0),p=(h.cost??0)+(l?.cost??0),q=(h.usage.credits??0)+(m?.credits??0),r=m?.contextPct??h.contextPct??(h.lastContext?Math.min(100,h.lastContext/2e5*100):null),s=null!==h.cost||l?.cost!==void 0,t=h.usage,u=Math.max(1,t.input+t.output+t.cacheRead+t.cacheWrite),E=Math.max(1,...h.tools.map(a=>a.count)),F=Math.max(1,...h.timeline.map(a=>a.tokens));return(0,d.jsxs)("div",{className:"stats-wrap",children:[(0,d.jsxs)("button",{className:"statsbar",onClick:()=>k(a=>!a),"aria-expanded":j,children:[(0,d.jsxs)("span",{className:"sb",title:c("stats.contextTitle"),children:[(0,d.jsx)(v,{size:14}),(0,d.jsx)("b",{children:null!==r?`${r.toFixed(+(r<10))}%`:(0,C.yj)(h.lastContext)}),c("stats.context")]}),(0,d.jsxs)("span",{className:"sb",children:[(0,d.jsx)(w.A,{size:14}),(0,d.jsx)("b",{children:(0,C.yj)(n)}),c("stats.tokens")]}),q>0&&(0,d.jsxs)("span",{className:"sb",children:[(0,d.jsx)(x.A,{size:14}),(0,d.jsx)("b",{children:q.toFixed(2)}),c("stats.credits")]}),s&&(0,d.jsxs)("span",{className:"sb",title:h.costEstimated?c("stats.costEstimated"):c("stats.costReported"),children:[(0,d.jsx)(x.A,{size:14}),(0,d.jsxs)("b",{children:[h.costEstimated?"≈ ":"",(0,C.F0)(p)]})]}),(0,d.jsxs)("span",{className:"sb",children:[(0,d.jsx)(y,{size:14}),(0,d.jsx)("b",{children:h.turns}),c("stats.turns",{count:h.turns})]}),(0,d.jsxs)("span",{className:"sb",children:[(0,d.jsx)(z.A,{size:14}),(0,d.jsx)("b",{children:h.toolCalls}),c("stats.toolCalls",{count:h.toolCalls}),h.toolErrors>0&&(0,d.jsxs)("em",{className:"tbad",children:[" \xb7 ",c("stats.failed",{count:h.toolErrors})]})]}),h.durationMs>0&&(0,d.jsxs)("span",{className:"sb",children:[(0,d.jsx)(A.A,{size:14}),(0,d.jsx)("b",{children:(0,C.nc)(h.durationMs)}),c("stats.working")]}),(0,d.jsx)(B.A,{size:15,className:`chev2 ${j?"open":""}`})]}),j&&(0,d.jsxs)("div",{className:"statspanel",children:[(0,d.jsxs)("section",{children:[(0,d.jsx)("div",{className:"eyebrow",children:c("stats.mix")}),(0,d.jsxs)("div",{className:"mixbar",role:"img","aria-label":c("stats.mix"),children:[(0,d.jsx)("i",{className:"fa-c-cr",style:{width:`${t.cacheRead/u*100}%`}}),(0,d.jsx)("i",{className:"fa-c-cw",style:{width:`${t.cacheWrite/u*100}%`}}),(0,d.jsx)("i",{className:"fa-c-in",style:{width:`${t.input/u*100}%`}}),(0,d.jsx)("i",{className:"fa-c-out",style:{width:`${t.output/u*100}%`}})]}),(0,d.jsxs)("dl",{className:"legend",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("i",{className:"fa-c-cr"}),(0,d.jsx)("dt",{children:c("stats.cacheRead")}),(0,d.jsx)("dd",{children:(0,C.yj)(t.cacheRead)})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("i",{className:"fa-c-cw"}),(0,d.jsx)("dt",{children:c("stats.cacheWrite")}),(0,d.jsx)("dd",{children:(0,C.yj)(t.cacheWrite)})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("i",{className:"fa-c-in"}),(0,d.jsx)("dt",{children:c("stats.input")}),(0,d.jsx)("dd",{children:(0,C.yj)(t.input)})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("i",{className:"fa-c-out"}),(0,d.jsx)("dt",{children:c("stats.output")}),(0,d.jsxs)("dd",{children:[(0,C.yj)(t.output),t.reasoning>0&&(0,d.jsxs)("span",{className:"muted",children:[" (",c("stats.thinking",{tokens:(0,C.yj)(t.reasoning)}),")"]})]})]})]}),h.models.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"eyebrow mt-m",children:c("stats.models")}),h.models.map(a=>(0,d.jsxs)("div",{className:"row small between",children:[(0,d.jsx)("span",{className:"mono",children:a.model}),(0,d.jsx)("span",{className:"muted",children:c("stats.modelLine",{count:a.messages,out:(0,C.yj)(a.output)})})]},a.model))]})]}),(0,d.jsxs)("section",{children:[(0,d.jsxs)("div",{className:"eyebrow",children:[c("stats.toolsUsed")," ",h.toolTimeMs>0&&(0,d.jsxs)("span",{className:"muted",children:["\xb7 ",c("stats.totalTime",{time:(0,C.nc)(h.toolTimeMs)})]})]}),0===h.tools.length?(0,d.jsx)("p",{className:"muted small m0 mt-s",children:c("stats.noTools")}):h.tools.slice(0,9).map(a=>(0,d.jsxs)("div",{className:"toolrow",title:c("stats.toolTitle",{count:a.count,time:(0,C.nc)(a.totalMs)}),children:[(0,d.jsx)("span",{className:"mono tn",children:a.name.replace(/^mcp__/,"").replace("__"," \xb7 ")}),(0,d.jsx)("span",{className:"tbar",children:(0,d.jsx)("i",{style:{width:`${a.count/E*100}%`}})}),(0,d.jsxs)("span",{className:"tc",children:[a.count,a.errors>0&&(0,d.jsxs)("em",{className:"tbad",children:[" (",a.errors,"✗)"]})]}),(0,d.jsx)("span",{className:"td muted",children:a.totalMs?(0,C.nc)(a.totalMs/a.count):""})]},a.name))]}),(0,d.jsxs)("section",{className:"fa-span",children:[(0,d.jsx)("div",{className:"eyebrow",children:c("stats.perTurn")}),(0,d.jsx)("div",{className:"spark",role:"list",children:h.timeline.slice(-40).map((a,b)=>(0,d.jsx)("div",{className:"sbar",role:"listitem",title:`${a.prompt||c("stats.promptFallback")}
1
+ (()=>{var a={};a.id=969,a.ids=[969],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1708:a=>{"use strict";a.exports=require("node:process")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3936:(a,b,c)=>{"use strict";c.d(b,{kh:()=>n,rs:()=>o,z6:()=>l});var d=c(55322),e=c(17027),f=c(37322),g=c(60570),h=c(93884),i=c(61162),j=c(54842),k=c(5207);function l(){let[a,b]=(0,e.useState)(null),c=(0,e.useRef)(void 0),g=(0,e.useRef)(!1);g.current=!!a;let h=(0,e.useCallback)((a,d,e)=>{clearTimeout(c.current);let f=()=>b({id:a,rect:d.getBoundingClientRect()});e||g.current?f():c.current=setTimeout(f,280)},[]),i=(0,e.useCallback)(()=>{clearTimeout(c.current),b(null)},[]);return{bind:(0,e.useCallback)(a=>({onMouseEnter:b=>h(a,b.currentTarget,!1),onMouseLeave:i,onFocus:b=>{b.currentTarget.matches(":focus-visible")&&h(a,b.currentTarget,!0)},onBlur:i,onClick:i}),[h,i]),node:a&&"undefined"!=typeof document?(0,f.createPortal)((0,d.jsx)(p,{anchor:a}),document.body):null}}function m({label:a,children:b}){return(0,d.jsxs)("div",{className:"ap-row",children:[(0,d.jsx)("dt",{children:a}),(0,d.jsx)("dd",{children:b})]})}function n({agent:a,hideColony:b=!1}){let{t:c}=(0,h.s9)(),e=(0,g.Tu)(a=>a.agents),f=(0,g.Tu)(a=>a.colonies).find(b=>b.id===a.colony_id),l=(0,j.E)((0,g.M_)(a.id)),n=a.worker_ids.map(a=>e.find(b=>b.id===a)?.name).filter(Boolean),o=e.filter(b=>"orchestrator"===b.role&&b.worker_ids.includes(a.id)).map(a=>a.name),p=a=>a.length>4?`${a.slice(0,4).join(", ")} ${c("hover.more",{count:a.length-4})}`:a.join(", ");return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"ap-head",children:[(0,d.jsx)(k._h,{agent:a}),(0,d.jsxs)("div",{className:"grow",children:[(0,d.jsx)("b",{className:"ap-name",children:a.name}),(0,d.jsxs)("div",{className:"row gap-s wrap mt-s",children:[(0,d.jsx)(k.PW,{role:a.role}),(0,d.jsx)(k.P5,{status:a.status})]})]})]}),(0,d.jsx)("p",{className:`ap-desc ${a.description?"":"muted"}`,children:a.description||c("switcher.noDescription")}),l&&(0,d.jsxs)("div",{className:"ap-now",children:[(0,d.jsx)("i",{className:"dot run"}),l]}),(0,d.jsxs)("dl",{className:"ap-rows",children:[(0,d.jsxs)(m,{label:c("form.provider"),children:[i.xq[a.provider].label,a.model?` \xb7 ${a.model}`:` \xb7 ${c("model.cliDefault")}`]}),(0,d.jsx)(m,{label:c("inherit.permissions"),children:(0,i.Ck)(a.effective.permission)}),(0,d.jsxs)(m,{label:c("colony.folder"),children:[(0,d.jsx)("span",{className:"mono",children:(0,i._1)(a.effective.cwd)}),a.effective.inherited.includes("cwd")&&(0,d.jsxs)("span",{className:"muted",children:[" \xb7 ",c("colony.fromColony")]})]}),!b&&(0,d.jsx)(m,{label:c("form.colony"),children:f?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("i",{className:"cdot",style:{background:f.color||"var(--honey)"}}),f.name]}):(0,d.jsx)("span",{className:"muted",children:c("common.noColony")})}),"orchestrator"===a.role?(0,d.jsx)(m,{label:c("form.team"),children:n.length?p(n):(0,d.jsx)("span",{className:"muted",children:c("colony.noWorkers")})}):(0,d.jsx)(m,{label:c("rel.directedBy"),children:o.length?p(o):(0,d.jsx)("span",{className:"muted",children:c("hover.noOrchestrator")})}),(0,d.jsx)(m,{label:c("colony.session"),children:(0,d.jsx)("span",{className:"mono",children:a.session_id?`${a.session_id.slice(0,12)}…`:c("colony.noSession")})}),(0,d.jsxs)(m,{label:c("agents.col.updated"),children:[(0,i.KN)(a.updated_at),!!a.queued&&a.queued>0&&(0,d.jsxs)("span",{className:"muted",children:[" \xb7 ",c("queue.count",{count:a.queued})]})]})]})]})}function o({target:a,width:b=310,pinned:c=!1,onClose:g,children:h,label:i}){let j=(0,e.useRef)(null),[k,l]=(0,e.useState)(null);return((0,e.useCallback)(()=>{if(!a)return;let c=j.current?.offsetHeight??0,d=a instanceof DOMRect?a:a.getBoundingClientRect(),e=d.right+12+b+8<=window.innerWidth?"right":"left",f="right"===e?d.right+12:Math.max(8,d.left-12-b),g=Math.min(Math.max(8,d.top+d.height/2-c/2),Math.max(8,window.innerHeight-c-8));l(a=>a&&a.left===f&&a.top===g&&a.side===e?a:{left:f,top:g,side:e})},[a,b]),a&&"undefined"!=typeof document)?(0,f.createPortal)((0,d.jsx)("div",{ref:j,className:`ap-card ${c?"pinned":""} ${k?.side??"right"}`,role:c?"complementary":"tooltip","aria-label":i,style:{left:k?.left??-9999,top:k?.top??-9999,width:b,visibility:k?"visible":"hidden"},children:h}),document.body):null}function p({anchor:a}){let b=(0,g.fJ)(a.id);return b?(0,d.jsx)(o,{target:a.rect,children:(0,d.jsx)(n,{agent:b})}):null}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},23124:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(51537).A)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},26530:(a,b,c)=>{Promise.resolve().then(c.bind(c,27769))},26713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},27769:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(85972).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/agents/[id]/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/agents/[id]/page.tsx","default")},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31096:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>bo});var d=c(55322),e=c(97984),f=c(93674),g=c(17027),h=c(91705),i=c.n(h),j=c(66252),k=c(61222),l=c(38550),m=c(89667),n=c(93351),o=c(60570),p=c(7371),q=c(61162),r=c(73269),s=c(90634),t=c(48612),u=c(51537);let v=(0,u.A)("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var w=c(40413),x=c(33165);let y=(0,u.A)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);var z=c(30257),A=c(78574),B=c(18869),C=c(30584),D=c(93884);function E({agent:a,session:b}){let{t:c}=(0,D.s9)(),{finished:e,live:f}=(0,o.o0)(),[h,i]=(0,g.useState)(null),[j,k]=(0,g.useState)(!1);e[a.id];let l=f[a.id];if(!h||0===h.turns&&!l)return null;let m=l?.usage,n=(0,C.RP)(h.usage)+(m?(0,C.RP)({input:m.input??0,output:m.output??0,cacheRead:m.cacheRead??0,cacheWrite:m.cacheWrite??0}):0),p=(h.cost??0)+(l?.cost??0),q=(h.usage.credits??0)+(m?.credits??0),r=m?.contextPct??h.contextPct??(h.lastContext?Math.min(100,h.lastContext/2e5*100):null),s=null!==h.cost||l?.cost!==void 0,t=h.usage,u=Math.max(1,t.input+t.output+t.cacheRead+t.cacheWrite),E=Math.max(1,...h.tools.map(a=>a.count)),F=Math.max(1,...h.timeline.map(a=>a.tokens));return(0,d.jsxs)("div",{className:"stats-wrap",children:[(0,d.jsxs)("button",{className:"statsbar",onClick:()=>k(a=>!a),"aria-expanded":j,children:[(0,d.jsxs)("span",{className:"sb",title:c("stats.contextTitle"),children:[(0,d.jsx)(v,{size:14}),(0,d.jsx)("b",{children:null!==r?`${r.toFixed(+(r<10))}%`:(0,C.yj)(h.lastContext)}),c("stats.context")]}),(0,d.jsxs)("span",{className:"sb",children:[(0,d.jsx)(w.A,{size:14}),(0,d.jsx)("b",{children:(0,C.yj)(n)}),c("stats.tokens")]}),q>0&&(0,d.jsxs)("span",{className:"sb",children:[(0,d.jsx)(x.A,{size:14}),(0,d.jsx)("b",{children:q.toFixed(2)}),c("stats.credits")]}),s&&(0,d.jsxs)("span",{className:"sb",title:h.costEstimated?c("stats.costEstimated"):c("stats.costReported"),children:[(0,d.jsx)(x.A,{size:14}),(0,d.jsxs)("b",{children:[h.costEstimated?"≈ ":"",(0,C.F0)(p)]})]}),(0,d.jsxs)("span",{className:"sb",children:[(0,d.jsx)(y,{size:14}),(0,d.jsx)("b",{children:h.turns}),c("stats.turns",{count:h.turns})]}),(0,d.jsxs)("span",{className:"sb",children:[(0,d.jsx)(z.A,{size:14}),(0,d.jsx)("b",{children:h.toolCalls}),c("stats.toolCalls",{count:h.toolCalls}),h.toolErrors>0&&(0,d.jsxs)("em",{className:"tbad",children:[" \xb7 ",c("stats.failed",{count:h.toolErrors})]})]}),h.durationMs>0&&(0,d.jsxs)("span",{className:"sb",children:[(0,d.jsx)(A.A,{size:14}),(0,d.jsx)("b",{children:(0,C.nc)(h.durationMs)}),c("stats.working")]}),(0,d.jsx)(B.A,{size:15,className:`chev2 ${j?"open":""}`})]}),j&&(0,d.jsxs)("div",{className:"statspanel",children:[(0,d.jsxs)("section",{children:[(0,d.jsx)("div",{className:"eyebrow",children:c("stats.mix")}),(0,d.jsxs)("div",{className:"mixbar",role:"img","aria-label":c("stats.mix"),children:[(0,d.jsx)("i",{className:"fa-c-cr",style:{width:`${t.cacheRead/u*100}%`}}),(0,d.jsx)("i",{className:"fa-c-cw",style:{width:`${t.cacheWrite/u*100}%`}}),(0,d.jsx)("i",{className:"fa-c-in",style:{width:`${t.input/u*100}%`}}),(0,d.jsx)("i",{className:"fa-c-out",style:{width:`${t.output/u*100}%`}})]}),(0,d.jsxs)("dl",{className:"legend",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("i",{className:"fa-c-cr"}),(0,d.jsx)("dt",{children:c("stats.cacheRead")}),(0,d.jsx)("dd",{children:(0,C.yj)(t.cacheRead)})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("i",{className:"fa-c-cw"}),(0,d.jsx)("dt",{children:c("stats.cacheWrite")}),(0,d.jsx)("dd",{children:(0,C.yj)(t.cacheWrite)})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("i",{className:"fa-c-in"}),(0,d.jsx)("dt",{children:c("stats.input")}),(0,d.jsx)("dd",{children:(0,C.yj)(t.input)})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("i",{className:"fa-c-out"}),(0,d.jsx)("dt",{children:c("stats.output")}),(0,d.jsxs)("dd",{children:[(0,C.yj)(t.output),t.reasoning>0&&(0,d.jsxs)("span",{className:"muted",children:[" (",c("stats.thinking",{tokens:(0,C.yj)(t.reasoning)}),")"]})]})]})]}),h.models.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"eyebrow mt-m",children:c("stats.models")}),h.models.map(a=>(0,d.jsxs)("div",{className:"row small between",children:[(0,d.jsx)("span",{className:"mono",children:a.model}),(0,d.jsx)("span",{className:"muted",children:c("stats.modelLine",{count:a.messages,out:(0,C.yj)(a.output)})})]},a.model))]})]}),(0,d.jsxs)("section",{children:[(0,d.jsxs)("div",{className:"eyebrow",children:[c("stats.toolsUsed")," ",h.toolTimeMs>0&&(0,d.jsxs)("span",{className:"muted",children:["\xb7 ",c("stats.totalTime",{time:(0,C.nc)(h.toolTimeMs)})]})]}),0===h.tools.length?(0,d.jsx)("p",{className:"muted small m0 mt-s",children:c("stats.noTools")}):h.tools.slice(0,9).map(a=>(0,d.jsxs)("div",{className:"toolrow",title:c("stats.toolTitle",{count:a.count,time:(0,C.nc)(a.totalMs)}),children:[(0,d.jsx)("span",{className:"mono tn",children:a.name.replace(/^mcp__/,"").replace("__"," \xb7 ")}),(0,d.jsx)("span",{className:"tbar",children:(0,d.jsx)("i",{style:{width:`${a.count/E*100}%`}})}),(0,d.jsxs)("span",{className:"tc",children:[a.count,a.errors>0&&(0,d.jsxs)("em",{className:"tbad",children:[" (",a.errors,"✗)"]})]}),(0,d.jsx)("span",{className:"td muted",children:a.totalMs?(0,C.nc)(a.totalMs/a.count):""})]},a.name))]}),(0,d.jsxs)("section",{className:"fa-span",children:[(0,d.jsx)("div",{className:"eyebrow",children:c("stats.perTurn")}),(0,d.jsx)("div",{className:"tbars",role:"list",children:h.timeline.slice(-40).map((a,b)=>(0,d.jsx)("div",{className:"sbar",role:"listitem",title:`${a.prompt||c("stats.promptFallback")}
2
2
  ${c("stats.turnLine",{tokens:(0,C.yj)(a.tokens),tools:a.tools,time:(0,C.nc)(a.durationMs)})}${null!==a.cost?` \xb7 ${(0,C.F0)(a.cost)}`:""}`,children:(0,d.jsx)("i",{style:{height:`${Math.max(4,a.tokens/F*100)}%`}})},b))})]})]})]})}var F=c(68364),G=c(77790),H=c(71267),I=c(16487),J=c(54842),K=c(3936),L=c(5207),M=c(36143);function N({activeId:a,collapsed:b=!1,onToggle:c}){let{t:e}=(0,D.s9)(),{agents:f,colonies:h,live:j}=(0,o.o0)(),k=(0,K.z6)(),[l,m]=(0,g.useState)(""),[n,p]=(0,g.useState)(!1),r=(0,g.useMemo)(()=>{let a=a=>!l||`${a.name} ${a.description} ${a.provider} ${a.model}`.toLowerCase().includes(l.toLowerCase()),b=h.map(b=>({key:b.id,name:b.name,color:b.color||"var(--honey)",items:f.filter(c=>c.colony_id===b.id&&a(c))}));return b.push({key:"free",name:e("common.noColony"),color:null,items:f.filter(b=>(!b.colony_id||!h.some(a=>a.id===b.colony_id))&&a(b))}),b.filter(a=>a.items.length)},[f,h,l,e]),s=c&&(0,d.jsx)("button",{className:"btn ghost icon sm",onClick:c,"aria-label":b?e("switcher.expand"):e("switcher.collapse"),title:b?e("switcher.expand"):e("switcher.collapse"),"aria-expanded":!b,children:b?(0,d.jsx)(F.A,{size:17}):(0,d.jsx)(G.A,{size:17})});return b?(0,d.jsxs)("aside",{className:"switcher mini","aria-label":e("nav.agents"),children:[(0,d.jsxs)("div",{className:"switcher-head",children:[s,(0,d.jsx)("button",{className:"btn ghost icon sm",onClick:()=>p(!0),"aria-label":e("newAgent.title"),title:e("newAgent.title"),children:(0,d.jsx)(H.A,{size:16})})]}),(0,d.jsx)("div",{className:"switcher-list",children:r.map(b=>(0,d.jsxs)("div",{className:"mini-group",children:[(0,d.jsx)("div",{className:"mini-sep",title:`${b.name} \xb7 ${b.items.length}`,style:b.color?{"--c":b.color}:void 0}),b.items.map(b=>(0,d.jsx)(i(),{href:`/agents/${b.id}`,className:"sw-item mini","aria-current":b.id===a?"page":void 0,"aria-label":b.name,...k.bind(b.id),children:(0,d.jsxs)("span",{className:"sw-av",children:[(0,d.jsx)(L._h,{agent:b}),"idle"!==b.status&&(0,d.jsx)("i",{className:`pip ${"error"===b.status?"err":""}`})]})},b.id))]},b.key))}),n&&(0,d.jsx)(M.b,{onClose:()=>p(!1)}),k.node]}):(0,d.jsxs)("aside",{className:"switcher","aria-label":e("nav.agents"),children:[(0,d.jsxs)("div",{className:"switcher-head",children:[(0,d.jsxs)("div",{className:"row",children:[(0,d.jsx)("b",{style:{fontFamily:"var(--font-display)",fontSize:16},className:"grow",children:e("nav.agents")}),s,(0,d.jsx)("button",{className:"btn ghost icon sm",onClick:()=>p(!0),"aria-label":e("newAgent.title"),children:(0,d.jsx)(H.A,{size:16})})]}),(0,d.jsxs)("div",{className:"search",children:[(0,d.jsx)(I.A,{size:15}),(0,d.jsx)("input",{className:"input",placeholder:e("switcher.find"),value:l,onChange:a=>m(a.target.value),"aria-label":e("switcher.find")})]})]}),(0,d.jsxs)("div",{className:"switcher-list",children:[0===r.length&&(0,d.jsx)("p",{className:"muted small",style:{padding:16},children:e("switcher.noMatch",{query:l})}),r.map(b=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"switcher-group",children:[b.color&&(0,d.jsx)("i",{className:"cdot",style:{background:b.color}}),b.name,(0,d.jsx)("span",{children:b.items.length})]}),b.items.map(b=>{let c=(0,J.E)(j[b.id]);return(0,d.jsxs)(i(),{href:`/agents/${b.id}`,className:"sw-item","aria-current":b.id===a?"page":void 0,...k.bind(b.id),children:[(0,d.jsxs)("span",{className:"sw-av",children:[(0,d.jsx)(L._h,{agent:b}),"idle"!==b.status&&(0,d.jsx)("i",{className:`pip ${"error"===b.status?"err":""}`})]}),(0,d.jsxs)("span",{className:"sw-body",children:[(0,d.jsxs)("span",{className:"sw-top",children:[(0,d.jsx)("b",{children:b.name}),"orchestrator"===b.role&&(0,d.jsx)("em",{children:e("role.orchestrator")})]}),(0,d.jsx)("span",{className:`sw-sub ${c?"live":b.description?"":"blank"}`,children:c??("error"===b.status?e("status.error"):b.description||e("switcher.noDescription"))}),(0,d.jsxs)("span",{className:"sw-meta",children:[(0,d.jsx)("i",{style:{background:q.xq[b.provider].color}}),q.xq[b.provider].short,b.model?` \xb7 ${b.model}`:"",(0,d.jsx)("span",{className:"sw-ago",children:b.queued&&b.queued>0?e("queue.count",{count:b.queued}):(0,q.KN)(b.updated_at)})]})]})]},b.id)})]},b.key))]}),n&&(0,d.jsx)(M.b,{onClose:()=>p(!1)}),k.node]})}var O=c(4111),P=c(77671);let Q=(0,u.A)("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);var R=c(29083);let S=(0,u.A)("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);var T=c(19993);let U=(0,u.A)("TextSearch",[["path",{d:"M21 6H3",key:"1jwq7v"}],["path",{d:"M10 12H3",key:"1ulcyk"}],["path",{d:"M10 18H3",key:"13769t"}],["circle",{cx:"17",cy:"15",r:"3",key:"1upz2a"}],["path",{d:"m21 19-1.9-1.9",key:"dwi7p8"}]]),V=(0,u.A)("ListFilter",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);function W(a,b,c=[],d={}){let e=new Map(b.map(a=>[a.path,a])),f=new Set(a);for(let a of b)f.add(a.path);let g={name:"",path:"",type:"dir",children:[],changed:0,additions:0,deletions:0},h=new Map([["",g]]),i=a=>{let b=h.get(a);if(b)return b;let c=a.lastIndexOf("/"),d=i(c<0?"":a.slice(0,c)),e={name:a.slice(c+1),path:a,type:"dir",children:[],changed:0,additions:0,deletions:0};return d.children.push(e),h.set(a,e),e};for(let a of f){let b=a.lastIndexOf("/");i(b<0?"":a.slice(0,b)).children.push({name:a.slice(b+1),path:a,type:"file",children:[],change:e.get(a),changed:+!!e.has(a),additions:e.get(a)?.additions??0,deletions:e.get(a)?.deletions??0})}let j=(a,b,c)=>{if(a.children.some(a=>a.path===b))return;let e={name:b.slice(b.lastIndexOf("/")+1),path:b,type:c?"dir":"file",children:[],ignored:!0,lazy:c&&!(b in d),changed:0,additions:0,deletions:0};if(a.children.push(e),c&&h.set(b,e),c)for(let a of d[b]??[])j(e,`${b}/${a.name}`,a.dir)};for(let a of c){let b=a.endsWith("/"),c=b?a.slice(0,-1):a,d=c.lastIndexOf("/");j(i(d<0?"":c.slice(0,d)),c,b)}let k=a=>{for(let b of(a.children.sort((a,b)=>a.type===b.type?a.name.localeCompare(b.name):"dir"===a.type?-1:1),a.children))"dir"===b.type&&k(b),a.changed+=(b.type,b.changed),a.additions+=b.additions,a.deletions+=b.deletions;a.children=a.children.map(a=>{let b=a;for(;"dir"===b.type&&1===b.children.length&&"dir"===b.children[0].type;){let a=b.children[0];b={...a,name:`${b.name}/${a.name}`}}return b})};return k(g),g}function X(a,b,c){let d=c.query.trim().toLowerCase(),e=a=>(!c.onlyChanged||0!==a.changed)&&(!d||("file"===a.type?a.path.toLowerCase().includes(d):a.children.some(e))),f=[],g=(a,h)=>{for(let i of a.children)e(i)&&(f.push({node:i,depth:h}),"dir"===i.type&&(d||c.onlyChanged||b.has(i.path))&&g(i,h+1))};return g(a,0),f}var Y=c(2335),Z=c(8776),$=c(48838);let _=(0,u.A)("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var aa=c(94788),ab=c(37070),ac=c(31826);let ad=/\.(png|jpe?g|gif|webp|svg|ico|bmp|avif)$/i,ae=/\.(md|markdown|mdx)$/i;var af=c(23124),ag=c(31251);function ah(a){let b={meta:[],hunks:[],binary:!1},c=null,d=0,e=0;for(let f of a.split("\n")){let a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@ ?(.*)$/.exec(f);if(a){d=Number(a[1]),e=Number(a[2]),c={header:f,section:a[3]??"",lines:[]},b.hunks.push(c);continue}if(!c){/^Binary files .* differ$/.test(f)||f.startsWith("GIT binary patch")?b.binary=!0:(/^(rename|copy) (from|to) /.test(f)||/^(new|deleted) file mode/.test(f)||/^similarity index/.test(f))&&b.meta.push(f);continue}let g=f[0];if("+"===g)c.lines.push({kind:"add",newNo:e++,text:f.slice(1)});else if("-"===g)c.lines.push({kind:"del",oldNo:d++,text:f.slice(1)});else if(" "===g)c.lines.push({kind:"ctx",oldNo:d++,newNo:e++,text:f.slice(1)});else if("\\"===g){let a=c.lines[c.lines.length-1];a&&(a.noEol=!0)}}return b}let ai=a=>/^(@@ [^@]+@@)/.exec(a)?.[1]??a;var aj=c(74854),ak=c(70014),al=c(61593),am=c(26596),an=c(21975);let ao=(0,g.memo)(function({row:a,path:b,ws:c,actions:e,picking:f,onPick:g}){let{t:h}=(0,D.s9)();if("hunk"===a.t)return(0,d.jsxs)("div",{className:"vl-row hunk",children:[(0,d.jsx)("div",{className:"vl-ln",style:{left:0},children:"⋯"}),(0,d.jsx)("div",{className:"vl-ln",style:{left:"calc(6ch + 16px)"},children:"⋯"}),(0,d.jsxs)("div",{className:"vl-hl",children:[(0,d.jsx)("span",{className:"rng mono",children:a.header}),a.section&&(0,d.jsx)("span",{className:"hs",title:a.section,children:a.section}),e&&f?.hunk===a.idx?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{type:"button",className:"hk-btn on",onClick:()=>e.pickAll(a.idx,a.changed),children:h("git.discard.lines.all")}),(0,d.jsxs)("button",{type:"button",className:"hk-btn danger on",disabled:!f.picked.size,onClick:()=>e.discardPicked(a.idx,a.header),children:[(0,d.jsx)(S,{size:12}),h("git.discard.lines.go",{count:f.picked.size})]}),(0,d.jsx)("button",{type:"button",className:"hk-btn on",onClick:e.stopPicking,children:h("common.cancel")})]}):e&&(0,d.jsxs)(d.Fragment,{children:[a.changed>0&&e.canPick&&(0,d.jsxs)("button",{type:"button",className:"hk-btn",title:h("git.discard.lines.hint"),onClick:()=>e.startPicking(a.idx),children:[(0,d.jsx)(al.A,{size:12}),h("git.discard.lines")]}),(0,d.jsxs)("button",{type:"button",className:"hk-btn",title:h("git.discard.hunk.hint"),onClick:()=>e.discardHunk(a.idx,a.header),children:[(0,d.jsx)(S,{size:12}),h("git.discard.hunk")]})]})]})]});if("line"===a.t){let e=a.l;return(0,d.jsxs)("div",{className:`vl-row ${e.kind} ${g&&void 0!==a.k&&f?.picked.has(a.k)?"picked":""}`,onClick:g&&void 0!==a.k?()=>g(a.k):void 0,children:[(0,d.jsx)("div",{className:"vl-ln",style:{left:0},children:e.oldNo??""}),(0,d.jsx)("div",{className:"vl-ln",style:{left:"calc(6ch + 16px)"},children:e.newNo??""}),(0,d.jsx)("div",{className:"vl-sg",children:g&&void 0!==a.k?(0,d.jsx)("input",{type:"checkbox",checked:!!f?.picked.has(a.k),onChange:()=>void 0,"aria-label":h("git.discard.lines.pick")}):"add"===e.kind?"+":"del"===e.kind?"−":""}),(0,d.jsx)("div",{className:"vl-cd",children:(0,d.jsx)(ak.SH,{text:e.text,path:b,ws:c})})]})}let{left:i,right:j}=a.r;return(0,d.jsxs)("div",{className:"vl-row split",children:[(0,d.jsx)("div",{className:`vl-ln ${i?.kind??"void"}`,style:{left:0},children:i?.oldNo??""}),(0,d.jsx)("div",{className:`vl-cd ${i?.kind??"void"}`,title:i&&i.text.length>60?i.text:void 0,children:i?(0,d.jsx)(ak.SH,{text:i.text,path:b,ws:c}):null}),(0,d.jsx)("div",{className:`vl-ln ${j?.kind??"void"}`,children:j?.newNo??""}),(0,d.jsx)("div",{className:`vl-cd ${j?.kind??"void"}`,title:j&&j.text.length>60?j.text:void 0,children:j?(0,d.jsx)(ak.SH,{text:j.text,path:b,ws:c}):null})]})});function ap({parsed:a,layout:b,path:c,cutOff:e=!1,firstIndex:f=0,onDiscardHunk:h,onDiscardLines:i}){let{whitespace:j}=(0,Z.Wx)(),k=(0,g.useMemo)(()=>(function(a,b,c,d=0){let e=[],f=(0,am.KJ)(c);return a.hunks.forEach((a,c)=>{e.push({t:"hunk",idx:c+d,header:ai(a.header),section:f?a.section:"",changed:a.lines.filter(a=>"ctx"!==a.kind).length});let g=0;if("unified"===b)for(let b of a.lines)e.push({t:"line",l:b,hunk:c+d,k:"ctx"===b.kind?void 0:g++});else for(let b of function(a){let b=[];for(let c=0;c<a.length;){let d=a[c];if("ctx"===d.kind){b.push({left:d,right:d}),c++;continue}let e=[],f=[];for(;c<a.length&&"del"===a[c].kind;)e.push(a[c++]);for(;c<a.length&&"add"===a[c].kind;)f.push(a[c++]);for(let a=0;a<Math.max(e.length,f.length);a++)b.push({left:e[a],right:f[a]})}return b}(a.lines))e.push({t:"pair",r:b})}),e})(a,b,c,f),[a,b,c,f]),l=(0,g.useMemo)(()=>a.hunks.reduce((a,b)=>b.lines.reduce((a,b)=>Math.max(a,b.text.length),a),0),[a]),m="unified"===b?`calc(12ch + 32px + 18px + ${l}ch + 24px)`:void 0,n=(0,g.useRef)(null),o=(0,g.useRef)(null),[p,q]=(0,g.useState)({max:0,track:0}),[r,s]=(0,g.useState)(null),t=a=>s(b=>{if(!b)return b;let c=new Set(b.picked);return c.has(a)?c.delete(a):c.add(a),{...b,picked:c}}),u=h?{canPick:"unified"===b&&!!i,discardHunk:h,startPicking:a=>s({hunk:a,picked:new Set}),stopPicking:()=>s(null),pickAll:(a,b)=>s({hunk:a,picked:new Set(Array.from({length:b},(a,b)=>b))}),discardPicked:(a,b)=>{if(r&&i){let c=[...r.picked].sort((a,b)=>a-b);s(null),i(a,b,c)}}}:void 0;return(0,d.jsxs)("div",{className:`vf is-${b}`,ref:n,style:{"--vl-left":"0px","--hx":"0px"},children:[a.meta.length>0&&(0,d.jsx)("div",{className:"gx-meta",children:a.meta.join(" \xb7 ")}),(0,d.jsx)("div",{className:"vf-main",children:(0,d.jsx)(an.T,{count:k.length,width:m,render:b=>{let f=k[b],g="line"===f.t&&r?.hunk===f.hunk;return(0,d.jsx)(ao,{row:f,path:c,ws:j,actions:"hunk"!==f.t||e&&f.idx===a.hunks.length-1?void 0:u,picking:"hunk"===f.t||g?r:void 0,onPick:g?t:void 0},b)}})}),"split"===b&&p.max>0&&(0,d.jsx)("div",{className:"hbar",ref:o,onScroll:a=>n.current?.style.setProperty("--hx",`${a.currentTarget.scrollLeft}px`),"aria-label":"Scroll sideways",children:(0,d.jsx)("div",{style:{width:p.track+p.max,height:1}})})]})}function aq({path:a,hunk:b,index:c,total:e,extent:f,onClose:h,onGo:i}){let{t:j}=(0,D.s9)(),k=(0,g.useMemo)(()=>({meta:[],hunks:[b],binary:!1}),[b]),l=b.lines.length+1;return(0,d.jsxs)("div",{className:"vl-peek",role:"dialog","aria-label":j("git.peek.title"),onClick:a=>a.stopPropagation(),children:[(0,d.jsxs)("div",{className:"vl-peek-head",children:[(0,d.jsx)("b",{children:f?f.from===f.to?j("git.peek.line",{n:f.from}):j("git.peek.lines",{from:f.from,to:f.to}):j("git.peek.title")}),(0,d.jsx)("span",{className:"muted mono small grow",children:ai(b.header)}),(0,d.jsx)("span",{className:"small muted",children:j("git.peek.count",{n:c+1,total:e})}),(0,d.jsx)("button",{type:"button",className:"btn ghost icon sm",disabled:c<=0,onClick:()=>i(c-1),"aria-label":j("git.peek.prev"),title:`${j("git.peek.prev")} (Alt+↑)`,children:(0,d.jsx)(af.A,{size:15})}),(0,d.jsx)("button",{type:"button",className:"btn ghost icon sm",disabled:c>=e-1,onClick:()=>i(c+1),"aria-label":j("git.peek.next"),title:`${j("git.peek.next")} (Alt+↓)`,children:(0,d.jsx)(B.A,{size:15})}),(0,d.jsx)("button",{type:"button",className:"btn ghost icon sm",onClick:h,"aria-label":j("common.close"),children:(0,d.jsx)(ag.A,{size:14})})]}),(0,d.jsx)("div",{className:"vl-peek-body",style:{height:Math.min(l*an.U+4,260)},children:(0,d.jsx)(ap,{parsed:k,layout:"unified",path:a,firstIndex:c})})]})}function ar({f:a,agent:b,blame:c,onOpenCommit:e,marks:f,allNew:h,focusLine:i}){let j=f?.groups??[],[k,l]=(0,g.useState)(null),m=(0,g.useMemo)(()=>{let b=a.content.split("\n").length;return j.map(a=>({from:Math.min(a.from,b),to:Math.min(a.to,b)}))},[j,a.content]),n=k?m[k.block]??null:null,[o,p]=(0,g.useState)(),r=(b,c)=>{let d={from:b.from,to:Math.min(b.to,a.content.split("\n").length)};return(d.to-(c+1)<=25?Math.max(d.to,c+1):c+1)*an.U},s=a=>34+Math.min((a.view.lines.length+1)*an.U+4,260)+14,{t}=(0,D.s9)(),{whitespace:u}=(0,Z.Wx)(),[v,w]=(0,g.useState)(null),[x,y]=(0,g.useState)(null),z=(0,aj.Z)(a.content,a.path),A=(0,g.useMemo)(()=>z.length&&""===z[z.length-1]?z.slice(0,-1):z,[z]),B=(0,g.useMemo)(()=>a.content.split("\n").reduce((a,b)=>Math.max(a,b.length),0),[a.content]),E=(0,g.useMemo)(()=>{if(!v)return null;let a=-1;return v.lines.map((b,c)=>{let d=b!==v.lines[c-1];return d&&a++,{first:d,g:a%2}})},[v]);if(a.binary)return(0,d.jsx)("p",{className:"gx-note",children:t("git.file.binary")});if(0===A.length)return(0,d.jsx)("p",{className:"gx-note",children:t("git.file.empty")});let F=210*!!v;return(0,d.jsxs)("div",{className:"vf",children:["head"===a.source&&(0,d.jsx)("div",{className:"gx-banner",children:t("git.file.deleted")}),a.truncated&&(0,d.jsx)("div",{className:"gx-banner",children:t("git.file.truncated")}),x&&(0,d.jsx)("div",{className:"gx-banner",children:x}),v?.truncated&&(0,d.jsx)("div",{className:"gx-banner",children:t("git.blame.truncated",{count:v.lines.length})}),(0,d.jsx)("div",{className:"vf-main",style:{"--vl-left":`${F}px`},children:(0,d.jsx)(an.T,{count:A.length,width:`calc(${F}px + 6ch + ${B}ch + 40px)`,overlay:k&&j[k.block]?{top:r(j[k.block],k.row),node:(0,d.jsx)(aq,{path:a.path,hunk:j[k.block].view,index:k.block,extent:n,onClose:()=>l(null),total:j.length,onGo:a=>{let b=m[a];if(!b)return;let c=Math.max(0,b.from-1);l({row:c,block:a}),p({top:c*an.U,bottom:r(j[a],c)+s(j[a]),key:Date.now()})}})}:void 0,reveal:i?{top:Math.max(0,i.line-4)*an.U,bottom:(i.line+2)*an.U,key:i.key}:o,render:b=>{let c=v?.lines[b],g=c?v.commits[c]:void 0,m=E?.[b],o="worktree"===a.source?h?"add":f?.lines.get(b+1):void 0,w=!!f&&f.removedBefore.has(b+1),x=!!f&&b===A.length-1&&f.removedBefore.has(A.length+1),y=f&&"worktree"===a.source?f.blockOfLine.get(b+1)??(w?f.blockOfRemoval.get(b+1):x?f.blockOfRemoval.get(A.length+1):void 0):void 0;return(0,d.jsxs)("div",{className:`vl-row ${i&&b+1===i.line?"m-hit":""} ${m?`bl-g${m.g}`:""} ${o?`m-${o}`:""} ${w?"m-delb":x?"m-dela":""} ${void 0!==y?"has-peek":""} ${n&&b+1>=n.from&&b+1<=n.to?"in-peek":""}`,onClick:void 0!==y?a=>{if(!a.target.closest(".bl-btn")&&(a.target.closest(".vl-ln")||window.getSelection()?.isCollapsed)){if(k?.row===b)return void l(null);l({row:b,block:y}),p({top:b*an.U,bottom:r(j[y],b)+s(j[y]),key:Date.now()})}}:void 0,title:void 0!==y?t("git.peek.hint"):void 0,children:[v&&(0,d.jsx)("div",{className:`vl-bl ${m?.first?"first":""}`,children:m?.first&&g&&(g.uncommitted?(0,d.jsx)("span",{className:"muted",children:t("git.blame.uncommitted")}):(0,d.jsxs)("button",{type:"button",className:"bl-btn",title:`${g.summary}
3
3
  ${g.author} \xb7 ${(0,C.v7)(g.time)}`,onClick:()=>e(c),children:[(0,d.jsx)("span",{className:"mono sha",children:g.short}),(0,d.jsx)("span",{className:"who",children:g.author}),(0,d.jsx)("span",{className:"when",children:(0,q.KN)(g.time)})]}))}),(0,d.jsx)("div",{className:"vl-ln",children:b+1}),(0,d.jsx)("div",{className:"vl-cd",children:(0,d.jsx)(ak.Yr,{html:A[b],ws:u})})]},b)}})})]})}function as({agent:a,gitRef:b,path:c,toolbar:e=!0}){let{t:f}=(0,D.s9)(),[h,i]=(0,g.useState)(null),[j,k]=(0,g.useState)(""),[l,m]=(0,g.useState)("preview"),n=ad.test(c),o=ae.test(c);return(0,d.jsxs)(d.Fragment,{children:[e&&(0,d.jsxs)("div",{className:"gx-ptools",style:{padding:"6px 14px"},children:[(0,d.jsx)("span",{className:"mono small grow",title:c,style:{overflow:"hidden",textOverflow:"ellipsis"},children:c}),h&&(0,d.jsx)("span",{className:"muted small",children:(0,C.zi)(h.size)}),o&&h&&!h.binary&&(0,d.jsx)(L.$q,{value:l,onChange:m,options:[{id:"preview",label:f("git.view.preview")},{id:"source",label:f("git.view.source")}]}),(0,d.jsx)(Y.WQ,{text:c,label:f("git.copyPath")})]}),(0,d.jsx)("div",{className:"gx-body",children:j?(0,d.jsx)("p",{className:"gx-note",children:j}):n?(0,d.jsx)("div",{className:"gx-image",children:(0,d.jsx)("img",{src:`/api/agents/${a.id}/git/raw-at?ref=${encodeURIComponent(b)}&path=${encodeURIComponent(c)}`,alt:c,onError:()=>k(f("git.file.missingAt",{ref:b}))})}):h?h.binary?(0,d.jsx)("p",{className:"gx-note",children:f("git.file.binary")}):o&&"preview"===l?(0,d.jsxs)("div",{className:"gx-md md",children:[h.truncated&&(0,d.jsx)("div",{className:"gx-banner",children:f("git.diff.truncated")}),(0,d.jsx)(ab.oz,{remarkPlugins:[ac.A],components:{a:a=>(0,d.jsx)("a",{...a,target:"_blank",rel:"noreferrer"})},children:h.content})]}):(0,d.jsx)(ar,{f:h,agent:a,blame:!1,onOpenCommit:()=>void 0,marks:null,allNew:!1}):(0,d.jsx)("p",{className:"gx-note",children:f("git.loading")})})]})}let at={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflict:"!",typechange:"T"};function au({status:a,titled:b=!1}){let{t:c}=(0,D.s9)();return(0,d.jsx)("span",{className:`stl st-${a}`,title:b?c(`git.status.${a}`):void 0,children:at[a]})}function av({agent:a,gitRef:b,path:c,label:e}){let[f,h]=(0,g.useState)(!0);return f?(0,d.jsxs)("figure",{className:"gx-pic",children:[(0,d.jsx)("figcaption",{className:"muted small",children:e}),(0,d.jsx)("div",{className:"gx-image",children:(0,d.jsx)("img",{src:`/api/agents/${a.id}/git/raw-at?ref=${encodeURIComponent(b)}&path=${encodeURIComponent(c)}`,alt:c,onError:()=>h(!1)})})]}):null}function aw({agent:a,detailUrl:b,diffUrl:c,header:e,focus:f,embedded:h=!1,before:i,after:j,label:k}){let{t:l}=(0,D.s9)(),[m,n]=(0,g.useState)(null),[o,p]=(0,g.useState)(null),[q,r]=(0,g.useState)(null),[s,t]=(0,g.useState)("unified"),[u,v]=(0,g.useState)(null),w=m?.files.find(a=>a.path===o),x=(0,g.useMemo)(()=>q&&w&&q.path===w.path?ah(q.diff):null,[q,w]);if(u)return(0,d.jsx)("section",{className:"gx-preview",children:(0,d.jsx)("p",{className:"gx-note err",children:u})});if(!m)return(0,d.jsx)("section",{className:"gx-preview",children:(0,d.jsx)("p",{className:"gx-note",children:l("git.loading")})});let y=!!w&&ad.test(w.path);return(0,d.jsxs)("section",{className:`gx-preview gx-commitview ${h?"embedded":""}`,"aria-label":k,children:[(0,d.jsx)("header",{className:"gx-chead",children:e(m)}),0===m.files.length?(0,d.jsx)("p",{className:"gx-note",children:l("git.cmp.nofiles")}):(0,d.jsx)("div",{className:"gx-cfilelist",role:"listbox",children:m.files.map(a=>(0,d.jsxs)("button",{role:"option","aria-selected":o===a.path,className:`gx-cfile ${o===a.path?"sel":""}`,onClick:()=>p(a.path),title:a.oldPath?`${a.oldPath} → ${a.path}`:a.path,children:[(0,d.jsx)(au,{status:a.status}),(0,d.jsx)("span",{className:"mono nm",children:a.path}),(null!==a.additions||null!==a.deletions)&&(0,d.jsxs)("span",{className:"gx-counts sm",children:[(0,d.jsxs)("i",{className:"add",children:["+",a.additions??0]}),(0,d.jsxs)("i",{className:"del",children:["−",a.deletions??0]})]})]},a.path))}),w&&(0,d.jsxs)(d.Fragment,{children:[!y&&(0,d.jsx)("div",{className:"gx-ptools",style:{padding:"6px 14px"},children:(0,d.jsx)(L.$q,{value:s,onChange:t,options:[{id:"unified",label:l("git.layout.unified")},{id:"split",label:l("git.layout.split")}]})}),(0,d.jsx)("div",{className:"gx-body",children:y?(0,d.jsxs)("div",{className:"gx-picpair",children:["added"!==w.status&&(0,d.jsx)(av,{agent:a,gitRef:i,path:w.oldPath??w.path,label:l("git.img.before")}),"deleted"!==w.status&&(0,d.jsx)(av,{agent:a,gitRef:j,path:w.path,label:l("git.img.after")})]}):x?x.binary?(0,d.jsx)("p",{className:"gx-note",children:l("git.diff.binary")}):0===x.hunks.length?(0,d.jsx)("p",{className:"gx-note",children:l("git.diff.empty")}):(0,d.jsxs)(d.Fragment,{children:[q?.truncated&&(0,d.jsx)("div",{className:"gx-banner",children:l("git.diff.truncated")}),(0,d.jsx)(ap,{parsed:x,layout:s,path:w.path})]}):(0,d.jsx)("p",{className:"gx-note",children:l("git.loading")})})]})]})}function ax({agent:a,sha:b,embedded:c=!1,focus:e}){let{t:f}=(0,D.s9)();return(0,d.jsx)(aw,{agent:a,detailUrl:`/agents/${a.id}/git/commit?sha=${b}`,embedded:c,focus:e,before:`${b}^`,after:b,label:b,diffUrl:c=>`/agents/${a.id}/git/commit-diff?sha=${b}&path=${encodeURIComponent(c.path)}${c.oldPath?`&old=${encodeURIComponent(c.oldPath)}`:""}`,header:a=>{let[b,...c]=a.message.split("\n"),e=c.join("\n").trim();return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("h3",{children:b}),e&&(0,d.jsx)("pre",{className:"gx-cbody",children:e}),(0,d.jsxs)("div",{className:"muted small row gap-s wrap",children:[(0,d.jsx)("span",{className:"mono",children:a.sha.slice(0,10)}),(0,d.jsx)(Y.WQ,{text:a.sha,label:f("git.info.copySha"),compact:!0}),(0,d.jsxs)("span",{children:["\xb7 ",a.author," \xb7 ",(0,C.v7)(a.date)]}),(0,d.jsxs)("span",{children:["\xb7 ",f("git.hist.files",{count:a.files.length})]})]})]})}})}function ay({agent:a,sel:b,onSelect:c,onLoaded:e}){let{t:f}=(0,D.s9)(),[h,i]=(0,g.useState)(null),[j,k]=(0,g.useState)(!1),[l,m]=(0,g.useState)(""),[n,o]=(0,g.useState)(""),p=(0,g.useMemo)(()=>(h??[]).filter(a=>!l||`${a.name} ${a.subject}`.toLowerCase().includes(l.toLowerCase())),[h,l]);return n?(0,d.jsx)("p",{className:"gx-note err",children:n}):h?h.length?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"gx-filter",children:(0,d.jsxs)("div",{className:"search",children:[(0,d.jsx)(I.A,{size:14}),(0,d.jsx)("input",{className:"input",placeholder:f("git.tags.search"),value:l,onChange:a=>m(a.target.value),"aria-label":f("git.tags.search")})]})}),(0,d.jsxs)("div",{className:"gx-hist",role:"listbox","aria-label":f("git.tab.tags"),children:[p.map(a=>(0,d.jsxs)("button",{role:"option","aria-selected":b===a.name,className:`gx-commit ${b===a.name?"sel":""}`,onClick:()=>c(a),children:[(0,d.jsxs)("span",{className:"subj",children:[(0,d.jsx)(_,{size:13,style:{verticalAlign:"-2px",marginRight:5}}),a.name]}),(0,d.jsx)("span",{className:"meta",children:a.subject||"—"}),(0,d.jsxs)("span",{className:"meta",children:[(0,d.jsx)("span",{className:"mono sha",children:a.sha.slice(0,8)})," \xb7 ",(0,q.KN)(Date.parse(a.date))]})]},a.name)),!p.length&&(0,d.jsx)("p",{className:"gx-note",children:f("git.noMatch",{query:l})}),j&&(0,d.jsx)("p",{className:"gx-note",children:f("git.tags.truncated",{count:h.length})})]})]}):(0,d.jsx)("p",{className:"gx-note",children:f("git.tags.empty")}):(0,d.jsx)("p",{className:"gx-note",children:f("git.loading")})}function az({agent:a,tag:b,onChanged:c}){let{t:e}=(0,D.s9)(),f=(0,L.dj)(),[h,i]=(0,g.useState)(null),[j,k]=(0,g.useState)(""),l=!!h&&/^[\w./-]+$/.test(h)&&!h.startsWith("-")&&!h.endsWith("/")&&!h.includes(".."),m=async()=>{if(h&&l)try{await p.FH.post(`/agents/${a.id}/git/branch-create`,{branch:h,from:b.name}),f(e("git.tags.branchCreated",{branch:h})),i(null),k(""),c?.()}catch(a){k(a instanceof Error?a.message:"error")}},[n,o]=(0,g.useState)("files"),[q,r]=(0,g.useState)(null),[s,t]=(0,g.useState)(!1),[u,v]=(0,g.useState)(new Set),[w,x]=(0,g.useState)(""),[y,z]=(0,g.useState)(null),[A,E]=(0,g.useState)(""),F=(0,g.useMemo)(()=>q?W(q,[]):null,[q]),G=(0,g.useMemo)(()=>F?X(F,u,{query:w,onlyChanged:!1}).slice(0,3e3):[],[F,u,w]);return(0,d.jsxs)("section",{className:"gx-preview gx-tagview","aria-label":b.name,children:[(0,d.jsxs)("header",{className:"gx-chead",children:[(0,d.jsxs)("h3",{children:[(0,d.jsx)(_,{size:16,style:{verticalAlign:"-2px",marginRight:6}}),b.name]}),b.subject&&(0,d.jsx)("div",{children:b.subject}),(0,d.jsxs)("div",{className:"muted small row gap-s wrap",children:[(0,d.jsx)("span",{className:"gx-chip soft",children:b.annotated?e("git.tags.annotated"):e("git.tags.lightweight")}),(0,d.jsx)("span",{className:"mono",children:b.sha.slice(0,10)}),(0,d.jsx)(Y.WQ,{text:b.sha,label:e("git.info.copySha"),compact:!0}),(0,d.jsxs)("span",{children:["\xb7 ",(0,C.v7)(b.date)]}),q&&(0,d.jsxs)("span",{children:["\xb7 ",e("git.tags.nfiles",{count:q.length})]})]}),(0,d.jsx)("div",{className:"row gap-s wrap",style:{marginTop:8},children:null===h?(0,d.jsxs)("button",{className:"btn sm",onClick:()=>i(""),children:[(0,d.jsx)(Q,{size:14}),e("git.tags.newBranch")]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("input",{className:"input mono",style:{maxWidth:240},autoFocus:!0,placeholder:e("git.tags.branchName"),value:h,onChange:a=>{i(a.target.value.trim()),k("")},"aria-label":e("git.tags.branchName"),onKeyDown:a=>{"Enter"===a.key&&m(),"Escape"===a.key&&i(null)}}),(0,d.jsx)("button",{className:"btn primary sm",disabled:!l,onClick:()=>void m(),children:e("git.tags.createBranch")}),(0,d.jsx)("button",{className:"btn ghost sm",onClick:()=>{i(null),k("")},children:e("common.cancel")})]})}),j&&(0,d.jsx)("p",{className:"gx-note err",style:{margin:0},children:j}),(0,d.jsx)("div",{style:{marginTop:4},children:(0,d.jsx)(L.$q,{value:n,onChange:o,options:[{id:"files",label:e("git.tags.files")},{id:"changes",label:e("git.tags.changes")}]})})]}),"changes"===n?(0,d.jsx)(ax,{agent:a,sha:b.sha,embedded:!0},b.sha):A?(0,d.jsx)("p",{className:"gx-note err",children:A}):F?(0,d.jsxs)("div",{className:"gx-tagfiles",children:[(0,d.jsxs)("div",{className:"gx-tagtree",children:[(0,d.jsx)("div",{className:"gx-filter",children:(0,d.jsxs)("div",{className:"search",children:[(0,d.jsx)(I.A,{size:14}),(0,d.jsx)("input",{className:"input",placeholder:e("git.filterPlaceholder"),value:w,onChange:a=>x(a.target.value),"aria-label":e("git.filterPlaceholder")})]})}),(0,d.jsxs)("div",{className:"gx-list",role:"tree",children:[0===G.length?(0,d.jsx)("p",{className:"gx-note",children:w?e("git.noMatch",{query:w}):e("git.noFiles")}):G.map(({node:a,depth:b})=>{let c="dir"===a.type,e=c&&(!!w||u.has(a.path));return(0,d.jsxs)("button",{type:"button",role:"treeitem","aria-level":b+1,"aria-expanded":c?e:void 0,"aria-selected":!c&&y===a.path,className:`gx-row ${c?"dir":"file"} ${!c&&y===a.path?"sel":""}`,style:{paddingLeft:8+14*b},title:a.path,onClick:()=>{let b;return c?(b=a.path,v(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})):z(a.path)},children:[(0,d.jsx)("span",{className:"chev",children:c?e?(0,d.jsx)(B.A,{size:14}):(0,d.jsx)(R.A,{size:14}):null}),(0,d.jsx)("span",{className:"ico",children:c?e?(0,d.jsx)(aa.A,{size:15}):(0,d.jsx)(O.A,{size:15}):(0,d.jsx)(T.A,{size:15})}),(0,d.jsx)("span",{className:"nm",children:a.name})]},a.path)}),s&&(0,d.jsx)("p",{className:"gx-note",children:e("git.treeTruncated",{count:q?.length??0})})]})]}),(0,d.jsx)("div",{className:"gx-tagfile",children:y?(0,d.jsx)(as,{agent:a,gitRef:b.name,path:y}):(0,d.jsx)("div",{className:"gx-empty",children:(0,d.jsx)("p",{children:e("git.tags.pick")})})})]}):(0,d.jsx)("p",{className:"gx-note",children:e("git.loading")})]})}let aA=(0,u.A)("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);var aB=c(28923),aC=c(2838);function aD({refs:a,value:b,onChange:c,label:e,extra:f,icon:h=!0,compact:i=!1}){let{t:j}=(0,D.s9)(),[k,l]=(0,g.useState)(!1),[m,n]=(0,g.useState)(""),o=(0,g.useRef)(null);(0,aC.s)(k,o,()=>l(!1));let p=a=>!m||`${a.name} ${a.subject}`.toLowerCase().includes(m.toLowerCase()),r=(0,g.useMemo)(()=>(a?.branches??[]).filter(p),[a,m]),s=(0,g.useMemo)(()=>(a?.remotes??[]).filter(p),[a,m]),t=(0,g.useMemo)(()=>(a?.tags??[]).filter(p),[a,m]),u=m.trim(),v=/^([0-9a-f]{7,40}|HEAD([~^]\d*)*)$/i.test(u)&&![...a?.branches??[],...a?.tags??[]].some(a=>a.name===u),w=a=>{c(a),l(!1)},x=(a,c)=>(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":b===a.name,className:`gx-refrow ${b===a.name?"sel":""}`,onClick:()=>w(a.name),title:a.subject,children:[(0,d.jsxs)("span",{className:"nm",children:[b===a.name?(0,d.jsx)(aB.A,{size:13}):"tag"===c?(0,d.jsx)(_,{size:13}):(0,d.jsx)(Q,{size:13}),a.name]}),(0,d.jsxs)("span",{className:"sub",children:[a.subject||"—"," \xb7 ",(0,q.KN)(Date.parse(a.date))]})]},`${c}:${a.name}`);return(0,d.jsxs)("div",{className:"gx-brmenu gx-refpick",ref:o,children:[i?(0,d.jsxs)("button",{type:"button",className:`btn sm ${b?"primary gx-refbtn":"ghost icon"}`,"aria-expanded":k,"aria-haspopup":"listbox","aria-label":e,title:e,onClick:()=>l(a=>!a),children:[(0,d.jsx)(Q,{size:14}),b&&(0,d.jsx)("span",{className:"nm mono",children:b})]}):(0,d.jsxs)("button",{type:"button",className:"btn sm gx-refbtn","aria-expanded":k,"aria-haspopup":"listbox",title:e,onClick:()=>l(a=>!a),children:[h&&(0,d.jsx)(Q,{size:14}),(0,d.jsx)("span",{className:"nm mono",children:f?.find(a=>a.value===b)?.label??(b||j("git.ref.pick"))}),(0,d.jsx)(B.A,{size:13})]}),k&&(0,d.jsxs)("div",{className:"gx-pop",role:"listbox",children:[(0,d.jsxs)("div",{className:"search",children:[(0,d.jsx)(I.A,{size:14}),(0,d.jsx)("input",{className:"input",autoFocus:!0,placeholder:j("git.ref.search"),value:m,onChange:a=>n(a.target.value),"aria-label":j("git.ref.search"),onKeyDown:a=>{"Enter"===a.key&&v&&w(u)}})]}),(0,d.jsxs)("div",{className:"gx-brlist",children:[!m&&f?.map(a=>(0,d.jsx)("button",{type:"button",role:"option","aria-selected":b===a.value,className:`gx-refrow ${b===a.value?"sel":""}`,onClick:()=>w(a.value),children:(0,d.jsxs)("span",{className:"nm",children:[b===a.value&&(0,d.jsx)(aB.A,{size:13}),a.label]})},a.value)),v&&(0,d.jsx)("button",{type:"button",className:"gx-refrow",onClick:()=>w(u),children:(0,d.jsx)("span",{className:"nm mono",children:j("git.ref.useCommit",{ref:u.slice(0,12)})})}),r.length>0&&(0,d.jsx)("div",{className:"gx-brhead",children:j("git.ref.branches")}),r.map(a=>x(a,"branch")),t.length>0&&(0,d.jsx)("div",{className:"gx-brhead",children:j("git.ref.tags")}),t.slice(0,200).map(a=>x(a,"tag")),s.length>0&&(0,d.jsx)("div",{className:"gx-brhead",children:j("git.ref.remotes")}),s.slice(0,200).map(a=>x(a,"branch")),a&&!r.length&&!t.length&&!s.length&&!v&&(0,d.jsx)("p",{className:"gx-note",children:j("git.ref.none")})]})]})]})}function aE({refs:a,sel:b,onChange:c}){let{t:e}=(0,D.s9)();return(0,d.jsxs)("div",{className:"gx-cmpside",children:[(0,d.jsx)("label",{className:"label",children:e("git.cmp.base")}),(0,d.jsx)(aD,{refs:a,value:b.base,onChange:a=>c({...b,base:a})}),(0,d.jsx)("div",{className:"row",style:{justifyContent:"center"},children:(0,d.jsx)("button",{className:"btn ghost icon sm",onClick:()=>c({base:b.head,head:b.base}),disabled:!b.base&&!b.head,"aria-label":e("git.cmp.swap"),title:e("git.cmp.swap"),children:(0,d.jsx)(aA,{size:15,style:{transform:"rotate(90deg)"}})})}),(0,d.jsx)("label",{className:"label",children:e("git.cmp.head")}),(0,d.jsx)(aD,{refs:a,value:b.head,onChange:a=>c({...b,head:a})}),(!b.base||!b.head)&&(0,d.jsx)("p",{className:"muted small",children:e("git.cmp.pick")})]})}function aF({agent:a,sel:b}){let{t:c}=(0,D.s9)();if(!(b.base&&b.head))return(0,d.jsx)("div",{className:"gx-preview",children:(0,d.jsx)("div",{className:"gx-empty",children:(0,d.jsx)("p",{children:c("git.cmp.pick")})})});let e=`base=${encodeURIComponent(b.base)}&head=${encodeURIComponent(b.head)}`;return(0,d.jsx)(aw,{agent:a,detailUrl:`/agents/${a.id}/git/compare?${e}`,before:b.base,after:b.head,label:`${b.base} → ${b.head}`,diffUrl:b=>`/agents/${a.id}/git/compare-diff?${e}&path=${encodeURIComponent(b.path)}${b.oldPath?`&old=${encodeURIComponent(b.oldPath)}`:""}`,header:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("h3",{children:[(0,d.jsx)("span",{className:"mono",children:b.base})," → ",(0,d.jsx)("span",{className:"mono",children:b.head})]}),a.base.sha===a.head.sha?(0,d.jsx)("p",{className:"muted small",style:{margin:0},children:c("git.cmp.same")}):(0,d.jsxs)("div",{className:"muted small row gap-s wrap",children:[(0,d.jsx)("span",{children:c("git.cmp.summary",{ahead:a.ahead,behind:a.behind})}),(0,d.jsxs)("span",{children:["\xb7 ",c("git.hist.files",{count:a.files.length})]})]}),a.commits.length>0&&(0,d.jsxs)("details",{className:"gx-cmpcommits",children:[(0,d.jsx)("summary",{children:c("git.cmp.commits",{count:a.ahead})}),(0,d.jsx)("ul",{children:a.commits.map(a=>(0,d.jsxs)("li",{children:[(0,d.jsx)("span",{className:"mono sha",children:a.short})," ",a.subject," ",(0,d.jsxs)("span",{className:"muted",children:["\xb7 ",a.author," \xb7 ",(0,q.KN)(Date.parse(a.date))]})]},a.sha))}),a.commitsTruncated&&(0,d.jsx)("p",{className:"muted small",children:c("git.cmp.more",{count:a.commits.length})})]})]})})}function aG(a){let b=a.split("\n"),c=[];for(let a=0;a<b.length;a++){if(!/^<{7}( |$)/.test(b[a]))continue;let d=-1,e=-1,f=-1;for(let c=a+1;c<b.length&&!/^<{7}( |$)/.test(b[c]);c++)if(/^\|{7}( |$)/.test(b[c])&&d<0)e=c;else if("======="===b[c]&&d<0)d=c;else if(/^>{7}( |$)/.test(b[c])&&d>=0){f=c;break}d<0||f<0||(c.push({start:a,end:f,ours:b.slice(a+1,e>=0?e:d),base:e>=0?b.slice(e+1,d):void 0,theirs:b.slice(d+1,f),oursLabel:b[a].slice(8).trim(),theirsLabel:b[f].slice(8).trim()}),a=f)}return c}function aH(a,b,c){let d=aG(a)[b];if(!d)return a;let e={ours:d.ours,theirs:d.theirs,"ours-theirs":[...d.ours,...d.theirs],"theirs-ours":[...d.theirs,...d.ours]}[c],f=a.split("\n");return f.splice(d.start,d.end-d.start+1,...e),f.join("\n")}var aI=c(28521);function aJ({agent:a,path:b,state:c,a:e,onResolved:f}){let{t:h}=(0,D.s9)(),[i,j]=(0,g.useState)(null),[l,m]=(0,g.useState)(""),[n,o]=(0,g.useState)(null),[p,q]=(0,g.useState)(0),r=(0,g.useMemo)(()=>aG(l),[l]),s="rebase"!==c&&"stash"!==c,t=a=>"mine"===a===s?"ours":"theirs",u=a=>"both-mine"===a?s?"ours-theirs":"theirs-ours":"both-remote"===a?s?"theirs-ours":"ours-theirs":t(a),v=/^(<{7}|>{7})( |$)/m.test(l),w=!!i&&!i.binary&&!i.truncated,x=!!e.busy,y=async a=>{await e.run("resolve",h("git.res.done"),"resolve-side",{path:b,side:t(a)})&&f()},z=async()=>{await e.run("resolve",h("git.res.done"),"resolve",{path:b,content:l})&&f()},A=async()=>{await e.run("unresolve",h("git.res.restored"),"unresolve",{path:b})&&q(a=>a+1)},B=b.lastIndexOf("/"),C=B>=0?b.slice(0,B+1):"",E=b.slice(B+1);return(0,d.jsxs)("section",{className:"gx-preview gx-resolver","aria-label":b,children:[(0,d.jsxs)("header",{className:"gx-phead",children:[(0,d.jsxs)("div",{className:"gx-ptitle",children:[(0,d.jsxs)("span",{className:"gx-path mono",title:b,children:[(0,d.jsx)("span",{className:"dir",children:C}),(0,d.jsx)("b",{children:E})]}),(0,d.jsx)("span",{className:"gx-chip st-conflict",children:h("git.status.conflict")}),w&&(0,d.jsx)("span",{className:"muted small",children:r.length>0?h("git.res.left",{count:r.length}):h("git.res.none")})]}),(0,d.jsxs)("div",{className:"gx-ptools",children:[(0,d.jsx)("button",{className:"btn sm",disabled:x,title:h("git.res.allMine.hint"),onClick:()=>void y("mine"),children:h("git.res.allMine")}),(0,d.jsx)("button",{className:"btn sm",disabled:x,title:h("git.res.allRemote.hint"),onClick:()=>void y("remote"),children:h("git.res.allRemote")}),(0,d.jsx)(Y.WQ,{text:b,label:h("git.copyPath")})]})]}),n?(0,d.jsx)("p",{className:"gx-note err",children:n}):i?w?(0,d.jsxs)("div",{className:"gx-rbody",children:[r.length>0&&(0,d.jsx)("div",{className:"gx-rblocks",children:r.map((a,e)=>(0,d.jsxs)("div",{className:"gx-rcard",children:[(0,d.jsxs)("div",{className:"gx-rtitle",children:[(0,d.jsx)("b",{children:h("git.res.block",{n:e+1,total:r.length})}),(0,d.jsx)("span",{className:"muted small",children:h("git.res.line",{n:a.start+1})})]}),(0,d.jsx)("div",{className:"gx-rsides",children:["mine","remote"].map(f=>{let g,i="ours"===t(f)?a.ours:a.theirs,j=!(g="ours"===t(f)?a.oursLabel:a.theirsLabel)||["HEAD","ours","theirs","Updated upstream","Stashed changes"].includes(g)?"":g;return(0,d.jsxs)("div",{className:`gx-rside ${f}`,children:[(0,d.jsxs)("div",{className:"gx-rhead",children:[(0,d.jsx)("span",{children:"mine"===f?"stash"===c?h("git.res.mine.stash"):h("git.res.mine"):"stash"===c?h("git.res.remote.stash"):h("git.res.remote")}),j&&(0,d.jsx)("i",{className:"ref",children:j})]}),(0,d.jsx)("pre",{children:i.length?(0,d.jsx)(ak.Cy,{text:i.join("\n"),path:b}):(0,d.jsx)("span",{className:"muted",children:h("git.res.empty")})}),(0,d.jsx)("button",{className:"btn sm",onClick:()=>m(a=>aH(a,e,u(f))),children:"mine"===f?h("git.res.keepMine"):h("git.res.keepRemote")})]},f)})}),(0,d.jsxs)("div",{className:"gx-rboth",children:[(0,d.jsxs)("span",{className:"small muted",children:[h("git.res.both"),":"]}),(0,d.jsx)("button",{className:"btn sm",onClick:()=>m(a=>aH(a,e,u("both-mine"))),children:h("git.res.bothMine")}),(0,d.jsx)("button",{className:"btn sm",onClick:()=>m(a=>aH(a,e,u("both-remote"))),children:h("git.res.bothRemote")})]})]},`${e}-${a.start}`))}),(0,d.jsxs)("div",{className:"gx-rresult",children:[(0,d.jsxs)("div",{className:"row",children:[(0,d.jsx)("label",{className:"label grow",htmlFor:"gx-result",children:h("git.res.result")}),(0,d.jsx)("span",{className:"small muted",children:h("git.res.editHint")})]}),(0,d.jsx)(aI.B,{id:"gx-result",label:h("git.res.result"),value:l,path:b,onChange:m})]}),(0,d.jsxs)("footer",{className:"gx-rfoot",children:[(0,d.jsxs)("button",{className:"btn ghost sm",disabled:x,onClick:()=>void A(),title:h("git.res.restore.hint"),children:[(0,d.jsx)(k.A,{size:14}),h("git.res.restore")]}),(0,d.jsx)("span",{className:"grow"}),(0,d.jsx)("button",{className:"btn primary",disabled:x||v,onClick:()=>void z(),children:h("git.res.markResolved")})]})]}):(0,d.jsx)("p",{className:"gx-note",children:h("git.res.noEdit")}):(0,d.jsx)("p",{className:"gx-note",children:h("git.loading")})]})}function aK({agent:a,plan:b,a:c,onClose:e,onGo:f}){let{t:g}=(0,D.s9)();return(0,d.jsxs)(L.TM,{title:g("git.sw.title",{branch:b.to}),confirmLabel:g("git.sw.anyway"),onConfirm:()=>{c.busy||f()},onClose:e,children:[b.carried>0&&(0,d.jsx)("p",{className:"confirm-body",children:g("git.sw.carried",{count:b.carried,from:b.from})}),(0,d.jsxs)("div",{className:"gx-sw-warn",role:"alert",children:[b.selfRunning&&(0,d.jsx)("div",{children:g("git.warn.running",{name:a.name})}),b.others.length>0&&(0,d.jsx)("div",{children:g("git.sw.others",{count:b.others.length,names:b.others.map(a=>a.name).join(", ")})})]})]})}let aL=(0,u.A)("PackagePlus",[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M19 13v6",key:"85cyf1"}],["path",{d:"M21 10V8a2 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 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),aM=(0,u.A)("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);var aN=c(34410);function aO({stashes:a,sel:b,onSelect:c,onSave:e,canSave:f}){let{t:g}=(0,D.s9)();return(0,d.jsxs)("div",{className:"gx-stashes",children:[(0,d.jsx)("div",{className:"gx-stash-head",children:(0,d.jsxs)("button",{className:"btn sm",disabled:!f,title:f?void 0:g("git.stash.nothing"),onClick:e,children:[(0,d.jsx)(aL,{size:14}),g("git.stash.save")]})}),a?0===a.length?(0,d.jsx)("p",{className:"gx-note",children:g("git.stash.empty")}):(0,d.jsx)("div",{className:"gx-hist",role:"listbox","aria-label":g("git.tab.stashes"),children:a.map(a=>(0,d.jsxs)("button",{role:"option","aria-selected":b===a.sha,className:`gx-commit ${b===a.sha?"sel":""}`,onClick:()=>c(a.sha),children:[(0,d.jsx)("span",{className:"subj",children:a.message||"—"}),(0,d.jsxs)("span",{className:"meta",children:[a.branch&&(0,d.jsxs)(d.Fragment,{children:[a.branch," \xb7 "]}),(0,q.KN)(Date.parse(a.date))]}),a.smart&&(0,d.jsx)("span",{className:"refs",children:(0,d.jsx)("i",{className:"ref",children:g("git.stash.smart")})})]},a.sha))}):(0,d.jsx)("p",{className:"gx-note",children:g("git.loading")})]})}function aP({a,onClose:b}){let{t:c}=(0,D.s9)(),[e,f]=(0,g.useState)(""),h=async()=>{b(),await a.run("stash",c("git.stash.saved"),"stash-save",{message:e})};return(0,d.jsxs)(L.aF,{title:c("git.stash.save"),onClose:b,children:[(0,d.jsx)("p",{className:"confirm-body",children:c("git.stash.save.body")}),(0,d.jsx)("input",{className:"input",autoFocus:!0,value:e,maxLength:200,placeholder:c("git.stash.save.placeholder"),onChange:a=>f(a.target.value),onKeyDown:a=>{"Enter"===a.key&&h()},"aria-label":c("git.stash.save.placeholder")}),(0,d.jsxs)("div",{className:"row confirm-actions",children:[(0,d.jsx)("button",{className:"btn ghost",onClick:b,children:c("common.cancel")}),(0,d.jsx)("button",{className:"btn primary",disabled:!!a.busy,onClick:()=>void h(),children:c("git.stash.save")})]})]})}function aQ({agent:a,stash:b,a:c}){let{t:e}=(0,D.s9)(),[f,h]=(0,g.useState)(null),[i,j]=(0,g.useState)(null),[k,l]=(0,g.useState)(null),[m,n]=(0,g.useState)(null),[o,p]=(0,g.useState)(!1),[r,s]=(0,g.useState)(null),t=(0,g.useMemo)(()=>m?ah(m.diff):null,[m]),u=!!c.busy,v=a=>void c.run("stash",a?e("git.stash.popped"):e("git.stash.applied"),"stash-apply",{sha:b.sha,pop:a}),w=(i?.files.length??0)+(f?.untracked.length??0);return(0,d.jsxs)("section",{className:"gx-preview gx-commitview","aria-label":b.message,children:[(0,d.jsxs)("header",{className:"gx-chead",children:[(0,d.jsx)("h3",{children:b.message||"—"}),(0,d.jsxs)("div",{className:"muted small row gap-s wrap",children:[(0,d.jsxs)("span",{children:[b.branch&&`${b.branch} \xb7 `,(0,q.KN)(Date.parse(b.date))]}),f&&(0,d.jsxs)("span",{children:["\xb7 ",e("git.hist.files",{count:w})]})]}),(0,d.jsxs)("div",{className:"row gap-s wrap",children:[(0,d.jsxs)("button",{className:"btn sm",disabled:u,title:e("git.stash.apply.hint"),onClick:()=>v(!1),children:[(0,d.jsx)(aM,{size:14}),e("git.stash.apply")]}),(0,d.jsx)("button",{className:"btn sm primary",disabled:u,title:e("git.stash.pop.hint"),onClick:()=>v(!0),children:e("git.stash.pop")}),(0,d.jsxs)("button",{className:"btn sm danger",disabled:u,onClick:()=>p(!0),children:[(0,d.jsx)(aN.A,{size:14}),e("git.stash.drop")]})]})]}),r?(0,d.jsx)("p",{className:"gx-note err",children:r}):i&&f?0===w?(0,d.jsx)("p",{className:"gx-note",children:e("git.hist.noFiles")}):(0,d.jsxs)("div",{className:"gx-cfilelist",role:"listbox",children:[i.files.map(a=>(0,d.jsxs)("button",{role:"option","aria-selected":k?.path===a.path&&!k.untracked,className:`gx-cfile ${k?.path===a.path&&!k.untracked?"sel":""}`,onClick:()=>l({path:a.path,untracked:!1,oldPath:a.oldPath}),children:[(0,d.jsx)(au,{status:a.status}),(0,d.jsx)("span",{className:"mono nm",children:a.path}),(null!==a.additions||null!==a.deletions)&&(0,d.jsxs)("span",{className:"gx-counts sm",children:[(0,d.jsxs)("i",{className:"add",children:["+",a.additions??0]}),(0,d.jsxs)("i",{className:"del",children:["−",a.deletions??0]})]})]},`t-${a.path}`)),f.untracked.map(a=>(0,d.jsxs)("button",{role:"option","aria-selected":k?.path===a&&k.untracked,className:`gx-cfile ${k?.path===a&&k.untracked?"sel":""}`,onClick:()=>l({path:a,untracked:!0}),children:[(0,d.jsx)(au,{status:"untracked"}),(0,d.jsx)("span",{className:"mono nm",children:a})]},`u-${a}`))]}):(0,d.jsx)("p",{className:"gx-note",children:e("git.loading")}),k&&(0,d.jsx)("div",{className:"gx-body",children:t?t.binary?(0,d.jsx)("p",{className:"gx-note",children:e("git.diff.binary")}):0===t.hunks.length?(0,d.jsx)("p",{className:"gx-note",children:e("git.diff.empty")}):(0,d.jsx)(ap,{parsed:t,layout:"unified",path:k.path,cutOff:!!m?.truncated}):(0,d.jsx)("p",{className:"gx-note",children:e("git.loading")})}),o&&(0,d.jsx)(L.TM,{danger:!0,title:e("git.stash.drop.title"),body:e("git.stash.drop.body",{name:b.message||"—"}),confirmLabel:e("git.stash.drop"),onClose:()=>p(!1),onConfirm:()=>{u||c.run("stash",e("git.stash.dropped"),"stash-drop",{sha:b.sha})},children:(0,d.jsx)("p",{className:"gx-lost",children:e("git.discard.all.warn")})})]})}var aR=c(58437);let aS=(0,u.A)("CloudDownload",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);var aT=c(12675),aU=c(36414);let aV=(0,u.A)("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);function aW({a}){let{t:b}=(0,D.s9)(),c=a.notice;return c?(0,d.jsxs)("div",{className:"gx-notice err",role:"alert",children:[(0,d.jsxs)("div",{className:"row",children:[(0,d.jsx)("b",{className:"grow",children:c.title}),(0,d.jsx)("button",{className:"btn ghost icon sm",onClick:()=>a.setNotice(null),"aria-label":b("common.close"),children:(0,d.jsx)(ag.A,{size:14})})]}),(0,d.jsx)("pre",{children:c.text}),c.diverged&&(0,d.jsxs)("div",{className:"row gap-s wrap",children:[(0,d.jsx)("span",{className:"small muted",children:b("git.notice.diverged")}),(0,d.jsx)("button",{className:"btn sm",disabled:!!a.busy,onClick:()=>void a.run("pull",b("git.done.pull"),"pull",{mode:"merge"}),children:b("git.pull.merge")}),(0,d.jsx)("button",{className:"btn sm",disabled:!!a.busy,onClick:()=>void a.run("pull",b("git.done.pull"),"pull",{mode:"rebase"}),children:b("git.pull.rebase")})]})]}):null}function aX({a,ahead:b,behind:c,detached:e,changeCount:f,onCommit:g}){let{t:h}=(0,D.s9)(),i=!!a.busy;return(0,d.jsxs)("div",{className:"gx-acts",role:"group","aria-label":h("git.act.group"),children:[(0,d.jsx)("button",{className:"btn sm",disabled:i,title:`${h("git.act.fetch")}: ${h("git.act.fetch.hint")}`,"aria-label":h("git.act.fetch"),onClick:()=>void a.run("fetch",h("git.done.fetch"),"fetch"),children:"fetch"===a.busy?(0,d.jsx)(aR.A,{size:14,className:"spin"}):(0,d.jsx)(aS,{size:14})}),(0,d.jsxs)("button",{className:"btn sm",disabled:i,title:`${h("git.act.pull")}: ${h("git.act.pull.hint")}`,"aria-label":h("git.act.pull"),onClick:()=>void a.run("pull",h("git.done.pull"),"pull"),children:["pull"===a.busy?(0,d.jsx)(aR.A,{size:14,className:"spin"}):(0,d.jsx)(aT.A,{size:14}),c>0&&(0,d.jsx)("span",{className:"ct",children:c})]}),(0,d.jsxs)("button",{className:"btn sm",disabled:i||e,title:`${h("git.act.push")}: ${h("git.act.push.hint")}`,"aria-label":h("git.act.push"),onClick:()=>void a.run("push",h("git.done.push"),"push"),children:["push"===a.busy?(0,d.jsx)(aR.A,{size:14,className:"spin"}):(0,d.jsx)(aU.A,{size:14}),b>0&&(0,d.jsx)("span",{className:"ct",children:b})]}),(0,d.jsxs)("button",{className:"btn sm primary",disabled:i||0===f,title:0===f?h("git.commit.nothing"):void 0,onClick:g,children:["commit"===a.busy?(0,d.jsx)(aR.A,{size:14,className:"spin"}):(0,d.jsx)(aV,{size:14}),h("git.act.commit"),f>0&&(0,d.jsx)("span",{className:"ct",children:f})]})]})}let aY=(0,u.A)("GitMerge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);function aZ({agent:a,a:b,current:c,onSwitch:e}){let{t:f}=(0,D.s9)(),[h,i]=(0,g.useState)(!1),[j,k]=(0,g.useState)(null),[l,m]=(0,g.useState)(""),[n,o]=(0,g.useState)(""),[p,r]=(0,g.useState)(null),[s,t]=(0,g.useState)(null),[u,v]=(0,g.useState)(""),w=(0,g.useRef)(null);(0,aC.s)(h,w,()=>i(!1));let x=(0,g.useMemo)(()=>(j?.local??[]).filter(a=>a.name.toLowerCase().includes(l.toLowerCase())),[j,l]),y=(0,g.useMemo)(()=>{let a=new Set((j?.local??[]).map(a=>a.name));return(j?.remote??[]).filter(b=>!a.has(b.name.split("/").slice(1).join("/"))&&b.name.toLowerCase().includes(l.toLowerCase()))},[j,l]),z=async(a,c,d,e)=>{i(!1),await b.run(a,c,d,e)},A=/^[\w./-]+$/.test(n)&&!n.startsWith("-")&&!n.endsWith("/")&&!n.includes("..");return(0,d.jsxs)("div",{className:"gx-brmenu",ref:w,children:[(0,d.jsxs)("button",{type:"button",className:"btn sm","aria-expanded":h,"aria-haspopup":"dialog",onClick:()=>i(a=>!a),children:[(0,d.jsx)(Q,{size:14}),f("git.act.branches"),(0,d.jsx)(B.A,{size:13})]}),h&&(0,d.jsxs)("div",{className:"gx-pop",role:"dialog","aria-label":f("git.act.branches"),children:[(0,d.jsxs)("div",{className:"search",children:[(0,d.jsx)(I.A,{size:14}),(0,d.jsx)("input",{className:"input",autoFocus:!0,placeholder:f("git.br.search"),value:l,onChange:a=>m(a.target.value),"aria-label":f("git.br.search")})]}),(0,d.jsxs)("div",{className:"gx-newbr",children:[(0,d.jsx)("input",{className:"input mono",placeholder:f("git.br.newPlaceholder"),value:n,onChange:a=>o(a.target.value.trim()),"aria-label":f("git.br.new",{branch:c??""}),onKeyDown:a=>{"Enter"===a.key&&A&&z("switch",f("git.done.switch",{branch:n}),"switch",{branch:n,create:!0})}}),(0,d.jsxs)("button",{className:"btn sm",disabled:!A||!!b.busy,title:f("git.br.new",{branch:c??"…"}),onClick:()=>void z("switch",f("git.done.switch",{branch:n}),"switch",{branch:n,create:!0}),children:[(0,d.jsx)(H.A,{size:14}),f("git.br.create")]})]}),u&&(0,d.jsx)("p",{className:"gx-note err",children:u}),(0,d.jsxs)("div",{className:"gx-brlist",children:[x.length>0&&(0,d.jsx)("div",{className:"gx-brhead",children:f("git.br.local")}),x.map(a=>(0,d.jsxs)("div",{className:`gx-br ${a.name===c?"cur":""}`,children:[(0,d.jsxs)("button",{className:"grow",disabled:a.name===c||!!b.busy,onClick:()=>{i(!1),e(a.name)},title:f("git.br.switchTo",{branch:a.name}),children:[(0,d.jsxs)("span",{className:"nm",children:[a.name===c&&(0,d.jsx)(aB.A,{size:13}),a.name]}),(0,d.jsxs)("span",{className:"sub",children:[a.subject," \xb7 ",(0,q.KN)(Date.parse(a.date))]})]}),a.name!==c&&(0,d.jsx)("button",{className:"btn ghost icon sm",disabled:!!b.busy,onClick:()=>r(a.name),"aria-label":f("git.br.merge",{branch:c??""}),title:f("git.br.merge",{branch:c??""}),children:(0,d.jsx)(aY,{size:14})}),a.name!==c&&(0,d.jsx)("button",{className:"btn ghost icon sm",disabled:!!b.busy,onClick:()=>{b.setNotice(null),t(a.name),i(!1)},"aria-label":f("git.br.delete",{branch:a.name}),title:f("git.br.delete",{branch:a.name}),children:(0,d.jsx)(aN.A,{size:14})})]},a.name)),y.length>0&&(0,d.jsx)("div",{className:"gx-brhead",children:f("git.br.remote")}),y.map(a=>(0,d.jsxs)("div",{className:"gx-br",children:[(0,d.jsxs)("button",{className:"grow",disabled:!!b.busy,onClick:()=>{let b=a.name.split("/").slice(1).join("/");i(!1),e(b)},title:f("git.br.switchTo",{branch:a.name}),children:[(0,d.jsx)("span",{className:"nm",children:a.name}),(0,d.jsxs)("span",{className:"sub",children:[a.subject," \xb7 ",(0,q.KN)(Date.parse(a.date))]})]}),(0,d.jsx)("button",{className:"btn ghost icon sm",disabled:!!b.busy,onClick:()=>r(a.name),"aria-label":f("git.br.merge",{branch:c??""}),title:f("git.br.merge",{branch:c??""}),children:(0,d.jsx)(aY,{size:14})})]},a.name)),j&&!x.length&&!y.length&&(0,d.jsx)("p",{className:"gx-note",children:f("git.br.none")})]}),p&&(0,d.jsxs)("div",{className:"gx-mergeask",children:[(0,d.jsx)("span",{children:f("git.br.mergeAsk",{from:p,into:c??""})}),(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsx)("button",{className:"btn ghost sm",onClick:()=>r(null),children:f("common.cancel")}),(0,d.jsx)("button",{className:"btn primary sm",disabled:!!b.busy,onClick:()=>void z("merge",f("git.done.merge",{branch:p}),"merge",{branch:p}),children:f("git.br.mergeGo")})]})]})]}),s&&(0,d.jsxs)(L.aF,{title:f("git.br.delete",{branch:s}),onClose:()=>t(null),children:[(0,d.jsx)("p",{className:"confirm-body",children:f("git.br.deleteAsk",{branch:s})}),b.notice&&(0,d.jsx)("pre",{className:"gx-notice err gx-prewrap",children:b.notice.text}),(0,d.jsxs)("div",{className:"row confirm-actions",children:[(0,d.jsx)("button",{className:"btn ghost",onClick:()=>t(null),children:f("common.cancel")}),b.notice&&/not fully merged/i.test(b.notice.text)?(0,d.jsx)("button",{className:"btn danger",disabled:!!b.busy,onClick:async()=>{await b.run("branch-delete",f("git.done.branchDelete"),"branch-delete",{branch:s,force:!0})&&t(null)},children:f("git.br.deleteForce")}):(0,d.jsx)("button",{className:"btn danger",disabled:!!b.busy,onClick:async()=>{await b.run("branch-delete",f("git.done.branchDelete"),"branch-delete",{branch:s})&&t(null)},children:f("git.br.deleteGo")})]})]})]})}function a$({changes:a,a:b,onClose:c,initialMessage:e=""}){let{t:f}=(0,D.s9)(),[h,i]=(0,g.useState)(()=>new Set(a.map(a=>a.path))),[j,k]=(0,g.useState)(e),l=a.filter(a=>h.has(a.path)),m=l.flatMap(a=>a.oldPath?[a.path,a.oldPath]:[a.path]),n=!!j.trim()&&l.length>0&&!b.busy,o=async a=>{if(!await b.run("commit",f("git.done.commit"),"commit",{message:j,paths:m}))return void c();c(),a&&await b.run("push",f("git.done.push"),"push")};return(0,d.jsxs)(L.aF,{title:f("git.commit.title"),onClose:c,children:[(0,d.jsxs)("div",{className:"gx-cfiles",children:[(0,d.jsxs)("div",{className:"row",children:[(0,d.jsx)("span",{className:"small muted grow",children:f("git.commit.selected",{n:l.length,total:a.length})}),(0,d.jsx)("button",{className:"btn ghost sm",onClick:()=>i(new Set(a.map(a=>a.path))),children:f("git.commit.all")}),(0,d.jsx)("button",{className:"btn ghost sm",onClick:()=>i(new Set),children:f("git.commit.none")})]}),(0,d.jsx)("div",{className:"gx-clist",children:a.map(a=>(0,d.jsxs)("label",{className:"gx-crow",title:a.path,children:[(0,d.jsx)("input",{type:"checkbox",checked:h.has(a.path),onChange:()=>{let b;return b=a.path,i(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})}}),(0,d.jsx)(au,{status:a.status}),(0,d.jsx)("span",{className:"mono nm",children:a.path}),(null!==a.additions||null!==a.deletions)&&(0,d.jsxs)("span",{className:"gx-counts sm",children:[(0,d.jsxs)("i",{className:"add",children:["+",a.additions??0]}),(0,d.jsxs)("i",{className:"del",children:["−",a.deletions??0]})]})]},a.path))})]}),(0,d.jsxs)("div",{className:"field",children:[(0,d.jsx)("label",{children:f("git.commit.message")}),(0,d.jsx)("textarea",{className:"textarea",rows:4,autoFocus:!0,value:j,onChange:a=>k(a.target.value),placeholder:f("git.commit.placeholder"),onKeyDown:a=>{(a.ctrlKey||a.metaKey)&&"Enter"===a.key&&n&&o(!1)}}),(0,d.jsx)("span",{className:"hint",children:f("git.commit.hint")})]}),(0,d.jsxs)("div",{className:"row confirm-actions",children:[(0,d.jsx)("button",{className:"btn ghost",onClick:c,children:f("common.cancel")}),(0,d.jsx)("button",{className:"btn",disabled:!n,onClick:()=>void o(!1),children:"commit"===b.busy?f("git.commit.committing"):f("git.commit.go")}),(0,d.jsx)("button",{className:"btn primary",disabled:!n,onClick:()=>void o(!0),children:f("git.commit.goPush")})]})]})}function a_({agent:a,head:b,sel:c,onSelect:e,refs:f,path:h,onClearPath:i}){let{t:j}=(0,D.s9)(),[k,l]=(0,g.useState)(null),[m,n]=(0,g.useState)(!1),[o,r]=(0,g.useState)(!1),[s,t]=(0,g.useState)(""),[u,v]=(0,g.useState)(""),[w,x]=(0,g.useState)("message"),[y,z]=(0,g.useState)(""),[A,B]=(0,g.useState)(""),C=!!(A||h||y),E=async b=>{r(!0);try{let c=`skip=${b}${A?`&q=${encodeURIComponent(A)}&by=${w}`:""}${h?`&path=${encodeURIComponent(h)}`:""}${y?`&ref=${encodeURIComponent(y)}`:""}`,d=await p.FH.get(`/agents/${a.id}/git/log?${c}`);return l(a=>0===b?d.commits:[...a??[],...d.commits]),n(d.hasMore),t(""),d.commits}catch(a){return t(a instanceof Error?a.message:"error"),null}finally{r(!1)}};return(0,g.useRef)(""),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"gx-hfilter",children:[(0,d.jsxs)("div",{className:"search",children:[(0,d.jsx)(I.A,{size:14}),(0,d.jsx)("input",{className:"input",placeholder:j("git.hist.search"),value:u,onChange:a=>v(a.target.value),"aria-label":j("git.hist.search"),title:"content"===w?j("git.hist.by.hint"):void 0})]}),(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsxs)("select",{className:"input",value:w,onChange:a=>x(a.target.value),"aria-label":j("git.hist.search"),title:j("git.hist.by.hint"),children:[(0,d.jsx)("option",{value:"message",children:j("git.hist.by.message")}),(0,d.jsx)("option",{value:"author",children:j("git.hist.by.author")}),(0,d.jsx)("option",{value:"content",children:j("git.hist.by.content")})]}),(0,d.jsx)(aD,{refs:f,value:y,onChange:z,extra:[{value:"",label:j("git.hist.branchCurrent")},{value:"all",label:j("git.hist.branchAll")}]})]}),h&&(0,d.jsxs)("div",{className:"gx-chip soft gx-pathchip",children:[(0,d.jsx)("span",{className:"mono nm",title:h,children:j("git.hist.file",{path:h})}),(0,d.jsx)("button",{className:"btn ghost icon sm",onClick:i,"aria-label":j("git.hist.clearFile"),title:j("git.hist.clearFile"),children:(0,d.jsx)(ag.A,{size:13})})]})]}),s?(0,d.jsx)("p",{className:"gx-note err",children:s}):k?k.length?(0,d.jsxs)("div",{className:"gx-hist",role:"listbox","aria-label":j("git.tab.history"),children:[k.map(a=>(0,d.jsxs)("button",{role:"option","aria-selected":c===a.sha,className:`gx-commit ${c===a.sha?"sel":""}`,onClick:()=>e(a.sha),children:[(0,d.jsx)("span",{className:"subj",children:a.subject||"—"}),(0,d.jsxs)("span",{className:"meta",children:[(0,d.jsx)("span",{className:"mono sha",children:a.short})," \xb7 ",a.author," \xb7 ",(0,q.KN)(Date.parse(a.date))]}),(a.refs.length>0||a.merge)&&(0,d.jsxs)("span",{className:"refs",children:[a.merge&&(0,d.jsx)("i",{className:"ref",children:j("git.hist.merge")}),a.refs.slice(0,3).map(a=>(0,d.jsx)("i",{className:"ref",children:a},a))]})]},a.sha)),m&&(0,d.jsx)("button",{className:"btn sm gx-more",disabled:o,onClick:()=>void E(k.length),children:o?j("git.loading"):j("git.hist.more")})]}):(0,d.jsx)("p",{className:"gx-note",children:C?j("git.hist.noMatch"):j("git.hist.empty")}):(0,d.jsx)("p",{className:"gx-note",children:j("git.loading")})]})}function a0({files:a,all:b,summary:c,file:e,onConfirm:f,onClose:g}){let{t:h}=(0,D.s9)(),i=(0,d.jsxs)("ul",{className:"gx-dlist",children:[a.slice(0,8).map(a=>(0,d.jsx)("li",{className:"mono",children:a},a)),a.length>8&&(0,d.jsx)("li",{className:"muted",children:h("hover.more",{count:a.length-8})})]});if(!b&&e&&!a.length){let a=e.add||e.del?` (+${e.add} −${e.del})`:"";return(0,d.jsxs)(L.TM,{danger:!0,title:h("git.discard.file.title"),confirmLabel:h("git.discard.file.go"),onConfirm:f,onClose:g,children:[(0,d.jsx)("p",{className:"gx-file-eff mono",children:e.path}),(0,d.jsx)("p",{className:"confirm-body",children:"deleted"===e.status?h("git.discard.file.deleted"):"renamed"===e.status?h("git.discard.file.renamed",{from:e.oldPath??""}):h("git.discard.file.modified",{lines:a})}),(0,d.jsx)("p",{className:"gx-lost",children:h("git.discard.all.warn")})]})}return b?(0,d.jsxs)(L.TM,{danger:!0,title:h("git.discard.all.title"),confirmLabel:h("git.discard.all.go"),onConfirm:f,onClose:g,children:[(0,d.jsxs)("ul",{className:"gx-effects",children:[c&&c.restore>0&&(0,d.jsx)("li",{children:h("git.discard.all.restore",{count:c.restore})}),a.length>0&&(0,d.jsxs)("li",{className:"bad",children:[(0,d.jsx)("b",{children:h("git.discard.all.delete",{count:a.length})}),i]})]}),c&&(0,d.jsx)("p",{className:"muted small confirm-body",children:h("git.discard.all.lines",{add:c.add,del:c.del})}),(0,d.jsx)("p",{className:"gx-lost",children:h("git.discard.all.warn")})]}):(0,d.jsx)(L.TM,{danger:!0,title:h("git.discard.confirm.title"),body:h("git.discard.confirm.body",{count:a.length}),confirmLabel:h("git.discard.confirm.go"),onConfirm:f,onClose:g,children:i})}let a1=(0,u.A)("UserSearch",[["circle",{cx:"10",cy:"7",r:"4",key:"e45bow"}],["path",{d:"M10.3 15H7a4 4 0 0 0-4 4v2",key:"3bnktk"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}]]);function a2({agent:a,path:b,ignored:c=!1,change:e,stamp:f,refs:h,focusLine:i,onHistory:j,onOpenCommit:k,onDiscard:l,onDiscardHunk:n,onDiscardLines:o}){let{t:p}=(0,D.s9)(),[q,r]=(0,g.useState)(!1),s=!!e&&!ad.test(b),t=ae.test(b),[u,v]=(0,g.useState)(i?"file":s?"diff":t?"preview":"file"),[w,x]=(0,g.useState)("unified"),[y,z]=(0,g.useState)(null),[A,B]=(0,g.useState)(null),[E,F]=(0,g.useState)(null),[G,H]=(0,g.useState)(!1),[I,J]=(0,g.useState)(!1),K=ad.test(b),[M,N]=(0,g.useState)(null),O=(0,g.useMemo)(()=>y&&y.path===b?ah(y.diff):null,[y,b]),[P,Q]=(0,g.useState)(null),R=e?.status==="untracked"||e?.status==="added"&&!e.oldPath,T=(0,g.useMemo)(()=>P&&P.path===b?ah(P.diff):null,[P,b]),U=(0,g.useMemo)(()=>T?function(a){let b=new Map,c=new Set,d=new Map,e=new Map,f=[];for(let g of a.hunks){let a=g.lines,h=[],i=Number(/\+(\d+)/.exec(g.header)?.[1]??1);for(let b=0;b<a.length;b++)h[b]=i,"del"!==a[b].kind&&(i=(a[b].newNo??i)+1);let j=[];for(let b=0;b<a.length;){if("ctx"===a[b].kind){b++;continue}let c=b;for(;b<a.length&&"ctx"!==a[b].kind;)b++;j.push([c,b-1])}for(let[g,k]of j){let j=f.length,l=1/0,m=-1/0;for(let f=g;f<=k;){if("ctx"===a[f].kind){f++;continue}let g=[],n=[];for(;f<=k&&"del"===a[f].kind;)g.push(a[f++]);for(;f<=k&&"add"===a[f].kind;)n.push(a[f++]);n.forEach((a,c)=>{let e=a.newNo;b.set(e,c<g.length?"mod":"add"),d.set(e,j),l=Math.min(l,e),m=Math.max(m,e)});let o=n.length?n[n.length-1].newNo+1:f<a.length?h[f]:i;g.length>n.length&&(c.add(o),e.set(o,j),l=Math.min(l,o),m=Math.max(m,o))}let n=g;for(let b=0;b<3&&n>0&&"ctx"===a[n-1].kind;b++)n--;let o=k;for(let b=0;b<3&&o<a.length-1&&"ctx"===a[o+1].kind;b++)o++;let p=a.slice(n,o+1),q=p.filter(a=>void 0!==a.oldNo),r=p.filter(a=>void 0!==a.newNo);f.push({from:l,to:m,view:{header:`@@ -${q[0]?.oldNo??0},${q.length} +${r[0]?.newNo??0},${r.length} @@`,section:"",lines:p}})}}return{lines:b,removedBefore:c,blockOfLine:d,blockOfRemoval:e,groups:f}}(T):null,[T]),V=b.lastIndexOf("/"),W=V>=0?b.slice(0,V+1):"",X=b.slice(V+1);return(0,d.jsxs)("section",{className:"gx-preview","aria-label":b,children:[(0,d.jsxs)("header",{className:"gx-phead",children:[(0,d.jsxs)("div",{className:"gx-ptitle",children:[(0,d.jsxs)("span",{className:"gx-path mono",title:b,children:[(0,d.jsx)("span",{className:"dir",children:W}),(0,d.jsx)("b",{children:X})]}),c&&(0,d.jsx)("span",{className:"gx-chip soft",title:p("git.ignored.hint"),children:p("git.ignored.chip")}),e&&(0,d.jsx)("span",{className:`gx-chip st-${e.status}`,children:p(`git.status.${e.status}`)}),e?.staged&&(0,d.jsx)("span",{className:"gx-chip soft",children:p("git.staged")}),e?.unstaged&&"untracked"!==e.status&&(0,d.jsx)("span",{className:"gx-chip soft",children:p("git.unstaged")}),e&&(null!==e.additions||null!==e.deletions)&&(0,d.jsxs)("span",{className:"gx-counts",children:[(0,d.jsxs)("i",{className:"add",children:["+",e.additions??0]}),(0,d.jsxs)("i",{className:"del",children:["−",e.deletions??0]})]}),A&&!e&&(0,d.jsx)("span",{className:"muted small",children:(0,C.zi)(A.size)})]}),(0,d.jsxs)("div",{className:"gx-ptr",children:[e?.status!=="untracked"&&!c&&(0,d.jsx)("button",{type:"button",className:"btn ghost icon sm",title:p("git.file.history"),"aria-label":p("git.file.history"),onClick:()=>j(b),children:(0,d.jsx)(m.A,{size:15})}),e?.status!=="untracked"&&!c&&(0,d.jsx)(aD,{refs:h,value:M??"",onChange:N,compact:!0,label:p("git.file.viewAt"),extra:[{value:"",label:p("git.file.viewAt")}]}),!K&&!c&&!M&&e?.status!=="deleted"&&e?.status!=="untracked"&&e?.status!=="conflict"&&(()=>{let a=q&&"file"===u;return(0,d.jsx)("button",{type:"button",className:`btn ghost icon sm ${a?"on":""}`,"aria-pressed":a,"aria-label":p("git.blame"),title:`${p("git.blame")}: ${p("git.blame.hint")}`,onClick:()=>{"file"!==u?(v("file"),r(!0)):r(a=>!a)},children:(0,d.jsx)(a1,{size:15})})})(),(0,d.jsx)(Y.WQ,{text:b,label:p("git.copyPath"),compact:!0}),e&&"conflict"!==e.status&&(0,d.jsxs)("button",{type:"button",className:"btn sm",title:p("git.discard.hint"),onClick:()=>l(e),children:[(0,d.jsx)(S,{size:14}),p("git.discard")]})]}),(0,d.jsx)("div",{className:"gx-ptools",children:(0,d.jsxs)("div",{className:"gx-ptl",children:[(e||t)&&(0,d.jsx)(L.$q,{value:u,onChange:v,options:[...e?[{id:"diff",label:p("git.view.diff")}]:[],...t?[{id:"preview",label:p("git.view.preview")}]:[],{id:"file",label:p(t?"git.view.source":"git.view.file")}]}),"diff"===u&&e&&(0,d.jsx)(L.$q,{value:w,onChange:x,options:[{id:"unified",label:p("git.layout.unified")},{id:"split",label:p("git.layout.split")}]})]})})]}),e?.oldPath&&(0,d.jsx)("div",{className:"gx-banner",children:p("git.renamedFrom",{path:e.oldPath})}),M&&(0,d.jsxs)("div",{className:"gx-banner row gap-s",children:[(0,d.jsx)("span",{className:"grow",children:p("git.file.atRef",{ref:M})}),(0,d.jsx)("button",{className:"btn sm",onClick:()=>N(null),children:p("git.file.backToCurrent")})]}),M?(0,d.jsx)(as,{agent:a,gitRef:M,path:e?.oldPath&&M?e.oldPath:b,toolbar:!1}):(0,d.jsx)("div",{className:"gx-body",children:E?(0,d.jsx)("p",{className:"gx-note err",children:E}):!G||O||A?"diff"===u&&e?O?O.binary?(0,d.jsx)("p",{className:"gx-note",children:p("git.diff.binary")}):0===O.hunks.length?(0,d.jsx)("p",{className:"gx-note",children:p("git.diff.empty")}):(0,d.jsxs)(d.Fragment,{children:[y?.truncated&&(0,d.jsx)("div",{className:"gx-banner",children:p("git.diff.truncated")}),(0,d.jsx)(ap,{parsed:O,layout:w,path:b,cutOff:!!y?.truncated,onDiscardHunk:e?.status==="modified"?(a,c)=>n(b,a,c):void 0,onDiscardLines:e?.status==="modified"?(a,c,d)=>o(b,a,c,d):void 0})]}):null:K&&!I&&e?.status!=="deleted"?(0,d.jsx)("div",{className:"gx-image",children:(0,d.jsx)("img",{src:`/api/agents/${a.id}/git/raw?path=${encodeURIComponent(b)}&v=${f}`,alt:X,onError:()=>J(!0)})}):"preview"===u&&A&&A.path===b?(0,d.jsxs)("div",{className:"gx-md md",children:[A.truncated&&(0,d.jsx)("div",{className:"gx-banner",children:p("git.diff.truncated")}),(0,d.jsx)(ab.oz,{remarkPlugins:[ac.A],components:{a:a=>(0,d.jsx)("a",{...a,target:"_blank",rel:"noreferrer"})},children:A.content})]}):A&&A.path===b?(0,d.jsx)(ar,{f:A,agent:a,blame:q,onOpenCommit:k,marks:U,allNew:R,focusLine:i}):K&&I?(0,d.jsx)("p",{className:"gx-note",children:p("git.file.binary")}):null:(0,d.jsx)("p",{className:"gx-note",children:p("git.loading")})})]})}let a3=(0,u.A)("FileImage",[["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"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);var a4=c(78381);let a5=(0,u.A)("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);function a6({name:a}){return ad.test(a)?(0,d.jsx)(a3,{size:15}):/\.(md|mdx|txt|rst)$/i.test(a)?(0,d.jsx)(a4.A,{size:15}):(0,am.eX)(a)?(0,d.jsx)(a5,{size:15}):(0,d.jsx)(T.A,{size:15})}let a7=(0,g.memo)(function({rows:a,expanded:b,forceOpen:c,sel:e,onToggle:f,onSelect:h,label:i}){let{t:j}=(0,D.s9)(),k=(0,g.useRef)(null),[l,m]=(0,g.useState)(null),n=a=>`${a.ignored?"i:":""}${a.path}`,o=a.some(a=>n(a.node)===l)?l:a.find(a=>a.node.path===e&&!a.node.ignored)?.node.path??(a[0]?n(a[0].node):null),p=(0,g.useCallback)(a=>{let b=[...k.current?.querySelectorAll("[data-row]")??[]],c=b.indexOf(document.activeElement),d=c=>{a.preventDefault(),b[Math.max(0,Math.min(b.length-1,c))]?.focus()};if("ArrowDown"===a.key)d(c+1);else if("ArrowUp"===a.key)d(c-1);else if("Home"===a.key)d(0);else if("End"===a.key)d(b.length-1);else if(c>=0&&("ArrowRight"===a.key||"ArrowLeft"===a.key)){let e=b[c],f="1"===e.dataset.dir,g="true"===e.getAttribute("aria-expanded");if("ArrowRight"===a.key)f&&!g?(a.preventDefault(),e.click()):f&&g&&d(c+1);else if(f&&g)a.preventDefault(),e.click();else{let a=Number(e.getAttribute("aria-level"));for(let e=c-1;e>=0;e--)if(Number(b[e].getAttribute("aria-level"))<a){d(e);break}}}},[]);return(0,d.jsx)("div",{className:"gx-tree-rows",ref:k,onKeyDown:p,role:"tree","aria-label":i,children:a.map(({node:a,depth:g})=>{let i="dir"===a.type,k=i&&(c||b.has(a.path)),l=a.change,p=n(a);return(0,d.jsxs)("button",{"data-row":!0,"data-dir":i?"1":"0","data-path":a.path,type:"button",role:"treeitem","aria-level":g+1,"aria-expanded":i?!!k:void 0,"aria-selected":!i&&e===a.path,tabIndex:o===p?0:-1,onFocus:()=>m(p),className:`gx-row ${i?"dir":"file"} ${a.ignored?"ignored":""} ${l?`changed st-${l.status}`:""} ${!i&&e===a.path?"sel":""} ${i&&a.changed?"has-changes":""}`,style:{paddingLeft:8+14*g},title:a.ignored?`${a.path}: ${j("git.ignored.hint")}`:a.path,onClick:()=>i?f(a):h(a.path),children:[(0,d.jsx)("span",{className:"chev",children:i?k?(0,d.jsx)(B.A,{size:14}):(0,d.jsx)(R.A,{size:14}):null}),(0,d.jsx)("span",{className:"ico",children:i?k?(0,d.jsx)(aa.A,{size:15}):(0,d.jsx)(O.A,{size:15}):(0,d.jsx)(a6,{name:a.name})}),(0,d.jsx)("span",{className:"nm",children:a.name}),i&&a.changed>0&&(0,d.jsx)("span",{className:"dirdot",title:j("git.dirChanged",{count:a.changed}),children:a.changed}),l&&(0,d.jsxs)("span",{className:"meta",children:[(null!==l.additions||null!==l.deletions)&&(0,d.jsxs)("span",{className:"gx-counts sm",children:[(0,d.jsxs)("i",{className:"add",children:["+",l.additions??0]}),(0,d.jsxs)("i",{className:"del",children:["−",l.deletions??0]})]}),(0,d.jsx)(au,{status:l.status,titled:!0})]})]},p)})})}),a8=(0,u.A)("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]),a9=(0,u.A)("GitCompareArrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),ba=(0,u.A)("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]),bb=["files","history","tags","compare","stashes"],bc={files:a8,history:m.A,tags:_,compare:a9,stashes:ba},bd=a=>`gx-tab-${a}`,be="gx-side-panel";function bf({mode:a,onChange:b,stashCount:c,label:e}){let{t:f}=(0,D.s9)(),g=a=>`${f(`git.tab.${a}`)}${"stashes"===a&&c?` \xb7 ${c}`:""}`;return(0,d.jsx)("div",{className:"gx-tabs",role:"tablist","aria-label":e,onKeyDown:c=>{let d=bb.indexOf(a),e=null;"ArrowRight"===c.key||"ArrowDown"===c.key?e=(d+1)%bb.length:"ArrowLeft"===c.key||"ArrowUp"===c.key?e=(d-1+bb.length)%bb.length:"Home"===c.key?e=0:"End"===c.key&&(e=bb.length-1),null!==e&&(c.preventDefault(),b(bb[e]),requestAnimationFrame(()=>document.getElementById(bd(bb[e]))?.focus()))},children:bb.map((c,e)=>{let f=bc[c];return(0,d.jsxs)("button",{id:bd(c),type:"button",role:"tab","aria-selected":a===c,"aria-controls":be,tabIndex:a===c?0:-1,"aria-label":g(c),title:`${g(c)} (Alt+${e+1})`,className:`gx-tab ${a===c?"on":""}`,onClick:()=>b(c),children:[(0,d.jsx)(f,{size:15}),a===c&&(0,d.jsx)("span",{children:g(c)})]},c)})})}function bg({agent:a,git:b}){let{t:c}=(0,D.s9)(),{status:e,tree:f,loading:h,error:i,refresh:j}=b,[k,l]=(0,g.useState)(null),[m,n]=(0,g.useState)(new Set),[o,r]=(0,g.useState)(""),[s,t]=(0,g.useState)(!1),[u,v]=(0,g.useState)(!1),[w,x]=(0,g.useState)("files"),[y,z]=(0,g.useState)(null),[A,E]=(0,g.useState)({base:"",head:""}),[F,G]=(0,g.useState)(!1),[H,J]=(0,g.useState)(null),[K,M]=(0,g.useState)(),N=(0,g.useRef)(null),[_,aa]=(0,g.useState)(null),[ab,ac]=(0,g.useState)(null),[ad,ae]=(0,g.useState)(null),[af,ag]=(0,g.useState)(!1),[ah,ai]=(0,g.useState)(null),[aj,ak]=(0,g.useState)(!1),[al,am]=(0,g.useState)(null),[an,ao]=(0,g.useState)(!1),ap=function(a,b){let{t:c}=(0,D.s9)(),d=(0,L.dj)(),[e,f]=(0,g.useState)(null),[h,i]=(0,g.useState)(null),j=async(e,g,h,j={})=>{f(e),i(null);try{let e=await p.FH.post(`/agents/${a.id}/git/${h}`,j),f=(e.output??"").split("\n").filter(Boolean).pop()??"",i=["conflicts"===e.pending?c("git.pending.conflicts"):"",e.kept?.length?c("git.sw.kept",{count:e.kept.length,names:e.kept.slice(0,3).join(", ")}):""].filter(Boolean).join(", ");return d(i?`${g}: ${i}`:f&&f.length<90?`${g}: ${f}`:g),await b(),!0}catch(d){let a=d instanceof Error?d.message:"error";return i({title:c("git.notice.failed",{action:g}),text:a,diverged:/fast-forward|divergent/i.test(a)}),await b(),!1}finally{f(null)}};return{busy:e,notice:h,setNotice:i,run:j}}(a,()=>j()),[aq,ar]=(0,g.useState)(null),as=(0,Z.Wx)();(0,g.useRef)(new Set);let at=e&&e.isRepo?e:null,au=function(a,b){let[c,d]=(0,g.useState)(null);return c}(0,at?.head?.sha),av=f&&f.isRepo?f.files:null,aw=f&&f.isRepo?f.ignored:null,[aA,aB]=(0,g.useState)({}),aC=(0,g.useMemo)(()=>at&&av?W(av,at.changes,as.showIgnored?aw??[]:[],aA):null,[at,av,aw,aA,as.showIgnored]),aD=(0,g.useMemo)(()=>{let a=(aw??[]).map(a=>a.replace(/\/$/,""));return b=>a.some(a=>b===a||b.startsWith(`${a}/`))},[aw]),aG=(0,g.useMemo)(()=>new Map((at?.changes??[]).map(a=>[a.path,a])),[at]),aH=(0,g.useMemo)(()=>(at?.changes??[]).reduce((a,b)=>({add:a.add+(b.additions??0),del:a.del+(b.deletions??0)}),{add:0,del:0}),[at]);a.id;let aI=(0,g.useMemo)(()=>aC?X(aC,m,{query:o,onlyChanged:s}):[],[aC,m,o,s]),aL=(0,g.useMemo)(()=>aI.slice(0,2e3),[aI]),aM=(0,g.useRef)(aA);aM.current=aA;let aN=(0,g.useCallback)(b=>{let c;c=b.path,n(a=>{let b=new Set(a);return b.has(c)?b.delete(c):b.add(c),b}),!b.ignored||!b.lazy||b.path in aM.current||p.FH.get(`/agents/${a.id}/git/ls?path=${encodeURIComponent(b.path)}`).then(a=>aB(c=>({...c,[b.path]:a.entries}))).catch(()=>aB(a=>({...a,[b.path]:[]})))},[a.id]),aR=(0,g.useCallback)(a=>{M(void 0),l(a)},[]);if(i&&!e)return(0,d.jsx)("div",{className:"gx",children:(0,d.jsxs)("div",{className:"gx-empty",children:[(0,d.jsx)("h3",{children:c("git.error.title")}),(0,d.jsx)("p",{children:i}),(0,d.jsx)("button",{className:"btn",onClick:()=>void j(),children:c("git.refresh")})]})});if(!e)return(0,d.jsx)("div",{className:"gx",children:(0,d.jsx)("div",{className:"gx-empty",children:(0,d.jsx)("p",{children:c("git.loading")})})});if(!e.isRepo)return(0,d.jsx)("div",{className:"gx",children:(0,d.jsxs)("div",{className:"gx-empty",children:[(0,d.jsx)(O.A,{size:26,className:"muted"}),(0,d.jsx)("h3",{children:"not-repo"===e.reason?c("git.notRepo.title"):"no-git"===e.reason?c("git.noGit.title"):c("git.error.title")}),(0,d.jsx)("p",{children:"not-repo"===e.reason?c("git.notRepo.body",{path:e.cwd.replace(/^\/home\/[^/]+/,"~")}):"no-git"===e.reason?c("git.noGit.body"):e.message}),(0,d.jsxs)("button",{className:"btn",onClick:()=>void j(),children:[(0,d.jsx)(P.A,{size:14}),c("git.refresh")]})]})});let aS=k?aG.get(k):void 0,aT=a=>ap.run("switch",a.carried?c("git.done.switchCarried",{branch:a.to,count:a.carried}):c("git.done.switch",{branch:a.to}),a.overlap.length||a.collisions.length?"switch-smart":"switch",{branch:a.to}),aU=async b=>{try{let c=await p.FH.get(`/agents/${a.id}/git/switch-plan?branch=${encodeURIComponent(b)}`);c.others.length||c.selfRunning?ai(c):await aT(c)}catch(a){ap.setNotice({title:c("git.notice.failed",{action:c("git.done.switch",{branch:b})}),text:a instanceof Error?a.message:"error",diverged:!1})}},aV=a=>a.filter(a=>"untracked"===a.status||"added"===a.status&&!a.oldPath).map(a=>a.path),aY=(0,C.Xd)(e.generatedAt);return(0,d.jsxs)("div",{className:"gx","data-gx-theme":as.theme,style:{"--g-tab":as.tabSize},children:[(0,d.jsxs)("div",{className:"gx-bar",children:[(0,d.jsxs)("button",{type:"button",className:"gx-branch","aria-expanded":u,"aria-controls":"gx-info",title:c("git.info.toggle"),onClick:()=>v(a=>!a),children:[(0,d.jsx)(Q,{size:14}),(0,d.jsx)("span",{className:"bn",children:e.branch??(e.head?`${c("git.detached")} ${e.head.sha}`:c("git.noCommitsBranch"))}),e.head&&(0,d.jsx)("span",{className:"sha",children:e.head.sha}),e.upstream&&(e.upstream.ahead>0||e.upstream.behind>0)&&(0,d.jsxs)("span",{className:"ab",title:c("git.upstream"),children:[e.upstream.ahead>0&&`↑${e.upstream.ahead}`,e.upstream.ahead>0&&e.upstream.behind>0&&" ",e.upstream.behind>0&&`↓${e.upstream.behind}`]}),u?(0,d.jsx)(B.A,{size:14}):(0,d.jsx)(R.A,{size:14})]}),(0,d.jsx)("span",{className:"grow"}),(0,d.jsx)("span",{className:"gx-sum",children:0===e.changes.length?(0,d.jsx)("span",{className:"muted",children:c("git.clean")}):(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)("span",{title:c("git.summary",{count:e.changes.length}),"aria-label":c("git.summary",{count:e.changes.length}),children:[(0,d.jsx)("b",{children:e.changes.length})," ",(0,d.jsx)("span",{className:"muted",children:c("git.files.short")})," ",(0,d.jsxs)("i",{className:"add",children:["+",(0,C._E)(aH.add)]})," ",(0,d.jsxs)("i",{className:"del",children:["−",(0,C._E)(aH.del)]})]})})}),(0,d.jsx)(aZ,{agent:a,a:ap,current:e.branch,onSwitch:a=>void aU(a)}),(0,d.jsx)(aX,{a:ap,ahead:e.upstream?.ahead??0,behind:e.upstream?.behind??0,detached:!e.branch,changeCount:e.changes.length,onCommit:()=>ao(!0)}),(0,d.jsx)("button",{className:"btn ghost icon sm",disabled:!!ap.busy||0===e.changes.length||!!e.state,onClick:()=>{let a=aV(e.changes);ar({files:a,all:!0,summary:{restore:e.changes.length-a.length,add:aH.add,del:aH.del},go:async()=>{let a=await ap.run("discard-all",c("git.done.discard"),"discard-all");return a&&l(null),a}})},"aria-label":c("git.discard.all"),title:e.state?c("git.discard.all.blocked"):c("git.discard.all"),children:(0,d.jsx)(S,{size:15})}),(0,d.jsx)($.i,{}),(0,d.jsx)("button",{className:"btn ghost icon sm",onClick:()=>void j(),"aria-label":c("git.refresh"),title:`${c("git.refresh")} \xb7 ${c("git.updated",{time:aY})}`,children:(0,d.jsx)(P.A,{size:15,className:h?"spin":""})})]}),u&&(0,d.jsxs)("dl",{id:"gx-info",className:"gx-info",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:c("git.info.branch")}),(0,d.jsxs)("dd",{className:"mono",children:[e.branch??(e.head?`${c("git.detached")} ${e.head.sha}`:c("git.noCommitsBranch")),e.branch&&(0,d.jsx)(Y.WQ,{text:e.branch,label:c("git.info.copyBranch")})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:c("git.info.upstreamLabel")}),(0,d.jsx)("dd",{children:e.upstream?0===e.upstream.ahead&&0===e.upstream.behind?c("git.info.inSync"):c("git.info.upstreamStatus",{ahead:e.upstream.ahead,behind:e.upstream.behind}):(0,d.jsx)("span",{className:"muted",children:c("git.info.noUpstream")})})]}),e.head?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:c("git.info.commit")}),(0,d.jsxs)("dd",{className:"mono",children:[e.head.sha,(0,d.jsx)(Y.WQ,{text:e.head.sha,label:c("git.info.copySha")})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:c("git.info.message")}),(0,d.jsx)("dd",{className:"msg",children:e.head.subject||(0,d.jsx)("span",{className:"muted",children:"—"})})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:c("git.info.author")}),(0,d.jsx)("dd",{children:e.head.author})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:c("git.info.when")}),(0,d.jsxs)("dd",{children:[(0,C.v7)(e.head.when)," ",(0,d.jsxs)("span",{className:"muted",children:["\xb7 ",(0,q.KN)(Date.parse(e.head.when))]})]})]})]}):(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:c("git.info.commit")}),(0,d.jsx)("dd",{className:"muted",children:c("git.noCommits")})]})]}),"running"===a.status&&(0,d.jsx)("div",{className:"gx-warn",children:c("git.warn.running",{name:a.name})}),e.state&&(()=>{let a=e.changes.filter(a=>"conflict"===a.status),b="merge"===e.state?c("git.state.merge"):"rebase"===e.state?c("git.state.rebase"):c("git.state.stash");return(0,d.jsxs)("div",{className:"gx-state",role:"status",children:[(0,d.jsx)("b",{children:b}),(0,d.jsxs)("span",{className:"grow",children:["stash"===e.state&&e.stash&&(0,d.jsxs)(d.Fragment,{children:[c("git.state.stash.hint",{from:e.stash.from,to:e.stash.to})," \xb7 "]}),a.length>0?c("git.state.conflicts",{count:a.length}):c("git.state.ready")]}),0===a.length&&("merge"===e.state?(0,d.jsx)("button",{className:"btn primary sm",disabled:!!ap.busy,onClick:()=>ao(!0),children:c("git.state.finishMerge")}):"rebase"===e.state?(0,d.jsx)("button",{className:"btn primary sm",disabled:!!ap.busy,onClick:()=>void ap.run("continue",c("git.done.rebaseContinue"),"rebase-continue"),children:c("git.state.continueRebase")}):(0,d.jsx)("button",{className:"btn primary sm",disabled:!!ap.busy,onClick:()=>void ap.run("smart",c("git.done.smartFinish"),"smart-finish"),children:c("git.state.finishStash")})),"stash"===e.state?(0,d.jsx)("button",{className:"btn sm danger",disabled:!!ap.busy,onClick:()=>ak(!0),children:c("git.state.cancelStash")}):(0,d.jsx)("button",{className:"btn sm danger",disabled:!!ap.busy,onClick:()=>void ap.run("abort",c("git.done.mergeAbort"),"merge-abort"),children:"merge"===e.state?c("git.state.abortMerge"):c("git.state.abortRebase")})]})})(),(0,d.jsx)(aW,{a:ap}),e.scope&&(0,d.jsx)("div",{className:"gx-scope",children:c("git.scope",{path:e.scope})}),(0,d.jsxs)("div",{className:"gx-main",children:[(0,d.jsxs)("aside",{className:"gx-tree","aria-label":c("git.filesLabel"),children:[(0,d.jsx)(bf,{mode:w,onChange:x,stashCount:ab?.length??0,label:c("git.filesLabel")}),(0,d.jsx)("div",{className:"gx-sidepanel",id:be,role:"tabpanel","aria-labelledby":bd(w),children:"stashes"===w?(0,d.jsx)(aO,{stashes:ab,sel:ad,onSelect:ae,onSave:()=>ag(!0),canSave:e.changes.length>0&&!e.state}):"tags"===w?(0,d.jsx)(ay,{agent:a,sel:_?.name??null,onSelect:aa}):"compare"===w?(0,d.jsx)(aE,{refs:au,sel:A,onChange:E}):"history"===w?(0,d.jsx)(a_,{agent:a,head:e.head?.sha,sel:al,onSelect:am,refs:au,path:y,onClearPath:()=>z(null)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"gx-filter",children:[(0,d.jsxs)("div",{className:"search",children:[(0,d.jsx)(I.A,{size:14}),(0,d.jsx)("input",{ref:N,className:"input",placeholder:F?c("git.search.placeholder"):c("git.filterPlaceholder"),value:o,onChange:a=>r(a.target.value),"aria-label":c("git.filterPlaceholder")})]}),(0,d.jsxs)("div",{className:"seg icons",role:"group","aria-label":c("git.search.name"),children:[(0,d.jsx)("button",{type:"button","aria-pressed":!F,title:c("git.search.name"),"aria-label":c("git.search.name"),onClick:()=>G(!1),children:(0,d.jsx)(T.A,{size:14})}),(0,d.jsx)("button",{type:"button","aria-pressed":F,title:c("git.search.content"),"aria-label":c("git.search.content"),onClick:()=>G(!0),children:(0,d.jsx)(U,{size:14})})]}),!F&&(0,d.jsxs)("button",{type:"button",className:`btn sm gx-onlych ${s?"primary":""}`,"aria-pressed":s,title:c("git.filter.changed"),onClick:()=>t(a=>!a),children:[(0,d.jsx)(V,{size:14}),e.changes.length>0&&(0,d.jsx)("span",{className:"ct",children:e.changes.length})]})]}),F?(0,d.jsx)("div",{className:"gx-list gx-hits",children:o.trim().length<2?(0,d.jsx)("p",{className:"gx-note",children:c("git.search.min")}):H&&H.q===o.trim()?0===H.hits.length?(0,d.jsx)("p",{className:"gx-note",children:c("git.search.none",{query:H.q})}):(0,d.jsxs)(d.Fragment,{children:[H.hits.map((a,b)=>(0,d.jsxs)("button",{type:"button",className:`gx-hit ${k===a.path&&K?.line===a.line?"sel":""}`,onClick:()=>{l(a.path),M({line:a.line,key:Date.now()})},title:`${a.path}:${a.line}`,children:[(0,d.jsxs)("span",{className:"mono nm",children:[a.path,(0,d.jsxs)("i",{children:[":",a.line]})]}),(0,d.jsx)("span",{className:"mono tx",children:a.text.trim()})]},`${a.path}:${a.line}:${b}`)),H.truncated&&(0,d.jsx)("p",{className:"gx-note",children:c("git.search.capped",{count:H.hits.length})})]}):(0,d.jsx)("p",{className:"gx-note",children:c("git.search.searching")})}):(0,d.jsxs)("div",{className:"gx-list",children:[aC?0===aL.length?(0,d.jsx)("p",{className:"gx-note",children:o?c("git.noMatch",{query:o}):s?c("git.clean"):c("git.noFiles")}):(0,d.jsx)(a7,{rows:aL,expanded:m,forceOpen:!!(o||s),sel:k,onToggle:aN,onSelect:aR,label:c("git.filesLabel")}):(0,d.jsx)("p",{className:"gx-note",children:c("git.loading")}),aI.length>aL.length&&(0,d.jsx)("p",{className:"gx-note",children:c("git.rowsCapped",{count:aL.length})}),f?.isRepo&&f.truncated&&(0,d.jsx)("p",{className:"gx-note",children:c("git.treeTruncated",{count:f.files.length})})]})]})})]}),"stashes"===w?ab?.find(a=>a.sha===ad)?(0,d.jsx)(aQ,{agent:a,stash:ab.find(a=>a.sha===ad),a:ap},ad):(0,d.jsx)("div",{className:"gx-preview",children:(0,d.jsx)("div",{className:"gx-empty",children:(0,d.jsx)("p",{children:c("git.stash.empty")})})}):"compare"===w?(0,d.jsx)(aF,{agent:a,sel:A}):"tags"===w?_?(0,d.jsx)(az,{agent:a,tag:_,onChanged:()=>void j()},_.name):(0,d.jsx)("div",{className:"gx-preview",children:(0,d.jsx)("div",{className:"gx-empty",children:(0,d.jsx)("p",{children:c("git.tags.select")})})}):"history"===w?al?(0,d.jsx)(ax,{agent:a,sha:al,focus:y??void 0},`${al}|${y??""}`):(0,d.jsx)("div",{className:"gx-preview",children:(0,d.jsx)("div",{className:"gx-empty",children:(0,d.jsx)("p",{children:c("git.hist.select")})})}):k&&aS?.status==="conflict"?(0,d.jsx)(aJ,{agent:a,path:k,state:e.state,a:ap,onResolved:()=>{j()}},k):k?(0,d.jsx)(a2,{agent:a,path:k,ignored:aD(k),change:aS,stamp:e.generatedAt,refs:au,focusLine:K,onHistory:a=>{z(a),am(null),x("history")},onOpenCommit:a=>{am(a),x("history")},onDiscard:a=>ar({files:aV([a]),all:!1,file:{path:a.path,status:a.status,oldPath:a.oldPath,add:a.additions??0,del:a.deletions??0},go:async()=>{let b=await ap.run("discard",c("git.done.discard"),"discard",{path:a.path,oldPath:a.oldPath});return b&&aV([a]).length&&l(null),b}}),onDiscardHunk:(a,b,d)=>void ap.run("discard-hunk",c("git.done.discard"),"discard-hunk",{path:a,index:b,header:d}),onDiscardLines:(a,b,d,e)=>void ap.run("discard-lines",c("git.done.discard"),"discard-lines",{path:a,index:b,header:d,lines:e})},k):(0,d.jsx)("div",{className:"gx-preview",children:(0,d.jsx)("div",{className:"gx-empty",children:(0,d.jsx)("p",{children:c("git.select")})})})]}),ah&&(0,d.jsx)(aK,{agent:a,plan:ah,a:ap,onClose:()=>ai(null),onGo:()=>{ai(null),aT(ah)}}),af&&(0,d.jsx)(aP,{a:ap,onClose:()=>ag(!1)}),aj&&e.stash&&(0,d.jsx)(L.TM,{danger:!0,title:c("git.state.cancelStash.title"),body:c("git.state.cancelStash.body",{from:e.stash.from}),confirmLabel:c("git.state.cancelStash.go"),onClose:()=>ak(!1),onConfirm:()=>{ap.busy||ap.run("smart",c("git.done.smartCancel"),"smart-cancel")}}),aq&&(0,d.jsx)(a0,{files:aq.files,all:aq.all,summary:aq.summary,file:aq.file,onClose:()=>ar(null),onConfirm:()=>{aq.go()}}),an&&(0,d.jsx)(a$,{changes:e.changes,a:ap,initialMessage:e.mergeMsg,onClose:()=>ao(!1)})]})}var bh=c(58664),bi=c(15964),bj=c(71556),bk=c(40123),bl=c(59686);function bm({agent:a}){let{t:b}=(0,D.s9)(),{refresh:c}=(0,o.o0)(),e=(0,L.dj)(),[f,h]=(0,g.useState)(null),[i,j]=(0,g.useState)(""),[k,l]=(0,g.useState)(""),[m,n]=(0,g.useState)(!1),[r,s]=(0,g.useState)(!1),t=(0,g.useRef)(""),u=!!f&&i!==t.current,v=(0,g.useRef)(!1);v.current=u;let w=(0,g.useCallback)(async(b=!1)=>{try{let c=await p.FH.get(`/agents/${a.id}/notebook`);h(a=>a&&a.version===c.version&&a.enabled===c.enabled?a:c),(b||!v.current)&&(t.current=c.content,j(c.content))}catch(a){l(a instanceof Error?a.message:String(a))}},[a.id]),x=async(c=i)=>{if(f){n(!0),l("");try{let d=await p.FH.put(`/agents/${a.id}/notebook`,{content:c,version:f.version});h({...f,...d}),t.current=d.content,j(d.content),e(b("notebook.saved"))}catch(a){l(a instanceof Error?a.message:String(a))}n(!1)}},y=async()=>{try{await p.FH.patch(`/agents/${a.id}`,{skill_ids:[...new Set([...a.skill_ids,f.skill_id])]}),await c(["agents"]),await w(!0)}catch(a){l(a instanceof Error?a.message:String(a))}};if(!f)return(0,d.jsx)("div",{className:"pane",children:(0,d.jsx)("p",{className:"hint",children:k||b("git.loading")})});let z=i.length,A=z>f.max,B=z>.8*f.max;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"pane",children:[(0,d.jsx)("p",{className:"hint",style:{margin:0},children:b("notebook.intro")}),!f.enabled&&(0,d.jsxs)("div",{className:"banner honey",children:[(0,d.jsx)(bj.A,{size:16}),(0,d.jsx)("div",{className:"grow",children:b("notebook.off")}),(0,d.jsx)("button",{className:"btn sm",onClick:y,children:b("notebook.on")})]}),k&&(0,d.jsxs)("div",{className:"banner err",children:[(0,d.jsx)(bj.A,{size:16}),(0,d.jsx)("div",{className:"grow",children:k}),(0,d.jsxs)("button",{className:"btn sm",onClick:()=>{l(""),w(!0)},children:[(0,d.jsx)(P.A,{size:13}),b("notebook.reload")]})]}),(0,d.jsxs)("div",{className:"row small muted",style:{justifyContent:"space-between"},children:[(0,d.jsxs)("span",{children:[(0,d.jsx)(bk.A,{size:12,style:{verticalAlign:"-1px"}})," ",f.updated_at?b("notebook.updated",{who:b("user"===f.updated_by?"notebook.by.you":"notebook.by.agent"),when:(0,q.KN)(f.updated_at)}):b("notebook.never")]}),(0,d.jsxs)("span",{style:{color:A?"var(--danger, #c0392b)":B?"var(--honey)":void 0},children:[z.toLocaleString()," / ",f.max.toLocaleString()]})]}),(0,d.jsx)(bl.n,{value:i,onChange:j,placeholder:b("notebook.placeholder"),defaultView:"write",minHeight:320})]}),(0,d.jsxs)("div",{className:"savebar col",children:[(0,d.jsx)("span",{className:"muted small",children:u?b("agent.unsavedChanges"):b("agent.allSaved")}),(0,d.jsxs)("div",{className:"row",children:[(0,d.jsxs)("button",{className:"btn danger sm",style:{marginRight:"auto"},disabled:!i.trim()||m,onClick:()=>s(!0),children:[(0,d.jsx)(aN.A,{size:14}),b("notebook.clear")]}),u&&(0,d.jsx)("button",{className:"btn ghost sm",onClick:()=>j(t.current),children:b("common.discard")}),(0,d.jsx)("button",{className:"btn primary sm",disabled:!u||m||A,onClick:()=>void x(),children:b("notebook.save")})]})]}),r&&(0,d.jsxs)(L.aF,{title:b("notebook.clear.title"),onClose:()=>s(!1),children:[(0,d.jsx)("p",{style:{margin:0},className:"muted",children:b("notebook.clear.confirm")}),(0,d.jsxs)("div",{className:"row",style:{justifyContent:"flex-end"},children:[(0,d.jsx)("button",{className:"btn ghost",onClick:()=>s(!1),children:b("common.cancel")}),(0,d.jsx)("button",{className:"btn danger",onClick:()=>{s(!1),x("")},children:b("notebook.clear")})]})]})]})}let bn=["config","notebook","sessions"];function bo({params:a}){let{id:b}=(0,g.use)(a);return(0,d.jsx)(bp,{id:b},b)}function bp({id:a}){let{t:b}=(0,D.s9)(),{ready:c,error:h,retry:u,refresh:v}=(0,o.q5)(),w=(0,o.fJ)(a),x=(0,j.useRouter)(),y=(0,L.dj)(),[z,A]=(0,s.Z)("tab",""),[B,C]=(0,g.useState)("config"),F=bn.includes(z)?z:B,G=""!==z,[H,I]=(0,g.useState)(!1),[J,K]=(0,g.useState)([]),[M,O]=(0,g.useState)(void 0),[P,Q]=(0,g.useState)(null),[R,S]=(0,g.useState)("chat"),[T,U]=(0,r.ud)("hive-switcher-collapsed",0),V=1===T,W=()=>U(+!V),X=function(a,b){let{finished:c}=(0,o.o0)(),d=a?.id??"";c[d];let[e,f]=(0,g.useState)(null),[h,i]=(0,g.useState)(null),[j,k]=(0,g.useState)(!1),[l,m]=(0,g.useState)(null),n=(0,g.useRef)(0);a?.effective.cwd;let q=a?.status==="running",r=(0,g.useCallback)(async a=>{if(!d)return;let b=++n.current;k(!0);try{let[c,e]=await Promise.all([p.FH.get(`/agents/${d}/git/status`),a?p.FH.get(`/agents/${d}/git/tree`):Promise.resolve(null)]);if(b!==n.current)return;f(c),e&&i(e),m(null)}catch(a){b===n.current&&m(a instanceof Error?a.message:"error")}finally{b===n.current&&k(!1)}},[d]);return(0,bh.n)(()=>r(!0),5e3,{enabled:b&&q,immediate:!1}),{status:e,tree:h,loading:j,error:l,refresh:(0,g.useCallback)(()=>r(!0),[r])}}(w,"changes"===R),Y=X.status&&X.status.isRepo?X.status.changes.length:0,Z=(a,b)=>{let c=b??F;C(c),A(a?c:"")},$=(0,f.A)(w,{onDeleted:()=>x.push("/agents")}),{draft:_,setDraft:aa,errors:ab,dirty:ac}=$,ad=()=>{ac?I(!0):Z(!1)};if(!w)return(0,d.jsxs)("div",{className:`ws ${V?"sw-collapsed":""}`,children:[(0,d.jsx)(N,{activeId:a,collapsed:V,onToggle:W}),(0,d.jsx)("div",{className:"page",children:!c&&h?(0,d.jsxs)(L.lZ,{kind:"err",children:[(0,d.jsx)("span",{children:h})," ",(0,d.jsx)("button",{type:"button",className:"btn sm",onClick:()=>void u(),children:b("fa.retry")})]}):c?(0,d.jsx)(L.pp,{title:b("agent.missing.title"),body:b("agent.missing.body"),action:(0,d.jsx)(i(),{className:"btn",href:"/agents",children:b("agent.missing.back")})}):null})]});let ae=async c=>{await p.FH.post(`/agents/${a}/resume-session`,{session_id:c}),O(void 0),y(b("agent.resumed"))},af=J.filter(a=>"delegation"!==a.kind),ag=J.filter(a=>"delegation"===a.kind),ah=J.find(a=>a.session_id===M)?.kind==="delegation",ai=[...M?[{id:"make-current",label:b("agent.makeCurrent"),onClick:()=>void ae(M).catch(a=>y(a instanceof Error?a.message:String(a),"err")),disabled:ah},{id:"back-current",label:b("agent.backToCurrent"),onClick:()=>O(void 0)}]:[],{id:"new-conv",label:b("agent.newConversation"),icon:(0,d.jsx)(k.A,{size:14}),onClick:()=>Q("new"),disabled:!w.session_id||"running"===w.status}];return(0,d.jsxs)("div",{className:`ws ${V?"sw-collapsed":""}`,children:[(0,d.jsx)(N,{activeId:a,collapsed:V,onToggle:W}),(0,d.jsxs)("section",{className:"ws-chat",children:[(0,d.jsx)(L.DS,{back:{href:"/",label:b("agent.backToColony")},avatar:(0,d.jsx)(L._h,{agent:w}),title:w.name,meta:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(L.PW,{role:w.role}),(0,d.jsx)(L.dJ,{provider:w.provider}),(0,d.jsx)("span",{className:"small",children:w.model||b("model.cliDefault")}),(0,d.jsx)(L.P5,{status:w.status})]}),actions:ai,primary:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"seg",role:"group","aria-label":b("git.tab.label"),children:[(0,d.jsx)("button",{type:"button","aria-pressed":"chat"===R,onClick:()=>S("chat"),children:b("git.tab.chat")}),(0,d.jsxs)("button",{type:"button","aria-pressed":"changes"===R,onClick:()=>S("changes"),children:[b("git.tab.changes"),Y>0&&(0,d.jsx)("span",{className:"tabcount",children:Y})]})]}),(0,d.jsx)(e.N,{spec:{agentId:a},title:b("dock.agent")}),(0,d.jsxs)("button",{type:"button",className:`btn sm ${G?"primary":""}`,onClick:()=>G?ad():Z(!0),"aria-expanded":G,"aria-label":b("colony.agentSettings"),children:[(0,d.jsx)(l.A,{size:14}),b("agent.settings"),ac&&(0,d.jsx)("i",{className:"dot run",title:b("agent.unsaved")})]})]})}),(0,d.jsxs)("div",{className:"chat-pane",hidden:"chat"!==R,children:[(0,d.jsx)(E,{agent:w,session:M}),(0,d.jsx)(t.ry,{agent:w,sessionOverride:M})]}),"changes"===R&&(0,d.jsx)(bg,{agent:w,git:X})]}),G&&(0,d.jsx)(L._s,{title:w.name,subtitle:`${b(`role.${w.role}`)} \xb7 ${q.xq[w.provider].label}`,onClose:ad,footer:"config"===F&&_?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:"muted small grow",children:[ac?b("agent.unsavedChanges"):b("agent.allSaved"),ac&&"running"===w.status?` ${b("agent.appliesNextTurn")}`:""]}),$.actions({size:"sm"})]}):void 0,children:(0,d.jsxs)("div",{className:"agent-config",children:[(0,d.jsx)(L.tU,{idPrefix:"cfg",label:b("fa.cfg.tabs"),value:F,onChange:a=>Z(!0,a),tabs:[{id:"config",label:b("agent.tab.config")},{id:"notebook",label:b("agent.tab.notebook")},{id:"sessions",label:b("nav.sessions")}]}),(0,d.jsx)(L.Kp,{id:"config",value:F,idPrefix:"cfg",children:_&&(0,d.jsx)(d.Fragment,{children:(0,d.jsx)("div",{className:"pane",children:(0,d.jsx)(bi.SU,{draft:_,onChange:aa,errors:ab,selfId:a})})})}),(0,d.jsx)(L.Kp,{id:"notebook",value:F,idPrefix:"cfg",children:(0,d.jsx)(bm,{agent:w})}),(0,d.jsx)(L.Kp,{id:"sessions",value:F,idPrefix:"cfg",children:(0,d.jsxs)("div",{className:"pane",children:[(0,d.jsx)("p",{className:"hint m0",children:b("agent.sessions.intro",{path:(0,q._1)(w.effective.cwd)})}),(0,d.jsx)("div",{className:"eyebrow",children:b("agent.sessions.conversations")}),0===af.length?(0,d.jsx)(L.pp,{compact:!0,icon:(0,d.jsx)(m.A,{size:22}),title:b("agent.sessions.empty")}):af.map(a=>{let c=a.session_id===w.session_id;return(0,d.jsxs)("div",{className:`card card-pad col fa-sess ${M===a.session_id?"on":""}`,children:[(0,d.jsxs)("div",{className:"row",children:[(0,d.jsxs)("span",{className:"mono grow",children:[a.session_id.slice(0,18),"…"]}),c&&(0,d.jsx)("span",{className:"chip honey",children:b("sessions.current")})]}),(0,d.jsx)("span",{className:"muted small",children:b("agent.sessions.started",{started:(0,q.KN)(a.first_seen),last:(0,q.KN)(a.last_seen)})}),(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsx)("button",{className:"btn sm",onClick:()=>{O(c?void 0:a.session_id),Z(!1)},children:M===a.session_id?b("agent.sessions.viewing"):b("agent.sessions.read")}),!c&&(0,d.jsx)("button",{className:"btn sm",onClick:()=>ae(a.session_id).then(()=>Z(!1)).catch(a=>y(a instanceof Error?a.message:String(a),"err")),children:b("agent.sessions.resume")})]})]},a.session_id)}),ag.length>0&&(0,d.jsx)("div",{className:"eyebrow mt-s",children:b("agent.sessions.delegated")}),ag.map(a=>(0,d.jsxs)("div",{className:`card card-pad col fa-sess ${M===a.session_id?"on":""}`,children:[(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsx)(n.A,{size:14,className:"muted"}),(0,d.jsx)("b",{className:"grow",children:b("agent.sessions.from",{name:a.from_name??b("chat.anOrchestrator")})}),(0,d.jsx)("span",{className:"muted small",children:(0,q.KN)(a.last_seen)})]}),a.task&&(0,d.jsx)("span",{className:"small fa-clamp3",children:a.task}),(0,d.jsx)("div",{className:"row gap-s",children:(0,d.jsx)("button",{className:"btn sm",onClick:()=>{O(M===a.session_id?void 0:a.session_id),Z(!1)},children:M===a.session_id?b("agent.sessions.viewing"):b("agent.sessions.read")})})]},a.session_id))]})})]})}),$.deleteModal,H&&(0,d.jsx)(L.TM,{danger:!0,title:b("fa.unsaved.title"),body:b("fa.unsaved.body"),confirmLabel:b("fa.unsaved.discard"),cancelLabel:b("fa.unsaved.keep"),onClose:()=>I(!1),onConfirm:()=>{$.discard(),Z(!1)}}),"new"===P&&(0,d.jsx)(L.TM,{title:b("agent.newConvTitle"),body:b("agent.newConvBody"),confirmLabel:b("agent.newConvStart"),onClose:()=>Q(null),onConfirm:async()=>{await p.FH.post(`/agents/${a}/new-session`),await v(["agents"]),y(b("agent.newConvStarted"))}})]})}},33873:a=>{"use strict";a.exports=require("path")},38550:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(51537).A)("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]])},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},49519:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>F.a,__next_app__:()=>L,handler:()=>N,pages:()=>K,routeModule:()=>M,tree:()=>J});var d=c(62009),e=c(51640),f=c(52679),g=c(69985),h=c(91790),i=c(81200),j=c(54530),k=c(35977),l=c(234),m=c(43472),n=c(12698),o=c(28976),p=c(54084),q=c(16307),r=c(53063),s=c(72428),t=c(261),u=c(48291),v=c(56032),w=c(26713),x=c(83370),y=c(10143),z=c(27155),A=c(77620),B=c(13428),C=c(50164),D=c(86439),E=c(2972),F=c.n(E),G=c(94672),H=c(18313),I={};for(let a in G)0>["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(I[a]=()=>G[a]);c.d(b,I);let J={children:["",{children:["agents",{children:["[id]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,27769)),"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/agents/[id]/page.tsx"]}]},{}]},{metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,84507))).default(a),async a=>(await Promise.resolve().then(c.bind(c,23575))).default(a)],apple:[async a=>(await Promise.resolve().then(c.bind(c,54287))).default(a)],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(c.bind(c,61918)),"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,2972,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,96298,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,60075,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,79678,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,84507))).default(a),async a=>(await Promise.resolve().then(c.bind(c,23575))).default(a)],apple:[async a=>(await Promise.resolve().then(c.bind(c,54287))).default(a)],openGraph:[],twitter:[],manifest:void 0}}]}.children,K=["/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/agents/[id]/page.tsx"],L={require:c,loadChunk:()=>Promise.resolve()},M=new e.AppPageRouteModule({definition:{kind:f.RouteKind.APP_PAGE,page:"/agents/[id]/page",pathname:"/agents/[id]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:J},distDir:".next",relativeProjectDir:""});async function N(a,b,e){var E;let I="/agents/[id]/page";"/index"===I&&(I="/");let O=(0,i.getRequestMeta)(a,"postponed"),P=(0,i.getRequestMeta)(a,"minimalMode"),Q=await M.prepare(a,b,{srcPage:I,multiZoneDraftMode:!1});if(!Q)return b.statusCode=400,b.end("Bad Request"),null==e.waitUntil||e.waitUntil.call(e,Promise.resolve()),null;let{buildId:R,query:S,params:T,parsedUrl:U,pageIsDynamic:V,buildManifest:W,nextFontManifest:X,reactLoadableManifest:Y,serverActionsManifest:Z,clientReferenceManifest:$,subresourceIntegrityManifest:_,prerenderManifest:aa,isDraftMode:ab,resolvedPathname:ac,revalidateOnlyGenerated:ad,routerServerContext:ae,nextConfig:af,interceptionRoutePatterns:ag}=Q,ah=U.pathname||"/",ai=(0,t.normalizeAppPath)(I),{isOnDemandRevalidate:aj}=Q,ak=M.match(ah,aa),al=!!aa.routes[ac]&&(M.isDev||(0,d.isRouteCacheOwner)(ac,M.cacheOwner,aa.routes[ac])),am=!!(ak||al||aa.routes[ai]),an=a.headers["user-agent"]||"",ao=(0,w.getBotType)(an),ap=(0,r.isHtmlBotRequest)(a),aq=(0,i.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[v.NEXT_ROUTER_PREFETCH_HEADER],ar=(0,i.getRequestMeta)(a,"isRSCRequest")??(0,o.f)(a.headers[v.RSC_HEADER]),as=(0,u.getIsPossibleServerAction)(a),at=(0,n.checkIsAppPPREnabled)(af.experimental.ppr)&&(null==(E=aa.routes[ai]??aa.dynamicRoutes[ai])?void 0:E.renderingMode)==="PARTIALLY_STATIC",au=!1,av=!1,aw=at?O:void 0,ax=at&&ar&&!aq,ay=(0,i.getRequestMeta)(a,"segmentPrefetchRSCRequest"),az=!an||(0,r.shouldServeStreamingMetadata)(an,af.htmlLimitedBots);ap&&at&&(am=!1,az=!1);let aA=!0===M.isDev||!am||"string"==typeof O||ax,aB=ap&&at,aC=null;ab||!am||aA||as||aw||ax||(aC=ac);let aD=aC;!aD&&M.isDev&&(aD=ac),M.isDev||ab||!am||!ar||ax||(0,l.d)(a.headers);let aE={...G,tree:J,pages:K,GlobalError:F(),handler:N,routeModule:M,__next_app__:L};Z&&$&&(0,q.setReferenceManifestsSingleton)({page:I,clientReferenceManifest:$,serverActionsManifest:Z,serverModuleMap:(0,s.createServerModuleMap)({serverActionsManifest:Z})});let aF=a.method||"GET",aG=(0,h.getTracer)(),aH=aG.getActiveScopeSpan();try{let d=M.getVaryHeader(ac,ag);b.setHeader("Vary",d);let g=async(c,d)=>{let e=new m.NodeNextRequest(a),f=new m.NodeNextResponse(b);return M.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=aG.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==j.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${aF} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aF} ${a.url}`)})},l=async({span:d,postponed:f,fallbackRouteParams:h})=>{let j={query:S,params:T,page:ai,sharedContext:{buildId:R},serverComponentsHmrCache:(0,i.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:h,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aE,Component:(0,k.T)(aE),params:T,routeModule:M,page:I,postponed:f,shouldWaitOnAllReady:aB,serveStreamingMetadata:az,supportsDynamicResponse:"string"==typeof f||aA,buildManifest:W,nextFontManifest:X,reactLoadableManifest:Y,subresourceIntegrityManifest:_,serverActionsManifest:Z,clientReferenceManifest:$,setIsrStatus:null==ae?void 0:ae.setIsrStatus,dir:c(33873).join(process.cwd(),M.relativeProjectDir),isDraftMode:ab,isRevalidate:am&&!f&&!ax,botType:ao,isOnDemandRevalidate:aj,isPossibleServerAction:as,assetPrefix:af.assetPrefix,nextConfigOutput:af.output,crossOrigin:af.crossOrigin,trailingSlash:af.trailingSlash,previewProps:aa.preview,deploymentId:af.deploymentId,enableTainting:af.experimental.taint,htmlLimitedBots:af.htmlLimitedBots,devtoolSegmentExplorer:af.experimental.devtoolSegmentExplorer,reactMaxHeadersLength:af.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:(0,i.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:af.experimental.cacheLife,basePath:af.basePath,serverActions:af.experimental.serverActions,...au?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isRevalidate:!0,isDebugDynamicAccesses:au}:{},experimental:{isRoutePPREnabled:at,expireTime:af.expireTime,staleTimes:af.experimental.staleTimes,cacheComponents:!!af.experimental.cacheComponents,clientSegmentCache:!!af.experimental.clientSegmentCache,clientParamParsing:!!af.experimental.clientParamParsing,dynamicOnHover:!!af.experimental.dynamicOnHover,inlineCss:!!af.experimental.inlineCss,authInterrupts:!!af.experimental.authInterrupts,clientTraceMetadata:af.experimental.clientTraceMetadata||[]},waitUntil:e.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d)=>M.onRequestError(a,b,d,ae),err:(0,i.getRequestMeta)(a,"invokeError"),dev:M.isDev}},l=await g(d,j),{metadata:m}=l,{cacheControl:n,headers:o={},fetchTags:p}=m;if(p&&(o[A.NEXT_CACHE_TAGS_HEADER]=p),a.fetchMetrics=m.fetchMetrics,am&&(null==n?void 0:n.revalidate)===0&&!M.isDev&&!at){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ac}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
4
4
  see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:x.CachedRouteKind.APP_PAGE,html:l,headers:o,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:n}},n=async({hasResolved:c,previousCacheEntry:d,isRevalidating:g,span:h})=>{let j,k=!1===M.isDev,m=c||b.writableEnded;if(aj&&ad&&!d&&!P)return(null==ae?void 0:ae.render404)?await ae.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(ak&&(j=(0,y.parseFallbackField)(ak.fallback)),j===y.FallbackMode.PRERENDER&&(0,w.isBot)(an)&&(!at||ap)&&(j=y.FallbackMode.BLOCKING_STATIC_RENDER),(null==d?void 0:d.isStale)===-1&&(aj=!0),aj&&(j!==y.FallbackMode.NOT_FOUND||d)&&(j=y.FallbackMode.BLOCKING_STATIC_RENDER),!P&&j!==y.FallbackMode.BLOCKING_STATIC_RENDER&&aD&&!m&&!ab&&V&&(k||!al)){let b;if((k||ak)&&j===y.FallbackMode.NOT_FOUND)throw new D.NoFallbackError;if(at&&!ar){let c="string"==typeof(null==ak?void 0:ak.fallback)?ak.fallback:k?ai:null;if(b=await M.handleResponse({cacheKey:c,req:a,nextConfig:af,routeKind:f.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:aa,isRoutePPREnabled:at,responseGenerator:async()=>l({span:h,postponed:void 0,fallbackRouteParams:k||av?(0,p.u)(ai):null}),waitUntil:e.waitUntil}),null===b)return null;if(b)return delete b.cacheControl,b}}let n=aj||g||!aw?void 0:aw;if(au&&void 0!==n)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:x.CachedRouteKind.PAGES,html:z.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let o=V&&at&&((0,i.getRequestMeta)(a,"renderFallbackShell")||av)?(0,p.u)(ah):null;return l({span:h,postponed:n,fallbackRouteParams:o})},o=async c=>{var d,g,h,j,k;let m,o=await M.handleResponse({cacheKey:aC,responseGenerator:a=>n({span:c,...a}),routeKind:f.RouteKind.APP_PAGE,isOnDemandRevalidate:aj,isRoutePPREnabled:at,req:a,nextConfig:af,prerenderManifest:aa,waitUntil:e.waitUntil});if(ab&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),M.isDev&&b.setHeader("Cache-Control","no-store, must-revalidate"),!o){if(aC)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(d=o.value)?void 0:d.kind)!==x.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(h=o.value)?void 0:h.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let p="string"==typeof o.value.postponed;am&&!ax&&(!p||aq)&&(P||b.setHeader("x-nextjs-cache",aj?"REVALIDATED":o.isMiss?"MISS":o.isStale?"STALE":"HIT"),b.setHeader(v.NEXT_IS_PRERENDER_HEADER,"1"));let{value:q}=o;if(aw)m={revalidate:0,expire:void 0};else if(P&&ar&&!aq&&at)m={revalidate:0,expire:void 0};else if(!M.isDev)if(ab)m={revalidate:0,expire:void 0};else if(am){if(o.cacheControl)if("number"==typeof o.cacheControl.revalidate){if(o.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${o.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});m={revalidate:o.cacheControl.revalidate,expire:(null==(j=o.cacheControl)?void 0:j.expire)??af.expireTime}}else m={revalidate:A.CACHE_ONE_YEAR,expire:void 0}}else b.getHeader("Cache-Control")||(m={revalidate:0,expire:void 0});if(o.cacheControl=m,"string"==typeof ay&&(null==q?void 0:q.kind)===x.CachedRouteKind.APP_PAGE&&q.segmentData){b.setHeader(v.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=q.headers)?void 0:k[A.NEXT_CACHE_TAGS_HEADER];P&&am&&c&&"string"==typeof c&&b.setHeader(A.NEXT_CACHE_TAGS_HEADER,c);let d=q.segmentData.get(ay);return void 0!==d?(0,C.sendRenderResult)({req:a,res:b,generateEtags:af.generateEtags,poweredByHeader:af.poweredByHeader,result:z.default.fromStatic(d,v.RSC_CONTENT_TYPE_HEADER),cacheControl:o.cacheControl}):(b.statusCode=204,(0,C.sendRenderResult)({req:a,res:b,generateEtags:af.generateEtags,poweredByHeader:af.poweredByHeader,result:z.default.EMPTY,cacheControl:o.cacheControl}))}let r=(0,i.getRequestMeta)(a,"onCacheEntry");if(r&&await r({...o,value:{...o.value,kind:"PAGE"}},{url:(0,i.getRequestMeta)(a,"initURL")}))return null;if(p&&aw)throw Object.defineProperty(Error("Invariant: postponed state should not be present on a resume request"),"__NEXT_ERROR_CODE",{value:"E396",enumerable:!1,configurable:!0});if(q.headers){let a={...q.headers};for(let[c,d]of(P&&am||delete a[A.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let s=null==(g=q.headers)?void 0:g[A.NEXT_CACHE_TAGS_HEADER];if(P&&am&&s&&"string"==typeof s&&b.setHeader(A.NEXT_CACHE_TAGS_HEADER,s),!q.status||ar&&at||(b.statusCode=q.status),!P&&q.status&&H.RedirectStatusCode[q.status]&&ar&&(b.statusCode=200),p&&b.setHeader(v.NEXT_DID_POSTPONE_HEADER,"1"),ar&&!ab){if(void 0===q.rscData){if(q.postponed)throw Object.defineProperty(Error("Invariant: Expected postponed to be undefined"),"__NEXT_ERROR_CODE",{value:"E372",enumerable:!1,configurable:!0});return(0,C.sendRenderResult)({req:a,res:b,generateEtags:af.generateEtags,poweredByHeader:af.poweredByHeader,result:q.html,cacheControl:ax?{revalidate:0,expire:void 0}:o.cacheControl})}return(0,C.sendRenderResult)({req:a,res:b,generateEtags:af.generateEtags,poweredByHeader:af.poweredByHeader,result:z.default.fromStatic(q.rscData,v.RSC_CONTENT_TYPE_HEADER),cacheControl:o.cacheControl})}let t=q.html;if(!p||P||ar)return(0,C.sendRenderResult)({req:a,res:b,generateEtags:af.generateEtags,poweredByHeader:af.poweredByHeader,result:t,cacheControl:o.cacheControl});if(au)return t.push(new ReadableStream({start(a){a.enqueue(B.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,C.sendRenderResult)({req:a,res:b,generateEtags:af.generateEtags,poweredByHeader:af.poweredByHeader,result:t,cacheControl:{revalidate:0,expire:void 0}});let u=new TransformStream;return t.push(u.readable),l({span:c,postponed:q.postponed,fallbackRouteParams:null}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==x.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(u.writable)}).catch(a=>{u.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,C.sendRenderResult)({req:a,res:b,generateEtags:af.generateEtags,poweredByHeader:af.poweredByHeader,result:t,cacheControl:{revalidate:0,expire:void 0}})};if(!aH)return await aG.withPropagatedContext(a.headers,()=>aG.trace(j.BaseServerSpan.handleRequest,{spanName:`${aF} ${a.url}`,kind:h.SpanKind.SERVER,attributes:{"http.method":aF,"http.target":a.url}},o));await o(aH)}catch(b){throw b instanceof D.NoFallbackError||await M.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"render",revalidateReason:(0,g.c)({isRevalidate:am,isOnDemandRevalidate:aj})},ae),b}}},54842:(a,b,c)=>{"use strict";c.d(b,{E:()=>f});var d=c(93043),e=c(2335);function f(a){if(!a)return null;let b=a.blocks[a.blocks.length-1],c="dispatch"===a.source?(0,d.Tl)("activity.delegated"):"";if(!b)return`${c}${(0,d.Tl)("activity.starting")}`;if("tool"===b.type){let a=(0,e.q0)(b),f=`${a.label}${a.summary?` ${a.summary}`:""}`;return`${c}${void 0===b.output?(0,d.Tl)("activity.running",{tool:f}):(0,d.Tl)("activity.ran",{tool:f})}`}return`${c}${"thinking"===b.type?(0,d.Tl)("activity.thinking"):(0,d.Tl)("activity.writing")}`}},55511:a=>{"use strict";a.exports=require("crypto")},61034:(a,b,c)=>{Promise.resolve().then(c.bind(c,31096))},61222:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(51537).A)("RotateCcw",[["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"}]])},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66390:(a,b,c)=>{"use strict";c.d(b,{G:()=>i});var d=c(55322),e=c(5207),f=c(60570),g=c(7371),h=c(93884);function i({agent:a,onClose:b,onDeleted:c}){let{t:i}=(0,h.s9)(),{refresh:j}=(0,f.zd)(),k=(0,e.dj)();return(0,d.jsx)(e.TM,{title:i("agent.deleteTitle",{name:a.name}),body:i("agent.deleteBody"),danger:!0,confirmLabel:i("agent.delete"),cancelLabel:i("agent.keep"),onClose:b,onConfirm:async()=>{await g.FH.del(`/agents/${a.id}`),await j(["agents","colonies"]),k(i("agent.deleted")),c?.()}})}},68364:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(51537).A)("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]])},73136:a=>{"use strict";a.exports=require("node:url")},76760:a=>{"use strict";a.exports=require("node:path")},77790:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(51537).A)("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]])},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},93674:(a,b,c)=>{"use strict";c.d(b,{A:()=>n});var d=c(55322),e=c(17027),f=c(34410),g=c(5207),h=c(15964),i=c(66390),j=c(60570),k=c(13520),l=c(7371),m=c(93884);function n(a,b={}){let{t:c}=(0,m.s9)(),{agents:o,colonies:p,objects:q,refresh:r}=(0,j.q5)(),s=(0,g.dj)(),t=(0,e.useMemo)(()=>a?q.filter(b=>b.manager_id===a.id).map(a=>a.id).sort():[],[q,a?.id]),u=(0,e.useMemo)(()=>a?JSON.stringify((0,h.TN)(a,t)):"",[a,t]),[v,w]=(0,e.useState)(()=>a?(0,h.TN)(a,t):null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),B=v&&a?(0,h.tf)(v,o,a.id,p):{},C=!!v&&JSON.stringify(v)!==u;(0,k.h)(C);let D=async()=>{if(v&&a){if(Object.keys(B).length)return void s(c("edit.fixFields"),"err");y(!0);try{let{type_id:d,object_ids:e,...f}=v;await l.FH.patch(`/agents/${a.id}`,f),JSON.stringify([...e].sort())!==JSON.stringify(t)&&await l.FH.put(`/agents/${a.id}/resources`,{object_ids:e}),await r(["agents","colonies","objects"]),s(c("edit.saved",{name:v.name.trim()})),b.onSaved?.()}catch(a){s(a instanceof Error?a.message:c("edit.saveFailed"),"err")}y(!1)}},E=()=>{a&&w((0,h.TN)(a,t))};return{draft:v,setDraft:w,errors:B,dirty:C,saving:x,save:D,discard:E,actions:(a={})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{className:`btn danger push-r ${a.size??""}`,onClick:()=>A(!0),children:[(0,d.jsx)(f.A,{size:a.size?14:15}),c("agent.delete")]}),a.onCancel?(0,d.jsx)("button",{className:`btn ghost ${a.size??""}`,onClick:a.onCancel,children:c("common.cancel")}):(0,d.jsx)("button",{className:`btn ghost ${a.size??""}`,disabled:!C,onClick:E,children:c("common.discard")}),(0,d.jsx)("button",{className:`btn primary ${a.size??""}`,disabled:!C||x,onClick:D,children:x?c("common.saving"):c("common.saveChanges")})]}),deleteModal:z&&a?(0,d.jsx)(i.G,{agent:a,onClose:()=>A(!1),onDeleted:b.onDeleted}):null}}},97984:(a,b,c)=>{"use strict";c.d(b,{N:()=>h});var d=c(55322),e=c(35305),f=c(42580),g=c(93884);function h({spec:a,label:b,title:c}){let{t:h}=(0,g.s9)(),i=(0,f.n)();return(0,d.jsxs)("button",{className:"btn sm",onClick:()=>void i.openTerminal(a),title:c,children:[(0,d.jsx)(e.A,{size:14}),b??h("dock.nav")]})}}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[691,790,335,593,555,274,143,716,802,612],()=>b(b.s=49519));module.exports=c})();
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/agents/[id]/page"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"5506":{"*":{"id":"34720","name":"*","chunks":[],"async":false}},"11108":{"*":{"id":"93286","name":"*","chunks":[],"async":false}},"13970":{"*":{"id":"54880","name":"*","chunks":[],"async":false}},"20353":{"*":{"id":"66621","name":"*","chunks":[],"async":false}},"25382":{"*":{"id":"73026","name":"*","chunks":[],"async":false}},"26082":{"*":{"id":"7700","name":"*","chunks":[],"async":false}},"36098":{"*":{"id":"80749","name":"*","chunks":[],"async":false}},"40523":{"*":{"id":"96297","name":"*","chunks":[],"async":false}},"42860":{"*":{"id":"31096","name":"*","chunks":[],"async":false}},"46269":{"*":{"id":"54462","name":"*","chunks":[],"async":false}},"47857":{"*":{"id":"82921","name":"*","chunks":[],"async":false}},"51161":{"*":{"id":"44389","name":"*","chunks":[],"async":false}},"55890":{"*":{"id":"17740","name":"*","chunks":[],"async":false}},"64304":{"*":{"id":"87328","name":"*","chunks":[],"async":false}},"75750":{"*":{"id":"82874","name":"*","chunks":[],"async":false}},"77363":{"*":{"id":"12197","name":"*","chunks":[],"async":false}},"86300":{"*":{"id":"39639","name":"*","chunks":[],"async":false}},"89146":{"*":{"id":"74050","name":"*","chunks":[],"async":false}},"89976":{"*":{"id":"15726","name":"*","chunks":[],"async":false}},"91962":{"*":{"id":"840","name":"*","chunks":[],"async":false}},"95339":{"*":{"id":"93177","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/client/components/builtin/global-error.js":{"id":89146,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":89146,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/client/components/client-page.js":{"id":77363,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/client/components/client-page.js":{"id":77363,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/client/components/client-segment.js":{"id":51161,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/client/components/client-segment.js":{"id":51161,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":55890,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":55890,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/client/components/layout-router.js":{"id":26082,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/client/components/layout-router.js":{"id":26082,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":91962,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":91962,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/client/components/render-from-template-context.js":{"id":64304,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":64304,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/lib/framework/boundary-components.js":{"id":40523,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":40523,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":13970,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":13970,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/components/Shell.tsx":{"id":5506,"name":"*","chunks":["586","static/chunks/586-f7017d585a84738d.js","839","static/chunks/839-23c5508622fae942.js","177","static/chunks/app/layout-87ebb70bd9cb8443.js"],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/font/google/target.css?{\"path\":\"app/layout.tsx\",\"import\":\"Bricolage_Grotesque\",\"arguments\":[{\"subsets\":[\"latin\"],\"variable\":\"--f-display\",\"axes\":[\"opsz\"]}],\"variableName\":\"display\"}":{"id":39856,"name":"*","chunks":["586","static/chunks/586-f7017d585a84738d.js","839","static/chunks/839-23c5508622fae942.js","177","static/chunks/app/layout-87ebb70bd9cb8443.js"],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/font/google/target.css?{\"path\":\"app/layout.tsx\",\"import\":\"Hanken_Grotesk\",\"arguments\":[{\"subsets\":[\"latin\"],\"variable\":\"--f-body\"}],\"variableName\":\"body\"}":{"id":98682,"name":"*","chunks":["586","static/chunks/586-f7017d585a84738d.js","839","static/chunks/839-23c5508622fae942.js","177","static/chunks/app/layout-87ebb70bd9cb8443.js"],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/font/google/target.css?{\"path\":\"app/layout.tsx\",\"import\":\"JetBrains_Mono\",\"arguments\":[{\"subsets\":[\"latin\"],\"variable\":\"--f-mono\"}],\"variableName\":\"mono\"}":{"id":15151,"name":"*","chunks":["586","static/chunks/586-f7017d585a84738d.js","839","static/chunks/839-23c5508622fae942.js","177","static/chunks/app/layout-87ebb70bd9cb8443.js"],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/globals.css":{"id":87968,"name":"*","chunks":["586","static/chunks/586-f7017d585a84738d.js","839","static/chunks/839-23c5508622fae942.js","177","static/chunks/app/layout-87ebb70bd9cb8443.js"],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/agents/[id]/page.tsx":{"id":42860,"name":"*","chunks":["586","static/chunks/586-f7017d585a84738d.js","706","static/chunks/706-fa2be0f10ffebe6a.js","837","static/chunks/837-33c7480524f48577.js","486","static/chunks/486-13e08542f3a1cbac.js","316","static/chunks/316-26da9cc233ba7557.js","839","static/chunks/839-23c5508622fae942.js","517","static/chunks/517-ccaf8cc5c733cbd8.js","350","static/chunks/350-56599dc3bf06066d.js","291","static/chunks/291-efae53ea5f7ee92d.js","30","static/chunks/30-9adcbe92b15a6815.js","705","static/chunks/705-a16e1fe09be1ac7f.js","969","static/chunks/app/agents/%5Bid%5D/page-4af6c246c4ca7a97.js"],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/relations/page.tsx":{"id":86300,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/resources/[id]/page.tsx":{"id":75750,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/connections/page.tsx":{"id":46269,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/resources/page.tsx":{"id":89976,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/agents/page.tsx":{"id":47857,"name":"*","chunks":["586","static/chunks/586-f7017d585a84738d.js","706","static/chunks/706-fa2be0f10ffebe6a.js","839","static/chunks/839-23c5508622fae942.js","517","static/chunks/517-ccaf8cc5c733cbd8.js","165","static/chunks/app/agents/page-f4c4c80f955f3967.js"],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/page.tsx":{"id":36098,"name":"*","chunks":["586","static/chunks/586-f7017d585a84738d.js","706","static/chunks/706-fa2be0f10ffebe6a.js","486","static/chunks/486-13e08542f3a1cbac.js","839","static/chunks/839-23c5508622fae942.js","517","static/chunks/517-ccaf8cc5c733cbd8.js","350","static/chunks/350-56599dc3bf06066d.js","291","static/chunks/291-efae53ea5f7ee92d.js","844","static/chunks/844-fe55292e0701f436.js","974","static/chunks/app/page-a7f292117b7d76bf.js"],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/schedules/page.tsx":{"id":95339,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/sessions/page.tsx":{"id":25382,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/skills/page.tsx":{"id":20353,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/types/page.tsx":{"id":11108,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/":[],"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/layout":[{"inlined":false,"path":"static/css/945795da867f5250.css"},{"inlined":false,"path":"static/css/dd4e32c285f75776.css"}],"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/page":[],"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/agents/page":[],"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/agents/[id]/page":[]},"rscModuleMapping":{"5506":{"*":{"id":"55356","name":"*","chunks":[],"async":false}},"11108":{"*":{"id":"60068","name":"*","chunks":[],"async":false}},"13970":{"*":{"id":"27134","name":"*","chunks":[],"async":false}},"20353":{"*":{"id":"61959","name":"*","chunks":[],"async":false}},"25382":{"*":{"id":"64848","name":"*","chunks":[],"async":false}},"26082":{"*":{"id":"92090","name":"*","chunks":[],"async":false}},"36098":{"*":{"id":"10230","name":"*","chunks":[],"async":false}},"40523":{"*":{"id":"78683","name":"*","chunks":[],"async":false}},"42860":{"*":{"id":"27769","name":"*","chunks":[],"async":false}},"46269":{"*":{"id":"5420","name":"*","chunks":[],"async":false}},"47857":{"*":{"id":"94963","name":"*","chunks":[],"async":false}},"51161":{"*":{"id":"68875","name":"*","chunks":[],"async":false}},"55890":{"*":{"id":"65662","name":"*","chunks":[],"async":false}},"64304":{"*":{"id":"72702","name":"*","chunks":[],"async":false}},"75750":{"*":{"id":"67744","name":"*","chunks":[],"async":false}},"77363":{"*":{"id":"18727","name":"*","chunks":[],"async":false}},"86300":{"*":{"id":"976","name":"*","chunks":[],"async":false}},"87968":{"*":{"id":"53140","name":"*","chunks":[],"async":false}},"89146":{"*":{"id":"2972","name":"*","chunks":[],"async":false}},"89976":{"*":{"id":"39016","name":"*","chunks":[],"async":false}},"91962":{"*":{"id":"5726","name":"*","chunks":[],"async":false}},"95339":{"*":{"id":"29143","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{"13970":{"*":{"id":"54880","name":"*","chunks":[],"async":false}},"26082":{"*":{"id":"7700","name":"*","chunks":[],"async":false}},"40523":{"*":{"id":"96297","name":"*","chunks":[],"async":false}},"51161":{"*":{"id":"44389","name":"*","chunks":[],"async":false}},"55890":{"*":{"id":"17740","name":"*","chunks":[],"async":false}},"64304":{"*":{"id":"87328","name":"*","chunks":[],"async":false}},"77363":{"*":{"id":"12197","name":"*","chunks":[],"async":false}},"89146":{"*":{"id":"74050","name":"*","chunks":[],"async":false}},"91962":{"*":{"id":"840","name":"*","chunks":[],"async":false}}}}
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/agents/[id]/page"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"5506":{"*":{"id":"34720","name":"*","chunks":[],"async":false}},"11108":{"*":{"id":"93286","name":"*","chunks":[],"async":false}},"13970":{"*":{"id":"54880","name":"*","chunks":[],"async":false}},"20353":{"*":{"id":"66621","name":"*","chunks":[],"async":false}},"25382":{"*":{"id":"73026","name":"*","chunks":[],"async":false}},"26082":{"*":{"id":"7700","name":"*","chunks":[],"async":false}},"36098":{"*":{"id":"80749","name":"*","chunks":[],"async":false}},"40523":{"*":{"id":"96297","name":"*","chunks":[],"async":false}},"42860":{"*":{"id":"31096","name":"*","chunks":[],"async":false}},"46269":{"*":{"id":"54462","name":"*","chunks":[],"async":false}},"47857":{"*":{"id":"82921","name":"*","chunks":[],"async":false}},"51161":{"*":{"id":"44389","name":"*","chunks":[],"async":false}},"55890":{"*":{"id":"17740","name":"*","chunks":[],"async":false}},"64304":{"*":{"id":"87328","name":"*","chunks":[],"async":false}},"75750":{"*":{"id":"82874","name":"*","chunks":[],"async":false}},"77363":{"*":{"id":"12197","name":"*","chunks":[],"async":false}},"86300":{"*":{"id":"39639","name":"*","chunks":[],"async":false}},"89146":{"*":{"id":"74050","name":"*","chunks":[],"async":false}},"89976":{"*":{"id":"15726","name":"*","chunks":[],"async":false}},"91962":{"*":{"id":"840","name":"*","chunks":[],"async":false}},"95339":{"*":{"id":"93177","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/client/components/builtin/global-error.js":{"id":89146,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":89146,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/client/components/client-page.js":{"id":77363,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/client/components/client-page.js":{"id":77363,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/client/components/client-segment.js":{"id":51161,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/client/components/client-segment.js":{"id":51161,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":55890,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":55890,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/client/components/layout-router.js":{"id":26082,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/client/components/layout-router.js":{"id":26082,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":91962,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":91962,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/client/components/render-from-template-context.js":{"id":64304,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":64304,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/lib/framework/boundary-components.js":{"id":40523,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":40523,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":13970,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":13970,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/components/Shell.tsx":{"id":5506,"name":"*","chunks":["586","static/chunks/586-f7017d585a84738d.js","839","static/chunks/839-4aefe6e71be6e1ef.js","177","static/chunks/app/layout-99620746d028dda8.js"],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/font/google/target.css?{\"path\":\"app/layout.tsx\",\"import\":\"Bricolage_Grotesque\",\"arguments\":[{\"subsets\":[\"latin\"],\"variable\":\"--f-display\",\"axes\":[\"opsz\"]}],\"variableName\":\"display\"}":{"id":39856,"name":"*","chunks":["586","static/chunks/586-f7017d585a84738d.js","839","static/chunks/839-4aefe6e71be6e1ef.js","177","static/chunks/app/layout-99620746d028dda8.js"],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/font/google/target.css?{\"path\":\"app/layout.tsx\",\"import\":\"Hanken_Grotesk\",\"arguments\":[{\"subsets\":[\"latin\"],\"variable\":\"--f-body\"}],\"variableName\":\"body\"}":{"id":98682,"name":"*","chunks":["586","static/chunks/586-f7017d585a84738d.js","839","static/chunks/839-4aefe6e71be6e1ef.js","177","static/chunks/app/layout-99620746d028dda8.js"],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/node_modules/next/font/google/target.css?{\"path\":\"app/layout.tsx\",\"import\":\"JetBrains_Mono\",\"arguments\":[{\"subsets\":[\"latin\"],\"variable\":\"--f-mono\"}],\"variableName\":\"mono\"}":{"id":15151,"name":"*","chunks":["586","static/chunks/586-f7017d585a84738d.js","839","static/chunks/839-4aefe6e71be6e1ef.js","177","static/chunks/app/layout-99620746d028dda8.js"],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/globals.css":{"id":87968,"name":"*","chunks":["586","static/chunks/586-f7017d585a84738d.js","839","static/chunks/839-4aefe6e71be6e1ef.js","177","static/chunks/app/layout-99620746d028dda8.js"],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/connections/page.tsx":{"id":46269,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/agents/[id]/page.tsx":{"id":42860,"name":"*","chunks":["586","static/chunks/586-f7017d585a84738d.js","706","static/chunks/706-fa2be0f10ffebe6a.js","837","static/chunks/837-33c7480524f48577.js","486","static/chunks/486-13e08542f3a1cbac.js","316","static/chunks/316-26da9cc233ba7557.js","839","static/chunks/839-4aefe6e71be6e1ef.js","517","static/chunks/517-ccaf8cc5c733cbd8.js","350","static/chunks/350-56599dc3bf06066d.js","291","static/chunks/291-efae53ea5f7ee92d.js","30","static/chunks/30-9adcbe92b15a6815.js","705","static/chunks/705-c7e75806f77b880c.js","969","static/chunks/app/agents/%5Bid%5D/page-3faf40800981a736.js"],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/resources/[id]/page.tsx":{"id":75750,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/resources/page.tsx":{"id":89976,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/schedules/page.tsx":{"id":95339,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/sessions/page.tsx":{"id":25382,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/skills/page.tsx":{"id":20353,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/types/page.tsx":{"id":11108,"name":"*","chunks":[],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/agents/page.tsx":{"id":47857,"name":"*","chunks":["586","static/chunks/586-f7017d585a84738d.js","706","static/chunks/706-fa2be0f10ffebe6a.js","839","static/chunks/839-4aefe6e71be6e1ef.js","517","static/chunks/517-ccaf8cc5c733cbd8.js","165","static/chunks/app/agents/page-f4c4c80f955f3967.js"],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/page.tsx":{"id":36098,"name":"*","chunks":["586","static/chunks/586-f7017d585a84738d.js","706","static/chunks/706-fa2be0f10ffebe6a.js","486","static/chunks/486-13e08542f3a1cbac.js","839","static/chunks/839-4aefe6e71be6e1ef.js","517","static/chunks/517-ccaf8cc5c733cbd8.js","350","static/chunks/350-56599dc3bf06066d.js","291","static/chunks/291-efae53ea5f7ee92d.js","844","static/chunks/844-fe55292e0701f436.js","974","static/chunks/app/page-a7f292117b7d76bf.js"],"async":false},"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/relations/page.tsx":{"id":86300,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/":[],"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/layout":[{"inlined":false,"path":"static/css/945795da867f5250.css"},{"inlined":false,"path":"static/css/b7a03c62468f4263.css"}],"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/page":[],"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/agents/page":[],"/home/hugh/Documentos/projects/personal/hive-am/dist/stage/web/app/agents/[id]/page":[]},"rscModuleMapping":{"5506":{"*":{"id":"55356","name":"*","chunks":[],"async":false}},"11108":{"*":{"id":"60068","name":"*","chunks":[],"async":false}},"13970":{"*":{"id":"27134","name":"*","chunks":[],"async":false}},"20353":{"*":{"id":"61959","name":"*","chunks":[],"async":false}},"25382":{"*":{"id":"64848","name":"*","chunks":[],"async":false}},"26082":{"*":{"id":"92090","name":"*","chunks":[],"async":false}},"36098":{"*":{"id":"10230","name":"*","chunks":[],"async":false}},"40523":{"*":{"id":"78683","name":"*","chunks":[],"async":false}},"42860":{"*":{"id":"27769","name":"*","chunks":[],"async":false}},"46269":{"*":{"id":"5420","name":"*","chunks":[],"async":false}},"47857":{"*":{"id":"94963","name":"*","chunks":[],"async":false}},"51161":{"*":{"id":"68875","name":"*","chunks":[],"async":false}},"55890":{"*":{"id":"65662","name":"*","chunks":[],"async":false}},"64304":{"*":{"id":"72702","name":"*","chunks":[],"async":false}},"75750":{"*":{"id":"67744","name":"*","chunks":[],"async":false}},"77363":{"*":{"id":"18727","name":"*","chunks":[],"async":false}},"86300":{"*":{"id":"976","name":"*","chunks":[],"async":false}},"87968":{"*":{"id":"53140","name":"*","chunks":[],"async":false}},"89146":{"*":{"id":"2972","name":"*","chunks":[],"async":false}},"89976":{"*":{"id":"39016","name":"*","chunks":[],"async":false}},"91962":{"*":{"id":"5726","name":"*","chunks":[],"async":false}},"95339":{"*":{"id":"29143","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{"13970":{"*":{"id":"54880","name":"*","chunks":[],"async":false}},"26082":{"*":{"id":"7700","name":"*","chunks":[],"async":false}},"40523":{"*":{"id":"96297","name":"*","chunks":[],"async":false}},"51161":{"*":{"id":"44389","name":"*","chunks":[],"async":false}},"55890":{"*":{"id":"17740","name":"*","chunks":[],"async":false}},"64304":{"*":{"id":"87328","name":"*","chunks":[],"async":false}},"77363":{"*":{"id":"12197","name":"*","chunks":[],"async":false}},"89146":{"*":{"id":"74050","name":"*","chunks":[],"async":false}},"91962":{"*":{"id":"840","name":"*","chunks":[],"async":false}}}}