agent-relay-server 0.58.0 → 0.59.0
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/docs/openapi.json +1 -1
- package/package.json +2 -2
- package/public/assets/{MessageBubble-CHKzD4RY.js → MessageBubble-BrEKymoV.js} +2 -2
- package/public/assets/{MessageBubble-CHKzD4RY.js.map → MessageBubble-BrEKymoV.js.map} +1 -1
- package/public/assets/{PlanGraphPanel-BFVTJa0q.js → PlanGraphPanel-CXix1C-H.js} +2 -2
- package/public/assets/{PlanGraphPanel-BFVTJa0q.js.map → PlanGraphPanel-CXix1C-H.js.map} +1 -1
- package/public/assets/{activity-M-dFLU_O.js → activity-CRafQ1Je.js} +2 -2
- package/public/assets/{activity-M-dFLU_O.js.map → activity-CRafQ1Je.js.map} +1 -1
- package/public/assets/{agent-profiles-CvHSoyCX.js → agent-profiles-DW4o5-ND.js} +2 -2
- package/public/assets/{agent-profiles-CvHSoyCX.js.map → agent-profiles-DW4o5-ND.js.map} +1 -1
- package/public/assets/agents-Cbegv0Hm.js +2 -0
- package/public/assets/{agents-DZBM5dp_.js.map → agents-Cbegv0Hm.js.map} +1 -1
- package/public/assets/analytics-DX6T7JX3.js +910 -0
- package/public/assets/{analytics-bvjb3Urs.js.map → analytics-DX6T7JX3.js.map} +1 -1
- package/public/assets/{automation-CDSn9Uq-.js → automation-CzSBv4gg.js} +2 -2
- package/public/assets/{automation-CDSn9Uq-.js.map → automation-CzSBv4gg.js.map} +1 -1
- package/public/assets/{badge-Dj6PREuI.js → badge-Cy6qO_Jz.js} +2 -2
- package/public/assets/{badge-Dj6PREuI.js.map → badge-Cy6qO_Jz.js.map} +1 -1
- package/public/assets/{branch-state-badge-CdYg2HYc.js → branch-state-badge-CRA50r81.js} +2 -2
- package/public/assets/{branch-state-badge-CdYg2HYc.js.map → branch-state-badge-CRA50r81.js.map} +1 -1
- package/public/assets/{button-Cqpufqam.js → button-73wpRw65.js} +2 -2
- package/public/assets/{button-Cqpufqam.js.map → button-73wpRw65.js.map} +1 -1
- package/public/assets/{card-OmDF73CE.js → card-BU6PvVHv.js} +2 -2
- package/public/assets/{card-OmDF73CE.js.map → card-BU6PvVHv.js.map} +1 -1
- package/public/assets/{channels-BkxrdOFZ.js → channels-B1MQCPCT.js} +2 -2
- package/public/assets/{channels-BkxrdOFZ.js.map → channels-B1MQCPCT.js.map} +1 -1
- package/public/assets/chat-BqIaFYGJ.js +2 -0
- package/public/assets/{chat-YzX1z76l.js.map → chat-BqIaFYGJ.js.map} +1 -1
- package/public/assets/{connectors-Bg3rHgl_.js → connectors-C9aFJIrh.js} +2 -2
- package/public/assets/{connectors-Bg3rHgl_.js.map → connectors-C9aFJIrh.js.map} +1 -1
- package/public/assets/{copy-button-DI7b8A7_.js → copy-button-HRopUwui.js} +2 -2
- package/public/assets/{copy-button-DI7b8A7_.js.map → copy-button-HRopUwui.js.map} +1 -1
- package/public/assets/display-CketawEF.js.map +1 -1
- package/public/assets/{dist-CNjnTZEI.js → dist-CC5f7oYw.js} +2 -2
- package/public/assets/{dist-CNjnTZEI.js.map → dist-CC5f7oYw.js.map} +1 -1
- package/public/assets/{dist-DkeTrbTA.js → dist-CLHMeXYi.js} +2 -2
- package/public/assets/{dist-DkeTrbTA.js.map → dist-CLHMeXYi.js.map} +1 -1
- package/public/assets/{dist-C5t_OxI0.js → dist-Ci1MM51P.js} +2 -2
- package/public/assets/{dist-C5t_OxI0.js.map → dist-Ci1MM51P.js.map} +1 -1
- package/public/assets/{dist-CV3sgFiv.js → dist-Cko2KPW8.js} +2 -2
- package/public/assets/{dist-CV3sgFiv.js.map → dist-Cko2KPW8.js.map} +1 -1
- package/public/assets/dist-D41tzJYg.js +2 -0
- package/public/assets/{dist-yYauqYKR.js.map → dist-D41tzJYg.js.map} +1 -1
- package/public/assets/{dist-CoUvwLTy.js → dist-DFLciw0h.js} +2 -2
- package/public/assets/{dist-CoUvwLTy.js.map → dist-DFLciw0h.js.map} +1 -1
- package/public/assets/dist-DUoZnlB2.js +2 -0
- package/public/assets/{dist-DmhyU0Na.js.map → dist-DUoZnlB2.js.map} +1 -1
- package/public/assets/dist-De2oguBm.js +2 -0
- package/public/assets/{dist-DxkMwkrr.js.map → dist-De2oguBm.js.map} +1 -1
- package/public/assets/{dist-1x-LE9Uk.js → dist-DmN94rc8.js} +2 -2
- package/public/assets/{dist-1x-LE9Uk.js.map → dist-DmN94rc8.js.map} +1 -1
- package/public/assets/{dist-DV2tZ2fq.js → dist-Kkpnjx_M.js} +2 -2
- package/public/assets/{dist-DV2tZ2fq.js.map → dist-Kkpnjx_M.js.map} +1 -1
- package/public/assets/{dist-Ca3ujqG_.js → dist-T7u7IZGJ.js} +2 -2
- package/public/assets/{dist-Ca3ujqG_.js.map → dist-T7u7IZGJ.js.map} +1 -1
- package/public/assets/{es2015-DcavLcQ0.js → es2015-Df08Opjx.js} +2 -2
- package/public/assets/{es2015-DcavLcQ0.js.map → es2015-Df08Opjx.js.map} +1 -1
- package/public/assets/{formatted-body-impl-D8i9qqL1.js → formatted-body-impl-DOXH7oDF.js} +2 -2
- package/public/assets/{formatted-body-impl-D8i9qqL1.js.map → formatted-body-impl-DOXH7oDF.js.map} +1 -1
- package/public/assets/index-DaNOQJci.css +2 -0
- package/public/assets/index-br_Y6Cvt.js +21 -0
- package/public/assets/{index-Ba2RDJaA.js.map → index-br_Y6Cvt.js.map} +1 -1
- package/public/assets/{input-C_dl_9fG.js → input-B2EDz-BE.js} +2 -2
- package/public/assets/{input-C_dl_9fG.js.map → input-B2EDz-BE.js.map} +1 -1
- package/public/assets/{insights-D1aANwZ2.js → insights-B1edq5lk.js} +2 -2
- package/public/assets/{insights-D1aANwZ2.js.map → insights-B1edq5lk.js.map} +1 -1
- package/public/assets/{integrations-BrAr9bap.js → integrations-Cm4fjp7_.js} +2 -2
- package/public/assets/{integrations-BrAr9bap.js.map → integrations-Cm4fjp7_.js.map} +1 -1
- package/public/assets/{lib-B3iMVsf-.js → lib-BZrjIp-o.js} +3 -3
- package/public/assets/{lib-B3iMVsf-.js.map → lib-BZrjIp-o.js.map} +1 -1
- package/public/assets/lucide-react-H_-8G79A.js +9 -0
- package/public/assets/{lucide-react-CMhBract.js.map → lucide-react-H_-8G79A.js.map} +1 -1
- package/public/assets/{maintenance-C-xspsMG.js → maintenance-D6zvw0fU.js} +2 -2
- package/public/assets/{maintenance-C-xspsMG.js.map → maintenance-D6zvw0fU.js.map} +1 -1
- package/public/assets/{managed-agents-Bf3ni0vo.js → managed-agents-CzfEznM1.js} +2 -2
- package/public/assets/{managed-agents-Bf3ni0vo.js.map → managed-agents-CzfEznM1.js.map} +1 -1
- package/public/assets/{markdown-preview-impl-DKbUBTf_.js → markdown-preview-impl-DZlCaTHQ.js} +2 -2
- package/public/assets/{markdown-preview-impl-DKbUBTf_.js.map → markdown-preview-impl-DZlCaTHQ.js.map} +1 -1
- package/public/assets/memory-CUUAzJDc.js +2 -0
- package/public/assets/{memory-DeLwJFwH.js.map → memory-CUUAzJDc.js.map} +1 -1
- package/public/assets/messages-6QZH46LG.js +2 -0
- package/public/assets/{messages-Cww6dZnM.js.map → messages-6QZH46LG.js.map} +1 -1
- package/public/assets/{orchestrators-DRjwROXw.js → orchestrators-CrcqkPuc.js} +2 -2
- package/public/assets/{orchestrators-DRjwROXw.js.map → orchestrators-CrcqkPuc.js.map} +1 -1
- package/public/assets/overview-418xXZO_.js +2 -0
- package/public/assets/{overview-DjcRomU_.js.map → overview-418xXZO_.js.map} +1 -1
- package/public/assets/pairs-CnedATgT.js +2 -0
- package/public/assets/{pairs-DT0u2fnW.js.map → pairs-CnedATgT.js.map} +1 -1
- package/public/assets/{react-dom-Dtl9-x_1.js → react-dom-WI6TjVe7.js} +2 -2
- package/public/assets/{react-dom-Dtl9-x_1.js.map → react-dom-WI6TjVe7.js.map} +1 -1
- package/public/assets/{security-Bwg3oFI8.js → security-DS13pbag.js} +2 -2
- package/public/assets/{security-Bwg3oFI8.js.map → security-DS13pbag.js.map} +1 -1
- package/public/assets/{select-Cariwv69.js → select-BOprGZDS.js} +2 -2
- package/public/assets/{select-Cariwv69.js.map → select-BOprGZDS.js.map} +1 -1
- package/public/assets/{settings-Bd6Ug3DO.js → settings-BgInn_f3.js} +4 -4
- package/public/assets/{settings-Bd6Ug3DO.js.map → settings-BgInn_f3.js.map} +1 -1
- package/public/assets/{store-BgJq_lN9.js → store-DHO_a8BD.js} +5 -5
- package/public/assets/{store-BgJq_lN9.js.map → store-DHO_a8BD.js.map} +1 -1
- package/public/assets/{tasks-DVz1zhOU.js → tasks-B-4oCPuv.js} +2 -2
- package/public/assets/{tasks-DVz1zhOU.js.map → tasks-B-4oCPuv.js.map} +1 -1
- package/public/assets/teams-sCQAs_QA.js +2 -0
- package/public/assets/{teams-TqFntFB_.js.map → teams-sCQAs_QA.js.map} +1 -1
- package/public/assets/{terminal-viewer-impl-OsJ5crlx.js → terminal-viewer-impl-BhqS2XpS.js} +3 -3
- package/public/assets/{terminal-viewer-impl-OsJ5crlx.js.map → terminal-viewer-impl-BhqS2XpS.js.map} +1 -1
- package/public/assets/{use-keyboard-viewport-BYHcL7sP.js → use-keyboard-viewport-fOL_3RHB.js} +2 -2
- package/public/assets/{use-keyboard-viewport-BYHcL7sP.js.map → use-keyboard-viewport-fOL_3RHB.js.map} +1 -1
- package/public/assets/{work-queue-B4b2jPLR.js → work-queue-BDhjlwUH.js} +2 -2
- package/public/assets/{work-queue-B4b2jPLR.js.map → work-queue-BDhjlwUH.js.map} +1 -1
- package/public/assets/workspaces-6I-C69nf.js +3 -0
- package/public/assets/{workspaces-m97LP4Eu.js.map → workspaces-6I-C69nf.js.map} +1 -1
- package/public/index.html +21 -21
- package/src/db/stats.ts +209 -38
- package/src/maintenance.ts +9 -2
- package/src/mcp.ts +3 -0
- package/src/project-instructions.ts +176 -0
- package/src/routes/agents-spawn.ts +2 -0
- package/src/routes/commands.ts +11 -5
- package/src/services/spawn-agent.ts +26 -1
- package/src/workspace-merge.ts +11 -0
- package/src/workspace-pr-completion.ts +57 -1
- package/public/assets/agents-DZBM5dp_.js +0 -2
- package/public/assets/analytics-bvjb3Urs.js +0 -910
- package/public/assets/chat-YzX1z76l.js +0 -2
- package/public/assets/dist-DmhyU0Na.js +0 -2
- package/public/assets/dist-DxkMwkrr.js +0 -2
- package/public/assets/dist-yYauqYKR.js +0 -2
- package/public/assets/index-Ba2RDJaA.js +0 -21
- package/public/assets/index-CtFXWxBJ.css +0 -2
- package/public/assets/lucide-react-CMhBract.js +0 -9
- package/public/assets/memory-DeLwJFwH.js +0 -2
- package/public/assets/messages-Cww6dZnM.js +0 -2
- package/public/assets/overview-DjcRomU_.js +0 -2
- package/public/assets/pairs-DT0u2fnW.js +0 -2
- package/public/assets/teams-TqFntFB_.js +0 -2
- package/public/assets/workspaces-m97LP4Eu.js +0 -3
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{B as t,D as n,E as r,I as i,Kn as a,M as o,Pn as s,Vt as ee,gn as te,m as ne}from"./lucide-react-CMhBract.js";import{o as re,t as c}from"./store-BgJq_lN9.js";import{U as l,d as ie,h as u}from"./display-CketawEF.js";import{t as d}from"./badge-Dj6PREuI.js";import{t as f}from"./button-Cqpufqam.js";import{t as p}from"./input-C_dl_9fG.js";import{M as ae,r as oe,s as se}from"./index-Ba2RDJaA.js";import{i as m,n as h,r as g,t as _}from"./card-OmDF73CE.js";var v=e(a(),1),y=s(),b=[`organization`,`role`,`project`,`task`,`interaction`,`agent`],ce=[`private`,`project`,`org`,`public`],le=[`public`,`normal`,`sensitive`,`secret`],x=[`reported`,`inferred`,`verified`];function S(){return{type:`project`,scope:`default`,title:``,content:``,tags:``,visibility:`project`,sensitivity:`normal`,confidence:`reported`,relevanceScore:`0.7`}}function C(e){return{type:e.type,scope:e.scope,title:e.title,content:e.content,tags:e.tags.join(`, `),visibility:e.visibility,sensitivity:e.sensitivity,confidence:e.confidence,relevanceScore:String(e.relevanceScore)}}function w(e){return e.split(`,`).map(e=>e.trim()).filter(Boolean)}function ue(e){let t={limit:100};e.type&&(t.type=e.type),e.scope.trim()&&(t.scope=e.scope.trim()),e.visibility&&(t.visibility=e.visibility);let n=w(e.tags);if(n.length&&(t.tags=n),e.minRelevance.trim()){let n=Number(e.minRelevance);Number.isFinite(n)&&(t.minRelevance=Math.max(0,Math.min(1,n)))}return t}function T(e){return e===`secret`?`bg-red-500/10 text-red-400 border-red-500/30`:e===`sensitive`?`bg-yellow-500/10 text-yellow-400 border-yellow-500/30`:e===`public`?`bg-blue-500/10 text-blue-400 border-blue-500/30`:`bg-zinc-500/10 text-zinc-400 border-zinc-500/30`}function E(e){return e>=.8?`text-emerald-400`:e>=.5?`text-yellow-400`:`text-zinc-400`}function de(e){return e?Object.entries(e).map(([e,t])=>`${e}=${Array.isArray(t)?t.join(` `):String(t)}`).join(` `):`default`}function fe(e){return e.filter(e=>![`system`,`user`,`channel`].includes(e.kind||``))}function D(){let e=re(),a=c(e=>e.agents),s=c(e=>e.memories),D=c(e=>e.memoryTotal),k=c(e=>e.memoryStats),A=c(e=>e.memoryBrokerInfo),j=c(e=>e.memoryFilters),M=c(e=>e.selectedMemoryId),me=c(e=>e.memoryLoading),N=c(e=>e.set),he=c(e=>e.fetchMemories),P=c(e=>e.refreshMemory),F=c(e=>e.saveMemory),I=c(e=>e.deleteMemory),L=c(e=>e.injectMemory),R=s.find(e=>e.id===M),[z,B]=(0,v.useState)(`create`),[V,H]=(0,v.useState)(S),[U,W]=(0,v.useState)(``),[G,ge]=(0,v.useState)(`manual`),[K,_e]=(0,v.useState)(`1600`),[q,ve]=(0,v.useState)(`8`),[J,ye]=(0,v.useState)(``),Y=(0,v.useMemo)(()=>fe(a),[a]);(0,v.useEffect)(()=>{!U&&Y[0]&&W(Y[0].id)},[Y,U]),(0,v.useEffect)(()=>{R&&z===`edit`&&H(C(R))},[R?.id,z]);let X=(0,v.useMemo)(()=>{let e=j.search.trim().toLowerCase();return e?s.filter(t=>[t.id,t.type,t.scope,t.title,t.content,...t.tags].some(t=>String(t).toLowerCase().includes(e))):s},[s,j.search]);function Z(e){N({memoryFilters:{...j,...e}})}async function be(){let e=Number(V.relevanceScore),t={title:V.title.trim(),content:V.content.trim(),tags:w(V.tags),visibility:V.visibility,sensitivity:V.sensitivity,confidence:V.confidence,relevanceScore:Number.isFinite(e)?Math.max(0,Math.min(1,e)):.7};if(z===`edit`&&R){await F(t,R.id);return}await F({...t,type:V.type,scope:V.scope.trim()}),B(`create`),H(S())}async function Q(e){if(!U)return;let t=await L({agentId:U,memoryIds:e,query:e?.length?void 0:ue(j),reason:G.trim()||`manual`,budget:{maxTokens:Math.max(200,Number(K)||1600),maxMemories:Math.max(1,Number(q)||8),priorityCutoff:3}});t?.command?.id&&ye(t.command.id)}function xe(){B(`create`),H(S())}function Se(){R&&(B(`edit`),H(C(R)))}let Ce=V.title.trim()&&V.content.trim()&&(z===`edit`||V.scope.trim()),$=de(A?.config);return(0,y.jsxs)(`div`,{className:`space-y-4`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 flex-wrap`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(te,{className:`w-5 h-5 text-muted-foreground`}),(0,y.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Memory`}),(0,y.jsx)(d,{variant:`secondary`,children:k?.total??D}),A&&(0,y.jsx)(d,{className:A.external?`bg-blue-500/15 text-blue-400 border-blue-500/30`:`bg-emerald-500/15 text-emerald-400 border-emerald-500/30`,children:A.type})]}),(0,y.jsxs)(f,{size:`sm`,variant:`outline`,className:`gap-1.5`,onClick:()=>P(),children:[(0,y.jsx)(o,{className:`w-3.5 h-3.5 ${me?`animate-spin`:``}`}),`Refresh`]})]}),(0,y.jsxs)(`div`,{className:`grid gap-3 xl:grid-cols-[1.2fr_0.8fr]`,children:[(0,y.jsxs)(_,{children:[(0,y.jsx)(g,{className:`py-3 px-4`,children:(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,y.jsxs)(m,{className:`text-sm font-medium flex items-center gap-2`,children:[(0,y.jsx)(ee,{className:`w-4 h-4 text-muted-foreground`}),`Broker`]}),A?.capabilities&&(0,y.jsx)(`div`,{className:`flex flex-wrap gap-1 justify-end`,children:Object.entries(A.capabilities).filter(([,e])=>!!e).map(([e])=>(0,y.jsx)(d,{variant:`outline`,className:`text-[10px] px-1.5 py-0`,children:e},e))})]})}),(0,y.jsxs)(h,{className:`px-4 pb-4 space-y-3`,children:[(0,y.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-2`,children:[(0,y.jsx)(O,{label:`total`,value:k?.total??D}),(0,y.jsx)(O,{label:`project`,value:k?.byType?.project??0}),(0,y.jsx)(O,{label:`task`,value:k?.byType?.task??0}),(0,y.jsx)(O,{label:`agent`,value:k?.byType?.agent??0}),(0,y.jsx)(O,{label:`sensitive`,value:(k?.bySensitivity?.sensitive??0)+(k?.bySensitivity?.secret??0)})]}),(0,y.jsx)(`div`,{className:`font-mono text-xs text-muted-foreground truncate`,title:$,children:$})]})]}),(0,y.jsxs)(_,{children:[(0,y.jsx)(g,{className:`py-3 px-4`,children:(0,y.jsx)(m,{className:`text-sm font-medium`,children:`Inject`})}),(0,y.jsxs)(h,{className:`px-4 pb-4 space-y-2`,children:[(0,y.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-2`,children:[(0,y.jsxs)(`select`,{className:`rounded-md border border-input bg-background px-2 py-1.5 text-sm`,value:U,onChange:e=>W(e.target.value),children:[(0,y.jsx)(`option`,{value:``,children:`Agent`}),Y.map(e=>(0,y.jsx)(`option`,{value:e.id,children:ie(e)},e.id))]}),(0,y.jsx)(p,{value:G,onChange:e=>ge(e.target.value),placeholder:`reason`}),(0,y.jsx)(p,{value:K,onChange:e=>_e(e.target.value),inputMode:`numeric`,placeholder:`tokens`}),(0,y.jsx)(p,{value:q,onChange:e=>ve(e.target.value),inputMode:`numeric`,placeholder:`memories`})]}),(0,y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,y.jsxs)(f,{size:`sm`,className:`gap-1.5`,disabled:!U||!R,onClick:()=>R&&Q([R.id]),children:[(0,y.jsx)(r,{className:`w-3.5 h-3.5`}),`Selected`]}),(0,y.jsxs)(f,{size:`sm`,variant:`outline`,className:`gap-1.5`,disabled:!U,onClick:()=>Q(),children:[(0,y.jsx)(n,{className:`w-3.5 h-3.5`}),`Filtered`]}),J&&(0,y.jsx)(d,{variant:`outline`,className:`font-mono text-[10px]`,children:J})]})]})]})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[minmax(0,1fr)_420px]`,children:[(0,y.jsxs)(`div`,{className:`space-y-3`,children:[(0,y.jsx)(_,{children:(0,y.jsx)(h,{className:`p-3`,children:(0,y.jsxs)(`div`,{className:`grid grid-cols-2 lg:grid-cols-6 gap-2`,children:[(0,y.jsx)(p,{className:`lg:col-span-2`,value:j.search,onChange:e=>Z({search:e.target.value}),placeholder:`Search visible memories`}),(0,y.jsxs)(`select`,{className:`rounded-md border border-input bg-background px-2 py-1.5 text-sm`,value:j.type,onChange:e=>Z({type:e.target.value}),children:[(0,y.jsx)(`option`,{value:``,children:`All types`}),b.map(e=>(0,y.jsx)(`option`,{value:e,children:e},e))]}),(0,y.jsx)(p,{value:j.scope,onChange:e=>Z({scope:e.target.value}),placeholder:`scope`}),(0,y.jsx)(p,{value:j.tags,onChange:e=>Z({tags:e.target.value}),placeholder:`tags`}),(0,y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,y.jsx)(p,{value:j.minRelevance,onChange:e=>Z({minRelevance:e.target.value}),placeholder:`score`}),(0,y.jsx)(f,{size:`sm`,variant:`outline`,className:`h-8 px-2`,onClick:()=>he(),children:(0,y.jsx)(n,{className:`w-4 h-4`})})]})]})})}),(0,y.jsx)(se,{className:`h-[calc(100dvh-24rem)] min-h-[360px]`,children:(0,y.jsxs)(`div`,{className:`space-y-2 pr-2`,children:[X.length===0&&(0,y.jsx)(`div`,{className:`text-center text-sm text-muted-foreground py-16`,children:`No memories`}),X.map(t=>(0,y.jsx)(pe,{memory:t,selected:t.id===M,now:e,onSelect:()=>N({selectedMemoryId:t.id})},t.id))]})})]}),(0,y.jsxs)(_,{children:[(0,y.jsx)(g,{className:`py-3 px-4`,children:(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,y.jsx)(m,{className:`text-sm font-medium`,children:z===`edit`?`Edit Memory`:`New Memory`}),(0,y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,y.jsx)(f,{size:`sm`,variant:`ghost`,className:`h-7 px-2`,onClick:xe,title:`New memory`,children:(0,y.jsx)(i,{className:`w-3.5 h-3.5`})}),(0,y.jsx)(f,{size:`sm`,variant:`ghost`,className:`h-7 px-2`,onClick:Se,disabled:!R,title:`Edit selected`,children:(0,y.jsx)(t,{className:`w-3.5 h-3.5`})}),(0,y.jsx)(f,{size:`sm`,variant:`ghost`,className:`h-7 px-2 text-red-400 hover:text-red-300`,disabled:!R,onClick:()=>R&&I(R.id),title:`Delete selected`,children:(0,y.jsx)(ne,{className:`w-3.5 h-3.5`})})]})]})}),(0,y.jsxs)(h,{className:`px-4 pb-4 space-y-3`,children:[R&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,y.jsx)(d,{variant:`secondary`,children:R.type}),(0,y.jsx)(d,{variant:`outline`,children:R.scope}),(0,y.jsx)(d,{className:T(R.sensitivity),children:R.sensitivity}),(0,y.jsx)(d,{variant:`outline`,className:E(R.relevanceScore),children:R.relevanceScore.toFixed(2)})]}),(0,y.jsxs)(`div`,{className:`text-xs text-muted-foreground`,title:u(R.updatedAt),children:[`updated `,l(e,R.updatedAt)]}),(0,y.jsx)(`p`,{className:`text-sm font-medium`,children:R.title}),(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground whitespace-pre-wrap max-h-24 overflow-auto`,children:R.content})]}),(0,y.jsx)(ae,{})]}),(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,y.jsx)(`select`,{className:`rounded-md border border-input bg-background px-2 py-1.5 text-sm`,disabled:z===`edit`,value:V.type,onChange:e=>H({...V,type:e.target.value}),children:b.map(e=>(0,y.jsx)(`option`,{value:e,children:e},e))}),(0,y.jsx)(p,{disabled:z===`edit`,value:V.scope,onChange:e=>H({...V,scope:e.target.value}),placeholder:`scope`}),(0,y.jsx)(p,{className:`col-span-2`,value:V.title,onChange:e=>H({...V,title:e.target.value}),placeholder:`title`}),(0,y.jsx)(oe,{className:`col-span-2 min-h-32`,value:V.content,onChange:e=>H({...V,content:e.target.value}),placeholder:`content`}),(0,y.jsx)(p,{className:`col-span-2`,value:V.tags,onChange:e=>H({...V,tags:e.target.value}),placeholder:`tags`}),(0,y.jsx)(`select`,{className:`rounded-md border border-input bg-background px-2 py-1.5 text-sm`,value:V.visibility,onChange:e=>H({...V,visibility:e.target.value}),children:ce.map(e=>(0,y.jsx)(`option`,{value:e,children:e},e))}),(0,y.jsx)(`select`,{className:`rounded-md border border-input bg-background px-2 py-1.5 text-sm`,value:V.sensitivity,onChange:e=>H({...V,sensitivity:e.target.value}),children:le.map(e=>(0,y.jsx)(`option`,{value:e,children:e},e))}),(0,y.jsx)(`select`,{className:`rounded-md border border-input bg-background px-2 py-1.5 text-sm`,value:V.confidence,onChange:e=>H({...V,confidence:e.target.value}),children:x.map(e=>(0,y.jsx)(`option`,{value:e,children:e},e))}),(0,y.jsx)(p,{value:V.relevanceScore,onChange:e=>H({...V,relevanceScore:e.target.value}),inputMode:`decimal`,placeholder:`score`})]}),(0,y.jsx)(f,{size:`sm`,className:`w-full`,disabled:!Ce,onClick:be,children:z===`edit`?`Save memory`:`Create memory`})]})]})]})]})}function O({label:e,value:t}){return(0,y.jsxs)(`div`,{className:`rounded-md border border-border bg-muted/20 px-3 py-2`,children:[(0,y.jsx)(`div`,{className:`text-lg font-semibold tabular-nums`,children:t}),(0,y.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e})]})}function pe({memory:e,selected:t,now:n,onSelect:r}){return(0,y.jsx)(`button`,{onClick:r,className:`w-full text-left rounded-md border p-3 transition-colors ${t?`border-primary bg-primary/5`:`border-border bg-card hover:border-zinc-600`}`,children:(0,y.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,y.jsxs)(`div`,{className:`min-w-0`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,y.jsx)(d,{variant:`secondary`,className:`text-[10px]`,children:e.type}),(0,y.jsx)(d,{variant:`outline`,className:`text-[10px] font-mono`,children:e.scope}),(0,y.jsx)(d,{className:`text-[10px] ${T(e.sensitivity)}`,children:e.sensitivity})]}),(0,y.jsx)(`div`,{className:`font-medium text-sm mt-2 truncate`,children:e.title}),(0,y.jsx)(`div`,{className:`text-xs text-muted-foreground line-clamp-2 mt-1`,children:e.content}),e.tags.length>0&&(0,y.jsx)(`div`,{className:`flex gap-1 flex-wrap mt-2`,children:e.tags.slice(0,8).map(e=>(0,y.jsxs)(d,{variant:`outline`,className:`text-[10px] text-zinc-400`,children:[`#`,e]},e))})]}),(0,y.jsxs)(`div`,{className:`text-right shrink-0 space-y-1`,children:[(0,y.jsx)(`div`,{className:`text-sm font-semibold tabular-nums ${E(e.relevanceScore)}`,children:e.relevanceScore.toFixed(2)}),(0,y.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,title:u(e.updatedAt),children:l(n,e.updatedAt)}),e.accessCount>0&&(0,y.jsxs)(`div`,{className:`text-[10px] text-muted-foreground`,children:[e.accessCount,` hits`]})]})]})})}export{D as MemoryView};
|
|
2
|
-
//# sourceMappingURL=memory-DeLwJFwH.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{$ as t,A as n,Kn as r,Pn as i,Y as a,i as o,m as s,p as c,tn as l,vt as u,xn as d,z as f}from"./lucide-react-CMhBract.js";import{o as p,t as m}from"./store-BgJq_lN9.js";import{D as h,U as g,d as _,f as v,h as y}from"./display-CketawEF.js";import{t as b}from"./badge-Dj6PREuI.js";import{t as x}from"./button-Cqpufqam.js";import{R as S,U as C,t as w}from"./index-Ba2RDJaA.js";import{n as T,t as E}from"./card-OmDF73CE.js";var D=e(r(),1),O=i();function k(e,t){if(t.startsWith(`/`))return t;let n=`${e.replace(/\/+$/,``)}/${t}`.split(`/`),r=[];for(let e of n)!e||e===`.`||(e===`..`?r.pop():r.push(e));return`/`+r.join(`/`)}function A(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n>0?t.slice(0,n):`/`}function j(){let e=p(),n=m(e=>e.messages),r=m(e=>e.agentsById),i=m(e=>e.selectedAgent),s=m(e=>e.channelFilter),c=m(e=>e.tagFilter),l=m(e=>e.replyTo),u=m(e=>e.set),d=m(e=>e.openCompose),h=m(e=>e.startReply),g=m(e=>e.doClaim),v=m(e=>e.doDeliveryAction),y=m(e=>e.doDeleteMessage),w=m(e=>e.openThread),T=m(e=>e.cancelReply),E=S(),k=C(),A=(0,D.useMemo)(()=>{let e=[...n].sort((e,t)=>t.id-e.id);return i&&(e=e.filter(e=>e.from===i||e.to===i)),s&&(e=e.filter(e=>e.channel===s)),c&&(e=e.filter(e=>((r[e.from]||r[e.to])?.tags||[]).includes(c))),e},[n,i,s,c,r]),j=(0,D.useMemo)(()=>{let e=[],t=new Map;for(let n of A){let r=n.threadId??n.id;t.has(r)||t.set(r,[]),t.get(r).push(n),n.id===r&&e.push(n)}let n=new Set(e.map(e=>e.id));for(let t of A)!n.has(t.threadId??t.id)&&!e.find(e=>e.id===t.id)&&e.push(t);return e.sort((e,t)=>t.id-e.id),e.map(e=>({root:e,replies:(t.get(e.id)||[]).filter(t=>t.id!==e.id).sort((e,t)=>e.id-t.id)}))},[A]);function N(e){return r[e]?_(r[e]):e.slice(-10)}let P=(0,D.useMemo)(()=>[...new Set(n.map(e=>e.channel).filter(Boolean))],[n]);return(0,O.jsxs)(`div`,{className:`space-y-4`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between flex-wrap gap-2`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(t,{className:`w-5 h-5 text-muted-foreground`}),(0,O.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Messages`}),(0,O.jsx)(b,{variant:`secondary`,children:A.length})]}),(0,O.jsxs)(x,{size:`sm`,onClick:d,children:[(0,O.jsx)(f,{className:`w-4 h-4 mr-1`}),` Compose`]})]}),(0,O.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,O.jsxs)(`select`,{className:`rounded-md border border-input bg-background px-3 py-1.5 text-sm`,value:i,onChange:e=>u({selectedAgent:e.target.value}),children:[(0,O.jsx)(`option`,{value:``,children:`All agents`}),E.map(e=>(0,O.jsx)(`option`,{value:e.id,children:_(e)},e.id))]}),(0,O.jsxs)(`select`,{className:`rounded-md border border-input bg-background px-3 py-1.5 text-sm`,value:c,onChange:e=>u({tagFilter:e.target.value}),children:[(0,O.jsx)(`option`,{value:``,children:`All tags`}),k.map(e=>(0,O.jsxs)(`option`,{value:e,children:[`#`,e]},e))]}),(0,O.jsxs)(`select`,{className:`rounded-md border border-input bg-background px-3 py-1.5 text-sm`,value:s,onChange:e=>u({channelFilter:e.target.value}),children:[(0,O.jsx)(`option`,{value:``,children:`All channels`}),P.map(e=>(0,O.jsx)(`option`,{value:e,children:e},e))]})]}),l&&(0,O.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md bg-blue-500/10 border border-blue-500/20 px-3 py-2 text-sm text-blue-300`,children:[(0,O.jsx)(a,{className:`w-4 h-4 shrink-0`}),(0,O.jsxs)(`span`,{children:[`Replying to message #`,l.id,` from `,(0,O.jsx)(`strong`,{children:N(l.from)})]}),(0,O.jsx)(x,{variant:`ghost`,size:`sm`,className:`ml-auto h-6 px-1.5`,onClick:T,children:(0,O.jsx)(o,{className:`w-3.5 h-3.5`})})]}),(0,O.jsx)(`div`,{className:`h-[calc(100dvh-15rem)] overflow-y-auto`,children:(0,O.jsxs)(`div`,{className:`space-y-2 pr-2`,children:[j.length===0&&(0,O.jsx)(`div`,{className:`text-center text-muted-foreground py-16 text-sm`,children:`No messages`}),j.map(({root:t,replies:n})=>(0,O.jsxs)(`div`,{className:`space-y-1`,children:[(0,O.jsx)(M,{msg:t,now:e,agentLabel:N,agentsById:r,onReply:()=>h(t),onClaim:()=>g(t.id),onRetry:()=>v(t.id,`retry-now`),onMarkDead:()=>v(t.id,`mark-dead`,`Marked dead from dashboard`),onClear:()=>v(t.id,`clear`,`Cleared after manual handling`),onDelete:()=>y(t.id),onThread:t.threadId?()=>w(t.threadId):void 0,replyCount:n.length}),n.map(t=>(0,O.jsx)(`div`,{className:`ml-6`,children:(0,O.jsx)(M,{msg:t,now:e,agentLabel:N,agentsById:r,onReply:()=>h(t),onClaim:()=>g(t.id),onRetry:()=>v(t.id,`retry-now`),onMarkDead:()=>v(t.id,`mark-dead`,`Marked dead from dashboard`),onClear:()=>v(t.id,`clear`,`Cleared after manual handling`),onDelete:()=>y(t.id)})},t.id))]},t.id))]})})]})}function M({msg:e,now:t,agentLabel:r,agentsById:i,onReply:o,onClaim:c,onRetry:f,onMarkDead:p,onClear:_,onDelete:S,onThread:C,replyCount:j}){let[M,P]=(0,D.useState)(!1),F=h(e),I=m(e=>e.openFilesAt),L=e.deliveryStatus===`queued`||e.deliveryStatus===`failed`||e.deliveryStatus===`dead`||!!(e.deliveryLastError||e.deliveryPoisonReason),R=i[e.from===`user`?e.to:e.from];function z(e){return k((typeof R?.meta?.cwd==`string`?R.meta.cwd:``)||`/`,e)}function B(e,t){let n=z(e);I({path:A(n),selectedPath:n,line:t,overlay:!0})}return(0,O.jsx)(E,{className:`group relative`,children:(0,O.jsxs)(T,{className:`p-3`,children:[(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap text-xs text-muted-foreground mb-1`,children:[(0,O.jsx)(`span`,{className:`font-medium text-foreground`,children:r(e.from)}),(0,O.jsx)(`span`,{children:`→`}),(0,O.jsx)(`span`,{children:v(e.to,i)}),e.channel&&(0,O.jsxs)(b,{variant:`outline`,className:`text-xs px-1.5 py-0 gap-0.5`,children:[(0,O.jsx)(u,{className:`w-2.5 h-2.5`}),e.channel]}),e.claimedBy&&(0,O.jsxs)(b,{variant:`outline`,className:`text-xs px-1.5 py-0 text-emerald-400 border-emerald-500/30`,children:[(0,O.jsx)(l,{className:`w-2.5 h-2.5 mr-0.5`}),`claimed`]}),L&&(0,O.jsx)(N,{msg:e,now:t}),e.subject&&(0,O.jsx)(`span`,{className:`font-medium text-foreground`,children:e.subject}),(0,O.jsxs)(`span`,{className:`ml-auto shrink-0`,title:y(e.createdAt),children:[(0,O.jsxs)(`span`,{className:`opacity-40 mr-1`,children:[`#`,e.id]}),g(t,e.createdAt)]})]}),F&&(0,O.jsx)(`div`,{className:`cursor-pointer`,onClick:()=>P(e=>!e),children:(0,O.jsx)(w,{text:F,rawBody:e.body,className:`text-sm text-muted-foreground ${M?``:`max-h-[3.75rem] overflow-hidden`}`,onOpenPath:B,resolvePathTitle:(e,t)=>`${z(e)}${t?`:${t}`:``}`})})]}),(0,O.jsxs)(`div`,{className:`absolute top-2 right-2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity bg-card rounded-md shadow-sm border border-border px-1 py-0.5`,children:[(0,O.jsx)(x,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs`,onClick:o,title:`Reply`,children:(0,O.jsx)(a,{className:`w-3.5 h-3.5`})}),e.claimable&&!e.claimedBy&&(0,O.jsx)(x,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-orange-400 hover:text-orange-300`,onClick:c,title:`Claim`,children:(0,O.jsx)(l,{className:`w-3.5 h-3.5`})}),L&&(0,O.jsx)(x,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-blue-400 hover:text-blue-300`,onClick:f,title:`Retry delivery now`,children:(0,O.jsx)(n,{className:`w-3.5 h-3.5`})}),e.deliveryStatus!==`dead`&&L&&(0,O.jsx)(x,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-red-400 hover:text-red-300`,onClick:p,title:`Mark dead`,children:(0,O.jsx)(d,{className:`w-3.5 h-3.5`})}),(e.deliveryStatus===`failed`||e.deliveryStatus===`dead`)&&(0,O.jsx)(x,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-emerald-400 hover:text-emerald-300`,onClick:_,title:`Clear after manual handling`,children:(0,O.jsx)(l,{className:`w-3.5 h-3.5`})}),C&&(j??0)>0&&(0,O.jsxs)(x,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs`,onClick:C,title:`Thread`,children:[`+`,j]}),(0,O.jsx)(x,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-red-400 hover:text-red-300`,onClick:S,title:`Delete`,children:(0,O.jsx)(s,{className:`w-3.5 h-3.5`})})]})]})})}function N({msg:e,now:t}){let n=e.deliveryStatus||`pending`,r=e.deliveryPoisonReason||e.deliveryLastError||(e.deliveryNextRetryAt?`retry ${g(t,e.deliveryNextRetryAt)}`:void 0);return(0,O.jsxs)(b,{variant:`outline`,className:`text-xs px-1.5 py-0 ${n===`dead`?`text-red-300 border-red-500/30 bg-red-500/10`:n===`failed`?`text-amber-300 border-amber-500/30 bg-amber-500/10`:`text-blue-300 border-blue-500/30 bg-blue-500/10`}`,title:r||n,children:[(0,O.jsx)(c,{className:`w-2.5 h-2.5 mr-0.5`}),n,e.deliveryAttempts?` ${e.deliveryAttempts}x`:``]})}export{j as MessagesView};
|
|
2
|
-
//# sourceMappingURL=messages-Cww6dZnM.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{$ as t,J as n,Kn as r,Pn as i,ht as a,jn as o,l as s,ot as c,p as l,st as u,vn as d}from"./lucide-react-CMhBract.js";import{o as f,t as p}from"./store-BgJq_lN9.js";import{A as m,U as h,W as g,d as _,f as v,g as y,q as b,ut as x}from"./display-CketawEF.js";import{t as S}from"./badge-Dj6PREuI.js";import{I as C,L as w,M as T,S as E,s as D,x as O,z as k}from"./index-Ba2RDJaA.js";import{i as A,n as j,r as M,t as N}from"./card-OmDF73CE.js";var P=e(r(),1),F=i();function I(){let e=p(e=>e.stats),r=p(e=>e.agents),i=p(e=>e.messages),I=p(e=>e.health),L=f(),R=p(e=>e.agentsById),z=p(e=>e.switchView),B=p(e=>e.runHealthAction),V=p(e=>e.managedPolicies),H=p(e=>e.showOffline),U=k(),W=w(),G=C(),K=(0,P.useMemo)(()=>{let e=b(r,!1,V);return H||(e=e.filter(e=>e.status!==`offline`)),[...e].sort((e,t)=>(x[e.status]??9)-(x[t.status]??9)||g(t.lastSeen)-g(e.lastSeen))},[r,H,V]),q=K.slice(0,20),J=[...i].sort((e,t)=>t.id-e.id).slice(0,15),Y=I&&I.status!==`ok`?y(I.checks||[]):[];function X(e){z(e)}return(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:[(0,F.jsxs)(N,{className:`cursor-pointer hover:border-zinc-600 transition-colors`,onClick:()=>X(`agents`),children:[(0,F.jsx)(M,{className:`pb-1 pt-4 px-4`,children:(0,F.jsxs)(A,{className:`text-xs font-medium text-muted-foreground flex items-center gap-1.5`,children:[(0,F.jsx)(s,{className:`w-3.5 h-3.5`}),`Agents`]})}),(0,F.jsxs)(j,{className:`px-4 pb-4`,children:[(0,F.jsx)(`div`,{className:`text-2xl font-bold`,children:K.length}),(0,F.jsxs)(`div`,{className:`text-xs text-muted-foreground mt-0.5`,children:[U,` online`]})]})]}),(0,F.jsxs)(N,{className:`cursor-pointer hover:border-zinc-600 transition-colors`,onClick:()=>X(`agents`),children:[(0,F.jsx)(M,{className:`pb-1 pt-4 px-4`,children:(0,F.jsxs)(A,{className:`text-xs font-medium text-muted-foreground flex items-center gap-1.5`,children:[(0,F.jsx)(o,{className:`w-3.5 h-3.5`}),`Busy`]})}),(0,F.jsxs)(j,{className:`px-4 pb-4`,children:[(0,F.jsx)(`div`,{className:`text-2xl font-bold`,children:W}),(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground mt-0.5`,children:`in a turn now`})]})]}),(0,F.jsxs)(N,{className:`cursor-pointer hover:border-zinc-600 transition-colors`,onClick:()=>X(`messages`),children:[(0,F.jsx)(M,{className:`pb-1 pt-4 px-4`,children:(0,F.jsxs)(A,{className:`text-xs font-medium text-muted-foreground flex items-center gap-1.5`,children:[(0,F.jsx)(n,{className:`w-3.5 h-3.5`}),`Messages 24h`]})}),(0,F.jsxs)(j,{className:`px-4 pb-4`,children:[(0,F.jsx)(`div`,{className:`text-2xl font-bold`,children:e.messagesLast24h??`—`}),(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground mt-0.5`,children:`last 24 hours`})]})]}),(0,F.jsxs)(N,{className:`cursor-pointer hover:border-zinc-600 transition-colors`,onClick:()=>X(`messages`),children:[(0,F.jsx)(M,{className:`pb-1 pt-4 px-4`,children:(0,F.jsxs)(A,{className:`text-xs font-medium text-muted-foreground flex items-center gap-1.5`,children:[(0,F.jsx)(t,{className:`w-3.5 h-3.5`}),`Total Messages`]})}),(0,F.jsxs)(j,{className:`px-4 pb-4`,children:[(0,F.jsx)(`div`,{className:`text-2xl font-bold`,children:e.messages??`—`}),(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground mt-0.5`,children:`all time`})]})]})]}),Y.length>0&&(0,F.jsxs)(N,{className:`border-yellow-500/40 bg-yellow-500/5`,children:[(0,F.jsx)(M,{className:`pb-2 pt-4 px-4`,children:(0,F.jsxs)(A,{className:`text-sm font-medium text-yellow-400 flex items-center gap-2`,children:[(0,F.jsx)(l,{className:`w-4 h-4`}),`Health Alerts (`,Y.length,`)`]})}),(0,F.jsx)(j,{className:`px-4 pb-4 space-y-2`,children:Y.map(e=>(0,F.jsxs)(`div`,{className:`text-sm space-y-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(S,{variant:`outline`,className:e.status===`error`?`border-red-500/40 text-red-400`:`border-yellow-500/40 text-yellow-400`,children:e.status}),(0,F.jsx)(`span`,{className:`font-medium`,children:e.name})]}),(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.detail}),e.subjects.length>0&&(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.subjects.map(e=>(0,F.jsxs)(S,{variant:`secondary`,className:`max-w-full truncate text-[11px]`,title:[e.id,e.status,e.detail].filter(Boolean).join(` · `),children:[e.label||e.id,e.status?` · ${e.status}`:``,e.detail?` · ${e.detail}`:``]},e.id))}),e.actions.length>0&&(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5 pt-0.5`,children:e.actions.slice(0,3).map(e=>(0,F.jsx)(`button`,{onClick:()=>B(e),className:`text-xs text-blue-400 hover:text-blue-300 underline underline-offset-2`,children:e.label},e.label))})]},e.name))})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-4`,children:[(0,F.jsx)(N,{className:`cursor-pointer hover:border-zinc-600 transition-colors ${G.unreadInbox>0?`border-red-500/40`:``}`,onClick:()=>X(`chat`),children:(0,F.jsxs)(j,{className:`p-4 flex items-center gap-3`,children:[(0,F.jsx)(`div`,{className:`p-2 rounded-lg ${G.unreadInbox>0?`bg-red-500/15`:`bg-zinc-800`}`,children:(0,F.jsx)(a,{className:`w-4 h-4 ${G.unreadInbox>0?`text-red-400`:`text-zinc-400`}`})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-lg font-bold`,children:G.unreadInbox}),(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Unread`})]})]})}),(0,F.jsx)(N,{className:`cursor-pointer hover:border-zinc-600 transition-colors ${G.pendingPairInvites>0?`border-yellow-500/40`:``}`,onClick:()=>X(`pairs`),children:(0,F.jsxs)(j,{className:`p-4 flex items-center gap-3`,children:[(0,F.jsx)(`div`,{className:`p-2 rounded-lg ${G.pendingPairInvites>0?`bg-yellow-500/15`:`bg-zinc-800`}`,children:(0,F.jsx)(u,{className:`w-4 h-4 ${G.pendingPairInvites>0?`text-yellow-400`:`text-zinc-400`}`})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-lg font-bold`,children:G.pendingPairInvites}),(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Pair invites`})]})]})}),(0,F.jsx)(N,{className:`cursor-pointer hover:border-zinc-600 transition-colors ${G.claimableTasks>0?`border-orange-500/40`:``}`,onClick:()=>X(`work`),children:(0,F.jsxs)(j,{className:`p-4 flex items-center gap-3`,children:[(0,F.jsx)(`div`,{className:`p-2 rounded-lg ${G.claimableTasks>0?`bg-orange-500/15`:`bg-zinc-800`}`,children:(0,F.jsx)(c,{className:`w-4 h-4 ${G.claimableTasks>0?`text-orange-400`:`text-zinc-400`}`})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-lg font-bold`,children:G.claimableTasks}),(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Claimable waiting`})]})]})})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,F.jsxs)(N,{children:[(0,F.jsx)(M,{className:`pb-2 pt-4 px-4`,children:(0,F.jsxs)(A,{className:`text-sm font-medium flex items-center gap-2`,children:[(0,F.jsx)(d,{className:`w-4 h-4 text-muted-foreground`}),`Agents`,(0,F.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground font-normal`,children:q.length})]})}),(0,F.jsx)(j,{className:`px-0 pb-0`,children:(0,F.jsx)(D,{className:`h-[340px]`,children:q.length===0?(0,F.jsx)(`div`,{className:`px-4 pb-4 text-sm text-muted-foreground`,children:`No agents registered.`}):(0,F.jsx)(`div`,{className:`space-y-0`,children:q.map((e,t)=>(0,F.jsxs)(`div`,{children:[t>0&&(0,F.jsx)(T,{}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2.5 px-4 py-2.5 hover:bg-zinc-800/50 transition-colors cursor-pointer`,onClick:()=>p.getState().openAgentDetail(e),children:[(0,F.jsx)(E,{agent:e,now:L}),(0,F.jsx)(O,{agent:e}),(0,F.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,F.jsx)(`div`,{className:`text-sm font-medium truncate`,children:_(e)}),e.tags.length>0&&(0,F.jsx)(`div`,{className:`flex gap-1 mt-0.5 flex-wrap`,children:e.tags.slice(0,2).map(e=>(0,F.jsx)(S,{variant:`outline`,className:`text-[9px] px-1 py-0 h-4`,children:e},e))})]}),(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:h(L,e.lastSeen)})]})]},e.id))})})})]}),(0,F.jsxs)(N,{children:[(0,F.jsx)(M,{className:`pb-2 pt-4 px-4`,children:(0,F.jsxs)(A,{className:`text-sm font-medium flex items-center gap-2`,children:[(0,F.jsx)(o,{className:`w-4 h-4 text-muted-foreground`}),`Recent Activity`,(0,F.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground font-normal`,children:J.length})]})}),(0,F.jsx)(j,{className:`px-0 pb-0`,children:(0,F.jsx)(D,{className:`h-[340px]`,children:J.length===0?(0,F.jsx)(`div`,{className:`px-4 pb-4 text-sm text-muted-foreground`,children:`No recent messages.`}):(0,F.jsx)(`div`,{className:`space-y-0`,children:J.map((e,t)=>(0,F.jsxs)(`div`,{children:[t>0&&(0,F.jsx)(T,{}),(0,F.jsxs)(`div`,{className:`px-4 py-2.5 hover:bg-zinc-800/50 transition-colors`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-muted-foreground mb-0.5`,children:[(0,F.jsx)(`span`,{className:`text-foreground font-medium truncate max-w-[100px]`,children:v(e.from,R)}),(0,F.jsx)(`span`,{children:`→`}),(0,F.jsx)(`span`,{className:`truncate max-w-[100px]`,children:v(e.to,R)}),(0,F.jsxs)(`span`,{className:`ml-auto shrink-0 tabular-nums`,children:[(0,F.jsxs)(`span`,{className:`opacity-40 mr-1`,children:[`#`,e.id]}),h(L,e.createdAt)]})]}),(0,F.jsx)(`div`,{className:`text-xs text-foreground line-clamp-2 leading-snug`,children:m(e)})]})]},e.id))})})})]})]})]})}export{I as OverviewView};
|
|
2
|
-
//# sourceMappingURL=overview-DjcRomU_.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{$ as e,Pn as t,d as n,lt as r,st as i,wn as a}from"./lucide-react-CMhBract.js";import{o,t as s}from"./store-BgJq_lN9.js";import{U as c,ct as l,d as u,h as d}from"./display-CketawEF.js";import{t as f}from"./badge-Dj6PREuI.js";import{t as p}from"./button-Cqpufqam.js";import{s as m}from"./index-Ba2RDJaA.js";import{n as h,r as g,t as _}from"./card-OmDF73CE.js";var v=t(),y=[{value:`open`,label:`Active & Pending`},{value:`active`,label:`Active`},{value:`pending`,label:`Pending`},{value:`ended`,label:`Ended`},{value:`rejected`,label:`Rejected`},{value:`expired`,label:`Expired`},{value:``,label:`All`}];function b(){let e=o(),t=s(e=>e.pairs),r=s(e=>e.agentsById),a=s(e=>e.pairStatusFilter),c=s(e=>e.set),l=s(e=>e.fetchPairs),d=s(e=>e.openPairInvite),h=s(e=>e.openPairMessage),g=s(e=>e.doAcceptPair),_=s(e=>e.doRejectPair),b=s(e=>e.doHangupPair),S=t.filter(e=>e.status===`pending`).length;function C(e){c({pairStatusFilter:e}),setTimeout(()=>l(),0)}function w(e){return r[e]?u(r[e]):e.slice(-10)}return(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsxs)(`div`,{className:`flex items-center justify-between flex-wrap gap-2`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(i,{className:`w-5 h-5 text-muted-foreground`}),(0,v.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Pair Sessions`}),S>0&&(0,v.jsxs)(f,{className:`bg-yellow-500/20 text-yellow-400 border-yellow-500/30 border`,children:[S,` pending`]})]}),(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(`select`,{className:`rounded-md border border-input bg-background px-3 py-1.5 text-sm`,value:a,onChange:e=>C(e.target.value),children:y.map(e=>(0,v.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,v.jsxs)(p,{size:`sm`,onClick:()=>d(),children:[(0,v.jsx)(n,{className:`w-4 h-4 mr-1`}),` Pair agents`]})]})]}),(0,v.jsx)(m,{className:`h-[calc(100dvh-11rem)]`,children:(0,v.jsxs)(`div`,{className:`space-y-3 pr-2`,children:[t.length===0&&(0,v.jsx)(`div`,{className:`text-center text-muted-foreground py-16 text-sm`,children:`No pair sessions`}),t.map(t=>(0,v.jsx)(x,{pair:t,now:e,agentName:w,onAccept:()=>g(t),onReject:()=>_(t),onMessage:()=>h(t),onHangup:()=>b(t)},t.id))]})})]})}function x({pair:t,now:n,agentName:i,onAccept:o,onReject:s,onMessage:u,onHangup:m}){let y=l[t.status]||`bg-zinc-500/20 text-zinc-400`,b=t.status===`pending`,x=t.status===`active`;return(0,v.jsxs)(_,{children:[(0,v.jsx)(g,{className:`py-3 px-4 pb-0`,children:(0,v.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap flex-1 min-w-0`,children:[(0,v.jsx)(f,{className:`${y} border text-xs`,children:t.status}),(0,v.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm min-w-0`,children:[(0,v.jsx)(`span`,{className:`font-medium truncate max-w-[120px]`,title:t.requesterId,children:i(t.requesterId)}),(0,v.jsx)(a,{className:`w-3.5 h-3.5 text-muted-foreground shrink-0`}),(0,v.jsx)(`span`,{className:`font-medium truncate max-w-[120px]`,title:t.targetId,children:i(t.targetId)})]})]}),(0,v.jsxs)(`div`,{className:`text-right shrink-0`,children:[(0,v.jsx)(`div`,{className:`text-xs font-mono text-muted-foreground/60 truncate max-w-[100px]`,children:t.id.slice(-10)}),(0,v.jsx)(`div`,{className:`text-xs text-muted-foreground`,title:d(t.updatedAt),children:c(n,t.updatedAt)})]})]})}),(0,v.jsxs)(h,{className:`px-4 py-3`,children:[t.objective&&(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground mb-3 line-clamp-2`,children:t.objective}),(0,v.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[b&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(p,{size:`sm`,className:`bg-emerald-600 hover:bg-emerald-700 text-white h-7 text-xs`,onClick:o,children:`Accept`}),(0,v.jsx)(p,{size:`sm`,variant:`outline`,className:`h-7 text-xs text-red-400 hover:text-red-300`,onClick:s,children:`Reject`})]}),x&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(p,{size:`sm`,variant:`outline`,className:`h-7 text-xs`,onClick:u,children:[(0,v.jsx)(e,{className:`w-3.5 h-3.5 mr-1`}),` Message`]}),(0,v.jsxs)(p,{size:`sm`,variant:`outline`,className:`h-7 text-xs text-red-400 hover:text-red-300`,onClick:m,children:[(0,v.jsx)(r,{className:`w-3.5 h-3.5 mr-1`}),` Hang up`]})]})]})]})]})}export{b as PairsView};
|
|
2
|
-
//# sourceMappingURL=pairs-DT0u2fnW.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{Fn as t,J as n,Kn as r,M as i,Mn as a,Pn as o,l as s,m as c,un as l}from"./lucide-react-CMhBract.js";import{r as ee,t as u}from"./store-BgJq_lN9.js";import{H as d,U as f,Y as p,d as m,h}from"./display-CketawEF.js";import{a as te,i as ne,n as re,r as ie,t as ae}from"./select-Cariwv69.js";import{t as g}from"./badge-Dj6PREuI.js";import{t as _}from"./button-Cqpufqam.js";import{t as v}from"./input-C_dl_9fG.js";import{s as y}from"./index-Ba2RDJaA.js";import{i as b,n as x,r as S,t as C}from"./card-OmDF73CE.js";import{t as oe}from"./PlanGraphPanel-BFVTJa0q.js";var w=e(r(),1),T=o();function E(e){if(e==null)return`-`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.round(t/60);if(n<60)return`${n}m`;let r=Math.round(n/60);return r<48?`${r}h`:`${Math.round(r/24)}d`}function D(e){return`${Math.round(e*100)}%`}function O(e){return e===`success`?`bg-emerald-500/10 text-emerald-400 border-emerald-500/20`:e===`partial`?`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`:e===`failed`?`bg-red-500/10 text-red-400 border-red-500/20`:`bg-zinc-500/10 text-zinc-400 border-zinc-500/20`}function se({data:e,loading:t,error:n}){let r=e?.totals.byOutcomeStatus,i=e?.compositionShapes.slice(0,6)??[],a=e?.recent.slice(0,8)??[];return(0,T.jsxs)(C,{children:[(0,T.jsx)(S,{children:(0,T.jsxs)(b,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(l,{className:`size-4 text-primary`}),` Outcomes`]}),(0,T.jsxs)(g,{variant:`secondary`,children:[e?.totals.total??0,` dissolved`]})]})}),(0,T.jsxs)(x,{className:`space-y-5`,children:[n?(0,T.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:n}):null,t&&!e?(0,T.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`Loading outcomes…`}):!e||e.totals.total===0?(0,T.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`No dissolved teams yet`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2 text-xs`,children:[`success`,`partial`,`failed`,`unknown`].map(e=>{let t=r?.[e]??0;return(0,T.jsxs)(g,{variant:`outline`,className:t===0?`text-muted-foreground`:O(e===`unknown`?null:e),children:[t,` `,e]},e)})}),(0,T.jsxs)(`section`,{className:`space-y-2`,children:[(0,T.jsx)(`div`,{className:`text-sm font-medium`,children:`Composition win-rate`}),(0,T.jsx)(`div`,{className:`divide-y divide-border rounded-md border border-border`,children:i.map(e=>(0,T.jsxs)(`div`,{className:`grid gap-2 px-3 py-2 text-sm md:grid-cols-[1fr_auto_auto] md:items-center`,children:[(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`div`,{className:`break-words font-medium`,title:e.shape,children:e.shape}),(0,T.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[e.count,` team`,e.count===1?``:`s`,` · avg `,E(e.avgWallClockMs)]})]}),(0,T.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.successCount,`/`,e.count]}),(0,T.jsx)(g,{variant:`outline`,className:O(e.successRate>=.5?`success`:e.successRate>0?`partial`:`failed`),children:D(e.successRate)})]},e.shape))})]}),(0,T.jsxs)(`section`,{className:`space-y-2`,children:[(0,T.jsx)(`div`,{className:`text-sm font-medium`,children:`Recent outcomes`}),(0,T.jsx)(`div`,{className:`overflow-hidden rounded-md border border-border`,children:(0,T.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,T.jsx)(`thead`,{className:`bg-muted/40 text-xs text-muted-foreground`,children:(0,T.jsxs)(`tr`,{children:[(0,T.jsx)(`th`,{className:`px-3 py-2 text-left font-medium`,children:`Team`}),(0,T.jsx)(`th`,{className:`px-3 py-2 text-left font-medium`,children:`Outcome`}),(0,T.jsx)(`th`,{className:`px-3 py-2 text-right font-medium`,children:`Members`}),(0,T.jsx)(`th`,{className:`px-3 py-2 text-right font-medium`,children:`Duration`})]})}),(0,T.jsx)(`tbody`,{className:`divide-y divide-border`,children:a.map(e=>(0,T.jsxs)(`tr`,{children:[(0,T.jsxs)(`td`,{className:`max-w-[220px] px-3 py-2`,children:[(0,T.jsx)(`div`,{className:`truncate font-medium`,children:e.title||e.id.slice(0,12)}),(0,T.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.id})]}),(0,T.jsx)(`td`,{className:`px-3 py-2`,children:(0,T.jsx)(g,{variant:`outline`,className:O(e.outcome),children:e.outcome??`unknown`})}),(0,T.jsx)(`td`,{className:`px-3 py-2 text-right`,children:e.memberCount}),(0,T.jsx)(`td`,{className:`px-3 py-2 text-right text-muted-foreground`,children:E(e.durationMs)})]},e.id))})]})})]})]})]})]})}var ce=[{value:`all`,label:`All kinds`},{value:`decision`,label:`Decisions`},{value:`fact`,label:`Facts`},{value:`ruled_out`,label:`Ruled out`}],le={decision:`decision`,fact:`fact`,ruled_out:`ruled out`};function ue(e){return e.status===`dissolved`?`dissolved`:e.zeroMembersSince==null?`active`:`orphaned`}var de={active:`bg-emerald-500/10 text-emerald-400 border-emerald-500/20`,orphaned:`bg-amber-500/10 text-amber-400 border-amber-500/20`,dissolved:`bg-zinc-500/10 text-zinc-400 border-zinc-500/20`},fe={success:`bg-emerald-500/10 text-emerald-400 border-emerald-500/20`,partial:`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`,failed:`bg-red-500/10 text-red-400 border-red-500/20`},k={active:`bg-emerald-500/10 text-emerald-400 border-emerald-500/20`,superseded:`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`,retracted:`bg-red-500/10 text-red-400 border-red-500/20`};function A(e){return e?e.slice(0,12):`-`}function pe(e){if(e===void 0)return`-`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.round(t/60);if(n<60)return`${n}m`;let r=Math.round(n/60);return r<48?`${r}h`:`${Math.round(r/24)}d`}function me(e){if(!e.composition)return null;try{let t=JSON.parse(e.composition);return Array.isArray(t)?t.length:null}catch{return null}}function he(e,t){let n=t.trim().toLowerCase();return n?[e.title,e.id,e.coordinatorId,e.rootCoordinatorId,e.outcomeStatus,e.outcomeSummary].some(e=>String(e??``).toLowerCase().includes(n)):!0}function ge(e){return e.status===`offline`?`bg-zinc-500/10 text-zinc-400 border-zinc-500/20`:e.status===`busy`?`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`:e.status===`stale`?`bg-red-500/10 text-red-400 border-red-500/20`:`bg-emerald-500/10 text-emerald-400 border-emerald-500/20`}function j(){let[e,r]=(0,w.useState)(null),[o,l]=(0,w.useState)([]),[E,D]=(0,w.useState)(null),[O,j]=(0,w.useState)(`all`),[M,N]=(0,w.useState)(``),[P,F]=(0,w.useState)(!1),[I,L]=(0,w.useState)(!1),[R,z]=(0,w.useState)(null),[B,V]=(0,w.useState)(()=>Date.now()),H=u(e=>e.teams),U=u(e=>e.teamsLoading),W=u(e=>e.teamsError),_e=u(e=>e.fetchTeams),ve=u(e=>e.teamOutcomeAggregates),ye=u(e=>e.teamOutcomeAggregatesLoading),be=u(e=>e.teamOutcomeAggregatesError),xe=u(e=>e.fetchTeamOutcomeAggregates),G=u(e=>e.fetchPlan),Se=u(e=>e.dissolveTeam),Ce=u(e=>e.openConfirm),K=u(e=>e.agentsById),we=u(e=>e.switchView),Te=u(e=>e.openInboxThread),Ee=u(t=>{let n=e??t.teams[0]?.id;return n?t.plansByTeam[ee(n)]??null:null}),De=e=>{let t=K[e];return t?m(t):e.slice(-8)};async function q(e,n=O){L(!0),z(null);try{let r=new URLSearchParams({team:e});n!==`all`&&r.set(`kind`,n),l((await t(`GET`,`/blackboard?${r.toString()}`)).entries),D(e)}catch(t){z(p(t)),l([]),D(e)}finally{L(!1)}}async function J(){F(!0),z(null);try{let[t]=await Promise.all([_e(),xe()]);V(Date.now());let n=e??t[0]?.id;n?(G({teamId:n}),await q(n,O)):(l([]),D(null))}catch(e){z(p(e))}finally{F(!1)}}(0,w.useEffect)(()=>{J()},[]),(0,w.useEffect)(()=>{E&&q(E,O)},[O]);let Y=(0,w.useMemo)(()=>H.filter(e=>he(e,M)),[H,M]),X=e??H[0]?.id??null,Z=H.find(e=>e.id===X)??null,Q=E===X?o:[],$=(0,w.useMemo)(()=>X?Object.values(K).filter(e=>e.teamId===X).sort((e,t)=>m(e).localeCompare(m(t))||e.id.localeCompare(t.id)):[],[K,X]),Oe=(0,w.useMemo)(()=>{let e={decision:[],fact:[],ruled_out:[]};for(let t of Q)e[t.kind].push(t);return e},[Q]),ke=O===`all`?[`decision`,`fact`,`ruled_out`]:[O];return(0,T.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(s,{className:`size-5 text-primary`}),(0,T.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Teams`}),(0,T.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`active and dissolved team working sets`})]}),(0,T.jsxs)(_,{variant:`outline`,size:`sm`,onClick:()=>void J(),disabled:P||U,children:[(0,T.jsx)(i,{className:a(`size-4`,(P||U)&&`animate-spin`)}),` Refresh`]})]}),(R||W)&&(0,T.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:R||W}),(0,T.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[minmax(320px,420px)_1fr]`,children:[(0,T.jsxs)(`div`,{className:`min-h-[520px] min-w-0 space-y-3`,children:[(0,T.jsxs)(`div`,{className:`space-y-3`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,T.jsx)(`span`,{children:`Team list`}),(0,T.jsx)(g,{variant:`secondary`,children:H.length})]}),(0,T.jsx)(v,{value:M,onChange:e=>N(e.target.value),placeholder:`Filter teams`,className:`h-8`})]}),(0,T.jsx)(`div`,{children:(P||U)&&H.length===0?(0,T.jsx)(`div`,{className:`py-16 text-center text-sm text-muted-foreground`,children:`Loading teams…`}):Y.length===0?(0,T.jsx)(`div`,{className:`py-16 text-center text-sm text-muted-foreground`,children:H.length===0?`No teams`:`No teams match`}):(0,T.jsx)(y,{className:`h-[610px] pr-3`,children:(0,T.jsx)(`div`,{className:`space-y-2`,children:Y.map(e=>{let t=e.id===X,i=me(e),o=ue(e),s=e.coordinatorId,c=()=>{r(e.id),G({teamId:e.id}),q(e.id,O)};return(0,T.jsx)(`div`,{role:`button`,tabIndex:0,onClick:c,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c())},className:`block w-full cursor-pointer text-left`,children:(0,T.jsx)(C,{className:a(`transition-colors hover:border-primary/50`,t&&`border-primary/60 bg-primary/5`),children:(0,T.jsxs)(x,{className:`space-y-3 p-3`,children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.title||A(e.id)}),(0,T.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.id})]}),(0,T.jsx)(g,{variant:`outline`,className:de[o],children:o})]}),(0,T.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:[(0,T.jsx)(`span`,{children:`Coordinator`}),s?(0,T.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),Te(s),we(`chat`)},className:`flex min-w-0 items-center justify-end gap-1 text-right text-primary hover:underline`,title:`Chat with ${s}`,children:[(0,T.jsx)(n,{className:`size-3 shrink-0`}),(0,T.jsx)(`span`,{className:`truncate`,children:De(s)})]}):(0,T.jsx)(`span`,{className:`text-right text-muted-foreground`,children:`—`}),(0,T.jsx)(`span`,{children:`Members`}),(0,T.jsx)(`span`,{className:`text-right text-foreground`,children:i??`-`}),(0,T.jsx)(`span`,{children:`Created`}),(0,T.jsx)(`span`,{className:`text-right text-foreground`,title:h(e.createdAt),children:f(B,e.createdAt)}),e.dissolvedAt?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{children:`Dissolved`}),(0,T.jsx)(`span`,{className:`text-right text-foreground`,title:h(e.dissolvedAt),children:f(B,e.dissolvedAt)})]}):null]}),o===`orphaned`&&e.zeroMembersSince!=null?(0,T.jsx)(`div`,{className:`flex items-center gap-1.5 border-t border-border pt-2 text-xs text-amber-400`,title:h(e.zeroMembersSince),children:(0,T.jsxs)(`span`,{children:[`No live members since `,f(B,e.zeroMembersSince),` — auto-dissolving`]})}):null,e.status===`dissolved`?(0,T.jsxs)(`div`,{className:`space-y-1 border-t border-border pt-2`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e.outcomeStatus?(0,T.jsx)(g,{variant:`outline`,className:fe[e.outcomeStatus],children:e.outcomeStatus}):(0,T.jsx)(g,{variant:`outline`,children:`no outcome`}),(0,T.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:pe(e.wallClockMs)})]}),e.outcomeSummary?(0,T.jsx)(`p`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:e.outcomeSummary}):null]}):null]})})},e.id)})})})})]}),(0,T.jsxs)(`div`,{className:`min-h-[520px] min-w-0 space-y-4`,children:[(0,T.jsx)(se,{data:ve,loading:ye,error:be}),Z&&Ee?(0,T.jsx)(C,{className:`p-0`,children:(0,T.jsx)(oe,{teamId:Z.id})}):null,(0,T.jsxs)(C,{children:[(0,T.jsx)(S,{children:(0,T.jsxs)(b,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`span`,{children:`Roster`}),(0,T.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[$.length,` member`,$.length===1?``:`s`]})]}),Z&&Z.status!==`dissolved`?(0,T.jsxs)(_,{variant:`destructive`,size:`sm`,onClick:()=>Ce(`Dissolve Team`,`Dissolve "${Z.title||Z.id}"? This closes the team working set but keeps its records visible.`,()=>void Se(Z.id)),children:[(0,T.jsx)(c,{className:`size-4`}),` Dissolve`]}):null]})}),(0,T.jsx)(x,{children:Z?$.length===0?(0,T.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`No members`}):(0,T.jsx)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:$.map(e=>(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 rounded-md border border-border bg-background px-3 py-2`,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,T.jsx)(`span`,{className:a(`h-2 w-2 shrink-0 rounded-full`,d(e,B))}),(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`div`,{className:`truncate text-sm font-medium`,children:m(e)}),(0,T.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.id})]})]}),(0,T.jsx)(g,{variant:`outline`,className:ge(e),children:e.status})]},e.id))}):(0,T.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`No team selected`})})]}),(0,T.jsxs)(C,{children:[(0,T.jsx)(S,{children:(0,T.jsxs)(b,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`span`,{children:`Blackboard`}),Z?(0,T.jsx)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:Z.title||Z.id}):null]}),(0,T.jsxs)(ae,{value:O,onValueChange:e=>j(e),children:[(0,T.jsx)(ne,{size:`sm`,className:`w-36`,children:(0,T.jsx)(te,{})}),(0,T.jsx)(re,{children:ce.map(e=>(0,T.jsx)(ie,{value:e.value,children:e.label},e.value))})]})]})}),(0,T.jsx)(x,{children:Z?I&&Q.length===0?(0,T.jsx)(`div`,{className:`py-16 text-center text-sm text-muted-foreground`,children:`Loading blackboard…`}):Q.length===0?(0,T.jsx)(`div`,{className:`py-16 text-center text-sm text-muted-foreground`,children:`No blackboard entries`}):(0,T.jsx)(y,{className:`h-[640px] pr-3`,children:(0,T.jsx)(`div`,{className:`space-y-5`,children:ke.map(e=>{let t=Oe[e];return t.length===0?null:(0,T.jsxs)(`section`,{className:`space-y-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(g,{variant:`secondary`,children:le[e]}),(0,T.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.length})]}),(0,T.jsx)(`div`,{className:`space-y-2`,children:t.map(e=>(0,T.jsxs)(`div`,{className:`space-y-3 rounded-md border border-border bg-background p-3`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`div`,{className:`text-sm font-medium`,children:e.title}),(0,T.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`by `,A(e.authorId),` · `,f(B,e.updatedAt||e.createdAt)]})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-1`,children:[(0,T.jsx)(g,{variant:`outline`,className:k[e.status],children:e.status}),e.supersedes?(0,T.jsxs)(g,{variant:`outline`,children:[`supersedes `,A(e.supersedes)]}):null]})]}),e.body?(0,T.jsx)(`p`,{className:`whitespace-pre-wrap text-sm text-muted-foreground`,children:e.body}):null]},e.id))})]},e)})})}):(0,T.jsx)(`div`,{className:`py-16 text-center text-sm text-muted-foreground`,children:`No team selected`})})]})]})]})]})}export{j as TeamsView};
|
|
2
|
-
//# sourceMappingURL=teams-TqFntFB_.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{An as t,At as n,Ct as r,Dn as i,Ft as a,It as o,Jt as s,Kn as c,M as l,Nt as u,Ot as d,Pn as f,Sn as p,St as m,W as h,an as g,bt as _,cn as v,i as ee,m as y,p as b,sn as x}from"./lucide-react-CMhBract.js";import{o as S,t as C}from"./store-BgJq_lN9.js";import{J as w,U as T,d as E}from"./display-CketawEF.js";import{t as D}from"./badge-Dj6PREuI.js";import{t as O}from"./button-Cqpufqam.js";import{t as k}from"./copy-button-DI7b8A7_.js";import{i as A,n as j,r as M,t as N}from"./card-OmDF73CE.js";var P=e(c(),1),F=f(),I=new Set([`active`,`ready`,`conflict`,`review_requested`,`merge_planned`,`cleanup_requested`]),L=new Set([`active`,`ready`,`conflict`,`review_requested`,`merge_planned`]),R=new Set([`active`,`ready`,`review_requested`,`merge_planned`,`conflict`]),z={active:`bg-blue-500/10 text-blue-400 border-blue-500/20`,ready:`bg-emerald-500/10 text-emerald-400 border-emerald-500/20`,conflict:`bg-red-500/10 text-red-400 border-red-500/20`,review_requested:`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`,merge_planned:`bg-indigo-500/10 text-indigo-400 border-indigo-500/20`,merged:`bg-violet-500/10 text-violet-400 border-violet-500/20`,abandoned:`bg-zinc-500/10 text-zinc-400 border-zinc-500/20`,cleanup_requested:`bg-orange-500/10 text-orange-400 border-orange-500/20`,cleaned:`bg-zinc-500/10 text-zinc-400 border-zinc-500/20`},B={active:`active`,ready:`ready`,conflict:`conflict`,review_requested:`review`,merge_planned:`merge planned`,merged:`merged`,abandoned:`abandoned`,cleanup_requested:`cleanup`,cleaned:`cleaned`},V={conflict:0,ready:1,review_requested:2,merge_planned:3,active:4,cleanup_requested:5,merged:6,abandoned:7,cleaned:8},H=new Set(w);function U(e){let t=e.split(`/`).filter(Boolean);return t.length<=3?e||`-`:`/${t.slice(-3).join(`/`)}`}function W(e,t){return e?E(e):t||`-`}function G(e){return z[e]||`bg-zinc-500/10 text-zinc-400 border-zinc-500/20`}function K(e,t){let n=(V[e.status]??99)-(V[t.status]??99);return n===0?Number(t.updatedAt||0)-Number(e.updatedAt||0):n}function q(e){let t=new Map;for(let n of e){let e=n.repoRoot||n.sourceCwd||`unknown repo`;t.set(e,[...t.get(e)||[],n])}return[...t.entries()].map(([e,t])=>({repoRoot:e,workspaces:t.sort(K)})).sort((e,t)=>{let n=e.workspaces.some(e=>I.has(e.status));return n===t.workspaces.some(e=>I.has(e.status))?e.repoRoot.localeCompare(t.repoRoot):n?-1:1})}function J(e,t){return t===`all`?e:t===`cleaned`?e.filter(e=>H.has(e.status)):e.filter(e=>!H.has(e.status))}function Y({workspace:e,expanded:t,onToggleDetails:r}){let i=C(e=>e.workspaceAction),a=C(e=>e.purgeWorkspace),s=C(e=>e.fetchWorkspaceMergePreview),c=C(e=>e.openFilesAt),l=e.status===`cleaned`||e.status===`merged`||e.status===`abandoned`,u=l||e.status===`cleanup_requested`,f=e.worktreePath||e.sourceCwd||e.repoRoot,p=C(t=>t.workspaceGitState[e.id]),m=!!p&&p.available!==!1&&p.landed===!0,h=e.mode===`isolated`&&!!e.worktreePath&&R.has(e.status)&&!m;async function b(){await s(e.id),await i(e.id,`merge`)}return(0,F.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-1.5`,children:[(0,F.jsx)(O,{size:`icon-sm`,variant:`ghost`,title:t?`Hide details`:`Show diff & timeline`,onClick:r,children:t?(0,F.jsx)(x,{className:`h-3.5 w-3.5`}):(0,F.jsx)(g,{className:`h-3.5 w-3.5`})}),(0,F.jsx)(O,{size:`icon-sm`,variant:`ghost`,title:`Open workspace`,disabled:!f||e.status===`cleaned`,onClick:()=>void c({path:f}),children:(0,F.jsx)(d,{className:`h-3.5 w-3.5`})}),(0,F.jsx)(k,{value:f,label:`Copy path`,copiedLabel:`Copied path`,size:`icon-sm`,variant:`ghost`,disabled:!f}),(0,F.jsx)(O,{size:`icon-sm`,variant:`outline`,title:`Mark ready`,disabled:u||e.status===`ready`,onClick:()=>void i(e.id,`ready`),children:(0,F.jsx)(v,{className:`h-3.5 w-3.5`})}),(0,F.jsx)(O,{size:`icon-sm`,variant:`outline`,title:`Request review`,disabled:u||e.status===`review_requested`,onClick:()=>void i(e.id,`request-review`),children:(0,F.jsx)(o,{className:`h-3.5 w-3.5`})}),(0,F.jsx)(O,{size:`icon-sm`,variant:`outline`,title:`Mark merge planned`,disabled:u||e.status===`merge_planned`,onClick:()=>void i(e.id,`merge-plan`),children:(0,F.jsx)(n,{className:`h-3.5 w-3.5`})}),(0,F.jsx)(O,{size:`icon-sm`,variant:`default`,title:m?`Already merged into base — nothing to land`:`Merge & land work`,disabled:!h,onClick:()=>void b(),children:(0,F.jsx)(_,{className:`h-3.5 w-3.5`})}),(0,F.jsx)(O,{size:`icon-sm`,variant:`outline`,title:`Request cleanup (removes the worktree on the host)`,disabled:e.status===`cleaned`||e.status===`cleanup_requested`,onClick:()=>void i(e.id,`cleanup`),children:(0,F.jsx)(y,{className:`h-3.5 w-3.5`})}),l&&(0,F.jsx)(O,{size:`icon-sm`,variant:`ghost`,title:`Purge record (clears the row, does not touch disk)`,onClick:()=>void a(e.id),children:(0,F.jsx)(ee,{className:`h-3.5 w-3.5`})})]})}function X({workspace:e,unmerged:t}){let n=C(t=>t.workspaceMergePreview[e.id]),r=C(e=>e.fetchWorkspaceMergePreview),i=t>0&&R.has(e.status);return(0,P.useEffect)(()=>{i&&n===void 0&&r(e.id)},[i,n,e.id,r]),!i||n===void 0||n.available===!1?null:n.conflict?(0,F.jsxs)(`span`,{className:`flex items-center gap-0.5 text-amber-400`,title:`Merging into ${n.baseRef||`base`} would conflict — resolve before merging`,children:[(0,F.jsx)(b,{className:`h-3 w-3`}),`conflict`]}):n.conflict===!1?(0,F.jsxs)(`span`,{className:`flex items-center gap-0.5 text-emerald-400`,title:`Clean to merge via ${n.strategy===`pr`?`PR`:`rebase + fast-forward`} into ${n.baseRef||`base`}`,children:[(0,F.jsx)(v,{className:`h-3 w-3`}),n.strategy===`pr`?`PR ready`:`clean`]}):null}function Z({workspace:e}){let t=S(),n=C(t=>t.workspaceGitState[e.id]),r=C(e=>e.fetchWorkspaceGitState),a=e.mode===`isolated`&&!!e.worktreePath&&L.has(e.status);if((0,P.useEffect)(()=>{a&&n===void 0&&r(e.id)},[a,n,e.id,r]),!a)return null;let o=(0,F.jsx)(O,{size:`icon-sm`,variant:`ghost`,className:`h-5 w-5`,title:`Refresh git state`,onClick:()=>void r(e.id),children:(0,F.jsx)(l,{className:`h-3 w-3`})});if(n===void 0)return(0,F.jsx)(`div`,{className:`flex items-center gap-1 text-[11px] text-muted-foreground`,children:`Loading git state…`});if(n.available===!1)return(0,F.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px] text-muted-foreground`,title:n.reason,children:[(0,F.jsx)(`span`,{children:`git state unavailable`}),o]});if(n.missing)return(0,F.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px] text-muted-foreground`,children:[`worktree gone `,o]});if(n.error)return(0,F.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px] text-red-400`,title:n.error,children:[(0,F.jsx)(`span`,{children:`git error`}),o]});let s=n.ahead??0,c=n.landed===!0,d=c?0:n.unmergedAhead??s,f=n.behind??0,h=n.dirtyCount??0,g=d===0&&h===0&&!c,_=n.lastCommit;return(0,F.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[11px]`,children:[g?(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`no unmerged work`}):(0,F.jsxs)(F.Fragment,{children:[c?(0,F.jsxs)(`span`,{className:`flex items-center gap-0.5 text-emerald-400`,title:`Work already landed in ${n.baseRef||`base`} via squash/cherry-pick — safe to clean up`,children:[(0,F.jsx)(v,{className:`h-3 w-3`}),`landed`]}):(0,F.jsxs)(`span`,{className:d>0?`flex items-center text-emerald-400`:`flex items-center text-muted-foreground`,title:s===d?`${d} commit(s) ahead of base`:`${d} unmerged commit(s) (${s} ahead of base)`,children:[(0,F.jsx)(p,{className:`h-3 w-3`}),d]}),(0,F.jsxs)(`span`,{className:f>0?`flex items-center text-amber-400`:`flex items-center text-muted-foreground`,title:`${f} commit(s) behind base`,children:[(0,F.jsx)(i,{className:`h-3 w-3`}),f]}),h>0&&(0,F.jsxs)(`span`,{className:`flex items-center text-orange-400`,title:`${h} uncommitted change(s)`,children:[(0,F.jsx)(u,{className:`h-3 w-3`}),h]}),!c&&(0,F.jsx)(X,{workspace:e,unmerged:d})]}),o]}),_&&(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-[11px] text-muted-foreground`,title:`${_.sha.slice(0,8)} — ${_.message}`,children:[(0,F.jsx)(m,{className:`h-3 w-3 shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:_.message||_.sha.slice(0,8)}),_.at?(0,F.jsxs)(`span`,{className:`shrink-0 opacity-70`,children:[`· `,T(t,_.at)]}):null]})]})}function Q({workspace:e}){let t=S(),n=typeof e.metadata?.mergedAt==`number`?e.metadata.mergedAt:void 0,r=[{label:`created`,at:e.createdAt},{label:`ready`,at:e.readyAt},{label:`merged`,at:n},{label:`cleaned`,at:e.cleanedAt}].filter(e=>typeof e.at==`number`&&e.at>0);return(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-muted-foreground`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1 font-medium text-foreground`,children:[(0,F.jsx)(s,{className:`h-3 w-3`}),`Timeline`]}),r.map((e,n)=>(0,F.jsxs)(`span`,{className:`flex items-center gap-1`,children:[n>0&&(0,F.jsx)(`span`,{className:`opacity-40`,children:`→`}),(0,F.jsx)(`span`,{className:`text-foreground`,children:e.label}),(0,F.jsx)(`span`,{title:new Date(e.at).toLocaleString(),children:T(t,e.at)})]},e.label))]})}function te(e){return e.startsWith(`+`)&&!e.startsWith(`+++`)?`text-emerald-400`:e.startsWith(`-`)&&!e.startsWith(`---`)?`text-red-400`:e.startsWith(`@@`)?`text-cyan-400`:e.startsWith(`diff `)||e.startsWith(`index `)||e.startsWith(`+++`)||e.startsWith(`---`)?`text-muted-foreground`:``}function ne({workspace:e}){let t=C(t=>t.workspaceDiff[e.id]),n=C(e=>e.fetchWorkspaceDiff),r=e.mode===`isolated`&&!!e.worktreePath;if((0,P.useEffect)(()=>{r&&t===void 0&&n(e.id)},[r,t,e.id,n]),!r)return null;if(t===void 0)return(0,F.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:`Loading diff…`});if(t.available===!1)return(0,F.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`Diff unavailable`,t.reason?`: ${t.reason}`:``]});if(t.missing)return(0,F.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:`Worktree no longer on disk`});if(t.error)return(0,F.jsxs)(`div`,{className:`text-[11px] text-red-400`,children:[`Diff error: `,t.error]});if(!t.files.length)return(0,F.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`No committed changes against `,t.baseRef||`base`]});let i=(0,F.jsx)(O,{size:`icon-sm`,variant:`ghost`,className:`h-5 w-5`,title:`Refresh diff`,onClick:()=>void n(e.id),children:(0,F.jsx)(l,{className:`h-3 w-3`})});return(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-medium`,children:[(0,F.jsx)(a,{className:`h-3 w-3`}),(0,F.jsxs)(`span`,{children:[t.files.length,` file`,t.files.length===1?``:`s`,` vs `,t.baseRef||`base`]}),i]}),(0,F.jsx)(`ul`,{className:`space-y-0.5 text-[11px]`,children:t.files.map(e=>(0,F.jsxs)(`li`,{className:`flex items-center gap-2 font-mono`,children:[(0,F.jsx)(`span`,{className:`truncate`,title:e.path,children:e.path}),e.binary?(0,F.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`binary`}):(0,F.jsxs)(`span`,{className:`shrink-0`,children:[(0,F.jsxs)(`span`,{className:`text-emerald-400`,children:[`+`,e.additions??0]}),` `,(0,F.jsxs)(`span`,{className:`text-red-400`,children:[`−`,e.deletions??0]})]})]},e.path))}),t.patch&&(0,F.jsxs)(`pre`,{className:`max-h-80 overflow-auto rounded border border-border bg-muted/30 p-2 text-[10.5px] leading-relaxed`,children:[t.patch.split(`
|
|
2
|
-
`).map((e,t)=>(0,F.jsx)(`div`,{className:te(e),children:e||` `},t)),t.truncated&&(0,F.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:`… patch truncated`})]})]})}function re({workspace:e}){return(0,F.jsxs)(`div`,{className:`space-y-3 border-t border-dashed border-border bg-muted/20 px-3 py-3`,children:[(0,F.jsx)(Q,{workspace:e}),(0,F.jsx)(ne,{workspace:e})]})}function $(){let e=C(e=>e.workspaceOrphans),n=C(e=>e.fetchWorkspaceOrphans),i=C(e=>e.reclaimWorkspaceOrphan);return(0,P.useEffect)(()=>{n()},[n]),e.length?(0,F.jsxs)(N,{className:`border-amber-500/30`,children:[(0,F.jsxs)(M,{className:`px-4 py-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(h,{className:`h-4 w-4 text-amber-400`}),(0,F.jsx)(A,{className:`text-sm font-medium`,children:`Orphaned worktrees`}),(0,F.jsx)(D,{variant:`outline`,className:`border-amber-500/30 text-amber-400 text-[10px]`,children:e.length}),(0,F.jsx)(O,{size:`icon-sm`,variant:`ghost`,className:`ml-auto h-6 w-6`,title:`Rescan`,onClick:()=>void n(),children:(0,F.jsx)(l,{className:`h-3.5 w-3.5`})})]}),(0,F.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Agent worktrees on disk with no live workspace. Reclaim removes them from the host.`})]}),(0,F.jsx)(j,{className:`p-0`,children:e.map(e=>(0,F.jsxs)(`div`,{className:`flex items-center gap-3 border-t border-border px-4 py-2 text-xs`,children:[(0,F.jsx)(r,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,F.jsx)(`span`,{className:`truncate font-medium`,title:e.branch,children:e.branch||`(detached)`}),(0,F.jsx)(`span`,{className:`truncate font-mono text-muted-foreground`,title:e.worktreePath,children:U(e.worktreePath)}),e.hadTerminalRow&&(0,F.jsx)(D,{variant:`outline`,className:`text-[10px]`,children:`cleanup failed`}),(0,F.jsxs)(O,{size:`sm`,variant:`outline`,className:`ml-auto h-7 text-xs`,onClick:()=>void i(e),children:[(0,F.jsx)(t,{className:`mr-1 h-3.5 w-3.5`}),`Reclaim`]})]},e.worktreePath))})]}):null}function ie(e){let t=e.match(/\/pull\/(\d+)/);return t?`PR #${t[1]}`:`View PR`}function ae({workspace:e}){let t=e.metadata?.mergeResult,n=t?.prUrl,r=t?.error||e.metadata?.mergeError;return!n&&!r?null:(0,F.jsxs)(F.Fragment,{children:[n&&(0,F.jsxs)(`a`,{href:n,target:`_blank`,rel:`noreferrer`,title:n,className:`inline-flex items-center gap-0.5 rounded border border-violet-500/30 px-1.5 py-0 text-[10px] text-violet-400 hover:text-violet-300`,children:[(0,F.jsx)(_,{className:`h-2.5 w-2.5`}),ie(n)]}),r&&(0,F.jsxs)(D,{variant:`outline`,className:`max-w-[16rem] border-amber-500/30 text-amber-400 text-[10px]`,title:r,children:[(0,F.jsx)(b,{className:`mr-0.5 h-2.5 w-2.5 shrink-0`}),(0,F.jsxs)(`span`,{className:`truncate`,children:[`merge: `,r]})]})]})}function oe({workspace:e}){let t=S(),[n,i]=(0,P.useState)(!1),a=C(e=>e.agentsById),o=C(t=>t.workspaceFocusId===e.id),s=e.ownerAgentId?a[e.ownerAgentId]:void 0,c=e.stewardAgentId?a[e.stewardAgentId]:void 0,l=e.worktreePath||e.sourceCwd||e.repoRoot,u=(0,P.useRef)(null);return(0,P.useEffect)(()=>{o&&u.current?.scrollIntoView({behavior:`smooth`,block:`center`})},[o]),(0,F.jsxs)(`div`,{ref:u,className:`border-t border-border ${o?`bg-primary/5 ring-1 ring-inset ring-primary/40`:``}`,children:[(0,F.jsxs)(`div`,{className:`grid gap-3 px-3 py-3 text-sm lg:grid-cols-[minmax(180px,1.2fr)_minmax(220px,1.5fr)_minmax(160px,1fr)_minmax(170px,auto)]`,children:[(0,F.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,F.jsx)(r,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,F.jsx)(`span`,{className:`truncate font-medium`,title:e.branch||e.id,children:e.branch||e.id})]}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,F.jsx)(D,{variant:`outline`,className:`text-[10px] ${e.mode===`isolated`?`border-sky-500/30 text-sky-400`:`border-zinc-500/30 text-zinc-400`}`,children:e.mode}),e.requestedMode&&e.requestedMode!==e.mode&&(0,F.jsxs)(D,{variant:`outline`,className:`text-[10px]`,children:[`requested `,e.requestedMode]}),(0,F.jsx)(D,{variant:`outline`,className:`text-[10px] ${G(e.status)}`,children:B[e.status]||e.status}),(0,F.jsx)(ae,{workspace:e})]})]}),(0,F.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,F.jsx)(`div`,{className:`truncate font-mono text-xs`,title:l,children:U(l)}),(0,F.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,title:e.sourceCwd,children:e.sourceCwd}),(0,F.jsx)(Z,{workspace:e})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-[4.5rem_minmax(0,1fr)] gap-x-2 gap-y-1 text-xs`,children:[(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`Owner`}),(0,F.jsx)(`span`,{className:`truncate`,title:e.ownerAgentId,children:W(s,e.ownerPolicyName||e.ownerAgentId)}),(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`Steward`}),(0,F.jsx)(`span`,{className:`truncate`,title:e.stewardAgentId,children:W(c,e.stewardAgentId)}),(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`Updated`}),(0,F.jsx)(`span`,{children:T(t,e.updatedAt)}),e.baseRef&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`Base`}),(0,F.jsx)(`span`,{className:`truncate`,title:e.baseSha,children:e.baseRef})]})]}),(0,F.jsx)(Y,{workspace:e,expanded:n,onToggleDetails:()=>i(e=>!e)})]}),n&&(0,F.jsx)(re,{workspace:e})]})}function se({repoRoot:e,workspaces:t}){let n=t.filter(e=>I.has(e.status)).length,r=t.filter(e=>e.status===`ready`||e.status===`review_requested`||e.status===`merge_planned`).length,i=t.filter(e=>e.status===`conflict`).length;return(0,F.jsxs)(N,{children:[(0,F.jsx)(M,{className:`px-4 py-3`,children:(0,F.jsx)(`div`,{className:`flex min-w-0 items-start gap-3`,children:(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(A,{className:`truncate text-sm font-medium`,title:e,children:e}),(0,F.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:[(0,F.jsxs)(D,{variant:`outline`,className:`text-[10px]`,children:[t.length,` total`]}),(0,F.jsxs)(D,{variant:`outline`,className:`text-[10px]`,children:[n,` live`]}),r>0&&(0,F.jsxs)(D,{variant:`outline`,className:`border-emerald-500/20 text-emerald-400 text-[10px]`,children:[r,` merge signal`]}),i>0&&(0,F.jsxs)(D,{variant:`outline`,className:`border-red-500/20 text-red-400 text-[10px]`,children:[i,` conflict`]})]})]})})}),(0,F.jsx)(j,{className:`p-0`,children:t.map(e=>(0,F.jsx)(oe,{workspace:e},e.id))})]})}function ce(){let[e,t]=(0,P.useState)(`active`),n=C(e=>e.workspaces),r=C(e=>e.set),i=C(e=>e.workspaceFocusId);(0,P.useEffect)(()=>{i&&t(`all`)},[i]),(0,P.useEffect)(()=>()=>{r({workspaceFocusId:null})},[r]);let a=(0,P.useMemo)(()=>J(n,e),[n,e]),o=(0,P.useMemo)(()=>q(a),[a]),s=n.filter(e=>I.has(e.status)).length,c=n.filter(e=>e.mode===`isolated`).length,l=n.filter(e=>e.status===`ready`||e.status===`review_requested`||e.status===`merge_planned`).length,u=n.filter(e=>e.status===`conflict`).length,d=n.filter(e=>H.has(e.status)).length,f=[{key:`active`,label:`Active`,count:n.length-d},{key:`cleaned`,label:`Done`,count:d},{key:`all`,label:`All`,count:n.length}];return(0,F.jsxs)(`div`,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`Workspaces`}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Agent worktrees, ownership, and merge readiness.`})]}),(0,F.jsxs)(`div`,{className:`ml-auto flex flex-wrap gap-1.5`,children:[(0,F.jsxs)(D,{variant:`outline`,children:[c,` isolated`]}),(0,F.jsxs)(D,{variant:`outline`,children:[s,` live`]}),(0,F.jsxs)(D,{variant:`outline`,children:[l,` ready`]}),u>0&&(0,F.jsxs)(D,{variant:`outline`,className:`border-red-500/20 text-red-400`,children:[u,` conflict`]})]})]}),(0,F.jsx)($,{}),(0,F.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,F.jsx)(`div`,{className:`flex rounded-md border border-border bg-card p-1`,children:f.map(n=>(0,F.jsxs)(O,{size:`sm`,variant:e===n.key?`secondary`:`ghost`,className:`h-7 text-xs`,onClick:()=>t(n.key),children:[n.label,(0,F.jsx)(`span`,{className:`ml-1 text-muted-foreground`,children:n.count})]},n.key))})}),o.length===0?(0,F.jsxs)(`div`,{className:`rounded-md border border-border px-3 py-12 text-center text-sm text-muted-foreground`,children:[`No `,e===`all`?``:e,` workspaces`]}):(0,F.jsx)(`div`,{className:`space-y-3`,children:o.map(e=>(0,F.jsx)(se,{repoRoot:e.repoRoot,workspaces:e.workspaces},e.repoRoot))})]})}export{ce as WorkspacesView};
|
|
3
|
-
//# sourceMappingURL=workspaces-m97LP4Eu.js.map
|