local-operator-ui 0.31.26 → 0.31.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/main/index.js +143 -3
- package/out/renderer/assets/{_basePickBy-D0wlCvva.js → _basePickBy-oM-LmypH.js} +1 -1
- package/out/renderer/assets/{_baseUniq-DPa_8DrG.js → _baseUniq-CfyEpPZd.js} +1 -1
- package/out/renderer/assets/{agent-details-page-CrARDEtK.js → agent-details-page-DIBks4X5.js} +1 -1
- package/out/renderer/assets/{agent-hub-page-tj8FYJ7M.js → agent-hub-page-oV4gEqC4.js} +2 -2
- package/out/renderer/assets/agents-page-CZrNPorc.js +7 -0
- package/out/renderer/assets/aida-control-CQx1CGx-.js +50 -0
- package/out/renderer/assets/{arc-BG4bHuQI.js → arc-DXJiD7SC.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-IEHRJDOE-CkYkkIY9.js → architectureDiagram-IEHRJDOE-VHM5BLyo.js} +1 -1
- package/out/renderer/assets/{blockDiagram-JOT3LUYC-D0DwK5Ey.js → blockDiagram-JOT3LUYC-Cn1dvDZU.js} +1 -1
- package/out/renderer/assets/{book-open-DeQc_I6g.js → book-open-P6KBj9Du.js} +1 -1
- package/out/renderer/assets/browser-page-D6eiItUp.js +1 -0
- package/out/renderer/assets/{browser-webauthn-prompt-CYou_6QY.js → browser-webauthn-prompt-CByfVm08.js} +1 -1
- package/out/renderer/assets/{c4Diagram-VJAJSXHY-CubzqfYr.js → c4Diagram-VJAJSXHY-B8F1XGHT.js} +1 -1
- package/out/renderer/assets/channel-DZQWNfux.js +1 -0
- package/out/renderer/assets/{chunk-4BMEZGHF-AysrzODh.js → chunk-4BMEZGHF-CVoXO2u6.js} +1 -1
- package/out/renderer/assets/{chunk-A2AXSNBT-DfDo-OSy.js → chunk-A2AXSNBT-LFo0s6P7.js} +1 -1
- package/out/renderer/assets/{chunk-AEK57VVT-5xgHbFtp.js → chunk-AEK57VVT-B8s36YJo.js} +1 -1
- package/out/renderer/assets/{chunk-D6G4REZN-pYCMpQiN.js → chunk-D6G4REZN-BKkRpyOx.js} +1 -1
- package/out/renderer/assets/{chunk-RZ5BOZE2-C5bWxzka.js → chunk-RZ5BOZE2-qoB87AlE.js} +1 -1
- package/out/renderer/assets/{chunk-XZIHB7SX-B4wB3iEG.js → chunk-XZIHB7SX-BACgoEDe.js} +1 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-jw9F6ZK-.js +1 -0
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-jw9F6ZK-.js +1 -0
- package/out/renderer/assets/clone-DzWAH3PE.js +1 -0
- package/out/renderer/assets/{console-mirror-45f9-7QH.js → console-mirror-fXJ5fMxl.js} +1 -1
- package/out/renderer/assets/{consoleCapture-GiahzrSM.js → consoleCapture-Df4uIOqu.js} +1 -1
- package/out/renderer/assets/{dagre-OKDRZEBW-CBRdPb8k.js → dagre-OKDRZEBW-CLMw1D7m.js} +1 -1
- package/out/renderer/assets/{diagram-SSKATNLV-DyGZgIL1.js → diagram-SSKATNLV-plMydQ5N.js} +1 -1
- package/out/renderer/assets/{diagram-VNBRO52H-Con45RzE.js → diagram-VNBRO52H-BptPse7H.js} +1 -1
- package/out/renderer/assets/{erDiagram-Q7BY3M3F-Cpuc-IVT.js → erDiagram-Q7BY3M3F-CGjlhqbg.js} +1 -1
- package/out/renderer/assets/{error-boundary-CdtTgj_c.js → error-boundary-D3Um1PIl.js} +1 -1
- package/out/renderer/assets/{flowDiagram-4HSFHLVR-CsO4ubSn.js → flowDiagram-4HSFHLVR-rb1I18B8.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-APWFNJXF-LYPPAOmY.js → ganttDiagram-APWFNJXF-D-bSpERZ.js} +3 -3
- package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-BO_dix1Z.js → gitGraphDiagram-7IBYFJ6S-DDJQIXgd.js} +1 -1
- package/out/renderer/assets/{graph-uBeiISg2.js → graph-BkNT14na.js} +1 -1
- package/out/renderer/assets/{index-Bi4c5ZZH.js → index-BXamXVGw.js} +1 -1
- package/out/renderer/assets/{index-COUHPq03.js → index-D3ICBbhi.js} +514 -405
- package/out/renderer/assets/{index-CIj3B-eB.js → index-DHcQTmYa.js} +1 -1
- package/out/renderer/assets/index-DuUnXH9L.css +1 -0
- package/out/renderer/assets/{index-Dn3kYWFt.js → index-_dbvHdgc.js} +9 -9
- package/out/renderer/assets/infoDiagram-PH2N3AL5-Bg2dnJEw.js +2 -0
- package/out/renderer/assets/{installer-zpOWwoWQ.js → installer-D-IQpqXR.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-U35MCT3I-B6AH0Dcn.js → journeyDiagram-U35MCT3I-B5bji5kb.js} +1 -1
- package/out/renderer/assets/{kanban-definition-NDS4AKOZ-C7dciPrH.js → kanban-definition-NDS4AKOZ-BGi8PMEB.js} +1 -1
- package/out/renderer/assets/{layout-hxpgEDIm.js → layout-D3rwe0Wt.js} +1 -1
- package/out/renderer/assets/{legacy-agents-page-C6kd3fjG.js → legacy-agents-page-DnpWTuf8.js} +4 -4
- package/out/renderer/assets/{mermaid.core-CC8CflzC.js → mermaid.core-CHiYins7.js} +5 -5
- package/out/renderer/assets/mesh-page-B2_ZtHTQ.js +1 -0
- package/out/renderer/assets/{mindmap-definition-ALO5MXBD-BWI1IBWM.js → mindmap-definition-ALO5MXBD-BwO55Ck2.js} +1 -1
- package/out/renderer/assets/{mini-Dtj-bCUA.js → mini-D7VYY0xP.js} +1 -1
- package/out/renderer/assets/{org-surface-gate-CjPxDSXP.js → org-surface-gate-Da1VmZbG.js} +1 -1
- package/out/renderer/assets/{page-header-Dt6h8jvu.js → page-header-B3kbzqCp.js} +1 -1
- package/out/renderer/assets/{pieDiagram-IB7DONF6-DNymJR3P.js → pieDiagram-IB7DONF6-j0i7dQ2D.js} +1 -1
- package/out/renderer/assets/{projects-page-C3N6NYIX.js → projects-page-f-tkHojn.js} +9 -9
- package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-bRmQaOWY.js → quadrantDiagram-7GDLP6J5-BZkLgvoE.js} +1 -1
- package/out/renderer/assets/{radar-MK3ICKWK-B1I3333M.js → radar-MK3ICKWK-QB0E4nFC.js} +1 -1
- package/out/renderer/assets/{radient-auth-buttons-CCXHTNWU.js → radient-auth-buttons-2wnsv7f6.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-KVF5MWMF-B29w6CHz.js → requirementDiagram-KVF5MWMF-Cb1rqfe3.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-BNv_qf23.js → sankeyDiagram-QLVOVGJD-ST_5m9Zy.js} +1 -1
- package/out/renderer/assets/{schedules-page-CXz63fN5.js → schedules-page-DnHKOQij.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-D7gyUvnw.js → sequenceDiagram-X6HHIX6F-Bh-yCDC0.js} +1 -1
- package/out/renderer/assets/{settings-page-CsCf63si.js → settings-page-D1dF4GZE.js} +8 -8
- package/out/renderer/assets/{settings-section-DMXSpP_D.js → settings-section-C9etJXA9.js} +1 -1
- package/out/renderer/assets/{stateDiagram-DGXRK772-Dd3BswSO.js → stateDiagram-DGXRK772-D6MGh56o.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-Dvv5Bcoz.js +1 -0
- package/out/renderer/assets/{textarea-DsHM-W2p.js → textarea-DeXGhzIK.js} +2 -2
- package/out/renderer/assets/{timeline-definition-BDJGKUSR-MePOCWzB.js → timeline-definition-BDJGKUSR-pgK_gxyk.js} +1 -1
- package/out/renderer/assets/ui-preferences-store-BLiDaCIL.js +1 -0
- package/out/renderer/assets/{use-download-agent-mutation-BNAfnIa9.js → use-download-agent-mutation-CXw_g4Rv.js} +3 -3
- package/out/renderer/assets/{use-memberships-query-PWqngUAl.js → use-memberships-query-BGPQ6jDl.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-VJFVF3MP-heZP1JY-.js → xychartDiagram-VJFVF3MP-CYYxIZAM.js} +1 -1
- package/out/renderer/console-capture.html +5 -5
- package/out/renderer/index.html +8 -8
- package/out/renderer/installer.html +5 -5
- package/out/renderer/mini.html +6 -6
- package/package.json +3 -3
- package/out/renderer/assets/agents-page-CbQN_5wE.js +0 -7
- package/out/renderer/assets/aida-control-BuMafqCb.js +0 -50
- package/out/renderer/assets/browser-page-CIhGr6vl.js +0 -1
- package/out/renderer/assets/channel-B-eIVFbM.js +0 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-BN6aG5Qf.js +0 -1
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-BN6aG5Qf.js +0 -1
- package/out/renderer/assets/clone-C3CHGd7j.js +0 -1
- package/out/renderer/assets/index-D8ujEXbz.css +0 -1
- package/out/renderer/assets/infoDiagram-PH2N3AL5-BqRYyG2a.js +0 -2
- package/out/renderer/assets/mesh-page-M4Y20e0t.js +0 -2
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-D9cOpOSm.js +0 -1
- package/out/renderer/assets/ui-preferences-store-BmAT9G_p.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as l,p as
|
|
1
|
+
import{c as l,p as R}from"./textarea-DeXGhzIK.js";import{t as j,c as F,n as K,b as _,g as Q,f as U,h as z,i as S,j as N,a as v}from"./en-US-BcB1DWxG.js";import{j as r,c as g,r as V}from"./index-_dbvHdgc.js";import{bP as q,bQ as B,bf as O,bR as P,bS as Y,Z as k,_ as w,a3 as Z,$ as D,bl as G,bT as I,bm as W}from"./index-D3ICBbhi.js";import{B as X}from"./book-open-P6KBj9Du.js";import{j as J,k as ee,m as te,n as ae,o as ne,q as se,r as oe}from"./use-memberships-query-BGPQ6jDl.js";import{B as ie,u as b,f as C}from"./aida-control-CQx1CGx-.js";/**
|
|
2
2
|
* @license lucide-react v0.507.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -53,9 +53,9 @@ import{c as l,p as F}from"./textarea-DsHM-W2p.js";import{t as j,c as R,n as K,b
|
|
|
53
53
|
*
|
|
54
54
|
* This source code is licensed under the ISC license.
|
|
55
55
|
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const ze=[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]],
|
|
56
|
+
*/const ze=[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]],Se=l("scale",ze);/**
|
|
57
57
|
* @license lucide-react v0.507.0 - ISC
|
|
58
58
|
*
|
|
59
59
|
* This source code is licensed under the ISC license.
|
|
60
60
|
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const
|
|
61
|
+
*/const Ne=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],ve=l("shopping-cart",Ne);function De(e,t){const o=+j(e)-+j(t);return o<0?-1:o>0?1:o}function Ce(e){return F(e,Date.now())}function $e(e){return t=>{const a=(e?Math[e]:Math.trunc)(t);return a===0?0:a}}function qe(e,t,o){const a=Q(),n=o?.locale??a.locale??U,s=De(e,t);if(isNaN(s))throw new RangeError("Invalid time value");const i=Object.assign({},o,{addSuffix:o?.addSuffix,comparison:s}),[h,m]=K(o?.in,...s>0?[t,e]:[e,t]),d=$e("round"),x=m.getTime()-h.getTime(),f=x/v,E=_(m)-_(h),y=(x-E)/v,H=o?.unit;let u;if(f<1?u="second":f<60?u="minute":f<z?u="hour":y<S?u="day":y<N?u="month":u="year",u==="second"){const c=d(x/1e3);return n.formatDistance("xSeconds",c,i)}else if(u==="minute"){const c=d(f);return n.formatDistance("xMinutes",c,i)}else if(u==="hour"){const c=d(f/60);return n.formatDistance("xHours",c,i)}else if(u==="day"){const c=d(y/z);return n.formatDistance("xDays",c,i)}else if(u==="month"){const c=d(y/S);return c===12&&H!=="month"?n.formatDistance("xYears",1,i):n.formatDistance("xMonths",c,i)}else{const c=d(y/N);return n.formatDistance("xYears",c,i)}}function Ve(e,t){return qe(e,Ce(e),t)}const L={investment:{icon:r.jsx(ce,{size:14,"aria-hidden":"true"}),label:"Investment"},accounting:{icon:r.jsx(X,{size:14,"aria-hidden":"true"}),label:"Accounting"},healthcare:{icon:r.jsx(Me,{size:14,"aria-hidden":"true"}),label:"Healthcare"},legal:{icon:r.jsx(Se,{size:14,"aria-hidden":"true"}),label:"Legal"},software:{icon:r.jsx(Y,{size:14,"aria-hidden":"true"}),label:"Software"},security:{icon:r.jsx(P,{size:14,"aria-hidden":"true"}),label:"Security"},role_play:{icon:r.jsx(O,{size:14,"aria-hidden":"true"}),label:"Role play"},personal_assistance:{icon:r.jsx(B,{size:14,"aria-hidden":"true"}),label:"Personal assistance"},education:{icon:r.jsx(we,{size:14,"aria-hidden":"true"}),label:"Education"},marketing:{icon:r.jsx(_e,{size:14,"aria-hidden":"true"}),label:"Marketing"},sales:{icon:r.jsx(ve,{size:14,"aria-hidden":"true"}),label:"Sales"},research:{icon:r.jsx(xe,{size:14,"aria-hidden":"true"}),label:"Research"},analysis:{icon:r.jsx(ue,{size:14,"aria-hidden":"true"}),label:"Analysis"},management:{icon:r.jsx(he,{size:14,"aria-hidden":"true"}),label:"Management"},social_media:{icon:r.jsx(fe,{size:14,"aria-hidden":"true"}),label:"Social media"},other:{icon:r.jsx(ge,{size:14,"aria-hidden":"true"}),label:"Other"}};function p(e){const t=e.split("_").join(" ");return t.charAt(0).toUpperCase()+t.slice(1)}const Oe=e=>L[e]??{icon:r.jsx(q,{size:14,"aria-hidden":"true"}),label:p(e)},$="inline-flex min-h-5.5 items-center rounded-full border border-hairline bg-sunken px-2 text-meta leading-none",Be=({tags:e,categories:t,className:o})=>{if((!e||e.length===0)&&(!t||t.length===0))return null;const a=new Set((t??[]).map(s=>(L[s]?.label??p(s)).toLowerCase())),n=(e??[]).filter(s=>!a.has(p(s).toLowerCase()));return r.jsxs("div",{className:g("relative flex flex-wrap items-center gap-1.5 overflow-hidden",o),"data-testid":"agent-tags-and-categories",children:[t?.map(s=>{const i=Oe(s);return r.jsxs("span",{className:g($,"gap-1 font-medium text-ink-muted"),children:[i.icon,i.label]},s)}),n.map(s=>r.jsxs("span",{className:g($,"gap-1 font-normal text-ink-dim"),children:[r.jsx(q,{size:12,"aria-hidden":"true"}),p(s)]},s))]})},Pe=({orgName:e,className:t})=>r.jsxs(R,{variant:"neutral",className:g("gap-1",t),"data-testid":"agent-org-badge",title:e?`Shared with ${e}, not the public hub`:"Shared with an organization, not the public hub",children:[r.jsx(O,{"aria-hidden":"true"}),e??"Organization"]}),M={all:["agent-statuses"],page:e=>[...M.all,"page",[...e]]},Ie=e=>[...new Set(e)].sort(),Ye=({agentIds:e,enabled:t=!0})=>{const{isAuthenticated:o}=k(),a=e.join(","),n=V.useMemo(()=>Ie(e),[a]),s=ie({queryKey:M.page(n),queryFn:async()=>(await J(n)).result?.statuses??{},enabled:t&&o&&n.length>0,staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!1,retry:!1});return{...s,statuses:s.data??{},isKnown:s.isSuccess}},Ze=(e,t,o)=>o?e&&t[o]!==void 0:!1,T=(e,t,o)=>{e.setQueriesData({queryKey:M.all},a=>{if(!a)return a;const n=a[t]??{liked:!1,favourited:!1};return{...a,[t]:{...n,...o}}})},A=(e,{agentId:t,field:o,delta:a})=>{e.setQueriesData({queryKey:ee.all},n=>{if(!n)return n;const s=n.result?.records??[];return s.some(i=>i.id===t)?{...n,result:{...n.result,records:s.map(i=>i.id===t?{...i,[o]:Math.max(0,(i[o]??0)+a)}:i)}}:n})},Ge=()=>{const e=b(),{isAuthenticated:t}=k();return w({mutationFn:async({agentId:a,isCurrentlyFavourited:n})=>{if(!t)throw new Error("Authentication required to favourite/unfavourite an agent.");if(!a)throw new Error("Agent ID is required.");return n?(await te(a),{favourited:!1,changed:!0}):{favourited:!0,changed:(await ae(a)).result?.already_favourited!==!0}},onSuccess:({favourited:a,changed:n},s)=>{T(e,s.agentId,{favourited:a}),n&&A(e,{agentId:s.agentId,field:"favourite_count",delta:a?1:-1})}})},We=()=>{const e=b(),{isAuthenticated:t}=k();return w({mutationFn:async({agentId:a,isCurrentlyLiked:n})=>{if(!t)throw new Error("Authentication required to like/unlike an agent.");if(!a)throw new Error("Agent ID is required.");return n?(await ne(a),{liked:!1,changed:!0}):{liked:!0,changed:(await se(a)).result?.already_liked!==!0}},onSuccess:({liked:a,changed:n},s)=>{T(e,s.agentId,{liked:a}),n&&A(e,{agentId:s.agentId,field:"like_count",delta:a?1:-1})}})},Le=(e,t)=>{const o=[];for(const[,a]of e.getQueriesData({queryKey:I}))for(const n of a?.agents??[])n.id!==t&&o.push(n.name);return o},Xe=()=>{const e=b(),t=Z();return w({mutationFn:async({agentId:a})=>{if(!C.baseUrl)throw new Error("Local Operator API URL is not configured.");return W.downloadAgentFromRadient(C.baseUrl,a)},onSuccess:(a,n)=>{const s=a.result,i=s?.name?.trim()||n.agentName?.trim()||"Agent",h=s?.renamed_from?.trim()||null,m=s?.id?oe(i,Le(e,s.id)):null;h?D(`Downloaded "${i}" — you already have an agent called "${h}".`):m?G(`Downloaded "${i}". You already have an agent called "${m}", so two agents now answer to that name and either may be picked. Rename one of them.`):D(`Downloaded "${i}" from the hub.`),e.invalidateQueries({queryKey:I}),A(e,{agentId:n.agentId,field:"download_count",delta:1});const d=a.result;d?.id?t(`/chat/${d.id}`):console.warn("Downloaded agent ID not found in response, cannot navigate to chat.")}})};export{Be as A,L as C,Ue as H,Pe as O,We as a,Ge as b,Xe as c,Oe as d,qe as e,Ve as f,Ze as i,Ye as u};
|
package/out/renderer/assets/{use-memberships-query-PWqngUAl.js → use-memberships-query-BGPQ6jDl.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as v,y as A,z as h,P as $,B as _,C as w,E as I,F as R,G as q,H as L}from"./aida-control-BuMafqCb.js";import{V as P,W as N,X as S,Y as r,Z as k}from"./index-COUHPq03.js";const f={malware_or_exploitation:"Instructions to build or spread malware, or to attack systems you do not own, cannot be published.",credential_theft:"Instructions to obtain someone else's credentials or tokens cannot be published.",fraud_or_deception:"Instructions to deceive or defraud people cannot be published.",harassment_or_hate:"Instructions to harass, threaten or target people cannot be published.",sexual_content_minors:"This agent cannot be published. If you believe this is a mistake, contact support.",sexual_content:"Explicit sexual content cannot be published.",violence_or_weapons:"Instructions to build weapons or to injure people cannot be published.",drugs_or_controlled_substances:"Instructions to make or traffic illegal drugs cannot be published.",self_harm:"This agent cannot be published. If you believe this is a mistake, contact support.",mass_surveillance_or_privacy_abuse:"Instructions to surveil or profile people without their consent cannot be published.",evasion_or_abuse_tooling:"Instructions to evade or defeat safety and anti-abuse systems cannot be published.",prompt_injection:"This instruction set tries to instruct the reviewer rather than describe an agent, so it cannot be published.",unclear_dual_use:"We could not tell whether this is aimed at your own systems or someone else's. Add a sentence stating the scope and target, then publish again.",other_harmful:"This agent was rejected because its instructions would cause harm."},E=e=>{const n=e.trim();return n.length>12&&/\s/.test(n)&&!/^(not found|bad request|unauthorized|error|internal server error)\.?$/i.test(n)};function O(e){const n=e?.categories?.[0];return n&&S(n)?f[n]:f.other_harmful}function C(e,n){const t=n?.rule?` ${n.rule}`:"";switch(n?.field){case"name":return{body:`Name${t||" is not acceptable"}.`,field:"name"};case"instructions":return{body:t?`The instruction body${t}.`:`The instruction body must be between 1 and ${$} characters.`,field:"instructions"};case"description":return{body:`Description${t}.`,field:"description"};case"tools":return{body:`Tools${t}.`,field:"tools"};case"when_to_use":return{body:`When to use${t}.`,field:"when_to_use"};case"categories":return{body:`Categories${t}.`,field:"categories"};case"tags":return{body:`Tags${t}.`,field:"tags"};default:return{body:e,field:null}}}function V(e,n){const t=n.surface==="pull",a=t?"Nothing was pulled.":"Nothing was published.",o=t?"pull again":"publish again",i=n.name.trim()||(t?"this team":"this agent");switch(e.code){case"name_taken":return e.details?.owned_by_caller===!0?{variant:"danger",headline:"You already published this agent",body:`You published "${i}" already. Update that listing instead of publishing a second one.`,note:null,actions:e.details?.existing_agent_id||n.hubAgentId?["update-listing","focus-name"]:["focus-name"]}:{variant:"danger",headline:"That name is taken",body:`"${i}" is already published on the hub by another account. Agent names are unique across the hub.`,note:null,actions:["focus-name"]};case"name_claim_in_flight":return{variant:"warning",headline:"That name is being published right now",body:`Someone is publishing an agent called "${i}" at this moment. It is not claimed — try again in a moment.`,note:null,actions:["retry"]};case"name_reserved_builtin":{const s=e.details?.builtin_name,d=s?h(s)===h(i):!1;return{variant:"danger",headline:"That name is reserved",body:s&&!d?`"${i}" is reserved by the built-in agent "${s}". Built-in names cannot be published to the hub.`:`"${s??i}" is the name of a built-in agent. Built-in names cannot be published to the hub.`,note:null,actions:["focus-name","install-builtin"]}}case"moderation_rejected":return{variant:"danger",headline:"This agent was not accepted",body:e.details?.reason?.trim()||e.message,note:O(e.details),actions:["edit-instructions"]};case"moderation_unavailable":return{variant:"warning",headline:"Review is temporarily unavailable",body:"We could not review this agent just now. Nothing was published. Try again in a minute.",note:null,actions:["retry"]};case"invalid_instruction_set":{const{body:s,field:d}=C(e.message,e.details);return{variant:"danger",headline:"The agent document is not valid",body:s,note:null,actions:d==="name"?["focus-name"]:d==="instructions"?["edit-instructions"]:["edit-agent"]}}case"payload_too_large":{const s=e.details?.limit_bytes;return{variant:"danger",headline:"This agent is too large to publish",body:s?`The instruction set is larger than ${Math.round(s/1024)} KiB. Shorten the instructions.`:"The instruction set is larger than the hub accepts. Shorten the instructions.",note:null,actions:["edit-instructions"]}}case"not_owner":return{variant:"danger",headline:"You cannot update this listing",body:"This listing belongs to another account.",note:null,actions:["publish-as-new"]};case"agent_not_found":return{variant:"danger",headline:"That listing no longer exists",body:"It may have been delisted.",note:null,actions:["publish-as-new","refresh-hub"]};case"hub_unauthorized":return{variant:"danger",headline:"The hub refused this machine's sign-in",body:`${a} Sign in to Radient again to replace the credential the hub refused, then ${o}.`,note:null,actions:["sign-in"]};case"hub_unavailable":return{variant:"warning",headline:t?"The pull did not go through":"The publication did not go through",body:E(e.message)?e.message:`${a} Try again in a moment, or update the backend if the hub has moved.`,note:null,actions:["retry"]};case"local_failure":return{variant:"warning",headline:t?"The team could not be pulled from this machine":"The agent could not be published from this machine",body:e.message,note:null,actions:["retry"]};case"team_plan_required":return{variant:"warning",headline:"That organization needs an active Team plan",body:t?"Reading an organization's teams is part of the Team plan. Ask an owner of the organization to activate it in the Radient console, then pull again.":"Sharing agents inside an organization is part of the Team plan. Ask an owner of the organization to activate it in the Radient console, then publish again.",note:null,actions:["retry"]};case"not_a_member":return{variant:"danger",headline:"You are not a member of that organization",body:`${a} Ask an owner of the organization to invite you, then ${o}.`,note:null,actions:[]};case"insufficient_role":{const s=e.details?.required;return{variant:"danger",headline:"Your organization role does not allow this",body:s?`${t?"Reading an organization's teams needs":"Publishing into an organization needs"} the ${s} role. Ask an owner of the organization to change your role, then ${o}.`:`${t?"Reading an organization's teams needs":"Publishing into an organization needs"} a higher role than yours. Ask an owner of the organization to change your role, then ${o}.`,note:null,actions:[]}}case"team_not_found":return{variant:"danger",headline:"That team is no longer published",body:"It may have been delisted since this page was loaded.",note:null,actions:["refresh-hub"]};default:return{variant:"danger",headline:"The agent could not be published",body:e.message,note:null,actions:["retry"]}}}const z=[/^(?:Download agent from Radient failed: )?(?:Error downloading agent from Radient: )?\s*/,/^Failed to download agent(?: [^\s]+)? from Radient Agent Hub(?: due to a requests error)?:\s*/,/^[A-Za-z_][\w.]*\([^)]*\):\s*/],U=/^(\d{3})\b/,F=new Set([404,410]),j=["read timed out","connection timed out","connection refused","connection aborted","connection reset","connectionerror","connecttimeout","remote end closed connection","max retries exceeded","temporary failure in name resolution","name or service not known","no route to host"],x=e=>{const n=e.toLowerCase();return j.some(t=>n.includes(t))||N(e)},B=(e,n)=>{const t=n.trim()?`"${n.trim()}"`:"That agent";if(P(e))switch(e.code){case"agent_not_found":return`${t} is no longer on the hub, so nothing was downloaded.`;case"hub_unavailable":return`The hub did not complete the download, so ${t} was not downloaded.`;default:return`${t} was not downloaded: ${e.message}`}const a=z.reduce((i,s)=>i.replace(s,""),A(e,"").trim()).trim();if(!a)return`${t} could not be downloaded.`;const o=Number(U.exec(a)?.[1]??Number.NaN);return F.has(o)?`${t} is no longer on the hub, so nothing was downloaded.`:x(a)||o===408?`The hub could not be reached, so ${t} was not downloaded.`:o===429?`The hub is busy, so ${t} was not downloaded. Try again in a moment.`:o===401||o===403?`The hub refused this machine's sign-in, so ${t} was not downloaded.`:o>=500?`The hub could not complete the download, so ${t} was not downloaded. Try again in a moment.`:o>=400?`The hub refused the download, so ${t} is not here.`:`${t} was not downloaded: ${a}`},D="The action did not complete.",J=(e,n,t)=>e==="download"?B(n,t):v(D,n),ee={"focus-name":"Choose another name","update-listing":"Update the existing listing","install-builtin":"Install the built-in instead",retry:"Try again","edit-instructions":"Edit the instructions","edit-agent":"Edit the agent","publish-as-new":"Publish as a new listing","sign-in":"Sign in again","refresh-hub":"Refresh the hub"};function c(){return crypto.randomUUID()}async function K(e=1,n=20,t){const a={page:e,per_page:n};if(t)for(const[o,i]of Object.entries(t))i&&(a[o]=i);return r({operation:"agents.list",query:a})}async function ne(e){return r({operation:"agents.get",agentId:e})}async function te(e){return r({operation:"agents.delete",agentId:e,requestId:c(),confirmed:!0})}async function ae(e){return r({operation:"agents.like",agentId:e,requestId:c()})}async function oe(e){return r({operation:"agents.unlike",agentId:e,requestId:c(),confirmed:!0})}async function se(e){return r({operation:"agents.favourite",agentId:e,requestId:c()})}async function ie(e){return r({operation:"agents.unfavourite",agentId:e,requestId:c(),confirmed:!0})}async function re(e,n){return r({operation:"comments.create",agentId:e,payload:n,requestId:c()})}async function ue(e,n=1,t=20){return r({operation:"comments.list",agentId:e,query:{page:n,per_page:t}})}async function le(e,n,t){return r({operation:"comments.update",agentId:e,commentId:n,payload:t,requestId:c()})}async function ce(e,n){return r({operation:"comments.delete",agentId:e,commentId:n,requestId:c(),confirmed:!0})}async function de(e){return r({operation:"agents.statuses",query:{agent_ids:e.join(",")}})}async function M(){return r({operation:"memberships.list"})}async function W(e,n=1,t=20,a){const o={page:n,per_page:t};if(a)for(const[i,s]of Object.entries(a))s&&(o[i]=s);return r({operation:"org_agents.list",tenantId:e,query:o})}async function he(e){return r({operation:"org_teams.list",tenantId:e})}const Y="download_count",b={all:["public-agents"],list:e=>[...b.all,"list",{page:e.page,perPage:e.perPage,categories:e.categories?.join(",")??void 0,name:e.name??void 0,description:e.description??void 0,sort:e.sort,order:e.order}]},m={all:["org-agents"],list:(e,n)=>[...m.all,"list",e,{page:n.page,perPage:n.perPage,categories:n.categories?.join(",")??void 0,name:n.name??void 0,description:n.description??void 0,sort:n.sort,order:n.order}]},Q=e=>e&&e[0]===m.all[0]?String(e[2]??""):null,ge=e=>e.invalidateQueries({queryKey:b.all}),me=(e,n)=>e.invalidateQueries({queryKey:n?[...m.all,"list",n]:m.all}),be=({page:e=1,perPage:n=20,enabled:t=!0,categories:a,name:o,description:i,sort:s=Y,order:d="desc",tenantId:g}={})=>{const p={page:e,perPage:n,categories:a,name:o,description:i,sort:s,order:d},T=g?m.list(g,p):b.list(p),l=_({queryKey:T,queryFn:async()=>{const u={};return a&&a.length>0&&(u.categories=a.join(",")),o&&(u.name=o),i&&(u.description=i),u.sort=s,u.order=d,g?await W(g,e,n,u):await K(e,n,u)},select:u=>u.result,enabled:t,retry:w,staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!1,placeholderData:(u,y)=>Q(y?.queryKey)===(g??null)?u:void 0});return{...l,agents:l.data?.records,isRefreshing:l.isFetching&&l.data!==void 0,pagination:l.data?{page:l.data.page,perPage:l.data.per_page,totalPages:l.data.total_pages,totalRecords:l.data.total_records}:void 0}},H={name:"Name",description:"Description",instructions:"The instruction body",tools:"Tools"};function pe(e){const n=[],t=(a,o)=>{o&&n.push({field:a,message:`${H[a]} ${o}.`})};return t("name",I(e.name)),t("description",R(e.description)),e.instructions!==null&&t("instructions",q(e.instructions)),t("tools",L(e.tools??[])),n}function ye(e,n){const t=h(e);return n.some(a=>h(a)===t)}function fe(e){for(const n of e??[]){const t=n.indexOf(":");if(t<0||n.slice(0,t).trim().toLowerCase()!=="tools")continue;const a=n.slice(t+1).split(",").map(o=>o.trim()).filter(Boolean);return a.length>0?a:null}return null}function _e(e,n){const t=h(e);return n.find(a=>h(a)===t)??null}const G={all:["memberships"]},we=({enabled:e=!0}={})=>{const{isAuthenticated:n}=k(),t=_({queryKey:G.all,queryFn:async()=>(await M()).result??{memberships:[]},enabled:e&&n,staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!1,retry:w});return{...t,memberships:t.data?.memberships??[]}};export{ee as P,te as a,we as b,re as c,ce as d,J as e,he as f,ne as g,be as h,ge as i,de as j,b as k,ue as l,ie as m,se as n,oe as o,V as p,ae as q,_e as r,me as s,ye as t,le as u,pe as v,fe as w};
|
|
1
|
+
import{x as v,y as A,z as h,P as $,B as _,C as w,E as I,F as R,G as q,H as L}from"./aida-control-CQx1CGx-.js";import{V as P,W as N,X as S,Y as r,Z as k}from"./index-D3ICBbhi.js";const f={malware_or_exploitation:"Instructions to build or spread malware, or to attack systems you do not own, cannot be published.",credential_theft:"Instructions to obtain someone else's credentials or tokens cannot be published.",fraud_or_deception:"Instructions to deceive or defraud people cannot be published.",harassment_or_hate:"Instructions to harass, threaten or target people cannot be published.",sexual_content_minors:"This agent cannot be published. If you believe this is a mistake, contact support.",sexual_content:"Explicit sexual content cannot be published.",violence_or_weapons:"Instructions to build weapons or to injure people cannot be published.",drugs_or_controlled_substances:"Instructions to make or traffic illegal drugs cannot be published.",self_harm:"This agent cannot be published. If you believe this is a mistake, contact support.",mass_surveillance_or_privacy_abuse:"Instructions to surveil or profile people without their consent cannot be published.",evasion_or_abuse_tooling:"Instructions to evade or defeat safety and anti-abuse systems cannot be published.",prompt_injection:"This instruction set tries to instruct the reviewer rather than describe an agent, so it cannot be published.",unclear_dual_use:"We could not tell whether this is aimed at your own systems or someone else's. Add a sentence stating the scope and target, then publish again.",other_harmful:"This agent was rejected because its instructions would cause harm."},E=e=>{const n=e.trim();return n.length>12&&/\s/.test(n)&&!/^(not found|bad request|unauthorized|error|internal server error)\.?$/i.test(n)};function O(e){const n=e?.categories?.[0];return n&&S(n)?f[n]:f.other_harmful}function C(e,n){const t=n?.rule?` ${n.rule}`:"";switch(n?.field){case"name":return{body:`Name${t||" is not acceptable"}.`,field:"name"};case"instructions":return{body:t?`The instruction body${t}.`:`The instruction body must be between 1 and ${$} characters.`,field:"instructions"};case"description":return{body:`Description${t}.`,field:"description"};case"tools":return{body:`Tools${t}.`,field:"tools"};case"when_to_use":return{body:`When to use${t}.`,field:"when_to_use"};case"categories":return{body:`Categories${t}.`,field:"categories"};case"tags":return{body:`Tags${t}.`,field:"tags"};default:return{body:e,field:null}}}function V(e,n){const t=n.surface==="pull",a=t?"Nothing was pulled.":"Nothing was published.",o=t?"pull again":"publish again",i=n.name.trim()||(t?"this team":"this agent");switch(e.code){case"name_taken":return e.details?.owned_by_caller===!0?{variant:"danger",headline:"You already published this agent",body:`You published "${i}" already. Update that listing instead of publishing a second one.`,note:null,actions:e.details?.existing_agent_id||n.hubAgentId?["update-listing","focus-name"]:["focus-name"]}:{variant:"danger",headline:"That name is taken",body:`"${i}" is already published on the hub by another account. Agent names are unique across the hub.`,note:null,actions:["focus-name"]};case"name_claim_in_flight":return{variant:"warning",headline:"That name is being published right now",body:`Someone is publishing an agent called "${i}" at this moment. It is not claimed — try again in a moment.`,note:null,actions:["retry"]};case"name_reserved_builtin":{const s=e.details?.builtin_name,d=s?h(s)===h(i):!1;return{variant:"danger",headline:"That name is reserved",body:s&&!d?`"${i}" is reserved by the built-in agent "${s}". Built-in names cannot be published to the hub.`:`"${s??i}" is the name of a built-in agent. Built-in names cannot be published to the hub.`,note:null,actions:["focus-name","install-builtin"]}}case"moderation_rejected":return{variant:"danger",headline:"This agent was not accepted",body:e.details?.reason?.trim()||e.message,note:O(e.details),actions:["edit-instructions"]};case"moderation_unavailable":return{variant:"warning",headline:"Review is temporarily unavailable",body:"We could not review this agent just now. Nothing was published. Try again in a minute.",note:null,actions:["retry"]};case"invalid_instruction_set":{const{body:s,field:d}=C(e.message,e.details);return{variant:"danger",headline:"The agent document is not valid",body:s,note:null,actions:d==="name"?["focus-name"]:d==="instructions"?["edit-instructions"]:["edit-agent"]}}case"payload_too_large":{const s=e.details?.limit_bytes;return{variant:"danger",headline:"This agent is too large to publish",body:s?`The instruction set is larger than ${Math.round(s/1024)} KiB. Shorten the instructions.`:"The instruction set is larger than the hub accepts. Shorten the instructions.",note:null,actions:["edit-instructions"]}}case"not_owner":return{variant:"danger",headline:"You cannot update this listing",body:"This listing belongs to another account.",note:null,actions:["publish-as-new"]};case"agent_not_found":return{variant:"danger",headline:"That listing no longer exists",body:"It may have been delisted.",note:null,actions:["publish-as-new","refresh-hub"]};case"hub_unauthorized":return{variant:"danger",headline:"The hub refused this machine's sign-in",body:`${a} Sign in to Radient again to replace the credential the hub refused, then ${o}.`,note:null,actions:["sign-in"]};case"hub_unavailable":return{variant:"warning",headline:t?"The pull did not go through":"The publication did not go through",body:E(e.message)?e.message:`${a} Try again in a moment, or update the backend if the hub has moved.`,note:null,actions:["retry"]};case"local_failure":return{variant:"warning",headline:t?"The team could not be pulled from this machine":"The agent could not be published from this machine",body:e.message,note:null,actions:["retry"]};case"team_plan_required":return{variant:"warning",headline:"That organization needs an active Team plan",body:t?"Reading an organization's teams is part of the Team plan. Ask an owner of the organization to activate it in the Radient console, then pull again.":"Sharing agents inside an organization is part of the Team plan. Ask an owner of the organization to activate it in the Radient console, then publish again.",note:null,actions:["retry"]};case"not_a_member":return{variant:"danger",headline:"You are not a member of that organization",body:`${a} Ask an owner of the organization to invite you, then ${o}.`,note:null,actions:[]};case"insufficient_role":{const s=e.details?.required;return{variant:"danger",headline:"Your organization role does not allow this",body:s?`${t?"Reading an organization's teams needs":"Publishing into an organization needs"} the ${s} role. Ask an owner of the organization to change your role, then ${o}.`:`${t?"Reading an organization's teams needs":"Publishing into an organization needs"} a higher role than yours. Ask an owner of the organization to change your role, then ${o}.`,note:null,actions:[]}}case"team_not_found":return{variant:"danger",headline:"That team is no longer published",body:"It may have been delisted since this page was loaded.",note:null,actions:["refresh-hub"]};default:return{variant:"danger",headline:"The agent could not be published",body:e.message,note:null,actions:["retry"]}}}const z=[/^(?:Download agent from Radient failed: )?(?:Error downloading agent from Radient: )?\s*/,/^Failed to download agent(?: [^\s]+)? from Radient Agent Hub(?: due to a requests error)?:\s*/,/^[A-Za-z_][\w.]*\([^)]*\):\s*/],U=/^(\d{3})\b/,F=new Set([404,410]),j=["read timed out","connection timed out","connection refused","connection aborted","connection reset","connectionerror","connecttimeout","remote end closed connection","max retries exceeded","temporary failure in name resolution","name or service not known","no route to host"],x=e=>{const n=e.toLowerCase();return j.some(t=>n.includes(t))||N(e)},B=(e,n)=>{const t=n.trim()?`"${n.trim()}"`:"That agent";if(P(e))switch(e.code){case"agent_not_found":return`${t} is no longer on the hub, so nothing was downloaded.`;case"hub_unavailable":return`The hub did not complete the download, so ${t} was not downloaded.`;default:return`${t} was not downloaded: ${e.message}`}const a=z.reduce((i,s)=>i.replace(s,""),A(e,"").trim()).trim();if(!a)return`${t} could not be downloaded.`;const o=Number(U.exec(a)?.[1]??Number.NaN);return F.has(o)?`${t} is no longer on the hub, so nothing was downloaded.`:x(a)||o===408?`The hub could not be reached, so ${t} was not downloaded.`:o===429?`The hub is busy, so ${t} was not downloaded. Try again in a moment.`:o===401||o===403?`The hub refused this machine's sign-in, so ${t} was not downloaded.`:o>=500?`The hub could not complete the download, so ${t} was not downloaded. Try again in a moment.`:o>=400?`The hub refused the download, so ${t} is not here.`:`${t} was not downloaded: ${a}`},D="The action did not complete.",J=(e,n,t)=>e==="download"?B(n,t):v(D,n),ee={"focus-name":"Choose another name","update-listing":"Update the existing listing","install-builtin":"Install the built-in instead",retry:"Try again","edit-instructions":"Edit the instructions","edit-agent":"Edit the agent","publish-as-new":"Publish as a new listing","sign-in":"Sign in again","refresh-hub":"Refresh the hub"};function c(){return crypto.randomUUID()}async function K(e=1,n=20,t){const a={page:e,per_page:n};if(t)for(const[o,i]of Object.entries(t))i&&(a[o]=i);return r({operation:"agents.list",query:a})}async function ne(e){return r({operation:"agents.get",agentId:e})}async function te(e){return r({operation:"agents.delete",agentId:e,requestId:c(),confirmed:!0})}async function ae(e){return r({operation:"agents.like",agentId:e,requestId:c()})}async function oe(e){return r({operation:"agents.unlike",agentId:e,requestId:c(),confirmed:!0})}async function se(e){return r({operation:"agents.favourite",agentId:e,requestId:c()})}async function ie(e){return r({operation:"agents.unfavourite",agentId:e,requestId:c(),confirmed:!0})}async function re(e,n){return r({operation:"comments.create",agentId:e,payload:n,requestId:c()})}async function ue(e,n=1,t=20){return r({operation:"comments.list",agentId:e,query:{page:n,per_page:t}})}async function le(e,n,t){return r({operation:"comments.update",agentId:e,commentId:n,payload:t,requestId:c()})}async function ce(e,n){return r({operation:"comments.delete",agentId:e,commentId:n,requestId:c(),confirmed:!0})}async function de(e){return r({operation:"agents.statuses",query:{agent_ids:e.join(",")}})}async function M(){return r({operation:"memberships.list"})}async function W(e,n=1,t=20,a){const o={page:n,per_page:t};if(a)for(const[i,s]of Object.entries(a))s&&(o[i]=s);return r({operation:"org_agents.list",tenantId:e,query:o})}async function he(e){return r({operation:"org_teams.list",tenantId:e})}const Y="download_count",b={all:["public-agents"],list:e=>[...b.all,"list",{page:e.page,perPage:e.perPage,categories:e.categories?.join(",")??void 0,name:e.name??void 0,description:e.description??void 0,sort:e.sort,order:e.order}]},m={all:["org-agents"],list:(e,n)=>[...m.all,"list",e,{page:n.page,perPage:n.perPage,categories:n.categories?.join(",")??void 0,name:n.name??void 0,description:n.description??void 0,sort:n.sort,order:n.order}]},Q=e=>e&&e[0]===m.all[0]?String(e[2]??""):null,ge=e=>e.invalidateQueries({queryKey:b.all}),me=(e,n)=>e.invalidateQueries({queryKey:n?[...m.all,"list",n]:m.all}),be=({page:e=1,perPage:n=20,enabled:t=!0,categories:a,name:o,description:i,sort:s=Y,order:d="desc",tenantId:g}={})=>{const p={page:e,perPage:n,categories:a,name:o,description:i,sort:s,order:d},T=g?m.list(g,p):b.list(p),l=_({queryKey:T,queryFn:async()=>{const u={};return a&&a.length>0&&(u.categories=a.join(",")),o&&(u.name=o),i&&(u.description=i),u.sort=s,u.order=d,g?await W(g,e,n,u):await K(e,n,u)},select:u=>u.result,enabled:t,retry:w,staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!1,placeholderData:(u,y)=>Q(y?.queryKey)===(g??null)?u:void 0});return{...l,agents:l.data?.records,isRefreshing:l.isFetching&&l.data!==void 0,pagination:l.data?{page:l.data.page,perPage:l.data.per_page,totalPages:l.data.total_pages,totalRecords:l.data.total_records}:void 0}},H={name:"Name",description:"Description",instructions:"The instruction body",tools:"Tools"};function pe(e){const n=[],t=(a,o)=>{o&&n.push({field:a,message:`${H[a]} ${o}.`})};return t("name",I(e.name)),t("description",R(e.description)),e.instructions!==null&&t("instructions",q(e.instructions)),t("tools",L(e.tools??[])),n}function ye(e,n){const t=h(e);return n.some(a=>h(a)===t)}function fe(e){for(const n of e??[]){const t=n.indexOf(":");if(t<0||n.slice(0,t).trim().toLowerCase()!=="tools")continue;const a=n.slice(t+1).split(",").map(o=>o.trim()).filter(Boolean);return a.length>0?a:null}return null}function _e(e,n){const t=h(e);return n.find(a=>h(a)===t)??null}const G={all:["memberships"]},we=({enabled:e=!0}={})=>{const{isAuthenticated:n}=k(),t=_({queryKey:G.all,queryFn:async()=>(await M()).result??{memberships:[]},enabled:e&&n,staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!1,retry:w});return{...t,memberships:t.data?.memberships??[]}};export{ee as P,te as a,we as b,re as c,ce as d,J as e,he as f,ne as g,be as h,ge as i,de as j,b as k,ue as l,ie as m,se as n,oe as o,V as p,ae as q,_e as r,me as s,ye as t,le as u,pe as v,fe as w};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as n,s as ii,g as ei,t as vt,q as si,a as ni,b as ai,l as Lt,K as oi,e as ri,z as hi,G as lt,F as Et,H as li,M as ci,i as ui,N as gi}from"./mermaid.core-
|
|
1
|
+
import{_ as n,s as ii,g as ei,t as vt,q as si,a as ni,b as ai,l as Lt,K as oi,e as ri,z as hi,G as lt,F as Et,H as li,M as ci,i as ui,N as gi}from"./mermaid.core-CHiYins7.js";import{k as kt,l as Tt,n as Rt}from"./index-D3ICBbhi.js";import"./index-_dbvHdgc.js";import"./aida-control-CQx1CGx-.js";import"./ui-preferences-store-BLiDaCIL.js";import"./textarea-DeXGhzIK.js";import"./error-boundary-D3Um1PIl.js";import"./console-mirror-fXJ5fMxl.js";var at=function(){var t=n(function(B,r,l,c){for(l=l||{},c=B.length;c--;l[B[c]]=r);return l},"o"),i=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],o=[1,5],p=[1,6],g=[1,7],m=[1,5,10,12,14,16,18,19,21,23,34,35,36],T=[1,25],E=[1,26],S=[1,28],R=[1,29],I=[1,30],V=[1,31],_=[1,32],L=[1,33],f=[1,34],C=[1,35],h=[1,36],D=[1,37],N=[1,43],yt=[1,42],bt=[1,47],$=[1,50],b=[1,10,12,14,16,18,19,21,23,34,35,36],J=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],P=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],At=[1,64],tt={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:n(function(r,l,c,u,y,a,X){var x=a.length-1;switch(y){case 5:u.setOrientation(a[x]);break;case 9:u.setDiagramTitle(a[x].text.trim());break;case 12:u.setLineData({text:"",type:"text"},a[x]);break;case 13:u.setLineData(a[x-1],a[x]);break;case 14:u.setBarData({text:"",type:"text"},a[x]);break;case 15:u.setBarData(a[x-1],a[x]);break;case 16:this.$=a[x].trim(),u.setAccTitle(this.$);break;case 17:case 18:this.$=a[x].trim(),u.setAccDescription(this.$);break;case 19:this.$=a[x-1];break;case 20:this.$=[Number(a[x-2]),...a[x]];break;case 21:this.$=[Number(a[x])];break;case 22:u.setXAxisTitle(a[x]);break;case 23:u.setXAxisTitle(a[x-1]);break;case 24:u.setXAxisTitle({type:"text",text:""});break;case 25:u.setXAxisBand(a[x]);break;case 26:u.setXAxisRangeData(Number(a[x-2]),Number(a[x]));break;case 27:this.$=a[x-1];break;case 28:this.$=[a[x-2],...a[x]];break;case 29:this.$=[a[x]];break;case 30:u.setYAxisTitle(a[x]);break;case 31:u.setYAxisTitle(a[x-1]);break;case 32:u.setYAxisTitle({type:"text",text:""});break;case 33:u.setYAxisRangeData(Number(a[x-2]),Number(a[x]));break;case 37:this.$={text:a[x],type:"text"};break;case 38:this.$={text:a[x],type:"text"};break;case 39:this.$={text:a[x],type:"markdown"};break;case 40:this.$=a[x];break;case 41:this.$=a[x-1]+""+a[x];break}},"anonymous"),table:[t(i,e,{3:1,4:2,7:4,5:s,34:o,35:p,36:g}),{1:[3]},t(i,e,{4:2,7:4,3:8,5:s,34:o,35:p,36:g}),t(i,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:o,35:p,36:g}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(m,[2,34]),t(m,[2,35]),t(m,[2,36]),{1:[2,1]},t(i,e,{4:2,7:4,3:21,5:s,34:o,35:p,36:g}),{1:[2,3]},t(m,[2,5]),t(i,[2,7],{4:22,34:o,35:p,36:g}),{11:23,37:24,38:T,39:E,40:27,41:S,42:R,43:I,44:V,45:_,46:L,47:f,48:C,49:h,50:D},{11:39,13:38,24:N,27:yt,29:40,30:41,37:24,38:T,39:E,40:27,41:S,42:R,43:I,44:V,45:_,46:L,47:f,48:C,49:h,50:D},{11:45,15:44,27:bt,33:46,37:24,38:T,39:E,40:27,41:S,42:R,43:I,44:V,45:_,46:L,47:f,48:C,49:h,50:D},{11:49,17:48,24:$,37:24,38:T,39:E,40:27,41:S,42:R,43:I,44:V,45:_,46:L,47:f,48:C,49:h,50:D},{11:52,17:51,24:$,37:24,38:T,39:E,40:27,41:S,42:R,43:I,44:V,45:_,46:L,47:f,48:C,49:h,50:D},{20:[1,53]},{22:[1,54]},t(b,[2,18]),{1:[2,2]},t(b,[2,8]),t(b,[2,9]),t(J,[2,37],{40:55,41:S,42:R,43:I,44:V,45:_,46:L,47:f,48:C,49:h,50:D}),t(J,[2,38]),t(J,[2,39]),t(P,[2,40]),t(P,[2,42]),t(P,[2,43]),t(P,[2,44]),t(P,[2,45]),t(P,[2,46]),t(P,[2,47]),t(P,[2,48]),t(P,[2,49]),t(P,[2,50]),t(P,[2,51]),t(b,[2,10]),t(b,[2,22],{30:41,29:56,24:N,27:yt}),t(b,[2,24]),t(b,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:T,39:E,40:27,41:S,42:R,43:I,44:V,45:_,46:L,47:f,48:C,49:h,50:D},t(b,[2,11]),t(b,[2,30],{33:60,27:bt}),t(b,[2,32]),{31:[1,61]},t(b,[2,12]),{17:62,24:$},{25:63,27:At},t(b,[2,14]),{17:65,24:$},t(b,[2,16]),t(b,[2,17]),t(P,[2,41]),t(b,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(b,[2,31]),{27:[1,69]},t(b,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(b,[2,15]),t(b,[2,26]),t(b,[2,27]),{11:59,32:72,37:24,38:T,39:E,40:27,41:S,42:R,43:I,44:V,45:_,46:L,47:f,48:C,49:h,50:D},t(b,[2,33]),t(b,[2,19]),{25:73,27:At},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:n(function(r,l){if(l.recoverable)this.trace(r);else{var c=new Error(r);throw c.hash=l,c}},"parseError"),parse:n(function(r){var l=this,c=[0],u=[],y=[null],a=[],X=this.table,x="",G=0,Ct=0,Kt=2,wt=1,Zt=a.slice.call(arguments,1),A=Object.create(this.lexer),W={yy:{}};for(var it in this.yy)Object.prototype.hasOwnProperty.call(this.yy,it)&&(W.yy[it]=this.yy[it]);A.setInput(r,W.yy),W.yy.lexer=A,W.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var et=A.yylloc;a.push(et);var Jt=A.options&&A.options.ranges;typeof W.yy.parseError=="function"?this.parseError=W.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ti(k){c.length=c.length-2*k,y.length=y.length-k,a.length=a.length-k}n(ti,"popStack");function St(){var k;return k=u.pop()||A.lex()||wt,typeof k!="number"&&(k instanceof Array&&(u=k,k=u.pop()),k=l.symbols_[k]||k),k}n(St,"lex");for(var w,O,v,st,z={},j,M,_t,Q;;){if(O=c[c.length-1],this.defaultActions[O]?v=this.defaultActions[O]:((w===null||typeof w>"u")&&(w=St()),v=X[O]&&X[O][w]),typeof v>"u"||!v.length||!v[0]){var nt="";Q=[];for(j in X[O])this.terminals_[j]&&j>Kt&&Q.push("'"+this.terminals_[j]+"'");A.showPosition?nt="Parse error on line "+(G+1)+`:
|
|
2
2
|
`+A.showPosition()+`
|
|
3
3
|
Expecting `+Q.join(", ")+", got '"+(this.terminals_[w]||w)+"'":nt="Parse error on line "+(G+1)+": Unexpected "+(w==wt?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(nt,{text:A.match,token:this.terminals_[w]||w,line:A.yylineno,loc:et,expected:Q})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+w);switch(v[0]){case 1:c.push(w),y.push(A.yytext),a.push(A.yylloc),c.push(v[1]),w=null,Ct=A.yyleng,x=A.yytext,G=A.yylineno,et=A.yylloc;break;case 2:if(M=this.productions_[v[1]][1],z.$=y[y.length-M],z._$={first_line:a[a.length-(M||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(M||1)].first_column,last_column:a[a.length-1].last_column},Jt&&(z._$.range=[a[a.length-(M||1)].range[0],a[a.length-1].range[1]]),st=this.performAction.apply(z,[x,Ct,G,W.yy,v[1],y,a].concat(Zt)),typeof st<"u")return st;M&&(c=c.slice(0,-1*M*2),y=y.slice(0,-1*M),a=a.slice(0,-1*M)),c.push(this.productions_[v[1]][0]),y.push(z.$),a.push(z._$),_t=X[c[c.length-2]][c[c.length-1]],c.push(_t);break;case 3:return!0}}return!0},"parse")},Qt=function(){var B={EOF:1,parseError:n(function(l,c){if(this.yy.parser)this.yy.parser.parseError(l,c);else throw new Error(l)},"parseError"),setInput:n(function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:n(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:n(function(r){var l=r.length,c=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===u.length?this.yylloc.first_column:0)+u[u.length-c.length].length-c[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n(function(r){this.unput(this.match.slice(r))},"less"),pastInput:n(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
<title>Local Operator Console Capture</title>
|
|
7
7
|
<meta http-equiv="Content-Security-Policy"
|
|
8
8
|
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:" />
|
|
9
|
-
<script type="module" crossorigin src="./assets/consoleCapture-
|
|
10
|
-
<link rel="modulepreload" crossorigin href="./assets/index-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="./assets/ui-preferences-store-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="./assets/console-mirror-
|
|
13
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
9
|
+
<script type="module" crossorigin src="./assets/consoleCapture-Df4uIOqu.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="./assets/index-_dbvHdgc.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="./assets/ui-preferences-store-BLiDaCIL.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="./assets/console-mirror-fXJ5fMxl.js">
|
|
13
|
+
<link rel="stylesheet" crossorigin href="./assets/index-DuUnXH9L.css">
|
|
14
14
|
<link rel="stylesheet" crossorigin href="./assets/console-mirror-DOrYoP_4.css">
|
|
15
15
|
</head>
|
|
16
16
|
|
package/out/renderer/index.html
CHANGED
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
<meta http-equiv="Content-Security-Policy"
|
|
32
32
|
content="default-src 'self'; connect-src 'self' http://localhost:1111 http://127.0.0.1:1111 http://localhost:8080 http://127.0.0.1:8080 https://api.radienthq.com https://us.i.posthog.com https://login.microsoftonline.com https://accounts.google.com; script-src 'self' https://us-assets.i.posthog.com https://accounts.google.com https://login.microsoftonline.com; style-src 'self' 'unsafe-inline' data:; img-src 'self' data: blob: http://localhost:1111 http://127.0.0.1:1111; media-src 'self' blob: http://localhost:1111 http://127.0.0.1:1111; font-src 'self' data:; frame-src 'self' data: blob: http://localhost:1111 http://127.0.0.1:1111 https://accounts.google.com https://login.microsoftonline.com" />
|
|
33
33
|
<meta http-equiv="Cross-Origin-Opener-Policy" content="same-origin-allow-popups" />
|
|
34
|
-
<script type="module" crossorigin src="./assets/index-
|
|
35
|
-
<link rel="modulepreload" crossorigin href="./assets/index-
|
|
36
|
-
<link rel="modulepreload" crossorigin href="./assets/ui-preferences-store-
|
|
37
|
-
<link rel="modulepreload" crossorigin href="./assets/textarea-
|
|
38
|
-
<link rel="modulepreload" crossorigin href="./assets/aida-control-
|
|
39
|
-
<link rel="modulepreload" crossorigin href="./assets/error-boundary-
|
|
40
|
-
<link rel="modulepreload" crossorigin href="./assets/console-mirror-
|
|
41
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
34
|
+
<script type="module" crossorigin src="./assets/index-D3ICBbhi.js"></script>
|
|
35
|
+
<link rel="modulepreload" crossorigin href="./assets/index-_dbvHdgc.js">
|
|
36
|
+
<link rel="modulepreload" crossorigin href="./assets/ui-preferences-store-BLiDaCIL.js">
|
|
37
|
+
<link rel="modulepreload" crossorigin href="./assets/textarea-DeXGhzIK.js">
|
|
38
|
+
<link rel="modulepreload" crossorigin href="./assets/aida-control-CQx1CGx-.js">
|
|
39
|
+
<link rel="modulepreload" crossorigin href="./assets/error-boundary-D3Um1PIl.js">
|
|
40
|
+
<link rel="modulepreload" crossorigin href="./assets/console-mirror-fXJ5fMxl.js">
|
|
41
|
+
<link rel="stylesheet" crossorigin href="./assets/index-DuUnXH9L.css">
|
|
42
42
|
<link rel="stylesheet" crossorigin href="./assets/console-mirror-DOrYoP_4.css">
|
|
43
43
|
<link rel="stylesheet" crossorigin href="./assets/index-2qmFWi_F.css">
|
|
44
44
|
</head>
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
|
|
9
9
|
<meta http-equiv="Content-Security-Policy"
|
|
10
10
|
content="default-src 'self'; connect-src 'self' http://localhost:1111 http://127.0.0.1:1111; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: http://localhost:1111 http://127.0.0.1:1111; media-src 'self' http://localhost:1111 http://127.0.0.1:1111; font-src 'self' data:" />
|
|
11
|
-
<script type="module" crossorigin src="./assets/installer-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="./assets/index-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="./assets/textarea-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="./assets/error-boundary-
|
|
15
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
11
|
+
<script type="module" crossorigin src="./assets/installer-D-IQpqXR.js"></script>
|
|
12
|
+
<link rel="modulepreload" crossorigin href="./assets/index-_dbvHdgc.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="./assets/textarea-DeXGhzIK.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="./assets/error-boundary-D3Um1PIl.js">
|
|
15
|
+
<link rel="stylesheet" crossorigin href="./assets/index-DuUnXH9L.css">
|
|
16
16
|
</head>
|
|
17
17
|
|
|
18
18
|
<body>
|
package/out/renderer/mini.html
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
<title>Local Operator Quick Send</title>
|
|
7
7
|
<meta http-equiv="Content-Security-Policy"
|
|
8
8
|
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:" />
|
|
9
|
-
<script type="module" crossorigin src="./assets/mini-
|
|
10
|
-
<link rel="modulepreload" crossorigin href="./assets/index-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="./assets/ui-preferences-store-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="./assets/textarea-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="./assets/aida-control-
|
|
14
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
9
|
+
<script type="module" crossorigin src="./assets/mini-D7VYY0xP.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="./assets/index-_dbvHdgc.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="./assets/ui-preferences-store-BLiDaCIL.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="./assets/textarea-DeXGhzIK.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="./assets/aida-control-CQx1CGx-.js">
|
|
14
|
+
<link rel="stylesheet" crossorigin href="./assets/index-DuUnXH9L.css">
|
|
15
15
|
</head>
|
|
16
16
|
|
|
17
17
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "local-operator-ui",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.27",
|
|
4
4
|
"productName": "Local Operator",
|
|
5
5
|
"description": "User interface for AI agent assistants that run Python code safely on your device through an intuitive chat interface. Supports local and cloud LLM models with built-in security features.",
|
|
6
6
|
"main": "./out/main/index.js",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"check-types": "pnpm run check-types:main && pnpm run check-types:renderer",
|
|
77
77
|
"check-changed": "node scripts/ci-scope.mjs --since \"$(git merge-base origin/main HEAD)\" --run",
|
|
78
78
|
"test:session-cookies": "node scripts/session-cookie-electron.test.mjs",
|
|
79
|
-
"test:desktop": "node scripts/run-desktop-tests.mjs scripts/agents-config-probe-cadence.test.mjs scripts/agents-config-summary.test.mjs scripts/agents-config-retry.test.mjs scripts/update-fleet-drain.test.mjs scripts/at-mentions.test.mjs scripts/directory-listing.test.mjs scripts/slash-token.test.mjs scripts/slash-rank.test.mjs scripts/slash-submit.test.mjs scripts/slash-highlight.test.mjs scripts/slash-contract.test.mjs scripts/slash-row-format.test.mjs scripts/owned-serve-lifecycle.test.mjs scripts/launcher-watch.test.mjs scripts/linux-sandbox.test.mjs scripts/capture-evidence.test.mjs scripts/desktop-contract.test.mjs scripts/transcript-reducer.test.mjs scripts/transcript-focus.test.mjs scripts/transcript-focus-behaviour.test.mjs scripts/tool-compose-lifecycle.test.mjs scripts/transcript-paging.test.mjs scripts/transcript-paging-hook.test.mjs scripts/seed-placement.test.mjs scripts/seed-label-gap.test.mjs scripts/provider-state.test.mjs scripts/stale-agent.test.mjs scripts/desktop-renderer-transport.test.mjs scripts/desktop-proxy.test.mjs scripts/session-stream-token.test.mjs scripts/session-load-recovery.test.mjs scripts/provider-grid-error-copy.test.mjs scripts/provider-grid-pin.test.mjs scripts/settings-time-to-error.test.mjs scripts/backend-error-surfaces.test.mjs scripts/canonical-chat.test.mjs scripts/stale-caption.test.mjs scripts/desktop-watch-lease.test.mjs scripts/session-switch.test.mjs scripts/chat-search.test.mjs scripts/session-archive-delete.test.mjs scripts/chat-archived.test.mjs scripts/chat-archive-press.test.mjs scripts/palette-search.test.mjs scripts/palette-shortcut.test.mjs scripts/palette-contract.test.mjs scripts/palette-panel-request.test.mjs scripts/run-child-reader.test.mjs scripts/run-detail-model.test.mjs scripts/subagent-pulse.test.mjs scripts/chat-title.test.mjs scripts/clear-search.test.mjs scripts/tool-row.test.mjs scripts/working-line-clock.test.mjs scripts/attachment-url.test.mjs scripts/desktop-notifier.test.mjs scripts/launch-session.test.mjs scripts/desktop-feed.test.mjs scripts/session-status-feed.test.mjs scripts/viewer-record.test.mjs scripts/desktop-stream.test.mjs scripts/python-bytecode-cache.test.mjs scripts/preload-updater-surface.test.mjs scripts/update-affirmation.test.mjs scripts/update-global-install.test.mjs scripts/update-robustness.test.mjs scripts/merge-update-feed.test.mjs scripts/prune-bundled-resources.test.mjs scripts/bundled-runtime-layout.test.mjs scripts/verify-bundled-uv.test.mjs scripts/managed-python.test.mjs scripts/usage-view.test.mjs scripts/usage-container.test.mjs scripts/session-status.test.mjs scripts/composer-readings.test.mjs scripts/composer-queued-send.test.mjs scripts/composer-tabs.test.mjs scripts/scroll-region-to-top.test.mjs scripts/ask-options.test.mjs scripts/click-proof-expect.test.mjs scripts/window-mode.test.mjs scripts/relaunch-during-quit-proof.test.mjs scripts/about-panel.test.mjs scripts/evidence-manifest.test.mjs scripts/canonical-notice.test.mjs scripts/evidence-histogram-parity.test.mjs scripts/evidence-run-guard.test.mjs scripts/desktop-test-concurrency.test.mjs scripts/run-desktop-tests.test.mjs scripts/mcp-foreign-config-origin.test.mjs scripts/mentioned-files.test.mjs scripts/picker-feedback.test.mjs scripts/picker-host-selection.test.mjs scripts/panel-chart-motion.test.mjs scripts/panel-info-credentials.test.mjs scripts/panel-info-fleet.test.mjs scripts/warm-session.test.mjs scripts/submit-latency.test.mjs scripts/completion-view-ack.test.mjs scripts/echo-delivery.test.mjs scripts/check-runtime-deps.test.mjs scripts/new-chat-row.test.mjs scripts/new-chat-row-evidence.test.mjs scripts/new-chat-shortcut.test.mjs scripts/reconnect-page-gap.test.mjs scripts/browser-host.test.mjs scripts/check-vendored.test.mjs scripts/chat-session-status.test.mjs scripts/draft-selection.test.mjs scripts/toast-lifetime.test.mjs scripts/toast-close-placement.test.mjs scripts/storybook-query-fixture.test.mjs scripts/mcp-list-query.test.mjs scripts/mcp-target-resolution.test.mjs scripts/mcp-auth-surface.test.mjs scripts/mcp-failure-routing.test.mjs scripts/daemon-discovery.test.mjs scripts/daemon-health-state.test.mjs scripts/daemon-observation.test.mjs scripts/session-cookies.test.mjs scripts/move-session.test.mjs scripts/frontend-replace.test.mjs scripts/browser-chrome.test.mjs scripts/browser-queue-expiry.test.mjs scripts/dev-driver-gate.test.mjs scripts/logger-log-dir.test.mjs scripts/draft-splash.test.mjs scripts/suggestion-stack.test.mjs scripts/suggestion-stack-react.test.mjs scripts/notifications-off.test.mjs scripts/notification-launch.test.mjs scripts/notification-spawn-sites.test.mjs scripts/chrome-keychain.test.mjs scripts/interrupt-control.test.mjs scripts/interrupt-slot-hold-react.test.mjs scripts/chat-sidebar-archive.test.mjs scripts/chat-sidebar-selection.test.mjs scripts/message-quote.test.mjs scripts/panel-chart-hover.test.mjs scripts/panel-read-policy.test.mjs scripts/composer-suggestions.test.mjs scripts/composer-tip-react.test.mjs scripts/sidebar-catalogue-gate.test.mjs scripts/telemetry-launch.test.mjs scripts/telemetry-spawn-sites.test.mjs scripts/sidebar-focus-hold.test.mjs scripts/credential-capture.test.mjs scripts/soft-breaks.test.mjs scripts/credential-composer.test.mjs scripts/secret-ask.test.mjs scripts/run-panel-navigation.test.mjs scripts/backend-settings-tiers.test.mjs scripts/backend-settings-collapse.test.mjs scripts/check-build-env.test.mjs scripts/test-inventory.test.mjs scripts/conflict-markers.test.mjs scripts/compact-receipt.test.mjs scripts/chat-image-expand.test.mjs scripts/prune-python-seed.test.mjs scripts/mcp-auth-complete-no-retry.test.mjs scripts/panel-presentation.test.mjs scripts/turn-timestamp.test.mjs scripts/analytics-session-table.test.mjs scripts/theme-grid-navigation.test.mjs scripts/theme-registry-exhaustiveness.test.mjs scripts/scheduled-task-model.test.mjs scripts/backend-setting-combos.test.mjs scripts/model-setting-options.test.mjs scripts/searchable-select.test.mjs scripts/backend-settings-drafts.test.mjs scripts/typed-row-call-sites.test.mjs scripts/palette-focus.test.mjs scripts/composer-seeding.test.mjs scripts/skill-invocation.test.mjs scripts/skill-list.test.mjs scripts/theme-inline.test.mjs scripts/composer-refusal.test.mjs scripts/ci-scope.test.mjs scripts/browser-tab-strip-focus.test.mjs scripts/projects-board-focus.test.mjs scripts/browser-file-transfer-row.test.mjs scripts/link-targets.test.mjs scripts/link-actions.test.mjs scripts/chat-link-affordances.test.mjs scripts/transcription-failure-copy.test.mjs scripts/backend-version-drift.test.mjs scripts/live-seed-placement.test.mjs scripts/agents-publication.test.mjs scripts/agent-hub-queries.test.mjs scripts/install-builtin-batch.test.mjs scripts/install-progress.test.mjs scripts/attention-seen.test.mjs scripts/mark-all-read-control.test.mjs scripts/update-global-guard.test.mjs scripts/delivery-gate.test.mjs scripts/canvas-file-freshness.test.mjs scripts/no-websocket-plane.test.mjs scripts/update-window-report.test.mjs scripts/canvas-tab-close.test.mjs scripts/chat-sidebar-pins.test.mjs scripts/webauthn.test.mjs scripts/render-mac-entitlements.test.mjs scripts/row-state-floors.test.mjs scripts/pairing-card-copy.test.mjs scripts/update-install-copy.test.mjs scripts/update-shipit.test.mjs scripts/console-host.test.mjs scripts/console-pack.test.mjs scripts/settings-account-gate.test.mjs scripts/sidebar-pin-order.test.mjs scripts/sidebar-split.test.mjs scripts/radient-session-issue.test.mjs scripts/console-pane.test.mjs scripts/console-mirror.test.mjs scripts/shell-path.test.mjs scripts/build-env-guard.test.mjs scripts/install-scripts-network.test.mjs scripts/console-pane-render.test.mjs scripts/settings-section-routes.test.mjs scripts/authoring-refresh.test.mjs scripts/verify-macos-artifacts.test.mjs scripts/provider-chip-verdict.test.mjs scripts/child-reader-foot-react.test.mjs scripts/backend-spawn-address.test.mjs scripts/connectivity-banner-copy.test.mjs scripts/connectivity-banner-notice.test.mjs scripts/chat-list-sections.test.mjs scripts/chat-keyboard-regions.test.mjs scripts/chat-sidebar-view.test.mjs scripts/chat-sidebar-layout.test.mjs scripts/drafts-clear-on-send.test.mjs scripts/chat-sidebar-drafts.test.mjs scripts/undo-toasts.test.mjs scripts/chat-sidebar-sections.test.mjs scripts/titlebar-options.test.mjs scripts/lane-leading.test.mjs scripts/trace-fold-model.test.mjs scripts/trace-fold-behaviour.test.mjs scripts/chat-status-strip.test.mjs scripts/chat-pane-floors.test.mjs scripts/path-utils.test.mjs scripts/window-chrome.test.mjs scripts/chat-sidebar-scope-paging.test.mjs scripts/chat-sidebar-connection-voices.test.mjs scripts/integration-model.test.mjs scripts/mcp-catalog-parity.test.mjs scripts/btw-aside.test.mjs scripts/composer-send-failure.test.mjs scripts/composer-text-authority.test.mjs scripts/shared-composer.test.mjs scripts/analytics-rate-format.test.mjs scripts/provider-catalog.test.mjs scripts/provider-sign-in-flow.test.mjs scripts/provider-status.test.mjs scripts/evidence-sign-in-states.test.mjs scripts/provider-detail-remount.test.mjs scripts/model-select-store.test.mjs scripts/onboarding-step-block.test.mjs scripts/onboarding-default-model.test.mjs scripts/server-release-notes.test.mjs scripts/no-hardlink-write.test.mjs scripts/canvas-goals.test.mjs scripts/overlay-drag-zones.test.mjs scripts/message-surface-floors.test.mjs scripts/header-identity-model.test.mjs scripts/pane-slot-ground.test.mjs scripts/projects-tab.test.mjs scripts/agent-hub-org-sharing.test.mjs scripts/mesh-tab.test.mjs scripts/onboarding-search-step.test.mjs scripts/provider-error-guidance.test.mjs scripts/radient-verify-callout.test.mjs scripts/sidebar-account-reconnect.test.mjs scripts/stopped-row-measure.test.mjs scripts/aida-rail-marks.test.mjs scripts/aida-sidebar.test.mjs scripts/currency-math.test.mjs scripts/mesh-canvas-bench.test.mjs scripts/agents-offer-dismiss.test.mjs scripts/projects-card-click.test.mjs scripts/lane-registration.test.mjs scripts/projects-sheet.test.mjs scripts/turn-collapse-model.test.mjs scripts/turn-segments.test.mjs scripts/turn-collapse-behaviour.test.mjs scripts/checkpoint-model.test.mjs scripts/checkpoint-rail.test.mjs scripts/use-checkpoints.test.mjs scripts/reveal-record.test.mjs scripts/transcript-loader.test.mjs scripts/transcript-deep-jump.test.mjs scripts/thread-search-contract.test.mjs scripts/thread-search-model.test.mjs scripts/thread-search-overlay.test.mjs scripts/use-thread-search.test.mjs scripts/notification-lifetime.test.mjs scripts/transcript-rail-refusal.test.mjs scripts/use-active-checkpoint.test.mjs scripts/hold-escape-claim.test.mjs scripts/hotkey-registration.test.mjs scripts/mini-view-dictation.test.mjs scripts/mini-view-contract.test.mjs scripts/chat-device-model.test.mjs scripts/ptt-keymap-binding.test.mjs scripts/cross-session-visibility.test.mjs scripts/fold-open.test.mjs scripts/transcript-foot-slot.test.mjs scripts/chat-measure-drag.test.mjs scripts/chat-measure-handle.test.mjs scripts/header-identity-menu.test.mjs scripts/monitor-controls.test.mjs scripts/monitor-cancel-dialog.test.mjs scripts/child-transcript-paging.test.mjs scripts/loader-state-machine.test.mjs scripts/transcript-cursor-continuity.test.mjs scripts/older-history-slot.test.mjs scripts/chat-session-subagents.test.mjs scripts/message-actions.test.mjs scripts/update-indicator-segments.test.mjs scripts/reload-picker-close.test.mjs scripts/projects-time-window.test.mjs scripts/audio-recording-levels.test.mjs scripts/chat-sidebar-row-menu.test.mjs scripts/navigation-gesture.test.mjs scripts/right-slot-width.test.mjs scripts/transcript-fade.test.mjs scripts/org-teams-summary.test.mjs scripts/markdown-table-widths.test.mjs scripts/turn-answer-rail.test.mjs",
|
|
79
|
+
"test:desktop": "node scripts/run-desktop-tests.mjs scripts/agents-config-summary.test.mjs scripts/agents-config-retry.test.mjs scripts/update-fleet-drain.test.mjs scripts/at-mentions.test.mjs scripts/directory-listing.test.mjs scripts/slash-token.test.mjs scripts/slash-rank.test.mjs scripts/slash-submit.test.mjs scripts/slash-highlight.test.mjs scripts/slash-contract.test.mjs scripts/slash-row-format.test.mjs scripts/owned-serve-lifecycle.test.mjs scripts/launcher-watch.test.mjs scripts/linux-sandbox.test.mjs scripts/capture-evidence.test.mjs scripts/desktop-contract.test.mjs scripts/transcript-reducer.test.mjs scripts/transcript-focus.test.mjs scripts/transcript-focus-behaviour.test.mjs scripts/tool-compose-lifecycle.test.mjs scripts/transcript-paging.test.mjs scripts/transcript-paging-hook.test.mjs scripts/seed-placement.test.mjs scripts/seed-label-gap.test.mjs scripts/provider-state.test.mjs scripts/stale-agent.test.mjs scripts/desktop-renderer-transport.test.mjs scripts/desktop-proxy.test.mjs scripts/session-stream-token.test.mjs scripts/session-load-recovery.test.mjs scripts/provider-grid-error-copy.test.mjs scripts/provider-grid-pin.test.mjs scripts/settings-time-to-error.test.mjs scripts/backend-error-surfaces.test.mjs scripts/canonical-chat.test.mjs scripts/stale-caption.test.mjs scripts/desktop-watch-lease.test.mjs scripts/session-switch.test.mjs scripts/chat-search.test.mjs scripts/session-archive-delete.test.mjs scripts/chat-archived.test.mjs scripts/chat-archive-press.test.mjs scripts/palette-search.test.mjs scripts/palette-shortcut.test.mjs scripts/palette-contract.test.mjs scripts/palette-panel-request.test.mjs scripts/run-child-reader.test.mjs scripts/run-detail-model.test.mjs scripts/subagent-pulse.test.mjs scripts/chat-title.test.mjs scripts/clear-search.test.mjs scripts/tool-row.test.mjs scripts/working-line-clock.test.mjs scripts/attachment-url.test.mjs scripts/desktop-notifier.test.mjs scripts/launch-session.test.mjs scripts/desktop-feed.test.mjs scripts/session-status-feed.test.mjs scripts/viewer-record.test.mjs scripts/desktop-stream.test.mjs scripts/python-bytecode-cache.test.mjs scripts/preload-updater-surface.test.mjs scripts/update-affirmation.test.mjs scripts/update-global-install.test.mjs scripts/update-robustness.test.mjs scripts/merge-update-feed.test.mjs scripts/prune-bundled-resources.test.mjs scripts/bundled-runtime-layout.test.mjs scripts/verify-bundled-uv.test.mjs scripts/managed-python.test.mjs scripts/usage-view.test.mjs scripts/usage-container.test.mjs scripts/session-status.test.mjs scripts/composer-readings.test.mjs scripts/composer-queued-send.test.mjs scripts/composer-tabs.test.mjs scripts/scroll-region-to-top.test.mjs scripts/ask-options.test.mjs scripts/click-proof-expect.test.mjs scripts/window-mode.test.mjs scripts/relaunch-during-quit-proof.test.mjs scripts/about-panel.test.mjs scripts/evidence-manifest.test.mjs scripts/canonical-notice.test.mjs scripts/evidence-histogram-parity.test.mjs scripts/evidence-run-guard.test.mjs scripts/desktop-test-concurrency.test.mjs scripts/desktop-test-memory-guard.test.mjs scripts/run-desktop-tests.test.mjs scripts/mcp-foreign-config-origin.test.mjs scripts/mentioned-files.test.mjs scripts/picker-feedback.test.mjs scripts/picker-host-selection.test.mjs scripts/panel-chart-motion.test.mjs scripts/panel-info-credentials.test.mjs scripts/panel-info-fleet.test.mjs scripts/warm-session.test.mjs scripts/submit-latency.test.mjs scripts/completion-view-ack.test.mjs scripts/echo-delivery.test.mjs scripts/check-runtime-deps.test.mjs scripts/new-chat-row.test.mjs scripts/new-chat-row-evidence.test.mjs scripts/new-chat-shortcut.test.mjs scripts/reconnect-page-gap.test.mjs scripts/browser-host.test.mjs scripts/check-vendored.test.mjs scripts/chat-session-status.test.mjs scripts/draft-selection.test.mjs scripts/toast-lifetime.test.mjs scripts/toast-close-placement.test.mjs scripts/storybook-query-fixture.test.mjs scripts/mcp-list-query.test.mjs scripts/mcp-target-resolution.test.mjs scripts/mcp-auth-surface.test.mjs scripts/mcp-failure-routing.test.mjs scripts/daemon-discovery.test.mjs scripts/daemon-health-state.test.mjs scripts/daemon-observation.test.mjs scripts/session-cookies.test.mjs scripts/move-session.test.mjs scripts/frontend-replace.test.mjs scripts/browser-chrome.test.mjs scripts/browser-queue-expiry.test.mjs scripts/dev-driver-gate.test.mjs scripts/logger-log-dir.test.mjs scripts/draft-splash.test.mjs scripts/suggestion-stack.test.mjs scripts/suggestion-stack-react.test.mjs scripts/notifications-off.test.mjs scripts/notification-launch.test.mjs scripts/notification-spawn-sites.test.mjs scripts/chrome-keychain.test.mjs scripts/interrupt-control.test.mjs scripts/interrupt-slot-hold-react.test.mjs scripts/chat-sidebar-archive.test.mjs scripts/chat-sidebar-selection.test.mjs scripts/message-quote.test.mjs scripts/panel-chart-hover.test.mjs scripts/panel-read-policy.test.mjs scripts/composer-suggestions.test.mjs scripts/composer-tip-react.test.mjs scripts/sidebar-catalogue-gate.test.mjs scripts/telemetry-launch.test.mjs scripts/telemetry-spawn-sites.test.mjs scripts/sidebar-focus-hold.test.mjs scripts/credential-capture.test.mjs scripts/soft-breaks.test.mjs scripts/credential-composer.test.mjs scripts/secret-ask.test.mjs scripts/run-panel-navigation.test.mjs scripts/backend-settings-tiers.test.mjs scripts/backend-settings-collapse.test.mjs scripts/check-build-env.test.mjs scripts/test-inventory.test.mjs scripts/conflict-markers.test.mjs scripts/compact-receipt.test.mjs scripts/chat-image-expand.test.mjs scripts/prune-python-seed.test.mjs scripts/mcp-auth-complete-no-retry.test.mjs scripts/panel-presentation.test.mjs scripts/turn-timestamp.test.mjs scripts/analytics-session-table.test.mjs scripts/theme-grid-navigation.test.mjs scripts/theme-registry-exhaustiveness.test.mjs scripts/scheduled-task-model.test.mjs scripts/backend-setting-combos.test.mjs scripts/model-setting-options.test.mjs scripts/searchable-select.test.mjs scripts/backend-settings-drafts.test.mjs scripts/typed-row-call-sites.test.mjs scripts/palette-focus.test.mjs scripts/composer-seeding.test.mjs scripts/skill-invocation.test.mjs scripts/skill-list.test.mjs scripts/skill-highlight.test.mjs scripts/theme-inline.test.mjs scripts/composer-refusal.test.mjs scripts/ci-scope.test.mjs scripts/browser-tab-strip-focus.test.mjs scripts/projects-board-focus.test.mjs scripts/browser-file-transfer-row.test.mjs scripts/link-targets.test.mjs scripts/link-actions.test.mjs scripts/chat-link-affordances.test.mjs scripts/transcription-failure-copy.test.mjs scripts/backend-version-drift.test.mjs scripts/live-seed-placement.test.mjs scripts/agents-publication.test.mjs scripts/agent-hub-queries.test.mjs scripts/install-builtin-batch.test.mjs scripts/install-progress.test.mjs scripts/attention-seen.test.mjs scripts/mark-all-read-control.test.mjs scripts/update-global-guard.test.mjs scripts/delivery-gate.test.mjs scripts/canvas-file-freshness.test.mjs scripts/no-websocket-plane.test.mjs scripts/update-window-report.test.mjs scripts/canvas-tab-close.test.mjs scripts/chat-sidebar-pins.test.mjs scripts/webauthn.test.mjs scripts/render-mac-entitlements.test.mjs scripts/row-state-floors.test.mjs scripts/pairing-card-copy.test.mjs scripts/update-install-copy.test.mjs scripts/update-shipit.test.mjs scripts/console-host.test.mjs scripts/console-pack.test.mjs scripts/settings-account-gate.test.mjs scripts/sidebar-pin-order.test.mjs scripts/sidebar-split.test.mjs scripts/radient-session-issue.test.mjs scripts/console-pane.test.mjs scripts/console-mirror.test.mjs scripts/shell-path.test.mjs scripts/build-env-guard.test.mjs scripts/install-scripts-network.test.mjs scripts/console-pane-render.test.mjs scripts/settings-section-routes.test.mjs scripts/authoring-refresh.test.mjs scripts/verify-macos-artifacts.test.mjs scripts/provider-chip-verdict.test.mjs scripts/child-reader-foot-react.test.mjs scripts/backend-spawn-address.test.mjs scripts/connectivity-banner-copy.test.mjs scripts/connectivity-banner-notice.test.mjs scripts/chat-list-sections.test.mjs scripts/chat-keyboard-regions.test.mjs scripts/chat-sidebar-agents.test.mjs scripts/chat-sidebar-view.test.mjs scripts/chat-sidebar-layout.test.mjs scripts/drafts-clear-on-send.test.mjs scripts/chat-sidebar-drafts.test.mjs scripts/undo-toasts.test.mjs scripts/chat-sidebar-sections.test.mjs scripts/titlebar-options.test.mjs scripts/lane-leading.test.mjs scripts/trace-fold-model.test.mjs scripts/trace-fold-behaviour.test.mjs scripts/chat-status-strip.test.mjs scripts/chat-pane-floors.test.mjs scripts/path-utils.test.mjs scripts/window-chrome.test.mjs scripts/chat-sidebar-scope-paging.test.mjs scripts/chat-sidebar-connection-voices.test.mjs scripts/integration-model.test.mjs scripts/mcp-catalog-parity.test.mjs scripts/btw-aside.test.mjs scripts/composer-send-failure.test.mjs scripts/composer-text-authority.test.mjs scripts/shared-composer.test.mjs scripts/analytics-rate-format.test.mjs scripts/provider-catalog.test.mjs scripts/provider-sign-in-flow.test.mjs scripts/provider-status.test.mjs scripts/evidence-sign-in-states.test.mjs scripts/provider-detail-remount.test.mjs scripts/model-select-store.test.mjs scripts/onboarding-step-block.test.mjs scripts/onboarding-default-model.test.mjs scripts/server-release-notes.test.mjs scripts/no-hardlink-write.test.mjs scripts/canvas-goals.test.mjs scripts/overlay-drag-zones.test.mjs scripts/message-surface-floors.test.mjs scripts/header-identity-model.test.mjs scripts/pane-slot-ground.test.mjs scripts/projects-tab.test.mjs scripts/agent-hub-org-sharing.test.mjs scripts/mesh-tab.test.mjs scripts/onboarding-search-step.test.mjs scripts/provider-error-guidance.test.mjs scripts/radient-verify-callout.test.mjs scripts/sidebar-account-reconnect.test.mjs scripts/stopped-row-measure.test.mjs scripts/aida-rail-marks.test.mjs scripts/aida-sidebar.test.mjs scripts/currency-math.test.mjs scripts/mesh-canvas-bench.test.mjs scripts/agents-offer-dismiss.test.mjs scripts/projects-card-click.test.mjs scripts/lane-registration.test.mjs scripts/projects-sheet.test.mjs scripts/turn-collapse-model.test.mjs scripts/turn-collapse-behaviour.test.mjs scripts/checkpoint-model.test.mjs scripts/checkpoint-rail.test.mjs scripts/use-checkpoints.test.mjs scripts/reveal-record.test.mjs scripts/transcript-loader.test.mjs scripts/transcript-deep-jump.test.mjs scripts/thread-search-contract.test.mjs scripts/thread-search-model.test.mjs scripts/thread-search-overlay.test.mjs scripts/use-thread-search.test.mjs scripts/notification-lifetime.test.mjs scripts/transcript-rail-refusal.test.mjs scripts/use-active-checkpoint.test.mjs scripts/hold-escape-claim.test.mjs scripts/hotkey-registration.test.mjs scripts/mini-view-dictation.test.mjs scripts/mini-view-contract.test.mjs scripts/ptt-keymap-binding.test.mjs scripts/cross-session-visibility.test.mjs scripts/fold-open.test.mjs scripts/transcript-foot-slot.test.mjs scripts/chat-measure-drag.test.mjs scripts/chat-measure-handle.test.mjs scripts/header-identity-menu.test.mjs scripts/hub-updates.test.mjs scripts/monitor-controls.test.mjs scripts/monitor-cancel-dialog.test.mjs scripts/child-transcript-paging.test.mjs scripts/loader-state-machine.test.mjs scripts/transcript-cursor-continuity.test.mjs scripts/older-history-slot.test.mjs scripts/chat-session-subagents.test.mjs scripts/message-actions.test.mjs scripts/update-indicator-segments.test.mjs scripts/reload-picker-close.test.mjs scripts/projects-time-window.test.mjs scripts/audio-recording-levels.test.mjs scripts/chat-sidebar-row-menu.test.mjs scripts/navigation-gesture.test.mjs scripts/right-slot-width.test.mjs scripts/transcript-fade.test.mjs scripts/agents-config-probe-cadence.test.mjs scripts/turn-segments.test.mjs scripts/chat-device-model.test.mjs scripts/org-teams-summary.test.mjs scripts/markdown-table-widths.test.mjs scripts/turn-answer-rail.test.mjs scripts/scrollbar-activity.test.mjs",
|
|
80
80
|
"check-themes": "node scripts/generate-theme-css.mjs --check && node scripts/contrast-contract.mjs",
|
|
81
81
|
"check-vendored": "node scripts/check-vendored.mjs",
|
|
82
82
|
"check-evidence": "node scripts/check-evidence.mjs",
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
"appId": "com.local-operator",
|
|
226
226
|
"electronVersion": "44.3.0",
|
|
227
227
|
"productName": "Local Operator",
|
|
228
|
-
"copyright": "Copyright
|
|
228
|
+
"copyright": "Copyright \u00a9 2025 Radient Inc.",
|
|
229
229
|
"asar": {
|
|
230
230
|
"smartUnpack": false
|
|
231
231
|
},
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./legacy-agents-page-C6kd3fjG.js","./index-Dn3kYWFt.js","./index-D8ujEXbz.css","./index-COUHPq03.js","./aida-control-BuMafqCb.js","./ui-preferences-store-BmAT9G_p.js","./textarea-DsHM-W2p.js","./error-boundary-CdtTgj_c.js","./console-mirror-45f9-7QH.js","./console-mirror-DOrYoP_4.css","./index-2qmFWi_F.css","./page-header-Dt6h8jvu.js","./settings-section-DMXSpP_D.js","./use-memberships-query-PWqngUAl.js","./org-surface-gate-CjPxDSXP.js","./radient-auth-buttons-CCXHTNWU.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{aO as Ze,aP as Ne,$ as de,aQ as et,a3 as Fe,aR as Oe,U as je,aS as _e,aT as tt,a4 as st,aU as nt,aV as at,aW as rt,aX as we,aY as it,a6 as ot,aZ as lt,a_ as ct,a$ as Me,a5 as dt,b0 as ut}from"./index-COUHPq03.js";import{r as l,j as e,c as ee}from"./index-Dn3kYWFt.js";import{v as mt,a as Ue,u as ht,J as ft,h as V,d as ce,y as pe,D as gt,j as qe,B as pt}from"./aida-control-BuMafqCb.js";import{c as xt,p as _,B as E,a as ue,q as jt,r as bt,f as se,A as Q,h as X,i as Z,I as ae,s as Be,t as Pe,u as ze,v as We,w as me,x as ye,y as he,M as yt,z as vt,E as kt,F as Se}from"./textarea-DsHM-W2p.js";import{c as Nt}from"./ui-preferences-store-BmAT9G_p.js";import"./error-boundary-CdtTgj_c.js";import"./console-mirror-45f9-7QH.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 wt=[["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"}]],St=xt("log-in",wt),Ct=["A reviewer that only reads code","Add the coder twice to release-crew","A team called shipping with a manager and two coders"],Et={idle:"bg-ink-dim",running:"bg-accent",stopping:"bg-warning",done:"bg-success",stopped:"bg-ink-muted",error:"bg-danger"};function At({status:t,pulse:s}){return e.jsx("span",{"aria-hidden":"true",className:ee("size-2 shrink-0 rounded-full",Et[t]??"bg-ink-dim",s&&"animate-pulse")})}function Dt({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 Ce({run:t,onDismiss:s}){const[n,a]=l.useState(!1),r=l.useRef(null),d=t.status==="running"||t.status==="stopping";l.useEffect(()=>{if(!d)return;const f=x=>{x.key!=="Escape"||x.defaultPrevented||document.querySelector('[role="alertdialog"], [role="dialog"]')||r.current?.focus()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[d]);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(At,{status:t.status,pulse:d}),e.jsx("span",{"aria-live":"polite",className:"text-body-sm text-ink",children:h}),(d||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(E,{variant:"ghost",size:"sm","aria-expanded":n,onClick:()=>a(f=>!f),children:[n?e.jsx(jt,{className:"size-3.5"}):e.jsx(bt,{className:"size-3.5"}),"Watch"]}):null,d?e.jsxs(E,{ref:r,variant:"secondary",size:"sm",disabled:t.status==="stopping",onClick:()=>void t.stop(),children:[e.jsx(mt,{className:"size-3.5"}),t.status==="stopping"?"Stopping…":"Stop"]}):e.jsx(E,{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(Dt,{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(Tt,{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(E,{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 Tt({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 Ke({run:t,hero:s=!1,blockedReason:n,about:a,onClearAbout:r,onStripHeightChange:d}){const h=l.useRef(null),f=l.useRef(null),x=l.useCallback(u=>{if(f.current?.disconnect(),f.current=null,!d)return;if(!u){d(0);return}const w=()=>d(u.getBoundingClientRect().height);if(w(),typeof ResizeObserver>"u")return;const A=new ResizeObserver(w);A.observe(u),f.current=A},[d]),o=t.status==="running"||t.status==="stopping",c=!t.enabled||o||!!n,y=a?`Change ${a.name}…`:t.enabled?"Ask for a new agent or change a team…":"Configure agents by conversation",j=a?`${a.kind}:${a.name}`:null;l.useEffect(()=>{if(!j)return;const u=h.current;if(!u||u.disabled)return;u.focus();const w=u.value.length;u.setSelectionRange?.(w,w)},[j]);const S=()=>{const u=t.draft.trim();!u||c||t.start(u,a)},b=()=>{t.dismiss(),h.current?.focus()},T=()=>{r(),h.current?.focus()};return e.jsxs("div",{className:ee("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(Ce,{run:t,onDismiss:b}):e.jsx("div",{ref:x,className:"absolute inset-x-0 bottom-full rounded-t-md border-hairline border bg-canvas p-3",children:e.jsx(Ce,{run:t,onDismiss:b})}):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(E,{variant:"ghost",size:"sm",onClick:T,children:"Clear"})]}):null,e.jsx("label",{className:"sr-only",htmlFor:"config-composer-input",children:y}),e.jsx(ue,{id:"config-composer-input",ref:h,"aria-describedby":"config-composer-note",className:"min-h-16",placeholder:y,value:t.draft,disabled:c||!t.enabled,onChange:u=>t.setDraft(u.target.value),onKeyDown:u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S())}}),t.enabled&&!a&&!o&&!t.draft?e.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:Ct.map(u=>e.jsx(E,{variant:"outline",size:"sm",disabled:c,onClick:()=>{t.setDraft(u),h.current?.focus()},children:u},u))}):null,e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-2",children:[e.jsx(E,{variant:"primary",disabled:c||!t.draft.trim(),onClick:S,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 Ee=(t,s)=>t.kind===s.kind&&t.name===s.name;function It(t){return`${t.kind}:${t.name}`}const K=Nt(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=>Ee(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(r=>({...r.target,created:r.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=>!Ee(a,s))}))})),$t=new Set(["agent","team"]);function Rt(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",r=n?{kind:a,name:n}:null,d=t.phase==="done"&&!t.isError&&!t.notRunReason&&!t.neverSent,h=f=>({writes:f&&d});switch(s){case"create":return{verb:n?`Creating ${a} ${n}`:`Creating a ${a}`,target:r,...h(!0)};case"update":return{verb:n?`Updating ${a} ${n}`:`Updating a ${a}`,target:r,...h(!0)};case"install":return{verb:n?`Installing ${n}`:"Installing an agent",target:r,...h(!0)};case"list":case"search":case"show":return{verb:n?`Reading ${n}`:`Reading ${a}s`,target:r,...h(!1)};default:return{verb:t.phase==="running"?`Working on ${a}s`:`Checked ${a}s`,target:r,...h(!0)}}}const Lt={description:"description",kind:"kind",tools:"tools",effort:"effort tier",delegate:"delegation",action_class:"class",manager:"manager",members:"members",instructions:"instructions"};function Ft(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)}}function Ot(t){return{description:t.description??"",manager:t.manager??"",members:(t.members??[]).map(s=>`${s.kind}:${s.role}x${s.count}`).sort().join(",")}}function Ae(t,s){return{agents:Object.fromEntries((t??[]).map(n=>[n.name,Ft(n)])),teams:Object.fromEntries((s??[]).map(n=>[n.name,Ot(n)]))}}function _t(t,s){if(t===s)return"tools";const n=f=>f==="*"?null:new Set(f.split(",")),a=n(t),r=n(s);if(r===null)return"tools widened to every tool";if(a===null)return"tools narrowed to a list";const d=[...r].filter(f=>!a.has(f)),h=[...a].filter(f=>!r.has(f));return d.length&&!h.length?d.length===1?`tool added: ${d[0]}`:`${d.length} tools added`:h.length&&!d.length?h.length===1?`tool removed: ${h[0]}`:`${h.length} tools removed`:"tools changed"}function Mt(t,s,n){if(t==="tools")return _t(s,n);if(t==="delegate")return n==="true"?"delegation turned on":"delegation turned off";if(t==="members"){const a=r=>r?r.split(",").length:0;return`members changed (${a(s)} to ${a(n)})`}return`${Lt[t]??t} changed`}function Ut(t,s,n){const a=[],r=new Set;for(const d of n){const h=`${d.kind}:${d.name}`;if(r.has(h))continue;r.add(h);const f=t[d.kind==="agent"?"agents":"teams"][d.name],x=s[d.kind==="agent"?"agents":"teams"][d.name];if(!x)continue;if(!f){a.push({target:d,created:!0,changes:[]});continue}const o=[];for(const c of Object.keys(x))x[c]!==f[c]&&o.push({label:Mt(c,f[c],x[c]),before:f[c],after:x[c]});a.push({target:d,created:!1,changes:o})}for(const[d,h]of[["agent",s.agents],["team",s.teams]])for(const f of Object.keys(h))r.has(`${d}:${f}`)||(d==="agent"?t.agents[f]:t.teams[f])||a.push({target:{kind:d,name:f},created:!0,changes:[]});return a}function qt(t){return ce(t,"agents_config")&&ce(t,"session_interrupt")&&ce(t,"profile_catalogue")&&ce(t,"team_catalogue")}function Bt(t){if(!(t instanceof gt)||t.status!==409)return null;const n=t.detail?.session_id;return typeof n=="string"&&n.length>0?n:null}function Pt(t,s){const[n,a]=l.useState(()=>Date.now());return l.useEffect(()=>{if(!t||!s)return;const r=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(r)},[t,s]),t?Math.max(0,n-t):0}function zt(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 De(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 Wt(t){const n=t?.payload?.frontend;if(!n||typeof n!="object")return null;const a=n.streaming;if(typeof a=="boolean")return a;const r=n.snapshot?.streaming;return typeof r=="boolean"?r:null}function Kt(){const t=Ue(),s=qt(t.data),n=ht(),a=K(),[r,d]=l.useState(!1),[h,f]=l.useState(!1),x=l.useRef(!1),o=a.status==="running"||a.status==="stopping",c=ft(a.sessionId??void 0,!!a.sessionId),y=l.useMemo(()=>De(c.transcript?.records),[c.transcript?.records]);Ze(a.sessionId??void 0,c.subscriptionId);const j=c.transcript?.records,S=l.useRef(j);l.useEffect(()=>{S.current=j},[j]);const b=l.useMemo(()=>(c.transcript?.records??[]).filter(k=>k.kind==="tool"&&$t.has(k.toolName)).map(k=>({...Rt({toolName:k.toolName,args:k.args??null,phase:k.phase,ts:k.ts,isError:k.isError,notRunReason:k.notRunReason,neverSent:k.neverSent}),ts:k.ts})),[c.transcript]);l.useEffect(()=>{if(o)for(const p of b)p.target&&p.writes&&a.noteTouched(p.target)},[b,o,a]);const T=o&&b.length>0?b[b.length-1].verb:null,u=zt(Pt(a.startedAt,o)),w=l.useCallback(async(p,k="")=>{if(x.current)return;x.current=!0;const M=a.before;let N=[];try{const[$,R]=await Promise.all([V({op:"profiles.list"}),V({op:"teams.list"})]);M&&(N=Ut(M,Ae($.profiles,R.teams),a.touched))}catch{K.getState().fail("The run finished, but the agents and teams lists could not be read to describe what changed."),Ne(n);return}if(Ne(n),K.getState().settle(N,p,k),p==="done"&&N.length>0){const $=N.filter(R=>R.created).length;de($>0?`Configuration run finished: ${N.length} definition${N.length===1?"":"s"} changed.`:`Configuration run finished: ${N.length} definition${N.length===1?"":"s"} updated.`)}},[n,a.before,a.touched]);l.useEffect(()=>{if(o){if(c.failure){K.getState().fail(c.failure.statement);return}x.current||c.frontend&&(c.frontend.streaming||c.turnsCompleted!==0&&w(a.status==="stopping"?"stopped":"done",y))}},[o,y,c.failure,c.frontend,c.turnsCompleted,a.status,w]),l.useEffect(()=>{const p=a.sessionId;if(!o||!p)return;let k=!1;const M=async()=>{if(!(k||x.current))try{const R=await V({op:"sessions.get",sessionId:p});if(k||x.current||Wt(R)!==!1)return;const O=De(S.current);if(!O)return;w(K.getState().status==="stopping"?"stopped":"done",O)}catch{}},N=setTimeout(()=>void M(),400),$=setInterval(()=>void M(),4e3);return()=>{k=!0,clearTimeout(N),clearInterval($)}},[o,a.sessionId,w]);const A=async(p,k)=>{if(r||!p.trim())return;d(!0),f(!1),x.current=!1;const M=Ae(n.getQueryData(["desktop","profiles"]),n.getQueryData(["desktop","teams"])),N=k?`About the ${k.kind} “${k.name}”: ${p.trim()}`:p.trim();try{let $;try{$=(await V({op:"sessions.create",requestId:crypto.randomUUID(),purpose:"agents-config"})).session_id}catch(R){const O=Bt(R);if(O){f(!0),a.adopt(O,p.trim(),M);return}throw R}a.adopt($,N,M),await B($,N),a.acceptDraft()}catch($){const R=K.getState().sessionId;K.getState().failUnsent(pe($,R?"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{d(!1)}},B=async(p,k)=>{await V({op:"sessions.message",sessionId:p,requestId:crypto.randomUUID(),text:k})},F=async()=>{const p=K.getState();if(!(r||!p.unsent||!p.sessionId||!p.topic)){d(!0);try{await B(p.sessionId,p.topic),a.acceptDraft(),a.adopt(p.sessionId,p.topic,p.before),x.current=!1}catch(k){K.getState().failUnsent(pe(k,"The request could not be sent. It is still in the box."))}finally{d(!1)}}},q=async()=>{const p=K.getState().sessionId;if(p){a.stopping();try{await et(p,crypto.randomUUID())}catch(k){K.getState().stopFailed(pe(k,"The run did not acknowledge the request."))}}},v=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:v,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:T,elapsed:u,activity:b,start:A,stop:q,retry:F,canRetry:a.unsent&&!!a.sessionId,dismiss:a.dismiss,starting:r,attached:h}}const Vt=/Value error,\s*([\s\S]*?)\s*\[type=/,Gt=/^\d+ validation errors? for \S+[\s\S]*?\n\s*/i,Ht=/\s*\[type=[^\]]*\][\s\S]*$/m,Jt=/\s*For further information visit \S+/g,Yt=/'([^']+)' already exists/,Qt=/cannot contain spaces or path separators/i,Xt=/effort tier '([^']+)' is unavailable/i,Zt=/team name must be/i,es=/manager '([^']+)'/i,ts=/(?:member|role) '([^']+)' (?:is not|does not)/i,ss=/depth|cycle|circular/i,ns=/instructions/i,as=/description/i;function rs(t){const s=t.match(Vt);return s?.[1]?s[1].trim():t.replace(Gt,"").replace(Ht,"").replace(Jt,"").trim()}function fe(t){const s=rs(t),n=s.match(Yt);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(Qt.test(s))return{message:"Names cannot contain spaces or slashes.",field:"name"};const a=s.match(Xt);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(Zt))return{message:"A team name is 1-64 characters.",field:"name"};const d=s.match(es);if(d)return{message:`“${d[1]}” is not an agent or a team on this machine.`,field:"manager"};const h=s.match(ts);return h?{message:`“${h[1]}” is not an agent or a team on this machine.`,field:"members"}:ss.test(s)?{message:"That team would nest too deeply, or would contain itself. Check its members.",field:"members"}:ns.test(s)?{message:s,field:"instructions"}:as.test(s)?{message:s,field:"description"}:{message:s,field:null}}function is(t,s){const n=new Set(s),a=`${t}-copy`;if(!n.has(a))return a;for(let r=2;r<100;r+=1){const d=`${a}-${r}`;if(!n.has(d))return d}return a}function L({title:t,description:s,actions:n,children:a,className:r}){return e.jsxs("section",{className:ee("space-y-2 border-hairline border-t pt-4 first:border-t-0 first:pt-0",r),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 ne({text:t,empty:s="Nothing here yet.",mono:n=!1}){const[a,r]=l.useState(!1),[d,h]=l.useState(!1),f=l.useRef(null);return l.useEffect(()=>{if(a)return;const x=f.current;x&&h(!!t&&x.scrollHeight>x.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:ee("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}),d?e.jsx(E,{variant:"link",size:"sm",onClick:()=>r(x=>!x),children:a?"Show less":"Show all"}):null]}):e.jsx("p",{className:"text-body-sm text-ink-muted",children:s})}function Ve({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 Ge(t,s){l.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 ve({dirty:t,pending:s,onSave:n,onCancel:a,saveLabel:r="Save changes",pendingLabel:d="Saving…",dirtyHint:h,submit:f,confirming:x,onConfirmingChange:o}){const[c,y]=l.useState(!1),j=l.useRef(null),S=x!==void 0,b=S?x:c,T=u=>{S||y(u),o?.(u)};return l.useEffect(()=>{t||(S||y(!1),o?.(!1))},[t,S,o]),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(E,{ref:j,type:f?"submit":void 0,variant:"primary",onClick:f?void 0:n,disabled:s,children:s?d:r}),b?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-body-sm text-ink-muted",children:h??"Discard your unsaved changes?"}),e.jsx(E,{variant:"danger",onClick:a,children:"Discard changes"}),e.jsx(E,{variant:"ghost",onClick:()=>{T(!1),j.current?.focus()},children:"Keep editing"})]}):e.jsx(E,{variant:"ghost",onClick:()=>t?T(!0):a(),disabled:s,children:"Cancel"}),t&&!b?e.jsx("span",{className:"text-meta text-ink-muted",children:"Unsaved changes"}):null]})}let be=!1;function He(){be=!0}function Je(){const t=be;return be=!1,t}function os({rows:t=6}){return e.jsx("div",{className:"space-y-1","aria-hidden":"true",children:ls.slice(0,t).map(s=>e.jsx(se,{className:"h-11 w-full"},s))})}const ls=["a","b","c","d","e","f","g","h"];function Te(){return e.jsxs("div",{className:"max-w-3xl space-y-6","aria-hidden":"true",children:[e.jsx(se,{className:"h-7 w-64"}),e.jsx(se,{className:"h-5 w-40"}),e.jsx(se,{className:"h-28 w-full"}),e.jsx(se,{className:"h-24 w-full"})]})}function Ie({title:t,what:s,meaning:n,onRetry:a,retrying:r=!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(E,{variant:"secondary",onClick:a,disabled:r,children:r?"Retrying…":"Retry"})]})}function G({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 cs=/^[A-Za-z0-9_.:-]{1,128}$/;function J(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 ds(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 us({profile:t}){return e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx(Ve,{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]})}function Ye({tools:t,onChange:s,error:n}){const[a,r]=l.useState(""),[d,h]=l.useState(null),f=l.useId(),x=()=>{const o=a.trim();if(o){if(!cs.test(o)){h("Tool names are letters, digits, dot, underscore, dash or colon.");return}if(t?.includes(o)){h("That tool is already listed.");return}h(null),r(""),s([...t??[],o])}};return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-body-sm",children:[e.jsx(ye,{checked:t===null,onCheckedChange:o=>s(o?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(o=>e.jsx("li",{children:e.jsxs(_,{variant:"outline",children:[o,e.jsx(E,{variant:"ghost",size:"sm","aria-label":`Remove ${o}`,onClick:()=>s(t.filter(c=>c!==o)),className:"ml-1 h-4 px-1",children:"×"})]})},o))}):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(G,{label:"Add a tool",htmlFor:f,error:d??n}),e.jsx(ae,{id:f,value:a,inputSize:"md",placeholder:"Tool name","aria-invalid":!!(d??n),onChange:o=>{r(o.target.value),h(null)},onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),x())}})]}),e.jsx(E,{variant:"secondary",onClick:x,disabled:!a.trim(),children:"Add"})]})]})]})}function ms({profile:t,teams:s,effortTiers:n,askEnabled:a,onSaved:r,onDuplicate:d,onOpenTeam:h,onAskAgent:f,onDirtyChange:x}){const[o,c]=l.useState(!1),[y,j]=l.useState(()=>J(t)),[S,b]=l.useState(()=>J(t)),[T,u]=l.useState(!1),[w,A]=l.useState(null),[B,F]=l.useState(null),[q,v]=l.useState(!1),[p,k]=l.useState(!1),[M,N]=l.useState(!1),$=l.useRef(null),R=Fe(),O=JSON.stringify(S)!==JSON.stringify(y);l.useEffect(()=>(x?.(o&&O),()=>x?.(!1)),[x,o,O]),l.useEffect(()=>{Je()&&requestAnimationFrame(()=>$.current?.focus())},[]),l.useEffect(()=>{if(o&&O)return;const i=J(t);j(i),b(i)},[t,o,O]),l.useEffect(()=>{if(!o){k(!1);return}const i=J(t);k(O&&JSON.stringify(i)!==JSON.stringify(y))},[t,o,O,y]);const W=()=>{c(!1),A(null),F(null),v(!1),N(!1);const i=J(t);j(i),b(i)};Ge(()=>{if(M){N(!1);return}O?N(!0):W()},o);const ie=async i=>{if(i?.preventDefault(),T)return;const g=ds(y,S);if(Object.keys(g).length===0){W();return}if(typeof g.instructions=="string"&&!g.instructions.trim()){A("Give the agent instructions."),F("instructions");return}u(!0),A(null),F(null);try{const I=await V({op:"profiles.update",name:t.name,requestId:crypto.randomUUID(),fields:g});c(!1),v(!1);const C=J(I);j(C),b(C),r(I.name),de(`Saved ${I.name}.`),requestAnimationFrame(()=>$.current?.focus())}catch(I){const C=fe(I instanceof Error?I.message:"The agent could not be saved.");A(C.message),F(C.field);const z=I?.status,H=typeof z=="number"&&z!==408&&z>=400&&z<500;v(!H),H||je("The save could not be confirmed. Check whether it was applied before retrying.")}finally{u(!1)}},Y=async()=>{if(!T){u(!0),A(null);try{const i=await V({op:"profiles.install",name:t.name,requestId:crypto.randomUUID()}),g=J(i);j(g),b(g),r(i.name),de(`Installed ${i.name}. It can be edited now.`),requestAnimationFrame(()=>$.current?.focus())}catch(i){const g=fe(i instanceof Error?i.message:"The agent could not be installed.");A(g.message),je(g.message)}finally{u(!1)}}},D=(s??[]).filter(i=>i.manager===t.name||(i.members??[]).some(g=>g.role===t.name)),P=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:$,tabIndex:-1,className:"text-title focus:outline-none",children:t.name}),e.jsx(us,{profile:t})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(E,{variant:"primary",onClick:()=>{qe.getState().stageDraft({kind:"agent",name:t.name}),R("/chat")},children:"New chat"}),P?e.jsxs(E,{variant:"secondary",onClick:Y,disabled:T,children:[e.jsx(St,{className:"size-4"}),T?"Installing…":"Install to edit"]}):e.jsx(E,{variant:"secondary",onClick:()=>{c(!0),A(null),F(null)},children:"Edit"}),e.jsx(E,{variant:"ghost",onClick:()=>d(t),children:"Duplicate as new agent"}),a?e.jsx(E,{variant:"ghost",onClick:()=>f(`Change the agent ${t.name}: `),children:"Ask for a change"}):null]})]}),P?e.jsxs(Q,{variant:"info",children:[e.jsx(X,{children:"Built-in agent"}),e.jsx(Z,{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,p?e.jsxs(Q,{variant:"warning","data-testid":"agent-conflict",children:[e.jsx(X,{children:"This changed while you were editing"}),e.jsxs(Z,{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(E,{variant:"secondary",size:"sm",className:"mt-2",onClick:W,children:"Reload the saved version"})]})]}):null,q?e.jsxs(Q,{variant:"danger","data-testid":"agent-unconfirmed",children:[e.jsx(X,{children:"The last save was not confirmed"}),e.jsx(Z,{children:"The backend did not answer, so the write may or may not have landed. Check the agent below, then edit again."})]}):null,w&&!B?e.jsxs(Q,{variant:"danger",role:"alert","data-testid":"agent-save-error",children:[e.jsx(X,{children:"That did not save"}),e.jsx(Z,{children:w})]}):null]}),e.jsx("form",{noValidate:!0,onSubmit:i=>{i.preventDefault(),ie(i)},className:"space-y-6",children:o?e.jsxs(e.Fragment,{children:[e.jsx(ge,{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:S.description,error:B==="description"?w:null,onChange:i=>b(g=>({...g,description:i}))}),e.jsx(ge,{title:"Instructions",description:"What the agent is told to do. This is the agent's whole behaviour.",label:"Instructions",value:S.instructions,rows:12,required:!0,error:B==="instructions"?w:null,onChange:i=>b(g=>({...g,instructions:i}))}),e.jsx(L,{title:"Tools",children:e.jsx(Ye,{tools:S.tools,error:B==="tools"?w:null,onChange:i=>b(g=>({...g,tools:i}))})}),e.jsx(L,{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(ye,{checked:S.delegate,onCheckedChange:i=>b(g=>({...g,delegate:i})),"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(G,{label:"Effort tier",htmlFor:"agent-effort",error:B==="effort"?w:null}),e.jsx(he,{ariaLabel:"Effort tier",showLabel:!1,placeholder:"Choose an effort tier",busyLabel:"Loading effort tiers",options:["inherit",...n].map(i=>({id:i,name:i,description:i==="inherit"?"Use the session's own effort":void 0})),selected:{id:S.effort,name:S.effort},onSelect:i=>b(g=>({...g,effort:i.id})),helperText:"Tiers come from the backend's subagent model settings."})]})]})}),e.jsx(ve,{submit:!0,confirming:M,onConfirmingChange:N,dirty:O,pending:T,onSave:()=>void ie(),onCancel:W,saveLabel:"Save changes",dirtyHint:"Discard your unsaved changes to this agent?"})]}):e.jsxs(e.Fragment,{children:[e.jsx(L,{title:"When to use it",children:e.jsx(ne,{text:t.description||"",empty:"No description yet — add one so a model knows when to pick this agent."})}),e.jsx(L,{title:"Instructions",children:e.jsx(ne,{text:t.instructions??t.packaged_instructions??"",empty:"No instructions yet."})}),e.jsx(L,{title:"Tools",children:t.tools&&t.tools.length>0?e.jsx("ul",{className:"flex flex-wrap gap-1.5",children:t.tools.map(i=>e.jsx("li",{children:e.jsx(_,{variant:"outline",children:i})},i))}):e.jsx(_,{variant:"neutral",children:"All tools"})}),e.jsxs(L,{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(L,{title:"Used by",description:"Teams that name this agent as a manager or a member.",children:D.length>0?e.jsx("ul",{className:"flex flex-wrap gap-x-3 gap-y-1",children:D.map(i=>e.jsx("li",{children:e.jsx(E,{variant:"link",onClick:()=>h(i.name),children:i.name})},i.id))}):e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No team uses it yet."})}),e.jsxs(L,{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(Oe,{summary:"Compare with the packaged instructions",className:"mt-2",children:e.jsx(ne,{text:t.packaged_instructions,mono:!0})}):null]})]})})]})}function ge({title:t,description:s,label:n,value:a,onChange:r,rows:d,required:h,error:f,fieldRef:x}){const o=l.useId();return e.jsxs(L,{title:t,description:s,children:[e.jsx(G,{label:n,htmlFor:o,error:f}),d?e.jsx(ue,{id:o,ref:x,value:a,rows:d,required:h,"aria-invalid":!!f,className:ee("min-h-0"),onChange:c=>r(c.target.value)}):e.jsx(ae,{id:o,value:a,"aria-invalid":!!f,onChange:c=>r(c.target.value)})]})}function hs({initial:t,takenNames:s,effortTiers:n,onDirtyChange:a,onSaved:r,onCancel:d}){const[h,f]=l.useState(()=>t?is(t.name,s):""),[x,o]=l.useState(t?.kind??"role"),[c,y]=l.useState(()=>t?{...J(t),description:t.description??""}:{description:"",instructions:"",tools:null,effort:"inherit",delegate:!1}),[j,S]=l.useState(!1),[b,T]=l.useState(null),[u,w]=l.useState(null),A=l.useRef(null),B=l.useRef(null);l.useEffect(()=>(a?.(!!(h.trim()||c.instructions.trim())),()=>a?.(!1)),[a,h,c.instructions]),l.useEffect(()=>{A.current?.focus(),A.current?.select()},[]);const F=async v=>{if(v?.preventDefault(),!j){if(!h.trim()){T("Give the agent a name."),w("name"),A.current?.focus();return}if(/[\\/\s]/.test(h.trim())){T("Names cannot contain spaces or slashes."),w("name"),A.current?.focus();return}if(s.includes(h.trim())){T(`An agent called “${h.trim()}” already exists. Choose another name, or open the existing one to change it.`),w("name"),A.current?.focus();return}if(!c.instructions.trim()){T("Give the agent instructions."),w("instructions"),B.current?.focus();return}S(!0),T(null),w(null);try{const p=await V({op:"profiles.create",requestId:crypto.randomUUID(),name:h.trim(),fields:{kind:x,description:c.description,instructions:c.instructions,tools:c.tools??[],effort:c.effort,delegate:c.delegate}});de(`Created ${p.name}.`),He(),r(p.name)}catch(p){const k=fe(p instanceof Error?p.message:"The agent could not be created.");T(k.message),w(k.field)}finally{S(!1)}}},q=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:q}),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."})]}),b&&!u?e.jsxs(Q,{variant:"danger",role:"alert","data-testid":"agent-create-error",children:[e.jsx(X,{children:"That did not save"}),e.jsx(Z,{children:b})]}):null,e.jsxs("form",{noValidate:!0,onSubmit:v=>{v.preventDefault(),F(v)},className:"space-y-6",children:[e.jsx(L,{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(G,{label:"Name",htmlFor:"agent-create-name",error:u==="name"?b:null}),e.jsx(ae,{id:"agent-create-name",ref:A,value:h,required:!0,"aria-invalid":u==="name",onChange:v=>f(v.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(G,{label:"How it works with others",htmlFor:"agent-create-kind"}),e.jsxs(Be,{value:x,onValueChange:v=>o(v),children:[e.jsx(Pe,{id:"agent-create-kind",children:e.jsx(ze,{})}),e.jsxs(We,{children:[e.jsx(me,{value:"role",children:"You can chat with it directly"}),e.jsx(me,{value:"specialist",children:"Other agents can call on it"})]})]})]})]})}),e.jsx(ge,{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:c.description,error:u==="description"?b:null,onChange:v=>y(p=>({...p,description:v}))}),e.jsx(ge,{title:"Instructions",description:"What the agent is told to do. This is the agent's whole behaviour.",label:"Instructions",value:c.instructions,rows:12,required:!0,fieldRef:B,error:u==="instructions"?b:null,onChange:v=>y(p=>({...p,instructions:v}))}),e.jsx(L,{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(ye,{checked:c.delegate,onCheckedChange:v=>y(p=>({...p,delegate:v})),"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(G,{label:"Effort tier",htmlFor:"agent-create-effort"}),e.jsx(he,{ariaLabel:"Effort tier",showLabel:!1,busyLabel:"Loading effort tiers",placeholder:"Choose an effort tier",options:["inherit",...n].map(v=>({id:v,name:v,description:v==="inherit"?"Use the session's own effort":"A tier configured in Settings"})),selected:{id:c.effort,name:c.effort},onSelect:v=>y(p=>({...p,effort:v.id}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-body-sm text-ink-muted",children:"Tools"}),e.jsx(Ye,{tools:c.tools,error:u==="tools"?b:null,onChange:v=>y(p=>({...p,tools:v}))})]})]})}),e.jsx(ve,{submit:!0,dirty:!!(h.trim()||c.instructions),pending:j,saveLabel:t?"Create the copy":"Create agent",pendingLabel:"Creating…",dirtyHint:"Discard this new agent?",onSave:()=>void F(),onCancel:d})]})]})}function le(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 fs(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,...r})=>r))!==JSON.stringify(t.members.map(({key:a,...r})=>r))&&(n.members=s.members.map(({key:a,...r})=>r)),s.instructions!==t.instructions&&(n.instructions=s.instructions),s.project!==t.project&&(n.project=s.project),n}function $e(t,s,n){return(t.kind==="agent"?(s??[]).map(r=>r.name):(n??[]).map(r=>r.name)).includes(t.role)}function Re({team:t,agents:s,teams:n,askEnabled:a,onSaved:r,onCancelCreate:d,onOpenAgent:h,onAskAgent:f,onDirtyChange:x}){const o=!t,[c,y]=l.useState(o),[j,S]=l.useState(t?.name??""),[b,T]=l.useState(()=>le(t)),[u,w]=l.useState(()=>le(t)),[A,B]=l.useState(!1),[F,q]=l.useState(null),[v,p]=l.useState(null),[k,M]=l.useState(!1),N=l.useRef(null),$=l.useRef(null),R=l.useRef(null);l.useEffect(()=>{Je()&&requestAnimationFrame(()=>N.current?.focus())},[]);const O=Fe(),W=o?!!(j.trim()||u.description||u.members.length):JSON.stringify(u)!==JSON.stringify(b);l.useEffect(()=>(x?.((o||c)&&W),()=>x?.(!1)),[x,o,c,W]),l.useEffect(()=>{if(c&&W)return;const i=le(t);T(i),w(i)},[t,c,W]);const re=()=>{if(o){d?.();return}y(!1),q(null),p(null),M(!1);const i=le(t);T(i),w(i)};Ge(()=>{if(k){M(!1);return}W?M(!0):re()},c);const Y=async i=>{if(i?.preventDefault(),!A){if(o&&!j.trim()){q("Give the team a name."),p("name"),R.current?.focus();return}if(o&&/[\\/\s]/.test(j.trim())){q("Names cannot contain spaces or slashes."),p("name"),R.current?.focus();return}if(o&&(n??[]).some(g=>g.name===j.trim())){q(`A team called “${j.trim()}” already exists. Open it to change it, or choose another name.`),p("name"),R.current?.focus();return}if(o&&!u.instructions.trim()){q("Give the team instructions."),p("instructions"),$.current?.focus();return}B(!0),q(null),p(null);try{const g=t?await V({op:"teams.update",name:t.name,requestId:crypto.randomUUID(),fields:fs(b,u)}):await V({op:"teams.create",requestId:crypto.randomUUID(),fields:{name:j,description:u.description,manager:u.manager,members:u.members.map(({key:C,...z})=>z),instructions:u.instructions,project:u.project}}),I=le(g);T(I),w(I),y(!1),r(g.name),de(`${o?"Created":"Saved"} ${g.name}.`),o&&He(),requestAnimationFrame(()=>N.current?.focus())}catch(g){const I=fe(g instanceof Error?g.message:"The team could not be saved.");q(I.message),p(I.field),je(I.message)}finally{B(!1)}}},D=(i,g)=>w(I=>({...I,members:I.members.map((C,z)=>z===i?{...C,...g}:C)})),P=(u.members.length?u.members:t?.members??[]).reduce((i,g)=>i+(g.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:N,tabIndex:-1,className:"text-title focus:outline-none",children:t?t.name:"New team"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx(_,{variant:"neutral",children:P===1?"1 agent":`${P} agents`}),u.members.some(i=>i.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(E,{variant:"primary",onClick:()=>{qe.getState().stageDraft({kind:"team",name:t.name}),O("/chat")},children:"New team chat"}),c?null:e.jsx(E,{variant:"secondary",onClick:()=>y(!0),children:"Edit"}),a?e.jsx(E,{variant:"ghost",onClick:()=>f(`Change the team ${t.name}: `),children:"Ask for a change"}):null]}):null]}),F&&!v?e.jsxs(Q,{variant:"danger",role:"alert","data-testid":"team-save-error",children:[e.jsx(X,{children:"That did not save"}),e.jsx(Z,{children:F})]}):null]}),e.jsx("form",{noValidate:!0,onSubmit:i=>{i.preventDefault(),Y(i)},className:"space-y-6",children:o||c?e.jsxs(e.Fragment,{children:[o?e.jsxs(L,{title:"Name",description:"How you and your chats will refer to this team.",children:[e.jsx(G,{label:"Team name",htmlFor:"team-name",error:v==="name"?F:null}),e.jsx(ae,{ref:R,id:"team-name","data-testid":"team-name-input",value:j,required:!0,maxLength:64,autoFocus:!0,"aria-invalid":v==="name",onChange:i=>S(i.target.value)})]}):null,e.jsx(L,{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(G,{label:"Manager agent",htmlFor:"team-manager",error:v==="manager"?F:null}),e.jsx(he,{ariaLabel:"Manager agent",showLabel:!1,placeholder:"Choose a manager",busyLabel:"Loading agents",options:te(s,n),selected:te(s,n).find(i=>i.id===u.manager)??null,onSelect:i=>w(g=>({...g,manager:i.id})),onCustomSubmit:i=>w(g=>({...g,manager:i})),listNotice:"Agents and teams on this machine"}),te(s,n).some(i=>i.id===u.manager)?null:e.jsxs(_,{variant:"warning","data-testid":"team-manager-missing",children:["Not found: ",u.manager]})]})}),e.jsx(L,{title:"Members",description:"Who the manager can delegate to, and how many of each.",children:e.jsxs("div",{className:"space-y-2",children:[u.members.map((i,g)=>{const I=!$e(i,s,n);return e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"w-56",children:e.jsx(he,{ariaLabel:`Member ${g+1}`,showLabel:!1,placeholder:"Choose an agent or team",busyLabel:"Loading agents",options:[...te(s,n).filter(C=>i.kind==="team"?C.group==="Teams":C.group==="Agents")],selected:te(s,n).find(C=>C.id===i.role)??null,onSelect:C=>D(g,{role:C.id,kind:C.group==="Teams"?"team":"agent"}),onCustomSubmit:C=>D(g,{role:C})})}),e.jsxs(Be,{value:i.kind,onValueChange:C=>D(g,{kind:C}),children:[e.jsx(Pe,{"aria-label":`Member ${g+1} kind`,className:"w-32",children:e.jsx(ze,{})}),e.jsxs(We,{children:[e.jsx(me,{value:"agent",children:"Agent"}),e.jsx(me,{value:"team",children:"Team"})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(E,{variant:"secondary",size:"icon-sm","aria-label":`One fewer ${i.role}`,disabled:i.count<=1,onClick:()=>D(g,{count:i.count-1}),children:e.jsx(yt,{"aria-hidden":"true"})}),e.jsx("span",{className:"min-w-6 text-center text-body-sm tabular-nums","aria-label":`${i.count} of ${i.role}`,children:i.count}),e.jsx(E,{variant:"secondary",size:"icon-sm","aria-label":`One more ${i.role}`,disabled:i.count>=16,onClick:()=>D(g,{count:i.count+1}),children:e.jsx(_e,{"aria-hidden":"true"})})]}),e.jsx(E,{variant:"ghost",onClick:()=>w(C=>({...C,members:C.members.filter((z,H)=>H!==g)})),children:"Remove"}),I?e.jsxs(_,{variant:"warning",children:["Not found: ",i.role]}):null]},i.key)}),e.jsx(E,{variant:"secondary",onClick:()=>w(i=>({...i,members:[...i.members,{role:"",count:1,kind:"agent",key:crypto.randomUUID()}]})),children:"Add member"})]})}),e.jsxs(L,{title:"Description",children:[e.jsx(G,{label:"What this team is for",htmlFor:"team-description",error:v==="description"?F:null}),e.jsx(ae,{id:"team-description",value:u.description,onChange:i=>w(g=>({...g,description:i.target.value}))})]}),e.jsxs(L,{title:"Collaboration instructions",children:[v==="instructions"?e.jsx("p",{className:"text-meta text-danger",role:"alert","data-testid":"team-instructions-error",children:F}):null,e.jsx(ue,{ref:$,"aria-label":"Collaboration instructions","aria-invalid":v==="instructions",className:"min-h-36",maxLength:8e3,value:u.instructions,onChange:i=>w(g=>({...g,instructions:i.target.value}))})]}),e.jsx(L,{title:"Project brief",children:e.jsx(ue,{"aria-label":"Project brief",className:"min-h-36",maxLength:8e3,value:u.project,onChange:i=>w(g=>({...g,project:i.target.value}))})}),e.jsx(ve,{submit:!0,confirming:k,onConfirmingChange:M,dirty:W,pending:A,saveLabel:o?"Create team":"Save changes",pendingLabel:o?"Creating…":"Saving…",dirtyHint:"Discard this team?",onSave:()=>void Y(),onCancel:re})]}):e.jsxs(e.Fragment,{children:[e.jsx(L,{title:"Manager",description:"The agent that leads the chat.",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(E,{variant:"link",onClick:()=>h(u.manager),children:u.manager}),te(s,n).some(i=>i.id===u.manager)?null:e.jsx(_,{variant:"warning","data-testid":"team-manager-missing",children:"Not found"})]})}),e.jsx(L,{title:"Members",children:e.jsx("ul",{className:"space-y-1",children:(t?.members??[]).map(i=>e.jsxs("li",{className:"flex flex-wrap items-center gap-2 text-body-sm",children:[e.jsx("span",{className:"text-ink",children:i.role}),e.jsx(_,{variant:"neutral",children:i.kind==="team"?"Team":"Agent"}),e.jsx("span",{className:"text-ink-muted",children:i.count===1?"×1":`×${i.count}`}),$e(i,s,n)?null:e.jsx(_,{variant:"warning","data-testid":"team-member-missing",children:"Not found"})]},`${i.kind}:${i.role}`))})}),e.jsx(L,{title:"What it is for",children:e.jsx(ne,{text:t?.description??"",empty:"No description yet."})}),t?.instructions?e.jsx(L,{title:"Collaboration instructions",children:e.jsx(ne,{text:t.instructions})}):null,t?.project?e.jsx(Oe,{summary:"Project brief",children:e.jsx(ne,{text:t.project})}):null]})})]})}function te(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 gs=l.lazy(()=>ut(()=>import("./legacy-agents-page-C6kd3fjG.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}))),Le=/^subagents\.models\.([^.]+)$/,ps=["lo","med","hi"],xe={all:"All",custom:"Custom",installed:"Installed",builtin:"Built-in"};function As(){const t=tt("surface"),{agentId:s}=st(),[n,a]=nt(),r=n.get("kind")==="team"||n.get("create")==="team",d=n.has("create"),h=n.get("name"),f=n.get("duplicate"),x=Ue(),o=ce(x.data,r?"team_catalogue":"profile_catalogue"),c=at(o),y=rt(o),j=o&&!!h&&!d,S=we(r?null:h,j),b=it(r?h:null,j),T=we(r?null:f,!!f),[u,w]=l.useState(""),[A,B]=l.useState("all"),[F,q]=l.useState(null),[v,p]=l.useState(null),[k,M]=l.useState(0),N=Kt(),$=K(m=>m.marks),R=K(m=>m.clearMark),O=pt({queryKey:["desktop","settings","effort-tiers"],enabled:o,queryFn:()=>V({op:"settings.list"}),staleTime:6e4}),W=l.useMemo(()=>(O.data?.settings??[]).filter(m=>{const U=m.key.match(Le)?.[1];return!U||!ps.includes(U)?!1:typeof m.value=="string"&&m.value.trim().length>0}).map(m=>m.key.match(Le)?.[1]).filter(m=>!!m),[O.data]),re=l.useMemo(()=>bs(c.data,u,A),[c.data,u,A]),ie=l.useMemo(()=>ys(y.data,u),[y.data,u]),Y=r?ie:re,D=h??null,P=l.useCallback(m=>{const U=new URLSearchParams;(m.kind??(r?"team":"agent"))==="team"&&U.set("kind","team"),m.name&&U.set("name",m.name),m.create!==null&&m.create!==void 0&&U.set("create",m.create),m.duplicate&&U.set("duplicate",m.duplicate),q(null),a(U)},[r,a]),i=`${r?"team":"agent"}:${d??""}:${D??""}`,g=l.useCallback(m=>p(m?i:null),[i]),I=v!==null&&v===i,C=l.useCallback(m=>{if(I){q(m);return}P(m)},[I,P]);l.useEffect(()=>{const m=U=>{U.key!=="Escape"||U.defaultPrevented||window.matchMedia("(max-width: 999px)").matches&&(!D&&!d||(U.preventDefault(),C({name:null})))};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[C,D,d]),l.useEffect(()=>{const m=K.getState(),U=m.about;if(!U)return;const ke=r?"team":"agent";D&&U.kind===ke&&U.name===D||(N.setAbout(null),m.draft.trim()===`Change the ${U.kind} ${U.name}:`.trim()&&N.setDraft(""))},[D,r,N]),l.useEffect(()=>{D&&R({kind:r?"team":"agent",name:D})},[D,r,R]);const z=()=>{c.refetch(),y.refetch(),S.refetch(),b.refetch()};if(s)return e.jsx(l.Suspense,{fallback:e.jsx("p",{className:"p-6 text-body",children:"Loading saved agent…"}),children:e.jsx(gs,{})});const H=r?b.error:S.error,oe=r?y.error:c.error,Qe=o&&!oe&&!d&&!D,Xe=r?b.isLoading:S.isLoading;return e.jsxs("div",{className:"flex h-full min-h-0 bg-canvas text-ink",children:[e.jsxs("aside",{ref:t,"data-open":D?"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(vt,{value:r?"team":"agent",onValueChange:m=>C({kind:m,name:null}),children:e.jsxs(kt,{"aria-label":"Browse definitions by type",className:"w-full",children:[e.jsxs(Se,{value:"agent",className:"flex-1","data-testid":"agents-tab",children:[e.jsx(ot,{className:"size-3.5"}),"Agents",c.data?e.jsx("span",{className:"min-w-[2ch] font-normal text-ink-dim tabular-nums",children:c.data.length}):null]}),e.jsxs(Se,{value:"team",className:"flex-1","data-testid":"teams-tab",children:[e.jsx(lt,{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(ct,{"aria-hidden":"true",className:"pointer-events-none absolute top-2 left-2 size-4 text-ink-dim"}),e.jsx(ae,{className:"pl-8",type:"search","aria-label":"Search agents and teams",placeholder:r?"Search teams":"Search agents",value:u,onChange:m=>w(m.target.value)})]}),!r&&c.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(xe).map(m=>e.jsx(E,{variant:"ghost",size:"sm","aria-pressed":A===m,onClick:()=>B(m),className:ee(A===m&&Me),children:xe[m]},m))})]})]}):null,e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:oe?null:!c.data&&!y.data?e.jsx(os,{}):Y.length===0?e.jsx("p",{className:"px-1 py-2 text-body-sm text-ink-muted",children:u?`Nothing matches “${u}”.`:r?"No teams yet. Ask for one below, or add one by hand.":A==="all"?"No agents yet. Ask for one below, or add one by hand.":`No ${xe[A].toLowerCase()} agents.`}):e.jsx(js,{rows:Y,name:d?null:D,teamMode:r,marked:new Map($.map(m=>[It(m),m.created])),onOpen:m=>C({name:m})})}),e.jsxs(E,{variant:"secondary",disabled:!o,onClick:()=>C({create:r?"team":"agent"}),children:[e.jsx(_e,{className:"size-4"}),r?"Add team manually":"Add agent manually"]})]}),e.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[D||d?e.jsx("div",{className:"flex shrink-0 items-center border-hairline border-b px-4 py-2 min-[1000px]:hidden",children:e.jsxs(E,{variant:"ghost",size:"sm",onClick:()=>C({name:null}),children:[e.jsx(dt,{className:"size-4"}),"Back to the list"]})}):null,e.jsx("div",{className:"min-h-0 flex-1 overflow-auto p-6 pb-0",style:k>0?{paddingBottom:k+16}:void 0,children:o?oe?e.jsx(Ie,{title:r?"Teams could not be read":"Agents could not be read",what:oe instanceof Error?oe.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:z,retrying:c.isFetching||y.isFetching}):D&&Xe?e.jsx(Te,{}):D&&H?e.jsx(Ie,{title:r?`“${D}” could not be read`:`“${D}” could not be read`,what:H instanceof Error?H.message:"The request did not complete.",meaning:"The definition may have been removed, or the backend refused the read.",onRetry:()=>{S.refetch(),b.refetch()},retrying:S.isFetching||b.isFetching}):d&&r?e.jsx(Re,{agents:c.data,teams:y.data,askEnabled:N.enabled,onDirtyChange:g,onSaved:m=>{z(),P({name:m})},onCancelCreate:()=>P({name:null}),onOpenAgent:m=>C({kind:"agent",name:m}),onAskAgent:m=>{N.setAbout({kind:"team",name:h??""}),N.setDraft(m)}},"team:create"):d&&f&&T.isLoading?e.jsx(Te,{}):d?e.jsx(hs,{initial:T.data??null,takenNames:(c.data??[]).map(m=>m.name),effortTiers:W,onDirtyChange:g,onSaved:m=>{z(),P({name:m})},onCancel:()=>P({name:null})},"agent:create"):r&&b.data?e.jsx(Re,{team:b.data,agents:c.data,teams:y.data,askEnabled:N.enabled,onDirtyChange:g,onSaved:m=>{z(),P({name:m})},onOpenAgent:m=>C({kind:"agent",name:m}),onAskAgent:m=>{N.setAbout({kind:"team",name:b.data?.name??""}),N.setDraft(m)}},`team:${b.data.name}`):!r&&S.data?e.jsx(ms,{profile:S.data,teams:y.data,effortTiers:W,askEnabled:N.enabled,onDirtyChange:g,onSaved:m=>{z(),P({name:m})},onDuplicate:m=>C({create:"agent",duplicate:m.name}),onOpenTeam:m=>C({kind:"team",name:m}),onAskAgent:m=>{N.setAbout({kind:"agent",name:S.data?.name??""}),N.setDraft(m)}},`agent:${S.data.name}`):D?e.jsx(se,{className:"h-6 w-40"}):e.jsx(xs,{teamMode:r,run:N,onAddManually:()=>C({create:r?"team":"agent"})}):e.jsxs(Q,{variant:x.isLoading?"neutral":"warning",className:"max-w-xl",children:[e.jsx(X,{children:x.isLoading?"Connecting to the backend":x.error?"The backend could not be reached":"Reusable agents need a newer backend"}),e.jsx(Z,{children:x.isLoading?"Loading what this backend can do…":x.error?x.error.message:"Update the backend to manage reusable agents and teams. Saved chats are unchanged."})]})}),F?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:r?"Discard your unsaved changes to this team?":"Discard your unsaved changes to this agent?"}),e.jsx(E,{variant:"danger",onClick:()=>{p(null),P(F)},children:"Discard changes"}),e.jsx(E,{variant:"ghost",onClick:()=>q(null),children:"Keep editing"})]}):null,Qe?null:e.jsx("div",{className:"shrink-0 border-hairline border-t bg-canvas p-4",children:e.jsx(Ke,{run:N,about:N.about,onClearAbout:()=>N.setAbout(null),onStripHeightChange:M,blockedReason:I?"Finish or cancel your edit first.":null})})]})]})}function xs({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(Ke,{run:s,hero:!0,about:s.about,onClearAbout:()=>s.setAbout(null)}),e.jsx(E,{variant:"ghost",onClick:n,children:t?"Or add a team by hand":"Or add an agent by hand"})]})}function js({rows:t,name:s,teamMode:n,marked:a,onOpen:r}){const d=l.useRef(new Map),[h,f]=l.useState(s),x=(o,c)=>{const y=t.findIndex(S=>S.name===o);if(y<0)return;const j=t[Math.min(t.length-1,Math.max(0,y+c))];j&&(f(j.name),d.current.get(j.name)?.focus())};return e.jsx("ul",{"aria-label":n?"Teams":"Agents",className:"space-y-1",children:t.map(o=>{const c="source"in o,y=a.get(`${n?"team":"agent"}:${o.name}`);return e.jsx("li",{children:e.jsxs("button",{ref:j=>{j?d.current.set(o.name,j):d.current.delete(o.name)},type:"button","aria-current":o.name===s?"true":void 0,tabIndex:o.name===(h??t[0]?.name)?0:-1,"data-testid":`roster-row-${o.name}`,className:ee("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",o.name===s&&Me),onFocus:()=>f(o.name),onClick:()=>r(o.name),onKeyDown:j=>{j.key==="ArrowDown"?(j.preventDefault(),x(o.name,1)):j.key==="ArrowUp"?(j.preventDefault(),x(o.name,-1)):j.key==="Home"?(j.preventDefault(),x(o.name,-t.length)):j.key==="End"&&(j.preventDefault(),x(o.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:o.name}),c?e.jsx(Ve,{source:o.source,appearance:"text"}):null,y!==void 0?e.jsx(_,{variant:"attention","data-testid":"roster-row-updated",children:y?"New":"Updated"}):null]}),e.jsxs("span",{className:"flex w-full flex-wrap items-center gap-1.5",children:["members"in o?e.jsx(_,{variant:"neutral",children:o.members.length===1?"1 member":`${o.members.length} members`}):null,o.description?e.jsx("span",{className:"min-w-0 flex-1 truncate text-meta text-ink-muted",children:o.description}):null]})]})},o.name)})})}function bs(t,s,n){const a=s.trim().toLowerCase();return(t??[]).filter(r=>n==="builtin"&&r.source!=="builtin"||n==="installed"&&r.source!=="installed"||n==="custom"&&r.source!=="custom"?!1:a?r.name.toLowerCase().includes(a)||(r.description??"").toLowerCase().includes(a):!0)}function ys(t,s){const n=s.trim().toLowerCase();return(t??[]).filter(a=>!n||a.name.toLowerCase().includes(n)||(a.description??"").toLowerCase().includes(n))}export{As as AgentsPage};
|