local-operator-ui 0.34.44 → 0.34.46
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 +1051 -66
- package/out/preload/index.js +305 -18
- package/out/renderer/assets/{_basePickBy-C-GwcPo5.js → _basePickBy-hPi3fEQr.js} +1 -1
- package/out/renderer/assets/{_baseUniq-whkmDW6w.js → _baseUniq-BH6SqqsG.js} +1 -1
- package/out/renderer/assets/{agent-details-page-DpCpkTfN.js → agent-details-page-D6Sf3QUC.js} +2 -2
- package/out/renderer/assets/agent-hub-page-geh3R5Uy.js +11 -0
- package/out/renderer/assets/agents-page-CFjl9C1o.js +7 -0
- package/out/renderer/assets/arc-hK5DqZTp.js +1 -0
- package/out/renderer/assets/architectureDiagram-IEHRJDOE-Od2Y7WJh.js +36 -0
- package/out/renderer/assets/{blockDiagram-JOT3LUYC-Dp4G8uLX.js → blockDiagram-JOT3LUYC-Ctc7-wAT.js} +6 -6
- package/out/renderer/assets/{book-open-C9onOH1C.js → book-open-BWUyDXVa.js} +1 -1
- package/out/renderer/assets/browser-page-KrEaCKVz.js +1 -0
- package/out/renderer/assets/browser-webauthn-prompt-CKqDqDU5.js +1 -0
- package/out/renderer/assets/{c4Diagram-VJAJSXHY-CnX5ELGv.js → c4Diagram-VJAJSXHY-KjhfyGml.js} +1 -1
- package/out/renderer/assets/channel-Bs-Xt2ih.js +1 -0
- package/out/renderer/assets/{chunk-4BMEZGHF-DYgqjjvg.js → chunk-4BMEZGHF-DUs-A7ex.js} +1 -1
- package/out/renderer/assets/{chunk-A2AXSNBT-3DoU7E6Y.js → chunk-A2AXSNBT-LbRRk1xd.js} +1 -1
- package/out/renderer/assets/{chunk-AEK57VVT-OX8UcnIV.js → chunk-AEK57VVT-Ddc0Dk4L.js} +1 -1
- package/out/renderer/assets/{chunk-D6G4REZN-Dbt1r37J.js → chunk-D6G4REZN-Cj8PtGTg.js} +1 -1
- package/out/renderer/assets/{chunk-RZ5BOZE2-CdLKa5S8.js → chunk-RZ5BOZE2-KXGjmJKN.js} +1 -1
- package/out/renderer/assets/{chunk-XZIHB7SX-B_CjCOio.js → chunk-XZIHB7SX-B8dmznR7.js} +1 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-BrkzW__m.js +1 -0
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-BrkzW__m.js +1 -0
- package/out/renderer/assets/clone-CnlBeott.js +1 -0
- package/out/renderer/assets/{console-mirror-D1YYJxrt.js → console-mirror-cPzOwzR9.js} +14 -14
- package/out/renderer/assets/consoleCapture-ComgYGzq.js +1 -0
- package/out/renderer/assets/{conversation-input-sync-BbbcfWqh.js → conversation-input-sync-B5HfvhyR.js} +259 -261
- package/out/renderer/assets/dagre-OKDRZEBW-BaeP_npI.js +4 -0
- package/out/renderer/assets/diagram-SSKATNLV-BDwSJBgs.js +43 -0
- package/out/renderer/assets/diagram-VNBRO52H-Ce2_qnEd.js +24 -0
- package/out/renderer/assets/{erDiagram-Q7BY3M3F-Cs4yDA7g.js → erDiagram-Q7BY3M3F-DUpyMDtK.js} +1 -1
- package/out/renderer/assets/{error-boundary-YxH9ow-2.js → error-boundary-B4K6A3dS.js} +2 -2
- package/out/renderer/assets/{flowDiagram-4HSFHLVR-BofJ9_8f.js → flowDiagram-4HSFHLVR-Twa-e-xh.js} +1 -1
- package/out/renderer/assets/ganttDiagram-APWFNJXF-6IcdZzTN.js +257 -0
- package/out/renderer/assets/gitGraphDiagram-7IBYFJ6S-BHwjqSB2.js +65 -0
- package/out/renderer/assets/{graph-D3WT1lJS.js → graph-CjSBt2SL.js} +1 -1
- package/out/renderer/assets/index-BDqI882o.js +7 -0
- package/out/renderer/assets/index-C7mMgpwT.css +1 -0
- package/out/renderer/assets/index-fKRRIb8a.js +1 -0
- package/out/renderer/assets/index-o-e57W52.js +804 -0
- package/out/renderer/assets/infoDiagram-PH2N3AL5-DusuxGWy.js +2 -0
- package/out/renderer/assets/{installer-BzSW3GXd.js → installer-B4Bd2pBF.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-U35MCT3I-DVmD515J.js → journeyDiagram-U35MCT3I-ouPHBWbW.js} +1 -1
- package/out/renderer/assets/{kanban-definition-NDS4AKOZ-DpiJ7P3i.js → kanban-definition-NDS4AKOZ-BpfzQ_cF.js} +1 -1
- package/out/renderer/assets/{layout-BFA2wwh_.js → layout-DWM2xDwq.js} +1 -1
- package/out/renderer/assets/legacy-agents-page-DMWtT-nK.js +33 -0
- package/out/renderer/assets/{mermaid.core-C7iGmYcY.js → mermaid.core-C2AhDEdD.js} +5 -5
- package/out/renderer/assets/mesh-page-DI_FXBTf.js +1 -0
- package/out/renderer/assets/messages-Bf6oXWsi.js +3 -0
- package/out/renderer/assets/mindmap-definition-ALO5MXBD-CWFoHd9r.js +95 -0
- package/out/renderer/assets/mini-BVxX6iDv.js +1 -0
- package/out/renderer/assets/{notebook-pen-rCh1XFso.js → notebook-pen-CKFoYavJ.js} +1 -1
- package/out/renderer/assets/org-access-Cj7MYYx3.js +1 -0
- package/out/renderer/assets/org-surface-gate-B61_V5sH.js +1 -0
- package/out/renderer/assets/{page-header-DWR3DkBt.js → page-header-D90TvAM5.js} +1 -1
- package/out/renderer/assets/pieDiagram-IB7DONF6-C4p49jAq.js +30 -0
- package/out/renderer/assets/projects-page-D0OgNUWf.js +45 -0
- package/out/renderer/assets/publication-validation-DLHcjuJy.js +1 -0
- package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-u3qKyomE.js → quadrantDiagram-7GDLP6J5-By3GJSI3.js} +1 -1
- package/out/renderer/assets/{radar-MK3ICKWK-DTXBXOd-.js → radar-MK3ICKWK-n8dqb_zt.js} +1 -1
- package/out/renderer/assets/radient-auth-buttons-p_Axd8pX.js +1 -0
- package/out/renderer/assets/{requirementDiagram-KVF5MWMF-CIyOJzHO.js → requirementDiagram-KVF5MWMF-CQ7JllrS.js} +1 -1
- package/out/renderer/assets/sankeyDiagram-QLVOVGJD-DNyPn5zx.js +10 -0
- package/out/renderer/assets/{schedules-page-DHwzeRvF.js → schedules-page-R7SXiFmi.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-DCj3Ke6W.js → sequenceDiagram-X6HHIX6F-CUHeYZkr.js} +1 -1
- package/out/renderer/assets/{settings-page-Br0K0YLW.js → settings-page-BZ_HPCkT.js} +60 -60
- package/out/renderer/assets/stateDiagram-DGXRK772-CL_twVvQ.js +1 -0
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-ruz5Lapk.js +1 -0
- package/out/renderer/assets/{timeline-definition-BDJGKUSR-C4cCAtD2.js → timeline-definition-BDJGKUSR-BCcBGH9R.js} +1 -1
- package/out/renderer/assets/{use-download-agent-mutation-CRmN4Z4O.js → use-download-agent-mutation-B87MG4sW.js} +4 -4
- package/out/renderer/assets/use-memberships-query-DCEm9yOI.js +1 -0
- package/out/renderer/assets/{use-session-snapshot-DZAAvDEa.js → use-session-snapshot-CChKOZqb.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-VJFVF3MP-DG9g8Bz_.js → xychartDiagram-VJFVF3MP-CvHda-UX.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 +7 -7
- package/package.json +2 -2
- package/out/renderer/assets/agent-hub-page-CUIy_Kx2.js +0 -11
- package/out/renderer/assets/agents-page-2HbuAEbx.js +0 -7
- package/out/renderer/assets/arc-DDs-mKBJ.js +0 -1
- package/out/renderer/assets/architectureDiagram-IEHRJDOE-CPUUDGvU.js +0 -36
- package/out/renderer/assets/browser-page-DYIlDoNt.js +0 -1
- package/out/renderer/assets/browser-webauthn-prompt-BCVHqXb0.js +0 -1
- package/out/renderer/assets/channel-DMF6TPjP.js +0 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-B0EbOHV0.js +0 -1
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-B0EbOHV0.js +0 -1
- package/out/renderer/assets/clone-D1pjaXDr.js +0 -1
- package/out/renderer/assets/consoleCapture-B-w56zDU.js +0 -1
- package/out/renderer/assets/dagre-OKDRZEBW-Di-XleTu.js +0 -4
- package/out/renderer/assets/diagram-SSKATNLV-HX5Tirdq.js +0 -43
- package/out/renderer/assets/diagram-VNBRO52H-BkGCdAFk.js +0 -24
- package/out/renderer/assets/ganttDiagram-APWFNJXF-B8-HoTDC.js +0 -257
- package/out/renderer/assets/gitGraphDiagram-7IBYFJ6S-B72gxYgp.js +0 -65
- package/out/renderer/assets/index-B7VSZn2a.css +0 -1
- package/out/renderer/assets/index-Bo-U0L08.js +0 -804
- package/out/renderer/assets/index-BwwNZ8BB.js +0 -1
- package/out/renderer/assets/index-StPsU3lP.js +0 -7
- package/out/renderer/assets/infoDiagram-PH2N3AL5-ChbJv-y5.js +0 -2
- package/out/renderer/assets/legacy-agents-page-C_w_SC0A.js +0 -33
- package/out/renderer/assets/mesh-page-DMSyd0cL.js +0 -1
- package/out/renderer/assets/mindmap-definition-ALO5MXBD-FgYmOkcR.js +0 -95
- package/out/renderer/assets/mini-B9yZoGaU.js +0 -1
- package/out/renderer/assets/org-surface-gate-CDIyXoCz.js +0 -1
- package/out/renderer/assets/pieDiagram-IB7DONF6-Ahxca-lE.js +0 -30
- package/out/renderer/assets/projects-page-BclfcCc4.js +0 -50
- package/out/renderer/assets/radient-auth-buttons-D6EcW_pf.js +0 -1
- package/out/renderer/assets/sankeyDiagram-QLVOVGJD-DPL4XBFG.js +0 -10
- package/out/renderer/assets/stateDiagram-DGXRK772-C_ILyKXn.js +0 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-DgnGm7tu.js +0 -1
- package/out/renderer/assets/ui-preferences-store-lljzccwU.js +0 -1
- package/out/renderer/assets/use-memberships-query-DIOIcGCQ.js +0 -1
- /package/out/renderer/assets/{index-CzjIMcYW.js → index-B-uibf5k.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as j,D as ye}from"./index-CzjIMcYW.js";const z=e=>{let t;const n=new Set,r=(u,h)=>{const p=typeof u=="function"?u(t):u;if(!Object.is(p,t)){const c=t;t=h??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(m=>m(t,c))}},s=()=>t,a={setState:r,getState:s,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u))},l=t=e(r,s,a);return a},Oe=e=>e?z(e):z,Re=e=>e;function ve(e,t=Re){const n=j.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return j.useDebugValue(n),n}const X=e=>{const t=Oe(e),n=r=>ve(t,r);return Object.assign(n,t),n},_e=e=>e?X(e):X;function Pe(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var o;const i=l=>l===null?null:JSON.parse(l,void 0),a=(o=n.getItem(s))!=null?o:null;return a instanceof Promise?a.then(i):i(a)},setItem:(s,o)=>n.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>n.removeItem(s)}}const k=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return k(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return k(r)(n)}}}},we=(e,t)=>(n,r,s)=>{let o={storage:Pe(()=>localStorage),partialize:d=>d,version:0,merge:(d,O)=>({...O,...d}),...t},i=!1;const a=new Set,l=new Set;let u=o.storage;if(!u)return e((...d)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...d)},r,s);const h=()=>{const d=o.partialize({...r()});return u.setItem(o.name,{state:d,version:o.version})},p=s.setState;s.setState=(d,O)=>{p(d,O),h()};const c=e((...d)=>{n(...d),h()},r,s);s.getInitialState=()=>c;let m;const N=()=>{var d,O;if(!u)return;i=!1,a.forEach(f=>{var g;return f((g=r())!=null?g:c)});const A=((O=o.onRehydrateStorage)==null?void 0:O.call(o,(d=r())!=null?d:c))||void 0;return k(u.getItem.bind(u))(o.name).then(f=>{if(f)if(typeof f.version=="number"&&f.version!==o.version){if(o.migrate){const g=o.migrate(f.state,f.version);return g instanceof Promise?g.then(L=>[!0,L]):[!0,g]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,f.state];return[!1,void 0]}).then(f=>{var g;const[L,Se]=f;if(m=o.merge(Se,(g=r())!=null?g:c),n(m,!0),L)return h()}).then(()=>{A?.(m,void 0),m=r(),i=!0,l.forEach(f=>f(m))}).catch(f=>{A?.(void 0,f)})};return s.persist={setOptions:d=>{o={...o,...d},d.storage&&(u=d.storage)},clearStorage:()=>{u?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>N(),hasHydrated:()=>i,onHydrate:d=>(a.add(d),()=>{a.delete(d)}),onFinishHydration:d=>(l.add(d),()=>{l.delete(d)})},o.skipHydration||N(),m||c},Ce=we,b=260,re=220,oe=320,B=56,be=b,Ee=1024,se=480,ie=44,ae=400,Ae=560;function le(e){return Math.max(0,Math.min(Ae,e-se))}function Q(e){return le(e)>=ae?"docked":"overlay"}function $n({capacity:e,min:t,max:n,drawn:r}){const s=e>=t;return s?{resizable:s,value:Math.min(Math.max(r,t),e),minWidth:t,maxWidth:Math.min(n,e)}:{resizable:s,value:r,minWidth:r,maxWidth:r}}function Ie(e,t=b,n=ie){return Q(e-ce(t)-n)==="overlay"&&Q(e-B-n)==="docked"}function ce(e){return Number.isNaN(e)?b:Math.min(oe,Math.max(re,e))}function Gn(e,t,n,r=b,s=!1,o=ie){if(e>=Ee){const a=!t&&s&&Ie(e,r,o);return{mode:t||a?"strip":"docked",width:t||a?B:ce(r),collapsed:t||a,sheetOpen:!1,resizable:!t&&!a}}return{mode:n?"overlay":"strip",width:n?be:B,collapsed:!0,sheetOpen:n,resizable:!1}}function Yn(e){return e.shiftKey||e.altKey||!(e.metaKey||e.ctrlKey)?!1:e.key.toLowerCase()==="b"}const jn=e=>e?"⌘B":"Ctrl+B",Me=["active","created"],zn={running:"Running",today:"Today",week:"This week",older:"Older"},De=new Set(["busy","delegating","approval","answer","wedged"]);function I(e){return De.has(e.status?.code??"")}const Te=new Set(["approval","answer"]);function Ne(e){return Te.has(e.status?.code??"")}const Le=24*60*60*1e3,ke=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()};function W(e,t){const n=t==="created"?e.created_at:e.updated_at;return typeof n!="number"||!Number.isFinite(n)||n<=0?null:n*1e3}const Be="last_user_at";function xe(e){const t=e[Be],n=typeof t=="number"&&Number.isFinite(t)&&t>0?t:e.created_at;return typeof n!="number"||!Number.isFinite(n)||n<=0?null:n*1e3}function Ue(e,t,n){if(I(e))return"running";const r=W(e,n);if(r===null)return"older";const s=ke(t);return r>=s?"today":r>=s-6*Le?"week":"older"}function Xn(e,t,n){const r={running:[],today:[],week:[],older:[]};for(const s of e)r[Ue(s,t,n)].push(s);return r}function He(e,t,n){const r=W(e,n);if(r===null)return"";const s=Math.floor(Math.max(0,t-r)/6e4);if(s<1)return"now";if(s<60)return`${s}m`;const o=Math.floor(s/60);if(o<24)return`${o}h`;const i=Math.floor(o/24);if(i<7)return`${i}d`;const a=Math.floor(i/7);return i<365?`${a}w`:`${Math.floor(i/365)}y`}function Qn(e,t,n){const r=He(e,t,n);if(!r)return"";const s=n==="created"?"created":"last active";if(r==="now")return`${s} just now`;const o={m:"minute",h:"hour",d:"day",w:"week",y:"year"},i=Number.parseInt(r,10),a=o[r.slice(-1)];return`${s} ${i} ${a}${i===1?"":"s"} ago`}const x=["pinned","running","today","week","older","agents","teams"],Vn={pinned:"Pinned",running:"Running",today:"Today",week:"This week",older:"Older",agents:"Agents",teams:"Teams"};function qn(e){return e==="agents"||e==="teams"}const C=8;function We(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function Jn(e,t){return{...e,[t]:(e[t]??C)+C}}function Zn(e,t,n,r,s){const o=!(e[n]??r);return{expanded:{...e,[n]:o},caps:!o&&!s?We(t,n):t}}function et(e,t,n,r){return(e||t!=="")&&(r>C||n.trim()!=="")}const nt="Collapse, then reopen, to restore the compact list";function tt(e){return(e??C)>C}const rt=e=>`section-grown-hint-${e}`,Fe=e=>e===1?"Show 1 more":`Show ${e} more`;function ot(e,t){return`${Fe(e)} ${t}`}const w={hidden:[],order:[...x],pins:[],groupBy:"section",basis:"active",orderBy:"active-first",loads:0,pinnedAgents:[]},Ke=10,v=[25,50],$e=50,Ge=500,Ye=64;function R(e){const t=Math.max(0,Math.floor(e));return t===0?Ke:t<=v.length?v[t-1]:v[v.length-1]+(t-v.length)*$e}function st(e,t){const n=R(e+1)-R(e),r=Math.max(0,Math.min(n,t));return r===1?"Show 1 more chat":`Show ${r} more chats`}function it(e,t,n){const r=R(t+1)-R(t),s=R(t),o=Math.min(s+r,e.length);let i=0;for(let l=s;l<o;l+=1)F(e[l])&&(i+=1);const a=Math.max(0,o-s-i);return a>0?a:Math.max(0,Math.min(r,n))}function F(e){return I(e)}function je(e){return Ne(e)?0:I(e)?1:2}function ze(e,t){return I(e)?xe(e):W(e,t)}function Xe(e,t){return e===null&&t===null?0:e===null?1:t===null?-1:t-e}function at(e,t,n){const r=e.map((s,o)=>({row:s,index:o,lane:t==="active-first"?je(s):0,at:ze(s,n)}));return r.sort((s,o)=>s.lane-o.lane||Xe(s.at,o.at)||s.index-o.index),r.map(s=>s.row)}function lt(e,t){const{limit:n,currentId:r,searching:s=!1}=t;if(s)return{rows:[...e],lifted:!1,remaining:0};const o=[];let i=Math.max(0,n);for(const u of e){if(i>0){o.push(u),i-=1;continue}F(u)&&o.push(u)}const a=Math.max(0,e.length-o.length);if(!r)return{rows:o,lifted:!1,remaining:a};const l=e.find(u=>u.session_id===r)??null;return l===null||o.includes(l)?{rows:o,lifted:!1,remaining:a}:{rows:[l,...o],lifted:!0,remaining:a}}function ct(e,t){if(t.searching)return{rows:[...e],lifted:!1,hidden:0,held:e.length};const n=R(t.loads),r=[];let s=n;for(const l of e){if(F(l)){r.push(l);continue}s>0&&(r.push(l),s-=1)}const o=t.currentId,i=o==null?null:e.find(l=>l.session_id===o)??null,a=i!==null&&!r.includes(i);return{rows:a&&i!==null?[i,...r]:r,lifted:a,hidden:e.length-r.length-(a?1:0),held:e.length}}function ut(e){if(e.add<=0)return null;const t=e.add===1?"Show 1 more chat":`Show ${e.add} more chats`;if(e.drawn>=e.total)return{label:t,aria:t};const n=`${e.drawn} of ${e.total}`;return{label:`${t} · ${n}`,aria:`${t} · ${n} shown`}}const Qe="mt-4",Ve="mt-2";function dt(e){return e?Qe:Ve}function ft(e,t,n,r){return n?e.toLocaleLowerCase().includes(n.toLocaleLowerCase())||(r??"").toLocaleLowerCase().includes(n.toLocaleLowerCase())||t>0:!0}function pt(e,t){if(t==="section")return null;if(t==="flat")return[{key:"all",label:"",rows:[...e]}];const n=new Map;for(const o of e){const i=o.binding?.team||o.binding?.agent||"",a=i||"ungrouped",l=n.get(a)??{key:a,label:i||"Ungrouped",rows:[]};l.rows.push(o),n.set(a,l)}const r=[...n.values()],s=r.findIndex(o=>o.key==="ungrouped");return s>0&&r.push(...r.splice(s,1)),r}function qe(e,t){return!e.hidden.includes(t)}function ue(e){return e.order.filter(t=>qe(e,t))}function ht(e,t){const n=e.hidden.includes(t)?e.hidden.filter(r=>r!==t):[...e.hidden,t];return{...e,hidden:n}}function mt(e,t,n){const r=ue(e),s=r.indexOf(t),o=r[s+n];if(s<0||o===void 0)return e;const i=e.order.indexOf(t),a=e.order.indexOf(o),l=[...e.order];return l[i]=o,l[a]=t,{...e,order:l}}const Je=["running","today","week","older"];function V(e){return Je.includes(e)}function gt(e,t,n,r){if(!V(t)||r&&!r(t))return!1;const s=ue(e),o=s.indexOf(t);if(o<0)return!1;const i=s[o+n];return i===void 0||!V(i)?!1:r?r(i):!0}const Ze=["section","agent","flat"],en=["active-first","recent"];function St(e){if(typeof e!="object"||e===null)return w;const t=e,n=new Set(x),r=[];if(Array.isArray(t.order))for(const c of t.order)typeof c=="string"&&n.has(c)&&(r.includes(c)||r.push(c));for(const c of x)r.includes(c)||r.push(c);const s=[];if(Array.isArray(t.hidden))for(const c of t.hidden)typeof c=="string"&&n.has(c)&&(s.includes(c)||s.push(c));const o=Ze.includes(t.groupBy)?t.groupBy:w.groupBy,i=Me.includes(t.basis)?t.basis:w.basis,a=en.includes(t.orderBy)?t.orderBy:w.orderBy,l=typeof t.loads=="number"&&Number.isFinite(t.loads)&&t.loads>0?Math.min(Ge,Math.floor(t.loads)):0,u=[];if(Array.isArray(t.pinnedAgents)){for(const c of t.pinnedAgents)if(typeof c=="string"&&c!==""&&!u.includes(c)){if(u.length>=Ye)break;u.push(c)}}const h=[],p=new Set;if(Array.isArray(t.pins))for(const c of t.pins)typeof c=="string"&&c.length!==0&&(p.has(c)||(p.add(c),h.push(c)));return{hidden:s,order:r,groupBy:o,basis:i,orderBy:a,loads:l,pins:h,pinnedAgents:u}}const nn="both",de="by-turn",U=[{value:"by-turn",label:"By turn"},{value:"by-response",label:"By response"}];function yt(e){for(const t of U)if(e===t.value)return t.value;return de}function Ot(e){return U.find(t=>t.value===e)?.label??U[0].label}const Rt="primary+alt+shift+space",tn=/^f([1-9]|1[0-9]|2[0-4])$/;function rn(e){return tn.test(e)}function on(e,t){const n=sn(e,t);return t==="mac"?n.join(""):n.join("+")}function sn(e,t){const r=t==="mac"?{primary:"⌘",meta:"⌘",ctrl:"⌃",alt:"⌥",shift:"⇧"}:{primary:"Ctrl",meta:t==="win"?"Win":"Super",ctrl:"Ctrl",alt:"Alt",shift:"Shift"},s={space:"Space",backspace:"Backspace",delete:"Delete",insert:"Insert",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown",up:"Up",down:"Down",left:"Left",right:"Right"};return e.split("+").map(o=>o.trim().toLowerCase()).filter(o=>o.length>0).map(o=>o in r?r[o]:o in s?s[o]:rn(o)||o.length===1?o.toUpperCase():o)}const M=[{id:"panel.console",label:"Open console",category:"Panels",defaultChord:"primary+j",scope:"app"},{id:"panel.canvas",label:"Open canvas",category:"Panels",defaultChord:"primary+shift+c",scope:"app"},{id:"panel.run",label:"Open run details",category:"Panels",defaultChord:null,scope:"app"},{id:"panel.ask",label:"Open asks",category:"Panels",defaultChord:null,scope:"app"},{id:"panel.browser",label:"Open browser",category:"Panels",defaultChord:null,scope:"app"},{id:"panel.code",label:"Open code review",category:"Panels",defaultChord:null,scope:"app"}],an=new Map(M.map(e=>[e.id,e])),ln=e=>an.get(e),fe=new Map([["primary+p","Reserved: opens the command palette from anywhere."],["primary+shift+p","Reserved: opens the command palette on commands."],["primary+shift+s","Reserved: starts speech to text."],["primary+k","Reserved: opens the command palette on chats."],["primary+n","Reserved: starts a new chat."],["primary+b","Reserved: toggles the sidebar."],["primary+[","Reserved: moves back between chats."],["primary+]","Reserved: moves forward between chats."],["primary+f","Reserved: searches the transcript."],["primary+alt+up","Reserved: walks up the chat regions."],["primary+alt+down","Reserved: walks down the chat regions."],["primary+shift+a","Reserved: archives the focused conversation."],["primary+s","Reserved: saves the canvas document."],["primary+o","Reserved: opens a file in the canvas."],["primary+shift+up","Reserved: moves the focused chat up the pinned order."],["primary+shift+down","Reserved: moves the focused chat down the pinned order."],["primary+c","Reserved: copy."],["primary+x","Reserved: cut."],["primary+v","Reserved: paste."],["primary+a","Reserved: select all."],["primary+z","Reserved: undo."],["primary+shift+z","Reserved: redo."],["primary+y","Reserved: redo on Windows and Linux."],["primary+q","Reserved: quits the app."],["primary+w","Reserved: closes the window."],["primary+m","Reserved: minimises the window."]]),cn=["primary","alt","shift"],un={primary:"primary",meta:"primary",cmd:"primary",command:"primary",super:"primary",ctrl:"primary",control:"primary",alt:"alt",option:"alt",shift:"shift"},dn=new Set(["space","backspace","delete","insert","home","end","pageup","pagedown","up","down","left","right"]),fn=e=>dn.has(e)||/^[a-z0-9]$/.test(e);function K(e){if(typeof e!="string")return null;const t=e.toLowerCase().split("+").map(o=>o.trim()).filter(o=>o.length>0);if(t.length===0)return null;const n=t[t.length-1];if(!fn(n))return null;const r=new Set;for(const o of t.slice(0,-1)){const i=un[o];if(i===void 0)return null;r.add(i)}return[...cn.filter(o=>r.has(o)),n].join("+")}const pe=e=>e.split("+").includes("primary");function $(e,t){const n=t?.[e];return typeof n=="string"||n===null?n:ln(e)?.defaultChord??null}function vt(e){const t=new Map;for(const n of M){const r=$(n.id,e);r!==null&&!t.has(r)&&t.set(r,n.id)}return t}const pn=e=>e==="mac"?"A shortcut needs ⌘ or Ctrl.":"A shortcut needs Ctrl.";function hn(e,t,n,r="linux"){const s=e===null?null:K(e);if(s===null)return"That key cannot be bound.";if(!pe(s))return pn(r);const o=fe.get(s);if(o!==void 0)return o;for(const i of M)if(i.id!==t&&$(i.id,n)===s)return`Already assigned to ${i.label}.`;return null}function mn(e){if(e===null||typeof e!="object"||Array.isArray(e))return{};const t=e,n=new Set,r={};for(const s of M){const o=t[s.id];if(o===null){r[s.id]=null;continue}const i=typeof o=="string"?K(o):null,a=i!==null&&pe(i)&&!fe.has(i)&&!n.has(i)?i:null;a!==null&&(r[s.id]=a);const l=a??s.defaultChord;l!==null&&n.add(l)}return r}function _t(e,t,n){const r=$(e,t);return r===null?null:gn(r,n)}function gn(e,t){return on(e,t)}const q=64,H=["canvas","run","browser","console","code"],Sn={canvas:"isCanvasOpen",run:"isRunPanelOpen",browser:"isBrowserPaneOpen",console:"isConsolePaneOpen",code:"isCodeReviewPaneOpen"};function he(e){return typeof e=="string"&&H.includes(e)}function G(e){return e.startsWith("draft:")}function D(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r[0]===t)return r[1]}}function Y(e){return e.length>q?e.slice(e.length-q):e}function me(e,t,n){return Y([...e.filter(([r])=>r!==t),[t,n]])}function yn(e,t,n){return D(e,t)!==n?e:e.filter(([r])=>r!==t)}function On(e,t,n){const r=D(e,t);return r===void 0?e:Y([...e.filter(([s])=>s!==t&&s!==n),[n,r]])}const J=Object.freeze({isCanvasOpen:!1,isRunPanelOpen:!1,isBrowserPaneOpen:!1,isConsolePaneOpen:!1,isCodeReviewPaneOpen:!1});function Z(e,t,n){if(n||typeof t!="string")return J;const r=D(e,t);return r===void 0?J:{isCanvasOpen:r==="canvas",isRunPanelOpen:r==="run",isBrowserPaneOpen:r==="browser",isConsolePaneOpen:r==="console",isCodeReviewPaneOpen:r==="code"}}function Rn(e){if(!Array.isArray(e))return[];const t=new Map;for(const n of e){if(!Array.isArray(n)||n.length!==2)continue;const[r,s]=n;typeof r!="string"||r===""||G(r)||he(s)&&(t.delete(r),t.set(r,s))}return Y([...t.entries()])}function Pt(e){const t=new Set(Object.keys(e.forgotten));for(const[n,r]of Object.entries(e.archiveFacts))r?.archived===!0&&r.answered===!0&&t.add(n);return t}function ee(e){return Sn[e]}const vn={canvas:"isCanvasOpen",run:"isRunPanelOpen",browser:"isBrowserPaneOpen",console:"isConsolePaneOpen",code:"isCodeReviewPaneOpen"},E=e=>e.isCanvasOpen?"canvas":e.isRunPanelOpen?"run":e.isBrowserPaneOpen?"browser":e.isConsolePaneOpen?"console":e.isCodeReviewPaneOpen?"code":e.isAskDrawerOpen?"ask":null,T=(e,t)=>e==="ask"?t.askDrawerScope==="fleet"||t.rightSlotRoute.mounted&&t.rightSlotRoute.session:t.rightSlotRoute.mounted?e==="code"?t.rightSlotRoute.session&&t.rightSlotRoute.codeReview:e!=="run"||t.rightSlotRoute.runDetails:!1,_n=e=>{const t=E(e);return t===null||t==="ask"?null:vn[t]},S=e=>({isRunPanelOpen:e==="isRunPanelOpen",isCanvasOpen:e==="isCanvasOpen",isBrowserPaneOpen:e==="isBrowserPaneOpen",isConsolePaneOpen:e==="isConsolePaneOpen",isCodeReviewPaneOpen:e==="isCodeReviewPaneOpen",isAskDrawerOpen:e==="isAskDrawerOpen",askDrawerEvictedPane:null}),y=(e,t)=>{const n=e.rightSlotKey;return typeof n!="string"?{}:{rightSlotMemory:me(e.rightSlotMemory,n,t)}},_=(e,t)=>{const n=e.rightSlotKey;if(typeof n!="string")return{};const r=yn(e.rightSlotMemory,n,t);return r===e.rightSlotMemory?{}:{rightSlotMemory:r}},Pn=Object.freeze({mounted:!1,runDetails:!1,session:!1,codeReview:!1,asksOffered:!1}),ge=Object.freeze([]);function wt(e,t){const n=E(t);if(n===null||!T(n,t))return 0;let r;switch(n){case"canvas":case"ask":r=Math.max(ae,t.rightSlotWidth||P);break;case"run":r=Math.max(te,t.rightSlotWidth||P);break;case"browser":r=Math.max(En,t.rightSlotWidth||P);break;case"console":r=Math.max(An,t.rightSlotWidth||P);break;case"code":r=Math.max(te,t.rightSlotWidth||P);break}return e<=0?r:n==="canvas"||n==="ask"?Math.min(r,le(e)):Math.min(r,Math.max(0,e-se))}function Ct(e){const t=E(e);return t!==null&&T(t,e)}function bt(e){const t=E(e);return t!==null&&T(t,e)?t:null}function Et(e){const t=E(e);return(t==="canvas"||t==="ask")&&T(t,e)}const P=640,ne=b,wn=20,Cn=4,bn=20,te=320,En=480,An=480,In=5e3,At=(e,t)=>e.some(n=>n.surface===t),It=(e,t=Date.now())=>e.some(n=>t-n.at<In),Mn=[],Dn=3,Tn=["chatMeasureWidth"],Mt=_e()(Ce((e,t)=>({isCommandPaletteOpen:!1,commandPaletteQuery:"",isSidebarCollapsed:!1,showAgentReasoning:!1,transcriptDisplayMode:de,themeName:ye,rightSlotWidth:0,chatSidebarWidth:ne,chatSidebarRegions:nn,chatSidebarView:w,chatSidebarListHeight:null,chatSidebarOrder:"entities-first",dismissedBuiltinOfferSignature:"",isCanvasOpen:!1,isRunPanelOpen:!1,isBrowserPaneOpen:!1,isConsolePaneOpen:!1,isCodeReviewPaneOpen:!1,rightSlotKey:void 0,rightSlotMemory:ge,rightSlotLegacySeed:null,isAskDrawerOpen:!1,askDrawerScope:"session",askDrawerEvictedPane:null,askOpenIntent:null,rightSlotRoute:Pn,consoleOpenIntent:null,runPanelReveal:null,codeReviewReveal:null,browserPaneScope:"conversation",consoleActiveSurface:null,consoleUnseen:Mn,isCreateAgentDialogOpen:!1,mentionRecents:null,profileRecents:{agent:[],team:[]},conversationRecents:[],shortcutBindings:{},openCreateAgentDialog:()=>{e({isCreateAgentDialogOpen:!0})},closeCreateAgentDialog:()=>{e({isCreateAgentDialogOpen:!1})},openCommandPalette:()=>{e({isCommandPaletteOpen:!0})},closeCommandPalette:()=>{e({isCommandPaletteOpen:!1,commandPaletteQuery:""})},toggleCommandPalette:(n="")=>{e(r=>({isCommandPaletteOpen:!r.isCommandPaletteOpen,commandPaletteQuery:r.isCommandPaletteOpen?r.commandPaletteQuery:n}))},setCommandPaletteQuery:n=>{e({commandPaletteQuery:n})},toggleSidebar:()=>{e(n=>({isSidebarCollapsed:!n.isSidebarCollapsed}))},setSidebarCollapsed:n=>{e({isSidebarCollapsed:n})},setShowAgentReasoning:n=>{e({showAgentReasoning:n})},setTranscriptDisplayMode:n=>{e({transcriptDisplayMode:n})},setTheme:n=>{e({themeName:n})},setCanvasOpen:n=>{e(r=>n?{...S("isCanvasOpen"),...y(r,"canvas")}:{isCanvasOpen:!1,..._(r,"canvas")})},setRunPanelOpen:n=>{e(r=>n?{...S("isRunPanelOpen"),...y(r,"run")}:{isRunPanelOpen:!1,..._(r,"run")})},setBrowserPaneOpen:n=>{e(r=>n?{...S("isBrowserPaneOpen"),...y(r,"browser")}:{isBrowserPaneOpen:!1,..._(r,"browser")})},setConsolePaneOpen:n=>{e(r=>n?{...S("isConsolePaneOpen"),...y(r,"console")}:{isConsolePaneOpen:!1,..._(r,"console")})},setCodeReviewPaneOpen:n=>{e(r=>n?{...S("isCodeReviewPaneOpen"),...y(r,"code")}:{isCodeReviewPaneOpen:!1,..._(r,"code")})},clearCodeReviewReveal:n=>{e(r=>r.codeReviewReveal?.nonce===n?{codeReviewReveal:null}:{})},revealCodeReviewPane:()=>{e(n=>({...S("isCodeReviewPaneOpen"),...y(n,"code"),codeReviewReveal:{nonce:(n.codeReviewReveal?.nonce??0)+1}}))},setAskDrawerOpen:(n,r)=>{e(s=>{const o=typeof s.rightSlotKey=="string";if(n)return{...S("isAskDrawerOpen"),askDrawerScope:r,askDrawerEvictedPane:o?null:_n(s),askOpenIntent:null};const i={isAskDrawerOpen:!1,askDrawerEvictedPane:null,askOpenIntent:null};return o?{...i,...Z(s.rightSlotMemory,s.rightSlotKey,!1)}:s.rightSlotKey===null?i:{...i,...s.askDrawerEvictedPane===null?null:{[s.askDrawerEvictedPane]:!0}}})},requestAskOpen:n=>{e({askOpenIntent:n})},clearAskOpenIntent:n=>{e(r=>r.askOpenIntent===n?{askOpenIntent:null}:{})},setConsoleActiveSurface:n=>{e({consoleActiveSurface:n})},requestConsoleOpen:n=>{e({consoleOpenIntent:n})},clearConsoleOpenIntent:n=>{e(r=>r.consoleOpenIntent===n?{consoleOpenIntent:null}:{})},markConsoleUnseen:(n,r)=>{e(s=>s.consoleUnseen.some(o=>o.surface===r)?{}:{consoleUnseen:[...s.consoleUnseen,{sessionId:n,surface:r,at:Date.now()}]})},clearConsoleUnseen:n=>{const r=Array.isArray(n)?n:[n];e(s=>{const o=s.consoleUnseen.filter(i=>!r.includes(i.surface));return o.length===s.consoleUnseen.length?{}:{consoleUnseen:o}})},setRightSlotWidth:n=>{e({rightSlotWidth:n})},restoreDefaultRightSlotWidth:()=>{e({rightSlotWidth:0})},bindRightSlotKey:(n,r)=>{e(s=>{let o=s.rightSlotMemory,i=s.rightSlotLegacySeed;const a=r?.admittedFrom;return typeof a=="string"&&typeof n=="string"&&(o=On(o,a,n)),n===null||(G(n)?i=null:i!==null&&D(o,n)===void 0&&(o=me(o,n,i),i=null)),{rightSlotKey:n,rightSlotMemory:o,rightSlotLegacySeed:i,...Z(o,n,s.isAskDrawerOpen)}})},setRightSlotRoute:n=>{const r=t().rightSlotRoute;r.mounted===n.mounted&&r.runDetails===n.runDetails&&r.session===n.session&&r.codeReview===n.codeReview&&r.asksOffered===n.asksOffered||e({rightSlotRoute:{...n}})},setShortcutBinding:(n,r)=>{if(r===null){e(o=>{const i={...o.shortcutBindings};return delete i[n],{shortcutBindings:i}});return}const s=K(r);s!==null&&hn(s,n,t().shortcutBindings)===null&&e(o=>({shortcutBindings:{...o.shortcutBindings,[n]:s}}))},clearShortcutBinding:n=>{e(r=>({shortcutBindings:{...r.shortcutBindings,[n]:null}}))},setBrowserPaneScope:n=>{e({browserPaneScope:n})},revealRunPanelSection:n=>{e(r=>({...S("isRunPanelOpen"),...y(r,"run"),runPanelReveal:{section:n,nonce:(r.runPanelReveal?.nonce??0)+1}}))},clearRunPanelReveal:n=>{e(r=>r.runPanelReveal?.nonce===n?{runPanelReveal:null}:{})},setChatSidebarWidth:n=>{e({chatSidebarWidth:Math.min(oe,Math.max(re,n))})},setChatSidebarRegions:n=>{e({chatSidebarRegions:n})},setChatSidebarListHeight:n=>{e({chatSidebarListHeight:n})},restoreDefaultChatSidebarListHeight:()=>{e({chatSidebarListHeight:null})},setChatSidebarOrder:n=>{e({chatSidebarOrder:n})},setChatSidebarView:n=>{e({chatSidebarView:n})},dismissBuiltinOffer:n=>{e({dismissedBuiltinOfferSignature:n})},restoreDefaultChatSidebarWidth:()=>{e({chatSidebarWidth:ne})},rememberMention:(n,r)=>{e(s=>{const o=s.mentionRecents,i=o?.cwd===n?o.paths:[],a=[r,...i.filter(l=>l!==r)].slice(0,wn);return{mentionRecents:{cwd:n,paths:a}}})},rememberProfile:(n,r)=>{e(s=>({profileRecents:{...s.profileRecents,[n]:Nn(s.profileRecents[n]??[],r)}}))},rememberConversation:n=>{e(r=>{const s=Bn(r.conversationRecents),o=Ln(s,n);return o.length===s.length&&o.every((i,a)=>i===s[a])?r:{conversationRecents:o}})}}),{name:"ui-preferences-storage",version:Dn,migrate:Wn,partialize:xn,merge:Hn}));function Nn(e,t){return[t,...e.filter(n=>n!==t)].slice(0,Cn)}function Ln(e,t){return[t,...e.filter(n=>n!==t)].slice(0,bn)}const kn=[];function Bn(e){return Array.isArray(e)?e:kn}function xn(e){const{runPanelReveal:t,codeReviewReveal:n,consoleOpenIntent:r,askOpenIntent:s,isAskDrawerOpen:o,askDrawerScope:i,askDrawerEvictedPane:a,rightSlotRoute:l,isCanvasOpen:u,isRunPanelOpen:h,isBrowserPaneOpen:p,isConsolePaneOpen:c,isCodeReviewPaneOpen:m,rightSlotKey:N,...d}=e;return{...d,rightSlotMemory:Un(e.rightSlotMemory)}}function Un(e){return(e??ge).filter(([t])=>!G(t))}function Hn(e,t){const n=e??{},{isCanvasOpen:r,isRunPanelOpen:s,isBrowserPaneOpen:o,isConsolePaneOpen:i,isCodeReviewPaneOpen:a,...l}=n;return{...t,...l,rightSlotKey:t.rightSlotKey,rightSlotMemory:Rn(n.rightSlotMemory),rightSlotLegacySeed:he(n.rightSlotLegacySeed)?n.rightSlotLegacySeed:null,shortcutBindings:mn(n.shortcutBindings)}}function Wn(e,t){const n={...e??{}};if(t<1&&Fn(n),t<2)for(const r of Tn)delete n[r];if(t<3){let r=null;for(const s of H)if(n[ee(s)]===!0){r=s;break}r!==null&&(n.rightSlotLegacySeed=r);for(const s of H)delete n[ee(s)]}return n}function Fn(e){const t=[["canvasWidth",800],["runPanelWidth",420],["browserPanelWidth",640],["consolePanelWidth",796]];let n=0;for(const[r,s]of t){const o=e[r];if(typeof o=="number"&&o>0&&o!==s){n=o;break}}for(const[r]of t)delete e[r];e.rightSlotWidth=n}export{Pn as $,et as A,ft as B,In as C,Rt as D,C as E,dt as F,pt as G,st as H,it as I,tt as J,M as K,nt as L,rt as M,Fe as N,ot as O,Jn as P,ct as Q,ut as R,Vn as S,U as T,He as U,I as V,Qn as W,zn as X,Zn as Y,Ot as Z,Ct as _,gn as a,wt as a0,$n as a1,ae as a2,le as a3,te as a4,P as a5,En as a6,An as a7,Q as a8,se as a9,Bn as aa,vt as ab,jn as ac,ce as ad,on as ae,G as af,Pt as ag,Pe as ah,Et as ai,Gn as aj,Yn as ak,Ee as al,B as am,ie as an,oe as ao,re as ap,de as aq,K as ar,rn as as,hn as b,_e as c,yt as d,$ as e,sn as f,_t as g,It as h,At as i,W as j,qe as k,V as l,qn as m,mt as n,gt as o,Ce as p,St as q,bt as r,at as s,ht as t,Mt as u,lt as v,R as w,w as x,Xn as y,ue as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ax as I,ay as R,az as L,aA as P,aB as h,aC as q,aD as E,aE as r,aF as w,aG as T,aH as S,aI as N,aJ as k,aK as O,aL as C}from"./conversation-input-sync-BbbcfWqh.js";const _={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."},z=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 U(e){const n=e?.categories?.[0];return n&&E(n)?_[n]:_.other_harmful}function j(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 ${q} 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 ne(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:U(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}=j(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:z(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 x=[/^(?: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*/],F=/^(\d{3})\b/,B=new Set([404,410]),D=["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"],K=e=>{const n=e.toLowerCase();return D.some(t=>n.includes(t))||P(e)},M=(e,n)=>{const t=n.trim()?`"${n.trim()}"`:"That agent";if(R(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=x.reduce((i,s)=>i.replace(s,""),L(e,"").trim()).trim();if(!a)return`${t} could not be downloaded.`;const o=Number(F.exec(a)?.[1]??Number.NaN);return B.has(o)?`${t} is no longer on the hub, so nothing was downloaded.`:K(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}`},H="The action did not complete.",te=(e,n,t)=>e==="download"?M(n,t):I(H,n),ae={"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 G(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 oe(e){return r({operation:"agents.get",agentId:e})}async function se(e){return r({operation:"agents.delete",agentId:e,requestId:c(),confirmed:!0})}async function ie(e){return r({operation:"agents.like",agentId:e,requestId:c()})}async function re(e){return r({operation:"agents.unlike",agentId:e,requestId:c(),confirmed:!0})}async function ue(e){return r({operation:"agents.favourite",agentId:e,requestId:c()})}async function le(e){return r({operation:"agents.unfavourite",agentId:e,requestId:c(),confirmed:!0})}async function ce(e,n){return r({operation:"comments.create",agentId:e,payload:n,requestId:c()})}async function de(e,n=1,t=20){return r({operation:"comments.list",agentId:e,query:{page:n,per_page:t}})}async function he(e,n,t){return r({operation:"comments.update",agentId:e,commentId:n,payload:t,requestId:c()})}async function ge(e,n){return r({operation:"comments.delete",agentId:e,commentId:n,requestId:c(),confirmed:!0})}async function be(e){return r({operation:"agents.statuses",query:{agent_ids:e.join(",")}})}async function Q(){return r({operation:"memberships.list"})}async function W(e,n=1,t=20,a){const o={page:n,per_page:t};if(a)for(const[i,s]of Object.entries(a))s&&(o[i]=s);return r({operation:"org_agents.list",tenantId:e,query:o})}async function me(e){return r({operation:"org_teams.list",tenantId:e})}class m extends Error{status;reason;constructor(n,t,a){super(n),this.name="PublicHubError",this.status=t,this.reason=a}}const Y=/\/+$/,v=(e,n)=>{const t=e.replace(Y,"");return n?`${t}/v1/teams/${encodeURIComponent(n)}`:`${t}/v1/teams`},A=async e=>{let n;try{n=await fetch(e,{method:"GET",headers:{Accept:"application/json"},redirect:"error"})}catch(a){throw console.error("The public hub could not be reached:",a),new m("The public hub could not be reached.",null,a)}if(!n.ok)throw new m(`The public hub answered ${n.status}.`,n.status);let t;try{t=await n.json()}catch{throw new m("The public hub answered with a body that is not JSON.",n.status)}if(!t||typeof t!="object"||!("result"in t))throw new m("The public hub answered with a body this app cannot read.",n.status);return t};async function pe(e,n=1,t=12){const a=`${v(e)}?page=${n}&per_page=${t}`;return A(a)}async function ye(e,n){return A(v(e,n))}const J="download_count",p={all:["public-agents"],list:e=>[...p.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}]},b={all:["org-agents"],list:(e,n)=>[...b.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}]},X=e=>e&&e[0]===b.all[0]?String(e[2]??""):null,fe=e=>e.invalidateQueries({queryKey:p.all}),_e=(e,n)=>e.invalidateQueries({queryKey:n?[...b.all,"list",n]:b.all}),we=({page:e=1,perPage:n=20,enabled:t=!0,categories:a,name:o,description:i,sort:s=J,order:d="desc",tenantId:g}={})=>{const y={page:e,perPage:n,categories:a,name:o,description:i,sort:s,order:d},$=g?b.list(g,y):p.list(y),l=w({queryKey:$,queryFn:async()=>{const u={};return a&&a.length>0&&(u.categories=a.join(",")),o&&(u.name=o),i&&(u.description=i),u.sort=s,u.order=d,g?await W(g,e,n,u):await G(e,n,u)},select:u=>u.result,enabled:t,retry:T,staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!1,placeholderData:(u,f)=>X(f?.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}},Z={name:"Name",description:"Description",instructions:"The instruction body",tools:"Tools"};function Te(e){const n=[],t=(a,o)=>{o&&n.push({field:a,message:`${Z[a]} ${o}.`})};return t("name",S(e.name)),t("description",N(e.description)),e.instructions!==null&&t("instructions",k(e.instructions)),t("tools",O(e.tools??[])),n}function ve(e,n){const t=h(e);return n.some(a=>h(a)===t)}function Ae(e){for(const n of e??[]){const t=n.indexOf(":");if(t<0||n.slice(0,t).trim().toLowerCase()!=="tools")continue;const a=n.slice(t+1).split(",").map(o=>o.trim()).filter(Boolean);return a.length>0?a:null}return null}function $e(e,n){const t=h(e);return n.find(a=>h(a)===t)??null}const V={all:["memberships"]},Ie=({enabled:e=!0}={})=>{const{isAuthenticated:n}=C(),t=w({queryKey:V.all,queryFn:async()=>(await Q()).result??{memberships:[]},enabled:e&&n,staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!1,retry:T});return{...t,memberships:t.data?.memberships??[]}};export{ae as P,se as a,Ie as b,ce as c,ge as d,te as e,me as f,oe as g,pe as h,fe as i,ye as j,m as k,de as l,we as m,be as n,p as o,ne as p,le as q,ue as r,re as s,ie as t,he as u,$e as v,_e as w,ve as x,Te as y,Ae as z};
|
|
File without changes
|