local-operator-ui 0.31.30 → 0.31.31

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 (86) hide show
  1. package/out/main/index.js +61 -5
  2. package/out/preload/index.js +9 -0
  3. package/out/renderer/assets/{_basePickBy-Y9GC34gi.js → _basePickBy-Bf87kbLT.js} +1 -1
  4. package/out/renderer/assets/{_baseUniq-B0peOdjF.js → _baseUniq-BH5GsGmP.js} +1 -1
  5. package/out/renderer/assets/{agent-details-page-DVzsvKvr.js → agent-details-page-C3T3KXVe.js} +1 -1
  6. package/out/renderer/assets/{agent-hub-page-Dp8llcze.js → agent-hub-page-C9i0FC1M.js} +1 -1
  7. package/out/renderer/assets/agents-page-iwyAy2dH.js +7 -0
  8. package/out/renderer/assets/{arc-DQzRvMGZ.js → arc-D5SGXb2R.js} +1 -1
  9. package/out/renderer/assets/{architectureDiagram-IEHRJDOE-BHLUr3Vi.js → architectureDiagram-IEHRJDOE-DU9QzL8S.js} +1 -1
  10. package/out/renderer/assets/{blockDiagram-JOT3LUYC-CVK0U-3j.js → blockDiagram-JOT3LUYC-DcKApfM_.js} +1 -1
  11. package/out/renderer/assets/{book-open-j4JS3yvI.js → book-open-s9VDPEq5.js} +1 -1
  12. package/out/renderer/assets/browser-page-ufPL_LU7.js +1 -0
  13. package/out/renderer/assets/{browser-webauthn-prompt-nwdqBWnv.js → browser-webauthn-prompt-2pudGCfZ.js} +1 -1
  14. package/out/renderer/assets/{c4Diagram-VJAJSXHY-BqLTGVHe.js → c4Diagram-VJAJSXHY-Bzfgk0Sn.js} +1 -1
  15. package/out/renderer/assets/channel-DIn96Ghl.js +1 -0
  16. package/out/renderer/assets/{chunk-4BMEZGHF-BSPZPecM.js → chunk-4BMEZGHF-dKcCv0u5.js} +1 -1
  17. package/out/renderer/assets/{chunk-A2AXSNBT-CEEG3uIi.js → chunk-A2AXSNBT-BsCiqyno.js} +1 -1
  18. package/out/renderer/assets/{chunk-AEK57VVT-CvyIUWUR.js → chunk-AEK57VVT-1r_2Mv4Z.js} +1 -1
  19. package/out/renderer/assets/{chunk-D6G4REZN-D4lVOdW7.js → chunk-D6G4REZN-DYkeE8Xz.js} +1 -1
  20. package/out/renderer/assets/{chunk-RZ5BOZE2-znegx9P6.js → chunk-RZ5BOZE2-CPFwl8UM.js} +1 -1
  21. package/out/renderer/assets/{chunk-XZIHB7SX-DPz_D8Nf.js → chunk-XZIHB7SX-D2UnATG-.js} +1 -1
  22. package/out/renderer/assets/classDiagram-GIVACNV2-OB18Wa5z.js +1 -0
  23. package/out/renderer/assets/classDiagram-v2-COTLJTTW-OB18Wa5z.js +1 -0
  24. package/out/renderer/assets/clone-DZKGcLf4.js +1 -0
  25. package/out/renderer/assets/{console-mirror-GUGtzmyW.js → console-mirror-DM2NwKgG.js} +1 -1
  26. package/out/renderer/assets/{consoleCapture-D8nStIVt.js → consoleCapture-Dz6t0BLj.js} +1 -1
  27. package/out/renderer/assets/{conversation-input-sync-CGaXAqah.js → conversation-input-sync-D5WTijVw.js} +237 -237
  28. package/out/renderer/assets/{dagre-OKDRZEBW-ByuMXl-x.js → dagre-OKDRZEBW-CC7ZHJGZ.js} +1 -1
  29. package/out/renderer/assets/{diagram-SSKATNLV-DrN1Clbm.js → diagram-SSKATNLV-BIgXD6N3.js} +1 -1
  30. package/out/renderer/assets/{diagram-VNBRO52H-BU95qC98.js → diagram-VNBRO52H-DSb-jidW.js} +1 -1
  31. package/out/renderer/assets/{erDiagram-Q7BY3M3F-CLttNK5z.js → erDiagram-Q7BY3M3F-BVsfO34u.js} +1 -1
  32. package/out/renderer/assets/error-boundary-Bz59nB-q.js +126 -0
  33. package/out/renderer/assets/{flowDiagram-4HSFHLVR-BCsFW1Gf.js → flowDiagram-4HSFHLVR-BeLsb93D.js} +1 -1
  34. package/out/renderer/assets/{ganttDiagram-APWFNJXF-Cdg1Q_-7.js → ganttDiagram-APWFNJXF-BYW2a9Z4.js} +1 -1
  35. package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-0tWQBOZl.js → gitGraphDiagram-7IBYFJ6S-CmL3lNpb.js} +1 -1
  36. package/out/renderer/assets/{graph-BOvjqm1y.js → graph-BghwrGcW.js} +1 -1
  37. package/out/renderer/assets/{index-DbuNRNvX.js → index-BQpze3Xm.js} +1 -1
  38. package/out/renderer/assets/index-BUbxCOmE.css +1 -0
  39. package/out/renderer/assets/{index-D09I1LXM.js → index-D9eEHYnY.js} +113 -113
  40. package/out/renderer/assets/{index-Bbr0EFhm.js → index-DlJX13aK.js} +1 -1
  41. package/out/renderer/assets/{infoDiagram-PH2N3AL5-cyj8Lve1.js → infoDiagram-PH2N3AL5-Dlc4HRnT.js} +1 -1
  42. package/out/renderer/assets/{installer-DDGjYv9v.js → installer-ChFDulNf.js} +1 -1
  43. package/out/renderer/assets/{journeyDiagram-U35MCT3I-DWBKDniU.js → journeyDiagram-U35MCT3I-D9GIHKf8.js} +1 -1
  44. package/out/renderer/assets/{kanban-definition-NDS4AKOZ-Cl5Gtazo.js → kanban-definition-NDS4AKOZ-GbHp25E6.js} +1 -1
  45. package/out/renderer/assets/{layout-CxuQX-mj.js → layout-D5NC6G2z.js} +1 -1
  46. package/out/renderer/assets/{legacy-agents-page-EmhBvGX8.js → legacy-agents-page-BHwGeOra.js} +3 -3
  47. package/out/renderer/assets/{mermaid.core-eIMT1oSc.js → mermaid.core-CPX3HUNW.js} +5 -5
  48. package/out/renderer/assets/{mesh-page-B8pGIWvO.js → mesh-page-DW4V6mDF.js} +1 -1
  49. package/out/renderer/assets/{mindmap-definition-ALO5MXBD-zPRivaIU.js → mindmap-definition-ALO5MXBD-yAjncoir.js} +1 -1
  50. package/out/renderer/assets/{mini-D6nPFjTs.js → mini-CskWqoCm.js} +1 -1
  51. package/out/renderer/assets/{org-surface-gate-BeX5voGq.js → org-surface-gate-DmIzbHBX.js} +1 -1
  52. package/out/renderer/assets/{page-header-BLBgjVqc.js → page-header-C73htBLU.js} +1 -1
  53. package/out/renderer/assets/{pieDiagram-IB7DONF6-CUTT0oqK.js → pieDiagram-IB7DONF6-BTv_vjGw.js} +1 -1
  54. package/out/renderer/assets/projects-page-CoJRWpnW.js +55 -0
  55. package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-B6ksoL9Y.js → quadrantDiagram-7GDLP6J5-E-Z7fgK4.js} +1 -1
  56. package/out/renderer/assets/{radar-MK3ICKWK-BpDoqWc2.js → radar-MK3ICKWK-LRPaWbT7.js} +1 -1
  57. package/out/renderer/assets/{radient-auth-buttons-Ep1e0Z5I.js → radient-auth-buttons-CkIa2gnI.js} +1 -1
  58. package/out/renderer/assets/{requirementDiagram-KVF5MWMF-DQwmYS7R.js → requirementDiagram-KVF5MWMF-D41oCTsq.js} +1 -1
  59. package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-Dc8VJLoV.js → sankeyDiagram-QLVOVGJD-Dj68j1bd.js} +1 -1
  60. package/out/renderer/assets/{schedules-page-DyMkIr1h.js → schedules-page-DEn7fbmP.js} +1 -1
  61. package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-SsVDN37O.js → sequenceDiagram-X6HHIX6F-CuT8-UJl.js} +1 -1
  62. package/out/renderer/assets/{settings-page-C_1ja3uN.js → settings-page-BUPgMvuh.js} +1 -1
  63. package/out/renderer/assets/{settings-section-BLUoPALO.js → settings-section-hVWmfyYL.js} +1 -1
  64. package/out/renderer/assets/{stateDiagram-DGXRK772-vwQ-TB_f.js → stateDiagram-DGXRK772-CtoVTWw4.js} +1 -1
  65. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-CASDd-AK.js +1 -0
  66. package/out/renderer/assets/{timeline-definition-BDJGKUSR-CQ_pAZms.js → timeline-definition-BDJGKUSR-B4S43lWT.js} +1 -1
  67. package/out/renderer/assets/{ui-preferences-store-CxJfZcpf.js → ui-preferences-store-Ch3sXoS6.js} +1 -1
  68. package/out/renderer/assets/{use-download-agent-mutation-DIujvdLj.js → use-download-agent-mutation-CPCwxFuX.js} +2 -2
  69. package/out/renderer/assets/{use-memberships-query-BhO5nUlo.js → use-memberships-query-Cq1pVuOg.js} +1 -1
  70. package/out/renderer/assets/{xychartDiagram-VJFVF3MP-Cs3B-KEl.js → xychartDiagram-VJFVF3MP-PmR4I0xI.js} +1 -1
  71. package/out/renderer/console-capture.html +5 -5
  72. package/out/renderer/index.html +7 -7
  73. package/out/renderer/installer.html +4 -4
  74. package/out/renderer/mini.html +6 -6
  75. package/package.json +2 -2
  76. package/out/renderer/assets/agents-page-DlN3w0Rq.js +0 -7
  77. package/out/renderer/assets/browser-page-BI7a4ZtV.js +0 -1
  78. package/out/renderer/assets/channel-BP8e6HYH.js +0 -1
  79. package/out/renderer/assets/classDiagram-GIVACNV2-DVXt0ycE.js +0 -1
  80. package/out/renderer/assets/classDiagram-v2-COTLJTTW-DVXt0ycE.js +0 -1
  81. package/out/renderer/assets/clone-D0eJwRGh.js +0 -1
  82. package/out/renderer/assets/error-boundary-BR1z8pWF.js +0 -126
  83. package/out/renderer/assets/index-Cy3MjKxd.css +0 -1
  84. package/out/renderer/assets/projects-page-D60z6cvI.js +0 -55
  85. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-D30uaRbQ.js +0 -1
  86. /package/out/renderer/assets/{index-CSNQxVPq.js → index-h1qa1pbA.js} +0 -0
