local-operator-ui 0.31.5 → 0.31.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/out/main/index.js +151 -9
  2. package/out/renderer/assets/{_basePickBy-BFnTyl9Q.js → _basePickBy-CM6CmIFp.js} +1 -1
  3. package/out/renderer/assets/{_baseUniq-DD9jcRtU.js → _baseUniq-C_PbHIMV.js} +1 -1
  4. package/out/renderer/assets/agent-details-page-DC0sQky0.js +6 -0
  5. package/out/renderer/assets/agent-hub-page-CBrJcFHF.js +6 -0
  6. package/out/renderer/assets/agents-page-CTw-MYYr.js +2 -0
  7. package/out/renderer/assets/arc-DrUEk02e.js +1 -0
  8. package/out/renderer/assets/{architectureDiagram-IEHRJDOE-7e2mo6tq.js → architectureDiagram-IEHRJDOE-CW6LvKX9.js} +1 -1
  9. package/out/renderer/assets/{blockDiagram-JOT3LUYC-BVljD84R.js → blockDiagram-JOT3LUYC-4ogTNs12.js} +1 -1
  10. package/out/renderer/assets/{book-open-B8nHgs3o.js → book-open-CNgko0U5.js} +1 -1
  11. package/out/renderer/assets/browser-page-iMdnjKCm.js +1 -0
  12. package/out/renderer/assets/{browser-webauthn-prompt-BiNyKO73.js → browser-webauthn-prompt-C5PLWNNM.js} +1 -1
  13. package/out/renderer/assets/{c4Diagram-VJAJSXHY-JwdJCFiM.js → c4Diagram-VJAJSXHY-C9J6_WCU.js} +1 -1
  14. package/out/renderer/assets/channel-C3fiRwpT.js +1 -0
  15. package/out/renderer/assets/{chunk-4BMEZGHF-ysuKUzF3.js → chunk-4BMEZGHF-S_BSO-Hr.js} +1 -1
  16. package/out/renderer/assets/{chunk-A2AXSNBT-DsztjjTP.js → chunk-A2AXSNBT-CVy8PtwG.js} +1 -1
  17. package/out/renderer/assets/{chunk-AEK57VVT-pv5-Z61i.js → chunk-AEK57VVT-B38TMTuJ.js} +1 -1
  18. package/out/renderer/assets/{chunk-D6G4REZN-B0HKfeJ8.js → chunk-D6G4REZN-8nX93svh.js} +1 -1
  19. package/out/renderer/assets/{chunk-RZ5BOZE2-DNjaGyn6.js → chunk-RZ5BOZE2-BgbNMOZE.js} +1 -1
  20. package/out/renderer/assets/{chunk-XZIHB7SX-CB3yOZ7o.js → chunk-XZIHB7SX-BNpmrMrQ.js} +1 -1
  21. package/out/renderer/assets/classDiagram-GIVACNV2-C4j3K9wg.js +1 -0
  22. package/out/renderer/assets/classDiagram-v2-COTLJTTW-C4j3K9wg.js +1 -0
  23. package/out/renderer/assets/clone-D0rpLafB.js +1 -0
  24. package/out/renderer/assets/{console-mirror-BoykuSNB.js → console-mirror-DjoNpI7u.js} +1 -1
  25. package/out/renderer/assets/{consoleCapture-Cujhy7_W.js → consoleCapture-BTYJP9Fs.js} +1 -1
  26. package/out/renderer/assets/{dagre-OKDRZEBW-DscYjoQb.js → dagre-OKDRZEBW-BCX_miAW.js} +1 -1
  27. package/out/renderer/assets/{diagram-SSKATNLV-MR2_cP2x.js → diagram-SSKATNLV-CAzJv9lq.js} +1 -1
  28. package/out/renderer/assets/{diagram-VNBRO52H-BmkFh4Vx.js → diagram-VNBRO52H-DBFKrI1R.js} +1 -1
  29. package/out/renderer/assets/{erDiagram-Q7BY3M3F-D07ZEVLp.js → erDiagram-Q7BY3M3F-BMv_jdkl.js} +1 -1
  30. package/out/renderer/assets/error-boundary-Be38BRVp.js +126 -0
  31. package/out/renderer/assets/{flowDiagram-4HSFHLVR-DvEjarQP.js → flowDiagram-4HSFHLVR-CVkQHh1o.js} +1 -1
  32. package/out/renderer/assets/{ganttDiagram-APWFNJXF-D5UFT4S7.js → ganttDiagram-APWFNJXF-Ct36PMFY.js} +3 -3
  33. package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-DH2UEbHf.js → gitGraphDiagram-7IBYFJ6S-CFytZqHN.js} +1 -1
  34. package/out/renderer/assets/{graph-BKMaU8e_.js → graph-CTLrBVeK.js} +1 -1
  35. package/out/renderer/assets/index-BjeBA__i.css +1 -0
  36. package/out/renderer/assets/{index-DyfVjYXR.js → index-C7KtPkib.js} +393 -388
  37. package/out/renderer/assets/{index-D4l3Ha6i.js → index-DWyjbOQ1.js} +1 -1
  38. package/out/renderer/assets/{index-BZWSvhnc.js → index-DuQnzBvj.js} +1 -1
  39. package/out/renderer/assets/{infoDiagram-PH2N3AL5-BB9p2nRT.js → infoDiagram-PH2N3AL5-B2VN0HcS.js} +1 -1
  40. package/out/renderer/assets/{installer-1ycbb4_E.js → installer-DOOu7eM6.js} +1 -1
  41. package/out/renderer/assets/{journeyDiagram-U35MCT3I-Dt2T-pPF.js → journeyDiagram-U35MCT3I-EeQ9FZU_.js} +1 -1
  42. package/out/renderer/assets/{kanban-definition-NDS4AKOZ-BxdASKeG.js → kanban-definition-NDS4AKOZ-CWx17q1q.js} +1 -1
  43. package/out/renderer/assets/{layout-BOJV8F98.js → layout-DxijCKSW.js} +1 -1
  44. package/out/renderer/assets/legacy-agents-page-DKwZ9IUL.js +38 -0
  45. package/out/renderer/assets/{mermaid.core-Dm5FgUKb.js → mermaid.core-BROGXuWS.js} +5 -5
  46. package/out/renderer/assets/mesh-page-ljmpYH3c.js +1 -0
  47. package/out/renderer/assets/{mindmap-definition-ALO5MXBD-C54cCZAD.js → mindmap-definition-ALO5MXBD-MJVwWrDq.js} +1 -1
  48. package/out/renderer/assets/org-surface-gate-BeVNIdZG.js +1 -0
  49. package/out/renderer/assets/{page-header-DtDPxJCD.js → page-header-BXIWLsA1.js} +1 -1
  50. package/out/renderer/assets/{pieDiagram-IB7DONF6-CrhdJ9uV.js → pieDiagram-IB7DONF6-Bdk5nKMy.js} +2 -2
  51. package/out/renderer/assets/projects-page-qaSb7T1c.js +11 -0
  52. package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-BWSQJ0gX.js → quadrantDiagram-7GDLP6J5-CuC3CzS2.js} +1 -1
  53. package/out/renderer/assets/{radar-MK3ICKWK-CJpp5uw3.js → radar-MK3ICKWK-D5QncMMi.js} +1 -1
  54. package/out/renderer/assets/radient-auth-buttons-CD8VvexI.js +1 -0
  55. package/out/renderer/assets/{requirementDiagram-KVF5MWMF-B7hVsPNs.js → requirementDiagram-KVF5MWMF-CIBLY5OK.js} +1 -1
  56. package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-BJT1eAxQ.js → sankeyDiagram-QLVOVGJD-CfkXerpy.js} +1 -1
  57. package/out/renderer/assets/{schedules-page-Br3MWcWr.js → schedules-page-DHSDg1Cx.js} +1 -1
  58. package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-DxQHWkSx.js → sequenceDiagram-X6HHIX6F-C7qAHp50.js} +1 -1
  59. package/out/renderer/assets/settings-page-B0Q3AzNJ.js +307 -0
  60. package/out/renderer/assets/settings-section-BeU3N8-t.js +6 -0
  61. package/out/renderer/assets/{stateDiagram-DGXRK772-7zKxJIA5.js → stateDiagram-DGXRK772-DGrpcP97.js} +1 -1
  62. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-BtHrKykB.js +1 -0
  63. package/out/renderer/assets/{timeline-definition-BDJGKUSR-CKvl8Sf0.js → timeline-definition-BDJGKUSR-DAxKBrN7.js} +1 -1
  64. package/out/renderer/assets/use-download-agent-mutation-BWvEVFd-.js +61 -0
  65. package/out/renderer/assets/use-memberships-query-D1ABZPRc.js +1 -0
  66. package/out/renderer/assets/{xychartDiagram-VJFVF3MP-B2w5N_2D.js → xychartDiagram-VJFVF3MP-c8KzKHoZ.js} +1 -1
  67. package/out/renderer/console-capture.html +4 -4
  68. package/out/renderer/index.html +5 -5
  69. package/out/renderer/installer.html +4 -4
  70. package/package.json +2 -2
  71. package/out/renderer/assets/agent-details-page-G90FKyVP.js +0 -6
  72. package/out/renderer/assets/agent-hub-page-BaU9D2Uf.js +0 -6
  73. package/out/renderer/assets/agents-page-BWmJb3M1.js +0 -2
  74. package/out/renderer/assets/arc-D4G69weg.js +0 -1
  75. package/out/renderer/assets/browser-page-Dc7F-WKs.js +0 -1
  76. package/out/renderer/assets/channel-DY5WkW10.js +0 -1
  77. package/out/renderer/assets/classDiagram-GIVACNV2-mWo2wa6Q.js +0 -1
  78. package/out/renderer/assets/classDiagram-v2-COTLJTTW-mWo2wa6Q.js +0 -1
  79. package/out/renderer/assets/clone-Cbm34QyD.js +0 -1
  80. package/out/renderer/assets/compact-pagination-CEfQ3P1V.js +0 -1
  81. package/out/renderer/assets/error-boundary-BX3Jjofp.js +0 -126
  82. package/out/renderer/assets/index-YlW7OZrX.css +0 -1
  83. package/out/renderer/assets/legacy-agents-page-DlUvUwjx.js +0 -38
  84. package/out/renderer/assets/projects-page-DRQqnIMU.js +0 -11
  85. package/out/renderer/assets/publication-validation-Cke6xOnn.js +0 -1
  86. package/out/renderer/assets/radient-auth-buttons-DPiKAtaZ.js +0 -6
  87. package/out/renderer/assets/settings-page-Cz2ODzjH.js +0 -307
  88. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-3TyB4Xbk.js +0 -1
  89. package/out/renderer/assets/use-download-agent-mutation-yItIUILb.js +0 -61
  90. /package/out/renderer/assets/{index-hIJSZMtz.js → index-C-P4UaBn.js} +0 -0
