@open-mercato/cezar 0.18.0 → 0.19.0-pr1815.4229
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/dist/automations/automation-cli.js +12 -6
- package/dist/automations/automation-cli.js.map +1 -1
- package/dist/automations/prompts.js +3 -1
- package/dist/automations/prompts.js.map +1 -1
- package/dist/automations/schedule-runner.js +18 -4
- package/dist/automations/schedule-runner.js.map +1 -1
- package/dist/automations/store.js +9 -2
- package/dist/automations/store.js.map +1 -1
- package/dist/automations/templates.js +1 -0
- package/dist/automations/templates.js.map +1 -1
- package/dist/automations/types.d.ts +28 -0
- package/dist/automations/types.js +6 -2
- package/dist/automations/types.js.map +1 -1
- package/dist/contract/automation-schedule.d.ts +28 -0
- package/dist/contract/automations.d.ts +126 -0
- package/dist/contract/github.d.ts +56 -0
- package/dist/contract/index.js +63 -0
- package/dist/contract/workspace.d.ts +18 -0
- package/dist/server/forge/github-issue-metadata.d.ts +6 -0
- package/dist/server/forge/github-issue-metadata.js +66 -0
- package/dist/server/forge/github-issue-metadata.js.map +1 -0
- package/dist/server/forge/github.d.ts +1 -1
- package/dist/server/forge/github.js +38 -4
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/forge/types.d.ts +2 -17
- package/dist/server/server.d.ts +320 -36
- package/dist/server/server.js +21 -20
- package/dist/server/server.js.map +1 -1
- package/dist/workflows/run.js +7 -0
- package/dist/workflows/run.js.map +1 -1
- package/package.json +3 -3
- package/web/dist/assets/{agent-task-pickers-DbNIzx20.js → agent-task-pickers-_i7QNEVz.js} +1 -1
- package/web/dist/assets/{alert-dialog-4Kna6Hd7.js → alert-dialog-BZU09BVw.js} +1 -1
- package/web/dist/assets/arrow-down-BQxdXW9w.js +1 -0
- package/web/dist/assets/arrow-left-CvmEanh8.js +1 -0
- package/web/dist/assets/automation-format-CEBKDGz8.js +1 -0
- package/web/dist/assets/automations-route-Cg1sWvtN.js +1 -0
- package/web/dist/assets/button-BvYDiOkd.js +100 -0
- package/web/dist/assets/{centered-state-D-wDs7Y1.js → centered-state-Bpq40Y_t.js} +1 -1
- package/web/dist/assets/check-DC3eAaS2.js +1 -0
- package/web/dist/assets/chevron-left-BW4WDtiS.js +1 -0
- package/web/dist/assets/chevron-right-DuM1UAhq.js +1 -0
- package/web/dist/assets/circle-check-DiPv45P_.js +1 -0
- package/web/dist/assets/{clipboard-DQGL_gUp.js → clipboard-7kWKIj7k.js} +1 -1
- package/web/dist/assets/{collapsible-D7qsttC5.js → collapsible-OE3rGS50.js} +1 -1
- package/web/dist/assets/{commit-list-DTMGEn0-.js → commit-list-DalU6p3i.js} +1 -1
- package/web/dist/assets/{compare-variants-DqlkpLFs.js → compare-variants-CuCfgtyG.js} +1 -1
- package/web/dist/assets/dashboard-BYBop-ZJ.js +44 -0
- package/web/dist/assets/{diff-DY-_mmb0.js → diff-DfTKq2z2.js} +2 -2
- package/web/dist/assets/{diff-view-oTEcZZ_O.js → diff-view-Du2463vL.js} +1 -1
- package/web/dist/assets/{download-BBtWFvsh.js → download-_KH0gJo8.js} +1 -1
- package/web/dist/assets/facet-filter-BSS2vFA8.js +5 -0
- package/web/dist/assets/{file-CbWEaOku.js → file-d2ABwdSR.js} +1 -1
- package/web/dist/assets/file-preview-BURiO97x.js +2 -0
- package/web/dist/assets/{git-pull-request-draft-Dwhm6Vhn.js → git-pull-request-draft-DIdbQZ0O.js} +1 -1
- package/web/dist/assets/git-tab-loading-8Y0ID8J2.js +1 -0
- package/web/dist/assets/{git-toolbar-C3vpZJaZ.js → git-toolbar-CSrf6Ux9.js} +1 -1
- package/web/dist/assets/github-DQ8J0EYw.js +1 -0
- package/web/dist/assets/{host-usage-CI_ZlJQu.js → host-usage-EK6T4fAW.js} +1 -1
- package/web/dist/assets/{icon-tooltip-CgAWLDxo.js → icon-tooltip-nRvCJxOH.js} +1 -1
- package/web/dist/assets/index-BVPhzJ3k.js +31 -0
- package/web/dist/assets/index-HmrjUHlJ.css +2 -0
- package/web/dist/assets/{input-Br4NQpZK.js → input-90eli0Uk.js} +1 -1
- package/web/dist/assets/{layout-cards-fdJa2H62.js → layout-cards-n-2Pwe6c.js} +1 -1
- package/web/dist/assets/{lib-w_5wfsBF.js → lib-C4vuyY62.js} +1 -1
- package/web/dist/assets/loader-circle-DAforPX2.js +1 -0
- package/web/dist/assets/{markdown-G3dvGJao.js → markdown-BBnagS_c.js} +1 -1
- package/web/dist/assets/{markdown-BfZORc0a.js → markdown-DLB6o6YD.js} +1 -1
- package/web/dist/assets/{message-square-Dl-ol3uz.js → message-square-WCEmfkiD.js} +1 -1
- package/web/dist/assets/plus-BJEPAJjW.js +1 -0
- package/web/dist/assets/{project-router-DgQSavhI.js → project-router-7DKoABD3.js} +1 -1
- package/web/dist/assets/queries-DsfjHsrp.js +1 -0
- package/web/dist/assets/{reference-chip-BxUGeHDa.js → reference-chip-frnxjI-K.js} +1 -1
- package/web/dist/assets/repo-git-DVREyQYa.js +1 -0
- package/web/dist/assets/{run-diff-CqXLVaDj.js → run-diff-CmqQmGTJ.js} +1 -1
- package/web/dist/assets/{save-ByUa-aAl.js → save-CCb1fwTJ.js} +1 -1
- package/web/dist/assets/{scroll-within-Dexi68h1.js → scroll-within-CNcaqKGp.js} +1 -1
- package/web/dist/assets/{search-x-CLuL49ms.js → search-x-Cm22V3TC.js} +1 -1
- package/web/dist/assets/{settings-2-BvalJGW-.js → settings-2-CWK1otJs.js} +1 -1
- package/web/dist/assets/skills-B0OolFqS.js +1 -0
- package/web/dist/assets/{square-FwRsgrg-.js → square-B-gfdc5r.js} +1 -1
- package/web/dist/assets/{tabs-nC1VLjcX.js → tabs-D3hCl7A6.js} +1 -1
- package/web/dist/assets/{tag-CteJEZQp.js → tag-C5TeSwBA.js} +1 -1
- package/web/dist/assets/{task-commits-CYcqwz-f.js → task-commits-DIrIWA6g.js} +1 -1
- package/web/dist/assets/{task-graph-CJfTnzUp.js → task-graph-Diq4xAP_.js} +1 -1
- package/web/dist/assets/{task-notes-DxH2q3Hr.js → task-notes-DnIcoZgS.js} +1 -1
- package/web/dist/assets/task-workspace-DhUBQLGl.js +29 -0
- package/web/dist/assets/{terminal-aoRx5eKS.js → terminal-BIKtPgmL.js} +1 -1
- package/web/dist/assets/{terminal-drawer-CuGVJS-l.js → terminal-drawer-f0Tw3yHw.js} +2 -2
- package/web/dist/assets/{textarea-X_NVmVlZ.js → textarea-D6BGJB7j.js} +1 -1
- package/web/dist/assets/{token-metrics-CdH7TbLP.js → token-metrics-CMdTXREP.js} +1 -1
- package/web/dist/assets/{tooltip-C2bzSwbQ.js → tooltip-Bb7ddw0_.js} +1 -1
- package/web/dist/assets/{tracker-BYs-vq6-.js → tracker-BDiIqG2R.js} +2 -2
- package/web/dist/assets/{triangle-alert-BdMPm9Jb.js → triangle-alert-BhQYv6Is.js} +1 -1
- package/web/dist/assets/{upload-DrvICo_K.js → upload-Crivm77f.js} +1 -1
- package/web/dist/assets/{use-now-Byfm730u.js → use-now-BW1HO2p_.js} +1 -1
- package/web/dist/assets/{use-submit-shortcut-B41NLqM4.js → use-submit-shortcut-oBvmLiAo.js} +1 -1
- package/web/dist/assets/{workflow-graph-ppdi5xyK.js → workflow-graph-DJLPSGD3.js} +3 -3
- package/web/dist/assets/{worktree-lifecycle-operation-CvU6xu3u.js → worktree-lifecycle-operation-DL-RTic4.js} +2 -2
- package/web/dist/index.html +39 -39
- package/dist/telemetry-service.json +0 -1
- package/web/dist/assets/arrow-left-B1Ed0tpu.js +0 -1
- package/web/dist/assets/automation-format-CXffJGqm.js +0 -1
- package/web/dist/assets/automations-route-ruFF7d59.js +0 -1
- package/web/dist/assets/button-wdWSPx_B.js +0 -100
- package/web/dist/assets/check-DvAMBXJe.js +0 -1
- package/web/dist/assets/chevron-left-Dqb1lvgZ.js +0 -1
- package/web/dist/assets/chevron-right-DDQuVTY1.js +0 -1
- package/web/dist/assets/circle-check-BiVc-j8x.js +0 -1
- package/web/dist/assets/dashboard-BX4228zB.js +0 -44
- package/web/dist/assets/facet-filter-B_AsFqFx.js +0 -5
- package/web/dist/assets/file-preview-DEKEA-Hk.js +0 -2
- package/web/dist/assets/git-tab-loading-w5Ne43J6.js +0 -1
- package/web/dist/assets/github-Hshin4wG.js +0 -1
- package/web/dist/assets/index-CQ1cB3qE.css +0 -2
- package/web/dist/assets/index-D-pGbO9R.js +0 -31
- package/web/dist/assets/loader-circle-CwT0JWiv.js +0 -1
- package/web/dist/assets/plus-BwQyZgNP.js +0 -1
- package/web/dist/assets/queries-BTgOLNTK.js +0 -1
- package/web/dist/assets/repo-git-B47L82oV.js +0 -1
- package/web/dist/assets/skills-Bu12y3Zp.js +0 -1
- package/web/dist/assets/task-workspace-7NHIdOyT.js +0 -29
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{C as r,Ia as i,Na as a,ct as o,er as s,ft as c,ki as l,lt as u,mt as d,pt as f,r as p,st as m,yr as h}from"./queries-DsfjHsrp.js";import{F as g,i as _,r as v,t as y}from"./button-BvYDiOkd.js";import{c as b,f as x,t as S,w as C}from"./project-router-7DKoABD3.js";import{t as w}from"./use-desktop-BNN3U2y9.js";import{t as T}from"./arrow-down-BQxdXW9w.js";import{t as E}from"./arrow-left-CvmEanh8.js";import{n as ee,t as te}from"./file-d2ABwdSR.js";import{t as ne}from"./check-DC3eAaS2.js";import{t as re}from"./chevron-right-DuM1UAhq.js";import{c as D,d as O,f as k,l as ie,m as A,o as j,p as ae,s as M,t as oe}from"./git-toolbar-CSrf6Ux9.js";import{a as se,c as ce,d as le,f as N,i as ue,l as de,o as fe,r as pe,s as me,t as he}from"./file-preview-BURiO97x.js";import{n as P}from"./upload-Crivm77f.js";import{n as F,t as I}from"./triangle-alert-BhQYv6Is.js";import{t as L}from"./plus-BJEPAJjW.js";import{t as R}from"./search-x-Cm22V3TC.js";import{t as z}from"./input-90eli0Uk.js";import{n as ge}from"./lib-C4vuyY62.js";import{t as B}from"./centered-state-Bpq40Y_t.js";import{a as _e}from"./index-BVPhzJ3k.js";import{t as ve}from"./markdown-DLB6o6YD.js";import{t as V}from"./diff-DfTKq2z2.js";import{t as H}from"./commit-list-DalU6p3i.js";var U=g(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),W=e(t(),1),G=n();function ye(){let e=c(),t=f();if(!e.data)return null;let n=e.data,r=e=>t.mutate(e,{onSuccess:e=>x(e.message),onError:e=>x(e.message,{tone:`danger`,expected:e instanceof s&&e.status===409})}),i=t.isPending,a=t.variables;return(0,G.jsxs)(`div`,{"data-slot":`repo-sync`,className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-meta`,children:[n.upstream?(0,G.jsxs)(`span`,{"data-slot":`repo-upstream`,className:`truncate font-mono text-soft-foreground`,title:`Upstream`,children:[`→ `,n.upstream]}):n.branch?(0,G.jsx)(`span`,{"data-slot":`repo-upstream`,className:`text-soft-foreground`,children:`not published`}):(0,G.jsx)(`span`,{"data-slot":`repo-upstream`,className:`text-soft-foreground`,children:`detached HEAD`}),n.upstream?(0,G.jsx)(q,{ahead:n.ahead,behind:n.behind}):n.outgoing.length>0?(0,G.jsx)(q,{ahead:n.outgoing.length,behind:null}):null,(0,G.jsx)(`span`,{"data-slot":`repo-fetched`,className:`hidden text-soft-foreground sm:inline`,children:n.lastFetchedAt?`fetched ${xe(n.lastFetchedAt)}`:`never fetched`}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,G.jsx)(K,{which:`fetch`,label:`Fetch`,busy:i,pending:a,onClick:r,disabled:!n.pushRemote,children:(0,G.jsx)(O,{"aria-hidden":`true`,className:v(i&&a===`fetch`&&`animate-spin`)})}),n.upstream?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(K,{which:`pull`,label:`Pull`,busy:i,pending:a,onClick:r,disabled:!n.behind,children:(0,G.jsx)(T,{"aria-hidden":`true`})}),(0,G.jsx)(K,{which:`push`,label:`Push`,busy:i,pending:a,onClick:r,disabled:!n.ahead,children:(0,G.jsx)(ee,{"aria-hidden":`true`})}),(0,G.jsx)(K,{which:`sync`,label:`Sync`,busy:i,pending:a,onClick:r,disabled:!n.ahead&&!n.behind,variant:`outline`,children:(0,G.jsx)(O,{"aria-hidden":`true`,className:v(i&&a===`sync`&&`animate-spin`)})})]}):n.branch&&n.pushRemote?(0,G.jsx)(K,{which:`push`,label:`Publish branch`,busy:i,pending:a,onClick:r,variant:`outline`,children:(0,G.jsx)(U,{"aria-hidden":`true`})}):null]})]})}function K({which:e,label:t,busy:n,pending:r,onClick:i,disabled:a,variant:o=`ghost`,children:s}){return(0,G.jsxs)(y,{variant:o,size:`sm`,"data-action":`repo-${e}`,"aria-busy":n&&r===e,disabled:n||a,onClick:()=>i(e),children:[s,t]})}function q({ahead:e,behind:t}){return e===null&&t===null?null:!e&&!t?(0,G.jsx)(`span`,{"data-slot":`sync-counts`,className:`text-soft-foreground`,children:`in sync`}):(0,G.jsxs)(`span`,{"data-slot":`sync-counts`,className:`flex items-center gap-1 font-mono`,children:[e?(0,G.jsxs)(`span`,{"data-sync":`ahead`,title:`${e} to push`,className:`text-primary`,children:[`↑`,e]}):null,t?(0,G.jsxs)(`span`,{"data-sync":`behind`,title:`${t} to pull`,className:`text-warning`,children:[`↓`,t]}):null]})}function be({name:e,sync:t}){if(!t)return null;let n=t.branches.find(t=>t.name===e),r=n?n.gone?`upstream gone`:n.upstream?null:`local only`:`remote only`;return(0,G.jsx)(`span`,{"data-slot":`branch-tracking`,className:`flex shrink-0 items-center gap-1 text-meta`,children:r?(0,G.jsx)(`span`,{className:`text-soft-foreground`,children:r}):(0,G.jsx)(q,{ahead:n.ahead,behind:n.behind})})}function xe(e){let t=Math.max(0,Math.round((Date.now()-Date.parse(e))/1e3));if(t<60)return`just now`;let n=Math.round(t/60);if(n<60)return`${n} min ago`;let r=Math.round(n/60);return r<24?`${r} h ago`:`${Math.round(r/24)} d ago`}function Se({repo:e,info:t}){let n=ie(),r=c(),o=i(),s=e=>x(e.message,{tone:`danger`}),u=a({mutationFn:e=>h({name:e}),onSuccess:async e=>{x(e.created?`Created and switched to ${e.branch}`:`Switched to ${e.branch}`),await Promise.all([o.invalidateQueries({queryKey:p.repo}),o.invalidateQueries({queryKey:p.health})]),o.setQueryData(p.repo,t=>t?.info?{...t,info:{...t.info,branch:e.branch}}:t),o.setQueryData(p.health,n=>n?.repo?.root===t.root?{...n,repo:{...n.repo,branch:e.branch}}:n)},onError:s}),d=a({mutationFn:e=>l({baseBranch:e}),onSuccess:e=>{x(e.baseBranch?`Agents now branch from ${e.baseBranch}`:`Agents now fork from the checked-out branch`),o.invalidateQueries({queryKey:p.repo})},onError:s}),[f,m]=(0,W.useState)(``),[g,_]=(0,W.useState)(``),b=g.trim().toLowerCase(),S=b?e.branches.filter(e=>e.toLowerCase().includes(b)):e.branches;return(0,G.jsxs)(`section`,{"data-slot":`repo-branches`,className:`flex flex-col gap-6 px-4 py-4 md:px-6`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{className:`eyebrow text-soft-foreground`,children:`Branches`}),(0,G.jsx)(z,{"aria-label":`Filter branches`,placeholder:`Filter branches…`,value:g,onChange:e=>_(e.target.value),className:`mt-2 max-w-xl`}),(0,G.jsxs)(`ul`,{"data-slot":`repo-branch-list`,className:`mt-2 flex max-w-xl flex-col divide-y divide-border`,children:[S.map(n=>{let i=n===t.branch,a=e.checkedOutElsewhere?.[n];return(0,G.jsxs)(`li`,{"data-slot":`branch-row`,"data-branch":n,className:`flex min-h-9 items-center gap-2 py-1`,children:[(0,G.jsx)(k,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:v(`min-w-0 truncate font-mono text-xs`,i&&`font-semibold`),children:n}),(0,G.jsx)(be,{name:n,sync:r.data}),i?(0,G.jsxs)(`span`,{"data-slot":`branch-current`,className:`flex shrink-0 items-center gap-1 rounded-sm bg-muted px-1.5 py-px text-micro font-medium text-muted-foreground`,children:[(0,G.jsx)(ne,{"aria-hidden":`true`,className:`size-3`}),`current`]}):a?(0,G.jsx)(`span`,{"data-slot":`branch-elsewhere`,title:`Checked out in ${a}`,className:`ml-auto shrink-0 text-meta text-soft-foreground`,children:`in another worktree`}):(0,G.jsx)(y,{variant:`ghost`,size:`sm`,"data-action":`switch-branch`,className:`ml-auto`,disabled:u.isPending,onClick:()=>u.mutate(n),children:`Switch`})]},n)}),S.length===0?(0,G.jsxs)(`li`,{"data-slot":`branch-empty`,className:`py-3 text-xs text-soft-foreground`,children:[`No branches match “`,g.trim(),`”.`]}):null]}),(0,G.jsxs)(`form`,{"data-slot":`branch-create`,className:`mt-3 flex max-w-md items-center gap-2`,onSubmit:e=>{e.preventDefault();let t=f.trim();t&&u.mutate(t,{onSuccess:()=>m(``)})},children:[(0,G.jsx)(z,{"aria-label":`New branch name`,placeholder:`new-branch-name`,value:f,onChange:e=>m(e.target.value)}),(0,G.jsxs)(y,{type:`submit`,variant:`outline`,size:`sm`,"data-action":`create-branch`,disabled:!f.trim()||u.isPending,children:[(0,G.jsx)(L,{"aria-hidden":`true`}),`Create`]})]})]}),(0,G.jsxs)(`div`,{className:`max-w-md`,children:[(0,G.jsx)(`label`,{htmlFor:`base-branch-picker`,className:`eyebrow text-soft-foreground`,children:`Agents’ base branch`}),(0,G.jsxs)(`select`,{id:`base-branch-picker`,"data-slot":`base-branch-picker`,value:e.baseBranch??``,disabled:d.isPending,onChange:e=>d.mutate(e.target.value===``?null:e.target.value),className:`mt-1.5 block w-full rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[(0,G.jsx)(`option`,{value:``,children:`follow checked-out branch (default)`}),e.branches.map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))]}),(0,G.jsx)(`p`,{className:`mt-1 text-meta text-soft-foreground`,children:`New task worktrees branch from this.`})]}),n?.available?(0,G.jsx)(Ce,{}):null]})}function Ce(){let e=r({limit:20});return(0,G.jsxs)(`div`,{"data-slot":`repo-prs`,className:`max-w-xl`,children:[(0,G.jsx)(`h2`,{className:`eyebrow text-soft-foreground`,children:`Open pull requests`}),e.isPending?(0,G.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`Loading pull requests…`}):e.isError?(0,G.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:e.error.message}):e.data.available?e.data.prs.length===0?(0,G.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`No open pull requests.`}):(0,G.jsx)(`ul`,{className:`mt-2 flex flex-col divide-y divide-border`,children:e.data.prs.map(e=>(0,G.jsx)(we,{pr:e},e.number))}):(0,G.jsx)(`p`,{"data-slot":`repo-prs-unavailable`,className:`mt-2 text-xs text-soft-foreground`,children:e.data.reason??`The forge is unreachable right now.`})]})}function we({pr:e}){let t=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(F,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,G.jsxs)(`span`,{className:`shrink-0 font-mono text-meta text-muted-foreground`,children:[`#`,e.number]}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ui`,children:e.title}),e.checks?(0,G.jsx)(Te,{checks:e.checks}):null]}),n=`flex min-w-0 items-center gap-2 rounded-sm px-1.5 py-2`;return(0,G.jsx)(`li`,{"data-slot":`pr-row`,"data-number":e.number,children:_(e.url)?(0,G.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:v(n,`hover:bg-muted`),children:t}):(0,G.jsx)(`span`,{className:n,children:t})})}function Te({checks:e}){return(0,G.jsx)(`span`,{"data-slot":`pr-checks`,"data-checks":e,className:v(`shrink-0 text-micro font-medium`,e===`passing`&&`text-success`,e===`failing`&&`text-danger`,e===`pending`&&`text-muted-foreground`),children:e})}function Ee(){let e=o(),t=w(),[n,r]=(0,W.useState)(`unified`),[i,a]=(0,W.useState)(!1),[c,l]=(0,W.useState)(!1),[u,d]=(0,W.useState)(null),f=(0,W.useRef)(null),p=(0,W.useRef)(null),[m,h]=ce(),g=me(m),_=e.isError&&e.error instanceof s&&e.error.status===409,y=e.data?.files??[],b=(0,W.useMemo)(()=>ue(y),[y]),x=(0,W.useMemo)(()=>y.some(ve),[y]),S=t?n:`unified`,C=!t||i;return(0,G.jsxs)(`section`,{"data-slot":`repo-changes`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,G.jsxs)(`div`,{"data-slot":`repo-changes-toolbar`,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,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Uncommitted changes`}),e.data?(0,G.jsx)(oe,{stat:e.data.stat}):null,(0,G.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,G.jsx)(M,{mode:n,wrap:i,preview:c,onModeChange:r,onWrapChange:a,onPreviewChange:x?l:void 0})})]}),e.isPending?(0,G.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading changes…`}):e.isError?(0,G.jsx)(B,{icon:_?(0,G.jsx)(A,{}):(0,G.jsx)(I,{}),tone:_?`neutral`:`danger`,heading:`h2`,title:_?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):y.length===0?(0,G.jsx)(B,{icon:(0,G.jsx)(A,{}),tone:`neutral`,heading:`h2`,title:`Working tree clean`,subtitle:`No uncommitted changes in the main working tree. Edits show up here as they happen.`}):(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-5 px-4 py-4 max-md:[--diff-sticky-top:7rem] md:px-6 md:py-0`,children:[(0,G.jsx)(`aside`,{ref:p,"data-slot":`changes-tree-pane`,style:g.style,className:v(`hidden w-60 max-w-[60%] shrink-0 overflow-y-auto overscroll-contain py-4 md:block lg:w-72`,g.className),children:(0,G.jsx)(de,{root:b,selected:u,onSelect:e=>{d(e),f.current?.scrollToPath(e)}})}),(0,G.jsx)(fe,{paneRef:p,width:m,onWidthChange:h,className:`hidden md:block`}),(0,G.jsx)(`div`,{"data-slot":`diff-pane`,"data-diff-scroller":t?``:void 0,className:`min-w-0 flex-1 md:overflow-y-auto md:overscroll-contain`,children:(0,G.jsx)(V,{files:y,viewRef:f,mode:S,wrap:C,preview:t&&x&&c,className:`min-w-0 md:py-4`})})]})]})}function De({log:e}){let{sha:t}=C(),n=c().data;if(t)return(0,G.jsx)(Oe,{sha:t});let r=new Set(n?.outgoing??[]),i=n?.incoming??[],a=(e,t)=>({sha:e.hash,shaLabel:e.hash,subject:e.subject,author:e.author,when:e.when,href:`/git/commits/${e.hash}`,...t?{sync:t}:{}}),o=i.length>0?(0,G.jsxs)(`section`,{"data-slot":`repo-incoming`,className:`border-b border-border`,children:[(0,G.jsxs)(`h2`,{className:`px-4 pt-3 text-meta font-medium text-muted-foreground md:px-6`,children:[`Incoming from `,n?.upstream,` · `,i.length]}),(0,G.jsx)(H,{slot:`repo-incoming-commits`,commits:i.map(e=>a(e,`incoming`))})]}):null;return e.length===0?(0,G.jsx)(B,{icon:(0,G.jsx)(P,{}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`The log is empty — this repository has no commits to show.`}):(0,G.jsxs)(G.Fragment,{children:[o,(0,G.jsx)(H,{slot:`repo-commits`,commits:e.map(e=>a(e,r.has(e.hash)?`outgoing`:void 0))})]})}function Oe({sha:e}){let t=u(e),n=w(),[r,i]=(0,W.useState)(`unified`),[a,o]=(0,W.useState)(!1),c=t.isError&&t.error instanceof s&&t.error.status===409,l=n?r:`unified`,d=!n||a;return(0,G.jsxs)(`section`,{"data-slot":`repo-commit`,"data-sha":e,className:`flex min-h-0 flex-1 flex-col`,children:[(0,G.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,G.jsx)(y,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,G.jsxs)(S,{to:`/git/commits`,children:[(0,G.jsx)(E,{"aria-hidden":`true`}),`All commits`]})}),t.data?(0,G.jsx)(ge,{stat:t.data.stat}):null,(0,G.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,G.jsx)(M,{mode:r,wrap:a,onModeChange:i,onWrapChange:o})})]}),t.isPending?(0,G.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):t.isError?(0,G.jsx)(B,{icon:c?(0,G.jsx)(R,{}):(0,G.jsx)(I,{}),tone:c?`neutral`:`danger`,heading:`h2`,title:c?`Commit not found`:`Could not load the commit`,subtitle:t.error.message}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-semibold`,children:t.data.subject}),(0,G.jsxs)(`p`,{className:`mt-0.5 text-meta text-soft-foreground`,children:[t.data.author,` · `,t.data.when,` ·`,` `,(0,G.jsx)(`span`,{className:`font-mono select-all`,children:t.data.sha})]})]}),t.data.files.length===0?(0,G.jsx)(B,{icon:(0,G.jsx)(P,{}),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,G.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:7rem] md:px-6`,children:(0,G.jsx)(V,{files:t.data.files,mode:l,wrap:d,className:`min-w-0`})})]})]})}function J(e,t){let n=0;for(let r of t){if(n=e.indexOf(r,n),n===-1)return!1;n+=r.length}return!0}function ke(e,t,n){let r=t.trim().toLowerCase();if(r===``)return{results:[...e],total:e.length};let i=[];for(let t of e){let e=t.toLowerCase();if(!J(e,r))continue;let n=e.slice(e.lastIndexOf(`/`)+1);i.push({path:t,basenameMatch:J(n,r)})}return i.sort((e,t)=>e.basenameMatch===t.basenameMatch?e.path.length===t.path.length?e.path.localeCompare(t.path):e.path.length-t.path.length:e.basenameMatch?-1:1),{results:i.slice(0,n).map(e=>e.path),total:i.length}}var Ae=200;function je({selected:e,onSelect:t}){let n=d(),r=n.isError&&n.error instanceof s&&n.error.status===409,i=n.data?.paths??[];return n.isPending?(0,G.jsx)(Y,{children:(0,G.jsx)(`p`,{"data-slot":`repo-files-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading files…`})}):n.isError?(0,G.jsx)(Y,{children:(0,G.jsx)(B,{icon:r?(0,G.jsx)(N,{}):(0,G.jsx)(I,{}),tone:r?`neutral`:`danger`,heading:`h2`,title:r?`No files to browse`:`Could not load the files`,subtitle:n.error.message})}):i.length===0?(0,G.jsx)(Y,{children:(0,G.jsx)(B,{icon:(0,G.jsx)(N,{}),tone:`neutral`,heading:`h2`,title:`No files yet`,subtitle:`Nothing is tracked in this repository. Files show up here once git knows about them.`})}):(0,G.jsxs)(Y,{children:[n.data.truncated?(0,G.jsxs)(`p`,{"data-slot":`repo-files-truncated`,role:`status`,className:`border-b border-border bg-muted/40 px-4 py-2 text-xs text-muted-foreground md:px-6`,children:[`Showing the first `,i.length.toLocaleString(),` files; this repository has more. The tree and the filter cover only what is loaded.`]}):null,(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-5 px-4 py-4 [--diff-sticky-top:7rem] md:flex-row md:items-start md:px-6`,children:[(0,G.jsx)(`aside`,{"data-slot":`repo-files-tree-pane`,className:v(`w-full shrink-0 md:sticky md:top-[var(--diff-sticky-top)] md:block md:max-h-[calc(100dvh_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain lg:w-72`,e!==null&&`hidden`),children:(0,G.jsx)(Me,{paths:i,selected:e,onSelect:t})}),(0,G.jsxs)(`div`,{className:v(`min-w-0 flex-1`,e===null&&`hidden md:block`),children:[e===null?null:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`repo-files-back`,onClick:()=>t(null),className:`mb-2 flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground md:hidden`,children:[(0,G.jsx)(E,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the file tree`]}),(0,G.jsx)(he,{source:{kind:`repo`},path:e})]})]})]})}function Y({children:e}){return(0,G.jsx)(`section`,{"data-slot":`repo-files`,className:`flex min-h-0 flex-1 flex-col`,children:e})}function X(e){if(e===null)return[];let t=e.split(`/`);return t.slice(0,-1).map((e,n)=>t.slice(0,n+1).join(`/`))}function Z(e,t,n){let r=[];for(let i of e.dirs){let e=t.has(i.path);r.push({kind:`dir`,path:i.path,name:i.name,level:n,open:e}),e&&r.push(...Z(i,t,n+1))}for(let t of e.files)r.push({kind:`file`,path:t.path,name:t.name,level:n,label:t.name});return r}function Me({paths:e,selected:t,onSelect:n}){let[r,i]=(0,W.useState)(``),[a,o]=(0,W.useState)(()=>new Set(X(t))),[s,c]=(0,W.useState)(t),l=(0,W.useRef)(null);(0,W.useEffect)(()=>{let e=X(t);e.length!==0&&o(t=>{if(e.every(e=>t.has(e)))return t;let n=new Set(t);for(let t of e)n.add(t);return n})},[t]);let u=r.trim()!==``,d=(0,W.useMemo)(()=>ke(e,r,Ae),[e,r]),f=(0,W.useMemo)(()=>se(e,(e,t)=>({kind:`file`,name:t,path:e})),[e]),p=(0,W.useMemo)(()=>u?d.results.map(e=>({kind:`file`,path:e,name:e.slice(e.lastIndexOf(`/`)+1),level:0,label:e})):Z(f,a,0),[u,d.results,f,a]),m=p.find(e=>e.path===s)??p[0],h=e=>o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,G.jsxs)(`div`,{"data-slot":`repo-files-browser`,className:`flex min-w-0 flex-col gap-2`,onKeyDown:e=>{e.key!==`/`||e.target===l.current||(e.preventDefault(),l.current?.focus())},children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`label`,{htmlFor:`repo-files-filter`,className:`sr-only`,children:`Filter repository files`}),(0,G.jsx)(`input`,{id:`repo-files-filter`,ref:l,"data-slot":`repo-files-filter`,type:`search`,value:r,placeholder:`Filter files… (/)`,"aria-controls":`repo-files-tree`,autoComplete:`off`,spellCheck:!1,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),i(``))},className:`w-full rounded-sm border border-border bg-background px-2 py-1 text-xs placeholder:text-soft-foreground focus:border-foreground focus:outline-none`}),(0,G.jsx)(`p`,{"data-slot":`repo-files-count`,role:`status`,"aria-live":`polite`,className:`sr-only`,children:u?`${d.total} files match ${r.trim()}`:`${e.length} files`})]}),u&&d.total===0?(0,G.jsxs)(`p`,{"data-slot":`repo-files-no-match`,className:`px-1.5 py-1 text-xs text-soft-foreground`,children:[`No file matches `,(0,G.jsx)(`span`,{className:`font-mono`,children:r.trim()}),`.`]}):(0,G.jsx)(`div`,{id:`repo-files-tree`,"data-slot":`repo-files-tree`,"data-filtering":u?`true`:void 0,role:`tree`,"aria-label":`Repository files`,"aria-activedescendant":m?Q(m.path):void 0,onKeyDown:e=>{let t=p.findIndex(e=>e.path===m?.path),r=e=>{let t=p[Math.max(0,Math.min(p.length-1,e))];t&&c(t.path)},i=p[t];if(e.key===`ArrowDown`)e.preventDefault(),r(t+1);else if(e.key===`ArrowUp`)e.preventDefault(),r(t-1);else if(e.key===`ArrowRight`&&i?.kind===`dir`)e.preventDefault(),i.open?r(t+1):h(i.path);else if(e.key===`ArrowLeft`&&i!==void 0)if(e.preventDefault(),i.kind===`dir`&&i.open)h(i.path);else for(let e=t-1;e>=0;--e){let t=p[e];if(t.level<i.level){c(t.path);break}}else(e.key===`Enter`||e.key===` `)&&i!==void 0&&(e.preventDefault(),i.kind===`file`?n(i.path):h(i.path))},className:`min-w-0 text-ui`,children:p.map(e=>e.kind===`dir`?(0,G.jsx)(Ne,{row:e,focused:e.path===m?.path,onToggle:()=>{c(e.path),h(e.path)}},e.path):(0,G.jsx)(Pe,{row:e,active:e.path===t,focused:e.path===m?.path,onSelect:()=>{c(e.path),n(e.path)}},e.path))}),u&&d.total>d.results.length?(0,G.jsxs)(`p`,{"data-slot":`repo-files-more`,className:`px-1.5 py-1 text-xs text-soft-foreground`,children:[(d.total-d.results.length).toLocaleString(),` more — refine the filter.`]}):null]})}var Q=e=>`repo-file-row-${e}`,$=(e,t)=>({paddingLeft:`${t+e*14}px`});function Ne({row:e,focused:t,onToggle:n}){return(0,G.jsxs)(`div`,{id:Q(e.path),role:`treeitem`,"aria-expanded":e.open,"aria-level":e.level+1,"data-slot":`repo-files-dir`,"data-path":e.path,"data-state":e.open?`open`:`closed`,tabIndex:t?0:-1,onClick:n,className:`flex w-full min-w-0 cursor-pointer items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground focus:bg-muted focus:outline-none`,style:$(e.level,6),children:[(0,G.jsx)(re,{"aria-hidden":`true`,className:v(`size-3.5 shrink-0 transition-transform`,e.open&&`rotate-90`)}),(0,G.jsx)(ae,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name})]})}function Pe({row:e,active:t,focused:n,onSelect:r}){let i=pe(e.path)?le:te;return(0,G.jsxs)(`div`,{id:Q(e.path),role:`treeitem`,"aria-level":e.level+1,"aria-selected":t,"aria-current":t?`true`:void 0,"data-slot":`repo-files-file`,"data-path":e.path,tabIndex:n?0:-1,onClick:r,className:v(`flex w-full min-w-0 cursor-pointer items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted focus:outline-none`,t?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:$(e.level,24),children:[(0,G.jsx)(i,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 truncate`,title:e.label,children:e.label})]})}function Fe({tab:e}){let t=m();if(t.isPending)return(0,G.jsx)(_e,{});if(t.isError)return(0,G.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,G.jsx)(B,{icon:(0,G.jsx)(I,{}),tone:`danger`,title:`Could not load the repository`,subtitle:t.error.message})});let n=t.data.info;return n?(0,G.jsx)(Ie,{repo:t.data,info:n,tab:e}):(0,G.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,G.jsx)(B,{icon:(0,G.jsx)(k,{}),tone:`neutral`,title:`Not a git repository`,subtitle:`The cockpit is running outside a git repository — start it inside one to browse changes, commits and branches.`})})}function Ie({repo:e,info:t,tab:n}){return(0,G.jsxs)(`div`,{"data-route":`repo-git`,className:v(`flex min-h-full flex-col`,n===`changes`&&`md:h-full`),children:[(0,G.jsxs)(`header`,{"data-slot":`repo-header`,className:`sticky top-0 z-20 border-b border-border bg-background/95 px-4 pt-3 backdrop-blur md:px-6`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,G.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Git`}),(0,G.jsx)(j,{branch:t.branch}),t.remote?(0,G.jsx)(`span`,{"data-slot":`repo-remote`,className:`hidden min-w-0 truncate text-meta text-soft-foreground md:inline`,children:t.remote}):null]}),(0,G.jsx)(`div`,{className:`mt-1.5`,children:(0,G.jsx)(ye,{})}),(0,G.jsxs)(`div`,{"data-slot":`repo-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,G.jsx)(D,{to:`/git`,active:n===`changes`,children:`Changes`}),(0,G.jsx)(D,{to:`/git/commits`,active:n===`commits`,children:`Commits`}),(0,G.jsx)(D,{to:`/git/branches`,active:n===`branches`,children:`Branches`}),(0,G.jsx)(D,{to:`/git/files`,active:n===`files`,children:`Files`})]})]}),n===`changes`?(0,G.jsx)(Ee,{}):n===`commits`?(0,G.jsx)(De,{log:e.log}):n===`files`?(0,G.jsx)(Le,{}):(0,G.jsx)(Se,{repo:e,info:t})]})}function Le(){let e=C(),t=b();return(0,G.jsx)(je,{selected:e[`*`]!==void 0&&e[`*`]!==``?e[`*`]:null,onSelect:e=>t(e===null?`/git/files`:`/git/files/${Re(e)}`,{replace:!0})})}function Re(e){return e.split(`/`).map(encodeURIComponent).join(`/`)}export{Fe as RepoGitRoute};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ia as r,bt as i,r as a}from"./queries-DsfjHsrp.js";import{r as o,t as s}from"./button-BvYDiOkd.js";import{t as c}from"./chevron-right-DuM1UAhq.js";import{n as l,r as u,t as d}from"./collapsible-OE3rGS50.js";import{a as f,i as p}from"./markdown-BBnagS_c.js";var m=e(t(),1),h=/^diff --git /;function g(e){let t=e.replace(h,``),n=t.lastIndexOf(` b/`);return _(n>=0?t.slice(n+3):t)}function _(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)&&t.length>=2?t.slice(1,-1).replace(/\\(.)/g,`$1`):t}function v(e){let t=_(e.slice(4));if(t!==`/dev/null`)return t.replace(/^[ab]\//,``)}function y(e){let t=[],n=null,r=!1;for(let i of e.split(`
|
|
2
2
|
`)){if(h.test(i)){n={path:g(i),status:`modified`,binary:!1,additions:0,deletions:0,lines:[]},t.push(n),r=!1;continue}if(n){if(!r){if(i.startsWith(`@@`))r=!0,n.lines.push(i);else if(i.startsWith(`rename from `))n.status=`renamed`,n.oldPath=_(i.slice(12));else if(i.startsWith(`rename to `))n.status=`renamed`,n.path=_(i.slice(10));else if(i.startsWith(`new file mode`))n.status=`added`;else if(i.startsWith(`deleted file mode`))n.status=`deleted`;else if(i.startsWith(`Binary files `)||i===`GIT binary patch`)n.binary=!0;else if(i.startsWith(`+++ `)){let e=v(i);e!==void 0&&(n.path=e)}else if(i.startsWith(`--- `)){let e=v(i);e!==void 0&&n.status===`deleted`&&(n.path=e)}continue}n.lines.push(i),i.startsWith(`+`)?n.additions+=1:i.startsWith(`-`)&&(n.deletions+=1)}}let i=t.at(-1);return i&&i.lines.at(-1)===``&&i.lines.pop(),t}function b(e){return{files:e.length,additions:e.reduce((e,t)=>e+t.additions,0),deletions:e.reduce((e,t)=>e+t.deletions,0)}}var x=n(),S=20,C=300;function w({runId:e}){let t=r(),n=i(e);(0,m.useEffect)(()=>{t.invalidateQueries({queryKey:a.runs.diff(e)})},[t,e]);let o=(0,m.useMemo)(()=>y(n.data??``),[n.data]),[c,l]=(0,m.useState)(!1);if(n.isPending)return(0,x.jsx)(`p`,{className:`px-1 text-xs text-soft-foreground`,children:`Loading diff…`});if(n.isError)return(0,x.jsx)(`p`,{className:`px-1 text-xs text-danger`,children:n.error.message});if(o.length===0)return(0,x.jsx)(`p`,{"data-slot":`run-diff-empty`,className:`px-1 font-mono text-xs text-soft-foreground`,children:n.data.trim()||`(no changes)`});let u=b(o),d=c?o:o.slice(0,S);return(0,x.jsxs)(`div`,{"data-slot":`run-diff`,className:`flex min-w-0 flex-col gap-2`,children:[(0,x.jsxs)(`p`,{className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,x.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,x.jsxs)(`span`,{className:`font-mono font-semibold tabular-nums`,children:[(0,x.jsxs)(`span`,{className:`text-success`,children:[`+`,u.additions]}),` `,(0,x.jsxs)(`span`,{className:`text-danger`,children:[`−`,u.deletions]})]})]}),d.map(e=>(0,x.jsx)(E,{file:e},`${e.oldPath??``}→${e.path}`)),o.length>d.length?(0,x.jsxs)(s,{variant:`ghost`,size:`sm`,className:`self-start`,onClick:()=>l(!0),children:[`Show `,o.length-d.length,` more files`]}):null]})}var T={added:`added`,deleted:`deleted`,renamed:`renamed`};function E({file:e}){let[t,n]=(0,m.useState)(!0),r=T[e.status];return(0,x.jsxs)(d,{open:t,onOpenChange:n,"data-slot":`diff-file`,className:`min-w-0 overflow-hidden rounded-md border border-border bg-card`,children:[(0,x.jsxs)(u,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted/50`,children:[(0,x.jsx)(c,{className:o(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),(0,x.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`text-soft-foreground`,children:[e.oldPath,` → `]}),e.path]}):e.path}),r?(0,x.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-micro font-medium text-muted-foreground`,children:r}):null,e.binary?(0,x.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-micro font-medium text-muted-foreground`,children:`binary`}):null,(0,x.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-meta font-semibold tabular-nums`,children:[(0,x.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,x.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})]}),(0,x.jsx)(l,{children:(0,x.jsx)(`div`,{className:`border-t border-border/50`,children:e.binary?(0,x.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.lines.length===0?(0,x.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,x.jsx)(D,{lines:e.lines})})})]})}function D({lines:e}){let[t,n]=(0,m.useState)(!1),r=t?e:e.slice(0,C),i=r.join(`
|
|
3
3
|
`),[a,s]=(0,m.useState)(null);(0,m.useEffect)(()=>{let e=!1;return p(i,`diff`).then(t=>{e||s({text:i,tokens:t.tokens})}),()=>{e=!0}},[i]);let c=a?.text===i?a.tokens:f(i,`diff`)?.tokens??null;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`pre`,{"data-slot":`diff-file-body`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7] whitespace-pre`,children:r.map((e,t)=>(0,x.jsxs)(`span`,{className:o(`block px-4`,e.startsWith(`+`)&&`bg-diff-add`,e.startsWith(`-`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[c?.[t]===void 0?e:c[t].map((e,t)=>(0,x.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t)),e===``?` `:``]},t))}),e.length>C?(0,x.jsx)(`button`,{type:`button`,"data-slot":`diff-file-toggle`,onClick:()=>n(e=>!e),className:`block w-full border-t border-border/50 px-4 py-1.5 text-left text-meta font-medium text-soft-foreground hover:text-foreground`,children:t?`Show less`:`Show all ${e.length} lines`}):null]})}export{w as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e}from"./button-
|
|
1
|
+
import{F as e}from"./button-BvYDiOkd.js";var t=e(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{H as i,r as a}from"./button-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{H as i,r as a}from"./button-BvYDiOkd.js";var o=e(t(),1),s=e(n(),1),c=r();function l({src:e,alt:t=``,className:n,...r}){let[l,u]=(0,o.useState)(!1),d=i(e);return(0,o.useEffect)(()=>{if(!l)return;let e=e=>{e.key===`Escape`&&u(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[l]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`img`,{...r,src:d,alt:t,loading:`lazy`,onClick:()=>u(!0),className:a(`cursor-zoom-in`,n)}),l?(0,s.createPortal)((0,c.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Image preview`,"data-slot":`image-lightbox`,onClick:()=>u(!1),className:`fixed inset-0 z-[100] flex cursor-zoom-out items-center justify-center bg-black/80 p-4 backdrop-blur-sm`,children:(0,c.jsx)(`img`,{src:d,alt:t,className:`max-h-full max-w-full rounded-md object-contain shadow-2xl`})}),document.body):null]})}function u(e){return e.image===!0&&(e.binary===!0||e.patch===``)}function d({file:e,imageSrc:t,oldImageSrc:n,onOpenInApp:r}){let i=e.oldPath??e.path;return e.status===`deleted`?n?(0,c.jsx)(`div`,{"data-slot":`diff-image-preview`,className:`flex flex-col items-center gap-2 p-4`,children:(0,c.jsx)(f,{src:n(i),alt:i,side:`old`})}):(0,c.jsx)(p,{children:`Image deleted — only the new side can be previewed.`}):t?(0,c.jsxs)(`div`,{"data-slot":`diff-image-preview`,className:`flex flex-col items-center gap-2 p-4`,children:[n!==void 0&&e.status!==`added`?(0,c.jsxs)(`div`,{className:`grid w-full grid-cols-1 items-start gap-4 sm:grid-cols-2`,children:[(0,c.jsx)(f,{label:`Before`,src:n(i),alt:i,side:`old`}),(0,c.jsx)(f,{label:`After`,src:t(e.path),alt:e.path,side:`new`})]}):(0,c.jsx)(f,{src:t(e.path),alt:e.path,side:`new`}),r?(0,c.jsx)(`button`,{type:`button`,"data-slot":`diff-image-open`,onClick:()=>r(e.path),className:`text-meta font-medium text-soft-foreground hover:text-foreground hover:underline`,children:`Open in default app`}):null]}):(0,c.jsx)(p,{children:`Binary file — no text diff.`})}function f({label:e,src:t,alt:n,side:r}){let[i,a]=(0,o.useState)(null);return(0,c.jsxs)(`figure`,{"data-slot":`diff-image-side`,"data-side":r,className:`flex min-w-0 flex-col items-center gap-1.5`,children:[e?(0,c.jsx)(`figcaption`,{className:`text-meta font-medium text-soft-foreground`,children:e}):null,i===t?(0,c.jsx)(p,{children:`Image can’t be previewed (too large or unavailable).`}):(0,c.jsx)(l,{src:t,alt:n,onError:()=>a(t),className:`max-h-[60vh] max-w-full rounded-sm`})]})}function p({children:e}){return(0,c.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:e})}function m(e){return e.closest(`[data-diff-scroller], [data-slot="main"]`)}function h(e,t,n){let r=t.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop-n;e.scrollTop=Math.max(0,r)}export{l as a,u as i,h as n,d as r,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e}from"./button-
|
|
1
|
+
import{F as e}from"./button-BvYDiOkd.js";var t=e(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e}from"./button-
|
|
1
|
+
import{F as e}from"./button-BvYDiOkd.js";var t=e(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),n=e(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]);export{t as n,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ia as r,Lt as i,Na as a,Ni as o,P as s,Rt as c,Zt as l,br as ee,er as u,fr as d,ir as f,nn as p,qt as m,r as h,ri as g,zi as _}from"./queries-DsfjHsrp.js";import{r as v,t as y}from"./button-BvYDiOkd.js";import{T as b,c as te,f as x,s as S,t as C}from"./project-router-7DKoABD3.js";import{_ as w,f as T,g as E,h as D,m as O,p as k}from"./reference-chip-frnxjI-K.js";import{Dn as A,F as j,gn as M,xn as N}from"./git-tab-loading-8Y0ID8J2.js";import{t as P}from"./arrow-left-CvmEanh8.js";import{F,G as I,I as L,P as R,R as z}from"./worktree-lifecycle-operation-DL-RTic4.js";import{t as B}from"./circle-check-DiPv45P_.js";import{d as V}from"./git-toolbar-CSrf6Ux9.js";import{t as ne}from"./triangle-alert-BhQYv6Is.js";import{t as re}from"./input-90eli0Uk.js";import{t as H}from"./centered-state-Bpq40Y_t.js";import{W as U,l as W,s as ie}from"./index-BVPhzJ3k.js";var G=e(t(),1),K=n(),q=[`.ai/cezar/skills/`,`.ai/skills/`,`.agents/skills/`];function J({children:e}){return(0,K.jsx)(`span`,{className:`font-mono`,children:e})}function Y(){return(0,K.jsx)(K.Fragment,{children:q.map((e,t)=>(0,K.jsxs)(`span`,{children:[t>0?t===q.length-1?`, or `:`, `:``,(0,K.jsx)(J,{children:e})]},e))})}function ae(){return(0,K.jsxs)(K.Fragment,{children:[`No skills yet. Drop Markdown files into `,(0,K.jsx)(Y,{}),` (agent mirrors like`,` `,(0,K.jsx)(J,{children:`.claude/skills/`}),` work too) — optional frontmatter: `,(0,K.jsx)(J,{children:`name`}),`,`,` `,(0,K.jsx)(J,{children:`description`}),`. Global (`,(0,K.jsx)(J,{children:`~/.agents/skills`}),`) and team-repo skills appear here too — try Refresh.`]})}var X=2e3,Z=5*6e4;async function oe(e,t,n={}){let{apply:r=f,read:i=g,wait:a=e=>new Promise(t=>setTimeout(t,e)),now:o=Date.now,onDropped:s=N}=n;try{return await r(e)}catch(n){if(!(n instanceof u)||n.status!==0&&n.status!==409)throw n;let r=e=>{n.status===0&&s(e)},c=o()+Z;for(;;){let s;try{s=await i(e)}catch{throw r(`unreachable`),n}if(s.status!==`updating`){if(s.updatedAt&&s.updatedAt!==t)return r(`recovered`),s;throw r(`not_applied`),n}if(o()>=c)throw r(`timed_out`),n;await a(X)}}}function Q(e){return e===`project`?`Project installation`:`Global installation`}function se({projectId:e,state:t,loadError:n}){let i=r(),o=te(),s=(0,G.useRef)(0),[c,l]=(0,G.useState)(!1),u=a({mutationFn:()=>ee({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=>{M(`skills_import`),l(!1),o(j(e))},onError:e=>x(e.message,{tone:`danger`})}),f=(t,n)=>{n.seq===s.current&&(i.setQueryData(p.skillsUpdate(e),t),n.action===`apply`&&t.updatedAt&&t.updatedAt!==n.previousUpdatedAt&&(i.invalidateQueries({queryKey:h.skills}),x(t.status===`error`?`Some skill updates failed.`:`Open Mercato skills updated.`),l(!0)))},m=(e,t)=>{t.seq===s.current&&x(e.message,{tone:`danger`})},g=a({mutationFn:t=>d(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>f(e,t),onError:(e,t)=>m(e,t)}),_=a({mutationFn:t=>oe(e,t.previousUpdatedAt).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>f(e,t),onError:(e,t)=>m(e,t)}),b=e=>{let n=++s.current;e===`apply`?_.mutate({action:e,seq:n,previousUpdatedAt:t?.updatedAt??null}):g.mutate({action:e,seq:n})},S=t?.scopes??[],C=S.filter(e=>e.skills.length>0),A=C.length>0,N=t?.status===`error`,P=A&&(t?.available||N),F=_.isPending||t?.status===`updating`,I=S.filter(e=>e.status===`error`||e.status===`unavailable`),L=S.filter(e=>e.updatedAt&&!I.includes(e)),R=`Checking installed Open Mercato skills…`;return n?R=`Update status is unavailable right now.`:t?.status===`available`?R=`An update is available for your installed Open Mercato skills.`:t?.status===`updating`?R=`Updating installed Open Mercato skills…`:t?.status===`current`&&!A?R=t.needsUpgradeNotes?`Skill files were updated.`:`No installed Open Mercato skills are tracked for updates.`:t?.status===`current`?R=`Installed Open Mercato skills are up to date.`:t?.status===`unavailable`?R=t.scopes.find(e=>e.reason)?.reason??`Automatic updates are unavailable.`:t?.status===`error`&&(R=`The update did not finish for every installation.`),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`section`,{"data-slot":`skills-update-card`,"aria-live":`polite`,className:`rounded-lg border border-border bg-muted/30 p-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`text-ui font-medium text-foreground`,children:R}),t?.checkedAt?(0,K.jsxs)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:[`Last checked `,new Date(t.checkedAt).toLocaleString(),`.`]}):null,C.length>0?(0,K.jsx)(`ul`,{className:`mt-1 text-xs text-soft-foreground`,children:C.map(e=>(0,K.jsxs)(`li`,{children:[Q(e.scope),` · `,e.skills.length,` tracked`]},e.scope))}):null,I.length>0?(0,K.jsxs)(`p`,{className:`mt-1 text-xs text-destructive`,children:[`Failed: `,I.map(e=>Q(e.scope)).join(`, `),L.length?`; updated: `+L.map(e=>Q(e.scope)).join(`, `):``,`.`]}):null]}),P?(0,K.jsxs)(y,{"data-action":`skills-update-apply`,size:`sm`,disabled:F,onClick:()=>b(`apply`),children:[(0,K.jsx)(V,{"aria-hidden":`true`,className:v(`size-3.5`,F&&`motion-safe:animate-spin`)}),F?`Updating…`:N?`Retry`:`Update now`]}):t?.status===`current`?(0,K.jsx)(y,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:g.isPending,onClick:()=>b(`check`),children:`Check again`}):t?.status===`unavailable`||n?(0,K.jsx)(y,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:g.isPending,onClick:()=>b(`check`),children:`Retry check`}):null]}),t?.status===`unavailable`||n?(0,K.jsxs)(`div`,{className:`mt-2 text-xs text-soft-foreground`,children:[`Manual examples: `,(0,K.jsx)(`code`,{children:`npx skills update -p`}),` · `,(0,K.jsx)(`code`,{children:`npx skills update -g`}),`. These broad commands may update other tracked sources.`]}):null,t?.needsUpgradeNotes?(0,K.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,K.jsx)(B,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-primary`}),(0,K.jsxs)(`span`,{children:[`Skill files were updated. Run `,(0,K.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` in each configured repository to apply descriptor migrations while preserving local edits.`]})]}):null]}),(0,K.jsx)(T,{open:c,onOpenChange:e=>u.isPending?void 0:l(e),children:(0,K.jsxs)(k,{"data-slot":`skills-upgrade-notes-dialog`,showCloseButton:!1,children:[(0,K.jsxs)(E,{children:[(0,K.jsx)(w,{children:`Apply the upgrade notes now?`}),(0,K.jsxs)(O,{children:[`The skill files were updated successfully. Start a new session with`,` `,(0,K.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` to sync repository descriptors while preserving local edits?`]})]}),(0,K.jsxs)(D,{children:[(0,K.jsx)(y,{type:`button`,variant:`outline`,disabled:u.isPending,onClick:()=>l(!1),children:`No`}),(0,K.jsx)(y,{type:`button`,disabled:u.isPending,onClick:()=>u.mutate(),children:u.isPending?`Starting…`:`Yes, start session`})]})]})})]})}function ce(e,t){let n=e?.importedSkills;return Array.isArray(n)?n.filter(e=>typeof e==`string`&&!!e):[...t]}function le(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 $(){return(0,K.jsxs)(`div`,{"data-route":`skills`,className:`flex min-h-full flex-col`,children:[(0,K.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,K.jsx)(`h1`,{className:`text-base font-semibold`,children:`Skills`}),(0,K.jsx)(`p`,{className:`text-ui text-muted-foreground`,children:`Markdown playbooks agents can follow.`})]}),(0,K.jsx)(ue,{})]})}function ue(){let e=S()??``,t=c(e,!!e),n=i(),ee=l(),u=s(),[d]=b(),[f,p]=(0,G.useState)(``),[g,te]=(0,G.useState)(null),w=r(),T=m(),E=u.data??[],D=(0,G.useMemo)(()=>E.map(e=>e.name),[E]),O=(0,G.useMemo)(()=>new Set(D),[D]),k=(0,G.useMemo)(()=>new Set(ce(T.data,D)),[T.data,D]),j=(0,G.useRef)(Promise.resolve()),M=(0,G.useRef)(0),N=(0,G.useCallback)(t=>{let n=h.uiState,r=h.skills,i=w.getQueryData(n),a=ce(i,D),s=a.includes(t)?a.filter(e=>e!==t):[...a,t];w.setQueryData(n,{...i,importedSkills:s});let c=++M.current;j.current=j.current.then(async()=>{try{let t=await o({importedSkills:s},e);if(c!==M.current)return;w.setQueryData(n,t),w.invalidateQueries({queryKey:r})}catch(e){if(c!==M.current)return;x(e instanceof Error?e.message:String(e),{tone:`danger`}),w.invalidateQueries({queryKey:n})}})},[D,e,w]),L=a({mutationFn:()=>_(),onSuccess:e=>{w.setQueryData(h.skills,e),x(`Team skills refreshed.`)},onError:e=>x(e.message,{tone:`danger`})});if(n.isError)return(0,K.jsx)(H,{icon:(0,K.jsx)(ne,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:n.error.message});let B=z(n.data??[]),U=new Set(B.map(e=>e.name)),W=z([...B.map(e=>({...e,enabled:e.source===`team`&&O.has(e.name)?k.has(e.name):!0})),...E.filter(e=>!U.has(e.name)).map(e=>({...e,enabled:k.has(e.name)}))].sort((e,t)=>e.name.localeCompare(t.name))),q=d.get(`skill`),J=W.find(e=>e.name===q)??(q===null?W.find(e=>e.enabled):null)??null,Y=J?.name??null,X=J?le(J,O,T.isPending,N,u.isError):void 0,Z=F(W),oe=Z.map(e=>e.key),Q=g!==null&&oe.includes(g)?g:null,$=F(R(Q===null?W:W.filter(e=>(e.team?.repo??``)===Q),f)),ue=$.flatMap(e=>e.skills);return(0,K.jsxs)(`div`,{"data-slot":`skills-section`,className:`flex min-h-full flex-1 items-stretch`,children:[(0,K.jsxs)(`section`,{"data-slot":`skills-list`,className:v(`w-full flex-col border-border md:flex md:w-96 md:shrink-0 md:border-r`,`md:sticky md:top-14 md:max-h-[calc(100dvh-(var(--spacing)*14))]`,q===null||!J?`flex`:`hidden md:flex`),children:[(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 p-3 pb-2`,children:[(0,K.jsx)(re,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:f,onChange:e=>p(e.target.value),className:`h-8 text-ui`}),(0,K.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,title:`git fetch the team skills repos`,disabled:L.isPending,onClick:()=>L.mutate(),className:`flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[(0,K.jsx)(V,{"aria-hidden":`true`,className:v(`size-3`,L.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),Z.length>1?(0,K.jsx)(`div`,{className:`shrink-0 px-3 pb-2`,children:(0,K.jsxs)(`select`,{"data-slot":`skills-repo-filter`,"aria-label":`Filter by repository`,value:Q??`__all__`,onChange:e=>te(e.target.value===`__all__`?null:e.target.value),className:`h-8 w-full rounded-md border border-border bg-card px-2 text-ui text-foreground outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:[(0,K.jsx)(`option`,{value:`__all__`,children:`All repositories`}),Z.map(e=>(0,K.jsxs)(`option`,{value:e.key,children:[e.label,` (`,e.skills.length,`)`]},e.key))]})}):null,e?(0,K.jsx)(`div`,{className:`shrink-0 px-3 pb-2`,children:(0,K.jsx)(se,{projectId:e,state:t.data,loadError:t.error})}):null,u.isError?(0,K.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,K.jsxs)(`p`,{className:`min-w-0`,children:[`Could not load the Open Mercato skills catalog. Team skills may be missing until it loads.`,` `,u.error.message]}),(0,K.jsx)(y,{type:`button`,"data-action":`skills-importable-retry`,variant:`ghost`,size:`sm`,disabled:u.isFetching,onClick:()=>void u.refetch(),children:`Retry`})]}):null,(0,K.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,K.jsx)(`li`,{className:`px-2.5 py-2 text-ui text-soft-foreground`,children:`Loading…`}):ue.length>0?$.map(e=>(0,K.jsxs)(`li`,{"data-slot":`skill-group`,"data-group":e.key||`local`,className:`list-none`,children:[Z.length>1?(0,K.jsx)(`h3`,{className:`px-2.5 pt-2 pb-1 eyebrow text-soft-foreground`,children:e.label}):null,(0,K.jsx)(`ul`,{className:`space-y-1`,children:e.skills.map(e=>(0,K.jsx)(de,{skill:e,active:Y===e.name,activation:le(e,O,T.isPending,N,u.isError)},e.name))})]},e.key)):(0,K.jsx)(`li`,{className:`px-2.5 py-2 text-xs leading-relaxed text-soft-foreground`,children:W.length>0?`(no skills match)`:(0,K.jsx)(ae,{})})})]}),(0,K.jsx)(`section`,{"data-slot":`skills-detail`,className:v(`min-w-0 flex-1 flex-col`,q===null||!J?`hidden md:flex`:`flex`),children:(0,K.jsx)(`div`,{className:`min-w-0 flex-1 px-4 py-4 md:px-7 md:py-5`,children:J?(0,K.jsxs)(K.Fragment,{children:[q===null?null:(0,K.jsxs)(C,{to:`/skills`,"data-slot":`skills-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,K.jsx)(P,{"aria-hidden":`true`,className:`size-3.5`}),`Back to skills`]}),(0,K.jsx)(ie,{skill:J,enabled:J.enabled,activation:X,usedBy:I(ee.data?.workflows??[],J.name)})]}):n.isPending?null:(0,K.jsx)(H,{icon:(0,K.jsx)(A,{}),tone:`neutral`,heading:`h2`,title:`No skill selected`,subtitle:`Pick a skill from the catalog.`})})})]})}function de({skill:e,active:t,activation:n}){let r=L(e),i=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,K.jsx)(`span`,{className:v(`min-w-0 truncate font-mono text-ui`,e.enabled?`font-semibold text-foreground`:`font-medium text-muted-foreground`),children:e.name}),(0,K.jsx)(W,{source:e.source,teamRepo:e.team?.repo,className:`ml-auto`})]}),e.description?(0,K.jsx)(`span`,{className:`line-clamp-2 text-xs text-soft-foreground`,children:e.description}):null]});return(0,K.jsxs)(`li`,{className:v(`flex min-w-0 items-start gap-0 rounded-md transition-colors hover:bg-muted`,t&&`bg-muted`),children:[n?(0,K.jsx)(U,{"data-slot":`skill-activation`,"aria-label":n.ariaLabel,checked:n.checked,disabled:n.disabled,onCheckedChange:n.onCheckedChange,size:`sm`,className:`mt-2.5 ml-2 shrink-0`}):null,(0,K.jsx)(C,{to:`/skills?skill=${encodeURIComponent(e.name)}`,"data-slot":`skill-row`,"data-skill":e.name,"data-project":r?`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:i})]})}export{$ as SkillsRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e}from"./button-
|
|
1
|
+
import{F as e}from"./button-BvYDiOkd.js";var t=e(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),n=e(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]);export{t as n,n 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{C as r,D as i,E as a,P as o,S as s,T as c,r as l,x as u}from"./button-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{C as r,D as i,E as a,P as o,S as s,T as c,r as l,x as u}from"./button-BvYDiOkd.js";import{d,f,m as p,p as m}from"./icon-tooltip-nRvCJxOH.js";var h=e(t(),1),g=n(),_=`Tabs`,[v,y]=a(_,[m]),b=m(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,onValueChange:o,defaultValue:s,orientation:c=`horizontal`,dir:l,activationMode:d=`automatic`,...f}=e,m=p(l),[h,v]=r({prop:a,onChange:o,defaultProp:s??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:u(),value:h,onValueChange:v,orientation:c,dir:m,activationMode:d,children:(0,g.jsx)(i.div,{dir:m,"data-orientation":c,...f,ref:t})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...a}=e,o=S(w,n),s=b(n);return(0,g.jsx)(f,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:(0,g.jsx)(i.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:a=!1,...o}=e,s=S(E,n),l=b(n),u=A(s.baseId,r),f=j(s.baseId,r),p=r===s.value;return(0,g.jsx)(d,{asChild:!0,...l,focusable:!a,active:p,children:(0,g.jsx)(i.button,{type:`button`,role:`tab`,"aria-selected":p,"aria-controls":f,"data-state":p?`active`:`inactive`,"data-disabled":a?``:void 0,disabled:a,id:u,...o,ref:t,onMouseDown:c(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?s.onValueChange(r):e.preventDefault()}),onKeyDown:c(e.onKeyDown,e=>{a||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&s.onValueChange(r)}),onFocus:c(e.onFocus,()=>{let e=s.activationMode!==`manual`;!p&&!a&&e&&s.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:a,children:o,...c}=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:a||f,children:({present:n})=>(0,g.jsx)(i.div,{"data-state":f?`active`:`inactive`,"data-orientation":l.orientation,role:`tabpanel`,"aria-labelledby":u,hidden:!n,id:d,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&o})})});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:l(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var L=o(`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:l(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:l(`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:l(`flex-1 outline-none`,e),...t})}export{z as i,B as n,R as r,I as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e}from"./button-
|
|
1
|
+
import{F as e}from"./button-BvYDiOkd.js";var t=e(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]);export{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{er as i,gt as a,vt as o,yt as s}from"./queries-
|
|
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{er as i,gt as a,vt as o,yt as s}from"./queries-DsfjHsrp.js";import{r as c,t as l}from"./button-BvYDiOkd.js";import{t as u,w as d}from"./project-router-7DKoABD3.js";import{t as f}from"./use-desktop-BNN3U2y9.js";import{Xt as p,n as m,r as h,t as g}from"./git-tab-loading-8Y0ID8J2.js";import{t as _}from"./arrow-left-CvmEanh8.js";import{s as v}from"./git-toolbar-CSrf6Ux9.js";import{n as y}from"./upload-Crivm77f.js";import{t as b}from"./triangle-alert-BhQYv6Is.js";import{t as x}from"./search-x-Cm22V3TC.js";import{n as S}from"./lib-C4vuyY62.js";import{t as C}from"./centered-state-Bpq40Y_t.js";import{t as w}from"./diff-DfTKq2z2.js";import{t as T}from"./commit-list-DalU6p3i.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}=d(),t=a(e);return t.isPending?(0,M.jsx)(m,{tab:`changes`}):t.isError?(0,M.jsx)(g,{tab:`changes`,error:t.error}):(0,M.jsx)(P,{run:t.data})}function P({run:e,embedded:t=!1,stateKey:n}){let{sha:r}=d(),[a,o]=A(n,null),u=t?a??void 0:r,f=s(e.id,p(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)(h,{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)(l,{variant:`ghost`,size:`xs`,"data-action":`all-commits`,onClick:()=>o(null),children:[(0,M.jsx)(_,{"aria-hidden":`true`}),`All commits`]})}):null,(0,M.jsx)(F,{runId:e.id,sha:u},u)]}):f.isPending?(0,M.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commits…`}):f.isError?(0,M.jsx)(C,{icon:(0,M.jsx)(y,{}),tone:f.error instanceof i&&f.error.status===409?`neutral`:`danger`,heading:`h2`,title:f.error instanceof i&&f.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:f.error.message}):f.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:f.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=o(e,t),r=f(),[a,s]=(0,E.useState)(`unified`),[c,d]=(0,E.useState)(!1),p=n.isError&&n.error instanceof i&&n.error.status===409,m=r?a:`unified`,h=!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)(l,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,M.jsxs)(u,{to:`/tasks/${e}/commits`,children:[(0,M.jsx)(_,{"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:a,wrap:c,onModeChange:s,onWrapChange:d})})]}),n.isPending?(0,M.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):n.isError?(0,M.jsx)(C,{icon:p?(0,M.jsx)(x,{}):(0,M.jsx)(b,{}),tone:p?`neutral`:`danger`,heading:`h2`,title:p?`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:m,wrap:h,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{gt as r}from"./queries-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{gt as r}from"./queries-DsfjHsrp.js";import{t as i}from"./project-router-7DKoABD3.js";import{r as a}from"./git-tab-loading-8Y0ID8J2.js";import{n as o}from"./textarea-D6BGJB7j.js";import{n as s}from"./terminal-BIKtPgmL.js";import{t as c}from"./centered-state-Bpq40Y_t.js";import{FloatingPanel as l,a as u,c as d,d as f,f as p,h as m,i as h,l as g,m as _,n as v,o as y,p as b,r as x,s as S,t as C,u as w}from"./workflow-graph-DJLPSGD3.js";var T=e(t(),1),E=n();function D({data:e}){let{node:t,state:n,childRunId:r}=e;return r?(0,E.jsx)(O,{node:t,state:n,childRunId:r}):(0,E.jsx)(C,{node:t,connectable:!1,status:n.status,loopCount:n.loopCount,iterations:n.iterations,costUsd:n.costUsd})}function O({node:e,state:t,childRunId:n}){let i=r(n).data,a=i&&i.steps.length>1?i.steps.map(e=>({id:e.id,name:e.name??e.id,status:e.status})):void 0;return(0,E.jsx)(C,{node:e,connectable:!1,status:t.status,costUsd:i?.costUsd??t.costUsd,inner:a,subtaskTo:`/tasks/${n}/graph`})}var k={live:D};function A({run:e,embedded:t=!1}){let n=e.workflowDef,r=(0,T.useMemo)(()=>n?u(n):null,[n]),i=(0,T.useMemo)(()=>r?g(r,e):null,[r,e]),[s,C]=(0,T.useState)(null),D=r?.nodes.find(e=>e.id===s),O=(0,T.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`},...j(e,t.id)}})):[],[r,i]),A=(0,T.useMemo)(()=>r?y(r):new Set,[r]),N=(0,T.useMemo)(()=>r?v(r,A):new Map,[r,A]),P=(0,T.useMemo)(()=>!r||!i?[]:r.nodes.flatMap(e=>d(e).flatMap(t=>{let n=w(r,e.id,t);if(!n)return[];let a=`${e.id}.${t}->${n}`,o=i.edges.get(a)??0,s=A.has(`${e.id}.${t}->${n}`),c=(r.layout?.[n]?.x??0)<=(r.layout?.[e.id]?.x??0),l=x({tone:S(e,t),back:s,emphasis:o?`taken`:`dim`});return[{id:a,source:e.id,sourceHandle:t,target:n,type:s||c||N.has(a)?`lane`:`default`,...N.has(a)?{data:{lane:N.get(a)}}:{},label:o>1?`×${o}`:void 0,style:l,markerEnd:{type:m.ArrowClosed,color:l.stroke,width:14,height:14},labelStyle:{fill:`var(--muted-foreground)`,fontSize:10,fontWeight:600},labelBgStyle:{fill:`var(--background)`}}]})),[r,i,A,N]);return(0,E.jsxs)(`div`,{"data-route":`task-graph`,className:`flex h-full min-h-0 flex-col`,children:[t?null:(0,E.jsx)(a,{run:e,tab:`graph`}),r?(0,E.jsxs)(`div`,{className:`relative min-h-[420px] flex-1`,children:[(0,E.jsxs)(_,{nodes:O,edges:P,nodeTypes:k,edgeTypes:h,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,onNodeClick:(e,t)=>C(t.id),onPaneClick:()=>C(null),fitView:!0,fitViewOptions:{padding:.2,maxZoom:1.2},minZoom:.2,colorMode:`system`,proOptions:{hideAttribution:!0},children:[(0,E.jsx)(f,{variant:p.Dots,gap:18,size:1}),(0,E.jsx)(b,{showInteractive:!1})]}),D&&i?(0,E.jsx)(l,{side:`right`,label:`Node details`,title:D.name??D.id,onClose:()=>C(null),children:(0,E.jsx)(M,{state:i.nodes.get(D.id)??{status:`pending`},outputs:e.graphState?.outputs?.[D.id],childRunId:j(e,D.id).childRunId,loopMax:D.type===`loop`?D.max:void 0})}):null]}):(0,E.jsx)(c,{icon:(0,E.jsx)(o,{}),tone:`neutral`,title:`No workflow graph`,subtitle:`This task has no stored workflow definition to draw.`})]})}function j(e,t){let n=e.graphState?.outputs?.[t]?.runId;return typeof n==`string`&&n?{childRunId:n}:{}}function M({state:e,outputs:t,loopMax:n,childRunId:r}){let a=[[`status`,e.status===`reached`?`passed through`:e.status]];e.iterations&&a.push([`runs`,String(e.iterations)]),e.costUsd&&a.push([`cost`,`$${e.costUsd.toFixed(2)}`]),e.loopCount!==void 0&&a.push([`iterations`,`${e.loopCount}${n?` / ${n}`:``}`]);let o=Object.entries(t??{}).filter(([,e])=>e!==``);return(0,E.jsxs)(`div`,{className:`space-y-4 p-4 text-label`,children:[(0,E.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1`,children:a.map(([e,t])=>(0,E.jsxs)(`div`,{className:`contents`,children:[(0,E.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,E.jsx)(`dd`,{children:t})]},e))}),r?(0,E.jsxs)(i,{to:`/tasks/${r}`,className:`inline-flex items-center gap-1 text-primary hover:underline`,children:[`Open the subtask `,(0,E.jsx)(s,{className:`size-3`})]}):null,(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`mb-1 eyebrow text-muted-foreground`,children:`Outputs`}),o.length===0?(0,E.jsx)(`p`,{className:`text-meta text-muted-foreground`,children:`Nothing yet — outputs appear once the node has run.`}):o.map(([e,t])=>(0,E.jsxs)(`div`,{className:`mb-2`,children:[(0,E.jsx)(`code`,{className:`text-meta text-muted-foreground`,children:e}),(0,E.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{A 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{M as r,gt as i,wt as a}from"./queries-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{M as r,gt as i,wt as a}from"./queries-DsfjHsrp.js";import{c as o,w as s}from"./project-router-7DKoABD3.js";import{G as c,J as l,et as u,n as d,q as f,r as p,t as m}from"./git-tab-loading-8Y0ID8J2.js";import{t as h}from"./markdown-BBnagS_c.js";import{t as g}from"./layout-cards-n-2Pwe6c.js";var _=e(t(),1),v=n();function y(){let{id:e}=s(),t=i(e);return t.isPending?(0,v.jsx)(d,{tab:`notes`}):t.isError?(0,v.jsx)(m,{tab:`notes`,error:t.error}):(0,v.jsxs)(`div`,{"data-route":`task-notes`,className:`flex min-h-full flex-col`,children:[(0,v.jsx)(b,{run:t.data}),(0,v.jsx)(`div`,{className:`mx-auto w-full max-w-[var(--measure)] px-3 py-3 md:px-6 md:py-5`,children:(0,v.jsx)(S,{runId:t.data.id})})]})}function b({run:e}){let t=o(),n=r().data?.capabilities?.terminal===!0,i=(0,_.useMemo)(()=>l.filter(t=>(t!==`graph`||!!e.workflowDef)&&(t!==`terminal`||n)),[e.workflowDef,n]),{hints:a,show:s}=f((0,_.useMemo)(()=>c(i),[i]));return(0,v.jsx)(p,{run:e,tab:`notes`,tabs:(0,_.useMemo)(()=>(0,v.jsx)(g,{keyHints:a,showKeyHints:s,layouts:[],active:``,fixedViews:i,onSelectFixed:n=>t(`/tasks/${e.id}/${u[n]}`),onSelect:x,onClose:x,notesHref:`/tasks/${e.id}/notes`,notesActive:!0,showLayouts:!1}),[i,t,e.id,a,s]),wide:!0})}var x=()=>{};function S({runId:e}){let t=a(e);return(0,v.jsx)(`div`,{"data-slot":`notes-panel`,children:t.isPending?(0,v.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`Loading notes…`}):t.isError?(0,v.jsx)(`p`,{className:`text-xs text-danger`,children:t.error.message}):t.data.trim().length>0?(0,v.jsx)(h,{children:t.data}):(0,v.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`No notes yet — the handoff file is seeded when the task starts.`})})}export{y as TaskNotesRoute};
|