hive-am 1.2.2 → 1.3.0

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 (110) hide show
  1. package/CHANGELOG.md +15 -1
  2. package/package.json +1 -1
  3. package/server/dist/context.js +62 -0
  4. package/server/dist/db/migrations.js +7 -0
  5. package/server/dist/db.js +4 -4
  6. package/server/dist/history/claude.js +8 -2
  7. package/server/dist/http/routes/agents.js +1 -1
  8. package/server/dist/http/validate.js +2 -0
  9. package/server/dist/instructions.js +4 -0
  10. package/server/dist/models.js +2 -0
  11. package/server/dist/providers/claude.js +13 -1
  12. package/server/dist/providers/opencode-server.js +59 -0
  13. package/server/dist/providers/opencode.js +4 -1
  14. package/server/dist/stats.js +15 -3
  15. package/web/.next/BUILD_ID +1 -1
  16. package/web/.next/app-build-manifest.json +70 -70
  17. package/web/.next/app-path-routes-manifest.json +7 -7
  18. package/web/.next/build-manifest.json +2 -2
  19. package/web/.next/prerender-manifest.json +49 -49
  20. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  21. package/web/.next/server/app/_not-found.html +1 -1
  22. package/web/.next/server/app/_not-found.rsc +3 -3
  23. package/web/.next/server/app/agents/[id]/page.js +3 -3
  24. package/web/.next/server/app/agents/[id]/page.js.nft.json +1 -1
  25. package/web/.next/server/app/agents/[id]/page_client-reference-manifest.js +1 -1
  26. package/web/.next/server/app/agents/page.js +1 -1
  27. package/web/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  28. package/web/.next/server/app/agents.html +1 -1
  29. package/web/.next/server/app/agents.rsc +4 -4
  30. package/web/.next/server/app/connections/page.js +1 -1
  31. package/web/.next/server/app/connections/page_client-reference-manifest.js +1 -1
  32. package/web/.next/server/app/connections.html +1 -1
  33. package/web/.next/server/app/connections.rsc +4 -4
  34. package/web/.next/server/app/index.html +1 -1
  35. package/web/.next/server/app/index.rsc +4 -4
  36. package/web/.next/server/app/page.js +1 -1
  37. package/web/.next/server/app/page.js.nft.json +1 -1
  38. package/web/.next/server/app/page_client-reference-manifest.js +1 -1
  39. package/web/.next/server/app/relations/page.js +1 -1
  40. package/web/.next/server/app/relations/page_client-reference-manifest.js +1 -1
  41. package/web/.next/server/app/relations.html +1 -1
  42. package/web/.next/server/app/relations.rsc +4 -4
  43. package/web/.next/server/app/resources/[id]/page.js +1 -1
  44. package/web/.next/server/app/resources/[id]/page.js.nft.json +1 -1
  45. package/web/.next/server/app/resources/[id]/page_client-reference-manifest.js +1 -1
  46. package/web/.next/server/app/resources/page.js +1 -1
  47. package/web/.next/server/app/resources/page.js.nft.json +1 -1
  48. package/web/.next/server/app/resources/page_client-reference-manifest.js +1 -1
  49. package/web/.next/server/app/resources.html +1 -1
  50. package/web/.next/server/app/resources.rsc +4 -4
  51. package/web/.next/server/app/schedules/page.js +1 -1
  52. package/web/.next/server/app/schedules/page_client-reference-manifest.js +1 -1
  53. package/web/.next/server/app/schedules.html +1 -1
  54. package/web/.next/server/app/schedules.rsc +4 -4
  55. package/web/.next/server/app/sessions/page.js +1 -1
  56. package/web/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  57. package/web/.next/server/app/sessions.html +1 -1
  58. package/web/.next/server/app/sessions.rsc +4 -4
  59. package/web/.next/server/app/skills/page.js +1 -1
  60. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  61. package/web/.next/server/app/skills.html +1 -1
  62. package/web/.next/server/app/skills.rsc +4 -4
  63. package/web/.next/server/app/types/page.js +1 -1
  64. package/web/.next/server/app/types/page_client-reference-manifest.js +1 -1
  65. package/web/.next/server/app/types.html +1 -1
  66. package/web/.next/server/app/types.rsc +4 -4
  67. package/web/.next/server/app-paths-manifest.json +7 -7
  68. package/web/.next/server/chunks/143.js +1 -1
  69. package/web/.next/server/chunks/274.js +1 -1
  70. package/web/.next/server/chunks/306.js +1 -1
  71. package/web/.next/server/chunks/451.js +1 -0
  72. package/web/.next/server/chunks/505.js +1 -1
  73. package/web/.next/server/chunks/612.js +1 -1
  74. package/web/.next/server/chunks/716.js +2 -2
  75. package/web/.next/server/pages/404.html +1 -1
  76. package/web/.next/server/pages/500.html +1 -1
  77. package/web/.next/server/server-reference-manifest.json +1 -1
  78. package/web/.next/static/chunks/281-d8a0dcfaa6d064e4.js +1 -0
  79. package/web/.next/static/chunks/{291-efae53ea5f7ee92d.js → 291-23f314877fa39054.js} +1 -1
  80. package/web/.next/static/chunks/304-681348099f874a30.js +1 -0
  81. package/web/.next/static/chunks/350-0fe82e622e7a670f.js +1 -0
  82. package/web/.next/static/chunks/{491-6b4e6201f5110dff.js → 491-28f093772bd460ac.js} +1 -1
  83. package/web/.next/static/chunks/517-373a80c8ba432bdc.js +1 -0
  84. package/web/.next/static/chunks/654-92a63b3c4b412666.js +1 -0
  85. package/web/.next/static/chunks/705-780e48e55b0346bd.js +1 -0
  86. package/web/.next/static/chunks/{844-fe55292e0701f436.js → 844-519177e6198ca84f.js} +1 -1
  87. package/web/.next/static/chunks/app/agents/[id]/page-c005161cec5527d8.js +1 -0
  88. package/web/.next/static/chunks/app/agents/{page-f4c4c80f955f3967.js → page-9bb8cba69776c719.js} +1 -1
  89. package/web/.next/static/chunks/app/connections/{page-0936beaf02d863c6.js → page-eb11cfb1ffeab3ca.js} +1 -1
  90. package/web/.next/static/chunks/app/{layout-99620746d028dda8.js → layout-49b46c9b5aa512a8.js} +1 -1
  91. package/web/.next/static/chunks/app/{page-a7f292117b7d76bf.js → page-da042d146caeeab6.js} +1 -1
  92. package/web/.next/static/chunks/app/relations/{page-fba25393c8688714.js → page-a44fd515a3b0525e.js} +1 -1
  93. package/web/.next/static/chunks/app/resources/[id]/{page-d110d89bb8b5fca7.js → page-bf05836f97248ca7.js} +1 -1
  94. package/web/.next/static/chunks/app/resources/{page-bbd0b450d3f3131d.js → page-800f774e5cacf4c9.js} +1 -1
  95. package/web/.next/static/chunks/app/schedules/{page-a1124397fc760413.js → page-96976fff4ee23538.js} +1 -1
  96. package/web/.next/static/chunks/app/sessions/{page-0e322811b0cde724.js → page-a7534ebd90e982d6.js} +1 -1
  97. package/web/.next/static/chunks/app/skills/{page-22ea0ef89d9f7a13.js → page-bc1acd0663f36129.js} +1 -1
  98. package/web/.next/static/chunks/app/types/{page-18c4e1db2724d41d.js → page-ebd37e220f77c1f3.js} +1 -1
  99. package/web/.next/static/css/{b7a03c62468f4263.css → d42799b7e6a0e8a2.css} +1 -1
  100. package/web/.next/trace +29 -29
  101. package/web/.next/server/chunks/555.js +0 -1
  102. package/web/.next/static/chunks/176-aeaf907a6ea5627d.js +0 -1
  103. package/web/.next/static/chunks/350-56599dc3bf06066d.js +0 -1
  104. package/web/.next/static/chunks/486-13e08542f3a1cbac.js +0 -1
  105. package/web/.next/static/chunks/517-ccaf8cc5c733cbd8.js +0 -1
  106. package/web/.next/static/chunks/705-c7e75806f77b880c.js +0 -1
  107. package/web/.next/static/chunks/839-4aefe6e71be6e1ef.js +0 -1
  108. package/web/.next/static/chunks/app/agents/[id]/page-3faf40800981a736.js +0 -1
  109. /package/web/.next/static/{7BI__-ayGDTlOrSboD_bT → aSYzbHk1M5YeS_d3SQKTZ}/_buildManifest.js +0 -0
  110. /package/web/.next/static/{7BI__-ayGDTlOrSboD_bT → aSYzbHk1M5YeS_d3SQKTZ}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";exports.id=306,exports.ids=[306],exports.modules={3936:(a,b,c)=>{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}},24956:(a,b,c)=>{c.d(b,{B:()=>h});var d=c(55322),e=c(17027),f=c(96107),g=c(2838);function h({label:a,title:b,children:c,size:h="md",align:i="start"}){let[j,k]=(0,e.useState)(!1),l=(0,e.useRef)(null),m=(0,e.useRef)(null),n=(0,e.useId)();return(0,g.s)(j,l,()=>k(!1),()=>m.current?.focus()),(0,d.jsxs)("span",{className:`help ${"sm"===h?"sm":""} ${"end"===i?"end":""}`,ref:l,children:[(0,d.jsx)("button",{ref:m,type:"button",className:"help-btn","aria-label":a,title:a,"aria-haspopup":"dialog","aria-expanded":j,"aria-controls":j?n:void 0,onClick:()=>k(a=>!a),children:(0,d.jsx)(f.A,{size:"sm"===h?15:18})}),j&&(0,d.jsxs)("div",{id:n,role:"dialog","aria-label":b,className:"help-pop",children:[(0,d.jsx)("div",{className:"eyebrow",children:b}),(0,d.jsx)("div",{className:"muted small help-body",children:c})]})]})}},31055:(a,b,c)=>{c.d(b,{b:()=>h});var d=c(55322),e=c(17027),f=c(2838),g=c(5207);function h({value:a,onChange:b,options:c,placeholder:h,mono:i=!1,ariaLabel:j,onOpen:k,empty:l}){let[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(0),q=(0,e.useRef)(null);(0,f.s)(m,q,()=>n(!1));let r=(0,e.useMemo)(()=>{let b=a.trim().toLowerCase();return(b?c.filter(a=>`${a.value} ${a.label??""} ${a.hint??""}`.toLowerCase().includes(b)):c).slice(0,60)},[c,a]),s=(0,g.Bp)(m&&(r.length>0||!!l),o,r.length),t=a=>{b(a.value),n(!1)};return(0,d.jsxs)("div",{className:"sg",ref:q,children:[(0,d.jsx)("input",{className:`input ${i?"mono":""}`,value:a,placeholder:h,"aria-label":j,autoComplete:"off",spellCheck:!1,...s.input,onFocus:()=>{m||(n(!0),k?.())},onClick:()=>n(!0),onChange:a=>{b(a.target.value),n(!0)},onKeyDown:a=>{"ArrowDown"===a.key?(a.preventDefault(),n(!0),p(a=>Math.min(r.length-1,a+1))):"ArrowUp"===a.key?(a.preventDefault(),p(a=>Math.max(0,a-1))):"Enter"===a.key&&m&&r[o]?(a.preventDefault(),t(r[o])):"Escape"===a.key&&m&&(a.stopPropagation(),n(!1))}}),m&&(r.length>0||l)&&(0,d.jsxs)("ul",{className:"sg-list",...s.listProps,children:[0===r.length&&(0,d.jsx)("li",{className:"sg-empty",role:"presentation",children:l}),r.map((a,b)=>(0,d.jsx)("li",{...s.optionProps(b),children:(0,d.jsxs)("button",{type:"button",tabIndex:-1,className:`sg-opt ${b===o?"hi":""}`,onMouseDown:a=>a.preventDefault(),onMouseEnter:()=>p(b),onClick:()=>t(a),children:[(0,d.jsx)("span",{className:`nm ${i?"mono":""}`,children:a.label??a.value}),a.hint&&(0,d.jsx)("span",{className:"hint",children:a.hint})]})},a.value))]})]})}},36368:(a,b,c)=>{c.d(b,{md:()=>I,wl:()=>K});var d=c(55322),e=c(97984),f=c(17027),g=c(91705),h=c.n(g),i=c(46378),j=c(31251),k=c(96489),l=c(48370),m=c(72836),n=c(6289),o=c(58437),p=c(85605),q=c(32309),r=c(84300),s=c(37811),t=c(78381),u=c(44521),v=c(8811),w=c(3936),x=c(7371),y=c(93884),z=c(61162),A=c(5207),B=c(89477),C=c(60570),D=c(42580),E=c(36143),F=c(93717),G=c(77712);let H={mysql:"MySQL / MariaDB",postgresql:"PostgreSQL",sqlite:"SQLite",mssql:"SQL Server"};function I({status:a,className:b=""}){return(0,d.jsx)("i",{className:`odot ${F.Wy[a]} ${b}`,"aria-hidden":!0})}function J(a){if("server"===a.kind)return a.config.start;if("http"===a.kind)return(0,z._1)(a.config.folder);if("database"===a.kind){let b=a.config;return"sqlite"===b.engine?(0,z._1)(b.file??""):`${b.host||"127.0.0.1"}${b.port?`:${b.port}`:""}${b.database?`/${b.database}`:""}`}if("cluster"===a.kind)return`${a.config.members.length}`;let b=a.config;return"container"===b.mode?b.image??"":"compose"===b.mode?(0,z._1)(b.file??""):b.container??""}function K({object:a,target:b,onClose:c,onCreateManager:g}){let{t:K}=(0,y.s9)(),{agents:L,objects:M,colonies:N}=(0,C.o0)(),O=(0,D.n)(),P="server"===a.kind||"docker"===a.kind&&"compose"!==a.config.mode,Q=a.manager_id?L.filter(b=>b.id===a.manager_id):L.filter(b=>b.skill_ids.includes(E.t)&&(b.colony_id??null)===(a.colony_id??null)),[R,S]=(0,f.useState)(!1),{refresh:T}=(0,C.o0)(),U=async b=>{try{await x.FH.put(`/objects/${a.id}/manager`,{agent_id:b}),await T(["objects","agents"]),S(!1)}catch(a){V(a instanceof Error?a.message:"","err")}},V=(0,A.dj)(),[W,X]=(0,f.useState)(null),{icon:Y,color:Z}=F.Nd[a.kind],$=a.state.status,_=async b=>{X(b);try{await x.FH.post(`/objects/${a.id}/action`,{action:b})}catch(a){V(`${K("obj.act.failed",{action:K(`obj.act.${b}`)})}: ${a instanceof Error?a.message:""}`,"err")}finally{X(null)}},aa="running"===$||"starting"===$,ab=async()=>{X("test");try{let b=await x.FH.post("/object-db/test",{id:a.id,config:a.config});V(`${K("db.test.ok")} \xb7 ${b.version} \xb7 ${b.ms} ms`)}catch(a){V(a instanceof Error?a.message:"","err")}finally{X(null)}},ac="cluster"===a.kind?a.config.members.map(a=>M.find(b=>b.id===a)).filter(a=>!!a):[];return(0,d.jsx)(w.rs,{target:b,pinned:!0,width:380,label:a.name,onClose:c,children:(0,d.jsxs)("div",{className:"col obj-panel res-gap12",children:[(0,d.jsxs)("div",{className:"ap-corner row gap-s",children:[(0,d.jsx)(h(),{className:"btn ghost icon sm",href:`/resources/${a.id}?tab=config`,"aria-label":K("obj.act.edit"),title:K("obj.act.edit"),children:(0,d.jsx)(i.A,{size:15})}),(0,d.jsx)("button",{className:"btn ghost icon sm",onClick:c,"aria-label":K("common.close"),title:`${K("common.close")} (Esc)`,children:(0,d.jsx)(j.A,{size:16})})]}),(0,d.jsxs)("div",{className:"row gap-l res-pr70",children:[(0,d.jsx)("span",{className:"obj-ico",style:{"--c":Z},children:(0,d.jsx)(Y,{size:22})}),(0,d.jsxs)("div",{className:"grow res-minw0",children:[(0,d.jsx)("h2",{className:"res-h2",children:a.name}),(0,d.jsxs)("div",{className:"row gap-s wrap res-mt4",children:[(0,d.jsxs)("span",{className:`ostatus ${F.Wy[$]}`,children:[(0,d.jsx)(I,{status:$}),K(`obj.status.${$}`)]}),(0,d.jsx)("span",{className:"muted small",children:K(`obj.kind.${a.kind}`)})]})]})]}),(a.state.detail||a.state.since)&&(0,d.jsx)("p",{className:"muted small res-m0",children:[(0,F.HS)(K,a.state.detail),a.state.since&&aa?K("obj.since",{time:(0,z.KN)(a.state.since)}):"",a.state.pid?K("obj.pid",{pid:a.state.pid}):""].filter(Boolean).join(" \xb7 ")}),(0,d.jsxs)(h(),{className:"btn primary",href:`/resources/${a.id}`,children:[(0,d.jsx)(k.A,{size:15}),K("obj.open")]}),"cluster"!==a.kind&&(0,d.jsx)("div",{className:"mono small obj-cmd",title:J(a),children:J(a)}),"database"===a.kind&&(0,d.jsxs)("div",{className:"row gap-s wrap",children:[(0,d.jsxs)("span",{className:"db-badge",children:[(0,d.jsx)(l.A,{size:12}),H[a.config.engine]]}),!1!==a.config.readOnly?(0,d.jsxs)("span",{className:"db-badge ro",children:[(0,d.jsx)(m.A,{size:12}),K("db.readonly.badge")]}):(0,d.jsxs)("span",{className:"db-badge rw",children:[(0,d.jsx)(n.A,{size:12}),K("db.write.badge")]}),(0,d.jsxs)("button",{className:"btn sm",disabled:!!W,onClick:()=>void ab(),children:["test"===W?(0,d.jsx)(o.A,{size:14,className:"spin"}):(0,d.jsx)(p.A,{size:14}),K("db.test")]})]}),"http"===a.kind||"database"===a.kind?null:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"row gap-s wrap",children:[(0,d.jsxs)("button",{className:"btn primary sm",disabled:!!W||("cluster"===a.kind?"running"===$:aa),onClick:()=>void _("start"),children:[(0,d.jsx)(q.A,{size:14}),K("cluster"===a.kind?"obj.act.startAll":"obj.act.start")]}),(0,d.jsxs)("button",{className:"btn sm",disabled:!!W||!aa&&"error"!==$&&!("cluster"===a.kind&&ac.some(a=>"running"===a.state.status)),onClick:()=>void _("stop"),children:[(0,d.jsx)(r.A,{size:14}),K("cluster"===a.kind?"obj.act.stopAll":"obj.act.stop")]}),(0,d.jsxs)("button",{className:"btn sm",disabled:!!W,onClick:()=>void _("restart"),children:[(0,d.jsx)(s.A,{size:14}),K("cluster"===a.kind?"obj.act.restartAll":"obj.act.restart")]})]}),"cluster"===a.kind&&(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"eyebrow res-mb6",children:K("obj.members")}),ac.length?(0,d.jsx)("div",{className:"col res-gap4",children:ac.map((a,b)=>(0,d.jsxs)("div",{className:"row gap-s small",children:[(0,d.jsx)("span",{className:"ord",children:b+1}),(0,d.jsx)(I,{status:a.state.status}),(0,d.jsx)("b",{className:"grow ellipsis",children:a.name}),(0,d.jsx)("span",{className:"muted",children:K(`obj.status.${a.state.status}`)})]},a.id))}):(0,d.jsx)("p",{className:"muted small res-m0",children:K("obj.members.empty")})]}),(0,d.jsxs)("div",{className:"row gap-s wrap",children:[P&&(0,d.jsx)(e.N,{spec:{objectId:a.id},label:"server"===a.kind?K("dock.here"):K("dock.shell")}),(0,d.jsxs)("button",{className:"btn sm",onClick:()=>O.openLogs(a.id,a.name),children:[(0,d.jsx)(t.A,{size:14}),K("dock.logs")]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"eyebrow res-mb6",children:K("obj.logs")}),(0,d.jsx)(G.I,{id:a.id})]})]}),"http"!==a.kind&&"database"!==a.kind&&(0,d.jsxs)("div",{className:"obj-managers",children:[(0,d.jsx)("div",{className:"eyebrow res-mb6",children:K("obj.managers")}),Q.length?(0,d.jsx)("div",{className:"row gap-s wrap",children:Q.map(b=>(0,d.jsxs)("span",{className:"chip ps-chip",children:[(0,d.jsxs)(h(),{href:`/agents/${b.id}`,title:"plan"===b.permission?K("obj.managers.readonly"):void 0,children:[b.name,"plan"===b.permission?` \xb7 ${K("obj.managers.ro")}`:""]}),a.manager_id===b.id&&(0,d.jsx)("button",{type:"button",onClick:()=>void U(null),"aria-label":K("obj.managers.remove"),title:K("obj.managers.remove"),children:(0,d.jsx)(j.A,{size:12})})]},b.id))}):(0,d.jsx)("p",{className:"muted small res-m0",children:K("obj.managers.none")}),a.manager_id&&(0,d.jsx)("p",{className:"muted small res-mt6",children:K("obj.managers.only")}),(0,d.jsxs)("div",{className:"row gap-s wrap res-mt8",children:[(0,d.jsxs)("button",{className:"btn sm",onClick:g,children:[(0,d.jsx)(u.A,{size:14}),K("obj.managers.create")]}),(0,d.jsxs)("button",{className:"btn sm","aria-pressed":R,onClick:()=>S(a=>!a),children:[(0,d.jsx)(v.A,{size:14}),K("obj.managers.add")]})]}),R&&(0,d.jsx)("div",{className:"res-mt8",children:(0,d.jsx)(B.c,{inline:!0,autoFocus:!0,options:L.filter(b=>b.id!==a.manager_id).map(a=>({id:a.id,label:a.name,hint:N.find(b=>b.id===a.colony_id)?.name??K("common.noColony")})),value:[],onChange:a=>a[0]&&void U(a[0]),placeholder:K("obj.manager.placeholder"),empty:K("obj.manager.empty"),ariaLabel:K("obj.managers.add")})})]})]})})}},54403:(a,b,c)=>{c.d(b,{X:()=>m});var d=c(55322),e=c(17027),f=c(7371),g=c(93884),h=c(60570),i=c(5207),j=c(88055),k=c(70226),l=c(75546);function m({presetColonyId:a,presetKind:b,onClose:c,onSaved:m}){let{t:n}=(0,g.s9)(),{refresh:o}=(0,h.o0)(),p=(0,i.dj)(),{d:q,set:r,setD:s}=(0,j.Te)(()=>(0,j.QJ)(void 0,a,b)),[t,u]=(0,e.useState)(""),[v,w]=(0,e.useState)(!1),x=async()=>{let a=q.name.trim()||("database"===q.kind?(0,l.I5)(q):"");if(!a)return void u(n("obj.err.name"));w(!0),u("");try{if("docker"===q.kind&&"template"===q.mode&&!q.template){u(n("tpl.pick")),w(!1);return}let b="docker"===q.kind&&"template"===q.mode?await f.FH.post("/objects/from-template",{name:a,colony_id:q.colony_id||null,template:q.template,values:q.tplValues}):await f.FH.post("/objects",{name:a,colony_id:q.colony_id||null,kind:q.kind,config:(0,j.qP)(q)});q.manager&&k.G.includes(q.kind)&&await f.FH.put(`/objects/${b.id}/manager`,{agent_id:q.manager}).catch(a=>p(a instanceof Error?a.message:"","err")),await o(["objects","agents"]),p(n("obj.created")),m?.(b.id),c()}catch(a){u(a instanceof Error?a.message:n("edit.saveFailed")),w(!1)}};return(0,d.jsx)(i._s,{title:n("obj.newTitle"),subtitle:n("obj.subtitle"),onClose:c,footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{className:"btn ghost",onClick:c,children:n("common.cancel")}),(0,d.jsx)("button",{className:"btn primary",disabled:v,onClick:()=>void x(),children:n("obj.create")})]}),children:(0,d.jsx)(j.Bh,{d:q,set:r,setD:s,showKind:!0,error:t})})}},54842:(a,b,c)=>{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")}`}},61060:(a,b,c)=>{c.d(b,{W:()=>p});var d=c(55322),e=c(17027),f=c(71267),g=c(72836),h=c(62850),i=c(45482),j=c(34410),k=c(31251),l=c(24956),m=c(93884),n=c(31055);let o="$shared";function p({value:a,onChange:b,fileEnvs:c=[],fileVars:p={},used:q=[],fileDefined:r=[],setBy:s={}}){let{t}=(0,m.s9)(),u=[o,...[...new Set([...Object.keys(a),...c])].filter(a=>a!==o).sort()],[v,w]=(0,e.useState)(()=>u.find(b=>b!==o&&Object.keys(a[b]??{}).length>0)??u[0]),[x,y]=(0,e.useState)(""),[z,A]=(0,e.useState)({}),B=a[v]??{},C=new Set([...v!==o?p[o]??[]:[],...p[v]??[]]),D=q.filter(a=>!(a.name in B)).map(a=>({value:a.name,hint:t("vars.used.count",{count:a.count})})),E=(c,d,e)=>{if(void 0!==e&&e!==c&&e in B)return;let f=Object.entries(B).map(([a,b])=>a===c?[e??a,{...b,...d}]:[a,b]);b({...a,[v]:Object.fromEntries(f)})},F=()=>{let c=x.trim();!/^[\w.$-]{1,60}$/.test(c)||c in a||c===o||(b({...a,[c]:{}}),w(c),y(""))};return(0,d.jsxs)("div",{className:"vars",children:[(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsx)("b",{children:t("ow.tab.vars")}),(0,d.jsxs)(l.B,{size:"sm",label:t("common.help"),title:t("vars.how.title"),children:[(0,d.jsx)("p",{children:t("vars.hint")}),(0,d.jsx)("p",{children:t("vars.how.1")}),(0,d.jsx)("p",{children:t("vars.how.2")}),(0,d.jsx)("p",{children:t("vars.note")})]})]}),(0,d.jsxs)("div",{className:"vars-envs",role:"tablist",children:[u.map(a=>(0,d.jsxs)("button",{type:"button",role:"tab","aria-selected":v===a,className:`vars-env ${v===a?"on":""}`,onClick:()=>w(a),title:a===o?t("vars.all.hint"):void 0,children:[a===o?t("vars.all"):a,c.includes(a)&&(0,d.jsx)("i",{className:"vars-file",title:t("vars.fromFile"),children:"\xb7"})]},a)),(0,d.jsxs)("span",{className:"vars-add",children:[(0,d.jsx)("input",{className:"input",placeholder:t("vars.newEnv"),value:x,onChange:a=>y(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),F())},"aria-label":t("vars.newEnv")}),(0,d.jsx)("button",{type:"button",className:"btn ghost icon sm",onClick:F,disabled:!x.trim(),"aria-label":t("vars.newEnv"),children:(0,d.jsx)(f.A,{size:14})})]})]}),(0,d.jsx)("p",{className:"muted small vars-scope",children:v===o?t("vars.scope.all"):t("vars.scope.env",{env:v})}),(0,d.jsxs)("div",{className:"vars-table",children:[0===Object.keys(B).length&&(0,d.jsx)("p",{className:"muted small",style:{margin:"4px 2px"},children:t("vars.empty")}),Object.entries(B).map(([c,e],f)=>{let k=`${v}/${f}`,l=e.secret&&!z[k];return(0,d.jsxs)("div",{className:"vars-row",children:[(0,d.jsx)(n.b,{value:c,onChange:a=>E(c,{},a.trim()),options:D,mono:!0,placeholder:t("vars.name"),ariaLabel:t("vars.name")}),(0,d.jsx)("input",{className:"input mono",type:l?"password":"text",value:e.value,onChange:a=>E(c,{value:a.target.value}),"aria-label":t("vars.value"),placeholder:e.secret&&e.set&&!e.value?t("vars.saved"):t("vars.value"),autoComplete:"off"}),(0,d.jsx)("button",{type:"button",className:`btn ghost icon sm ${e.secret?"on":""}`,"aria-pressed":!!e.secret,onClick:()=>E(c,{secret:!e.secret}),"aria-label":t("vars.secret"),title:t("vars.secret.hint"),children:(0,d.jsx)(g.A,{size:14})}),e.secret?(0,d.jsx)("button",{type:"button",className:"btn ghost icon sm",onClick:()=>A(a=>({...a,[k]:!a[k]})),"aria-label":t("vars.show"),title:t("vars.show"),children:z[k]?(0,d.jsx)(h.A,{size:14}):(0,d.jsx)(i.A,{size:14})}):(0,d.jsx)("span",{}),(0,d.jsx)("button",{type:"button",className:"btn ghost icon sm",onClick:()=>(c=>{let d={...B};delete d[c],b({...a,[v]:d})})(c),"aria-label":t("common.delete"),children:(0,d.jsx)(j.A,{size:14})}),C.has(c)&&(0,d.jsx)("span",{className:"vars-note",children:t("vars.overridden")})]},`${v}:${f}`)})]}),(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsxs)("button",{type:"button",className:"btn sm",onClick:()=>(c=>{let d=(void 0)??"name",e=1;for(;d in B;)d=`${(void 0)??"name"}${++e}`;b({...a,[v]:{...B,[d]:{value:""}}})})(),children:[(0,d.jsx)(f.A,{size:14}),t("vars.add")]}),v!==o&&!c.includes(v)&&(0,d.jsxs)("button",{type:"button",className:"btn ghost sm",onClick:()=>{let c={...a};delete c[v],b(c),w(o)},children:[(0,d.jsx)(k.A,{size:14}),t("vars.delEnv")]})]})]})}},75546:(a,b,c)=>{c.d(b,{dN:()=>E,I5:()=>D});var d=c(55322),e=c(85669),f=c(17027),g=c(58437),h=c(85605),i=c(57578),j=c(49870),k=c(48370),l=c(22276),m=c(29083),n=c(7371),o=c(5207),p=c(93884);function q(){let[a,b]=(0,f.useState)(null);return a}var r=c(88055),s=c(31251),t=c(71267);let u=["session","network","ssl","advanced"];function v({def:a,value:b,onChange:c}){return"boolean"===a.type?(0,d.jsxs)("select",{className:"select",value:b,onChange:a=>c(a.target.value),"aria-label":a.name,children:[(0,d.jsx)("option",{value:"true",children:"true"}),(0,d.jsx)("option",{value:"false",children:"false"})]}):"choice"===a.type?(0,d.jsxs)("select",{className:"select",value:b,onChange:a=>c(a.target.value),"aria-label":a.name,children:[!b&&(0,d.jsx)("option",{value:""}),a.choices.map(a=>(0,d.jsx)("option",{value:a,children:a},a))]}):(0,d.jsx)("input",{className:"input mono",type:"number"===a.type?"number":"text",min:a.min,max:a.max,value:b,placeholder:a.placeholder,autoComplete:"off",onChange:a=>c(a.target.value),"aria-label":a.name})}function w({engine:a,value:b,onChange:c,groups:e=u,exclude:f=[],quiet:g=!1}){let{t:h,locale:i}=(0,p.s9)(),j=q();if(!j)return(0,d.jsx)("p",{className:"muted small",style:{margin:0},children:h("dp.loading")});let k=j[a].filter(a=>e.includes(a.group)&&!f.includes(a.name)),l=k.filter(a=>a.name in b),m=k.filter(a=>!(a.name in b));return(0,d.jsxs)("div",{className:"dprops",children:[0===l.length&&!g&&(0,d.jsx)("p",{className:"muted small",style:{margin:0},children:h("dp.none")}),l.map(a=>(0,d.jsxs)("div",{className:"dprop",children:[(0,d.jsxs)("div",{className:"dprop-row",children:[(0,d.jsx)("code",{className:"dprop-name",children:a.name}),(0,d.jsx)("div",{className:"dprop-val",children:(0,d.jsx)(v,{def:a,value:b[a.name],onChange:d=>c({...b,[a.name]:d})})}),(0,d.jsx)("button",{type:"button",className:"btn ghost icon sm",onClick:()=>{let{[a.name]:d,...e}=b;c(e)},"aria-label":h("dp.remove",{name:a.name}),title:h("dp.remove",{name:a.name}),children:(0,d.jsx)(s.A,{size:14})})]}),(0,d.jsx)("p",{className:"muted small dprop-desc",children:"es"===i?a.es:a.desc})]},a.name)),m.length>0&&(0,d.jsxs)("div",{className:"dprop-add",children:[(0,d.jsx)(t.A,{size:14,className:"muted"}),(0,d.jsxs)("select",{className:"select",value:"","aria-label":h("dp.add"),onChange:a=>{let d=k.find(b=>b.name===a.target.value);d&&c({...b,[d.name]:"boolean"===d.type?"true":"choice"===d.type?d.choices[0]:""})},children:[(0,d.jsx)("option",{value:"",children:h("dp.add")}),u.filter(a=>m.some(b=>b.group===a)).map(a=>(0,d.jsx)("optgroup",{label:h(`dp.group.${a}`),children:m.filter(b=>b.group===a).map(a=>(0,d.jsx)("option",{value:a.name,children:a.name},a.name))},a))]})]})]})}let x={postgres:"postgresql",postgresql:"postgresql",mysql:"mysql",mariadb:"mysql",mssql:"mssql",sqlserver:"mssql",sqlite:"sqlite",file:"sqlite"};function y(a,b=[]){let c,d=a.trim(),e=/^(?:jdbc:)?([a-z][a-z0-9+.-]*):/i.exec(d),f=e?x[e[1].toLowerCase()]:void 0;if(!f)return null;let g={engine:f,host:"",port:"",user:"",password:"",database:"",file:"",ssl:!1,trust:!1,props:{}};if("sqlite"===f){let a=d.replace(/^(?:jdbc:)?(?:sqlite|file):(?:\/\/)?/i,"").split("?")[0],b=decodeURIComponent(a.startsWith("/")?a:`/${a}`);return b.length>1?{...g,file:b}:null}try{c=new URL(d.replace(/^jdbc:/i,"").replace(/^[a-z][a-z0-9+.-]*:/i,"http:"))}catch{return null}g.host=c.hostname,g.port=c.port,g.user=decodeURIComponent(c.username),g.password=decodeURIComponent(c.password),g.database=decodeURIComponent(c.pathname.replace(/^\//,""));let h=new Map(b.map(a=>[a.name.toLowerCase(),a]));return c.searchParams.forEach((a,b)=>{let c=b.toLowerCase(),d=a.toLowerCase();if("sslmode"===c||"ssl"===c||"encrypt"===c||"tls"===c)g.ssl=!["disable","disabled","false","no","0","allow","prefer"].includes(d)&&""!==d,g.trust=g.ssl&&["require","required","preferred"].includes(d);else if("trustservercertificate"===c)g.trust="true"===d;else{let b=h.get(c);b&&!b.name.startsWith("ssl.")&&(g.props[b.name]=a)}}),g}let z={mysql:{label:"MySQL / MariaDB",port:3306,color:"#00758f",sample:"mysql://user:password@localhost:3306/app"},postgresql:{label:"PostgreSQL",port:5432,color:"#4a7fb5",sample:"postgresql://user:password@localhost:5432/app?sslmode=require"},sqlite:{label:"SQLite",port:0,color:"#0f80cc",sample:"sqlite:///home/you/app/data.db"},mssql:{label:"SQL Server",port:1433,color:"#cc2927",sample:"mssql://sa:password@localhost:1433/master"}},A=Object.keys(z),B=["ssl.ca","ssl.cert","ssl.key"],C={"ssl.ca":"db.ssl.ca","ssl.cert":"db.ssl.cert","ssl.key":"db.ssl.key"};function D(a){let b="sqlite"===a.engine?a.dbFile.split("/").pop()?.replace(/\.[^.]+$/,""):a.dbName.trim()||a.dbHost.trim();return b?`${b} \xb7 ${z[a.engine].label.split(" ")[0]}`:""}function E({d:a,set:b,setD:c,objectId:s,creating:t=!1}){let{t:u,locale:v}=(0,p.s9)(),x=q(),[D,E]=(0,f.useState)({state:"idle"}),[F,G]=(0,f.useState)(""),[H,I]=(0,f.useState)(""),J="sqlite"===a.engine,K=(c,e={})=>(0,d.jsx)("input",{className:`input ${e.mono?"mono":""}`,type:e.type,value:a[c],placeholder:e.placeholder,autoComplete:e.auto??"off",onChange:a=>b(c,a.target.value)}),L=b=>{b!==a.engine&&(c(a=>({...a,engine:b,dbProps:{},dbSsl:!1,dbTrust:!1})),E({state:"idle"}))},M=async()=>{E({state:"busy"});try{let b=await n.FH.post("/object-db/test",{id:s,config:(0,r.Mr)(a)});E({state:"ok",text:`${b.version} \xb7 ${b.ms} ms`})}catch(a){E({state:"err",text:a instanceof Error?a.message:""})}},N=()=>{let b=y(F,x?.[y(F)?.engine??a.engine]);if(!b)return void I(u("db.url.bad"));I(""),E({state:"idle"}),c(a=>({...a,engine:b.engine,dbHost:b.host,dbPort:b.port,dbUser:b.user,dbPassword:b.password,dbName:b.database,dbFile:b.file,dbSsl:b.ssl,dbTrust:b.trust,dbProps:b.props})),G("")},O=(0,d.jsxs)(d.Fragment,{children:[J?(0,d.jsx)(o.yQ,{mode:"file",exts:["db","sqlite","sqlite3","db3"],value:a.dbFile,onChange:a=>b("dbFile",a),label:u("db.file"),hint:u("db.file.hint"),placeholder:"/home/you/app/data.db"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"of-grid2",children:[(0,d.jsx)(o.D0,{label:u("db.host"),children:K("dbHost",{placeholder:"127.0.0.1",mono:!0})}),(0,d.jsx)(o.D0,{label:u("db.port"),children:K("dbPort",{placeholder:String(z[a.engine].port)})}),(0,d.jsx)(o.D0,{label:u("db.user"),children:K("dbUser",{mono:!0})}),(0,d.jsx)(o.D0,{label:u("db.password"),hint:a.dbPasswordSet&&!a.dbPassword?u("db.password.saved"):void 0,children:(0,d.jsx)(e.y,{value:a.dbPassword,autoComplete:"new-password",placeholder:a.dbPasswordSet?"••••••••":"",onChange:a=>b("dbPassword",a.target.value)})})]}),(0,d.jsx)(o.D0,{label:u("db.database"),hint:u("db.database.hint"),children:K("dbName",{mono:!0})})]}),(0,d.jsxs)("div",{className:"row gap-s wrap db-test",children:[(0,d.jsxs)("button",{type:"button",className:"btn sm",onClick:()=>void M(),disabled:"busy"===D.state||!!J&&!a.dbFile.trim(),children:["busy"===D.state?(0,d.jsx)(g.A,{size:14,className:"spin"}):(0,d.jsx)(h.A,{size:14}),u("db.test")]}),"ok"===D.state&&(0,d.jsxs)("span",{className:"db-ok small",children:[(0,d.jsx)(i.A,{size:14}),u("db.test.ok")," \xb7 ",D.text]}),"err"===D.state&&(0,d.jsxs)("span",{className:"db-bad small",children:[(0,d.jsx)(j.A,{size:14}),D.text]})]})]}),P=J?null:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.Tl,{checked:a.dbSsl,onChange:a=>b("dbSsl",a),label:u("db.ssl")}),a.dbSsl&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.Tl,{checked:a.dbTrust,onChange:a=>b("dbTrust",a),label:u("db.trust"),hint:a.dbTrust?u("db.trust.on"):u("db.trust.off")}),B.filter(b=>x?.[a.engine].some(a=>a.name===b)).map(c=>{let e=x[a.engine].find(a=>a.name===c);return(0,d.jsx)(o.yQ,{mode:"file",exts:["pem","crt","cer","key"],value:a.dbProps[c]??"",onChange:d=>b("dbProps",{...a.dbProps,[c]:d}),label:u(C[c]),hint:"es"===v?e.es:e.desc,placeholder:e.placeholder},c)}),(0,d.jsx)(w,{engine:a.engine,value:a.dbProps,onChange:a=>b("dbProps",a),groups:["ssl"],exclude:[...B],quiet:!0})]})]}),Q=(0,d.jsx)(w,{engine:a.engine,value:a.dbProps,onChange:a=>b("dbProps",a),groups:["session","network","advanced"]}),R=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.Tl,{checked:a.dbReadOnly,onChange:a=>b("dbReadOnly",a),label:u("db.readonly"),hint:a.dbReadOnly?u("db.readonly.on"):u("db.readonly.off")}),(0,d.jsxs)("div",{className:"of-grid2",children:[(0,d.jsx)(o.D0,{label:u("db.timeout"),hint:u("db.timeout.hint"),children:K("dbTimeout",{placeholder:"30"})}),(0,d.jsx)(o.D0,{label:u("db.maxRows"),hint:u("db.maxRows.hint"),children:K("dbMaxRows",{placeholder:"1000"})})]})]}),S=(0,d.jsx)("div",{className:"dbengines",role:"group","aria-label":u("db.engine"),children:A.map(b=>(0,d.jsxs)("button",{type:"button",className:"dbengine","aria-pressed":a.engine===b,style:{"--c":z[b].color},onClick:()=>L(b),children:[(0,d.jsx)(k.A,{size:18}),(0,d.jsx)("b",{children:z[b].label}),(0,d.jsx)("small",{children:"sqlite"===b?u("db.engine.file"):u("db.engine.port",{port:z[b].port})})]},b))});return t?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(r.Zp,{title:u("db.engine"),hint:u("db.engine.hint"),children:S}),(0,d.jsxs)(r.Zp,{title:u("db.conn"),hint:u("db.conn.hint"),children:[(0,d.jsx)(o.D0,{label:u("db.url"),error:H,hint:H?void 0:u("db.url.hint"),children:(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsx)("input",{className:"input mono grow",value:F,placeholder:z[a.engine].sample,autoComplete:"off",spellCheck:!1,onChange:a=>{G(a.target.value),I("")},onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),N())}}),(0,d.jsxs)("button",{type:"button",className:"btn sm",disabled:!F.trim(),onClick:N,children:[(0,d.jsx)(l.A,{size:14}),u("db.url.use")]})]})}),O]}),(0,d.jsx)(r.Zp,{title:u("db.safety"),hint:u("db.safety.hint"),children:R}),(0,d.jsxs)("details",{className:"of-adv",children:[(0,d.jsxs)("summary",{children:[(0,d.jsx)(m.A,{size:15}),u("db.advanced"),(0,d.jsx)("span",{className:"muted small",children:u("db.advanced.hint")})]}),!J&&(0,d.jsx)(r.Zp,{title:u("db.sslTitle"),hint:u("db.sslTitle.hint"),children:P}),(0,d.jsx)(r.Zp,{title:u("dp.title"),hint:u("dp.hint"),children:Q})]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(r.Zp,{title:u("db.conn"),hint:u("db.conn.hint"),children:[(0,d.jsx)(o.D0,{label:u("db.engine"),children:(0,d.jsx)(o.$q,{value:a.engine,onChange:L,options:A.map(a=>({id:a,label:z[a].label}))})}),O]}),!J&&(0,d.jsx)(r.Zp,{title:u("db.sslTitle"),hint:u("db.sslTitle.hint"),children:P}),(0,d.jsx)(r.Zp,{title:u("dp.title"),hint:u("dp.hint"),children:Q}),(0,d.jsx)(r.Zp,{title:u("db.safety"),hint:u("db.safety.hint"),children:R})]})}},88055:(a,b,c)=>{c.d(b,{Zp:()=>u,Bh:()=>w,Mr:()=>t,QJ:()=>q,qP:()=>s,Te:()=>x});var d=c(55322),e=c(70226),f=c(17027),g=c(77671),h=c(5207);c(7371);var i=c(31055),j=c(93884);function k({template:a,values:b,onPick:c,onValue:e}){let{t:g}=(0,j.s9)(),i=function(){let[a,b]=(0,f.useState)(null);return a}(),k=i?.find(b=>b.id===a);return i?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"tpls",children:i.map(b=>(0,d.jsxs)("button",{type:"button",className:"tpl","aria-pressed":a===b.id,onClick:()=>c(b),children:[(0,d.jsx)("b",{children:b.name}),(0,d.jsx)("small",{children:b.description})]},b.id))}),k&&k.fields.map(a=>(0,d.jsx)(h.D0,{label:a.label,children:(0,d.jsx)("input",{className:`input ${"text"===a.kind&&"version"!==a.key?"":"mono"}`,value:b[a.key]??"",onChange:b=>e(a.key,b.target.value),placeholder:a.default,inputMode:"port"===a.kind?"numeric":void 0})},`${k.id}-${a.key}`)),k&&(0,d.jsx)("p",{className:"muted small",style:{margin:0},children:g("tpl.note")})]}):(0,d.jsx)("p",{className:"muted small",style:{margin:0},children:g("git.loading")})}var l=c(60570),m=c(93717),n=c(61060),o=c(75546);let p=a=>void 0===a?"":String(a),q=(a,b,c)=>{let d=a?.kind==="server"?a.config:{},e=a?.kind==="docker"?a.config:{},f=a?.kind==="http"?a.config:{},g=a?.kind==="cluster"?a.config:{},h=a?.kind==="database"?a.config:{};return{manager:a?.manager_id??"",name:a?.name??"",colony_id:a?.colony_id??b??"",kind:a?.kind??c??"server",cwd:d.cwd??"",start:d.start??"",stop:d.stop??"",port:p(d.port),env:(0,m.M6)(a?.kind==="server"?d.env:e.env),restart:d.restart??"no",maxRestarts:p(d.maxRestarts),healthKind:d.health?.kind??"",healthTarget:d.health?.target??"",healthInterval:p(d.health?.intervalSec),healthRetries:p(d.health?.retries),healthRestart:!!d.health?.restartWhenUnhealthy,stopTimeout:p(a?.kind==="server"?d.stopTimeoutSec:e.stopTimeoutSec),logMax:p(a?.kind==="server"?d.logMaxMb:e.logMaxMb),folder:f.folder??"",defEnv:f.env??"",variables:f.variables??{},members:g.members??[],template:"",tplValues:{},mode:e.mode??(a?"container":"template"),image:e.image??"",ports:(e.ports??[]).join("\n"),volumes:(e.volumes??[]).join("\n"),dockerRestart:e.restart??"no",command:e.command??"",file:e.file??"",project:e.project??"",services:(e.services??[]).join(", "),container:e.container??"",memory:e.memory??"",cpus:p(e.cpus),network:e.network??"",engine:h.engine??"postgresql",dbHost:h.host??"",dbPort:p(h.port),dbUser:h.user??"",dbPassword:"",dbPasswordSet:!!h.passwordSet,dbName:h.database??"",dbFile:h.file??"",dbSsl:!!h.ssl,dbTrust:!!h.trustCert,dbReadOnly:!1!==h.readOnly,dbTimeout:p(h.timeoutSec),dbMaxRows:p(h.maxRows),dbProps:{...h.props??{}}}},r=a=>""===a.trim()?void 0:Number(a);function s(a){return"database"===a.kind?t(a):"http"===a.kind?{folder:a.folder.trim(),env:a.defEnv.trim()||void 0,variables:Object.keys(a.variables).length?a.variables:void 0}:"cluster"===a.kind?{members:a.members}:"server"===a.kind?{cwd:a.cwd.trim(),start:a.start.trim(),stop:a.stop.trim()||void 0,port:r(a.port),env:(0,m.y$)(a.env),restart:"no"===a.restart?void 0:a.restart,maxRestarts:r(a.maxRestarts),stopTimeoutSec:r(a.stopTimeout),logMaxMb:r(a.logMax),health:a.healthKind&&a.healthTarget.trim()?{kind:a.healthKind,target:a.healthTarget.trim(),intervalSec:r(a.healthInterval),retries:r(a.healthRetries),restartWhenUnhealthy:a.healthRestart||void 0}:void 0}:"template"===a.mode?{mode:"compose"}:"existing"===a.mode?{mode:"existing",container:a.container.trim(),stopTimeoutSec:r(a.stopTimeout)}:"compose"===a.mode?{mode:"compose",file:a.file.trim(),project:a.project.trim()||void 0,services:a.services.split(",").map(a=>a.trim()).filter(Boolean),stopTimeoutSec:r(a.stopTimeout)}:{mode:"container",image:a.image.trim(),ports:(0,m.Mn)(a.ports),volumes:(0,m.Mn)(a.volumes),env:(0,m.y$)(a.env),restart:a.dockerRestart||"no",command:a.command.trim()||void 0,memory:a.memory.trim()||void 0,cpus:r(a.cpus),network:a.network.trim()||void 0,stopTimeoutSec:r(a.stopTimeout),logMaxMb:r(a.logMax)}}let t=a=>{let b=Object.entries(a.dbProps).filter(([b,c])=>""!==c.trim()&&(a.dbSsl||!b.startsWith("ssl."))),c=b.length?Object.fromEntries(b):void 0;return"sqlite"===a.engine?{engine:"sqlite",file:a.dbFile.trim(),props:c,readOnly:a.dbReadOnly,timeoutSec:r(a.dbTimeout),maxRows:r(a.dbMaxRows)}:{engine:a.engine,host:a.dbHost.trim()||void 0,port:r(a.dbPort),user:a.dbUser.trim()||void 0,password:a.dbPassword,database:a.dbName.trim()||void 0,ssl:a.dbSsl||void 0,trustCert:!!a.dbSsl&&!!a.dbTrust||void 0,props:c,readOnly:a.dbReadOnly,timeoutSec:r(a.dbTimeout),maxRows:r(a.dbMaxRows)}},u=({title:a,hint:b,wide:c=!1,children:e})=>(0,d.jsxs)("section",{className:`of-card ${c?"wide":""}`,id:`of-${a.toLowerCase().normalize("NFD").replace(/[^a-z0-9]+/g,"-")}`,"data-title":a,children:[(0,d.jsxs)("header",{children:[(0,d.jsx)("h4",{children:a}),b&&(0,d.jsx)("p",{className:"muted small",children:b})]}),e]});function v({file:a,project:b,services:c,onServices:e,onProject:g}){let{t:i}=(0,j.s9)(),{info:k,err:l,loading:m}=function(a){let[b,c]=(0,f.useState)(null),[d,e]=(0,f.useState)(""),[g,h]=(0,f.useState)(!1);return{info:b,err:d,loading:g}}(0),n=new Set(c.split(",").map(a=>a.trim()).filter(Boolean));return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.D0,{label:i("obj.f.services"),hint:i("dk.services.hint"),children:a?m?(0,d.jsx)("p",{className:"muted small res-m0",children:i("dk.services.loading")}):l?(0,d.jsx)("p",{className:"gx-note err res-m0",children:l}):k&&0===k.services.length?(0,d.jsx)("p",{className:"muted small res-m0",children:i("dk.services.none")}):k?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"chips",children:k.services.map(a=>(0,d.jsx)("button",{type:"button",className:`chip-pick ${n.has(a)?"on":""}`,"aria-pressed":n.has(a),onClick:()=>(a=>{let b=new Set(n);b.has(a)?b.delete(a):b.add(a),e([...b].join(", "))})(a),children:a},a))}),"file"===k.source&&(0,d.jsx)("p",{className:"muted small res-mt6",children:i("dk.services.file")})]}):null:(0,d.jsx)("p",{className:"muted small res-m0",children:i("dk.services.pickFile")})}),(0,d.jsx)(h.D0,{label:i("obj.f.project"),hint:i("dk.project.hint"),children:(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsx)("input",{className:"input mono",value:b,onChange:a=>g(a.target.value),placeholder:k?.project}),k&&!b&&(0,d.jsx)("button",{type:"button",className:"btn sm",onClick:()=>g(k.project),children:i("dk.project.use",{name:k.project})})]})})]})}function w({d:a,set:b,setD:c,scan:p,showKind:q=!1,error:r,objectId:s}){let{t}=(0,j.s9)(),{colonies:w,objects:x}=(0,l.o0)(),y=("docker"===a.kind&&("existing"===a.mode||a.mode),function(a){let[b,c]=(0,f.useState)(null),[d,e]=(0,f.useState)(null),[g,h]=(0,f.useState)(""),[i,j]=(0,f.useState)(0);return{containers:b,images:d,error:g,reload:(0,f.useCallback)(()=>j(a=>a+1),[])}}(0)),z=(c,e={})=>(0,d.jsx)("input",{className:`input ${e.mono?"mono":""}`,type:e.type,value:a[c],placeholder:e.placeholder,onChange:a=>b(c,a.target.value)}),A=y.error?(0,d.jsx)("p",{className:"muted small res-mt4",children:t("dk.unavailable",{error:y.error})}):null,B=(0,d.jsx)("button",{type:"button",className:"btn ghost icon sm",onClick:y.reload,"aria-label":t("dk.refresh"),title:t("dk.refresh"),children:(0,d.jsx)(g.A,{size:14})}),C=p?Object.keys(p.fileVars).filter(a=>"$shared"!==a):void 0,D=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.dR,{value:a.folder,onChange:a=>b("folder",a),label:t("obj.f.httpFolder"),hint:t("obj.f.httpFolder.hint")}),(0,d.jsx)(h.D0,{label:t("obj.f.defaultEnv"),hint:t("obj.f.defaultEnv.hint"),children:(0,d.jsx)(i.b,{value:a.defEnv,onChange:a=>b("defEnv",a),mono:!0,placeholder:"dev",options:[...new Set([...p?.environments??[],...Object.keys(a.variables).filter(a=>"$shared"!==a)])].map(a=>({value:a}))})})]});return(0,d.jsxs)("div",{className:"of",children:[q&&(0,d.jsx)(u,{title:t("obj.kind.pick"),wide:!0,children:(0,d.jsx)("div",{className:"okinds",children:["server","docker","http","database","cluster"].map(c=>{let{icon:e,color:f}=m.Nd[c];return(0,d.jsxs)("button",{type:"button",className:"okind","aria-pressed":a.kind===c,style:{"--c":f},onClick:()=>b("kind",c),children:[(0,d.jsx)(e,{size:20}),(0,d.jsx)("b",{children:t(`obj.kind.${c}`)}),(0,d.jsx)("small",{children:t(`obj.kind.${c}.hint`)})]},c)})})}),(0,d.jsxs)(u,{title:t("of.general"),children:[(0,d.jsx)(h.D0,{label:t("obj.f.name"),error:r,children:z("name",{placeholder:"database"===a.kind?(0,o.I5)(a):void 0})}),(0,d.jsx)(h.D0,{label:t("obj.colony"),children:(0,d.jsxs)("select",{className:"select",value:a.colony_id,onChange:a=>c(b=>({...b,colony_id:a.target.value,members:[]})),children:[(0,d.jsx)("option",{value:"",children:t("obj.noColony")}),w.map(a=>(0,d.jsx)("option",{value:a.id,children:a.name},a.id))]})}),e.G.includes(a.kind)&&(0,d.jsx)(e.I,{value:a.manager,onChange:a=>b("manager",a)}),"http"===a.kind&&!q&&D]}),"http"===a.kind?(0,d.jsxs)(d.Fragment,{children:[q&&(0,d.jsx)(u,{title:t("of.files"),children:D}),q&&(0,d.jsx)(u,{title:t("of.vars"),wide:!0,children:(0,d.jsx)(n.W,{value:a.variables,onChange:a=>b("variables",a),fileEnvs:C,fileVars:p?.fileVars,used:p?.used,fileDefined:p?.fileDefined,setBy:p?.setBy})})]}):"database"===a.kind?(0,d.jsx)(o.dN,{d:a,set:b,setD:c,objectId:s,creating:q}):"cluster"===a.kind?(0,d.jsx)(u,{title:t("of.members"),hint:t("obj.f.members.hint"),children:(()=>{let c=x.filter(b=>("server"===b.kind||"docker"===b.kind)&&(b.colony_id??"")===a.colony_id);return c.length?(0,d.jsx)("div",{className:"omembers",children:c.map(c=>{let{icon:e,color:f}=m.Nd[c.kind],g=a.members.indexOf(c.id);return(0,d.jsxs)("label",{className:"omember",children:[(0,d.jsx)("input",{type:"checkbox",checked:g>=0,onChange:()=>{let d;return d=c.id,b("members",a.members.includes(d)?a.members.filter(a=>a!==d):[...a.members,d])}}),(0,d.jsx)(e,{size:15,style:{color:f}}),(0,d.jsx)("span",{className:"nm",children:c.name}),g>=0&&(0,d.jsx)("span",{className:"ord",children:g+1})]},c.id)})}):(0,d.jsx)("p",{className:"muted small res-m0",children:t("obj.f.members.none")})})()}):"server"===a.kind?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(u,{title:t("of.run"),children:[(0,d.jsx)(h.dR,{value:a.cwd,onChange:a=>b("cwd",a),label:t("obj.f.folder"),hint:t("obj.f.folder.hint")}),(0,d.jsx)(h.D0,{label:t("obj.f.start"),hint:t("obj.f.start.hint"),children:z("start",{placeholder:"npm run dev",mono:!0})}),(0,d.jsx)(h.D0,{label:t("obj.f.stop"),hint:t("obj.f.stop.hint"),children:z("stop",{mono:!0})}),(0,d.jsx)(h.D0,{label:t("obj.f.port"),hint:t("obj.f.port.hint"),children:z("port",{placeholder:"3000"})})]}),(0,d.jsx)(u,{title:t("of.env"),children:(0,d.jsx)(h.D0,{label:t("obj.f.env"),hint:t("obj.f.env.hint"),children:(0,d.jsx)("textarea",{className:"textarea mono",rows:5,value:a.env,onChange:a=>b("env",a.target.value)})})}),(0,d.jsxs)(u,{title:t("obj.sup.title"),hint:t("obj.sup.note"),children:[(0,d.jsx)(h.D0,{label:t("obj.sup.restart"),hint:t("obj.sup.restart.hint"),children:(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsxs)("select",{className:"select",value:a.restart,onChange:a=>b("restart",a.target.value),children:[(0,d.jsx)("option",{value:"no",children:t("obj.sup.restart.no")}),(0,d.jsx)("option",{value:"on-failure",children:t("obj.sup.restart.fail")}),(0,d.jsx)("option",{value:"always",children:t("obj.sup.restart.always")})]}),"no"!==a.restart&&(0,d.jsx)("input",{className:"input res-mw130",value:a.maxRestarts,placeholder:t("obj.sup.max"),onChange:a=>b("maxRestarts",a.target.value),title:t("obj.sup.max.hint"),"aria-label":t("obj.sup.max")})]})}),(0,d.jsxs)(h.D0,{label:t("obj.sup.health"),hint:t("obj.sup.health.hint"),children:[(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsxs)("select",{className:"select res-mw170",value:a.healthKind,onChange:a=>b("healthKind",a.target.value),children:[(0,d.jsx)("option",{value:"",children:t("obj.sup.health.none")}),(0,d.jsx)("option",{value:"http",children:"HTTP"}),(0,d.jsx)("option",{value:"tcp",children:t("obj.sup.health.tcp")}),(0,d.jsx)("option",{value:"command",children:t("obj.sup.health.command")})]}),a.healthKind&&(0,d.jsx)("input",{className:"input mono grow",value:a.healthTarget,onChange:a=>b("healthTarget",a.target.value),placeholder:"http"===a.healthKind?"http://127.0.0.1:3000/health":"tcp"===a.healthKind?"3000":"curl -fs localhost:3000","aria-label":t("obj.sup.health")})]}),a.healthKind&&(0,d.jsxs)("div",{className:"row gap-s wrap res-mt8",children:[(0,d.jsx)("input",{className:"input res-mw150",value:a.healthInterval,onChange:a=>b("healthInterval",a.target.value),placeholder:t("obj.sup.interval"),"aria-label":t("obj.sup.interval")}),(0,d.jsx)("input",{className:"input res-mw130",value:a.healthRetries,onChange:a=>b("healthRetries",a.target.value),placeholder:t("obj.sup.retries"),"aria-label":t("obj.sup.retries")}),(0,d.jsx)(h.Tl,{checked:a.healthRestart,onChange:a=>b("healthRestart",a),label:t("obj.sup.healthRestart")})]})]}),(0,d.jsxs)("div",{className:"of-grid2",children:[(0,d.jsx)(h.D0,{label:t("obj.sup.stopTimeout"),hint:t("obj.sup.stopTimeout.hint"),children:z("stopTimeout",{placeholder:"8"})}),(0,d.jsx)(h.D0,{label:t("obj.sup.logMax"),hint:t("obj.sup.logMax.hint"),children:z("logMax",{placeholder:"5"})})]})]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(u,{title:t("obj.f.mode"),children:(0,d.jsx)(h.$q,{value:a.mode,onChange:a=>b("mode",a),options:[...q?[{id:"template",label:t("obj.mode.template")}]:[],{id:"container",label:t("obj.mode.container")},{id:"compose",label:t("obj.mode.compose")},{id:"existing",label:t("obj.mode.existing")}]})}),"template"===a.mode&&(0,d.jsx)(u,{title:t("obj.mode.template"),hint:t("tpl.hint"),children:(0,d.jsx)(k,{template:a.template,values:a.tplValues,onPick:a=>c(b=>({...b,template:a.id,tplValues:Object.fromEntries(a.fields.map(a=>[a.key,a.default])),name:b.name.trim()?b.name:a.name})),onValue:(a,b)=>c(c=>({...c,tplValues:{...c.tplValues,[a]:b}}))})}),"container"===a.mode&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(u,{title:t("of.image"),children:[(0,d.jsxs)(h.D0,{label:t("obj.f.image"),children:[(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsx)("div",{className:"grow",children:(0,d.jsx)(i.b,{value:a.image,onChange:a=>b("image",a),mono:!0,placeholder:t("dk.pickImage"),ariaLabel:t("obj.f.image"),options:(y.images??[]).map(a=>({value:a.ref,hint:`${a.size}${a.created?` \xb7 ${a.created}`:""}`}))})}),B]}),A]}),(0,d.jsx)(h.D0,{label:t("obj.f.ports"),hint:t("obj.f.ports.hint"),children:(0,d.jsx)("textarea",{className:"textarea mono",rows:2,value:a.ports,onChange:a=>b("ports",a.target.value),placeholder:"8080:80"})}),(0,d.jsxs)(h.D0,{label:t("obj.f.volumes"),hint:t("obj.f.volumes.hint"),children:[(0,d.jsx)("textarea",{className:"textarea mono",rows:2,value:a.volumes,onChange:a=>b("volumes",a.target.value)}),(0,d.jsx)(h.yQ,{bare:!0,value:"",buttonLabel:t("obj.f.volumes.add"),onChange:c=>b("volumes",`${a.volumes.trimEnd()}${a.volumes.trim()?"\n":""}${c}:/data`)})]})]}),(0,d.jsxs)(u,{title:t("of.env"),children:[(0,d.jsx)(h.D0,{label:t("obj.f.env"),hint:t("obj.f.env.hint"),children:(0,d.jsx)("textarea",{className:"textarea mono",rows:4,value:a.env,onChange:a=>b("env",a.target.value)})}),(0,d.jsx)(h.D0,{label:t("obj.f.restart"),children:(0,d.jsx)("select",{className:"select",value:a.dockerRestart,onChange:a=>b("dockerRestart",a.target.value),children:["no","always","unless-stopped","on-failure"].map(a=>(0,d.jsx)("option",{value:a,children:a},a))})}),(0,d.jsx)(h.D0,{label:t("obj.f.command"),children:z("command",{mono:!0})})]}),(0,d.jsx)(u,{title:t("of.limits"),hint:t("obj.dk.limits.hint"),children:(0,d.jsxs)("div",{className:"of-grid2",children:[(0,d.jsx)(h.D0,{label:t("obj.dk.memory"),children:z("memory",{placeholder:"512m"})}),(0,d.jsx)(h.D0,{label:t("obj.dk.cpus"),children:z("cpus",{placeholder:"1.5"})}),(0,d.jsx)(h.D0,{label:t("obj.dk.network"),children:z("network",{placeholder:"bridge"})}),(0,d.jsx)(h.D0,{label:t("obj.sup.stopTimeout"),children:z("stopTimeout",{placeholder:"10"})}),(0,d.jsx)(h.D0,{label:t("obj.sup.logMax"),children:z("logMax",{placeholder:"10"})})]})})]}),"compose"===a.mode&&(0,d.jsxs)(u,{title:t("obj.mode.compose"),children:[(0,d.jsx)(h.yQ,{mode:"file",exts:["yml","yaml"],value:a.file,onChange:a=>b("file",a),label:t("obj.f.file"),hint:t("obj.f.file.hint"),placeholder:"/home/you/app/docker-compose.yml"}),(0,d.jsx)(v,{file:a.file,project:a.project,services:a.services,onServices:a=>b("services",a),onProject:a=>b("project",a)}),(0,d.jsx)(h.D0,{label:t("obj.sup.stopTimeout"),hint:t("obj.sup.stopTimeout.hint"),children:z("stopTimeout",{placeholder:"10"})})]}),"existing"===a.mode&&(0,d.jsxs)(u,{title:t("obj.mode.existing"),children:[(0,d.jsxs)(h.D0,{label:t("obj.f.container"),hint:t("obj.f.container.hint"),children:[(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsx)("div",{className:"grow",children:(0,d.jsx)(i.b,{value:a.container,onChange:a=>b("container",a),mono:!0,placeholder:t("dk.pickContainer"),ariaLabel:t("obj.f.container"),options:(y.containers??[]).map(a=>({value:a.name,hint:`${a.image} \xb7 ${a.state}${a.managed?` \xb7 ${t("dk.managed")}`:""}`}))})}),B]}),A]}),(0,d.jsx)(h.D0,{label:t("obj.sup.stopTimeout"),hint:t("obj.sup.stopTimeout.hint"),children:z("stopTimeout",{placeholder:"10"})})]})]})]})}function x(a){let[b,c]=(0,f.useState)(a);return{d:b,setD:c,set:(a,b)=>c(c=>({...c,[a]:b}))}}},93717:(a,b,c)=>{c.d(b,{HS:()=>p,M6:()=>l,Mn:()=>n,Nd:()=>j,Wy:()=>k,y$:()=>m});var d=c(87456),e=c(79588),f=c(30162),g=c(48370),h=c(2266),i=c(61162);let j={server:{color:"#0f8f9e",icon:d.A},docker:{color:"#2496ed",icon:e.A},http:{color:"#7a4de0",icon:f.A},database:{color:"#d9822b",icon:g.A},cluster:{color:i.Ng,icon:h.A}},k={running:"ok",ready:"ok",starting:"warn",error:"err",stopped:"off",unknown:"off"},l=a=>Object.entries(a??{}).map(([a,b])=>`${a}=${b}`).join("\n");function m(a){let b={};for(let c of a.split("\n")){let a=c.trim();if(!a||a.startsWith("#"))continue;let d=a.indexOf("=");if(d<=0)throw Error(`"${a}" is not NAME=value`);b[a.slice(0,d).trim()]=a.slice(d+1)}return b}let n=a=>a.split("\n").map(a=>a.trim()).filter(Boolean),o=[[/^(\d+) requests in (\d+) files$/,"d.requests"],[/^(\d+)\/(\d+) running$/,"d.running"],[/^no members$/,"d.noMembers"],[/^only (\d+)\/(\d+) running · stopped: (.+)$/,"d.onlySome"],[/^(.+) failed · (\d+)\/(\d+) running$/,"d.failed"],[/^waiting for port (\d+)$/,"d.waitPort"],[/^running, but nothing listens on port (\d+)$/,"d.noPort"],[/^exited with code (\d+)$/,"d.exited"],[/^ended by (\w+)$/,"d.signal"],[/^restarted \((\d+)\/(\d+)\)$/,"d.restarted"],[/^was unhealthy: restarting \((\d+)\/(\d+)\)$/,"d.unhealthyRestart"],[/^health check pending$/,"d.healthPending"],[/^restarting$/,"d.restarting"],[/^container not found$/,"d.noContainer"],[/^the compose file is missing$/,"d.noCompose"],[/^(\d+) of (\d+) running$/,"d.running2"],[/^(\d+) services?$/,"d.services"],[/^a service exited with an error$/,"d.serviceFailed"],[/^checking…$/,"d.checking"],[/^unhealthy$/,"d.unhealthy"]];function p(a,b){return b?b.split(" \xb7 ").map(b=>{for(let[c,d]of o){let e=c.exec(b);if(e)return a(d,Object.fromEntries(e.slice(1).map((a,b)=>[`a${b+1}`,a])))}let c=/^(.*)restarting in (\d+) s \((\d+)\/(\d+)\)$/.exec(b);if(c)return a("d.restartIn",{a1:c[2],a2:c[3],a3:c[4]});let d=/^gave up after (\d+) restarts$/.exec(b);if(d)return a("d.gaveUp",{a1:d[1]});let e=/^unhealthy: (.+)$/.exec(b);return e?`${a("d.unhealthy")}: ${e[1]}`:b}).join(" \xb7 "):""}},97984:(a,b,c)=>{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")]})}}};
1
+ "use strict";exports.id=306,exports.ids=[306],exports.modules={3936:(a,b,c)=>{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(81963);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}},24956:(a,b,c)=>{c.d(b,{B:()=>h});var d=c(55322),e=c(17027),f=c(96107),g=c(2838);function h({label:a,title:b,children:c,size:h="md",align:i="start"}){let[j,k]=(0,e.useState)(!1),l=(0,e.useRef)(null),m=(0,e.useRef)(null),n=(0,e.useId)();return(0,g.s)(j,l,()=>k(!1),()=>m.current?.focus()),(0,d.jsxs)("span",{className:`help ${"sm"===h?"sm":""} ${"end"===i?"end":""}`,ref:l,children:[(0,d.jsx)("button",{ref:m,type:"button",className:"help-btn","aria-label":a,title:a,"aria-haspopup":"dialog","aria-expanded":j,"aria-controls":j?n:void 0,onClick:()=>k(a=>!a),children:(0,d.jsx)(f.A,{size:"sm"===h?15:18})}),j&&(0,d.jsxs)("div",{id:n,role:"dialog","aria-label":b,className:"help-pop",children:[(0,d.jsx)("div",{className:"eyebrow",children:b}),(0,d.jsx)("div",{className:"muted small help-body",children:c})]})]})}},31055:(a,b,c)=>{c.d(b,{b:()=>h});var d=c(55322),e=c(17027),f=c(2838),g=c(81963);function h({value:a,onChange:b,options:c,placeholder:h,mono:i=!1,ariaLabel:j,onOpen:k,empty:l}){let[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(0),q=(0,e.useRef)(null);(0,f.s)(m,q,()=>n(!1));let r=(0,e.useMemo)(()=>{let b=a.trim().toLowerCase();return(b?c.filter(a=>`${a.value} ${a.label??""} ${a.hint??""}`.toLowerCase().includes(b)):c).slice(0,60)},[c,a]),s=(0,g.Bp)(m&&(r.length>0||!!l),o,r.length),t=a=>{b(a.value),n(!1)};return(0,d.jsxs)("div",{className:"sg",ref:q,children:[(0,d.jsx)("input",{className:`input ${i?"mono":""}`,value:a,placeholder:h,"aria-label":j,autoComplete:"off",spellCheck:!1,...s.input,onFocus:()=>{m||(n(!0),k?.())},onClick:()=>n(!0),onChange:a=>{b(a.target.value),n(!0)},onKeyDown:a=>{"ArrowDown"===a.key?(a.preventDefault(),n(!0),p(a=>Math.min(r.length-1,a+1))):"ArrowUp"===a.key?(a.preventDefault(),p(a=>Math.max(0,a-1))):"Enter"===a.key&&m&&r[o]?(a.preventDefault(),t(r[o])):"Escape"===a.key&&m&&(a.stopPropagation(),n(!1))}}),m&&(r.length>0||l)&&(0,d.jsxs)("ul",{className:"sg-list",...s.listProps,children:[0===r.length&&(0,d.jsx)("li",{className:"sg-empty",role:"presentation",children:l}),r.map((a,b)=>(0,d.jsx)("li",{...s.optionProps(b),children:(0,d.jsxs)("button",{type:"button",tabIndex:-1,className:`sg-opt ${b===o?"hi":""}`,onMouseDown:a=>a.preventDefault(),onMouseEnter:()=>p(b),onClick:()=>t(a),children:[(0,d.jsx)("span",{className:`nm ${i?"mono":""}`,children:a.label??a.value}),a.hint&&(0,d.jsx)("span",{className:"hint",children:a.hint})]})},a.value))]})]})}},36368:(a,b,c)=>{c.d(b,{md:()=>I,wl:()=>K});var d=c(55322),e=c(97984),f=c(17027),g=c(91705),h=c.n(g),i=c(46378),j=c(31251),k=c(96489),l=c(48370),m=c(72836),n=c(6289),o=c(58437),p=c(85605),q=c(32309),r=c(84300),s=c(37811),t=c(78381),u=c(44521),v=c(8811),w=c(3936),x=c(7371),y=c(93884),z=c(61162),A=c(81963),B=c(89477),C=c(60570),D=c(42580),E=c(36143),F=c(93717),G=c(77712);let H={mysql:"MySQL / MariaDB",postgresql:"PostgreSQL",sqlite:"SQLite",mssql:"SQL Server"};function I({status:a,className:b=""}){return(0,d.jsx)("i",{className:`odot ${F.Wy[a]} ${b}`,"aria-hidden":!0})}function J(a){if("server"===a.kind)return a.config.start;if("http"===a.kind)return(0,z._1)(a.config.folder);if("database"===a.kind){let b=a.config;return"sqlite"===b.engine?(0,z._1)(b.file??""):`${b.host||"127.0.0.1"}${b.port?`:${b.port}`:""}${b.database?`/${b.database}`:""}`}if("cluster"===a.kind)return`${a.config.members.length}`;let b=a.config;return"container"===b.mode?b.image??"":"compose"===b.mode?(0,z._1)(b.file??""):b.container??""}function K({object:a,target:b,onClose:c,onCreateManager:g}){let{t:K}=(0,y.s9)(),{agents:L,objects:M,colonies:N}=(0,C.o0)(),O=(0,D.n)(),P="server"===a.kind||"docker"===a.kind&&"compose"!==a.config.mode,Q=a.manager_id?L.filter(b=>b.id===a.manager_id):L.filter(b=>b.skill_ids.includes(E.t)&&(b.colony_id??null)===(a.colony_id??null)),[R,S]=(0,f.useState)(!1),{refresh:T}=(0,C.o0)(),U=async b=>{try{await x.FH.put(`/objects/${a.id}/manager`,{agent_id:b}),await T(["objects","agents"]),S(!1)}catch(a){V(a instanceof Error?a.message:"","err")}},V=(0,A.dj)(),[W,X]=(0,f.useState)(null),{icon:Y,color:Z}=F.Nd[a.kind],$=a.state.status,_=async b=>{X(b);try{await x.FH.post(`/objects/${a.id}/action`,{action:b})}catch(a){V(`${K("obj.act.failed",{action:K(`obj.act.${b}`)})}: ${a instanceof Error?a.message:""}`,"err")}finally{X(null)}},aa="running"===$||"starting"===$,ab=async()=>{X("test");try{let b=await x.FH.post("/object-db/test",{id:a.id,config:a.config});V(`${K("db.test.ok")} \xb7 ${b.version} \xb7 ${b.ms} ms`)}catch(a){V(a instanceof Error?a.message:"","err")}finally{X(null)}},ac="cluster"===a.kind?a.config.members.map(a=>M.find(b=>b.id===a)).filter(a=>!!a):[];return(0,d.jsx)(w.rs,{target:b,pinned:!0,width:380,label:a.name,onClose:c,children:(0,d.jsxs)("div",{className:"col obj-panel res-gap12",children:[(0,d.jsxs)("div",{className:"ap-corner row gap-s",children:[(0,d.jsx)(h(),{className:"btn ghost icon sm",href:`/resources/${a.id}?tab=config`,"aria-label":K("obj.act.edit"),title:K("obj.act.edit"),children:(0,d.jsx)(i.A,{size:15})}),(0,d.jsx)("button",{className:"btn ghost icon sm",onClick:c,"aria-label":K("common.close"),title:`${K("common.close")} (Esc)`,children:(0,d.jsx)(j.A,{size:16})})]}),(0,d.jsxs)("div",{className:"row gap-l res-pr70",children:[(0,d.jsx)("span",{className:"obj-ico",style:{"--c":Z},children:(0,d.jsx)(Y,{size:22})}),(0,d.jsxs)("div",{className:"grow res-minw0",children:[(0,d.jsx)("h2",{className:"res-h2",children:a.name}),(0,d.jsxs)("div",{className:"row gap-s wrap res-mt4",children:[(0,d.jsxs)("span",{className:`ostatus ${F.Wy[$]}`,children:[(0,d.jsx)(I,{status:$}),K(`obj.status.${$}`)]}),(0,d.jsx)("span",{className:"muted small",children:K(`obj.kind.${a.kind}`)})]})]})]}),(a.state.detail||a.state.since)&&(0,d.jsx)("p",{className:"muted small res-m0",children:[(0,F.HS)(K,a.state.detail),a.state.since&&aa?K("obj.since",{time:(0,z.KN)(a.state.since)}):"",a.state.pid?K("obj.pid",{pid:a.state.pid}):""].filter(Boolean).join(" \xb7 ")}),(0,d.jsxs)(h(),{className:"btn primary",href:`/resources/${a.id}`,children:[(0,d.jsx)(k.A,{size:15}),K("obj.open")]}),"cluster"!==a.kind&&(0,d.jsx)("div",{className:"mono small obj-cmd",title:J(a),children:J(a)}),"database"===a.kind&&(0,d.jsxs)("div",{className:"row gap-s wrap",children:[(0,d.jsxs)("span",{className:"db-badge",children:[(0,d.jsx)(l.A,{size:12}),H[a.config.engine]]}),!1!==a.config.readOnly?(0,d.jsxs)("span",{className:"db-badge ro",children:[(0,d.jsx)(m.A,{size:12}),K("db.readonly.badge")]}):(0,d.jsxs)("span",{className:"db-badge rw",children:[(0,d.jsx)(n.A,{size:12}),K("db.write.badge")]}),(0,d.jsxs)("button",{className:"btn sm",disabled:!!W,onClick:()=>void ab(),children:["test"===W?(0,d.jsx)(o.A,{size:14,className:"spin"}):(0,d.jsx)(p.A,{size:14}),K("db.test")]})]}),"http"===a.kind||"database"===a.kind?null:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"row gap-s wrap",children:[(0,d.jsxs)("button",{className:"btn primary sm",disabled:!!W||("cluster"===a.kind?"running"===$:aa),onClick:()=>void _("start"),children:[(0,d.jsx)(q.A,{size:14}),K("cluster"===a.kind?"obj.act.startAll":"obj.act.start")]}),(0,d.jsxs)("button",{className:"btn sm",disabled:!!W||!aa&&"error"!==$&&!("cluster"===a.kind&&ac.some(a=>"running"===a.state.status)),onClick:()=>void _("stop"),children:[(0,d.jsx)(r.A,{size:14}),K("cluster"===a.kind?"obj.act.stopAll":"obj.act.stop")]}),(0,d.jsxs)("button",{className:"btn sm",disabled:!!W,onClick:()=>void _("restart"),children:[(0,d.jsx)(s.A,{size:14}),K("cluster"===a.kind?"obj.act.restartAll":"obj.act.restart")]})]}),"cluster"===a.kind&&(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"eyebrow res-mb6",children:K("obj.members")}),ac.length?(0,d.jsx)("div",{className:"col res-gap4",children:ac.map((a,b)=>(0,d.jsxs)("div",{className:"row gap-s small",children:[(0,d.jsx)("span",{className:"ord",children:b+1}),(0,d.jsx)(I,{status:a.state.status}),(0,d.jsx)("b",{className:"grow ellipsis",children:a.name}),(0,d.jsx)("span",{className:"muted",children:K(`obj.status.${a.state.status}`)})]},a.id))}):(0,d.jsx)("p",{className:"muted small res-m0",children:K("obj.members.empty")})]}),(0,d.jsxs)("div",{className:"row gap-s wrap",children:[P&&(0,d.jsx)(e.N,{spec:{objectId:a.id},label:"server"===a.kind?K("dock.here"):K("dock.shell")}),(0,d.jsxs)("button",{className:"btn sm",onClick:()=>O.openLogs(a.id,a.name),children:[(0,d.jsx)(t.A,{size:14}),K("dock.logs")]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"eyebrow res-mb6",children:K("obj.logs")}),(0,d.jsx)(G.I,{id:a.id})]})]}),"http"!==a.kind&&"database"!==a.kind&&(0,d.jsxs)("div",{className:"obj-managers",children:[(0,d.jsx)("div",{className:"eyebrow res-mb6",children:K("obj.managers")}),Q.length?(0,d.jsx)("div",{className:"row gap-s wrap",children:Q.map(b=>(0,d.jsxs)("span",{className:"chip ps-chip",children:[(0,d.jsxs)(h(),{href:`/agents/${b.id}`,title:"plan"===b.permission?K("obj.managers.readonly"):void 0,children:[b.name,"plan"===b.permission?` \xb7 ${K("obj.managers.ro")}`:""]}),a.manager_id===b.id&&(0,d.jsx)("button",{type:"button",onClick:()=>void U(null),"aria-label":K("obj.managers.remove"),title:K("obj.managers.remove"),children:(0,d.jsx)(j.A,{size:12})})]},b.id))}):(0,d.jsx)("p",{className:"muted small res-m0",children:K("obj.managers.none")}),a.manager_id&&(0,d.jsx)("p",{className:"muted small res-mt6",children:K("obj.managers.only")}),(0,d.jsxs)("div",{className:"row gap-s wrap res-mt8",children:[(0,d.jsxs)("button",{className:"btn sm",onClick:g,children:[(0,d.jsx)(u.A,{size:14}),K("obj.managers.create")]}),(0,d.jsxs)("button",{className:"btn sm","aria-pressed":R,onClick:()=>S(a=>!a),children:[(0,d.jsx)(v.A,{size:14}),K("obj.managers.add")]})]}),R&&(0,d.jsx)("div",{className:"res-mt8",children:(0,d.jsx)(B.c,{inline:!0,autoFocus:!0,options:L.filter(b=>b.id!==a.manager_id).map(a=>({id:a.id,label:a.name,hint:N.find(b=>b.id===a.colony_id)?.name??K("common.noColony")})),value:[],onChange:a=>a[0]&&void U(a[0]),placeholder:K("obj.manager.placeholder"),empty:K("obj.manager.empty"),ariaLabel:K("obj.managers.add")})})]})]})})}},54403:(a,b,c)=>{c.d(b,{X:()=>m});var d=c(55322),e=c(17027),f=c(7371),g=c(93884),h=c(60570),i=c(81963),j=c(88055),k=c(70226),l=c(75546);function m({presetColonyId:a,presetKind:b,onClose:c,onSaved:m}){let{t:n}=(0,g.s9)(),{refresh:o}=(0,h.o0)(),p=(0,i.dj)(),{d:q,set:r,setD:s}=(0,j.Te)(()=>(0,j.QJ)(void 0,a,b)),[t,u]=(0,e.useState)(""),[v,w]=(0,e.useState)(!1),x=async()=>{let a=q.name.trim()||("database"===q.kind?(0,l.I5)(q):"");if(!a)return void u(n("obj.err.name"));w(!0),u("");try{if("docker"===q.kind&&"template"===q.mode&&!q.template){u(n("tpl.pick")),w(!1);return}let b="docker"===q.kind&&"template"===q.mode?await f.FH.post("/objects/from-template",{name:a,colony_id:q.colony_id||null,template:q.template,values:q.tplValues}):await f.FH.post("/objects",{name:a,colony_id:q.colony_id||null,kind:q.kind,config:(0,j.qP)(q)});q.manager&&k.G.includes(q.kind)&&await f.FH.put(`/objects/${b.id}/manager`,{agent_id:q.manager}).catch(a=>p(a instanceof Error?a.message:"","err")),await o(["objects","agents"]),p(n("obj.created")),m?.(b.id),c()}catch(a){u(a instanceof Error?a.message:n("edit.saveFailed")),w(!1)}};return(0,d.jsx)(i._s,{title:n("obj.newTitle"),subtitle:n("obj.subtitle"),onClose:c,footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{className:"btn ghost",onClick:c,children:n("common.cancel")}),(0,d.jsx)("button",{className:"btn primary",disabled:v,onClick:()=>void x(),children:n("obj.create")})]}),children:(0,d.jsx)(j.Bh,{d:q,set:r,setD:s,showKind:!0,error:t})})}},54842:(a,b,c)=>{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")}`}},61060:(a,b,c)=>{c.d(b,{W:()=>p});var d=c(55322),e=c(17027),f=c(71267),g=c(72836),h=c(62850),i=c(45482),j=c(34410),k=c(31251),l=c(24956),m=c(93884),n=c(31055);let o="$shared";function p({value:a,onChange:b,fileEnvs:c=[],fileVars:p={},used:q=[],fileDefined:r=[],setBy:s={}}){let{t}=(0,m.s9)(),u=[o,...[...new Set([...Object.keys(a),...c])].filter(a=>a!==o).sort()],[v,w]=(0,e.useState)(()=>u.find(b=>b!==o&&Object.keys(a[b]??{}).length>0)??u[0]),[x,y]=(0,e.useState)(""),[z,A]=(0,e.useState)({}),B=a[v]??{},C=new Set([...v!==o?p[o]??[]:[],...p[v]??[]]),D=q.filter(a=>!(a.name in B)).map(a=>({value:a.name,hint:t("vars.used.count",{count:a.count})})),E=(c,d,e)=>{if(void 0!==e&&e!==c&&e in B)return;let f=Object.entries(B).map(([a,b])=>a===c?[e??a,{...b,...d}]:[a,b]);b({...a,[v]:Object.fromEntries(f)})},F=()=>{let c=x.trim();!/^[\w.$-]{1,60}$/.test(c)||c in a||c===o||(b({...a,[c]:{}}),w(c),y(""))};return(0,d.jsxs)("div",{className:"vars",children:[(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsx)("b",{children:t("ow.tab.vars")}),(0,d.jsxs)(l.B,{size:"sm",label:t("common.help"),title:t("vars.how.title"),children:[(0,d.jsx)("p",{children:t("vars.hint")}),(0,d.jsx)("p",{children:t("vars.how.1")}),(0,d.jsx)("p",{children:t("vars.how.2")}),(0,d.jsx)("p",{children:t("vars.note")})]})]}),(0,d.jsxs)("div",{className:"vars-envs",role:"tablist",children:[u.map(a=>(0,d.jsxs)("button",{type:"button",role:"tab","aria-selected":v===a,className:`vars-env ${v===a?"on":""}`,onClick:()=>w(a),title:a===o?t("vars.all.hint"):void 0,children:[a===o?t("vars.all"):a,c.includes(a)&&(0,d.jsx)("i",{className:"vars-file",title:t("vars.fromFile"),children:"\xb7"})]},a)),(0,d.jsxs)("span",{className:"vars-add",children:[(0,d.jsx)("input",{className:"input",placeholder:t("vars.newEnv"),value:x,onChange:a=>y(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),F())},"aria-label":t("vars.newEnv")}),(0,d.jsx)("button",{type:"button",className:"btn ghost icon sm",onClick:F,disabled:!x.trim(),"aria-label":t("vars.newEnv"),children:(0,d.jsx)(f.A,{size:14})})]})]}),(0,d.jsx)("p",{className:"muted small vars-scope",children:v===o?t("vars.scope.all"):t("vars.scope.env",{env:v})}),(0,d.jsxs)("div",{className:"vars-table",children:[0===Object.keys(B).length&&(0,d.jsx)("p",{className:"muted small",style:{margin:"4px 2px"},children:t("vars.empty")}),Object.entries(B).map(([c,e],f)=>{let k=`${v}/${f}`,l=e.secret&&!z[k];return(0,d.jsxs)("div",{className:"vars-row",children:[(0,d.jsx)(n.b,{value:c,onChange:a=>E(c,{},a.trim()),options:D,mono:!0,placeholder:t("vars.name"),ariaLabel:t("vars.name")}),(0,d.jsx)("input",{className:"input mono",type:l?"password":"text",value:e.value,onChange:a=>E(c,{value:a.target.value}),"aria-label":t("vars.value"),placeholder:e.secret&&e.set&&!e.value?t("vars.saved"):t("vars.value"),autoComplete:"off"}),(0,d.jsx)("button",{type:"button",className:`btn ghost icon sm ${e.secret?"on":""}`,"aria-pressed":!!e.secret,onClick:()=>E(c,{secret:!e.secret}),"aria-label":t("vars.secret"),title:t("vars.secret.hint"),children:(0,d.jsx)(g.A,{size:14})}),e.secret?(0,d.jsx)("button",{type:"button",className:"btn ghost icon sm",onClick:()=>A(a=>({...a,[k]:!a[k]})),"aria-label":t("vars.show"),title:t("vars.show"),children:z[k]?(0,d.jsx)(h.A,{size:14}):(0,d.jsx)(i.A,{size:14})}):(0,d.jsx)("span",{}),(0,d.jsx)("button",{type:"button",className:"btn ghost icon sm",onClick:()=>(c=>{let d={...B};delete d[c],b({...a,[v]:d})})(c),"aria-label":t("common.delete"),children:(0,d.jsx)(j.A,{size:14})}),C.has(c)&&(0,d.jsx)("span",{className:"vars-note",children:t("vars.overridden")})]},`${v}:${f}`)})]}),(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsxs)("button",{type:"button",className:"btn sm",onClick:()=>(c=>{let d=(void 0)??"name",e=1;for(;d in B;)d=`${(void 0)??"name"}${++e}`;b({...a,[v]:{...B,[d]:{value:""}}})})(),children:[(0,d.jsx)(f.A,{size:14}),t("vars.add")]}),v!==o&&!c.includes(v)&&(0,d.jsxs)("button",{type:"button",className:"btn ghost sm",onClick:()=>{let c={...a};delete c[v],b(c),w(o)},children:[(0,d.jsx)(k.A,{size:14}),t("vars.delEnv")]})]})]})}},75546:(a,b,c)=>{c.d(b,{dN:()=>E,I5:()=>D});var d=c(55322),e=c(85669),f=c(17027),g=c(58437),h=c(85605),i=c(57578),j=c(49870),k=c(48370),l=c(22276),m=c(29083),n=c(7371),o=c(81963),p=c(93884);function q(){let[a,b]=(0,f.useState)(null);return a}var r=c(88055),s=c(31251),t=c(71267);let u=["session","network","ssl","advanced"];function v({def:a,value:b,onChange:c}){return"boolean"===a.type?(0,d.jsxs)("select",{className:"select",value:b,onChange:a=>c(a.target.value),"aria-label":a.name,children:[(0,d.jsx)("option",{value:"true",children:"true"}),(0,d.jsx)("option",{value:"false",children:"false"})]}):"choice"===a.type?(0,d.jsxs)("select",{className:"select",value:b,onChange:a=>c(a.target.value),"aria-label":a.name,children:[!b&&(0,d.jsx)("option",{value:""}),a.choices.map(a=>(0,d.jsx)("option",{value:a,children:a},a))]}):(0,d.jsx)("input",{className:"input mono",type:"number"===a.type?"number":"text",min:a.min,max:a.max,value:b,placeholder:a.placeholder,autoComplete:"off",onChange:a=>c(a.target.value),"aria-label":a.name})}function w({engine:a,value:b,onChange:c,groups:e=u,exclude:f=[],quiet:g=!1}){let{t:h,locale:i}=(0,p.s9)(),j=q();if(!j)return(0,d.jsx)("p",{className:"muted small",style:{margin:0},children:h("dp.loading")});let k=j[a].filter(a=>e.includes(a.group)&&!f.includes(a.name)),l=k.filter(a=>a.name in b),m=k.filter(a=>!(a.name in b));return(0,d.jsxs)("div",{className:"dprops",children:[0===l.length&&!g&&(0,d.jsx)("p",{className:"muted small",style:{margin:0},children:h("dp.none")}),l.map(a=>(0,d.jsxs)("div",{className:"dprop",children:[(0,d.jsxs)("div",{className:"dprop-row",children:[(0,d.jsx)("code",{className:"dprop-name",children:a.name}),(0,d.jsx)("div",{className:"dprop-val",children:(0,d.jsx)(v,{def:a,value:b[a.name],onChange:d=>c({...b,[a.name]:d})})}),(0,d.jsx)("button",{type:"button",className:"btn ghost icon sm",onClick:()=>{let{[a.name]:d,...e}=b;c(e)},"aria-label":h("dp.remove",{name:a.name}),title:h("dp.remove",{name:a.name}),children:(0,d.jsx)(s.A,{size:14})})]}),(0,d.jsx)("p",{className:"muted small dprop-desc",children:"es"===i?a.es:a.desc})]},a.name)),m.length>0&&(0,d.jsxs)("div",{className:"dprop-add",children:[(0,d.jsx)(t.A,{size:14,className:"muted"}),(0,d.jsxs)("select",{className:"select",value:"","aria-label":h("dp.add"),onChange:a=>{let d=k.find(b=>b.name===a.target.value);d&&c({...b,[d.name]:"boolean"===d.type?"true":"choice"===d.type?d.choices[0]:""})},children:[(0,d.jsx)("option",{value:"",children:h("dp.add")}),u.filter(a=>m.some(b=>b.group===a)).map(a=>(0,d.jsx)("optgroup",{label:h(`dp.group.${a}`),children:m.filter(b=>b.group===a).map(a=>(0,d.jsx)("option",{value:a.name,children:a.name},a.name))},a))]})]})]})}let x={postgres:"postgresql",postgresql:"postgresql",mysql:"mysql",mariadb:"mysql",mssql:"mssql",sqlserver:"mssql",sqlite:"sqlite",file:"sqlite"};function y(a,b=[]){let c,d=a.trim(),e=/^(?:jdbc:)?([a-z][a-z0-9+.-]*):/i.exec(d),f=e?x[e[1].toLowerCase()]:void 0;if(!f)return null;let g={engine:f,host:"",port:"",user:"",password:"",database:"",file:"",ssl:!1,trust:!1,props:{}};if("sqlite"===f){let a=d.replace(/^(?:jdbc:)?(?:sqlite|file):(?:\/\/)?/i,"").split("?")[0],b=decodeURIComponent(a.startsWith("/")?a:`/${a}`);return b.length>1?{...g,file:b}:null}try{c=new URL(d.replace(/^jdbc:/i,"").replace(/^[a-z][a-z0-9+.-]*:/i,"http:"))}catch{return null}g.host=c.hostname,g.port=c.port,g.user=decodeURIComponent(c.username),g.password=decodeURIComponent(c.password),g.database=decodeURIComponent(c.pathname.replace(/^\//,""));let h=new Map(b.map(a=>[a.name.toLowerCase(),a]));return c.searchParams.forEach((a,b)=>{let c=b.toLowerCase(),d=a.toLowerCase();if("sslmode"===c||"ssl"===c||"encrypt"===c||"tls"===c)g.ssl=!["disable","disabled","false","no","0","allow","prefer"].includes(d)&&""!==d,g.trust=g.ssl&&["require","required","preferred"].includes(d);else if("trustservercertificate"===c)g.trust="true"===d;else{let b=h.get(c);b&&!b.name.startsWith("ssl.")&&(g.props[b.name]=a)}}),g}let z={mysql:{label:"MySQL / MariaDB",port:3306,color:"#00758f",sample:"mysql://user:password@localhost:3306/app"},postgresql:{label:"PostgreSQL",port:5432,color:"#4a7fb5",sample:"postgresql://user:password@localhost:5432/app?sslmode=require"},sqlite:{label:"SQLite",port:0,color:"#0f80cc",sample:"sqlite:///home/you/app/data.db"},mssql:{label:"SQL Server",port:1433,color:"#cc2927",sample:"mssql://sa:password@localhost:1433/master"}},A=Object.keys(z),B=["ssl.ca","ssl.cert","ssl.key"],C={"ssl.ca":"db.ssl.ca","ssl.cert":"db.ssl.cert","ssl.key":"db.ssl.key"};function D(a){let b="sqlite"===a.engine?a.dbFile.split("/").pop()?.replace(/\.[^.]+$/,""):a.dbName.trim()||a.dbHost.trim();return b?`${b} \xb7 ${z[a.engine].label.split(" ")[0]}`:""}function E({d:a,set:b,setD:c,objectId:s,creating:t=!1}){let{t:u,locale:v}=(0,p.s9)(),x=q(),[D,E]=(0,f.useState)({state:"idle"}),[F,G]=(0,f.useState)(""),[H,I]=(0,f.useState)(""),J="sqlite"===a.engine,K=(c,e={})=>(0,d.jsx)("input",{className:`input ${e.mono?"mono":""}`,type:e.type,value:a[c],placeholder:e.placeholder,autoComplete:e.auto??"off",onChange:a=>b(c,a.target.value)}),L=b=>{b!==a.engine&&(c(a=>({...a,engine:b,dbProps:{},dbSsl:!1,dbTrust:!1})),E({state:"idle"}))},M=async()=>{E({state:"busy"});try{let b=await n.FH.post("/object-db/test",{id:s,config:(0,r.Mr)(a)});E({state:"ok",text:`${b.version} \xb7 ${b.ms} ms`})}catch(a){E({state:"err",text:a instanceof Error?a.message:""})}},N=()=>{let b=y(F,x?.[y(F)?.engine??a.engine]);if(!b)return void I(u("db.url.bad"));I(""),E({state:"idle"}),c(a=>({...a,engine:b.engine,dbHost:b.host,dbPort:b.port,dbUser:b.user,dbPassword:b.password,dbName:b.database,dbFile:b.file,dbSsl:b.ssl,dbTrust:b.trust,dbProps:b.props})),G("")},O=(0,d.jsxs)(d.Fragment,{children:[J?(0,d.jsx)(o.yQ,{mode:"file",exts:["db","sqlite","sqlite3","db3"],value:a.dbFile,onChange:a=>b("dbFile",a),label:u("db.file"),hint:u("db.file.hint"),placeholder:"/home/you/app/data.db"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"of-grid2",children:[(0,d.jsx)(o.D0,{label:u("db.host"),children:K("dbHost",{placeholder:"127.0.0.1",mono:!0})}),(0,d.jsx)(o.D0,{label:u("db.port"),children:K("dbPort",{placeholder:String(z[a.engine].port)})}),(0,d.jsx)(o.D0,{label:u("db.user"),children:K("dbUser",{mono:!0})}),(0,d.jsx)(o.D0,{label:u("db.password"),hint:a.dbPasswordSet&&!a.dbPassword?u("db.password.saved"):void 0,children:(0,d.jsx)(e.y,{value:a.dbPassword,autoComplete:"new-password",placeholder:a.dbPasswordSet?"••••••••":"",onChange:a=>b("dbPassword",a.target.value)})})]}),(0,d.jsx)(o.D0,{label:u("db.database"),hint:u("db.database.hint"),children:K("dbName",{mono:!0})})]}),(0,d.jsxs)("div",{className:"row gap-s wrap db-test",children:[(0,d.jsxs)("button",{type:"button",className:"btn sm",onClick:()=>void M(),disabled:"busy"===D.state||!!J&&!a.dbFile.trim(),children:["busy"===D.state?(0,d.jsx)(g.A,{size:14,className:"spin"}):(0,d.jsx)(h.A,{size:14}),u("db.test")]}),"ok"===D.state&&(0,d.jsxs)("span",{className:"db-ok small",children:[(0,d.jsx)(i.A,{size:14}),u("db.test.ok")," \xb7 ",D.text]}),"err"===D.state&&(0,d.jsxs)("span",{className:"db-bad small",children:[(0,d.jsx)(j.A,{size:14}),D.text]})]})]}),P=J?null:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.Tl,{checked:a.dbSsl,onChange:a=>b("dbSsl",a),label:u("db.ssl")}),a.dbSsl&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.Tl,{checked:a.dbTrust,onChange:a=>b("dbTrust",a),label:u("db.trust"),hint:a.dbTrust?u("db.trust.on"):u("db.trust.off")}),B.filter(b=>x?.[a.engine].some(a=>a.name===b)).map(c=>{let e=x[a.engine].find(a=>a.name===c);return(0,d.jsx)(o.yQ,{mode:"file",exts:["pem","crt","cer","key"],value:a.dbProps[c]??"",onChange:d=>b("dbProps",{...a.dbProps,[c]:d}),label:u(C[c]),hint:"es"===v?e.es:e.desc,placeholder:e.placeholder},c)}),(0,d.jsx)(w,{engine:a.engine,value:a.dbProps,onChange:a=>b("dbProps",a),groups:["ssl"],exclude:[...B],quiet:!0})]})]}),Q=(0,d.jsx)(w,{engine:a.engine,value:a.dbProps,onChange:a=>b("dbProps",a),groups:["session","network","advanced"]}),R=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.Tl,{checked:a.dbReadOnly,onChange:a=>b("dbReadOnly",a),label:u("db.readonly"),hint:a.dbReadOnly?u("db.readonly.on"):u("db.readonly.off")}),(0,d.jsxs)("div",{className:"of-grid2",children:[(0,d.jsx)(o.D0,{label:u("db.timeout"),hint:u("db.timeout.hint"),children:K("dbTimeout",{placeholder:"30"})}),(0,d.jsx)(o.D0,{label:u("db.maxRows"),hint:u("db.maxRows.hint"),children:K("dbMaxRows",{placeholder:"1000"})})]})]}),S=(0,d.jsx)("div",{className:"dbengines",role:"group","aria-label":u("db.engine"),children:A.map(b=>(0,d.jsxs)("button",{type:"button",className:"dbengine","aria-pressed":a.engine===b,style:{"--c":z[b].color},onClick:()=>L(b),children:[(0,d.jsx)(k.A,{size:18}),(0,d.jsx)("b",{children:z[b].label}),(0,d.jsx)("small",{children:"sqlite"===b?u("db.engine.file"):u("db.engine.port",{port:z[b].port})})]},b))});return t?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(r.Zp,{title:u("db.engine"),hint:u("db.engine.hint"),children:S}),(0,d.jsxs)(r.Zp,{title:u("db.conn"),hint:u("db.conn.hint"),children:[(0,d.jsx)(o.D0,{label:u("db.url"),error:H,hint:H?void 0:u("db.url.hint"),children:(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsx)("input",{className:"input mono grow",value:F,placeholder:z[a.engine].sample,autoComplete:"off",spellCheck:!1,onChange:a=>{G(a.target.value),I("")},onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),N())}}),(0,d.jsxs)("button",{type:"button",className:"btn sm",disabled:!F.trim(),onClick:N,children:[(0,d.jsx)(l.A,{size:14}),u("db.url.use")]})]})}),O]}),(0,d.jsx)(r.Zp,{title:u("db.safety"),hint:u("db.safety.hint"),children:R}),(0,d.jsxs)("details",{className:"of-adv",children:[(0,d.jsxs)("summary",{children:[(0,d.jsx)(m.A,{size:15}),u("db.advanced"),(0,d.jsx)("span",{className:"muted small",children:u("db.advanced.hint")})]}),!J&&(0,d.jsx)(r.Zp,{title:u("db.sslTitle"),hint:u("db.sslTitle.hint"),children:P}),(0,d.jsx)(r.Zp,{title:u("dp.title"),hint:u("dp.hint"),children:Q})]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(r.Zp,{title:u("db.conn"),hint:u("db.conn.hint"),children:[(0,d.jsx)(o.D0,{label:u("db.engine"),children:(0,d.jsx)(o.$q,{value:a.engine,onChange:L,options:A.map(a=>({id:a,label:z[a].label}))})}),O]}),!J&&(0,d.jsx)(r.Zp,{title:u("db.sslTitle"),hint:u("db.sslTitle.hint"),children:P}),(0,d.jsx)(r.Zp,{title:u("dp.title"),hint:u("dp.hint"),children:Q}),(0,d.jsx)(r.Zp,{title:u("db.safety"),hint:u("db.safety.hint"),children:R})]})}},88055:(a,b,c)=>{c.d(b,{Zp:()=>u,Bh:()=>w,Mr:()=>t,QJ:()=>q,qP:()=>s,Te:()=>x});var d=c(55322),e=c(70226),f=c(17027),g=c(77671),h=c(81963);c(7371);var i=c(31055),j=c(93884);function k({template:a,values:b,onPick:c,onValue:e}){let{t:g}=(0,j.s9)(),i=function(){let[a,b]=(0,f.useState)(null);return a}(),k=i?.find(b=>b.id===a);return i?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"tpls",children:i.map(b=>(0,d.jsxs)("button",{type:"button",className:"tpl","aria-pressed":a===b.id,onClick:()=>c(b),children:[(0,d.jsx)("b",{children:b.name}),(0,d.jsx)("small",{children:b.description})]},b.id))}),k&&k.fields.map(a=>(0,d.jsx)(h.D0,{label:a.label,children:(0,d.jsx)("input",{className:`input ${"text"===a.kind&&"version"!==a.key?"":"mono"}`,value:b[a.key]??"",onChange:b=>e(a.key,b.target.value),placeholder:a.default,inputMode:"port"===a.kind?"numeric":void 0})},`${k.id}-${a.key}`)),k&&(0,d.jsx)("p",{className:"muted small",style:{margin:0},children:g("tpl.note")})]}):(0,d.jsx)("p",{className:"muted small",style:{margin:0},children:g("git.loading")})}var l=c(60570),m=c(93717),n=c(61060),o=c(75546);let p=a=>void 0===a?"":String(a),q=(a,b,c)=>{let d=a?.kind==="server"?a.config:{},e=a?.kind==="docker"?a.config:{},f=a?.kind==="http"?a.config:{},g=a?.kind==="cluster"?a.config:{},h=a?.kind==="database"?a.config:{};return{manager:a?.manager_id??"",name:a?.name??"",colony_id:a?.colony_id??b??"",kind:a?.kind??c??"server",cwd:d.cwd??"",start:d.start??"",stop:d.stop??"",port:p(d.port),env:(0,m.M6)(a?.kind==="server"?d.env:e.env),restart:d.restart??"no",maxRestarts:p(d.maxRestarts),healthKind:d.health?.kind??"",healthTarget:d.health?.target??"",healthInterval:p(d.health?.intervalSec),healthRetries:p(d.health?.retries),healthRestart:!!d.health?.restartWhenUnhealthy,stopTimeout:p(a?.kind==="server"?d.stopTimeoutSec:e.stopTimeoutSec),logMax:p(a?.kind==="server"?d.logMaxMb:e.logMaxMb),folder:f.folder??"",defEnv:f.env??"",variables:f.variables??{},members:g.members??[],template:"",tplValues:{},mode:e.mode??(a?"container":"template"),image:e.image??"",ports:(e.ports??[]).join("\n"),volumes:(e.volumes??[]).join("\n"),dockerRestart:e.restart??"no",command:e.command??"",file:e.file??"",project:e.project??"",services:(e.services??[]).join(", "),container:e.container??"",memory:e.memory??"",cpus:p(e.cpus),network:e.network??"",engine:h.engine??"postgresql",dbHost:h.host??"",dbPort:p(h.port),dbUser:h.user??"",dbPassword:"",dbPasswordSet:!!h.passwordSet,dbName:h.database??"",dbFile:h.file??"",dbSsl:!!h.ssl,dbTrust:!!h.trustCert,dbReadOnly:!1!==h.readOnly,dbTimeout:p(h.timeoutSec),dbMaxRows:p(h.maxRows),dbProps:{...h.props??{}}}},r=a=>""===a.trim()?void 0:Number(a);function s(a){return"database"===a.kind?t(a):"http"===a.kind?{folder:a.folder.trim(),env:a.defEnv.trim()||void 0,variables:Object.keys(a.variables).length?a.variables:void 0}:"cluster"===a.kind?{members:a.members}:"server"===a.kind?{cwd:a.cwd.trim(),start:a.start.trim(),stop:a.stop.trim()||void 0,port:r(a.port),env:(0,m.y$)(a.env),restart:"no"===a.restart?void 0:a.restart,maxRestarts:r(a.maxRestarts),stopTimeoutSec:r(a.stopTimeout),logMaxMb:r(a.logMax),health:a.healthKind&&a.healthTarget.trim()?{kind:a.healthKind,target:a.healthTarget.trim(),intervalSec:r(a.healthInterval),retries:r(a.healthRetries),restartWhenUnhealthy:a.healthRestart||void 0}:void 0}:"template"===a.mode?{mode:"compose"}:"existing"===a.mode?{mode:"existing",container:a.container.trim(),stopTimeoutSec:r(a.stopTimeout)}:"compose"===a.mode?{mode:"compose",file:a.file.trim(),project:a.project.trim()||void 0,services:a.services.split(",").map(a=>a.trim()).filter(Boolean),stopTimeoutSec:r(a.stopTimeout)}:{mode:"container",image:a.image.trim(),ports:(0,m.Mn)(a.ports),volumes:(0,m.Mn)(a.volumes),env:(0,m.y$)(a.env),restart:a.dockerRestart||"no",command:a.command.trim()||void 0,memory:a.memory.trim()||void 0,cpus:r(a.cpus),network:a.network.trim()||void 0,stopTimeoutSec:r(a.stopTimeout),logMaxMb:r(a.logMax)}}let t=a=>{let b=Object.entries(a.dbProps).filter(([b,c])=>""!==c.trim()&&(a.dbSsl||!b.startsWith("ssl."))),c=b.length?Object.fromEntries(b):void 0;return"sqlite"===a.engine?{engine:"sqlite",file:a.dbFile.trim(),props:c,readOnly:a.dbReadOnly,timeoutSec:r(a.dbTimeout),maxRows:r(a.dbMaxRows)}:{engine:a.engine,host:a.dbHost.trim()||void 0,port:r(a.dbPort),user:a.dbUser.trim()||void 0,password:a.dbPassword,database:a.dbName.trim()||void 0,ssl:a.dbSsl||void 0,trustCert:!!a.dbSsl&&!!a.dbTrust||void 0,props:c,readOnly:a.dbReadOnly,timeoutSec:r(a.dbTimeout),maxRows:r(a.dbMaxRows)}},u=({title:a,hint:b,wide:c=!1,children:e})=>(0,d.jsxs)("section",{className:`of-card ${c?"wide":""}`,id:`of-${a.toLowerCase().normalize("NFD").replace(/[^a-z0-9]+/g,"-")}`,"data-title":a,children:[(0,d.jsxs)("header",{children:[(0,d.jsx)("h4",{children:a}),b&&(0,d.jsx)("p",{className:"muted small",children:b})]}),e]});function v({file:a,project:b,services:c,onServices:e,onProject:g}){let{t:i}=(0,j.s9)(),{info:k,err:l,loading:m}=function(a){let[b,c]=(0,f.useState)(null),[d,e]=(0,f.useState)(""),[g,h]=(0,f.useState)(!1);return{info:b,err:d,loading:g}}(0),n=new Set(c.split(",").map(a=>a.trim()).filter(Boolean));return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.D0,{label:i("obj.f.services"),hint:i("dk.services.hint"),children:a?m?(0,d.jsx)("p",{className:"muted small res-m0",children:i("dk.services.loading")}):l?(0,d.jsx)("p",{className:"gx-note err res-m0",children:l}):k&&0===k.services.length?(0,d.jsx)("p",{className:"muted small res-m0",children:i("dk.services.none")}):k?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"chips",children:k.services.map(a=>(0,d.jsx)("button",{type:"button",className:`chip-pick ${n.has(a)?"on":""}`,"aria-pressed":n.has(a),onClick:()=>(a=>{let b=new Set(n);b.has(a)?b.delete(a):b.add(a),e([...b].join(", "))})(a),children:a},a))}),"file"===k.source&&(0,d.jsx)("p",{className:"muted small res-mt6",children:i("dk.services.file")})]}):null:(0,d.jsx)("p",{className:"muted small res-m0",children:i("dk.services.pickFile")})}),(0,d.jsx)(h.D0,{label:i("obj.f.project"),hint:i("dk.project.hint"),children:(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsx)("input",{className:"input mono",value:b,onChange:a=>g(a.target.value),placeholder:k?.project}),k&&!b&&(0,d.jsx)("button",{type:"button",className:"btn sm",onClick:()=>g(k.project),children:i("dk.project.use",{name:k.project})})]})})]})}function w({d:a,set:b,setD:c,scan:p,showKind:q=!1,error:r,objectId:s}){let{t}=(0,j.s9)(),{colonies:w,objects:x}=(0,l.o0)(),y=("docker"===a.kind&&("existing"===a.mode||a.mode),function(a){let[b,c]=(0,f.useState)(null),[d,e]=(0,f.useState)(null),[g,h]=(0,f.useState)(""),[i,j]=(0,f.useState)(0);return{containers:b,images:d,error:g,reload:(0,f.useCallback)(()=>j(a=>a+1),[])}}(0)),z=(c,e={})=>(0,d.jsx)("input",{className:`input ${e.mono?"mono":""}`,type:e.type,value:a[c],placeholder:e.placeholder,onChange:a=>b(c,a.target.value)}),A=y.error?(0,d.jsx)("p",{className:"muted small res-mt4",children:t("dk.unavailable",{error:y.error})}):null,B=(0,d.jsx)("button",{type:"button",className:"btn ghost icon sm",onClick:y.reload,"aria-label":t("dk.refresh"),title:t("dk.refresh"),children:(0,d.jsx)(g.A,{size:14})}),C=p?Object.keys(p.fileVars).filter(a=>"$shared"!==a):void 0,D=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.dR,{value:a.folder,onChange:a=>b("folder",a),label:t("obj.f.httpFolder"),hint:t("obj.f.httpFolder.hint")}),(0,d.jsx)(h.D0,{label:t("obj.f.defaultEnv"),hint:t("obj.f.defaultEnv.hint"),children:(0,d.jsx)(i.b,{value:a.defEnv,onChange:a=>b("defEnv",a),mono:!0,placeholder:"dev",options:[...new Set([...p?.environments??[],...Object.keys(a.variables).filter(a=>"$shared"!==a)])].map(a=>({value:a}))})})]});return(0,d.jsxs)("div",{className:"of",children:[q&&(0,d.jsx)(u,{title:t("obj.kind.pick"),wide:!0,children:(0,d.jsx)("div",{className:"okinds",children:["server","docker","http","database","cluster"].map(c=>{let{icon:e,color:f}=m.Nd[c];return(0,d.jsxs)("button",{type:"button",className:"okind","aria-pressed":a.kind===c,style:{"--c":f},onClick:()=>b("kind",c),children:[(0,d.jsx)(e,{size:20}),(0,d.jsx)("b",{children:t(`obj.kind.${c}`)}),(0,d.jsx)("small",{children:t(`obj.kind.${c}.hint`)})]},c)})})}),(0,d.jsxs)(u,{title:t("of.general"),children:[(0,d.jsx)(h.D0,{label:t("obj.f.name"),error:r,children:z("name",{placeholder:"database"===a.kind?(0,o.I5)(a):void 0})}),(0,d.jsx)(h.D0,{label:t("obj.colony"),children:(0,d.jsxs)("select",{className:"select",value:a.colony_id,onChange:a=>c(b=>({...b,colony_id:a.target.value,members:[]})),children:[(0,d.jsx)("option",{value:"",children:t("obj.noColony")}),w.map(a=>(0,d.jsx)("option",{value:a.id,children:a.name},a.id))]})}),e.G.includes(a.kind)&&(0,d.jsx)(e.I,{value:a.manager,onChange:a=>b("manager",a)}),"http"===a.kind&&!q&&D]}),"http"===a.kind?(0,d.jsxs)(d.Fragment,{children:[q&&(0,d.jsx)(u,{title:t("of.files"),children:D}),q&&(0,d.jsx)(u,{title:t("of.vars"),wide:!0,children:(0,d.jsx)(n.W,{value:a.variables,onChange:a=>b("variables",a),fileEnvs:C,fileVars:p?.fileVars,used:p?.used,fileDefined:p?.fileDefined,setBy:p?.setBy})})]}):"database"===a.kind?(0,d.jsx)(o.dN,{d:a,set:b,setD:c,objectId:s,creating:q}):"cluster"===a.kind?(0,d.jsx)(u,{title:t("of.members"),hint:t("obj.f.members.hint"),children:(()=>{let c=x.filter(b=>("server"===b.kind||"docker"===b.kind)&&(b.colony_id??"")===a.colony_id);return c.length?(0,d.jsx)("div",{className:"omembers",children:c.map(c=>{let{icon:e,color:f}=m.Nd[c.kind],g=a.members.indexOf(c.id);return(0,d.jsxs)("label",{className:"omember",children:[(0,d.jsx)("input",{type:"checkbox",checked:g>=0,onChange:()=>{let d;return d=c.id,b("members",a.members.includes(d)?a.members.filter(a=>a!==d):[...a.members,d])}}),(0,d.jsx)(e,{size:15,style:{color:f}}),(0,d.jsx)("span",{className:"nm",children:c.name}),g>=0&&(0,d.jsx)("span",{className:"ord",children:g+1})]},c.id)})}):(0,d.jsx)("p",{className:"muted small res-m0",children:t("obj.f.members.none")})})()}):"server"===a.kind?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(u,{title:t("of.run"),children:[(0,d.jsx)(h.dR,{value:a.cwd,onChange:a=>b("cwd",a),label:t("obj.f.folder"),hint:t("obj.f.folder.hint")}),(0,d.jsx)(h.D0,{label:t("obj.f.start"),hint:t("obj.f.start.hint"),children:z("start",{placeholder:"npm run dev",mono:!0})}),(0,d.jsx)(h.D0,{label:t("obj.f.stop"),hint:t("obj.f.stop.hint"),children:z("stop",{mono:!0})}),(0,d.jsx)(h.D0,{label:t("obj.f.port"),hint:t("obj.f.port.hint"),children:z("port",{placeholder:"3000"})})]}),(0,d.jsx)(u,{title:t("of.env"),children:(0,d.jsx)(h.D0,{label:t("obj.f.env"),hint:t("obj.f.env.hint"),children:(0,d.jsx)("textarea",{className:"textarea mono",rows:5,value:a.env,onChange:a=>b("env",a.target.value)})})}),(0,d.jsxs)(u,{title:t("obj.sup.title"),hint:t("obj.sup.note"),children:[(0,d.jsx)(h.D0,{label:t("obj.sup.restart"),hint:t("obj.sup.restart.hint"),children:(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsxs)("select",{className:"select",value:a.restart,onChange:a=>b("restart",a.target.value),children:[(0,d.jsx)("option",{value:"no",children:t("obj.sup.restart.no")}),(0,d.jsx)("option",{value:"on-failure",children:t("obj.sup.restart.fail")}),(0,d.jsx)("option",{value:"always",children:t("obj.sup.restart.always")})]}),"no"!==a.restart&&(0,d.jsx)("input",{className:"input res-mw130",value:a.maxRestarts,placeholder:t("obj.sup.max"),onChange:a=>b("maxRestarts",a.target.value),title:t("obj.sup.max.hint"),"aria-label":t("obj.sup.max")})]})}),(0,d.jsxs)(h.D0,{label:t("obj.sup.health"),hint:t("obj.sup.health.hint"),children:[(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsxs)("select",{className:"select res-mw170",value:a.healthKind,onChange:a=>b("healthKind",a.target.value),children:[(0,d.jsx)("option",{value:"",children:t("obj.sup.health.none")}),(0,d.jsx)("option",{value:"http",children:"HTTP"}),(0,d.jsx)("option",{value:"tcp",children:t("obj.sup.health.tcp")}),(0,d.jsx)("option",{value:"command",children:t("obj.sup.health.command")})]}),a.healthKind&&(0,d.jsx)("input",{className:"input mono grow",value:a.healthTarget,onChange:a=>b("healthTarget",a.target.value),placeholder:"http"===a.healthKind?"http://127.0.0.1:3000/health":"tcp"===a.healthKind?"3000":"curl -fs localhost:3000","aria-label":t("obj.sup.health")})]}),a.healthKind&&(0,d.jsxs)("div",{className:"row gap-s wrap res-mt8",children:[(0,d.jsx)("input",{className:"input res-mw150",value:a.healthInterval,onChange:a=>b("healthInterval",a.target.value),placeholder:t("obj.sup.interval"),"aria-label":t("obj.sup.interval")}),(0,d.jsx)("input",{className:"input res-mw130",value:a.healthRetries,onChange:a=>b("healthRetries",a.target.value),placeholder:t("obj.sup.retries"),"aria-label":t("obj.sup.retries")}),(0,d.jsx)(h.Tl,{checked:a.healthRestart,onChange:a=>b("healthRestart",a),label:t("obj.sup.healthRestart")})]})]}),(0,d.jsxs)("div",{className:"of-grid2",children:[(0,d.jsx)(h.D0,{label:t("obj.sup.stopTimeout"),hint:t("obj.sup.stopTimeout.hint"),children:z("stopTimeout",{placeholder:"8"})}),(0,d.jsx)(h.D0,{label:t("obj.sup.logMax"),hint:t("obj.sup.logMax.hint"),children:z("logMax",{placeholder:"5"})})]})]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(u,{title:t("obj.f.mode"),children:(0,d.jsx)(h.$q,{value:a.mode,onChange:a=>b("mode",a),options:[...q?[{id:"template",label:t("obj.mode.template")}]:[],{id:"container",label:t("obj.mode.container")},{id:"compose",label:t("obj.mode.compose")},{id:"existing",label:t("obj.mode.existing")}]})}),"template"===a.mode&&(0,d.jsx)(u,{title:t("obj.mode.template"),hint:t("tpl.hint"),children:(0,d.jsx)(k,{template:a.template,values:a.tplValues,onPick:a=>c(b=>({...b,template:a.id,tplValues:Object.fromEntries(a.fields.map(a=>[a.key,a.default])),name:b.name.trim()?b.name:a.name})),onValue:(a,b)=>c(c=>({...c,tplValues:{...c.tplValues,[a]:b}}))})}),"container"===a.mode&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(u,{title:t("of.image"),children:[(0,d.jsxs)(h.D0,{label:t("obj.f.image"),children:[(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsx)("div",{className:"grow",children:(0,d.jsx)(i.b,{value:a.image,onChange:a=>b("image",a),mono:!0,placeholder:t("dk.pickImage"),ariaLabel:t("obj.f.image"),options:(y.images??[]).map(a=>({value:a.ref,hint:`${a.size}${a.created?` \xb7 ${a.created}`:""}`}))})}),B]}),A]}),(0,d.jsx)(h.D0,{label:t("obj.f.ports"),hint:t("obj.f.ports.hint"),children:(0,d.jsx)("textarea",{className:"textarea mono",rows:2,value:a.ports,onChange:a=>b("ports",a.target.value),placeholder:"8080:80"})}),(0,d.jsxs)(h.D0,{label:t("obj.f.volumes"),hint:t("obj.f.volumes.hint"),children:[(0,d.jsx)("textarea",{className:"textarea mono",rows:2,value:a.volumes,onChange:a=>b("volumes",a.target.value)}),(0,d.jsx)(h.yQ,{bare:!0,value:"",buttonLabel:t("obj.f.volumes.add"),onChange:c=>b("volumes",`${a.volumes.trimEnd()}${a.volumes.trim()?"\n":""}${c}:/data`)})]})]}),(0,d.jsxs)(u,{title:t("of.env"),children:[(0,d.jsx)(h.D0,{label:t("obj.f.env"),hint:t("obj.f.env.hint"),children:(0,d.jsx)("textarea",{className:"textarea mono",rows:4,value:a.env,onChange:a=>b("env",a.target.value)})}),(0,d.jsx)(h.D0,{label:t("obj.f.restart"),children:(0,d.jsx)("select",{className:"select",value:a.dockerRestart,onChange:a=>b("dockerRestart",a.target.value),children:["no","always","unless-stopped","on-failure"].map(a=>(0,d.jsx)("option",{value:a,children:a},a))})}),(0,d.jsx)(h.D0,{label:t("obj.f.command"),children:z("command",{mono:!0})})]}),(0,d.jsx)(u,{title:t("of.limits"),hint:t("obj.dk.limits.hint"),children:(0,d.jsxs)("div",{className:"of-grid2",children:[(0,d.jsx)(h.D0,{label:t("obj.dk.memory"),children:z("memory",{placeholder:"512m"})}),(0,d.jsx)(h.D0,{label:t("obj.dk.cpus"),children:z("cpus",{placeholder:"1.5"})}),(0,d.jsx)(h.D0,{label:t("obj.dk.network"),children:z("network",{placeholder:"bridge"})}),(0,d.jsx)(h.D0,{label:t("obj.sup.stopTimeout"),children:z("stopTimeout",{placeholder:"10"})}),(0,d.jsx)(h.D0,{label:t("obj.sup.logMax"),children:z("logMax",{placeholder:"10"})})]})})]}),"compose"===a.mode&&(0,d.jsxs)(u,{title:t("obj.mode.compose"),children:[(0,d.jsx)(h.yQ,{mode:"file",exts:["yml","yaml"],value:a.file,onChange:a=>b("file",a),label:t("obj.f.file"),hint:t("obj.f.file.hint"),placeholder:"/home/you/app/docker-compose.yml"}),(0,d.jsx)(v,{file:a.file,project:a.project,services:a.services,onServices:a=>b("services",a),onProject:a=>b("project",a)}),(0,d.jsx)(h.D0,{label:t("obj.sup.stopTimeout"),hint:t("obj.sup.stopTimeout.hint"),children:z("stopTimeout",{placeholder:"10"})})]}),"existing"===a.mode&&(0,d.jsxs)(u,{title:t("obj.mode.existing"),children:[(0,d.jsxs)(h.D0,{label:t("obj.f.container"),hint:t("obj.f.container.hint"),children:[(0,d.jsxs)("div",{className:"row gap-s",children:[(0,d.jsx)("div",{className:"grow",children:(0,d.jsx)(i.b,{value:a.container,onChange:a=>b("container",a),mono:!0,placeholder:t("dk.pickContainer"),ariaLabel:t("obj.f.container"),options:(y.containers??[]).map(a=>({value:a.name,hint:`${a.image} \xb7 ${a.state}${a.managed?` \xb7 ${t("dk.managed")}`:""}`}))})}),B]}),A]}),(0,d.jsx)(h.D0,{label:t("obj.sup.stopTimeout"),hint:t("obj.sup.stopTimeout.hint"),children:z("stopTimeout",{placeholder:"10"})})]})]})]})}function x(a){let[b,c]=(0,f.useState)(a);return{d:b,setD:c,set:(a,b)=>c(c=>({...c,[a]:b}))}}},93717:(a,b,c)=>{c.d(b,{HS:()=>p,M6:()=>l,Mn:()=>n,Nd:()=>j,Wy:()=>k,y$:()=>m});var d=c(87456),e=c(79588),f=c(30162),g=c(48370),h=c(2266),i=c(61162);let j={server:{color:"#0f8f9e",icon:d.A},docker:{color:"#2496ed",icon:e.A},http:{color:"#7a4de0",icon:f.A},database:{color:"#d9822b",icon:g.A},cluster:{color:i.Ng,icon:h.A}},k={running:"ok",ready:"ok",starting:"warn",error:"err",stopped:"off",unknown:"off"},l=a=>Object.entries(a??{}).map(([a,b])=>`${a}=${b}`).join("\n");function m(a){let b={};for(let c of a.split("\n")){let a=c.trim();if(!a||a.startsWith("#"))continue;let d=a.indexOf("=");if(d<=0)throw Error(`"${a}" is not NAME=value`);b[a.slice(0,d).trim()]=a.slice(d+1)}return b}let n=a=>a.split("\n").map(a=>a.trim()).filter(Boolean),o=[[/^(\d+) requests in (\d+) files$/,"d.requests"],[/^(\d+)\/(\d+) running$/,"d.running"],[/^no members$/,"d.noMembers"],[/^only (\d+)\/(\d+) running · stopped: (.+)$/,"d.onlySome"],[/^(.+) failed · (\d+)\/(\d+) running$/,"d.failed"],[/^waiting for port (\d+)$/,"d.waitPort"],[/^running, but nothing listens on port (\d+)$/,"d.noPort"],[/^exited with code (\d+)$/,"d.exited"],[/^ended by (\w+)$/,"d.signal"],[/^restarted \((\d+)\/(\d+)\)$/,"d.restarted"],[/^was unhealthy: restarting \((\d+)\/(\d+)\)$/,"d.unhealthyRestart"],[/^health check pending$/,"d.healthPending"],[/^restarting$/,"d.restarting"],[/^container not found$/,"d.noContainer"],[/^the compose file is missing$/,"d.noCompose"],[/^(\d+) of (\d+) running$/,"d.running2"],[/^(\d+) services?$/,"d.services"],[/^a service exited with an error$/,"d.serviceFailed"],[/^checking…$/,"d.checking"],[/^unhealthy$/,"d.unhealthy"]];function p(a,b){return b?b.split(" \xb7 ").map(b=>{for(let[c,d]of o){let e=c.exec(b);if(e)return a(d,Object.fromEntries(e.slice(1).map((a,b)=>[`a${b+1}`,a])))}let c=/^(.*)restarting in (\d+) s \((\d+)\/(\d+)\)$/.exec(b);if(c)return a("d.restartIn",{a1:c[2],a2:c[3],a3:c[4]});let d=/^gave up after (\d+) restarts$/.exec(b);if(d)return a("d.gaveUp",{a1:d[1]});let e=/^unhealthy: (.+)$/.exec(b);return e?`${a("d.unhealthy")}: ${e[1]}`:b}).join(" \xb7 "):""}},97984:(a,b,c)=>{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")]})}}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=451,exports.ids=[451],exports.modules={206:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]])},16098:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]])},20862:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]])},21347:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]])},21959:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]])},22276:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]])},26357:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("MousePointerClick",[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]])},29083:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},29723:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]])},34410:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},35842:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},40123:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])},42818:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]])},46875:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]])},47087:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]])},48881:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]])},54143:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]])},54514:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},55674:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]])},61593:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]])},69048:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]])},73726:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]])},77671:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},84300:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]])},87414:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]])},88404:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]])},93351:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Waypoints",[["circle",{cx:"12",cy:"4.5",r:"2.5",key:"r5ysbb"}],["path",{d:"m10.2 6.3-3.9 3.9",key:"1nzqf6"}],["circle",{cx:"4.5",cy:"12",r:"2.5",key:"jydg6v"}],["path",{d:"M7 12h10",key:"b7w52i"}],["circle",{cx:"19.5",cy:"12",r:"2.5",key:"1piiel"}],["path",{d:"m13.8 17.7 3.9-3.9",key:"1wyg1y"}],["circle",{cx:"12",cy:"19.5",r:"2.5",key:"13o1pw"}]])},97299:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]])},98635:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(51537).A)("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]])}};