@open-mercato/cezar 0.20.0-pr2192.5251 → 0.20.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.
Files changed (94) hide show
  1. package/dist/server/agent-setup-routes.d.ts +14 -14
  2. package/dist/server/dashboard.d.ts +54 -54
  3. package/dist/server/server.d.ts +68 -68
  4. package/dist/server/worktree-lifecycle.d.ts +90 -90
  5. package/dist/telemetry-service.json +1 -0
  6. package/dist/workflows/run-env-keys.d.ts +8 -0
  7. package/dist/workflows/run-env-keys.js +14 -0
  8. package/dist/workflows/run-env-keys.js.map +1 -0
  9. package/package.json +5 -5
  10. package/web/dist/assets/{active-forge-KyXM3uG9.js → active-forge-CkAcQPDz.js} +1 -1
  11. package/web/dist/assets/{agent-task-pickers-UkVtTCna.js → agent-task-pickers-BXCIulS3.js} +1 -1
  12. package/web/dist/assets/{alert-dialog-DT465VL4.js → alert-dialog-B2Vi6MQZ.js} +1 -1
  13. package/web/dist/assets/{ask-card-DVv8mY_R.js → ask-card-DPIjQSs8.js} +1 -1
  14. package/web/dist/assets/{assets-view-D22vr-oN.js → assets-view-CsFjfV2n.js} +1 -1
  15. package/web/dist/assets/{automation-format-KxcnBz7L.js → automation-format-CMG-6CYi.js} +1 -1
  16. package/web/dist/assets/{automations-route-3gfbxDq2.js → automations-route-Dd7F6b4F.js} +1 -1
  17. package/web/dist/assets/{button-CEskWahs.js → button-CJXK1JqU.js} +1 -1
  18. package/web/dist/assets/{centered-state-Cpzaj75Y.js → centered-state-DE6sgEMs.js} +1 -1
  19. package/web/dist/assets/{chip-CEZRGBV7.js → chip-DTCkrr8F.js} +1 -1
  20. package/web/dist/assets/{collapsible-ZLdkcdMa.js → collapsible-DHALizq-.js} +1 -1
  21. package/web/dist/assets/{command-CcbuBum7.js → command-CwP_dLx3.js} +1 -1
  22. package/web/dist/assets/{commit-list-BSjLQA6p.js → commit-list-BJeaIEp4.js} +1 -1
  23. package/web/dist/assets/{compare-variants-C9soYpuE.js → compare-variants-CYv97XSw.js} +1 -1
  24. package/web/dist/assets/{composer-Bz8ZfbHr.js → composer-C-aBJhY0.js} +1 -1
  25. package/web/dist/assets/{composer-attachments-BD2enHFJ.js → composer-attachments-ChelZhq4.js} +1 -1
  26. package/web/dist/assets/{dashboard-Bl6qWW8i.js → dashboard-Dh65_Yi7.js} +1 -1
  27. package/web/dist/assets/{dialog-nn9sCNvn.js → dialog-DVZE8yAO.js} +1 -1
  28. package/web/dist/assets/{diff-FrEDv09S.js → diff-aKT-mpn8.js} +2 -2
  29. package/web/dist/assets/{diff-stat-zisAayZW.js → diff-stat-DPetRUXO.js} +1 -1
  30. package/web/dist/assets/{diff-view-BeoeZVcx.js → diff-view-m4TvXu0y.js} +1 -1
  31. package/web/dist/assets/{dist-B_KqW6o6.js → dist-Bsi6zLdE.js} +1 -1
  32. package/web/dist/assets/{dropdown-menu-ayNafd3n.js → dropdown-menu-BKvUsb5Y.js} +1 -1
  33. package/web/dist/assets/{file-preview-Dzc3RFUx.js → file-preview-C2EkjhOh.js} +1 -1
  34. package/web/dist/assets/{follow-up-engine-Dul_3U9s.js → follow-up-engine-BnRCTyQ4.js} +1 -1
  35. package/web/dist/assets/{git-tab-loading-DG4p-eF4.js → git-tab-loading-DpG2D8Vl.js} +1 -1
  36. package/web/dist/assets/{github-DvZE0hDJ.js → github-CWRtsamJ.js} +1 -1
  37. package/web/dist/assets/{host-usage-GTjB03IM.js → host-usage-B8ohHYHR.js} +1 -1
  38. package/web/dist/assets/{icon-tooltip-DRhwcic2.js → icon-tooltip-DYk5cjLx.js} +1 -1
  39. package/web/dist/assets/{impact-control-CTdtyfcn.js → impact-control-ClslFBBA.js} +1 -1
  40. package/web/dist/assets/{impact-model-CpNcUgTV.js → impact-model-DCDyRxcf.js} +1 -1
  41. package/web/dist/assets/{index-BMA7ZpLG.js → index-BfbbA0lF.js} +4 -4
  42. package/web/dist/assets/{input-BtDLUR9Q.js → input-DofKzJZl.js} +1 -1
  43. package/web/dist/assets/{loading-state-BTvZxCb2.js → loading-state-NiNQtJ5H.js} +1 -1
  44. package/web/dist/assets/{manager-avatar-Ct1uVuvZ.js → manager-avatar-CKfqcoJQ.js} +1 -1
  45. package/web/dist/assets/{manager-chat-BfxPyXv3.js → manager-chat-BdigDKYZ.js} +1 -1
  46. package/web/dist/assets/{manager-index-CeMdRtKd.js → manager-index-D0TOmxr6.js} +1 -1
  47. package/web/dist/assets/{manager-new-Bs8_CMUR.js → manager-new-CCet_7u8.js} +1 -1
  48. package/web/dist/assets/{manager-settings-Bv2EqZvs.js → manager-settings-I1AeATjr.js} +1 -1
  49. package/web/dist/assets/{managers-DDPXJoKR.js → managers-Dr63u21Y.js} +1 -1
  50. package/web/dist/assets/{markdown-3rt1rOmI.js → markdown-CXJIKz2i.js} +1 -1
  51. package/web/dist/assets/{markdown-LlPZylt7.js → markdown-YSf01kqC.js} +1 -1
  52. package/web/dist/assets/{mascot-picker-BuGxdrpW.js → mascot-picker-C4s7n9Fc.js} +1 -1
  53. package/web/dist/assets/{new-task-form-BoiK41PS.js → new-task-form-2p4cXcVQ.js} +1 -1
  54. package/web/dist/assets/{picker-pill-CzANlEqt.js → picker-pill-Dv9H0dRF.js} +1 -1
  55. package/web/dist/assets/{pill-C2wRS9lg.js → pill-CoDPUIcJ.js} +1 -1
  56. package/web/dist/assets/{popover-DPba6FvD.js → popover-DUg9gBOn.js} +1 -1
  57. package/web/dist/assets/{project-router-CnMbTz-a.js → project-router-B1Q3upIJ.js} +1 -1
  58. package/web/dist/assets/{project-terminal-sfYncenW.js → project-terminal-DbIohh5G.js} +2 -2
  59. package/web/dist/assets/{provider-auth-alert-DbNH_-XT.js → provider-auth-alert-GxIEkIvw.js} +1 -1
  60. package/web/dist/assets/{queries-DVZ1lYAo.js → queries-BQUz3Wnb.js} +1 -1
  61. package/web/dist/assets/{reasoning-effort-pill-al6bbPpw.js → reasoning-effort-pill-BOV3C0If.js} +1 -1
  62. package/web/dist/assets/{reference-chip-DdxKs2_A.js → reference-chip-BpbybBvl.js} +1 -1
  63. package/web/dist/assets/{reference-conflict-action-Ci4LDmIm.js → reference-conflict-action-ByDYwT-Y.js} +1 -1
  64. package/web/dist/assets/{repo-git-BcEGYBrc.js → repo-git-ikURCYEK.js} +1 -1
  65. package/web/dist/assets/{run-actions-CDKK-8MP.js → run-actions-ChUnbFA7.js} +1 -1
  66. package/web/dist/assets/{run-diff-JJOUeclX.js → run-diff-B08Fk7dR.js} +1 -1
  67. package/web/dist/assets/{scroll-within-CfS_Ia4E.js → scroll-within-DMA4ZbQV.js} +1 -1
  68. package/web/dist/assets/{segmented-Chb1Y4ie.js → segmented-DI7abdqX.js} +1 -1
  69. package/web/dist/assets/{select-DG3hFvx2.js → select-DL5E3ZAD.js} +1 -1
  70. package/web/dist/assets/{sheet-DirfZrZD.js → sheet-DPwaj6sk.js} +1 -1
  71. package/web/dist/assets/{skills-CxWFZgjH.js → skills-BNiKFlUw.js} +1 -1
  72. package/web/dist/assets/{spinner-CwKcijCN.js → spinner-hSpq0sPM.js} +1 -1
  73. package/web/dist/assets/{status-dot-CZAbXsOs.js → status-dot-AP_4obOJ.js} +1 -1
  74. package/web/dist/assets/{tabs-r4PCzkHp.js → tabs-DrhZb97I.js} +1 -1
  75. package/web/dist/assets/{task-commits-CHnonzuD.js → task-commits-Di0Mc8MX.js} +1 -1
  76. package/web/dist/assets/{task-graph-DZAjkdmH.js → task-graph-Bpi3lEER.js} +1 -1
  77. package/web/dist/assets/{task-notes-CHs_WZf5.js → task-notes-DCHLinAF.js} +1 -1
  78. package/web/dist/assets/{task-workspace-DWGBLHlR.js → task-workspace-DHl5akxu.js} +3 -3
  79. package/web/dist/assets/{telemetry-onLa6CTl.js → telemetry-3DhVDxf8.js} +1 -1
  80. package/web/dist/assets/{terminal-drawer-DV7kUP0D.js → terminal-drawer-CEktqC3z.js} +1 -1
  81. package/web/dist/assets/{terminal-pane-DQAHtCtb.js → terminal-pane-CmmTwiTX.js} +1 -1
  82. package/web/dist/assets/{terminal-scope-CEQdw5Tz.js → terminal-scope-okFE6qRP.js} +1 -1
  83. package/web/dist/assets/{textarea-BqeSvPOp.js → textarea-DDyYxCcO.js} +1 -1
  84. package/web/dist/assets/{thread-items-CNxMLcOo.js → thread-items-C-4IW5zi.js} +1 -1
  85. package/web/dist/assets/{toaster-4t61QM_C.js → toaster-BoJZiTRl.js} +1 -1
  86. package/web/dist/assets/{tracker-B7u8exjG.js → tracker-bQUG9SkJ.js} +1 -1
  87. package/web/dist/assets/{tree-pane-resize-XHzIJDtc.js → tree-pane-resize-xgVK7J9r.js} +1 -1
  88. package/web/dist/assets/utils-Dp6vCdiU.js +55 -0
  89. package/web/dist/assets/{workflow-graph-BaZd6m6v.js → workflow-graph-CGMeFErv.js} +1 -1
  90. package/web/dist/assets/{worktree-lifecycle-YFVatYLd.js → worktree-lifecycle-C18dBDW4.js} +1 -1
  91. package/web/dist/assets/{worktree-lifecycle-operation-CYHhFvQF.js → worktree-lifecycle-operation-_xqKBVKB.js} +1 -1
  92. package/web/dist/assets/{zoomable-image-D4B6jvp-.js → zoomable-image-BiM5LfTG.js} +1 -1
  93. package/web/dist/index.html +46 -46
  94. package/web/dist/assets/utils-DWwoYTjU.js +0 -60
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Di as r,Kt as i,Lr as a,Or as o,R as s,cn as c,ha as l,in as u,mr as d,pn as ee,qt as f,r as p,sa as m,vo as h,vr as g,xo as te}from"./queries-DVZ1lYAo.js";import{t as _}from"./utils-DWwoYTjU.js";import{C as v,c as y,l as ne,t as b}from"./project-router-CnMbTz-a.js";import{t as x}from"./createLucideIcon-BHp8sXmF.js";import{t as re}from"./arrow-left-BfRd_mrv.js";import{j as S}from"./run-actions-CDKK-8MP.js";import{t as C}from"./button-CEskWahs.js";import{i as w,n as T,o as E,s as D,t as O}from"./select-DG3hFvx2.js";import{t as k}from"./circle-check-BpDFgE5h.js";import{n as A}from"./manager-avatar-Ct1uVuvZ.js";import{C as ie,f as ae,g as oe,m as j,p as se}from"./composer-Bz8ZfbHr.js";import{t as ce}from"./refresh-cw-BIgmYimN.js";import{t as le}from"./triangle-alert-CIzim6ZN.js";import{t as M}from"./icon-tooltip-DRhwcic2.js";import{a as N,i as P,n as F,o as I,r as L,t as R}from"./dialog-nn9sCNvn.js";import{a as ue,i as de}from"./loading-state-BTvZxCb2.js";import{t as fe}from"./input-BtDLUR9Q.js";import{r as z}from"./toaster-4t61QM_C.js";import{b as B,m as V}from"./telemetry-onLa6CTl.js";import{t as H}from"./centered-state-Cpzaj75Y.js";import{_ as U}from"./new-task-form-BoiK41PS.js";import{c as pe,u as me}from"./index-BMA7ZpLG.js";var he=x(`list-chevrons-up-down`,[[`path`,{d:`M3 5h8`,key:`18g2rq`}],[`path`,{d:`M3 12h8`,key:`1xfjp6`}],[`path`,{d:`M3 19h8`,key:`fpbke4`}],[`path`,{d:`m15 8 3-3 3 3`,key:`bc4io6`}],[`path`,{d:`m15 16 3 3 3-3`,key:`9wmg1l`}]]),W=e(t(),1),G=n(),K=[`.ai/cezar/skills/`,`.ai/skills/`,`.agents/skills/`],q=[`.claude/commands/`,`.codex/prompts/`,`.github/prompts/`];function J({children:e}){return(0,G.jsx)(`span`,{className:`font-mono`,children:e})}function ge(){return(0,G.jsx)(G.Fragment,{children:K.map((e,t)=>(0,G.jsxs)(`span`,{children:[t>0?t===K.length-1?`, or `:`, `:``,(0,G.jsx)(J,{children:e})]},e))})}function _e(){return(0,G.jsxs)(G.Fragment,{children:[`No skills yet. Drop Markdown files into `,(0,G.jsx)(ge,{}),` (agent mirrors like`,` `,(0,G.jsx)(J,{children:`.claude/skills/`}),` work too) — optional frontmatter: `,(0,G.jsx)(J,{children:`name`}),`,`,` `,(0,G.jsx)(J,{children:`description`}),`. Global (`,(0,G.jsx)(J,{children:`~/.agents/skills`}),`) and team-repo skills appear here too — try Refresh. Repo commands (spec-kit's `,(0,G.jsx)(J,{children:q[0]}),`,`,` `,(0,G.jsx)(J,{children:q[1]}),`, `,(0,G.jsx)(J,{children:q[2]}),`, …) are listed too.`]})}var Y=2e3,X=5*6e4,Z=e=>e.tracked??e.skills;async function Q(e,t,n={}){let{apply:i=g,read:a=r,wait:o=e=>new Promise(t=>setTimeout(t,e)),now:s=Date.now,onDropped:c=B}=n;try{return await i(e)}catch(n){if(!(n instanceof d)||n.status!==0&&n.status!==409)throw n;let r=e=>{n.status===0&&c(e)},i=s()+X;for(;;){let c;try{c=await a(e)}catch{throw r(`unreachable`),n}if(c.status!==`updating`){if(c.updatedAt&&c.updatedAt!==t)return r(`recovered`),c;throw r(`not_applied`),n}if(s()>=i)throw r(`timed_out`),n;await o(Y)}}}function $(e){return e===`project`?`Project installation`:`Global installation`}function ve({projectId:e,state:t,loadError:n}){let r=te(),i=ne(),s=(0,W.useRef)(0),[c,l]=(0,W.useState)(!1),u=h({mutationFn:()=>a({task:`Apply the upgrade notes after updating the installed Open Mercato skills.`,steps:[{id:`apply-upgrade-notes`,name:`Apply upgrade notes`,skill:`om-apply-upgrade-notes`,prompt:`{{task}}`}]}),onSuccess:e=>{V(`skills_import`),l(!1),i(U(e))},onError:e=>z(e.message,{tone:`danger`})}),d=(t,n)=>{n.seq===s.current&&(r.setQueryData(ee.skillsUpdate(e),t),n.action===`apply`&&t.updatedAt&&t.updatedAt!==n.previousUpdatedAt&&(r.invalidateQueries({queryKey:p.skills}),z(t.status===`error`?`Some skill updates failed.`:`Open Mercato skills updated.`),l(!0)))},f=(e,t)=>{t.seq===s.current&&z(e.message,{tone:`danger`})},m=h({mutationFn:t=>o(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>d(e,t),onError:(e,t)=>f(e,t)}),g=h({mutationFn:t=>Q(e,t.previousUpdatedAt).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>d(e,t),onError:(e,t)=>f(e,t)}),v=e=>{let n=++s.current;e===`apply`?g.mutate({action:e,seq:n,previousUpdatedAt:t?.updatedAt??null}):m.mutate({action:e,seq:n})},y=t?.scopes??[],b=y.filter(e=>Z(e).length>0),x=b.length>0,re=y.some(e=>e.skills.length>0),S=t?.status===`error`,w=re&&(t?.available||S),T=g.isPending||t?.status===`updating`,E=y.filter(e=>e.status===`error`||e.status===`unavailable`),D=y.filter(e=>e.updatedAt&&!E.includes(e)),O=`Checking installed Open Mercato skills…`;return n?O=`Update status is unavailable right now.`:t?.status===`available`?O=`An update is available for your installed Open Mercato skills.`:t?.status===`updating`?O=`Updating installed Open Mercato skills…`:t?.status===`current`&&!x?O=t.needsUpgradeNotes?`Skill files were updated.`:`No installed Open Mercato skills are tracked for updates.`:t?.status===`current`?O=`Installed Open Mercato skills are up to date.`:t?.status===`unavailable`?O=t.scopes.find(e=>e.reason)?.reason??`Automatic updates are unavailable.`:t?.status===`error`&&(O=`The update did not finish for every installation.`),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`section`,{"data-slot":`skills-update-card`,"aria-live":`polite`,className:`rounded-lg border border-border bg-muted/30 p-3`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`text-ui font-medium text-foreground`,children:O}),t?.checkedAt?(0,G.jsxs)(`p`,{className:`mt-1 text-label text-muted-foreground`,children:[`Last checked `,new Date(t.checkedAt).toLocaleString(),`.`]}):null,b.length>0?(0,G.jsx)(`ul`,{className:`mt-1 text-label text-muted-foreground`,children:b.map(e=>(0,G.jsxs)(`li`,{children:[$(e.scope),` · `,Z(e).length,` tracked`]},e.scope))}):null,E.length>0?(0,G.jsxs)(`p`,{className:`mt-1 text-label text-danger`,children:[`Failed: `,E.map(e=>$(e.scope)).join(`, `),D.length?`; updated: `+D.map(e=>$(e.scope)).join(`, `):``,`.`]}):null]}),w?(0,G.jsxs)(C,{"data-action":`skills-update-apply`,size:`sm`,disabled:T,onClick:()=>v(`apply`),children:[(0,G.jsx)(ce,{"aria-hidden":`true`,className:_(`size-3.5`,T&&`motion-safe:animate-spin`)}),T?`Updating…`:S?`Retry`:`Update now`]}):t?.status===`current`?(0,G.jsx)(C,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:m.isPending,onClick:()=>v(`check`),children:`Check again`}):t?.status===`unavailable`||n?(0,G.jsx)(C,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:m.isPending,onClick:()=>v(`check`),children:`Retry check`}):null]}),t?.status===`unavailable`||n?(0,G.jsxs)(`div`,{className:`mt-2 text-label text-muted-foreground`,children:[`Manual examples: `,(0,G.jsx)(`code`,{children:`npx skills update -p`}),` · `,(0,G.jsx)(`code`,{children:`npx skills update -g`}),`. These broad commands may update other tracked sources.`]}):null,t?.needsUpgradeNotes?(0,G.jsxs)(`div`,{"data-slot":`skills-upgrade-notes`,className:`mt-3 flex gap-2 rounded-md border border-primary/30 bg-background p-2.5 text-xs text-foreground`,children:[(0,G.jsx)(k,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-primary`}),(0,G.jsxs)(`span`,{children:[`Skill files were updated. Run `,(0,G.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` in each configured repository to apply descriptor migrations while preserving local edits.`]})]}):null]}),(0,G.jsx)(R,{open:c,onOpenChange:e=>u.isPending?void 0:l(e),children:(0,G.jsxs)(F,{"data-slot":`skills-upgrade-notes-dialog`,showCloseButton:!1,children:[(0,G.jsxs)(N,{children:[(0,G.jsx)(I,{children:`Apply the upgrade notes now?`}),(0,G.jsxs)(L,{children:[`The skill files were updated successfully. Start a new session with`,` `,(0,G.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` to sync repository descriptors while preserving local edits?`]})]}),(0,G.jsxs)(P,{children:[(0,G.jsx)(C,{type:`button`,variant:`outline`,disabled:u.isPending,onClick:()=>l(!1),children:`No`}),(0,G.jsx)(C,{type:`button`,disabled:u.isPending,onClick:()=>u.mutate(),children:u.isPending?`Starting…`:`Yes, start session`})]})]})})]})}function ye(e,t){let n=e?.importedSkills;return Array.isArray(n)?n.filter(e=>typeof e==`string`&&!!e):[...t]}function be(e,t,n,r,i=!1){let a=e.source===`ai`||e.source===`cezar`||e.source===`agents`||e.source===`global`,o=e.source===`team`&&(t.has(e.name)||i);if(!(!a&&!o))return{ariaLabel:a?`${e.name} is always enabled`:`${e.enabled?`Disable`:`Enable`} ${e.name}`,checked:a||e.enabled,disabled:a||n||i,onCheckedChange:()=>r(e.name)}}function xe(){return(0,G.jsxs)(`div`,{"data-route":`skills`,className:`flex min-h-full flex-col`,children:[(0,G.jsxs)(`header`,{className:`sticky top-0 z-10 hidden h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-5 md:flex`,children:[(0,G.jsx)(`h1`,{className:`text-base font-semibold`,children:`Skills`}),(0,G.jsx)(`p`,{className:`text-ui text-muted-foreground`,children:`Markdown playbooks agents can follow.`})]}),(0,G.jsx)(Se,{})]})}function Se(){let e=y()??``,t=f(e,!!e),n=i(),r=c(),a=s(),[o]=v(),[d,ee]=(0,W.useState)(``),[g,ne]=(0,W.useState)(null),[x,k]=(0,W.useState)(!1),A=te(),j=u(),N=a.data??[],P=(0,W.useMemo)(()=>N.map(e=>e.name),[N]),F=(0,W.useMemo)(()=>new Set(P),[P]),I=(0,W.useMemo)(()=>new Set(ye(j.data,P)),[j.data,P]),L=(0,W.useRef)(Promise.resolve()),R=(0,W.useRef)(0),B=(0,W.useCallback)(t=>{let n=p.uiState,r=p.skills,i=A.getQueryData(n),a=ye(i,P),o=a.includes(t)?a.filter(e=>e!==t):[...a,t];A.setQueryData(n,{...i,importedSkills:o});let s=++R.current;L.current=L.current.then(async()=>{try{let t=await m({importedSkills:o},e);if(s!==R.current)return;A.setQueryData(n,t),A.invalidateQueries({queryKey:r})}catch(e){if(s!==R.current)return;z(e instanceof Error?e.message:String(e),{tone:`danger`}),A.invalidateQueries({queryKey:n})}})},[P,e,A]),V=h({mutationFn:()=>l(),onSuccess:e=>{A.setQueryData(p.skills,e),A.setQueryData(p.skillsReady,e),z(`Team skills refreshed.`)},onError:e=>z(e.message,{tone:`danger`})});if(n.isError)return(0,G.jsx)(H,{icon:(0,G.jsx)(le,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:n.error.message});let U=oe(n.data??[]),me=new Set(U.map(e=>e.name)),K=oe([...U.map(e=>({...e,enabled:e.source===`team`&&F.has(e.name)?I.has(e.name):!0})),...N.filter(e=>!me.has(e.name)).map(e=>({...e,enabled:I.has(e.name)}))].sort((e,t)=>e.name.localeCompare(t.name))),q=o.get(`skill`),J=K.find(e=>e.name===q)??(q===null?K.find(e=>e.enabled):null)??null,ge=J?.name??null,Y=J?be(J,F,j.isPending,B,a.isError):void 0,X=se(K),Z=X.map(e=>e.key),Q=g!==null&&Z.includes(g)?g:null,$=se(ae(Q===null?K:K.filter(e=>(e.team?.repo??``)===Q),d)),xe=$.flatMap(e=>e.skills);return(0,G.jsxs)(`div`,{"data-slot":`skills-section`,className:`flex min-h-full flex-1 items-stretch`,children:[(0,G.jsxs)(`section`,{"data-slot":`skills-list`,className:_(`w-full flex-col border-border md:flex md:shrink-0 md:border-r`,x?`md:w-[32rem]`:`md:w-96`,`md:sticky md:top-14 md:max-h-[calc(100dvh-(var(--spacing)*14))]`,q===null||!J?`flex`:`hidden md:flex`),children:[(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 p-3 pb-2`,children:[(0,G.jsx)(fe,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:d,onChange:e=>ee(e.target.value),className:`h-8 text-ui`}),(0,G.jsx)(M,{label:x?`Show short descriptions`:`Show full descriptions`,children:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`skills-detailed`,"aria-pressed":x,onClick:()=>k(e=>!e),className:`flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-label font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none aria-pressed:bg-muted aria-pressed:text-foreground`,children:[(0,G.jsx)(he,{"aria-hidden":`true`,className:`size-3`}),`Details`]})}),(0,G.jsx)(M,{label:`Fetch the team skills repos`,children:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,disabled:V.isPending,onClick:()=>V.mutate(),className:`flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-label font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[(0,G.jsx)(ce,{"aria-hidden":`true`,className:_(`size-3`,V.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})})]}),X.length>1?(0,G.jsx)(`div`,{className:`shrink-0 px-3 pb-2`,children:(0,G.jsxs)(O,{value:Q??`__all__`,onValueChange:e=>ne(e===`__all__`?null:e),children:[(0,G.jsx)(E,{"data-slot":`skills-repo-filter`,"aria-label":`Filter by repository`,size:`sm`,className:`w-full text-ui`,children:(0,G.jsx)(D,{})}),(0,G.jsxs)(T,{children:[(0,G.jsx)(w,{value:`__all__`,children:`All repositories`}),X.map(e=>(0,G.jsxs)(w,{value:e.key,children:[e.label,` (`,e.skills.length,`)`]},e.key))]})]})}):null,e?(0,G.jsx)(`div`,{className:`shrink-0 px-3 pb-2`,children:(0,G.jsx)(ve,{projectId:e,state:t.data,loadError:t.error})}):null,a.isError?(0,G.jsxs)(`div`,{"data-slot":`skills-importable-error`,role:`alert`,className:`mx-3 mb-2 flex shrink-0 items-center justify-between gap-3 rounded-md border border-danger/20 bg-danger/10 px-3 py-2 text-xs text-danger`,children:[(0,G.jsxs)(`p`,{className:`min-w-0`,children:[`Could not load the Open Mercato skills catalog. Team skills may be missing until it loads.`,` `,a.error.message]}),(0,G.jsx)(C,{type:`button`,"data-action":`skills-importable-retry`,variant:`ghost`,size:`sm`,disabled:a.isFetching,onClick:()=>void a.refetch(),children:`Retry`})]}):null,(0,G.jsx)(`ul`,{"data-slot":`skill-rows`,className:`min-h-0 flex-1 space-y-1 overflow-y-auto px-2 pb-2`,children:n.isPending?(0,G.jsx)(de,{as:`li`,label:`Loading skills…`,className:`list-none`,children:(0,G.jsx)(ue,{rows:5})}):xe.length>0?$.map(e=>(0,G.jsxs)(`li`,{"data-slot":`skill-group`,"data-group":e.key||`local`,className:`list-none`,children:[X.length>1?(0,G.jsx)(`h3`,{className:`px-2.5 pt-2 pb-1 eyebrow text-soft-foreground`,children:e.label}):null,(0,G.jsx)(`ul`,{className:`space-y-1`,children:e.skills.map(e=>(0,G.jsx)(Ce,{skill:e,active:ge===e.name,detailed:x,activation:be(e,F,j.isPending,B,a.isError)},e.name))})]},e.key)):(0,G.jsx)(`li`,{className:`px-2.5 py-2 text-label leading-relaxed text-muted-foreground`,children:K.length>0?`(no skills match)`:(0,G.jsx)(_e,{})})})]}),(0,G.jsx)(`section`,{"data-slot":`skills-detail`,className:_(`min-w-0 flex-1 flex-col`,q===null||!J?`hidden md:flex`:`flex`),children:(0,G.jsx)(`div`,{className:`min-w-0 flex-1 px-4 py-4 md:px-7 md:py-5`,children:J?(0,G.jsxs)(G.Fragment,{children:[q===null?null:(0,G.jsxs)(b,{to:`/skills`,"data-slot":`skills-back`,className:`mb-3 inline-flex items-center gap-1.5 text-label font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,G.jsx)(re,{"aria-hidden":`true`,className:`size-3.5`}),`Back to skills`]}),(0,G.jsx)(pe,{skill:J,enabled:J.enabled,activation:Y,usedBy:ie(r.data?.workflows??[],J.name)})]}):n.isPending?null:(0,G.jsx)(H,{icon:(0,G.jsx)(S,{}),tone:`neutral`,heading:`h2`,title:`No skill selected`,subtitle:`Pick a skill from the catalog.`})})})]})}function Ce({skill:e,active:t,detailed:n,activation:r}){let i=j(e),a=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:_(`min-w-0 truncate font-mono text-ui`,e.enabled?`font-semibold text-foreground`:`font-medium text-muted-foreground`),children:e.name}),(0,G.jsx)(me,{source:e.source,teamRepo:e.team?.repo,className:`ml-auto`})]}),e.description?(0,G.jsx)(`span`,{"data-slot":`skill-description`,className:_(`text-label text-muted-foreground`,n?`whitespace-pre-line break-words`:`line-clamp-2`),children:e.description}):null]});return(0,G.jsxs)(`li`,{className:_(`flex min-w-0 items-start gap-0 rounded-md transition-colors hover:bg-muted`,t&&`bg-muted`),children:[r?(0,G.jsx)(A,{"data-slot":`skill-activation`,"aria-label":r.ariaLabel,checked:r.checked,disabled:r.disabled,onCheckedChange:r.onCheckedChange,size:`sm`,className:`mt-2.5 ml-2 shrink-0`}):null,(0,G.jsx)(b,{to:`/skills?skill=${encodeURIComponent(e.name)}`,"data-slot":`skill-row`,"data-skill":e.name,"data-project":i?`true`:void 0,"data-enabled":e.enabled?`true`:`false`,"aria-current":t?`page`:void 0,className:`flex min-w-0 flex-1 flex-col gap-0.5 px-2.5 py-2`,children:a})]})}export{xe as SkillsRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Di as r,Kt as i,Lr as a,Or as o,R as s,cn as c,ha as l,in as u,mr as d,pn as ee,qt as f,r as p,sa as m,vo as h,vr as g,xo as te}from"./queries-BQUz3Wnb.js";import{t as _}from"./utils-Dp6vCdiU.js";import{C as v,c as y,l as ne,t as b}from"./project-router-B1Q3upIJ.js";import{t as x}from"./createLucideIcon-BHp8sXmF.js";import{t as re}from"./arrow-left-BfRd_mrv.js";import{j as S}from"./run-actions-ChUnbFA7.js";import{t as C}from"./button-CJXK1JqU.js";import{i as w,n as T,o as E,s as D,t as O}from"./select-DL5E3ZAD.js";import{t as k}from"./circle-check-BpDFgE5h.js";import{n as A}from"./manager-avatar-CKfqcoJQ.js";import{C as ie,f as ae,g as oe,m as j,p as se}from"./composer-C-aBJhY0.js";import{t as ce}from"./refresh-cw-BIgmYimN.js";import{t as le}from"./triangle-alert-CIzim6ZN.js";import{t as M}from"./icon-tooltip-DYk5cjLx.js";import{a as N,i as P,n as F,o as I,r as L,t as R}from"./dialog-DVZE8yAO.js";import{a as ue,i as de}from"./loading-state-NiNQtJ5H.js";import{t as fe}from"./input-DofKzJZl.js";import{r as z}from"./toaster-BoJZiTRl.js";import{b as B,m as V}from"./telemetry-3DhVDxf8.js";import{t as H}from"./centered-state-DE6sgEMs.js";import{_ as U}from"./new-task-form-2p4cXcVQ.js";import{c as pe,u as me}from"./index-BfbbA0lF.js";var he=x(`list-chevrons-up-down`,[[`path`,{d:`M3 5h8`,key:`18g2rq`}],[`path`,{d:`M3 12h8`,key:`1xfjp6`}],[`path`,{d:`M3 19h8`,key:`fpbke4`}],[`path`,{d:`m15 8 3-3 3 3`,key:`bc4io6`}],[`path`,{d:`m15 16 3 3 3-3`,key:`9wmg1l`}]]),W=e(t(),1),G=n(),K=[`.ai/cezar/skills/`,`.ai/skills/`,`.agents/skills/`],q=[`.claude/commands/`,`.codex/prompts/`,`.github/prompts/`];function J({children:e}){return(0,G.jsx)(`span`,{className:`font-mono`,children:e})}function ge(){return(0,G.jsx)(G.Fragment,{children:K.map((e,t)=>(0,G.jsxs)(`span`,{children:[t>0?t===K.length-1?`, or `:`, `:``,(0,G.jsx)(J,{children:e})]},e))})}function _e(){return(0,G.jsxs)(G.Fragment,{children:[`No skills yet. Drop Markdown files into `,(0,G.jsx)(ge,{}),` (agent mirrors like`,` `,(0,G.jsx)(J,{children:`.claude/skills/`}),` work too) — optional frontmatter: `,(0,G.jsx)(J,{children:`name`}),`,`,` `,(0,G.jsx)(J,{children:`description`}),`. Global (`,(0,G.jsx)(J,{children:`~/.agents/skills`}),`) and team-repo skills appear here too — try Refresh. Repo commands (spec-kit's `,(0,G.jsx)(J,{children:q[0]}),`,`,` `,(0,G.jsx)(J,{children:q[1]}),`, `,(0,G.jsx)(J,{children:q[2]}),`, …) are listed too.`]})}var Y=2e3,X=5*6e4,Z=e=>e.tracked??e.skills;async function Q(e,t,n={}){let{apply:i=g,read:a=r,wait:o=e=>new Promise(t=>setTimeout(t,e)),now:s=Date.now,onDropped:c=B}=n;try{return await i(e)}catch(n){if(!(n instanceof d)||n.status!==0&&n.status!==409)throw n;let r=e=>{n.status===0&&c(e)},i=s()+X;for(;;){let c;try{c=await a(e)}catch{throw r(`unreachable`),n}if(c.status!==`updating`){if(c.updatedAt&&c.updatedAt!==t)return r(`recovered`),c;throw r(`not_applied`),n}if(s()>=i)throw r(`timed_out`),n;await o(Y)}}}function $(e){return e===`project`?`Project installation`:`Global installation`}function ve({projectId:e,state:t,loadError:n}){let r=te(),i=ne(),s=(0,W.useRef)(0),[c,l]=(0,W.useState)(!1),u=h({mutationFn:()=>a({task:`Apply the upgrade notes after updating the installed Open Mercato skills.`,steps:[{id:`apply-upgrade-notes`,name:`Apply upgrade notes`,skill:`om-apply-upgrade-notes`,prompt:`{{task}}`}]}),onSuccess:e=>{V(`skills_import`),l(!1),i(U(e))},onError:e=>z(e.message,{tone:`danger`})}),d=(t,n)=>{n.seq===s.current&&(r.setQueryData(ee.skillsUpdate(e),t),n.action===`apply`&&t.updatedAt&&t.updatedAt!==n.previousUpdatedAt&&(r.invalidateQueries({queryKey:p.skills}),z(t.status===`error`?`Some skill updates failed.`:`Open Mercato skills updated.`),l(!0)))},f=(e,t)=>{t.seq===s.current&&z(e.message,{tone:`danger`})},m=h({mutationFn:t=>o(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>d(e,t),onError:(e,t)=>f(e,t)}),g=h({mutationFn:t=>Q(e,t.previousUpdatedAt).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>d(e,t),onError:(e,t)=>f(e,t)}),v=e=>{let n=++s.current;e===`apply`?g.mutate({action:e,seq:n,previousUpdatedAt:t?.updatedAt??null}):m.mutate({action:e,seq:n})},y=t?.scopes??[],b=y.filter(e=>Z(e).length>0),x=b.length>0,re=y.some(e=>e.skills.length>0),S=t?.status===`error`,w=re&&(t?.available||S),T=g.isPending||t?.status===`updating`,E=y.filter(e=>e.status===`error`||e.status===`unavailable`),D=y.filter(e=>e.updatedAt&&!E.includes(e)),O=`Checking installed Open Mercato skills…`;return n?O=`Update status is unavailable right now.`:t?.status===`available`?O=`An update is available for your installed Open Mercato skills.`:t?.status===`updating`?O=`Updating installed Open Mercato skills…`:t?.status===`current`&&!x?O=t.needsUpgradeNotes?`Skill files were updated.`:`No installed Open Mercato skills are tracked for updates.`:t?.status===`current`?O=`Installed Open Mercato skills are up to date.`:t?.status===`unavailable`?O=t.scopes.find(e=>e.reason)?.reason??`Automatic updates are unavailable.`:t?.status===`error`&&(O=`The update did not finish for every installation.`),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`section`,{"data-slot":`skills-update-card`,"aria-live":`polite`,className:`rounded-lg border border-border bg-muted/30 p-3`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`text-ui font-medium text-foreground`,children:O}),t?.checkedAt?(0,G.jsxs)(`p`,{className:`mt-1 text-label text-muted-foreground`,children:[`Last checked `,new Date(t.checkedAt).toLocaleString(),`.`]}):null,b.length>0?(0,G.jsx)(`ul`,{className:`mt-1 text-label text-muted-foreground`,children:b.map(e=>(0,G.jsxs)(`li`,{children:[$(e.scope),` · `,Z(e).length,` tracked`]},e.scope))}):null,E.length>0?(0,G.jsxs)(`p`,{className:`mt-1 text-label text-danger`,children:[`Failed: `,E.map(e=>$(e.scope)).join(`, `),D.length?`; updated: `+D.map(e=>$(e.scope)).join(`, `):``,`.`]}):null]}),w?(0,G.jsxs)(C,{"data-action":`skills-update-apply`,size:`sm`,disabled:T,onClick:()=>v(`apply`),children:[(0,G.jsx)(ce,{"aria-hidden":`true`,className:_(`size-3.5`,T&&`motion-safe:animate-spin`)}),T?`Updating…`:S?`Retry`:`Update now`]}):t?.status===`current`?(0,G.jsx)(C,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:m.isPending,onClick:()=>v(`check`),children:`Check again`}):t?.status===`unavailable`||n?(0,G.jsx)(C,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:m.isPending,onClick:()=>v(`check`),children:`Retry check`}):null]}),t?.status===`unavailable`||n?(0,G.jsxs)(`div`,{className:`mt-2 text-label text-muted-foreground`,children:[`Manual examples: `,(0,G.jsx)(`code`,{children:`npx skills update -p`}),` · `,(0,G.jsx)(`code`,{children:`npx skills update -g`}),`. These broad commands may update other tracked sources.`]}):null,t?.needsUpgradeNotes?(0,G.jsxs)(`div`,{"data-slot":`skills-upgrade-notes`,className:`mt-3 flex gap-2 rounded-md border border-primary/30 bg-background p-2.5 text-xs text-foreground`,children:[(0,G.jsx)(k,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-primary`}),(0,G.jsxs)(`span`,{children:[`Skill files were updated. Run `,(0,G.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` in each configured repository to apply descriptor migrations while preserving local edits.`]})]}):null]}),(0,G.jsx)(R,{open:c,onOpenChange:e=>u.isPending?void 0:l(e),children:(0,G.jsxs)(F,{"data-slot":`skills-upgrade-notes-dialog`,showCloseButton:!1,children:[(0,G.jsxs)(N,{children:[(0,G.jsx)(I,{children:`Apply the upgrade notes now?`}),(0,G.jsxs)(L,{children:[`The skill files were updated successfully. Start a new session with`,` `,(0,G.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` to sync repository descriptors while preserving local edits?`]})]}),(0,G.jsxs)(P,{children:[(0,G.jsx)(C,{type:`button`,variant:`outline`,disabled:u.isPending,onClick:()=>l(!1),children:`No`}),(0,G.jsx)(C,{type:`button`,disabled:u.isPending,onClick:()=>u.mutate(),children:u.isPending?`Starting…`:`Yes, start session`})]})]})})]})}function ye(e,t){let n=e?.importedSkills;return Array.isArray(n)?n.filter(e=>typeof e==`string`&&!!e):[...t]}function be(e,t,n,r,i=!1){let a=e.source===`ai`||e.source===`cezar`||e.source===`agents`||e.source===`global`,o=e.source===`team`&&(t.has(e.name)||i);if(!(!a&&!o))return{ariaLabel:a?`${e.name} is always enabled`:`${e.enabled?`Disable`:`Enable`} ${e.name}`,checked:a||e.enabled,disabled:a||n||i,onCheckedChange:()=>r(e.name)}}function xe(){return(0,G.jsxs)(`div`,{"data-route":`skills`,className:`flex min-h-full flex-col`,children:[(0,G.jsxs)(`header`,{className:`sticky top-0 z-10 hidden h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-5 md:flex`,children:[(0,G.jsx)(`h1`,{className:`text-base font-semibold`,children:`Skills`}),(0,G.jsx)(`p`,{className:`text-ui text-muted-foreground`,children:`Markdown playbooks agents can follow.`})]}),(0,G.jsx)(Se,{})]})}function Se(){let e=y()??``,t=f(e,!!e),n=i(),r=c(),a=s(),[o]=v(),[d,ee]=(0,W.useState)(``),[g,ne]=(0,W.useState)(null),[x,k]=(0,W.useState)(!1),A=te(),j=u(),N=a.data??[],P=(0,W.useMemo)(()=>N.map(e=>e.name),[N]),F=(0,W.useMemo)(()=>new Set(P),[P]),I=(0,W.useMemo)(()=>new Set(ye(j.data,P)),[j.data,P]),L=(0,W.useRef)(Promise.resolve()),R=(0,W.useRef)(0),B=(0,W.useCallback)(t=>{let n=p.uiState,r=p.skills,i=A.getQueryData(n),a=ye(i,P),o=a.includes(t)?a.filter(e=>e!==t):[...a,t];A.setQueryData(n,{...i,importedSkills:o});let s=++R.current;L.current=L.current.then(async()=>{try{let t=await m({importedSkills:o},e);if(s!==R.current)return;A.setQueryData(n,t),A.invalidateQueries({queryKey:r})}catch(e){if(s!==R.current)return;z(e instanceof Error?e.message:String(e),{tone:`danger`}),A.invalidateQueries({queryKey:n})}})},[P,e,A]),V=h({mutationFn:()=>l(),onSuccess:e=>{A.setQueryData(p.skills,e),A.setQueryData(p.skillsReady,e),z(`Team skills refreshed.`)},onError:e=>z(e.message,{tone:`danger`})});if(n.isError)return(0,G.jsx)(H,{icon:(0,G.jsx)(le,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:n.error.message});let U=oe(n.data??[]),me=new Set(U.map(e=>e.name)),K=oe([...U.map(e=>({...e,enabled:e.source===`team`&&F.has(e.name)?I.has(e.name):!0})),...N.filter(e=>!me.has(e.name)).map(e=>({...e,enabled:I.has(e.name)}))].sort((e,t)=>e.name.localeCompare(t.name))),q=o.get(`skill`),J=K.find(e=>e.name===q)??(q===null?K.find(e=>e.enabled):null)??null,ge=J?.name??null,Y=J?be(J,F,j.isPending,B,a.isError):void 0,X=se(K),Z=X.map(e=>e.key),Q=g!==null&&Z.includes(g)?g:null,$=se(ae(Q===null?K:K.filter(e=>(e.team?.repo??``)===Q),d)),xe=$.flatMap(e=>e.skills);return(0,G.jsxs)(`div`,{"data-slot":`skills-section`,className:`flex min-h-full flex-1 items-stretch`,children:[(0,G.jsxs)(`section`,{"data-slot":`skills-list`,className:_(`w-full flex-col border-border md:flex md:shrink-0 md:border-r`,x?`md:w-[32rem]`:`md:w-96`,`md:sticky md:top-14 md:max-h-[calc(100dvh-(var(--spacing)*14))]`,q===null||!J?`flex`:`hidden md:flex`),children:[(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 p-3 pb-2`,children:[(0,G.jsx)(fe,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:d,onChange:e=>ee(e.target.value),className:`h-8 text-ui`}),(0,G.jsx)(M,{label:x?`Show short descriptions`:`Show full descriptions`,children:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`skills-detailed`,"aria-pressed":x,onClick:()=>k(e=>!e),className:`flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-label font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none aria-pressed:bg-muted aria-pressed:text-foreground`,children:[(0,G.jsx)(he,{"aria-hidden":`true`,className:`size-3`}),`Details`]})}),(0,G.jsx)(M,{label:`Fetch the team skills repos`,children:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,disabled:V.isPending,onClick:()=>V.mutate(),className:`flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-label font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[(0,G.jsx)(ce,{"aria-hidden":`true`,className:_(`size-3`,V.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})})]}),X.length>1?(0,G.jsx)(`div`,{className:`shrink-0 px-3 pb-2`,children:(0,G.jsxs)(O,{value:Q??`__all__`,onValueChange:e=>ne(e===`__all__`?null:e),children:[(0,G.jsx)(E,{"data-slot":`skills-repo-filter`,"aria-label":`Filter by repository`,size:`sm`,className:`w-full text-ui`,children:(0,G.jsx)(D,{})}),(0,G.jsxs)(T,{children:[(0,G.jsx)(w,{value:`__all__`,children:`All repositories`}),X.map(e=>(0,G.jsxs)(w,{value:e.key,children:[e.label,` (`,e.skills.length,`)`]},e.key))]})]})}):null,e?(0,G.jsx)(`div`,{className:`shrink-0 px-3 pb-2`,children:(0,G.jsx)(ve,{projectId:e,state:t.data,loadError:t.error})}):null,a.isError?(0,G.jsxs)(`div`,{"data-slot":`skills-importable-error`,role:`alert`,className:`mx-3 mb-2 flex shrink-0 items-center justify-between gap-3 rounded-md border border-danger/20 bg-danger/10 px-3 py-2 text-xs text-danger`,children:[(0,G.jsxs)(`p`,{className:`min-w-0`,children:[`Could not load the Open Mercato skills catalog. Team skills may be missing until it loads.`,` `,a.error.message]}),(0,G.jsx)(C,{type:`button`,"data-action":`skills-importable-retry`,variant:`ghost`,size:`sm`,disabled:a.isFetching,onClick:()=>void a.refetch(),children:`Retry`})]}):null,(0,G.jsx)(`ul`,{"data-slot":`skill-rows`,className:`min-h-0 flex-1 space-y-1 overflow-y-auto px-2 pb-2`,children:n.isPending?(0,G.jsx)(de,{as:`li`,label:`Loading skills…`,className:`list-none`,children:(0,G.jsx)(ue,{rows:5})}):xe.length>0?$.map(e=>(0,G.jsxs)(`li`,{"data-slot":`skill-group`,"data-group":e.key||`local`,className:`list-none`,children:[X.length>1?(0,G.jsx)(`h3`,{className:`px-2.5 pt-2 pb-1 eyebrow text-soft-foreground`,children:e.label}):null,(0,G.jsx)(`ul`,{className:`space-y-1`,children:e.skills.map(e=>(0,G.jsx)(Ce,{skill:e,active:ge===e.name,detailed:x,activation:be(e,F,j.isPending,B,a.isError)},e.name))})]},e.key)):(0,G.jsx)(`li`,{className:`px-2.5 py-2 text-label leading-relaxed text-muted-foreground`,children:K.length>0?`(no skills match)`:(0,G.jsx)(_e,{})})})]}),(0,G.jsx)(`section`,{"data-slot":`skills-detail`,className:_(`min-w-0 flex-1 flex-col`,q===null||!J?`hidden md:flex`:`flex`),children:(0,G.jsx)(`div`,{className:`min-w-0 flex-1 px-4 py-4 md:px-7 md:py-5`,children:J?(0,G.jsxs)(G.Fragment,{children:[q===null?null:(0,G.jsxs)(b,{to:`/skills`,"data-slot":`skills-back`,className:`mb-3 inline-flex items-center gap-1.5 text-label font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,G.jsx)(re,{"aria-hidden":`true`,className:`size-3.5`}),`Back to skills`]}),(0,G.jsx)(pe,{skill:J,enabled:J.enabled,activation:Y,usedBy:ie(r.data?.workflows??[],J.name)})]}):n.isPending?null:(0,G.jsx)(H,{icon:(0,G.jsx)(S,{}),tone:`neutral`,heading:`h2`,title:`No skill selected`,subtitle:`Pick a skill from the catalog.`})})})]})}function Ce({skill:e,active:t,detailed:n,activation:r}){let i=j(e),a=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:_(`min-w-0 truncate font-mono text-ui`,e.enabled?`font-semibold text-foreground`:`font-medium text-muted-foreground`),children:e.name}),(0,G.jsx)(me,{source:e.source,teamRepo:e.team?.repo,className:`ml-auto`})]}),e.description?(0,G.jsx)(`span`,{"data-slot":`skill-description`,className:_(`text-label text-muted-foreground`,n?`whitespace-pre-line break-words`:`line-clamp-2`),children:e.description}):null]});return(0,G.jsxs)(`li`,{className:_(`flex min-w-0 items-start gap-0 rounded-md transition-colors hover:bg-muted`,t&&`bg-muted`),children:[r?(0,G.jsx)(A,{"data-slot":`skill-activation`,"aria-label":r.ariaLabel,checked:r.checked,disabled:r.disabled,onCheckedChange:r.onCheckedChange,size:`sm`,className:`mt-2.5 ml-2 shrink-0`}):null,(0,G.jsx)(b,{to:`/skills?skill=${encodeURIComponent(e.name)}`,"data-slot":`skill-row`,"data-skill":e.name,"data-project":i?`true`:void 0,"data-enabled":e.enabled?`true`:`false`,"aria-current":t?`page`:void 0,className:`flex min-w-0 flex-1 flex-col gap-0.5 px-2.5 py-2`,children:a})]})}export{xe as SkillsRoute};
@@ -1 +1 @@
1
- import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DWwoYTjU.js";import{t as n}from"./loader-circle-CPBhhDbB.js";var r=e();function i({className:e,label:i,...a}){return(0,r.jsx)(n,{"data-slot":`spinner`,...i?{role:`status`,"aria-label":i}:{"aria-hidden":!0},className:t(`size-4 shrink-0 text-muted-foreground motion-safe:animate-spin`,e),...a})}export{i as t};
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-Dp6vCdiU.js";import{t as n}from"./loader-circle-CPBhhDbB.js";var r=e();function i({className:e,label:i,...a}){return(0,r.jsx)(n,{"data-slot":`spinner`,...i?{role:`status`,"aria-label":i}:{"aria-hidden":!0},className:t(`size-4 shrink-0 text-muted-foreground motion-safe:animate-spin`,e),...a})}export{i as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DWwoYTjU.js";import{B as i}from"./button-CEskWahs.js";var a=e(t(),1),o=null,s=0;function c(){return typeof IntersectionObserver>`u`?null:(o??=new IntersectionObserver(e=>{for(let t of e)t.target.toggleAttribute(`data-offscreen`,!t.isIntersecting)}),o)}function l(e){let t=c();return t?(t.observe(e),s+=1,()=>{t.unobserve(e),e.removeAttribute(`data-offscreen`),--s,s===0&&o===t&&(t.disconnect(),o=null)}):()=>{}}var u=n(),d=i(`inline-block size-[7px] shrink-0 rounded-full`,{variants:{tone:{success:`bg-success`,pending:`bg-pending`,danger:`bg-danger`,violet:`bg-violet`,info:`bg-info`,neutral:`bg-soft-foreground`,idle:`bg-conflict`},pulse:{true:`animate-pulse motion-reduce:animate-none data-offscreen:[animation-play-state:paused]`,false:``}},defaultVariants:{tone:`neutral`,pulse:!1}});function f({className:e,tone:t=`neutral`,pulse:n=!1,ref:i,...o}){let s=a.useRef(null);return a.useEffect(()=>{if(!(!n||!s.current))return l(s.current)},[n]),(0,u.jsx)(`span`,{ref:a.useCallback(e=>{s.current=e,typeof i==`function`?i(e):i&&(i.current=e)},[i]),"data-slot":`status-dot`,"data-tone":t,className:r(d({tone:t,pulse:n,className:e})),...o})}export{f as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-Dp6vCdiU.js";import{B as i}from"./button-CJXK1JqU.js";var a=e(t(),1),o=null,s=0;function c(){return typeof IntersectionObserver>`u`?null:(o??=new IntersectionObserver(e=>{for(let t of e)t.target.toggleAttribute(`data-offscreen`,!t.isIntersecting)}),o)}function l(e){let t=c();return t?(t.observe(e),s+=1,()=>{t.unobserve(e),e.removeAttribute(`data-offscreen`),--s,s===0&&o===t&&(t.disconnect(),o=null)}):()=>{}}var u=n(),d=i(`inline-block size-[7px] shrink-0 rounded-full`,{variants:{tone:{success:`bg-success`,pending:`bg-pending`,danger:`bg-danger`,violet:`bg-violet`,info:`bg-info`,neutral:`bg-soft-foreground`,idle:`bg-conflict`},pulse:{true:`animate-pulse motion-reduce:animate-none data-offscreen:[animation-play-state:paused]`,false:``}},defaultVariants:{tone:`neutral`,pulse:!1}});function f({className:e,tone:t=`neutral`,pulse:n=!1,ref:i,...o}){let s=a.useRef(null);return a.useEffect(()=>{if(!(!n||!s.current))return l(s.current)},[n]),(0,u.jsx)(`span`,{ref:a.useCallback(e=>{s.current=e,typeof i==`function`?i(e):i&&(i.current=e)},[i]),"data-slot":`status-dot`,"data-tone":t,className:r(d({tone:t,pulse:n,className:e})),...o})}export{f as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DWwoYTjU.js";import{A as i,B as a,D as o,E as s,N as c,T as l,k as u}from"./button-CEskWahs.js";import{t as d}from"./dist-B_KqW6o6.js";import{g as f,h as p,m}from"./dropdown-menu-ayNafd3n.js";var h=e(t(),1),g=n(),_=`Tabs`,[v,y]=i(_,[f]),b=f(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:s=`horizontal`,dir:u,activationMode:f=`automatic`,...p}=e,m=d(u),[h,v]=o({prop:r,onChange:i,defaultProp:a??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:l(),value:h,onValueChange:v,orientation:s,dir:m,activationMode:f,children:(0,g.jsx)(c.div,{dir:m,"data-orientation":s,...p,ref:t})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=S(w,n),o=b(n);return(0,g.jsx)(p,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,g.jsx)(c.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=S(E,n),s=b(n),l=A(o.baseId,r),d=j(o.baseId,r),f=r===o.value;return(0,g.jsx)(m,{asChild:!0,...s,focusable:!i,active:f,children:(0,g.jsx)(c.button,{type:`button`,role:`tab`,"aria-selected":f,"aria-controls":d,"data-state":f?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:l,...a,ref:t,onMouseDown:u(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:u(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:u(e.onFocus,()=>{let e=o.activationMode!==`manual`;!f&&!i&&e&&o.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,l=S(O,n),u=A(l.baseId,r),d=j(l.baseId,r),f=r===l.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(s,{present:i||f,children:({present:n})=>(0,g.jsx)(c.div,{"data-state":f?`active`:`inactive`,"data-orientation":l.orientation,role:`tabpanel`,"aria-labelledby":u,hidden:!n,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&a})})});k.displayName=O;function A(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}var M=C,N=T,P=D,F=k;function I({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(M,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:r(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var L=a(`group/tabs-list inline-flex w-fit items-center justify-center rounded-md p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function R({className:e,variant:t=`default`,...n}){return(0,g.jsx)(N,{"data-slot":`tabs-list`,"data-variant":t,className:r(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:r(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-sm border border-transparent px-3 py-1 text-label font-medium whitespace-nowrap text-muted-foreground transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-xs group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-card data-[state=active]:font-semibold data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function B({className:e,...t}){return(0,g.jsx)(F,{"data-slot":`tabs-content`,className:r(`flex-1 outline-none`,e),...t})}export{z as i,B as n,R as r,I as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-Dp6vCdiU.js";import{A as i,B as a,D as o,E as s,N as c,T as l,k as u}from"./button-CJXK1JqU.js";import{t as d}from"./dist-Bsi6zLdE.js";import{g as f,h as p,m}from"./dropdown-menu-BKvUsb5Y.js";var h=e(t(),1),g=n(),_=`Tabs`,[v,y]=i(_,[f]),b=f(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:s=`horizontal`,dir:u,activationMode:f=`automatic`,...p}=e,m=d(u),[h,v]=o({prop:r,onChange:i,defaultProp:a??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:l(),value:h,onValueChange:v,orientation:s,dir:m,activationMode:f,children:(0,g.jsx)(c.div,{dir:m,"data-orientation":s,...p,ref:t})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=S(w,n),o=b(n);return(0,g.jsx)(p,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,g.jsx)(c.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=S(E,n),s=b(n),l=A(o.baseId,r),d=j(o.baseId,r),f=r===o.value;return(0,g.jsx)(m,{asChild:!0,...s,focusable:!i,active:f,children:(0,g.jsx)(c.button,{type:`button`,role:`tab`,"aria-selected":f,"aria-controls":d,"data-state":f?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:l,...a,ref:t,onMouseDown:u(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:u(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:u(e.onFocus,()=>{let e=o.activationMode!==`manual`;!f&&!i&&e&&o.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,l=S(O,n),u=A(l.baseId,r),d=j(l.baseId,r),f=r===l.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(s,{present:i||f,children:({present:n})=>(0,g.jsx)(c.div,{"data-state":f?`active`:`inactive`,"data-orientation":l.orientation,role:`tabpanel`,"aria-labelledby":u,hidden:!n,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&a})})});k.displayName=O;function A(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}var M=C,N=T,P=D,F=k;function I({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(M,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:r(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var L=a(`group/tabs-list inline-flex w-fit items-center justify-center rounded-md p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function R({className:e,variant:t=`default`,...n}){return(0,g.jsx)(N,{"data-slot":`tabs-list`,"data-variant":t,className:r(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:r(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-sm border border-transparent px-3 py-1 text-label font-medium whitespace-nowrap text-muted-foreground transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-xs group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-card data-[state=active]:font-semibold data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function B({className:e,...t}){return(0,g.jsx)(F,{"data-slot":`tabs-content`,className:r(`flex-1 outline-none`,e),...t})}export{z as i,B as n,R as r,I as t};
@@ -1 +1 @@
1
- import{n as e,r as t}from"./rolldown-runtime-QTnfLwEv.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{Dt as i,Et as a,St as o,mr as s}from"./queries-DVZ1lYAo.js";import{t as c}from"./utils-DWwoYTjU.js";import{S as l,t as u}from"./project-router-CnMbTz-a.js";import{t as d}from"./use-desktop-BNN3U2y9.js";import{n as f,r as p,t as m}from"./git-tab-loading-DG4p-eF4.js";import{t as h}from"./arrow-left-BfRd_mrv.js";import{y as g}from"./run-actions-CDKK-8MP.js";import{t as _}from"./button-CEskWahs.js";import{p as v}from"./impact-model-CpNcUgTV.js";import{n as y}from"./upload-BE8GV7hh.js";import{t as b}from"./search-x-I9Q8pgUa.js";import{t as x}from"./triangle-alert-CIzim6ZN.js";import{t as S}from"./diff-stat-zisAayZW.js";import{t as C}from"./centered-state-Cpzaj75Y.js";import{t as w}from"./diff-FrEDv09S.js";import{t as T}from"./commit-list-BSjLQA6p.js";var E=t(n(),1),D=new Map,O=new Map;function k(e,t){D.set(e,t);for(let n of O.get(e)??[])n(t)}function A(e,t){let n=()=>e!==void 0&&D.has(e)?D.get(e):t,[r,i]=(0,E.useState)(n),a=(0,E.useRef)(e);return a.current!==e&&(a.current=e,i(n())),(0,E.useEffect)(()=>{if(e===void 0)return;let t=e=>i(e),n=O.get(e)??new Set;return n.add(t),O.set(e,n),()=>{n.delete(t),n.size===0&&O.delete(e)}},[e]),[r,(0,E.useCallback)(t=>{e!==void 0&&D.set(e,t),i(t)},[e])]}var j=e({CommitsView:()=>P,TaskCommitsRoute:()=>N}),M=r();function N(){let{id:e}=l(),t=o(e);return t.isPending?(0,M.jsx)(f,{tab:`changes`}):t.isError?(0,M.jsx)(m,{tab:`changes`,error:t.error}):(0,M.jsx)(P,{run:t.data})}function P({run:e,embedded:t=!1,stateKey:n}){let{sha:r}=l(),[a,o]=A(n,null),u=t?a??void 0:r,d=i(e.id,g(e.status));return(0,M.jsxs)(`div`,{"data-route":`task-commits`,className:c(`flex min-h-full flex-col`,u&&`md:h-full`),children:[t?null:(0,M.jsx)(p,{run:e,tab:`commits`}),u?(0,M.jsxs)(M.Fragment,{children:[t?(0,M.jsx)(`div`,{className:`shrink-0 border-b border-border px-4 py-1.5 md:px-6`,children:(0,M.jsxs)(_,{variant:`ghost`,size:`xs`,"data-action":`all-commits`,onClick:()=>o(null),children:[(0,M.jsx)(h,{"aria-hidden":`true`}),`All commits`]})}):null,(0,M.jsx)(F,{runId:e.id,sha:u},u)]}):d.isPending?(0,M.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-label text-soft-foreground md:px-6`,children:`Loading commits…`}):d.isError?(0,M.jsx)(C,{icon:(0,M.jsx)(y,{}),tone:d.error instanceof s&&d.error.status===409?`neutral`:`danger`,heading:`h2`,title:d.error instanceof s&&d.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:d.error.message}):d.data.commits.length===0?(0,M.jsx)(C,{icon:(0,M.jsx)(y,{}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`This task hasn't committed anything on its branch. Autosave commits and any the agent makes appear here.`}):(0,M.jsx)(T,{slot:`task-commits`,className:`mx-auto w-full max-w-[var(--measure)]`,commits:d.data.commits.map(t=>({...t,shaLabel:t.sha.slice(0,8),href:`/tasks/${e.id}/commits/${t.sha}`})),onSelect:t?o:void 0})]})}function F({runId:e,sha:t}){let n=a(e,t),r=d(),[i,o]=(0,E.useState)(`unified`),[c,l]=(0,E.useState)(!1),f=n.isError&&n.error instanceof s&&n.error.status===409,p=r?i:`unified`,m=!r||c;return(0,M.jsxs)(`section`,{"data-slot":`task-commit`,"data-sha":t,className:`mx-auto flex min-h-0 w-full max-w-[var(--measure)] flex-1 flex-col`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,M.jsx)(_,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,M.jsxs)(u,{to:`/tasks/${e}/commits`,children:[(0,M.jsx)(h,{"aria-hidden":`true`}),`All commits`]})}),n.data?(0,M.jsx)(S,{stat:n.data.stat}):null,(0,M.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,M.jsx)(v,{mode:i,wrap:c,onModeChange:o,onWrapChange:l})})]}),n.isPending?(0,M.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-label text-soft-foreground md:px-6`,children:`Loading commit…`}):n.isError?(0,M.jsx)(C,{icon:f?(0,M.jsx)(b,{}):(0,M.jsx)(x,{}),tone:f?`neutral`:`danger`,heading:`h2`,title:f?`Commit not found`:`Could not load the commit`,subtitle:n.error.message}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,M.jsx)(`h2`,{className:`text-sm font-semibold`,children:n.data.subject}),(0,M.jsxs)(`p`,{className:`mt-0.5 text-meta text-soft-foreground`,children:[n.data.author,` · `,n.data.when,` ·`,` `,(0,M.jsx)(`span`,{className:`font-mono select-all`,children:n.data.sha})]})]}),n.data.files.length===0?(0,M.jsx)(C,{icon:(0,M.jsx)(y,{}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,M.jsx)(`div`,{"data-slot":`diff-pane`,"data-diff-scroller":r?``:void 0,className:`px-4 md:min-h-0 md:flex-1 md:overflow-y-auto md:overscroll-contain md:px-6`,children:(0,M.jsx)(w,{files:n.data.files,mode:p,wrap:m,className:`min-w-0 py-4`})})]})]})}export{A as i,j as n,k as r,P as t};
1
+ import{n as e,r as t}from"./rolldown-runtime-QTnfLwEv.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{Dt as i,Et as a,St as o,mr as s}from"./queries-BQUz3Wnb.js";import{t as c}from"./utils-Dp6vCdiU.js";import{S as l,t as u}from"./project-router-B1Q3upIJ.js";import{t as d}from"./use-desktop-BNN3U2y9.js";import{n as f,r as p,t as m}from"./git-tab-loading-DpG2D8Vl.js";import{t as h}from"./arrow-left-BfRd_mrv.js";import{y as g}from"./run-actions-ChUnbFA7.js";import{t as _}from"./button-CJXK1JqU.js";import{p as v}from"./impact-model-DCDyRxcf.js";import{n as y}from"./upload-BE8GV7hh.js";import{t as b}from"./search-x-I9Q8pgUa.js";import{t as x}from"./triangle-alert-CIzim6ZN.js";import{t as S}from"./diff-stat-DPetRUXO.js";import{t as C}from"./centered-state-DE6sgEMs.js";import{t as w}from"./diff-aKT-mpn8.js";import{t as T}from"./commit-list-BJeaIEp4.js";var E=t(n(),1),D=new Map,O=new Map;function k(e,t){D.set(e,t);for(let n of O.get(e)??[])n(t)}function A(e,t){let n=()=>e!==void 0&&D.has(e)?D.get(e):t,[r,i]=(0,E.useState)(n),a=(0,E.useRef)(e);return a.current!==e&&(a.current=e,i(n())),(0,E.useEffect)(()=>{if(e===void 0)return;let t=e=>i(e),n=O.get(e)??new Set;return n.add(t),O.set(e,n),()=>{n.delete(t),n.size===0&&O.delete(e)}},[e]),[r,(0,E.useCallback)(t=>{e!==void 0&&D.set(e,t),i(t)},[e])]}var j=e({CommitsView:()=>P,TaskCommitsRoute:()=>N}),M=r();function N(){let{id:e}=l(),t=o(e);return t.isPending?(0,M.jsx)(f,{tab:`changes`}):t.isError?(0,M.jsx)(m,{tab:`changes`,error:t.error}):(0,M.jsx)(P,{run:t.data})}function P({run:e,embedded:t=!1,stateKey:n}){let{sha:r}=l(),[a,o]=A(n,null),u=t?a??void 0:r,d=i(e.id,g(e.status));return(0,M.jsxs)(`div`,{"data-route":`task-commits`,className:c(`flex min-h-full flex-col`,u&&`md:h-full`),children:[t?null:(0,M.jsx)(p,{run:e,tab:`commits`}),u?(0,M.jsxs)(M.Fragment,{children:[t?(0,M.jsx)(`div`,{className:`shrink-0 border-b border-border px-4 py-1.5 md:px-6`,children:(0,M.jsxs)(_,{variant:`ghost`,size:`xs`,"data-action":`all-commits`,onClick:()=>o(null),children:[(0,M.jsx)(h,{"aria-hidden":`true`}),`All commits`]})}):null,(0,M.jsx)(F,{runId:e.id,sha:u},u)]}):d.isPending?(0,M.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-label text-soft-foreground md:px-6`,children:`Loading commits…`}):d.isError?(0,M.jsx)(C,{icon:(0,M.jsx)(y,{}),tone:d.error instanceof s&&d.error.status===409?`neutral`:`danger`,heading:`h2`,title:d.error instanceof s&&d.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:d.error.message}):d.data.commits.length===0?(0,M.jsx)(C,{icon:(0,M.jsx)(y,{}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`This task hasn't committed anything on its branch. Autosave commits and any the agent makes appear here.`}):(0,M.jsx)(T,{slot:`task-commits`,className:`mx-auto w-full max-w-[var(--measure)]`,commits:d.data.commits.map(t=>({...t,shaLabel:t.sha.slice(0,8),href:`/tasks/${e.id}/commits/${t.sha}`})),onSelect:t?o:void 0})]})}function F({runId:e,sha:t}){let n=a(e,t),r=d(),[i,o]=(0,E.useState)(`unified`),[c,l]=(0,E.useState)(!1),f=n.isError&&n.error instanceof s&&n.error.status===409,p=r?i:`unified`,m=!r||c;return(0,M.jsxs)(`section`,{"data-slot":`task-commit`,"data-sha":t,className:`mx-auto flex min-h-0 w-full max-w-[var(--measure)] flex-1 flex-col`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,M.jsx)(_,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,M.jsxs)(u,{to:`/tasks/${e}/commits`,children:[(0,M.jsx)(h,{"aria-hidden":`true`}),`All commits`]})}),n.data?(0,M.jsx)(S,{stat:n.data.stat}):null,(0,M.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,M.jsx)(v,{mode:i,wrap:c,onModeChange:o,onWrapChange:l})})]}),n.isPending?(0,M.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-label text-soft-foreground md:px-6`,children:`Loading commit…`}):n.isError?(0,M.jsx)(C,{icon:f?(0,M.jsx)(b,{}):(0,M.jsx)(x,{}),tone:f?`neutral`:`danger`,heading:`h2`,title:f?`Commit not found`:`Could not load the commit`,subtitle:n.error.message}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,M.jsx)(`h2`,{className:`text-sm font-semibold`,children:n.data.subject}),(0,M.jsxs)(`p`,{className:`mt-0.5 text-meta text-soft-foreground`,children:[n.data.author,` · `,n.data.when,` ·`,` `,(0,M.jsx)(`span`,{className:`font-mono select-all`,children:n.data.sha})]})]}),n.data.files.length===0?(0,M.jsx)(C,{icon:(0,M.jsx)(y,{}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,M.jsx)(`div`,{"data-slot":`diff-pane`,"data-diff-scroller":r?``:void 0,className:`px-4 md:min-h-0 md:flex-1 md:overflow-y-auto md:overscroll-contain md:px-6`,children:(0,M.jsx)(w,{files:n.data.files,mode:p,wrap:m,className:`min-w-0 py-4`})})]})]})}export{A as i,j as n,k as r,P as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Qn as r,St as i,rr as a}from"./queries-DVZ1lYAo.js";import{t as o}from"./project-router-CnMbTz-a.js";import{r as s}from"./git-tab-loading-DG4p-eF4.js";import{t as c}from"./workflow-BEP63Wt4.js";import{t as l}from"./external-link-BE6y205O.js";import{t as u}from"./centered-state-Cpzaj75Y.js";import{FloatingPanel as d,a as f,c as p,d as m,f as h,g,h as _,i as v,l as y,m as b,n as x,o as S,p as C,r as w,s as T,t as E,u as D}from"./workflow-graph-BaZd6m6v.js";var O=e(t(),1),k=n();function A({data:e}){let{node:t,state:n,childRunId:r}=e;return r?(0,k.jsx)(j,{node:t,state:n,childRunId:r}):(0,k.jsx)(E,{node:t,connectable:!1,status:n.status,loopCount:n.loopCount,iterations:n.iterations,costUsd:n.costUsd})}function j({node:e,state:t,childRunId:n}){let r=i(n).data,a=r?N(r):void 0,o=r&&r.steps.length>1?r.steps.map(e=>({id:e.id,name:e.name??e.id,status:e.id===a?.stepId?a.as:e.status})):void 0;return(0,k.jsx)(E,{node:e,connectable:!1,status:t.status,costUsd:r?.costUsd??t.costUsd,inner:o,subtaskTo:`/tasks/${n}/graph`})}var M={live:A};function N(e){let t=a(e),n=t?r(e.steps):void 0;return t&&n?{stepId:n,as:t}:void 0}function P({run:e,embedded:t=!1}){let n=e.workflowDef,r=(0,O.useMemo)(()=>n?S(n):null,[n]),i=(0,O.useMemo)(()=>r?D(r,e,{closing:N(e)}):null,[r,e]),[a,o]=(0,O.useState)(null),l=r?.nodes.find(e=>e.id===a),w=(0,O.useMemo)(()=>r&&i?r.nodes.map(t=>({id:t.id,type:`live`,position:r.layout?.[t.id]??{x:0,y:0},draggable:!1,connectable:!1,data:{node:t,state:i.nodes.get(t.id)??{status:`pending`},...F(e,t.id)}})):[],[r,i]),E=(0,O.useMemo)(()=>r?T(r):new Set,[r]),A=(0,O.useMemo)(()=>r?x(r,E):new Map,[r,E]),j=(0,O.useMemo)(()=>!r||!i?[]:r.nodes.flatMap(e=>y(e).flatMap(t=>{let n=m(r,e.id,t);if(!n)return[];let a=`${e.id}.${t}->${n}`,o=i.edges.get(a)??0,s=E.has(`${e.id}.${t}->${n}`),c=(r.layout?.[n]?.x??0)<=(r.layout?.[e.id]?.x??0),l=v({tone:p(e,t),back:s,emphasis:o?`taken`:`dim`});return[{id:a,source:e.id,sourceHandle:t,target:n,type:s||c||A.has(a)?`lane`:`default`,...A.has(a)?{data:{lane:A.get(a)}}:{},label:o>1?`×${o}`:void 0,style:l,markerEnd:{type:g.ArrowClosed,color:l.stroke,width:14,height:14},labelStyle:{fill:`var(--muted-foreground)`,fontSize:10,fontWeight:600},labelBgStyle:{fill:`var(--background)`}}]})),[r,i,E,A]);return(0,k.jsxs)(`div`,{"data-route":`task-graph`,className:`flex h-full min-h-0 flex-col`,children:[t?null:(0,k.jsx)(s,{run:e,tab:`graph`}),r?(0,k.jsxs)(`div`,{className:`relative min-h-[420px] flex-1`,children:[(0,k.jsxs)(_,{nodes:w,edges:j,nodeTypes:M,edgeTypes:f,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,onNodeClick:(e,t)=>o(t.id),onPaneClick:()=>o(null),fitView:!0,fitViewOptions:{padding:.2,maxZoom:1.2},minZoom:.2,colorMode:`system`,proOptions:{hideAttribution:!0},children:[(0,k.jsx)(h,{variant:C.Dots,gap:18,size:1}),(0,k.jsx)(b,{showInteractive:!1})]}),l&&i?(0,k.jsx)(d,{side:`right`,label:`Node details`,title:l.name??l.id,onClose:()=>o(null),children:(0,k.jsx)(I,{state:i.nodes.get(l.id)??{status:`pending`},outputs:e.graphState?.outputs?.[l.id],childRunId:F(e,l.id).childRunId,loopMax:l.type===`loop`?l.max:void 0})}):null]}):(0,k.jsx)(u,{icon:(0,k.jsx)(c,{}),tone:`neutral`,title:`No workflow graph`,subtitle:`This task has no stored workflow definition to draw.`})]})}function F(e,t){let n=e.graphState?.outputs?.[t]?.runId;return typeof n==`string`&&n?{childRunId:n}:{}}function I({state:e,outputs:t,loopMax:n,childRunId:r}){let i=[[`status`,e.status===`reached`?`passed through`:w(e.status)]];e.iterations&&i.push([`runs`,String(e.iterations)]),e.costUsd&&i.push([`cost`,`$${e.costUsd.toFixed(2)}`]),e.loopCount!==void 0&&i.push([`iterations`,`${e.loopCount}${n?` / ${n}`:``}`]);let a=Object.entries(t??{}).filter(([,e])=>e!==``);return(0,k.jsxs)(`div`,{className:`space-y-4 p-4 text-label`,children:[(0,k.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1`,children:i.map(([e,t])=>(0,k.jsxs)(`div`,{className:`contents`,children:[(0,k.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,k.jsx)(`dd`,{children:t})]},e))}),r?(0,k.jsxs)(o,{to:`/tasks/${r}`,className:`inline-flex items-center gap-1 text-primary hover:underline`,children:[`Open the subtask `,(0,k.jsx)(l,{className:`size-3`})]}):null,(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`mb-1 eyebrow text-muted-foreground`,children:`Outputs`}),a.length===0?(0,k.jsx)(`p`,{className:`text-meta text-muted-foreground`,children:`Nothing yet — outputs appear once the node has run.`}):a.map(([e,t])=>(0,k.jsxs)(`div`,{className:`mb-2`,children:[(0,k.jsx)(`code`,{className:`text-meta text-muted-foreground`,children:e}),(0,k.jsx)(`pre`,{className:`mt-0.5 max-h-48 overflow-auto rounded-md bg-muted/40 p-2 text-meta whitespace-pre-wrap`,children:String(t)})]},e))]})]})}export{P as TaskGraphView};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Qn as r,St as i,rr as a}from"./queries-BQUz3Wnb.js";import{t as o}from"./project-router-B1Q3upIJ.js";import{r as s}from"./git-tab-loading-DpG2D8Vl.js";import{t as c}from"./workflow-BEP63Wt4.js";import{t as l}from"./external-link-BE6y205O.js";import{t as u}from"./centered-state-DE6sgEMs.js";import{FloatingPanel as d,a as f,c as p,d as m,f as h,g,h as _,i as v,l as y,m as b,n as x,o as S,p as C,r as w,s as T,t as E,u as D}from"./workflow-graph-CGMeFErv.js";var O=e(t(),1),k=n();function A({data:e}){let{node:t,state:n,childRunId:r}=e;return r?(0,k.jsx)(j,{node:t,state:n,childRunId:r}):(0,k.jsx)(E,{node:t,connectable:!1,status:n.status,loopCount:n.loopCount,iterations:n.iterations,costUsd:n.costUsd})}function j({node:e,state:t,childRunId:n}){let r=i(n).data,a=r?N(r):void 0,o=r&&r.steps.length>1?r.steps.map(e=>({id:e.id,name:e.name??e.id,status:e.id===a?.stepId?a.as:e.status})):void 0;return(0,k.jsx)(E,{node:e,connectable:!1,status:t.status,costUsd:r?.costUsd??t.costUsd,inner:o,subtaskTo:`/tasks/${n}/graph`})}var M={live:A};function N(e){let t=a(e),n=t?r(e.steps):void 0;return t&&n?{stepId:n,as:t}:void 0}function P({run:e,embedded:t=!1}){let n=e.workflowDef,r=(0,O.useMemo)(()=>n?S(n):null,[n]),i=(0,O.useMemo)(()=>r?D(r,e,{closing:N(e)}):null,[r,e]),[a,o]=(0,O.useState)(null),l=r?.nodes.find(e=>e.id===a),w=(0,O.useMemo)(()=>r&&i?r.nodes.map(t=>({id:t.id,type:`live`,position:r.layout?.[t.id]??{x:0,y:0},draggable:!1,connectable:!1,data:{node:t,state:i.nodes.get(t.id)??{status:`pending`},...F(e,t.id)}})):[],[r,i]),E=(0,O.useMemo)(()=>r?T(r):new Set,[r]),A=(0,O.useMemo)(()=>r?x(r,E):new Map,[r,E]),j=(0,O.useMemo)(()=>!r||!i?[]:r.nodes.flatMap(e=>y(e).flatMap(t=>{let n=m(r,e.id,t);if(!n)return[];let a=`${e.id}.${t}->${n}`,o=i.edges.get(a)??0,s=E.has(`${e.id}.${t}->${n}`),c=(r.layout?.[n]?.x??0)<=(r.layout?.[e.id]?.x??0),l=v({tone:p(e,t),back:s,emphasis:o?`taken`:`dim`});return[{id:a,source:e.id,sourceHandle:t,target:n,type:s||c||A.has(a)?`lane`:`default`,...A.has(a)?{data:{lane:A.get(a)}}:{},label:o>1?`×${o}`:void 0,style:l,markerEnd:{type:g.ArrowClosed,color:l.stroke,width:14,height:14},labelStyle:{fill:`var(--muted-foreground)`,fontSize:10,fontWeight:600},labelBgStyle:{fill:`var(--background)`}}]})),[r,i,E,A]);return(0,k.jsxs)(`div`,{"data-route":`task-graph`,className:`flex h-full min-h-0 flex-col`,children:[t?null:(0,k.jsx)(s,{run:e,tab:`graph`}),r?(0,k.jsxs)(`div`,{className:`relative min-h-[420px] flex-1`,children:[(0,k.jsxs)(_,{nodes:w,edges:j,nodeTypes:M,edgeTypes:f,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,onNodeClick:(e,t)=>o(t.id),onPaneClick:()=>o(null),fitView:!0,fitViewOptions:{padding:.2,maxZoom:1.2},minZoom:.2,colorMode:`system`,proOptions:{hideAttribution:!0},children:[(0,k.jsx)(h,{variant:C.Dots,gap:18,size:1}),(0,k.jsx)(b,{showInteractive:!1})]}),l&&i?(0,k.jsx)(d,{side:`right`,label:`Node details`,title:l.name??l.id,onClose:()=>o(null),children:(0,k.jsx)(I,{state:i.nodes.get(l.id)??{status:`pending`},outputs:e.graphState?.outputs?.[l.id],childRunId:F(e,l.id).childRunId,loopMax:l.type===`loop`?l.max:void 0})}):null]}):(0,k.jsx)(u,{icon:(0,k.jsx)(c,{}),tone:`neutral`,title:`No workflow graph`,subtitle:`This task has no stored workflow definition to draw.`})]})}function F(e,t){let n=e.graphState?.outputs?.[t]?.runId;return typeof n==`string`&&n?{childRunId:n}:{}}function I({state:e,outputs:t,loopMax:n,childRunId:r}){let i=[[`status`,e.status===`reached`?`passed through`:w(e.status)]];e.iterations&&i.push([`runs`,String(e.iterations)]),e.costUsd&&i.push([`cost`,`$${e.costUsd.toFixed(2)}`]),e.loopCount!==void 0&&i.push([`iterations`,`${e.loopCount}${n?` / ${n}`:``}`]);let a=Object.entries(t??{}).filter(([,e])=>e!==``);return(0,k.jsxs)(`div`,{className:`space-y-4 p-4 text-label`,children:[(0,k.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1`,children:i.map(([e,t])=>(0,k.jsxs)(`div`,{className:`contents`,children:[(0,k.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,k.jsx)(`dd`,{children:t})]},e))}),r?(0,k.jsxs)(o,{to:`/tasks/${r}`,className:`inline-flex items-center gap-1 text-primary hover:underline`,children:[`Open the subtask `,(0,k.jsx)(l,{className:`size-3`})]}):null,(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`mb-1 eyebrow text-muted-foreground`,children:`Outputs`}),a.length===0?(0,k.jsx)(`p`,{className:`text-meta text-muted-foreground`,children:`Nothing yet — outputs appear once the node has run.`}):a.map(([e,t])=>(0,k.jsxs)(`div`,{className:`mb-2`,children:[(0,k.jsx)(`code`,{className:`text-meta text-muted-foreground`,children:e}),(0,k.jsx)(`pre`,{className:`mt-0.5 max-h-48 overflow-auto rounded-md bg-muted/40 p-2 text-meta whitespace-pre-wrap`,children:String(t)})]},e))]})]})}export{P as TaskGraphView};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{F as r,Mt as i,St as a,wt as o}from"./queries-DVZ1lYAo.js";import{t as s}from"./utils-DWwoYTjU.js";import{S as c,l}from"./project-router-CnMbTz-a.js";import{A as u,I as d,O as f,T as p,n as m,r as h,t as g}from"./git-tab-loading-DG4p-eF4.js";import{A as _,c as v}from"./thread-items-CNxMLcOo.js";import{t as y}from"./markdown-LlPZylt7.js";var b=e(t(),1),x=n();function S(){let{id:e}=c(),t=a(e);return t.isPending?(0,x.jsx)(m,{tab:`notes`}):t.isError?(0,x.jsx)(g,{tab:`notes`,error:t.error}):(0,x.jsxs)(`div`,{"data-route":`task-notes`,className:`flex min-h-full flex-col`,children:[(0,x.jsx)(C,{run:t.data}),(0,x.jsx)(`div`,{className:`mx-auto w-full max-w-[var(--measure)] px-3 py-3 md:px-6 md:py-5`,children:(0,x.jsx)(T,{runId:t.data.id})})]})}function C({run:e}){let t=l(),n=r().data?.capabilities?.terminal===!0,i=(0,b.useMemo)(()=>u.filter(t=>(t!==`graph`||!!e.workflowDef)&&(t!==`terminal`||n)),[e.workflowDef,n]),{hints:a,show:s}=f((0,b.useMemo)(()=>p(i),[i])),c=o(e.id).data?.artifacts?.length??0,m=e.diffStat?.files??0;return(0,x.jsx)(h,{run:e,tab:`notes`,tabs:(0,b.useMemo)(()=>(0,x.jsx)(_,{keyHints:a,showKeyHints:s,layouts:[],active:``,fixedViews:i,onSelectFixed:n=>t(`/tasks/${e.id}/${d[n]}`),onSelect:w,onClose:w,notesHref:`/tasks/${e.id}/notes`,notesActive:!0,showLayouts:!1,badges:c>0||m>0?{...c>0?{assets:c}:{},...m>0?{changes:m}:{}}:void 0}),[i,t,e.id,a,s,c,m]),wide:!0})}var w=()=>{};function T({runId:e}){let t=i(e);return(0,x.jsx)(`div`,{"data-slot":`notes-panel`,className:s(`leading-[1.65]`,v),children:t.isPending?(0,x.jsx)(`p`,{className:`text-label text-soft-foreground`,children:`Loading notes…`}):t.isError?(0,x.jsx)(`p`,{className:`text-label text-danger`,children:t.error.message}):t.data.trim().length>0?(0,x.jsx)(y,{children:t.data}):(0,x.jsx)(`p`,{className:`text-label text-muted-foreground`,children:`No notes yet — the handoff file is seeded when the task starts.`})})}export{S as TaskNotesRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{F as r,Mt as i,St as a,wt as o}from"./queries-BQUz3Wnb.js";import{t as s}from"./utils-Dp6vCdiU.js";import{S as c,l}from"./project-router-B1Q3upIJ.js";import{A as u,I as d,O as f,T as p,n as m,r as h,t as g}from"./git-tab-loading-DpG2D8Vl.js";import{A as _,c as v}from"./thread-items-C-4IW5zi.js";import{t as y}from"./markdown-YSf01kqC.js";var b=e(t(),1),x=n();function S(){let{id:e}=c(),t=a(e);return t.isPending?(0,x.jsx)(m,{tab:`notes`}):t.isError?(0,x.jsx)(g,{tab:`notes`,error:t.error}):(0,x.jsxs)(`div`,{"data-route":`task-notes`,className:`flex min-h-full flex-col`,children:[(0,x.jsx)(C,{run:t.data}),(0,x.jsx)(`div`,{className:`mx-auto w-full max-w-[var(--measure)] px-3 py-3 md:px-6 md:py-5`,children:(0,x.jsx)(T,{runId:t.data.id})})]})}function C({run:e}){let t=l(),n=r().data?.capabilities?.terminal===!0,i=(0,b.useMemo)(()=>u.filter(t=>(t!==`graph`||!!e.workflowDef)&&(t!==`terminal`||n)),[e.workflowDef,n]),{hints:a,show:s}=f((0,b.useMemo)(()=>p(i),[i])),c=o(e.id).data?.artifacts?.length??0,m=e.diffStat?.files??0;return(0,x.jsx)(h,{run:e,tab:`notes`,tabs:(0,b.useMemo)(()=>(0,x.jsx)(_,{keyHints:a,showKeyHints:s,layouts:[],active:``,fixedViews:i,onSelectFixed:n=>t(`/tasks/${e.id}/${d[n]}`),onSelect:w,onClose:w,notesHref:`/tasks/${e.id}/notes`,notesActive:!0,showLayouts:!1,badges:c>0||m>0?{...c>0?{assets:c}:{},...m>0?{changes:m}:{}}:void 0}),[i,t,e.id,a,s,c,m]),wide:!0})}var w=()=>{};function T({runId:e}){let t=i(e);return(0,x.jsx)(`div`,{"data-slot":`notes-panel`,className:s(`leading-[1.65]`,v),children:t.isPending?(0,x.jsx)(`p`,{className:`text-label text-soft-foreground`,children:`Loading notes…`}):t.isError?(0,x.jsx)(`p`,{className:`text-label text-danger`,children:t.error.message}):t.data.trim().length>0?(0,x.jsx)(y,{children:t.data}):(0,x.jsx)(`p`,{className:`text-label text-muted-foreground`,children:`No notes yet — the handoff file is seeded when the task starts.`})})}export{S as TaskNotesRoute};