@@ -1,7 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./legacy-agents-page-EmhBvGX8.js","./index-CSNQxVPq.js","./index-Cy3MjKxd.css","./conversation-input-sync-CGaXAqah.js","./ui-preferences-store-CxJfZcpf.js","./error-boundary-BR1z8pWF.js","./conversation-input-sync-CIGg7Rga.css","./page-header-BLBgjVqc.js","./index-D09I1LXM.js","./console-mirror-GUGtzmyW.js","./console-mirror-DOrYoP_4.css","./index-DHKnfVbX.css","./settings-section-BLUoPALO.js","./use-memberships-query-BhO5nUlo.js","./org-surface-gate-BeX5voGq.js","./radient-auth-buttons-Ep1e0Z5I.js"])))=>i.map(i=>d[i]);
2
- import{a_ as gt,a as Je,u as pt,a$ as xt,X as K,b0 as Oe,aN as me,d as ce,az as Te,S as bt,aP as Ye,ag as Qe,b1 as Xe,aw as ve,b2 as Ze,b3 as jt,aQ as yt,b4 as vt,b5 as kt,b6 as wt,b7 as Ue,b8 as Nt,aF as St,b9 as Ct,ba as Et,bb as At}from"./conversation-input-sync-CGaXAqah.js";import{r as o,j as e,c as Q}from"./index-CSNQxVPq.js";import{_ as It,$ as Tt,a0 as $t,a1 as Dt,a2 as Rt,a3 as Lt,a4 as Ft,a5 as _t,a6 as Ot,a7 as et,a8 as Ut,a9 as Mt,b as Pt,aa as tt,A as Bt}from"./index-D09I1LXM.js";import{c as zt,p as _,B as N,T as ke,q as qt,r as Wt,e as de,A as te,g as se,h as ne,I as he,s as st,t as nt,u as at,v as it,w as we,x as Ee,y as Ne,M as Ht,z as Kt,F as Gt,G as Me}from"./error-boundary-BR1z8pWF.js";import{c as Vt}from"./ui-preferences-store-CxJfZcpf.js";import"./console-mirror-GUGtzmyW.js";/**
3
- * @license lucide-react v0.507.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */const Jt=[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]],Yt=zt("log-in",Jt),Qt=["A reviewer that only reads code","Add the coder twice to release-crew","A team called shipping with a manager and two coders"],Xt={idle:"bg-ink-dim",running:"bg-accent",stopping:"bg-warning",done:"bg-success",stopped:"bg-ink-muted",error:"bg-danger"};function Zt({status:t,pulse:s}){return e.jsx("span",{"aria-hidden":"true",className:Q("size-2 shrink-0 rounded-full",Xt[t]??"bg-ink-dim",s&&"animate-pulse")})}function es({run:t}){return t.activity.length===0?e.jsx("p",{className:"text-meta text-ink-muted",children:"Nothing to show yet — the run has not called a tool."}):e.jsx("ul",{className:"max-h-48 space-y-1 overflow-y-auto",children:t.activity.map((s,n)=>e.jsxs("li",{className:"flex items-baseline gap-2 text-body-sm",children:[e.jsx("span",{className:"text-ink-dim tabular-nums",children:new Date(s.ts).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),e.jsx("span",{className:"text-ink",children:s.verb})]},`${s.ts}:${s.verb}:${n}`))})}function Pe({run:t,onDismiss:s}){const[n,a]=o.useState(!1),i=o.useRef(null),l=t.status==="running"||t.status==="stopping";o.useEffect(()=>{if(!l)return;const f=p=>{p.key!=="Escape"||p.defaultPrevented||document.querySelector('[role="alertdialog"], [role="dialog"]')||i.current?.focus()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[l]);const h=t.status==="running"?t.step??"Working on your request":t.status==="stopping"?"Stopping":t.status==="done"?t.results.length>0?"Finished":"Finished without changing anything":t.status==="stopped"?"Stopped":t.status==="error"?t.canRetry?"Stopped with an error":"Finished with an error":"";return e.jsxs("div",{className:"border-hairline border-b pb-2","data-testid":"config-run-strip",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[e.jsx(Zt,{status:t.status,pulse:l}),e.jsx("span",{"aria-live":"polite",className:"text-body-sm text-ink",children:h}),(l||t.status==="stopped"||t.status==="done")&&t.elapsed!=="0s"?e.jsx("span",{className:"text-meta text-ink-muted tabular-nums",children:t.elapsed}):null,t.touched.length>0?e.jsx(_,{variant:"neutral",children:t.touched.length===1?"1 definition":`${t.touched.length} definitions`}):null,e.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[t.activity.length>0?e.jsxs(N,{variant:"ghost",size:"sm","aria-expanded":n,onClick:()=>a(f=>!f),children:[n?e.jsx(qt,{className:"size-3.5"}):e.jsx(Wt,{className:"size-3.5"}),"Watch"]}):null,l?e.jsxs(N,{ref:i,variant:"secondary",size:"sm",disabled:t.status==="stopping",onClick:()=>void t.stop(),children:[e.jsx(gt,{className:"size-3.5"}),t.status==="stopping"?"Stopping…":"Stop"]}):e.jsx(N,{variant:"ghost",size:"sm",onClick:()=>s?s():t.dismiss(),children:"Dismiss"})]})]}),t.attached?e.jsx("p",{className:"mt-1 text-meta text-ink-muted",children:"Another configuration run was already going, so this page attached to it. Your request was not sent — it is still in the box."}):null,t.stopError?e.jsxs("div",{className:"mt-2 border-danger-border border-t pt-2","data-testid":"config-stop-refused",children:[e.jsx("p",{className:"text-body-sm text-danger",children:"The stop did not take — the run is still going."}),e.jsx("p",{className:"mt-0.5 text-meta text-ink-muted",children:t.stopError})]}):null,n?e.jsx("div",{className:"mt-2 border-hairline border-t pt-2",children:e.jsx(es,{run:t})}):null,t.status==="stopped"?e.jsxs("div",{className:"mt-2 space-y-1 border-hairline border-t pt-2 text-body-sm",children:[e.jsx("p",{className:"text-ink",children:t.results.length>0?"Stopped. Changes it had already made were kept.":"Stopped. Nothing had been changed yet."}),t.results.length>0?e.jsx("ul",{className:"space-y-0.5",children:t.results.map(f=>e.jsxs("li",{className:"text-ink-muted",children:[f.created?"Created ":"Changed ",e.jsx("span",{className:"text-ink",children:f.target.name})]},`${f.target.kind}:${f.target.name}`))}):null]}):null,t.status==="done"?e.jsx(ts,{run:t}):null,t.status==="error"&&t.error?e.jsxs("div",{className:"mt-2 border-danger-border border-t pt-2",children:[e.jsx("p",{className:"text-body-sm text-danger",children:t.error}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[t.canRetry?e.jsx(N,{variant:"secondary",size:"sm","data-testid":"config-retry",disabled:t.starting,onClick:()=>void t.retry(),children:t.starting?"Sending…":"Retry"}):null,e.jsx("p",{className:"text-meta text-ink-muted",children:"Nothing else was changed by this run."})]})]}):null]})}function ts({run:t}){return t.results.length===0?e.jsxs("div",{className:"mt-2 border-hairline border-t pt-2 text-body-sm",children:[e.jsx("p",{className:"text-ink-muted",children:"The run answered without changing any agent or team."}),t.answer?e.jsx("p",{className:"mt-1 whitespace-pre-wrap text-ink",children:t.answer}):null,t.topic?e.jsxs("p",{className:"mt-1 text-meta text-ink-muted",children:["You asked: ",t.topic]}):null]}):e.jsxs("div",{className:"mt-2 space-y-1 border-hairline border-t pt-2",children:[e.jsx("ul",{className:"space-y-1 text-body-sm",children:t.results.map(s=>e.jsxs("li",{children:[e.jsxs("span",{className:"text-ink",children:[s.created?"Created ":"Updated ",s.target.name]}),e.jsxs("span",{className:"text-ink-muted",children:[" (",s.target.kind,")"]}),s.changes.length>0?e.jsxs("span",{className:"text-ink-muted",children:[": ",s.changes.map(n=>n.label).join(", ")]}):s.created?null:e.jsx("span",{className:"text-ink-muted",children:": its settings changed. The list does not show instructions, so open it to see what was written."})]},`${s.target.kind}:${s.target.name}`))}),t.answer?e.jsx("p",{className:"whitespace-pre-wrap text-body-sm text-ink-muted",children:t.answer}):null]})}function rt({run:t,hero:s=!1,blockedReason:n,about:a,onClearAbout:i,onStripHeightChange:l}){const h=o.useRef(null),f=o.useRef(null),p=o.useCallback(d=>{if(f.current?.disconnect(),f.current=null,!l)return;if(!d){l(0);return}const k=()=>l(d.getBoundingClientRect().height);if(k(),typeof ResizeObserver>"u")return;const T=new ResizeObserver(k);T.observe(d),f.current=T},[l]),c=t.status==="running"||t.status==="stopping",r=!t.enabled||c||!!n,y=a?`Change ${a.name}…`:t.enabled?"Ask for a new agent or change a team…":"Configure agents by conversation",v=a?`${a.kind}:${a.name}`:null;o.useEffect(()=>{if(!v)return;const d=h.current;if(!d||d.disabled)return;d.focus();const k=d.value.length;d.setSelectionRange?.(k,k)},[v]);const b=()=>{const d=t.draft.trim();!d||r||t.start(d,a)},j=()=>{t.dismiss(),h.current?.focus()},E=()=>{i(),h.current?.focus()};return e.jsxs("div",{className:Q("relative rounded-md border border-hairline bg-surface p-3",s&&"shadow-none"),"data-testid":"config-composer",children:[e.jsx("div",{className:"sr-only",id:"config-composer-label",children:"Ask for an agent or team change"}),t.enabled&&t.status!=="idle"?s?e.jsx(Pe,{run:t,onDismiss:j}):e.jsx("div",{ref:p,className:"absolute inset-x-0 bottom-full rounded-t-md border-hairline border bg-canvas p-3",children:e.jsx(Pe,{run:t,onDismiss:j})}):null,a?e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsxs(_,{variant:"accent","data-testid":"config-composer-about",children:["About ",a.kind," ",a.name]}),e.jsx(N,{variant:"ghost",size:"sm",onClick:E,children:"Clear"})]}):null,e.jsx("label",{className:"sr-only",htmlFor:"config-composer-input",children:y}),e.jsx(ke,{id:"config-composer-input",ref:h,"aria-describedby":"config-composer-note",className:"min-h-16",placeholder:y,value:t.draft,disabled:r||!t.enabled,onChange:d=>t.setDraft(d.target.value),onKeyDown:d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),b())}}),t.enabled&&!a&&!c&&!t.draft?e.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:Qt.map(d=>e.jsx(N,{variant:"outline",size:"sm",disabled:r,onClick:()=>{t.setDraft(d),h.current?.focus()},children:d},d))}):null,e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-2",children:[e.jsx(N,{variant:"primary",disabled:r||!t.draft.trim(),onClick:b,children:t.starting?"Starting…":"Ask for a change"}),n?e.jsx("p",{className:"text-meta text-warning",children:n}):null,e.jsx("p",{id:"config-composer-note",className:"text-meta text-ink-muted",children:t.enabled?"Runs in the background. This does not appear in your conversation.":t.disabledReason})]})]})}const Be=(t,s)=>t.kind===s.kind&&t.name===s.name;function ss(t){return`${t.kind}:${t.name}`}const H=Vt(t=>({sessionId:null,status:"idle",topic:"",draft:"",about:null,error:null,stopError:null,unsent:!1,startedAt:null,settledAt:null,touched:[],results:[],answer:"",marks:[],before:null,setDraft:s=>t({draft:s}),setAbout:s=>t({about:s}),adopt:(s,n,a)=>t({sessionId:s,status:"running",topic:n,error:null,stopError:null,startedAt:Date.now(),settledAt:null,touched:[],results:[],answer:"",before:a,unsent:!1}),acceptDraft:()=>t({draft:""}),noteTouched:s=>t(n=>n.touched.some(a=>Be(a,s))?n:{touched:[...n.touched,s]}),stopping:()=>t(s=>s.status==="running"?{status:"stopping",stopError:null}:s),stopFailed:s=>t({status:"running",stopError:s}),settle:(s,n,a)=>t(()=>({status:n,settledAt:Date.now(),results:s,answer:a,marks:s.map(i=>({...i.target,created:i.created})),sessionId:null,stopError:null,before:null,unsent:!1})),fail:s=>t({status:"error",error:s,unsent:!1,stopError:null}),failUnsent:s=>t({status:"error",error:s,unsent:!0,stopError:null}),dismiss:()=>t({status:"idle",sessionId:null,error:null,stopError:null,unsent:!1,topic:"",touched:[],results:[],answer:"",marks:[],startedAt:null,settledAt:null,before:null}),clearMark:s=>t(n=>({marks:n.marks.filter(a=>!Be(a,s))}))})),ns=/Value error,\s*([\s\S]*?)\s*\[type=/,as=/^\d+ validation errors? for \S+[\s\S]*?\n\s*/i,is=/\s*\[type=[^\]]*\][\s\S]*$/m,rs=/\s*For further information visit \S+/g,os=/'([^']+)' already exists/,ls=/cannot contain spaces or path separators/i,cs=/effort tier '([^']+)' is unavailable/i,ds=/team name must be/i,us=/manager '([^']+)'/i,ms=/(?:member|role) '([^']+)' (?:is not|does not)/i,hs=/depth|cycle|circular/i,fs=/instructions/i,gs=/description/i;function ps(t){const s=t.match(ns);return s?.[1]?s[1].trim():t.replace(as,"").replace(is,"").replace(rs,"").trim()}function je(t){const s=ps(t),n=s.match(os);if(n)return{message:`An agent called “${n[1]}” already exists. Choose another name, or open the existing one to change it.`,field:"name"};if(ls.test(s))return{message:"Names cannot contain spaces or slashes.",field:"name"};const a=s.match(cs);if(a)return{message:`“${a[1]}” is not a configured effort tier. Use inherit, or add the tier in Settings.`,field:"effort"};if(s.match(ds))return{message:"A team name is 1-64 characters.",field:"name"};const l=s.match(us);if(l)return{message:`“${l[1]}” is not an agent or a team on this machine.`,field:"manager"};const h=s.match(ms);return h?{message:`“${h[1]}” is not an agent or a team on this machine.`,field:"members"}:hs.test(s)?{message:"That team would nest too deeply, or would contain itself. Check its members.",field:"members"}:fs.test(s)?{message:s,field:"instructions"}:gs.test(s)?{message:s,field:"description"}:{message:s,field:null}}function xs(t,s){const n=new Set(s),a=`${t}-copy`;if(!n.has(a))return a;for(let i=2;i<100;i+=1){const l=`${a}-${i}`;if(!n.has(l))return l}return a}function Ae(t){return t.action_class==="proactive"?"proactive":"reactive"}const bs={proactive:"Proactive"},js={proactive:"It may message you on its own: after sending you something it waits a few minutes for a reply, nudges again with growing gaps for a fixed number of tries, then waits for you — and it may also wake on its own schedule.",reactive:"It replies when you write to it. It does not nudge you, and it does not wake on its own schedule."},ys={proactive:"Turning this off stops the nudging and the scheduled wakes. It still replies when you write to it.",reactive:"Turning this on lets it write first: it will wait a few minutes for your reply, nudge you again up to a fixed number of tries, and it may wake on its own schedule. It still replies when you write to it."},vs="This one ships with the app and has no copy of its own yet, so switching installs it first — the same agent and the same instructions, now editable — and then sets its class.";function ks(t,s){const n=[];return t.source==="builtin"&&n.push({op:"profiles.install",name:t.name}),n.push({op:"profiles.update",name:t.name,fields:{action_class:s}}),n}async function ws(t,s,n,a=()=>crypto.randomUUID()){if(Ae(t)===s)return null;let i=null;const l=ks(t,s);for(let h=0;h<l.length;h+=1){const f=l[h];try{i=await n(f,a())}catch(p){throw new ot(p,l.slice(0,h))}}return i}class ot extends Error{completed;constructor(s,n){super(s instanceof Error?s.message:String(s)),this.name="ClassSwitchError",this.completed=n}}function Ns(t,s){const n=t instanceof Error&&t.message?t.message:"The backend sent no reason for it. Try the switch again.",a=je(n).message;return s.some(i=>i.op==="profiles.install")?`${a} The install did land, so the agent is editable now.`:a}const Ss=new Set(["agent","team"]);function Cs(t){const s=typeof t.args?.op=="string"?t.args.op:null,n=typeof t.args?.name=="string"?t.args.name:null,a=t.toolName==="team"?"team":"agent",i=n?{kind:a,name:n}:null,l=t.phase==="done"&&!t.isError&&!t.notRunReason&&!t.neverSent,h=f=>({writes:f&&l});switch(s){case"create":return{verb:n?`Creating ${a} ${n}`:`Creating a ${a}`,target:i,...h(!0)};case"update":return{verb:n?`Updating ${a} ${n}`:`Updating a ${a}`,target:i,...h(!0)};case"install":return{verb:n?`Installing ${n}`:"Installing an agent",target:i,...h(!0)};case"list":case"search":case"show":return{verb:n?`Reading ${n}`:`Reading ${a}s`,target:i,...h(!1)};default:return{verb:t.phase==="running"?`Working on ${a}s`:`Checked ${a}s`,target:i,...h(!0)}}}const Es={description:"description",kind:"kind",tools:"tools",effort:"effort tier",delegate:"delegation",action_class:"class",manager:"manager",members:"members",instructions:"instructions"};function As(t){return{description:t.description??"",kind:t.kind,tools:t.tools&&t.tools.length>0?[...t.tools].sort().join(","):"*",effort:t.effort??"inherit",delegate:String(!!t.delegate),action_class:Ae(t)}}function Is(t){return{description:t.description??"",manager:t.manager??"",members:(t.members??[]).map(s=>`${s.kind}:${s.role}x${s.count}`).sort().join(",")}}function ze(t,s){return{agents:Object.fromEntries((t??[]).map(n=>[n.name,As(n)])),teams:Object.fromEntries((s??[]).map(n=>[n.name,Is(n)]))}}function Ts(t,s){if(t===s)return"tools";const n=f=>f==="*"?null:new Set(f.split(",")),a=n(t),i=n(s);if(i===null)return"tools widened to every tool";if(a===null)return"tools narrowed to a list";const l=[...i].filter(f=>!a.has(f)),h=[...a].filter(f=>!i.has(f));return l.length&&!h.length?l.length===1?`tool added: ${l[0]}`:`${l.length} tools added`:h.length&&!l.length?h.length===1?`tool removed: ${h[0]}`:`${h.length} tools removed`:"tools changed"}function $s(t,s,n){if(t==="tools")return Ts(s,n);if(t==="delegate")return n==="true"?"delegation turned on":"delegation turned off";if(t==="action_class")return n==="proactive"?"class changed to proactive":"class changed to reactive — proactive messaging stopped";if(t==="members"){const a=i=>i?i.split(",").length:0;return`members changed (${a(s)} to ${a(n)})`}return`${Es[t]??t} changed`}function Ds(t,s,n){const a=[],i=new Set;for(const l of n){const h=`${l.kind}:${l.name}`;if(i.has(h))continue;i.add(h);const f=t[l.kind==="agent"?"agents":"teams"][l.name],p=s[l.kind==="agent"?"agents":"teams"][l.name];if(!p)continue;if(!f){a.push({target:l,created:!0,changes:[]});continue}const c=[];for(const r of Object.keys(p))p[r]!==f[r]&&c.push({label:$s(r,f[r],p[r]),before:f[r],after:p[r]});a.push({target:l,created:!1,changes:c})}for(const[l,h]of[["agent",s.agents],["team",s.teams]])for(const f of Object.keys(h))i.has(`${l}:${f}`)||(l==="agent"?t.agents[f]:t.teams[f])||a.push({target:{kind:l,name:f},created:!0,changes:[]});return a}function Rs(t){return ce(t,"agents_config")&&ce(t,"session_interrupt")&&ce(t,"profile_catalogue")&&ce(t,"team_catalogue")}function Ls(t){if(!(t instanceof bt)||t.status!==409)return null;const n=t.detail?.session_id;return typeof n=="string"&&n.length>0?n:null}function Fs(t,s){const[n,a]=o.useState(()=>Date.now());return o.useEffect(()=>{if(!t||!s)return;const i=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(i)},[t,s]),t?Math.max(0,n-t):0}function _s(t){const s=Math.floor(t/1e3);return s<60?`${s}s`:`${Math.floor(s/60)}m ${String(s%60).padStart(2,"0")}s`}function qe(t){for(let s=(t?.length??0)-1;s>=0;s-=1){const n=t?.[s];if(n?.kind==="assistant"&&n.text?.trim())return n.text.trim()}return""}function Os(t){const n=t?.payload?.frontend;if(!n||typeof n!="object")return null;const a=n.streaming;if(typeof a=="boolean")return a;const i=n.snapshot?.streaming;return typeof i=="boolean"?i:null}function Us(){const t=Je(),s=Rs(t.data),n=pt(),a=H(),[i,l]=o.useState(!1),[h,f]=o.useState(!1),p=o.useRef(!1),c=a.status==="running"||a.status==="stopping",r=xt(a.sessionId??void 0,!!a.sessionId),y=o.useMemo(()=>qe(r.transcript?.records),[r.transcript?.records]);It(a.sessionId??void 0,r.subscriptionId);const v=r.transcript?.records,b=o.useRef(v);o.useEffect(()=>{b.current=v},[v]);const j=o.useMemo(()=>(r.transcript?.records??[]).filter(C=>C.kind==="tool"&&Ss.has(C.toolName)).map(C=>({...Cs({toolName:C.toolName,args:C.args??null,phase:C.phase,ts:C.ts,isError:C.isError,notRunReason:C.notRunReason,neverSent:C.neverSent}),ts:C.ts})),[r.transcript]);o.useEffect(()=>{if(c)for(const x of j)x.target&&x.writes&&a.noteTouched(x.target)},[j,c,a]);const E=c&&j.length>0?j[j.length-1].verb:null,d=_s(Fs(a.startedAt,c)),k=o.useCallback(async(x,C="")=>{if(p.current)return;p.current=!0;const O=a.before;let A=[];try{const[U,D]=await Promise.all([K({op:"profiles.list"}),K({op:"teams.list"})]);O&&(A=Ds(O,ze(U.profiles,D.teams),a.touched))}catch{H.getState().fail("The run finished, but the agents and teams lists could not be read to describe what changed."),Oe(n);return}if(Oe(n),H.getState().settle(A,x,C),x==="done"&&A.length>0){const U=A.filter(D=>D.created).length;me(U>0?`Configuration run finished: ${A.length} definition${A.length===1?"":"s"} changed.`:`Configuration run finished: ${A.length} definition${A.length===1?"":"s"} updated.`)}},[n,a.before,a.touched]);o.useEffect(()=>{if(c){if(r.failure){H.getState().fail(r.failure.statement);return}p.current||r.frontend&&(r.frontend.streaming||r.turnsCompleted!==0&&k(a.status==="stopping"?"stopped":"done",y))}},[c,y,r.failure,r.frontend,r.turnsCompleted,a.status,k]),o.useEffect(()=>{const x=a.sessionId;if(!c||!x)return;let C=!1;const O=async()=>{if(!(C||p.current))try{const D=await K({op:"sessions.get",sessionId:x});if(C||p.current||Os(D)!==!1)return;const B=qe(b.current);if(!B)return;k(H.getState().status==="stopping"?"stopped":"done",B)}catch{}},A=setTimeout(()=>void O(),400),U=setInterval(()=>void O(),4e3);return()=>{C=!0,clearTimeout(A),clearInterval(U)}},[c,a.sessionId,k]);const T=async(x,C)=>{if(i||!x.trim())return;l(!0),f(!1),p.current=!1;const O=ze(n.getQueryData(["desktop","profiles"]),n.getQueryData(["desktop","teams"])),A=C?`About the ${C.kind} “${C.name}”: ${x.trim()}`:x.trim();try{let U;try{U=(await K({op:"sessions.create",requestId:crypto.randomUUID(),purpose:"agents-config"})).session_id}catch(D){const B=Ls(D);if(B){f(!0),a.adopt(B,x.trim(),O);return}throw D}a.adopt(U,A,O),await P(U,A),a.acceptDraft()}catch(U){const D=H.getState().sessionId;H.getState().failUnsent(Te(U,D?"The run was set up, but your request could not be sent. It is still in the box — send it again when the backend is reachable.":"The configuration run could not be started. Your request is still here."))}finally{l(!1)}},P=async(x,C)=>{await K({op:"sessions.message",sessionId:x,requestId:crypto.randomUUID(),text:C})},L=async()=>{const x=H.getState();if(!(i||!x.unsent||!x.sessionId||!x.topic)){l(!0);try{await P(x.sessionId,x.topic),a.acceptDraft(),a.adopt(x.sessionId,x.topic,x.before),p.current=!1}catch(C){H.getState().failUnsent(Te(C,"The request could not be sent. It is still in the box."))}finally{l(!1)}}},$=async()=>{const x=H.getState().sessionId;if(x){a.stopping();try{await Tt(x,crypto.randomUUID())}catch(C){H.getState().stopFailed(Te(C,"The run did not acknowledge the request."))}}},w=s?null:t.isLoading?"Connecting to the backend…":t.error?"The backend could not be reached, so the composer is unavailable for now.":"Ask for a change needs a newer backend. Update Local Operator to configure agents by conversation.";return{enabled:s,disabledReason:w,status:a.status,sessionId:a.sessionId,topic:a.topic,error:a.error,stopError:a.stopError,draft:a.draft,setDraft:a.setDraft,about:a.about,setAbout:a.setAbout,touched:a.touched,results:a.results,answer:a.answer,step:E,elapsed:d,activity:j,start:T,stop:$,retry:L,canRetry:a.unsent&&!!a.sessionId,dismiss:a.dismiss,starting:i,attached:h}}function R({title:t,description:s,actions:n,children:a,className:i}){return e.jsxs("section",{className:Q("space-y-2 border-hairline border-t pt-4 first:border-t-0 first:pt-0",i),children:[e.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1",children:[e.jsx("h3",{className:"text-heading",children:t}),n]}),s?e.jsx("p",{className:"text-meta text-ink-muted",children:s}):null,a]})}function ue({text:t,empty:s="Nothing here yet.",mono:n=!1}){const[a,i]=o.useState(!1),[l,h]=o.useState(!1),f=o.useRef(null);return o.useEffect(()=>{if(a)return;const p=f.current;p&&h(!!t&&p.scrollHeight>p.clientHeight+1)},[t,a]),t.trim()?e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{ref:f,tabIndex:0,"aria-label":"The full text",className:Q("whitespace-pre-wrap rounded-sm border border-hairline bg-surface px-3 py-2 text-body-sm text-ink",!a&&"max-h-64 overflow-y-auto",n&&"font-mono text-meta"),children:t}),l?e.jsx(N,{variant:"link",size:"sm",onClick:()=>i(p=>!p),children:a?"Show less":"Show all"}):null]}):e.jsx("p",{className:"text-body-sm text-ink-muted",children:s})}function lt({source:t,appearance:s="chip"}){const n=t==="builtin"?"Built-in":t==="installed"?"Installed":"Custom";return s==="text"?e.jsx("span",{className:"shrink-0 text-meta text-ink-dim",children:n}):e.jsx(_,{variant:"neutral",children:n})}function ct(t,s){o.useEffect(()=>{if(!s)return;const n=a=>{a.key!=="Escape"||a.defaultPrevented||(a.preventDefault(),t())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[s,t])}function Le({dirty:t,pending:s,onSave:n,onCancel:a,saveLabel:i="Save changes",pendingLabel:l="Saving…",dirtyHint:h,submit:f,confirming:p,onConfirmingChange:c}){const[r,y]=o.useState(!1),v=o.useRef(null),b=p!==void 0,j=b?p:r,E=d=>{b||y(d),c?.(d)};return o.useEffect(()=>{t||(b||y(!1),c?.(!1))},[t,b,c]),e.jsxs("div",{"data-testid":"edit-footer",className:"sticky bottom-0 z-10 -mx-6 mt-6 flex flex-wrap items-center gap-2 border-hairline border-t bg-canvas px-6 py-3",children:[e.jsx(N,{ref:v,type:f?"submit":void 0,variant:"primary",onClick:f?void 0:n,disabled:s,children:s?l:i}),j?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-body-sm text-ink-muted",children:h??"Discard your unsaved changes?"}),e.jsx(N,{variant:"danger",onClick:a,children:"Discard changes"}),e.jsx(N,{variant:"ghost",onClick:()=>{E(!1),v.current?.focus()},children:"Keep editing"})]}):e.jsx(N,{variant:"ghost",onClick:()=>t?E(!0):a(),disabled:s,children:"Cancel"}),t&&!j?e.jsx("span",{className:"text-meta text-ink-muted",children:"Unsaved changes"}):null]})}let Re=!1;function dt(){Re=!0}function ut(){const t=Re;return Re=!1,t}function Ms({rows:t=6}){return e.jsx("div",{className:"space-y-1","aria-hidden":"true",children:Ps.slice(0,t).map(s=>e.jsx(de,{className:"h-11 w-full"},s))})}const Ps=["a","b","c","d","e","f","g","h"];function We(){return e.jsxs("div",{className:"max-w-3xl space-y-6","aria-hidden":"true",children:[e.jsx(de,{className:"h-7 w-64"}),e.jsx(de,{className:"h-5 w-40"}),e.jsx(de,{className:"h-28 w-full"}),e.jsx(de,{className:"h-24 w-full"})]})}function He({title:t,what:s,meaning:n,onRetry:a,retrying:i=!1}){return e.jsxs("div",{role:"alert",className:"max-w-xl space-y-2",children:[e.jsx("h2",{className:"text-heading",children:t}),e.jsx("p",{className:"text-body-sm text-ink",children:s}),e.jsx("p",{className:"text-body-sm text-ink-muted",children:n}),e.jsx(N,{variant:"secondary",onClick:a,disabled:i,children:i?"Retrying…":"Retry"})]})}function Y({label:t,htmlFor:s,error:n}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[e.jsx("label",{htmlFor:s,className:"text-body-sm text-ink-muted",children:t}),n?e.jsx("span",{className:"text-meta text-danger",role:"alert",children:n}):null]})}const Bs=/^[A-Za-z0-9_.:-]{1,128}$/;function ee(t){return{description:t.description??"",instructions:t.instructions??"",tools:t.tools&&t.tools.length>0?[...t.tools]:null,effort:t.effort??"inherit",delegate:t.delegate??!1}}function zs(t,s){const n={};return s.description!==t.description&&(n.description=s.description),s.instructions!==t.instructions&&(n.instructions=s.instructions),JSON.stringify(s.tools)!==JSON.stringify(t.tools)&&(n.tools=s.tools??[]),s.effort!==t.effort&&(n.effort=s.effort),s.delegate!==t.delegate&&(n.delegate=s.delegate),n}function qs({profile:t}){return e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx(lt,{source:t.source}),t.divergent_fields?.length?e.jsx(_,{variant:"warning",children:"Modified"}):null,t.kind==="specialist"?e.jsx(_,{variant:"neutral",children:"Specialist"}):null,t.delegate?e.jsx(_,{variant:"neutral",children:"Delegates"}):null,t.tools&&t.tools.length>0?e.jsx(_,{variant:"neutral",children:t.tools.length===1?"1 tool":`${t.tools.length} tools`}):null]})}const Ws=5e3;let $e=null;function Hs({profile:t,displayedName:s,notice:n,onNotice:a,onChanged:i}){const l=Ae(t),[h,f]=o.useState(null),[p,c]=o.useState(!1),r=o.useRef(null),y=o.useId();o.useEffect(()=>{h!==null&&l===h&&f(null)},[l,h]),o.useEffect(()=>{const j=$e;!j||j.name!==t.name||($e=null,!(Date.now()-j.at>Ws)&&r.current?.focus())},[t.name]);const v=h??l,b=async j=>{if(!(p||j===v)){$e={name:t.name,at:Date.now()},a(null),f(j),c(!0);try{await ws(t,j,(E,d)=>E.op==="profiles.install"?K({op:"profiles.install",name:E.name,requestId:d}):K({op:"profiles.update",name:E.name,requestId:d,fields:E.fields??{}})),i(t.name),me(j==="proactive"?`${s} is now proactive — it may message you on its own.`:`${s} is now reactive — proactive messaging stopped.`)}catch(E){f(null);const d=E instanceof ot?E.completed:[],k=Ns(E,d);a(k),ve(k),i(t.name)}finally{c(!1)}}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative flex items-center gap-2 text-body-sm",children:[e.jsx(Ee,{ref:r,checked:v==="proactive","aria-disabled":p,"aria-labelledby":y,"data-testid":"agent-class-switch",className:"after:absolute after:inset-0 after:content-['']",onCheckedChange:j=>void b(j?"proactive":"reactive")}),e.jsx("span",{id:y,className:"text-ink",children:"Can message me on its own"}),e.jsx("span",{"aria-live":"polite",className:"text-ink-muted",children:p?"Switching…":v==="proactive"?"On":"Off"})]}),e.jsx("p",{className:"text-body-sm text-ink",children:js[v]}),e.jsx("p",{className:"text-meta text-ink-muted",children:ys[v]}),t.source==="builtin"?e.jsx("p",{className:"text-meta text-ink-muted",children:vs}):null,n?e.jsxs(te,{variant:"danger",role:"alert","data-testid":"agent-class-error",children:[e.jsx(se,{children:"The switch did not go through"}),e.jsx(ne,{children:n})]}):null]})}function mt({tools:t,onChange:s,error:n}){const[a,i]=o.useState(""),[l,h]=o.useState(null),f=o.useId(),p=()=>{const c=a.trim();if(c){if(!Bs.test(c)){h("Tool names are letters, digits, dot, underscore, dash or colon.");return}if(t?.includes(c)){h("That tool is already listed.");return}h(null),i(""),s([...t??[],c])}};return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-body-sm",children:[e.jsx(Ee,{checked:t===null,onCheckedChange:c=>s(c?null:[]),"aria-label":"Give this agent every tool"}),e.jsx("span",{children:"All tools"})]}),t===null?e.jsx("p",{className:"text-meta text-ink-muted",children:"This agent may use whatever the session offers."}):e.jsxs(e.Fragment,{children:[t.length>0?e.jsx("ul",{className:"flex flex-wrap gap-1.5",children:t.map(c=>e.jsx("li",{children:e.jsxs(_,{variant:"outline",children:[c,e.jsx(N,{variant:"ghost",size:"sm","aria-label":`Remove ${c}`,onClick:()=>s(t.filter(r=>r!==c)),className:"ml-1 h-4 px-1",children:"×"})]})},c))}):e.jsx("p",{className:"text-meta text-ink-muted",children:"No tools yet. Add one below, or turn on All tools."}),e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(Y,{label:"Add a tool",htmlFor:f,error:l??n}),e.jsx(he,{id:f,value:a,inputSize:"md",placeholder:"Tool name","aria-invalid":!!(l??n),onChange:c=>{i(c.target.value),h(null)},onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),p())}})]}),e.jsx(N,{variant:"secondary",onClick:p,disabled:!a.trim(),children:"Add"})]})]})]})}function Ks({profile:t,displayedName:s,classNotice:n,onClassNotice:a,teams:i,effortTiers:l,askEnabled:h,onSaved:f,onDuplicate:p,onOpenTeam:c,onAskAgent:r,onDirtyChange:y}){const[v,b]=o.useState(!1),[j,E]=o.useState(()=>ee(t)),[d,k]=o.useState(()=>ee(t)),[T,P]=o.useState(!1),[L,$]=o.useState(null),[w,x]=o.useState(null),[C,O]=o.useState(!1),[A,U]=o.useState(!1),[D,B]=o.useState(!1),z=o.useRef(null),ae=Ye(),q=JSON.stringify(d)!==JSON.stringify(j);o.useEffect(()=>(y?.(v&&q),()=>y?.(!1)),[y,v,q]),o.useEffect(()=>{ut()&&requestAnimationFrame(()=>z.current?.focus())},[]),o.useEffect(()=>{if(v&&q)return;const g=ee(t);E(g),k(g)},[t,v,q]),o.useEffect(()=>{if(!v){U(!1);return}const g=ee(t);U(q&&JSON.stringify(g)!==JSON.stringify(j))},[t,v,q,j]);const J=()=>{b(!1),$(null),x(null),O(!1),B(!1);const g=ee(t);E(g),k(g)};ct(()=>{if(D){B(!1);return}q?B(!0):J()},v);const Z=async g=>{if(g?.preventDefault(),T)return;const I=zs(j,d);if(Object.keys(I).length===0){J();return}if(typeof I.instructions=="string"&&!I.instructions.trim()){$("Give the agent instructions."),x("instructions");return}P(!0),$(null),x(null);try{const W=await K({op:"profiles.update",name:t.name,requestId:crypto.randomUUID(),fields:I});b(!1),O(!1);const G=ee(W);E(G),k(G),f(W.name),me(`Saved ${W.name}.`),requestAnimationFrame(()=>z.current?.focus())}catch(W){const G=je(W instanceof Error?W.message:"The agent could not be saved.");$(G.message),x(G.field);const re=W?.status,fe=typeof re=="number"&&re!==408&&re>=400&&re<500;O(!fe),fe||ve("The save could not be confirmed. Check whether it was applied before retrying.")}finally{P(!1)}},u=async()=>{if(!T){P(!0),$(null);try{const g=await K({op:"profiles.install",name:t.name,requestId:crypto.randomUUID()}),I=ee(g);E(I),k(I),f(g.name),me(`Installed ${g.name}. It can be edited now.`),requestAnimationFrame(()=>z.current?.focus())}catch(g){const I=je(g instanceof Error?g.message:"The agent could not be installed.");$(I.message),ve(I.message)}finally{P(!1)}}},S=(i??[]).filter(g=>g.manager===t.name||(g.members??[]).some(I=>I.role===t.name)),M=t.source==="builtin";return e.jsxs("div",{className:"max-w-3xl space-y-6",children:[e.jsxs("header",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-x-4 gap-y-3",children:[e.jsxs("div",{className:"min-w-0 space-y-2",children:[e.jsx("h2",{ref:z,tabIndex:-1,className:"text-title focus:outline-none",children:s}),e.jsx(qs,{profile:t})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(N,{variant:"primary",onClick:()=>{Qe.getState().stageDraft({kind:"agent",name:t.name}),ae("/chat")},children:"New chat"}),M?e.jsxs(N,{variant:"secondary",onClick:u,disabled:T,children:[e.jsx(Yt,{className:"size-4"}),T?"Installing…":"Install to edit"]}):e.jsx(N,{variant:"secondary",onClick:()=>{b(!0),$(null),x(null)},children:"Edit"}),e.jsx(N,{variant:"ghost",onClick:()=>p(t),children:"Duplicate as new agent"}),h?e.jsx(N,{variant:"ghost",onClick:()=>r(`Change the agent ${t.name}: `),children:"Ask for a change"}):null]})]}),M?e.jsxs(te,{variant:"info",children:[e.jsx(se,{children:"Built-in agent"}),e.jsx(ne,{children:"This one ships with the app and cannot be edited in place. Install it to get an editable copy, or duplicate it as a new agent."})]}):null,A?e.jsxs(te,{variant:"warning","data-testid":"agent-conflict",children:[e.jsx(se,{children:"This changed while you were editing"}),e.jsxs(ne,{children:[e.jsx("span",{className:"block",children:"Something else — a configuration run, or another window — wrote to this agent after you opened it. Your edits are kept; saving writes only the fields you changed."}),e.jsx(N,{variant:"secondary",size:"sm",className:"mt-2",onClick:J,children:"Reload the saved version"})]})]}):null,C?e.jsxs(te,{variant:"danger","data-testid":"agent-unconfirmed",children:[e.jsx(se,{children:"The last save was not confirmed"}),e.jsx(ne,{children:"The backend did not answer, so the write may or may not have landed. Check the agent below, then edit again."})]}):null,L&&!w?e.jsxs(te,{variant:"danger",role:"alert","data-testid":"agent-save-error",children:[e.jsx(se,{children:"That did not save"}),e.jsx(ne,{children:L})]}):null]}),e.jsx("form",{noValidate:!0,onSubmit:g=>{g.preventDefault(),Z(g)},className:"space-y-6",children:v?e.jsxs(e.Fragment,{children:[e.jsx(Se,{title:"When to use it",description:"One sentence the model reads to decide when this agent is the right one.",label:"When to use this agent",value:d.description,error:w==="description"?L:null,onChange:g=>k(I=>({...I,description:g}))}),e.jsx(Se,{title:"Instructions",description:"What the agent is told to do. This is the agent's whole behaviour.",label:"Instructions",value:d.instructions,rows:12,required:!0,error:w==="instructions"?L:null,onChange:g=>k(I=>({...I,instructions:g}))}),e.jsx(R,{title:"Tools",children:e.jsx(mt,{tools:d.tools,error:w==="tools"?L:null,onChange:g=>k(I=>({...I,tools:g}))})}),e.jsx(R,{title:"Delegation and effort",description:"Whether this agent may hand work to subagents, and which effort tier it runs at.",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-body-sm",children:[e.jsx(Ee,{checked:d.delegate,onCheckedChange:g=>k(I=>({...I,delegate:g})),"aria-label":"May delegate to subagents"}),e.jsx("span",{children:"May delegate to subagents"})]}),e.jsxs("div",{className:"max-w-sm space-y-1",children:[e.jsx(Y,{label:"Effort tier",htmlFor:"agent-effort",error:w==="effort"?L:null}),e.jsx(Ne,{ariaLabel:"Effort tier",showLabel:!1,placeholder:"Choose an effort tier",busyLabel:"Loading effort tiers",options:["inherit",...l].map(g=>({id:g,name:g,description:g==="inherit"?"Use the session's own effort":void 0})),selected:{id:d.effort,name:d.effort},onSelect:g=>k(I=>({...I,effort:g.id})),helperText:"Tiers come from the backend's subagent model settings."})]})]})}),e.jsx(Le,{submit:!0,confirming:D,onConfirmingChange:B,dirty:q,pending:T,onSave:()=>void Z(),onCancel:J,saveLabel:"Save changes",dirtyHint:"Discard your unsaved changes to this agent?"})]}):e.jsxs(e.Fragment,{children:[e.jsx(R,{title:"When to use it",children:e.jsx(ue,{text:t.description||"",empty:"No description yet — add one so a model knows when to pick this agent."})}),e.jsx(R,{title:"Instructions",children:e.jsx(ue,{text:t.instructions??t.packaged_instructions??"",empty:"No instructions yet."})}),e.jsx(R,{title:"Tools",children:t.tools&&t.tools.length>0?e.jsx("ul",{className:"flex flex-wrap gap-1.5",children:t.tools.map(g=>e.jsx("li",{children:e.jsx(_,{variant:"outline",children:g})},g))}):e.jsx(_,{variant:"neutral",children:"All tools"})}),e.jsxs(R,{title:"Delegation and effort",children:[e.jsx("p",{className:"text-body-sm text-ink",children:t.delegate?"May hand work to subagents.":"Does its own work; it does not delegate."}),e.jsxs("p",{className:"text-body-sm text-ink-muted",children:["Effort tier: ",t.effort??"inherit"]})]}),e.jsx(R,{title:"Messaging",description:"Reactive agents only reply. Proactive agents may also message you first.",children:e.jsx(Hs,{profile:t,displayedName:s,notice:n,onNotice:a,onChanged:f})}),e.jsx(R,{title:"Used by",description:"Teams that name this agent as a manager or a member.",children:S.length>0?e.jsx("ul",{className:"flex flex-wrap gap-x-3 gap-y-1",children:S.map(g=>e.jsx("li",{children:e.jsx(N,{variant:"link",onClick:()=>c(g.name),children:g.name})},g.id))}):e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No team uses it yet."})}),e.jsxs(R,{title:"Where it came from",description:t.source==="builtin"?"Shipped with the app.":t.source==="installed"?"Installed from a packaged starter.":"Created on this machine.",children:[e.jsxs("dl",{className:"space-y-1 text-body-sm",children:[t.seed_origin?e.jsxs("div",{className:"flex gap-2",children:[e.jsx("dt",{className:"text-ink-muted",children:"Source"}),e.jsx("dd",{className:"text-ink",children:t.seed_origin})]}):null,t.divergent_fields?.length?e.jsxs("div",{className:"flex gap-2",children:[e.jsx("dt",{className:"text-ink-muted",children:"Changed from the packaged copy"}),e.jsx("dd",{className:"text-ink",children:t.divergent_fields.join(", ")})]}):null]}),t.packaged_instructions&&t.divergent_fields?.length?e.jsx(Xe,{summary:"Compare with the packaged instructions",className:"mt-2",children:e.jsx(ue,{text:t.packaged_instructions,mono:!0})}):null]})]})})]})}function Se({title:t,description:s,label:n,value:a,onChange:i,rows:l,required:h,error:f,fieldRef:p}){const c=o.useId();return e.jsxs(R,{title:t,description:s,children:[e.jsx(Y,{label:n,htmlFor:c,error:f}),l?e.jsx(ke,{id:c,ref:p,value:a,rows:l,required:h,"aria-invalid":!!f,className:Q("min-h-0"),onChange:r=>i(r.target.value)}):e.jsx(he,{id:c,value:a,"aria-invalid":!!f,onChange:r=>i(r.target.value)})]})}function Gs({initial:t,takenNames:s,effortTiers:n,onDirtyChange:a,onSaved:i,onCancel:l}){const[h,f]=o.useState(()=>t?xs(t.name,s):""),[p,c]=o.useState(t?.kind??"role"),[r,y]=o.useState(()=>t?{...ee(t),description:t.description??""}:{description:"",instructions:"",tools:null,effort:"inherit",delegate:!1}),[v,b]=o.useState(!1),[j,E]=o.useState(null),[d,k]=o.useState(null),T=o.useRef(null),P=o.useRef(null);o.useEffect(()=>(a?.(!!(h.trim()||r.instructions.trim())),()=>a?.(!1)),[a,h,r.instructions]),o.useEffect(()=>{T.current?.focus(),T.current?.select()},[]);const L=async w=>{if(w?.preventDefault(),!v){if(!h.trim()){E("Give the agent a name."),k("name"),T.current?.focus();return}if(/[\\/\s]/.test(h.trim())){E("Names cannot contain spaces or slashes."),k("name"),T.current?.focus();return}if(s.includes(h.trim())){E(`An agent called “${h.trim()}” already exists. Choose another name, or open the existing one to change it.`),k("name"),T.current?.focus();return}if(!r.instructions.trim()){E("Give the agent instructions."),k("instructions"),P.current?.focus();return}b(!0),E(null),k(null);try{const x=await K({op:"profiles.create",requestId:crypto.randomUUID(),name:h.trim(),fields:{kind:p,description:r.description,instructions:r.instructions,tools:r.tools??[],effort:r.effort,delegate:r.delegate}});me(`Created ${x.name}.`),dt(),i(x.name)}catch(x){const C=je(x instanceof Error?x.message:"The agent could not be created.");E(C.message),k(C.field)}finally{b(!1)}}},$=t?"Duplicate as a new agent":"New agent";return e.jsxs("div",{className:"max-w-3xl space-y-6",children:[e.jsxs("header",{className:"space-y-2",children:[e.jsx("h2",{className:"text-title",children:$}),e.jsx("p",{className:"text-body-sm text-ink-muted",children:t?`A copy of ${t.name}. It is a separate agent: changing it does not change the original.`:"Reusable instructions shared by agent commands, subagents and teams. Chats stay separate."})]}),j&&!d?e.jsxs(te,{variant:"danger",role:"alert","data-testid":"agent-create-error",children:[e.jsx(se,{children:"That did not save"}),e.jsx(ne,{children:j})]}):null,e.jsxs("form",{noValidate:!0,onSubmit:w=>{w.preventDefault(),L(w)},className:"space-y-6",children:[e.jsx(R,{title:"Name and role",children:e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(Y,{label:"Name",htmlFor:"agent-create-name",error:d==="name"?j:null}),e.jsx(he,{id:"agent-create-name",ref:T,value:h,required:!0,"aria-invalid":d==="name",onChange:w=>f(w.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(Y,{label:"How it works with others",htmlFor:"agent-create-kind"}),e.jsxs(st,{value:p,onValueChange:w=>c(w),children:[e.jsx(nt,{id:"agent-create-kind",children:e.jsx(at,{})}),e.jsxs(it,{children:[e.jsx(we,{value:"role",children:"You can chat with it directly"}),e.jsx(we,{value:"specialist",children:"Other agents can call on it"})]})]})]})]})}),e.jsx(Se,{title:"When to use it",description:"One sentence the model reads to decide when this agent is the right one.",label:"When to use this agent",value:r.description,error:d==="description"?j:null,onChange:w=>y(x=>({...x,description:w}))}),e.jsx(Se,{title:"Instructions",description:"What the agent is told to do. This is the agent's whole behaviour.",label:"Instructions",value:r.instructions,rows:12,required:!0,fieldRef:P,error:d==="instructions"?j:null,onChange:w=>y(x=>({...x,instructions:w}))}),e.jsx(R,{title:"Delegation and effort",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-body-sm",children:[e.jsx(Ee,{checked:r.delegate,onCheckedChange:w=>y(x=>({...x,delegate:w})),"aria-label":"May delegate to subagents"}),e.jsx("span",{children:"May delegate to subagents"})]}),e.jsxs("div",{className:"max-w-sm space-y-1",children:[e.jsx(Y,{label:"Effort tier",htmlFor:"agent-create-effort"}),e.jsx(Ne,{ariaLabel:"Effort tier",showLabel:!1,busyLabel:"Loading effort tiers",placeholder:"Choose an effort tier",options:["inherit",...n].map(w=>({id:w,name:w,description:w==="inherit"?"Use the session's own effort":"A tier configured in Settings"})),selected:{id:r.effort,name:r.effort},onSelect:w=>y(x=>({...x,effort:w.id}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-body-sm text-ink-muted",children:"Tools"}),e.jsx(mt,{tools:r.tools,error:d==="tools"?j:null,onChange:w=>y(x=>({...x,tools:w}))})]})]})}),e.jsx(Le,{submit:!0,dirty:!!(h.trim()||r.instructions),pending:v,saveLabel:t?"Create the copy":"Create agent",pendingLabel:"Creating…",dirtyHint:"Discard this new agent?",onSave:()=>void L(),onCancel:l})]})]})}const Ce=t=>t==null?"":typeof t=="string"?t:JSON.stringify(t,null,2),Vs={available:"border-hairline",updating:"border-hairline",applied:"border-hairline",review:"border-warning-border",failed:"border-danger-border"};function Js(t){const s=[];for(const n of t??[])for(const a of n.fields??[])for(const i of a.regions??[])(i.provenance==="unresolved"||Ce(i.local)!==Ce(i.remote))&&s.push({field:a.field,region:i});return s}function Ys({regions:t}){return t.length?e.jsx("ul",{className:"space-y-3","data-testid":"hub-update-preview",children:t.map(({field:s,region:n},a)=>e.jsxs("li",{className:"space-y-1 text-meta",children:[e.jsx("p",{className:"font-medium text-ink",children:n.heading||n.name||s}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-ink-muted",children:"Yours"}),e.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded-sm border border-hairline p-2 text-ink",children:Ce(n.local)||"(nothing)"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-ink-muted",children:"The hub's"}),e.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded-sm border border-hairline p-2 text-ink",children:Ce(n.remote)||"(nothing)"})]})]})]},`${s}:${n.id??a}`))}):e.jsx("p",{className:"text-meta text-ink-muted",children:"No differences to show: the hub's version matches yours."})}function Qs({kind:t,name:s,enabled:n}){const a=$t(n),i=Dt(),[l,h]=o.useState(null),f=Lt(t,s),p=Rt(a.data).get(f),c=Ft(p),r=i.notes[f],y=i.pending.has(f);if(!p||!c)return r?e.jsx("section",{"data-testid":"hub-update-panel","aria-label":"Hub update",className:"mb-6 max-w-3xl rounded-md border border-hairline p-3 text-body-sm",children:e.jsx("p",{role:r.tone==="error"?"alert":"status",className:r.tone==="error"?"text-danger":"text-ink",children:r.message})}):null;const v=c.kind==="review",b=p.classification==="baseline-unknown",j=d=>({prefer:d,acknowledgeUnknownBaseline:b}),E=async()=>{const d=await i.applyItem(t,s,{...j(),dryRun:!0});h(d??[])};return e.jsxs("section",{"data-testid":"hub-update-panel","aria-label":"Hub update",className:Q("mb-6 max-w-3xl space-y-2 rounded-md border p-3 text-body-sm",Vs[c.kind]),children:[e.jsxs("p",{className:"flex items-start gap-2 text-ink",children:[e.jsx(_t,{mark:c,className:"mt-0.5"}),e.jsx("span",{className:Q(c.kind==="failed"&&"text-danger"),children:Ot(p,c)})]}),v&&b&&e.jsx("p",{className:"text-meta text-ink-muted",children:"Nothing records what you changed on this device. Either choice adds the hub's additions and deletes nothing of yours; where the two versions differ, your choice decides which wording stays."}),v&&!b&&e.jsx("p",{className:"text-meta text-ink-muted",children:"Where the two versions differ, your choice decides which wording stays. Everything else is merged, and your current version is saved as a backup first."}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.kind==="available"&&e.jsx(N,{size:"sm",variant:"outline","aria-disabled":y||void 0,onClick:()=>!y&&void i.applyItem(t,s),children:y?"Updating…":"Update from the hub"}),c.kind==="failed"&&c.retryable&&e.jsx(N,{size:"sm",variant:"outline","aria-disabled":y||void 0,onClick:()=>!y&&void i.retryItem(t,s),children:y?"Retrying…":"Retry"}),v&&e.jsxs(e.Fragment,{children:[e.jsx(N,{size:"sm",variant:"outline","aria-disabled":y||void 0,onClick:()=>!y&&void E(),children:y&&!l?"Loading…":"Preview the differences"}),e.jsx(N,{size:"sm",variant:"ghost","aria-disabled":y||void 0,onClick:()=>!y&&void i.applyItem(t,s,j("local")),children:"Keep mine where they differ"}),e.jsx(N,{size:"sm",variant:"ghost","aria-disabled":y||void 0,onClick:()=>!y&&void i.applyItem(t,s,j("remote")),children:"Use the hub's where they differ"})]})]}),l&&v&&e.jsx(Ys,{regions:Js(l)}),r&&e.jsx("p",{role:r.tone==="error"?"alert":"status",className:r.tone==="error"?"text-meta text-danger":"text-meta text-ink-muted",children:r.message})]})}function be(t){return{description:t?.description??"",manager:t?.manager??"manager",members:(t?.members??[]).map(s=>({...s,key:crypto.randomUUID()})),instructions:t?.instructions??"",project:t?.project??""}}function Xs(t,s){const n={};return s.description!==t.description&&(n.description=s.description),s.manager!==t.manager&&(n.manager=s.manager),JSON.stringify(s.members.map(({key:a,...i})=>i))!==JSON.stringify(t.members.map(({key:a,...i})=>i))&&(n.members=s.members.map(({key:a,...i})=>i)),s.instructions!==t.instructions&&(n.instructions=s.instructions),s.project!==t.project&&(n.project=s.project),n}function Ke(t,s,n){return(t.kind==="agent"?(s??[]).map(i=>i.name):(n??[]).map(i=>i.name)).includes(t.role)}function Ge({team:t,agents:s,teams:n,askEnabled:a,onSaved:i,onCancelCreate:l,onOpenAgent:h,onAskAgent:f,onDirtyChange:p}){const c=!t,[r,y]=o.useState(c),[v,b]=o.useState(t?.name??""),[j,E]=o.useState(()=>be(t)),[d,k]=o.useState(()=>be(t)),[T,P]=o.useState(!1),[L,$]=o.useState(null),[w,x]=o.useState(null),[C,O]=o.useState(!1),A=o.useRef(null),U=o.useRef(null),D=o.useRef(null);o.useEffect(()=>{ut()&&requestAnimationFrame(()=>A.current?.focus())},[]);const B=Ye(),z=c?!!(v.trim()||d.description||d.members.length):JSON.stringify(d)!==JSON.stringify(j);o.useEffect(()=>(p?.((c||r)&&z),()=>p?.(!1)),[p,c,r,z]),o.useEffect(()=>{if(r&&z)return;const u=be(t);E(u),k(u)},[t,r,z]);const ae=()=>{if(c){l?.();return}y(!1),$(null),x(null),O(!1);const u=be(t);E(u),k(u)};ct(()=>{if(C){O(!1);return}z?O(!0):ae()},r);const J=async u=>{if(u?.preventDefault(),!T){if(c&&!v.trim()){$("Give the team a name."),x("name"),D.current?.focus();return}if(c&&/[\\/\s]/.test(v.trim())){$("Names cannot contain spaces or slashes."),x("name"),D.current?.focus();return}if(c&&(n??[]).some(S=>S.name===v.trim())){$(`A team called “${v.trim()}” already exists. Open it to change it, or choose another name.`),x("name"),D.current?.focus();return}if(c&&!d.instructions.trim()){$("Give the team instructions."),x("instructions"),U.current?.focus();return}P(!0),$(null),x(null);try{const S=t?await K({op:"teams.update",name:t.name,requestId:crypto.randomUUID(),fields:Xs(j,d)}):await K({op:"teams.create",requestId:crypto.randomUUID(),fields:{name:v,description:d.description,manager:d.manager,members:d.members.map(({key:g,...I})=>I),instructions:d.instructions,project:d.project}}),M=be(S);E(M),k(M),y(!1),i(S.name),me(`${c?"Created":"Saved"} ${S.name}.`),c&&dt(),requestAnimationFrame(()=>A.current?.focus())}catch(S){const M=je(S instanceof Error?S.message:"The team could not be saved.");$(M.message),x(M.field),ve(M.message)}finally{P(!1)}}},X=(u,S)=>k(M=>({...M,members:M.members.map((g,I)=>I===u?{...g,...S}:g)})),Z=(d.members.length?d.members:t?.members??[]).reduce((u,S)=>u+(S.count||1),0);return e.jsxs("div",{className:"max-w-3xl space-y-6",children:[e.jsxs("header",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-x-4 gap-y-3",children:[e.jsxs("div",{className:"min-w-0 space-y-2",children:[e.jsx("h2",{ref:A,tabIndex:-1,className:"text-title focus:outline-none",children:t?Ze(t):"New team"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx(_,{variant:"neutral",children:Z===1?"1 agent":`${Z} agents`}),d.members.some(u=>u.kind==="team")?e.jsx(_,{variant:"neutral",children:"Includes a team"}):null]})]}),t?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(N,{variant:"primary",onClick:()=>{Qe.getState().stageDraft({kind:"team",name:t.name}),B("/chat")},children:"New team chat"}),r?null:e.jsx(N,{variant:"secondary",onClick:()=>y(!0),children:"Edit"}),a?e.jsx(N,{variant:"ghost",onClick:()=>f(`Change the team ${t.name}: `),children:"Ask for a change"}):null]}):null]}),L&&!w?e.jsxs(te,{variant:"danger",role:"alert","data-testid":"team-save-error",children:[e.jsx(se,{children:"That did not save"}),e.jsx(ne,{children:L})]}):null]}),e.jsx("form",{noValidate:!0,onSubmit:u=>{u.preventDefault(),J(u)},className:"space-y-6",children:c||r?e.jsxs(e.Fragment,{children:[c?e.jsxs(R,{title:"Name",description:"How you and your chats will refer to this team.",children:[e.jsx(Y,{label:"Team name",htmlFor:"team-name",error:w==="name"?L:null}),e.jsx(he,{ref:D,id:"team-name","data-testid":"team-name-input",value:v,required:!0,maxLength:64,autoFocus:!0,"aria-invalid":w==="name",onChange:u=>b(u.target.value)})]}):null,e.jsx(R,{title:"Manager",description:"The agent that leads the chat and decides who works on what.",children:e.jsxs("div",{className:"max-w-md space-y-2",children:[e.jsx(Y,{label:"Manager agent",htmlFor:"team-manager",error:w==="manager"?L:null}),e.jsx(Ne,{ariaLabel:"Manager agent",showLabel:!1,placeholder:"Choose a manager",busyLabel:"Loading agents",options:le(s,n),selected:le(s,n).find(u=>u.id===d.manager)??null,onSelect:u=>k(S=>({...S,manager:u.id})),onCustomSubmit:u=>k(S=>({...S,manager:u})),listNotice:"Agents and teams on this machine"}),le(s,n).some(u=>u.id===d.manager)?null:e.jsxs(_,{variant:"warning","data-testid":"team-manager-missing",children:["Not found: ",d.manager]})]})}),e.jsx(R,{title:"Members",description:"Who the manager can delegate to, and how many of each.",children:e.jsxs("div",{className:"space-y-2",children:[d.members.map((u,S)=>{const M=!Ke(u,s,n);return e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"w-56",children:e.jsx(Ne,{ariaLabel:`Member ${S+1}`,showLabel:!1,placeholder:"Choose an agent or team",busyLabel:"Loading agents",options:[...le(s,n).filter(g=>u.kind==="team"?g.group==="Teams":g.group==="Agents")],selected:le(s,n).find(g=>g.id===u.role)??null,onSelect:g=>X(S,{role:g.id,kind:g.group==="Teams"?"team":"agent"}),onCustomSubmit:g=>X(S,{role:g})})}),e.jsxs(st,{value:u.kind,onValueChange:g=>X(S,{kind:g}),children:[e.jsx(nt,{"aria-label":`Member ${S+1} kind`,className:"w-32",children:e.jsx(at,{})}),e.jsxs(it,{children:[e.jsx(we,{value:"agent",children:"Agent"}),e.jsx(we,{value:"team",children:"Team"})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(N,{variant:"secondary",size:"icon-sm","aria-label":`One fewer ${u.role}`,disabled:u.count<=1,onClick:()=>X(S,{count:u.count-1}),children:e.jsx(Ht,{"aria-hidden":"true"})}),e.jsx("span",{className:"min-w-6 text-center text-body-sm tabular-nums","aria-label":`${u.count} of ${u.role}`,children:u.count}),e.jsx(N,{variant:"secondary",size:"icon-sm","aria-label":`One more ${u.role}`,disabled:u.count>=16,onClick:()=>X(S,{count:u.count+1}),children:e.jsx(et,{"aria-hidden":"true"})})]}),e.jsx(N,{variant:"ghost",onClick:()=>k(g=>({...g,members:g.members.filter((I,W)=>W!==S)})),children:"Remove"}),M?e.jsxs(_,{variant:"warning",children:["Not found: ",u.role]}):null]},u.key)}),e.jsx(N,{variant:"secondary",onClick:()=>k(u=>({...u,members:[...u.members,{role:"",count:1,kind:"agent",key:crypto.randomUUID()}]})),children:"Add member"})]})}),e.jsxs(R,{title:"Description",children:[e.jsx(Y,{label:"What this team is for",htmlFor:"team-description",error:w==="description"?L:null}),e.jsx(he,{id:"team-description",value:d.description,onChange:u=>k(S=>({...S,description:u.target.value}))})]}),e.jsxs(R,{title:"Collaboration instructions",children:[w==="instructions"?e.jsx("p",{className:"text-meta text-danger",role:"alert","data-testid":"team-instructions-error",children:L}):null,e.jsx(ke,{ref:U,"aria-label":"Collaboration instructions","aria-invalid":w==="instructions",className:"min-h-36",maxLength:8e3,value:d.instructions,onChange:u=>k(S=>({...S,instructions:u.target.value}))})]}),e.jsx(R,{title:"Project brief",children:e.jsx(ke,{"aria-label":"Project brief",className:"min-h-36",maxLength:8e3,value:d.project,onChange:u=>k(S=>({...S,project:u.target.value}))})}),e.jsx(Le,{submit:!0,confirming:C,onConfirmingChange:O,dirty:z,pending:T,saveLabel:c?"Create team":"Save changes",pendingLabel:c?"Creating…":"Saving…",dirtyHint:"Discard this team?",onSave:()=>void J(),onCancel:ae})]}):e.jsxs(e.Fragment,{children:[e.jsx(R,{title:"Manager",description:"The agent that leads the chat.",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(N,{variant:"link",onClick:()=>h(d.manager),children:d.manager}),le(s,n).some(u=>u.id===d.manager)?null:e.jsx(_,{variant:"warning","data-testid":"team-manager-missing",children:"Not found"})]})}),e.jsx(R,{title:"Members",children:e.jsx("ul",{className:"space-y-1",children:(t?.members??[]).map(u=>e.jsxs("li",{className:"flex flex-wrap items-center gap-2 text-body-sm",children:[e.jsx("span",{className:"text-ink",children:u.role}),e.jsx(_,{variant:"neutral",children:u.kind==="team"?"Team":"Agent"}),e.jsx("span",{className:"text-ink-muted",children:u.count===1?"×1":`×${u.count}`}),Ke(u,s,n)?null:e.jsx(_,{variant:"warning","data-testid":"team-member-missing",children:"Not found"})]},`${u.kind}:${u.role}`))})}),e.jsx(R,{title:"What it is for",children:e.jsx(ue,{text:t?.description??"",empty:"No description yet."})}),t?.instructions?e.jsx(R,{title:"Collaboration instructions",children:e.jsx(ue,{text:t.instructions})}):null,t?.project?e.jsx(Xe,{summary:"Project brief",children:e.jsx(ue,{text:t.project})}):null]})})]})}function le(t,s){return[...(t??[]).map(n=>({id:n.name,name:n.name,description:n.description,group:"Agents"})),...(s??[]).map(n=>({id:n.name,name:n.name,description:n.description,group:"Teams"}))]}const Zs=o.lazy(()=>At(()=>import("./legacy-agents-page-EmhBvGX8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url).then(t=>({default:t.LegacyAgentsPage}))),Ve=/^subagents\.models\.([^.]+)$/,en=["lo","med","hi"],De={all:"All",custom:"Custom",installed:"Installed",builtin:"Built-in"},ye=t=>{const s=JSON.stringify(t)??"";let n=5381;for(let a=0;a<s.length;a+=1)n=(n*33^s.charCodeAt(a))>>>0;return`${s.length}.${n.toString(36)}`};function mn(){const t=jt("surface"),{agentId:s}=yt(),[n,a]=vt(),i=n.get("kind")==="team"||n.get("create")==="team",l=n.has("create"),h=n.get("name"),f=n.get("duplicate"),p=Je(),c=ce(p.data,i?"team_catalogue":"profile_catalogue"),r=kt(c),y=wt(c),v=c&&!!h&&!l,b=Ue(i?null:h,v),j=Nt(i?h:null,v),E=Ue(i?null:f,!!f),[d,k]=o.useState(""),[T,P]=o.useState("all"),[L,$]=o.useState(null),[w,x]=o.useState(null),[C,O]=o.useState(0),A=Us(),U=H(m=>m.marks),D=H(m=>m.clearMark),B=St({queryKey:["desktop","settings","effort-tiers"],enabled:c,queryFn:()=>K({op:"settings.list"}),staleTime:6e4}),z=o.useMemo(()=>(B.data?.settings??[]).filter(m=>{const F=m.key.match(Ve)?.[1];return!F||!en.includes(F)?!1:typeof m.value=="string"&&m.value.trim().length>0}).map(m=>m.key.match(Ve)?.[1]).filter(m=>!!m),[B.data]),ae=Ut(),q=o.useCallback(m=>Mt(m,ae),[ae]),J=o.useMemo(()=>nn(r.data,d,T,q),[r.data,d,T,q]),X=o.useMemo(()=>an(y.data,d),[y.data,d]),Z=i?X:J,u=h??null,[S,M]=o.useState(null);S!==null&&S.name!==u&&M(null);const g=o.useCallback(m=>{const F=new URLSearchParams;(m.kind??(i?"team":"agent"))==="team"&&F.set("kind","team"),m.name&&F.set("name",m.name),m.create!==null&&m.create!==void 0&&F.set("create",m.create),m.duplicate&&F.set("duplicate",m.duplicate),$(null),a(F)},[i,a]),I=`${i?"team":"agent"}:${l??""}:${u??""}`,W=o.useCallback(m=>x(m?I:null),[I]),G=w!==null&&w===I,[re,fe]=o.useState(!1),ge=`${i?"team":"agent"}:${u??""}`,ie=i?j.data?ye(j.data):null:b.data?ye(b.data):null,oe=o.useRef({identity:ge,content:ie});o.useEffect(()=>{if(oe.current.identity!==ge){oe.current={identity:ge,content:ie},fe(!1);return}if(ie===null||oe.current.content===null){oe.current={identity:ge,content:ie};return}oe.current.content!==ie&&(oe.current.content=ie,G&&fe(!0))},[ge,ie,G]);const Fe=(m,F)=>e.jsxs(e.Fragment,{children:[e.jsx(Qs,{kind:m,name:F,enabled:ce(p.data,"hub_updates")}),re&&e.jsx("output",{className:"mb-6 block max-w-3xl rounded-md border border-warning-border px-3 py-2 text-meta text-ink-muted",children:"The hub updated this definition while you were editing, and the form below now shows the merged version. Edits you had not saved were replaced."})]}),V=o.useCallback(m=>{if(G){$(m);return}g(m)},[G,g]);o.useEffect(()=>{const m=F=>{F.key!=="Escape"||F.defaultPrevented||window.matchMedia("(max-width: 999px)").matches&&(!u&&!l||(F.preventDefault(),V({name:null})))};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[V,u,l]),o.useEffect(()=>{const m=H.getState(),F=m.about;if(!F)return;const _e=i?"team":"agent";u&&F.kind===_e&&F.name===u||(A.setAbout(null),m.draft.trim()===`Change the ${F.kind} ${F.name}:`.trim()&&A.setDraft(""))},[u,i,A]),o.useEffect(()=>{u&&D({kind:i?"team":"agent",name:u})},[u,i,D]);const pe=()=>{r.refetch(),y.refetch(),b.refetch(),j.refetch()};if(s)return e.jsx(o.Suspense,{fallback:e.jsx("p",{className:"p-6 text-body",children:"Loading saved agent…"}),children:e.jsx(Zs,{})});const Ie=i?j.error:b.error,xe=i?y.error:r.error,ht=c&&!xe&&!l&&!u,ft=i?j.isLoading:b.isLoading;return e.jsxs("div",{className:"flex h-full min-h-0 bg-canvas text-ink",children:[e.jsxs("aside",{ref:t,"data-open":u?"true":void 0,className:"flex w-72 shrink-0 flex-col gap-3 bg-surface p-4 max-[999px]:data-[open=true]:hidden",children:[e.jsx("h1",{className:"text-heading",children:"Agents and teams"}),e.jsx(Kt,{value:i?"team":"agent",onValueChange:m=>V({kind:m,name:null}),children:e.jsxs(Gt,{"aria-label":"Browse definitions by type",className:"w-full",children:[e.jsxs(Me,{value:"agent",className:"flex-1","data-testid":"agents-tab",children:[e.jsx(Pt,{className:"size-3.5"}),"Agents",r.data?e.jsx("span",{className:"min-w-[2ch] font-normal text-ink-dim tabular-nums",children:r.data.length}):null]}),e.jsxs(Me,{value:"team",className:"flex-1","data-testid":"teams-tab",children:[e.jsx(Ct,{className:"size-3.5"}),"Teams",y.data?e.jsx("span",{className:"min-w-[2ch] font-normal text-ink-dim tabular-nums",children:y.data.length}):null]})]})}),e.jsxs("div",{className:"relative",children:[e.jsx(Et,{"aria-hidden":"true",className:"pointer-events-none absolute top-2 left-2 size-4 text-ink-dim"}),e.jsx(he,{className:"pl-8",type:"search","aria-label":"Search agents and teams",placeholder:i?"Search teams":"Search agents",value:d,onChange:m=>k(m.target.value)})]}),!i&&r.data?e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[e.jsx("span",{"aria-hidden":"true",className:"text-meta text-ink-muted",children:"Showing"}),e.jsxs("fieldset",{className:"m-0 min-w-0 border-0 p-0",children:[e.jsx("legend",{className:"sr-only",children:"Show definitions owned by"}),e.jsx("div",{className:"flex flex-wrap gap-0.5 rounded-md bg-sunken p-0.5",children:Object.keys(De).map(m=>e.jsx(N,{variant:"ghost",size:"sm","aria-pressed":T===m,onClick:()=>P(m),className:Q(T===m&&tt),children:De[m]},m))})]})]}):null,e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:xe?null:!r.data&&!y.data?e.jsx(Ms,{}):Z.length===0?e.jsx("p",{className:"px-1 py-2 text-body-sm text-ink-muted",children:d?`Nothing matches “${d}”.`:i?"No teams yet. Ask for one below, or add one by hand.":T==="all"?"No agents yet. Ask for one below, or add one by hand.":`No ${De[T].toLowerCase()} agents.`}):e.jsx(sn,{rows:Z,name:l?null:u,teamMode:i,printName:q,marked:new Map(U.map(m=>[ss(m),m.created])),onOpen:m=>V({name:m})})}),e.jsxs(N,{variant:"secondary",disabled:!c,onClick:()=>V({create:i?"team":"agent"}),children:[e.jsx(et,{className:"size-4"}),i?"Add team manually":"Add agent manually"]})]}),e.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[u||l?e.jsx("div",{className:"flex shrink-0 items-center border-hairline border-b px-4 py-2 min-[1000px]:hidden",children:e.jsxs(N,{variant:"ghost",size:"sm",onClick:()=>V({name:null}),children:[e.jsx(Bt,{className:"size-4"}),"Back to the list"]})}):null,e.jsx("div",{"data-agents-pane":!0,className:"min-h-0 flex-1 overflow-auto p-6 pb-0",style:C>0?{paddingBottom:C+16}:void 0,children:c?xe?e.jsx(He,{title:i?"Teams could not be read":"Agents could not be read",what:xe instanceof Error?xe.message:"The request did not complete.",meaning:"Nothing is lost. This is a read that failed — the backend answered an error, which is different from the backend being out of date.",onRetry:pe,retrying:r.isFetching||y.isFetching}):u&&ft?e.jsx(We,{}):u&&Ie?e.jsx(He,{title:i?`“${u}” could not be read`:`“${u}” could not be read`,what:Ie instanceof Error?Ie.message:"The request did not complete.",meaning:"The definition may have been removed, or the backend refused the read.",onRetry:()=>{b.refetch(),j.refetch()},retrying:b.isFetching||j.isFetching}):l&&i?e.jsx(Ge,{agents:r.data,teams:y.data,askEnabled:A.enabled,onDirtyChange:W,onSaved:m=>{pe(),g({name:m})},onCancelCreate:()=>g({name:null}),onOpenAgent:m=>V({kind:"agent",name:m}),onAskAgent:m=>{A.setAbout({kind:"team",name:h??""}),A.setDraft(m)}},"team:create"):l&&f&&E.isLoading?e.jsx(We,{}):l?e.jsx(Gs,{initial:E.data??null,takenNames:(r.data??[]).map(m=>m.name),effortTiers:z,onDirtyChange:W,onSaved:m=>{pe(),g({name:m})},onCancel:()=>g({name:null})},"agent:create"):i&&j.data?e.jsxs(e.Fragment,{children:[Fe("team",j.data.name),e.jsx(Ge,{team:j.data,agents:r.data,teams:y.data,askEnabled:A.enabled,onDirtyChange:W,onSaved:m=>{pe(),g({name:m})},onOpenAgent:m=>V({kind:"agent",name:m}),onAskAgent:m=>{A.setAbout({kind:"team",name:j.data?.name??""}),A.setDraft(m)}},`team:${j.data.name}:${ye(j.data)}`)]}):!i&&b.data?e.jsxs(e.Fragment,{children:[Fe("agent",b.data.name),e.jsx(Ks,{profile:b.data,displayedName:q(b.data.name),classNotice:S?.name===b.data.name?S.copy:null,onClassNotice:m=>M(m?{name:b.data.name,copy:m}:null),teams:y.data,effortTiers:z,askEnabled:A.enabled,onDirtyChange:W,onSaved:m=>{pe(),g({name:m})},onDuplicate:m=>V({create:"agent",duplicate:m.name}),onOpenTeam:m=>V({kind:"team",name:m}),onAskAgent:m=>{A.setAbout({kind:"agent",name:b.data?.name??""}),A.setDraft(m)}},`agent:${b.data.name}:${b.data.source}:${ye(b.data)}`)]}):u?e.jsx(de,{className:"h-6 w-40"}):e.jsx(tn,{teamMode:i,run:A,onAddManually:()=>V({create:i?"team":"agent"})}):e.jsxs(te,{variant:p.isLoading?"neutral":"warning",className:"max-w-xl",children:[e.jsx(se,{children:p.isLoading?"Connecting to the backend":p.error?"The backend could not be reached":"Reusable agents need a newer backend"}),e.jsx(ne,{children:p.isLoading?"Loading what this backend can do…":p.error?p.error.message:"Update the backend to manage reusable agents and teams. Saved chats are unchanged."})]})}),L?e.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-hairline border-t bg-surface px-4 py-3",role:"alertdialog","aria-label":"Discard your unsaved changes?",children:[e.jsx("span",{className:"text-body-sm text-ink",children:i?"Discard your unsaved changes to this team?":"Discard your unsaved changes to this agent?"}),e.jsx(N,{variant:"danger",onClick:()=>{x(null),g(L)},children:"Discard changes"}),e.jsx(N,{variant:"ghost",onClick:()=>$(null),children:"Keep editing"})]}):null,ht?null:e.jsx("div",{className:"shrink-0 border-hairline border-t bg-canvas p-4",children:e.jsx(rt,{run:A,about:A.about,onClearAbout:()=>A.setAbout(null),onStripHeightChange:O,blockedReason:G?"Finish or cancel your edit first.":null})})]})]})}function tn({teamMode:t,run:s,onAddManually:n}){return e.jsxs("div",{className:"max-w-xl space-y-4",children:[e.jsx("h2",{className:"text-title",children:t?"Ask for a team":"Ask for an agent"}),e.jsx("p",{className:"text-body text-ink-muted",children:t?"A team has one agent that leads the chat and members it can hand work to. Describe what you want and a configuration run sets it up.":"An agent is a reusable set of instructions you can start a chat with, or let other agents call on. Describe what you want and a configuration run sets it up."}),e.jsx(rt,{run:s,hero:!0,about:s.about,onClearAbout:()=>s.setAbout(null)}),e.jsx(N,{variant:"ghost",onClick:n,children:t?"Or add a team by hand":"Or add an agent by hand"})]})}function sn({rows:t,name:s,teamMode:n,marked:a,printName:i,onOpen:l}){const h=o.useRef(new Map),[f,p]=o.useState(s),c=(r,y)=>{const v=t.findIndex(j=>j.name===r);if(v<0)return;const b=t[Math.min(t.length-1,Math.max(0,v+y))];b&&(p(b.name),h.current.get(b.name)?.focus())};return e.jsx("ul",{"aria-label":n?"Teams":"Agents",className:"space-y-1",children:t.map(r=>{const y="source"in r,v=a.get(`${n?"team":"agent"}:${r.name}`);return e.jsx("li",{children:e.jsxs("button",{ref:b=>{b?h.current.set(r.name,b):h.current.delete(r.name)},type:"button","aria-current":r.name===s?"true":void 0,tabIndex:r.name===(f??t[0]?.name)?0:-1,"data-testid":`roster-row-${r.name}`,className:Q("flex min-h-11 w-full flex-col items-start gap-0.5 rounded-md px-2 py-1.5 text-left hover:bg-row-hover",r.name===s&&tt),onFocus:()=>p(r.name),onClick:()=>l(r.name),onKeyDown:b=>{b.key==="ArrowDown"?(b.preventDefault(),c(r.name,1)):b.key==="ArrowUp"?(b.preventDefault(),c(r.name,-1)):b.key==="Home"?(b.preventDefault(),c(r.name,-t.length)):b.key==="End"&&(b.preventDefault(),c(r.name,t.length))},children:[e.jsxs("span",{className:"flex w-full items-center gap-2",children:[e.jsx("span",{className:"truncate text-body-sm text-ink",children:"members"in r?Ze(r):i(r.name)}),y?e.jsx(lt,{source:r.source,appearance:"text"}):null,v!==void 0?e.jsx(_,{variant:"attention","data-testid":"roster-row-updated",children:v?"New":"Updated"}):null]}),e.jsxs("span",{className:"flex w-full flex-wrap items-center gap-1.5",children:["members"in r?e.jsx(_,{variant:"neutral",children:r.members.length===1?"1 member":`${r.members.length} members`}):null,y&&Ae(r)==="proactive"?e.jsx(_,{variant:"neutral","data-testid":"roster-row-proactive",children:bs.proactive}):null,r.description?e.jsx("span",{className:"min-w-0 flex-1 truncate text-meta text-ink-muted",children:r.description}):null]})]})},r.name)})})}function nn(t,s,n,a){const i=s.trim().toLowerCase();return(t??[]).filter(l=>n==="builtin"&&l.source!=="builtin"||n==="installed"&&l.source!=="installed"||n==="custom"&&l.source!=="custom"?!1:i?a(l.name).toLowerCase().includes(i)||l.name.toLowerCase().includes(i)||(l.description??"").toLowerCase().includes(i):!0)}function an(t,s){const n=s.trim().toLowerCase();return(t??[]).filter(a=>!n||a.name.toLowerCase().includes(n)||(a.label??"").toLowerCase().includes(n)||(a.description??"").toLowerCase().includes(n))}export{mn as AgentsPage};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-CSNQxVPq.js";import{B as o}from"./index-D09I1LXM.js";import"./conversation-input-sync-CGaXAqah.js";import"./ui-preferences-store-CxJfZcpf.js";import"./error-boundary-BR1z8pWF.js";import"./console-mirror-GUGtzmyW.js";const c=()=>r.jsx(o,{tabScope:"all",requestScope:"all",hostSessionId:null,surfaceTag:"browser-route",dockSurfaceTag:"browser-approvals-dock"});export{c as BrowserPage};
@@ -1 +0,0 @@
1
- import{U as a,C as n}from"./mermaid.core-eIMT1oSc.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-A2AXSNBT-CEEG3uIi.js";import{_ as i}from"./mermaid.core-eIMT1oSc.js";import"./chunk-RZ5BOZE2-znegx9P6.js";import"./conversation-input-sync-CGaXAqah.js";import"./ui-preferences-store-CxJfZcpf.js";import"./index-CSNQxVPq.js";import"./error-boundary-BR1z8pWF.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-A2AXSNBT-CEEG3uIi.js";import{_ as i}from"./mermaid.core-eIMT1oSc.js";import"./chunk-RZ5BOZE2-znegx9P6.js";import"./conversation-input-sync-CGaXAqah.js";import"./ui-preferences-store-CxJfZcpf.js";import"./index-CSNQxVPq.js";import"./error-boundary-BR1z8pWF.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
@@ -1 +0,0 @@
1
- import{b as r}from"./_baseUniq-B0peOdjF.js";var e=4;function a(o){return r(o,e)}export{a as c};