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