@@ -1,11 +0,0 @@
1
- import{r as v,j as e,c as D}from"./index-hIJSZMtz.js";import{g as re,ar as L,j as S,f as ve,aA as le,ak as K,ay as H,aB as be,aC as O,az as ye,aD as ke,aE as Ne,h as J,i as W,P as B,aw as G,aF as we,av as De,al as A,as as q,u as Se,b as Ce,aG as _e,aH as V,aI as Te}from"./index-DyfVjYXR.js";import{P as X}from"./page-header-DtDPxJCD.js";import{c as oe,I as T,S as Y,L as w,j as Pe,b as Z,d as ee,e as te,f as se,g as U,B as N,p as E,q as Ee,r as Le,X as Me,A as z}from"./error-boundary-BX3Jjofp.js";import"./console-mirror-BoykuSNB.js";/**
2
- * @license lucide-react v0.507.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const $e=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Ae=oe("link-2",$e);/**
7
- * @license lucide-react v0.507.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const Fe=[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]],Ye=oe("unlink",Fe),Q={list:["desktop","projects"],detail:t=>["desktop","projects",t]};function Re(t){return re({queryKey:Q.list,enabled:t,queryFn:()=>S({op:"projects.list"}).then(s=>s.projects),retry:le,staleTime:1e4})}function Ie(t,s){return re({queryKey:Q.detail(t??""),enabled:!!t,queryFn:()=>S({op:"projects.get",key:t??""}),retry:le,staleTime:1e4})}function M(){const t=ve();return()=>{t.invalidateQueries({queryKey:Q.list})}}function Oe(){const t=M();return L({mutationFn:s=>S({op:"projects.create",name:s.name,...s.description!==void 0?{description:s.description}:{},...s.status!==void 0?{status:s.status}:{},...s.tags!==void 0?{tags:s.tags}:{}}),onSuccess:()=>t()})}function Ue(){const t=M();return L({mutationFn:s=>S({op:"projects.update",key:s.key,fields:s.fields}),onSuccess:()=>t()})}function Be(){const t=M();return L({mutationFn:s=>S({op:"projects.delete",key:s.key,confirmed_name:s.confirmedName}),onSuccess:()=>t()})}function qe(){const t=M();return L({mutationFn:s=>S({op:"projects.link",key:s.key,sessionId:s.sessionId}),onSuccess:()=>t()})}function ze(){const t=M();return L({mutationFn:s=>S({op:"projects.unlink",key:s.key,sessionId:s.sessionId}),onSuccess:()=>t()})}function Ke(){const t=M();return L({mutationFn:s=>S({op:"projects.milestone",key:s.key,name:s.name,...s.targetDate!==void 0?{targetDate:s.targetDate}:{},...s.completed!==void 0?{completed:s.completed}:{}}),onSuccess:()=>t()})}function He(){const t=M();return L({mutationFn:s=>S({op:"projects.milestone.remove",key:s.key,name:s.name}),onSuccess:()=>t()})}const Je={active:{label:"Active",variant:"accent"},paused:{label:"Paused",variant:"neutral"},done:{label:"Done",variant:"success"},archived:{label:"Archived",variant:"outline"}};function ce(t){return Je[t]??{label:t||"Unknown",variant:"neutral"}}const Qe={completed:{label:"Completed",variant:"success"},overdue:{label:"Overdue",variant:"warning"},upcoming:{label:"Upcoming",variant:"neutral"}};function We(t){return Qe[t]??{label:String(t),variant:"neutral"}}const de="Stale",Ge=/^(\d{4})-(\d{2})-(\d{2})$/;function F(t,s,i=new Date){if(!t)return"";const n=Ge.exec(t);if(!n)return t;const m=new Date(Number(n[1]),Number(n[2])-1,Number(n[3]));if(Number.isNaN(m.getTime()))return t;const a=m.toLocaleDateString(s,{month:"short",day:"numeric"});return m.getFullYear()===i.getFullYear()?a:`${a}, ${m.getFullYear()}`}function me(t,s){if(t==null)return"";const i=Math.max(0,Math.floor(s/1e3-t));return i<60?"just now":i<3600?`${Math.floor(i/60)}m`:i<86400?`${Math.floor(i/3600)}h`:`${Math.floor(i/86400)}d`}function ue(t){return t==="just now"?"just now":`${t} ago`}const xe=/^$|^\d{4}-\d{2}-\d{2}$/;function Ve(t){return t?t==="operator"?"the operator":`session ${t}`:""}function Xe(t,s){if(!t.progress)return"not reported yet";const i=me(t.progress_updated_at,s),n=Ve(t.progress_reported_by),m=[i?`reported ${ue(i)}`:"reported"];return n&&m.push(`by ${n}`),m.join(" ")}function he(t,s){if(t==null)return"";const i=String(t);return s==="points"?`${i} pt`:s==="days"?`${i}d`:i}function pe(t,s){return s<=0?"":`${t}/${s}`}function ge(t){return t<=0?"":`${t} live`}function Ze(t){if(!t.exists)return{label:"Missing",variant:"outline"};if(t.archived)return{label:"Archived",variant:"neutral"};switch(t.runtime?.state){case"live":return{label:"Live",variant:"success"};case"wedged":return{label:"Wedged",variant:"warning"};case"stale":return{label:"Stale",variant:"warning"};case"stopped":return{label:"Stopped",variant:"neutral"};default:return{label:String(t.runtime?.state??"Unknown"),variant:"neutral"}}}function et(t){return t?t.running>0?t.running===1?"1 subagent running":`${t.running} subagents running`:t.settled===1?"1 subagent":`${t.settled} subagents`:""}function tt(t){return t?t.total===1?"1 todo":`${t.total} todos`:""}function st(t,s){const i=[],n=F(t.completed_at??t.target_date,s);n&&i.push({key:t.completed_at?"completed":"target",text:t.completed_at?`completed ${n}`:`due ${n}`});const m=he(t.estimate,t.estimate_unit);m&&i.push({key:"estimate",text:m});const a=pe(t.milestones_completed,t.milestones_total);a&&i.push({key:"milestones",text:`milestones ${a}`});const d=ge(t.live_sessions);return d&&i.push({key:"live",text:d}),i}const at=({open:t,projectName:s,onClose:i,onConfirm:n})=>{const[m,a]=v.useState(""),[d,o]=v.useState(null),[f,j]=v.useState(!1),c=v.useId();v.useEffect(()=>{t&&(a(""),o(null),j(!1))},[t]);const h=m.trim().toLowerCase()===s.trim().toLowerCase()&&s.trim().length>0,u=async()=>{j(!0),o(null);try{await n(m.trim()),i()}catch(x){o(x instanceof Error&&x.message?x.message:"The project was not deleted.")}finally{j(!1)}};return e.jsx(K,{open:t,onClose:i,title:"Delete this project?",dataTourTag:"project-delete-dialog",actions:e.jsxs(e.Fragment,{children:[e.jsx(H,{onClick:i,disabled:f,children:"Cancel"}),e.jsxs(be,{onClick:()=>void u(),disabled:!h||f,children:[f&&e.jsx(Y,{size:"xs"}),"Delete project"]})]}),children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("p",{className:"text-body-sm text-ink",children:"This deletes the project and its milestones. The sessions linked to it are not touched."}),e.jsxs("p",{className:"text-body-sm text-ink-muted",children:["Type"," ",e.jsx("span",{className:"font-mono text-mono-sm text-ink",children:s})," ","to confirm."]}),e.jsx(T,{id:`${c}-confirm`,value:m,onChange:x=>a(x.target.value),placeholder:s,"aria-label":"Type the project name to confirm","aria-invalid":m.length>0&&!h,autoFocus:!0}),d&&e.jsx("p",{className:"text-body-sm text-danger",children:d})]})})},nt=[{value:"active",label:"Active"},{value:"paused",label:"Paused"},{value:"done",label:"Done"},{value:"archived",label:"Archived"}],fe={name:"",description:"",status:"active",tags:"",startDate:"",targetDate:"",estimate:"",estimateUnit:"points"},ae=xe;function ne(t){return t.split(",").map(s=>s.trim()).filter(s=>s.length>0)}function it(t){return t?{name:t.name,description:t.description,status:t.status,tags:t.tags.join(", "),startDate:t.start_date??"",targetDate:t.target_date??"",estimate:t.estimate===null||t.estimate===void 0?"":String(t.estimate),estimateUnit:t.estimate_unit||"points"}:fe}const je=({open:t,mode:s,initial:i,onClose:n,onSubmit:m})=>{const[a,d]=v.useState(fe),[o,f]=v.useState({}),[j,c]=v.useState(null),[h,u]=v.useState(!1),x=v.useId();v.useEffect(()=>{t&&(d(it(i)),f({}),c(null),u(!1))},[t]);const b=(r,g)=>{d(k=>({...k,[r]:g}))},l=r=>{const g={},k=ke(r.name.trim());k&&(g.name=k),r.description.length>O&&(g.description=`Keep the description within ${O} characters.`);const $=ne(r.tags);if($.length>8)g.tags="At most 8 tags.";else for(const C of $){const p=Ne(C);if(p){g.tags=p;break}}if(s==="edit"&&(ae.test(r.startDate)||(g.startDate="Dates are YYYY-MM-DD, or empty."),ae.test(r.targetDate)||(g.targetDate="Dates are YYYY-MM-DD, or empty."),!g.startDate&&!g.targetDate&&r.startDate&&r.targetDate&&r.targetDate<r.startDate&&(g.targetDate="The target date is before the start date."),r.estimate)){const C=Number(r.estimate);(!Number.isFinite(C)||!(C>0)||C>1e3)&&(g.estimate="Estimates are greater than 0 and at most 1000.")}return g},R=async()=>{const r=l(a);if(f(r),Object.keys(r).length>0)return;u(!0),c(null);const g=ne(a.tags);try{s==="create"?await m({mode:"create",fields:{name:a.name.trim(),...a.description.trim()?{description:a.description.trim()}:{},status:a.status,...g.length>0?{tags:g}:{}}}):await m({mode:"edit",key:i?.key??"",fields:{name:a.name.trim(),description:a.description.trim(),status:a.status,tags:g,start_date:a.startDate,target_date:a.targetDate,...a.estimate?{estimate:Number(a.estimate)}:{},estimate_unit:a.estimateUnit}}),n()}catch(k){c(k instanceof Error&&k.message?k.message:"The project was not saved.")}finally{u(!1)}},I=s==="create"?"New project":"Edit project";return e.jsx(K,{open:t,onClose:n,title:I,maxWidth:"sm",dataTourTag:s==="create"?"project-create-dialog":"project-edit-dialog",actions:e.jsxs(e.Fragment,{children:[e.jsx(H,{onClick:n,disabled:h,children:"Cancel"}),e.jsxs(ye,{onClick:()=>void R(),disabled:h,children:[h&&e.jsx(Y,{size:"xs"}),s==="create"?"Create project":"Save changes"]})]}),children:e.jsxs("form",{className:"flex flex-col gap-4 px-1 py-1",onSubmit:r=>{r.preventDefault(),R()},children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(w,{htmlFor:`${x}-name`,children:"Name"}),e.jsx(T,{id:`${x}-name`,value:a.name,onChange:r=>b("name",r.target.value),placeholder:"payments-migration",autoFocus:!0,"aria-invalid":!!o.name}),o.name?e.jsx("p",{className:"text-meta text-danger",children:o.name}):e.jsx("p",{className:"text-meta text-ink-muted",children:"Letters, digits, dot, underscore or dash; no spaces."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(w,{htmlFor:`${x}-description`,children:"Description"}),e.jsx(Pe,{id:`${x}-description`,value:a.description,onChange:r=>b("description",r.target.value),rows:2,"aria-invalid":!!o.description}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.description?e.jsx("p",{className:"text-meta text-danger",children:o.description}):e.jsx("span",{}),e.jsxs("p",{className:"text-meta text-ink-muted tabular-nums",children:[a.description.length,"/",O]})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(w,{children:"Status"}),e.jsxs(Z,{value:a.status,onValueChange:r=>b("status",r),children:[e.jsx(ee,{"aria-label":"Status",children:e.jsx(te,{})}),e.jsx(se,{children:nt.map(r=>e.jsx(U,{value:r.value,children:r.label},r.value))})]}),a.status==="done"&&e.jsx("p",{className:"text-meta text-ink-muted",children:"Moving a project to Done stamps today as its completion date."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(w,{htmlFor:`${x}-tags`,children:"Tags"}),e.jsx(T,{id:`${x}-tags`,value:a.tags,onChange:r=>b("tags",r.target.value),placeholder:"q4, payments","aria-invalid":!!o.tags}),o.tags?e.jsx("p",{className:"text-meta text-danger",children:o.tags}):e.jsx("p",{className:"text-meta text-ink-muted",children:"Comma-separated, up to 8. Lowercase letters, digits, underscore or dash."})]}),s==="edit"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(w,{htmlFor:`${x}-start`,children:"Start date"}),e.jsx(T,{id:`${x}-start`,value:a.startDate,onChange:r=>b("startDate",r.target.value),placeholder:"YYYY-MM-DD","aria-invalid":!!o.startDate}),o.startDate&&e.jsx("p",{className:"text-meta text-danger",children:o.startDate})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(w,{htmlFor:`${x}-target`,children:"Target date"}),e.jsx(T,{id:`${x}-target`,value:a.targetDate,onChange:r=>b("targetDate",r.target.value),placeholder:"YYYY-MM-DD","aria-invalid":!!o.targetDate}),o.targetDate&&e.jsx("p",{className:"text-meta text-danger",children:o.targetDate})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(w,{htmlFor:`${x}-estimate`,children:"Estimate"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(T,{id:`${x}-estimate`,value:a.estimate,onChange:r=>b("estimate",r.target.value),placeholder:"13",inputMode:"decimal","aria-invalid":!!o.estimate,className:"max-w-28"}),e.jsxs(Z,{value:a.estimateUnit,onValueChange:r=>b("estimateUnit",r),children:[e.jsx(ee,{"aria-label":"Estimate unit",className:"max-w-32",children:e.jsx(te,{})}),e.jsxs(se,{children:[e.jsx(U,{value:"points",children:"Points"}),e.jsx(U,{value:"days",children:"Days"})]})]})]}),o.estimate&&e.jsx("p",{className:"text-meta text-danger",children:o.estimate}),s==="edit"&&a.estimate.trim()===""&&i?.estimate!==null&&i?.estimate!==void 0&&e.jsx("p",{className:"text-meta text-ink-muted",children:"Clearing an estimate is not supported yet — saving keeps its current value."})]})]}),j&&e.jsx("p",{className:"text-body-sm text-danger",children:j})]})})},rt=({links:t,busy:s,onUnlink:i,onLink:n})=>{const m=J(),a=W(c=>c.sessions),[d,o]=v.useState(!1),f=v.useMemo(()=>{const c=new Set(t.map(h=>h.session_id));return a.filter(h=>!c.has(h.session_id)).map(h=>({id:h.session_id,name:h.title||h.session_id,description:h.cwd??void 0}))},[a,t]),j=c=>{W.getState().openSession(c).then(h=>{h&&m(`/chat/${c}`)})};return e.jsxs("section",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-title text-ink",children:"Linked sessions"}),e.jsxs(N,{variant:"secondary",size:"sm",disabled:s,onClick:()=>o(!0),"data-tour-tag":"project-link-session",children:[e.jsx(Ae,{}),"Link session"]})]}),t.length===0?e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No sessions linked yet. Link the conversations that are working on this project so its progress stays with them."}):e.jsx("ul",{className:"flex flex-col divide-y divide-hairline rounded-lg border border-hairline bg-surface",children:t.map(c=>{const h=Ze(c),u=et(c.subagents),x=tt(c.todos),b=c.title||c.session_id,l=c.exists;return e.jsxs("li",{className:"flex items-center gap-2 px-3 py-2",children:[e.jsx("button",{type:"button",disabled:!l,onClick:()=>{l&&j(c.session_id)},className:D("flex min-w-0 flex-1 items-center gap-2 text-left",l?"cursor-pointer":"cursor-default opacity-100"),children:e.jsx("span",{className:D("min-w-0 truncate text-body-sm",c.title?"text-ink":"font-mono text-mono-sm text-ink-muted"),children:b})}),c.runtime?.busy===!0&&e.jsx("span",{className:"shrink-0 text-meta text-ink-muted",children:"busy"}),u&&e.jsx("span",{className:"shrink-0 text-meta text-ink-muted",children:u}),x&&e.jsx("span",{className:"shrink-0 text-meta text-ink-muted",children:x}),e.jsx(E,{variant:h.variant,children:h.label}),e.jsx(N,{variant:"ghost",size:"icon-sm",disabled:s,"aria-label":`Unlink ${b}`,onClick:()=>i(c.session_id),children:e.jsx(Ye,{})})]},c.session_id)})}),e.jsx(K,{open:d,onClose:()=>o(!1),title:"Link a session",maxWidth:"sm",dataTourTag:"project-link-dialog",actions:e.jsx(H,{onClick:()=>o(!1),children:"Close"}),children:e.jsxs("div",{className:"flex flex-col gap-2 px-1 py-1",children:[e.jsx(w,{children:"Session"}),e.jsx(Ee,{showLabel:!1,ariaLabel:"Search sessions",busyLabel:"Loading sessions",placeholder:"Search conversations",options:f,selected:null,onSelect:c=>{o(!1),n(c.id)}}),e.jsx("p",{className:"text-meta text-ink-muted",children:"Conversations already linked to this project are not listed."})]})})]})},lt=({milestones:t,busy:s,onToggle:i,onRemove:n,onAdd:m})=>{const[a,d]=v.useState(""),[o,f]=v.useState(""),j=!xe.test(o.trim()),c=a.trim().length>0&&!j&&!s,h=()=>{c&&(m(a.trim(),o.trim()),d(""),f(""))};return e.jsxs("section",{className:"flex flex-col gap-3",children:[e.jsx("h2",{className:"text-title text-ink",children:"Milestones"}),t.length===0?e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No milestones yet. Add one below to mark the dates this project is planned around."}):e.jsx("ul",{className:"flex flex-col divide-y divide-hairline rounded-lg border border-hairline bg-surface",children:t.map(u=>{const x=We(u.status),b=u.completed_at!==null;return e.jsxs("li",{className:"flex items-center gap-3 px-3 py-2",children:[e.jsx(Le,{checked:b,disabled:s,onCheckedChange:l=>i(u.name,l===!0),"aria-label":b?`Mark ${u.name} not complete`:`Mark ${u.name} complete`}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-body-sm text-ink",children:u.name}),u.target_date&&e.jsx("span",{className:"shrink-0 text-meta text-ink-muted",children:F(u.target_date,typeof navigator>"u"?void 0:navigator.language)}),e.jsx(E,{variant:x.variant,children:x.label}),e.jsx(N,{variant:"ghost",size:"icon-sm",disabled:s,"aria-label":`Remove ${u.name}`,onClick:()=>n(u.name),children:e.jsx(Me,{})})]},u.name)})}),e.jsxs("div",{className:"flex items-end gap-3",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[e.jsx(w,{htmlFor:"project-milestone-name",children:"New milestone"}),e.jsx(T,{id:"project-milestone-name",value:a,onChange:u=>d(u.target.value),placeholder:"beta cut",onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),h())}})]}),e.jsxs("div",{className:"flex w-40 flex-col gap-1.5",children:[e.jsx(w,{htmlFor:"project-milestone-date",children:"Target date"}),e.jsx(T,{id:"project-milestone-date",value:o,onChange:u=>f(u.target.value),placeholder:"YYYY-MM-DD","aria-invalid":j}),j&&e.jsx("p",{className:"text-meta text-danger",children:"Dates are YYYY-MM-DD, or empty."})]}),e.jsxs(N,{variant:"secondary",disabled:!c,onClick:h,"data-tour-tag":"project-milestone-add",children:[e.jsx(B,{}),"Add"]})]})]})},ot=({projectKey:t,nowMs:s})=>{const i=J(),n=Ie(t),m=Ue(),a=Be(),d=Ke(),o=He(),f=qe(),j=ze(),[c,h]=v.useState(!1),[u,x]=v.useState(!1),b=m.isPending||a.isPending||d.isPending||o.isPending||f.isPending||j.isPending;if(n.isLoading)return e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(Y,{label:"Loading project"})});if(n.isError||!n.data)return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(z,{variant:"danger",children:n.error instanceof Error&&n.error.message?n.error.message:"The project could not be read."}),e.jsxs(N,{variant:"secondary",onClick:()=>void i("/projects"),children:[e.jsx(G,{}),"All projects"]})]});const{project:l,links:R}=n.data,I=ce(l.status),r=he(l.estimate,l.estimate_unit),g=[],k=F(l.start_date,typeof navigator>"u"?void 0:navigator.language),$=F(l.target_date,typeof navigator>"u"?void 0:navigator.language),C=F(l.completed_at,typeof navigator>"u"?void 0:navigator.language);return k&&g.push({label:"Start",value:k}),$&&g.push({label:"Target",value:$}),C&&g.push({label:"Completed",value:C}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 overflow-y-auto",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("button",{type:"button",onClick:()=>void i("/projects"),className:"flex w-fit items-center gap-1.5 text-body-sm text-ink-muted hover:text-ink",children:[e.jsx(G,{className:"size-4"}),"All projects"]}),e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h1",{className:"min-w-0 truncate text-display text-ink",children:l.name}),e.jsx(E,{variant:I.variant,children:I.label}),l.progress_stale&&e.jsx(E,{variant:"warning",children:de})]}),l.description&&e.jsx("p",{className:"max-w-200 text-body text-ink-muted",children:l.description}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-body-sm text-ink-muted",children:[g.map(p=>e.jsxs("span",{children:[p.label," ",p.value]},p.label)),r&&e.jsx("span",{children:r}),l.tags.length>0&&e.jsx("span",{className:"flex flex-wrap items-center gap-1.5",children:l.tags.map(p=>e.jsx(E,{variant:"outline",children:p},p))})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(N,{variant:"secondary",onClick:()=>h(!0),"data-tour-tag":"project-edit",children:[e.jsx(we,{}),"Edit"]}),e.jsxs(N,{variant:"secondary",onClick:()=>x(!0),"data-tour-tag":"project-delete",children:[e.jsx(De,{}),"Delete"]})]})]})]}),e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-title text-ink",children:"Progress"}),e.jsx("p",{className:"max-w-200 whitespace-pre-wrap text-body-sm text-ink",children:l.progress||"No progress has been reported yet."}),e.jsx("p",{className:"text-meta text-ink-muted",children:Xe(l,s)})]}),e.jsx(lt,{milestones:l.milestones,busy:b,onToggle:(p,y)=>{d.mutateAsync({key:l.id,name:p,completed:y}).catch(P=>{A(P instanceof Error&&P.message?P.message:"The milestone was not updated.")})},onRemove:p=>{o.mutateAsync({key:l.id,name:p}).catch(y=>{A(y instanceof Error&&y.message?y.message:"The milestone was not removed.")})},onAdd:(p,y)=>{d.mutateAsync({key:l.id,name:p,targetDate:y}).catch(P=>{A(P instanceof Error&&P.message?P.message:"The milestone was not added.")})}}),e.jsx(rt,{projectKey:l.id,links:R,busy:b,onLink:p=>{f.mutateAsync({key:l.id,sessionId:p}).catch(y=>{A(y instanceof Error&&y.message?y.message:"The session was not linked.")})},onUnlink:p=>{j.mutateAsync({key:l.id,sessionId:p}).catch(y=>{A(y instanceof Error&&y.message?y.message:"The session was not unlinked.")})}}),e.jsx(je,{open:c,mode:"edit",initial:{key:l.id,name:l.name,description:l.description,status:l.status,tags:l.tags,start_date:l.start_date,target_date:l.target_date,estimate:l.estimate,estimate_unit:l.estimate_unit},onClose:()=>h(!1),onSubmit:async p=>{p.mode==="edit"&&(await m.mutateAsync({key:p.key,fields:p.fields}),q("Project saved"))}}),e.jsx(at,{open:u,projectName:l.name,onClose:()=>x(!1),onConfirm:async p=>{await a.mutateAsync({key:l.id,confirmedName:p}),q("Project deleted"),i("/projects")}})]})},_=[{key:"name",label:"Project",className:"min-w-0 flex-1"},{key:"status",label:"Status",className:"w-20 shrink-0"},{key:"target",label:"Target",className:"hidden w-32 shrink-0 @[40rem]:block"},{key:"estimate",label:"Estimate",className:"hidden w-16 shrink-0 @[40rem]:block"},{key:"milestones",label:"Milestones",className:"hidden w-20 shrink-0 @[34rem]:block"},{key:"live",label:"Live",className:"hidden w-14 shrink-0 @[34rem]:block"},{key:"progress",label:"Progress",className:"w-40 shrink-0"}];function ct(t,s){const i=me(t.progress_updated_at,s);return i?ue(i):"not reported"}const dt=({projects:t,nowMs:s,onOpen:i})=>e.jsxs("div",{className:"@container flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-hairline bg-surface","data-testid":"project-list",children:[e.jsx("div",{className:"flex shrink-0 items-center gap-3 border-b border-hairline px-3 py-2 text-meta text-ink-muted","aria-hidden":"true",children:_.map(n=>e.jsx("span",{className:n.className,children:n.label},n.key))}),e.jsx("ul",{className:"min-h-0 flex-1 divide-y divide-hairline overflow-y-auto",children:t.map(n=>{const m=ce(n.status),a=new Map(st(n,typeof navigator>"u"?void 0:navigator.language).map(f=>[f.key,f.text])),d=pe(n.milestones_completed,n.milestones_total),o=ge(n.live_sessions);return e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>i(n),"data-project-name":n.name,className:D("flex w-full items-center gap-3 px-3 py-2 text-left","transition-colors duration-fast ease-out-quart","hover:bg-elevated"),children:[e.jsx("span",{className:D(_[0].className,"truncate text-body-sm text-ink"),children:n.name}),e.jsx("span",{className:_[1].className,children:e.jsx(E,{variant:m.variant,children:m.label})}),e.jsx("span",{className:D(_[2].className,"truncate text-meta text-ink-muted"),children:a.get("target")??a.get("completed")??""}),e.jsx("span",{className:D(_[3].className,"truncate text-meta text-ink-muted"),children:a.get("estimate")??""}),e.jsx("span",{className:D(_[4].className,"truncate text-meta text-ink-muted"),children:d}),e.jsx("span",{className:D(_[5].className,"truncate text-meta text-ink-muted"),children:o}),e.jsxs("span",{className:D(_[6].className,"flex items-center gap-2"),children:[e.jsx("span",{className:"truncate text-meta text-ink-muted",children:ct(n,s)}),n.progress_stale&&e.jsx(E,{variant:"warning",children:de})]})]})},n.id)})})]}),ie={unpaired:"This app is not paired with the Local Operator server, so Projects are unavailable.","below-version":"The Local Operator server is older than this app expects, so Projects are unavailable. Update the server and try again.",unknown:"The server's capabilities could not be read, so Projects are unavailable."},gt=({nowMs:t=Date.now()})=>{const{projectId:s}=Se(),i=J(),n=Ce(),m=_e(n.data,"projects",1),a=m==="enabled",d=Re(a),o=Oe(),[f,j]=v.useState(!1);return a?s?e.jsx("div",{className:"flex h-full min-h-0 flex-col gap-8 p-6",children:e.jsx(ot,{projectKey:s,nowMs:t})}):e.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-8 p-6",children:[e.jsx(X,{title:"Projects",icon:V,subtitle:"Workstreams you and your agents track across sessions.",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{variant:"secondary",size:"icon","aria-label":"Refresh projects",title:"Refresh projects",disabled:d.isFetching,onClick:()=>void d.refetch(),"data-tour-tag":"refresh-projects-button",children:e.jsx(Te,{})}),e.jsxs(N,{variant:"secondary",onClick:()=>j(!0),"data-tour-tag":"create-project-button",children:[e.jsx(B,{}),"New project"]})]})}),d.isLoading&&e.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-hairline bg-surface",children:e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsx(Y,{label:"Loading projects"})})}),d.isError&&e.jsxs("div",{className:"flex flex-col items-start gap-2",children:[e.jsx(z,{variant:"danger",children:d.error instanceof Error&&d.error.message?d.error.message:"The projects could not be read."}),e.jsx(N,{variant:"secondary",size:"sm",onClick:()=>void d.refetch(),children:"Try again"})]}),d.isSuccess&&d.data.length===0&&e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-4 overflow-hidden rounded-lg border border-hairline bg-surface",children:[e.jsx("p",{className:"text-heading text-ink",children:"No projects yet."}),e.jsx("p",{className:"max-w-140 text-center text-body-sm text-ink-muted",children:"Create one here, or ask an agent to create one and link this session."}),e.jsxs(N,{variant:"primary",onClick:()=>j(!0),"data-tour-tag":"create-project-empty-button",children:[e.jsx(B,{}),"New project"]})]}),d.isSuccess&&d.data.length>0&&e.jsx(dt,{projects:d.data,nowMs:t,onOpen:c=>void i(`/projects/${c.id}`)}),e.jsx(je,{open:f,mode:"create",onClose:()=>j(!1),onSubmit:async c=>{c.mode==="create"&&(await o.mutateAsync(c.fields),q(`Project ${c.fields.name} created`))}})]}):e.jsxs("div",{className:"flex h-full flex-col gap-8 p-6",children:[e.jsx(X,{title:"Projects",icon:V}),n.isLoading?e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(Y,{label:"Checking the server's Projects support"})}):e.jsx(z,{variant:"warning",children:ie[m]??ie.unknown})]})};export{gt as ProjectsPage};
@@ -1 +0,0 @@
1
- import{a4 as l,a5 as d,a6 as c,a7 as h,a8 as s,a9 as b,aa as m,ab as g,ac as p,ad as _,ae as w}from"./index-DyfVjYXR.js";const i={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."},f=n=>{const t=n.trim();return t.length>12&&/\s/.test(t)&&!/^(not found|bad request|unauthorized|error|internal server error)\.?$/i.test(t)};function y(n){const t=n?.categories?.[0];return t&&m(t)?i[t]:i.other_harmful}function T(n,t){const e=t?.rule?` ${t.rule}`:"";switch(t?.field){case"name":return{body:`Name${e||" is not acceptable"}.`,field:"name"};case"instructions":return{body:e?`The instruction body${e}.`:`The instruction body must be between 1 and ${b} characters.`,field:"instructions"};case"description":return{body:`Description${e}.`,field:"description"};case"tools":return{body:`Tools${e}.`,field:"tools"};case"when_to_use":return{body:`When to use${e}.`,field:"when_to_use"};case"categories":return{body:`Categories${e}.`,field:"categories"};case"tags":return{body:`Tags${e}.`,field:"tags"};default:return{body:n,field:null}}}function k(n,t){const e=t.name.trim()||"this agent";switch(n.code){case"name_taken":return n.details?.owned_by_caller===!0?{variant:"danger",headline:"You already published this agent",body:`You published "${e}" already. Update that listing instead of publishing a second one.`,note:null,actions:n.details?.existing_agent_id||t.hubAgentId?["update-listing","focus-name"]:["focus-name"]}:{variant:"danger",headline:"That name is taken",body:`"${e}" 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 "${e}" at this moment. It is not claimed — try again in a moment.`,note:null,actions:["retry"]};case"name_reserved_builtin":{const o=n.details?.builtin_name,a=o?s(o)===s(e):!1;return{variant:"danger",headline:"That name is reserved",body:o&&!a?`"${e}" is reserved by the built-in agent "${o}". Built-in names cannot be published to the hub.`:`"${o??e}" 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:n.details?.reason?.trim()||n.message,note:y(n.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:o,field:a}=T(n.message,n.details);return{variant:"danger",headline:"The agent document is not valid",body:o,note:null,actions:a==="name"?["focus-name"]:a==="instructions"?["edit-instructions"]:["edit-agent"]}}case"payload_too_large":{const o=n.details?.limit_bytes;return{variant:"danger",headline:"This agent is too large to publish",body:o?`The instruction set is larger than ${Math.round(o/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:"Nothing was published. Sign in to Radient again to replace the credential the hub refused, then publish again.",note:null,actions:["sign-in"]};case"hub_unavailable":return{variant:"warning",headline:"The publication did not go through",body:f(n.message)?n.message:"Nothing was published. 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:"The agent could not be published from this machine",body:n.message,note:null,actions:["retry"]};default:return{variant:"danger",headline:"The agent could not be published",body:n.message,note:null,actions:["retry"]}}}const v=[/^(?: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*/],$=/^(\d{3})\b/,I=new Set([404,410]),N=["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"],R=n=>{const t=n.toLowerCase();return N.some(e=>t.includes(e))||h(n)},A=(n,t)=>{const e=t.trim()?`"${t.trim()}"`:"That agent";if(d(n))switch(n.code){case"agent_not_found":return`${e} is no longer on the hub, so nothing was downloaded.`;case"hub_unavailable":return`The hub did not complete the download, so ${e} was not downloaded.`;default:return`${e} was not downloaded: ${n.message}`}const o=v.reduce((r,u)=>r.replace(u,""),c(n,"").trim()).trim();if(!o)return`${e} could not be downloaded.`;const a=Number($.exec(o)?.[1]??Number.NaN);return I.has(a)?`${e} is no longer on the hub, so nothing was downloaded.`:R(o)||a===408?`The hub could not be reached, so ${e} was not downloaded.`:a===429?`The hub is busy, so ${e} was not downloaded. Try again in a moment.`:a===401||a===403?`The hub refused this machine's sign-in, so ${e} was not downloaded.`:a>=500?`The hub could not complete the download, so ${e} was not downloaded. Try again in a moment.`:a>=400?`The hub refused the download, so ${e} is not here.`:`${e} was not downloaded: ${o}`},L="The action did not complete.",C=(n,t,e)=>n==="download"?A(t,e):l(L,t),S={name:"Name",description:"Description",instructions:"The instruction body",tools:"Tools"};function x(n){const t=[],e=(o,a)=>{a&&t.push({field:o,message:`${S[o]} ${a}.`})};return e("name",g(n.name)),e("description",p(n.description)),n.instructions!==null&&e("instructions",_(n.instructions)),e("tools",w(n.tools??[])),t}function O(n,t){const e=s(n);return t.some(o=>s(o)===e)}function P(n){for(const t of n??[]){const e=t.indexOf(":");if(e<0||t.slice(0,e).trim().toLowerCase()!=="tools")continue;const o=t.slice(e+1).split(",").map(a=>a.trim()).filter(Boolean);return o.length>0?o:null}return null}function U(n,t){const e=s(n);return t.find(o=>s(o)===e)??null}export{C as a,k as b,O as i,U as l,x as p,P as t};
@@ -1,6 +0,0 @@
1
- import{c as h,A as m,S as p}from"./error-boundary-BX3Jjofp.js";import{j as e,c}from"./index-hIJSZMtz.js";import{f as u,b as v,d as g,af as k,ag as b,ah as f}from"./index-DyfVjYXR.js";/**
2
- * @license lucide-react v0.507.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const j=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],I=h("notebook-pen",j),S=({title:t,description:a,icon:s,children:n,titleComponent:l,sectionRef:i,dataTourTag:d,className:o,id:r})=>e.jsxs("div",{ref:i,id:r,tabIndex:r?-1:void 0,"data-tour-tag":d,className:c("w-full",o),children:[l??e.jsxs("h2",{className:"flex items-center gap-2 text-heading text-ink",children:[s&&e.jsx(s,{size:16,className:"shrink-0 text-ink-dim"}),t]}),a&&e.jsx("p",{className:"mt-1 max-w-2xl text-body-sm text-ink-muted",children:a}),e.jsx("div",{className:"mt-4",children:n})]}),D=({label:t,value:a,className:s,valueClassName:n})=>e.jsxs("div",{className:c("min-w-0",s),children:[e.jsx("div",{className:"flex items-center gap-1.5 text-meta text-ink-dim",children:t}),e.jsx("div",{className:c("mt-0.5 break-words text-body-sm",n??"text-ink"),children:a})]}),M=({children:t,className:a})=>e.jsx("div",{className:c("grid grid-cols-[repeat(auto-fit,minmax(160px,1fr))] gap-x-6 gap-y-4",a),children:t}),y="radient",C=({onSignInSuccess:t,onAfterCredentialUpdate:a,titleText:s="Sign in to Radient",descriptionText:n="Connect your Radient account to use Radient services."})=>{const l=u(),i=v(),d=g(i.data,"auth"),o=k(d),r=o.data?.find(x=>x.id===y);return i.isSuccess&&!d?e.jsx(m,{variant:"warning",children:"Signing in needs a newer Local Operator backend. Update the backend and restart the app."}):o.isLoading||i.isLoading?e.jsx("div",{className:"flex h-24 items-center justify-center",children:e.jsx(p,{size:"md",label:"Loading sign-in options"})}):r?e.jsxs("div",{className:"mx-auto w-full max-w-md",children:[s&&e.jsx("p",{className:"mb-2 text-center text-heading text-ink",children:s}),n&&e.jsx("p",{className:"mb-6 text-center text-body-sm text-ink-muted",children:n}),e.jsx(b,{provider:r,onConnected:()=>{l.invalidateQueries({queryKey:f.all}),a?.(),t?.()}})]}):e.jsx(m,{variant:"warning",children:"Radient is not available from this backend's provider registry."})};export{M as I,I as N,C as R,S,D as a};