@hearsay-tools/squawk 0.18.0-pr4371.8549 → 0.18.0-pr4393.8573
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/ci-wait/controller.d.ts +7 -7
- package/dist/ci-wait/errors.js +2 -1
- package/dist/ci-wait/errors.js.map +1 -1
- package/dist/ci-wait/pr-wait-kind.d.ts +1 -0
- package/dist/ci-wait/pr-wait-kind.js +5 -4
- package/dist/ci-wait/pr-wait-kind.js.map +1 -1
- package/dist/ci-wait/supervisor.js +42 -13
- package/dist/ci-wait/supervisor.js.map +1 -1
- package/dist/ci-wait/tool-catalog.js +1 -1
- package/dist/ci-wait/tool-catalog.js.map +1 -1
- package/dist/contract/ci-wait.d.ts +17 -0
- package/dist/contract/index.js +31 -2
- package/dist/contract/runs.d.ts +36 -0
- package/dist/contract/session-context.d.ts +54 -8
- package/dist/contract/wait-tools.d.ts +8 -0
- package/dist/contract/waits.d.ts +12 -0
- package/dist/data-gitignore.js +1 -0
- package/dist/data-gitignore.js.map +1 -1
- package/dist/delegation/routes.d.ts +65 -65
- package/dist/runners/claude/config-files.js +1 -1
- package/dist/runners/claude/config-files.js.map +1 -1
- package/dist/runners/pi/display.d.ts +1 -1
- package/dist/runners/pi/display.js +1 -1
- package/dist/runs/run-archive.d.ts +3 -0
- package/dist/runs/run-decode.d.ts +15 -0
- package/dist/runs/run-exits.d.ts +14 -0
- package/dist/server/automations-routes.d.ts +150 -150
- package/dist/server/project-settings-routes.d.ts +107 -107
- package/dist/server/projects-routes.d.ts +45 -45
- package/dist/server/repo-routes.d.ts +13 -13
- package/dist/server/runner-install-routes.d.ts +10 -10
- package/dist/server/runners-routes.d.ts +10 -10
- package/dist/server/runs-routes.d.ts +27 -0
- package/dist/server/server.d.ts +176 -82
- package/dist/server/session-context-routes.d.ts +35 -15
- package/dist/server/session-context-routes.js +6 -6
- package/dist/server/session-context-routes.js.map +1 -1
- package/dist/session-context-file.d.ts +3 -3
- package/dist/session-context-file.js +45 -16
- package/dist/session-context-file.js.map +1 -1
- package/dist/session-context.d.ts +18 -9
- package/dist/session-context.js +118 -47
- package/dist/session-context.js.map +1 -1
- package/dist/workflows/continuation-admission.d.ts +3 -0
- package/dist/workflows/input-acknowledgement.d.ts +1 -0
- package/dist/workflows/run/wait-engine.d.ts +3 -0
- package/dist/workflows/run/wait-input-descriptors.js +1 -0
- package/dist/workflows/run/wait-input-descriptors.js.map +1 -1
- package/dist/workflows/run/wait-kinds.d.ts +2 -0
- package/dist/workflows/waits.js +2 -2
- package/dist/workflows/waits.js.map +1 -1
- package/package.json +4 -4
- package/web/dist/assets/accounts-section-COizLyTO.js +1 -0
- package/web/dist/assets/{activity-motion-0wHCeUs7.css → activity-motion-DcKVM8fM.css} +1 -1
- package/web/dist/assets/activity-motion-DfI5xoMG.js +2 -0
- package/web/dist/assets/activity-route-BQs2vBeo.js +1 -0
- package/web/dist/assets/agent-config-section-BwBo-HRw.js +7 -0
- package/web/dist/assets/agent-defaults-section-h-Gjb_gh.js +1 -0
- package/web/dist/assets/appearance-Bcl2amXv.js +1 -0
- package/web/dist/assets/archive-on-merge-field-Bm8miJjt.js +1 -0
- package/web/dist/assets/attention-8bNiiAFt.js +1 -0
- package/web/dist/assets/automations-route-CutF-cGn.css +1 -0
- package/web/dist/assets/automations-route-rSezHxBp.js +2 -0
- package/web/dist/assets/{badge-D9JrXe0o.js → badge-DQ3U69Ht.js} +1 -1
- package/web/dist/assets/{button-BQ2y4XRB.js → button-B7MKxYjT.js} +1 -1
- package/web/dist/assets/change-counts-CW7O8g5Y.js +1 -0
- package/web/dist/assets/check-OP-CVgZG.js +1 -0
- package/web/dist/assets/circle-x-7nTlobAF.js +1 -0
- package/web/dist/assets/{command-CDt1BsZy.js → command-KdW7aO0N.js} +1 -1
- package/web/dist/assets/commit-list-DtEqtn9o.js +1 -0
- package/web/dist/assets/{dialog-BVF6dIeS.js → dialog-B531GGAo.js} +1 -1
- package/web/dist/assets/diff-BK789dS0.js +3 -0
- package/web/dist/assets/diff-controls-BFqQNxRu.js +1 -0
- package/web/dist/assets/diff-view-BEgQ7jZV.js +11 -0
- package/web/dist/assets/dist-Czz3Y5qH.js +1 -0
- package/web/dist/assets/file-preview-CDWTFZ4P.js +2 -0
- package/web/dist/assets/{folder-browser-Bn83Rjyn.js → folder-browser-BfclRPcX.js} +1 -1
- package/web/dist/assets/format-BU7D3IfE.js +1 -0
- package/web/dist/assets/git-toolbar-Pugtjt-9.js +1 -0
- package/web/dist/assets/github-CvpaGHe6.js +1 -0
- package/web/dist/assets/global-activity-route-Di_ICsRI.js +1 -0
- package/web/dist/assets/hourglass-CikYdGGQ.js +1 -0
- package/web/dist/assets/image-preview-Dx2w5oIn.js +1 -0
- package/web/dist/assets/index-CGjknHnV.css +1 -0
- package/web/dist/assets/index-CJFT0IZP.js +21 -0
- package/web/dist/assets/{label-tOtTf55G.js → label-DEH7fJN4.js} +1 -1
- package/web/dist/assets/{live-reads-CR3-q01w.js → live-reads-BJ9eDISf.js} +1 -1
- package/web/dist/assets/live-refetch-VoLPvzhe.js +1 -0
- package/web/dist/assets/loader-circle-CPBhhDbB.js +1 -0
- package/web/dist/assets/{markdown-C6YMilQS.js → markdown-Dv0r75AX.js} +1 -1
- package/web/dist/assets/{notifications-section-Ceh7_qob.js → notifications-section-DCiqPl3M.js} +1 -1
- package/web/dist/assets/open-in-menu-HM5l7Bwk.js +1 -0
- package/web/dist/assets/{preview-pane-connected-Ca9btxCQ.js → preview-pane-connected-WV9oolnn.js} +3 -3
- package/web/dist/assets/{project-location-C9WLgY3A.js → project-location-CfJLc6aJ.js} +1 -1
- package/web/dist/assets/{project-router-DucFIl_x.js → project-router-Bii3ofOk.js} +1 -1
- package/web/dist/assets/{project-scope-context-C912rTJP.js → project-scope-context-BdqKyBHa.js} +3 -3
- package/web/dist/assets/projects-section-D2cACaaG.js +1 -0
- package/web/dist/assets/prompt-templates-section-toLPd5u2.js +1 -0
- package/web/dist/assets/queries-C7VNk-nW.js +1 -0
- package/web/dist/assets/{reference-chip-zRuFkaGy.js → reference-chip-rylFalfg.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-mnASAu6Z.js → remote-settings-notice-N9vtBTIK.js} +1 -1
- package/web/dist/assets/repo-git-DJym0aRY.js +1 -0
- package/web/dist/assets/{report-reader-CAi5A1hx.js → report-reader-CjskGtxS.js} +1 -1
- package/web/dist/assets/reports-B-G9HA48.js +1 -0
- package/web/dist/assets/reports-CNFNb36Z.css +1 -0
- package/web/dist/assets/resources-section-B88h1y0Q.js +1 -0
- package/web/dist/assets/run-header-B-olCSdg.js +2 -0
- package/web/dist/assets/{run-header-CC7VUTg9.css → run-header-Ccnr9k0X.css} +1 -1
- package/web/dist/assets/save-cue-Cd3ZAPBS.js +1 -0
- package/web/dist/assets/select-BaydzE-I.js +1 -0
- package/web/dist/assets/session-context-section-BJKRXbss.js +119 -0
- package/web/dist/assets/settings-agent-picker-6xZMIC_D.js +1 -0
- package/web/dist/assets/settings-field-DP9sYv5a.js +1 -0
- package/web/dist/assets/settings-select-CCIMGnyA.js +1 -0
- package/web/dist/assets/settings-shell-BkTgs1S9.js +1 -0
- package/web/dist/assets/settings-shell-iSd4xMWS.css +1 -0
- package/web/dist/assets/{sidebar-section-D9xKMCxo.js → sidebar-section-B57HIEgv.js} +1 -1
- package/web/dist/assets/skills-pBrfwrKF.js +1 -0
- package/web/dist/assets/{status-dot-DtAOFiIi.js → status-dot-BRzVlF2X.js} +1 -1
- package/web/dist/assets/switch-SP8pw5uU.js +1 -0
- package/web/dist/assets/{tab-link-Bh6CcIR7.js → tab-link-B1CULYRs.js} +1 -1
- package/web/dist/assets/task-changes-CXldTh93.js +1 -0
- package/web/dist/assets/task-commits-BZ3B_GPB.js +1 -0
- package/web/dist/assets/task-files-BSfmCkJc.js +1 -0
- package/web/dist/assets/{task-github-item-trHnGX_B.js → task-github-item-v2bygvdO.js} +1 -1
- package/web/dist/assets/{task-groups-ClNnAPRA.js → task-groups-BbnYlkYj.js} +1 -1
- package/web/dist/assets/task-thread-BPWnJ7Qx.js +9 -0
- package/web/dist/assets/task-thread-DzADOhZd.css +1 -0
- package/web/dist/assets/{tasks-table-CE_VVk0w.js → tasks-table-Cx7AM7lZ.js} +1 -1
- package/web/dist/assets/thread-state-R0MTvwlo.js +4 -0
- package/web/dist/assets/use-hand-to-agent-state-B6h6kcQg.css +1 -0
- package/web/dist/assets/use-hand-to-agent-state-BckHuhr8.js +1 -0
- package/web/dist/assets/{useInfiniteQuery-CPEWc6dl.js → useInfiniteQuery--iQKfpUQ.js} +1 -1
- package/web/dist/assets/useQuery-BSyhc3l3.js +1 -0
- package/web/dist/assets/workflows-BBc2PFDB.js +7 -0
- package/web/dist/assets/workflows-C6suai0L.css +1 -0
- package/web/dist/assets/workspace-tools-CiTG-ArW.js +1 -0
- package/web/dist/assets/worktrees-section-C07tNayi.js +4 -0
- package/web/dist/index.html +26 -24
- package/web/dist/assets/accounts-section-C4cUskp7.js +0 -1
- package/web/dist/assets/activity-motion-DIX3bcyB.js +0 -2
- package/web/dist/assets/activity-route-a6v44jSV.js +0 -1
- package/web/dist/assets/agent-config-section-CazTT2mr.js +0 -1
- package/web/dist/assets/agent-defaults-section-CsAvxnzW.js +0 -1
- package/web/dist/assets/appearance-Bk8WVWHF.js +0 -1
- package/web/dist/assets/archive-on-merge-field-CEyCpweg.js +0 -1
- package/web/dist/assets/attention-BFUaj1mU.js +0 -1
- package/web/dist/assets/automations-route--30oSCSi.js +0 -1
- package/web/dist/assets/commit-diff-panel-B5u3nzBH.js +0 -1
- package/web/dist/assets/diff-CVqwOFJx.js +0 -3
- package/web/dist/assets/diff-controls-BSWICnsb.js +0 -1
- package/web/dist/assets/diff-view-CfDyBNLk.js +0 -11
- package/web/dist/assets/dist-C28wFbz0.js +0 -1
- package/web/dist/assets/file-preview-BXBSy4MR.js +0 -2
- package/web/dist/assets/format-BNCkW110.js +0 -1
- package/web/dist/assets/git-toolbar-CKOW2Bjf.js +0 -1
- package/web/dist/assets/github-A2sjbmuv.js +0 -1
- package/web/dist/assets/global-activity-route-CZY9ssbt.js +0 -1
- package/web/dist/assets/hourglass-B0lPAJvT.js +0 -1
- package/web/dist/assets/image-preview-CNBuRrK5.js +0 -1
- package/web/dist/assets/index-2DP8fWMQ.css +0 -1
- package/web/dist/assets/index-Clu9VXJs.js +0 -21
- package/web/dist/assets/live-refetch-CZb2VOyu.js +0 -1
- package/web/dist/assets/open-in-menu-xzDJ4_Tv.js +0 -1
- package/web/dist/assets/projects-section-C6TNM8uI.js +0 -1
- package/web/dist/assets/prompt-templates-section-DHqBQdL-.js +0 -1
- package/web/dist/assets/queries-DRpvYgai.js +0 -1
- package/web/dist/assets/repo-git-Dc7y1A-S.js +0 -1
- package/web/dist/assets/reports-B7QAzibP.css +0 -1
- package/web/dist/assets/reports-C8NVgUwM.js +0 -1
- package/web/dist/assets/resources-section-CcCHCo4b.js +0 -1
- package/web/dist/assets/run-header-Dpr7e1J3.js +0 -2
- package/web/dist/assets/session-context-section-Ga1E-Y_8.js +0 -119
- package/web/dist/assets/settings-agent-picker-DTDM4RXo.js +0 -1
- package/web/dist/assets/settings-field-Bl6WuvGX.js +0 -1
- package/web/dist/assets/settings-shell-CTuW5ilp.js +0 -1
- package/web/dist/assets/settings-shell-xK8txSJo.css +0 -1
- package/web/dist/assets/skills-QSp2j0Ei.js +0 -1
- package/web/dist/assets/switch-Bv2Zf1uU.js +0 -1
- package/web/dist/assets/task-changes-C_1yQ3pc.js +0 -1
- package/web/dist/assets/task-commits-B156s4Br.js +0 -1
- package/web/dist/assets/task-files-DQyZkvNF.js +0 -1
- package/web/dist/assets/task-thread-B4DPy4Lk.js +0 -9
- package/web/dist/assets/task-thread-DtQ6uGfQ.css +0 -1
- package/web/dist/assets/thread-state-BsUveC05.js +0 -4
- package/web/dist/assets/use-hand-to-agent-state-C7esPJ-N.css +0 -1
- package/web/dist/assets/use-hand-to-agent-state-CtDcLIHc.js +0 -1
- package/web/dist/assets/useQuery-BOEhMTCg.js +0 -1
- package/web/dist/assets/workflows-BQkr2ayW.js +0 -7
- package/web/dist/assets/workflows-C21NystW.css +0 -1
- package/web/dist/assets/workspace-tools-aucXH9WE.js +0 -1
- package/web/dist/assets/worktrees-section-A8b6TByx.js +0 -4
|
@@ -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}from"./utils-DSMR_WLb.js";import{Ir as i,Lr as a,P as o,di as s}from"./project-scope-context-
|
|
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}from"./utils-DSMR_WLb.js";import{Ir as i,Lr as a,P as o,di as s}from"./project-scope-context-BdqKyBHa.js";import{Qt as c,y as l}from"./queries-C7VNk-nW.js";import{t as u}from"./button-B7MKxYjT.js";import{gn as d}from"./index-CJFT0IZP.js";var f=e(t(),1),p=n(),m=[[`overall`,`Overall`],[`needsYou`,`Needs You`],[`finished`,`Finished`],[`working`,`Working`]];function h(){let e=r(),t=l(e);return t.isPending?(0,p.jsx)(`p`,{role:`status`,className:`p-4 text-sm text-muted-foreground`,children:`Loading sidebar settings…`}):t.isError?(0,p.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,p.jsxs)(`p`,{role:`alert`,children:[`Sidebar settings did not load: `,t.error.message]}),(0,p.jsx)(u,{className:`min-h-[44px]`,onClick:()=>void t.refetch(),children:`Retry`})]}):(0,p.jsx)(g,{scope:e,initial:t.data.sidebarLimits??{}},e)}function g({scope:e,initial:t}){let n=s(),r=i(void 0),l=_(t),[h,g]=(0,f.useState)(()=>({values:l,saved:l,received:l})),{values:y,saved:b}=h,x=e=>g(t=>({...t,values:e})),S=a.safeParse(Object.fromEntries(m.map(([e])=>[e,y[e]===null?null:Number(y[e])]))),C=e=>y[e]!==null&&(y[e].trim()===``||!Number.isSafeInteger(Number(y[e]))||Number(y[e])<=0),w=m.some(([e])=>y[e]!==b[e]);d(w);let T=c({onMutate:()=>n.cancelQueries({queryKey:[e,`ui-state`],exact:!0}),mutationFn:t=>o({sidebarLimits:t},e),onSuccess:async t=>{await n.cancelQueries({queryKey:[e,`ui-state`],exact:!0}),n.setQueryData([e,`ui-state`],t);let r=_(t.sidebarLimits);g({values:r,saved:r,received:r})}});return!T.isPending&&!v(h.received,l)&&g({values:w?y:l,saved:l,received:l}),(0,p.jsxs)(`form`,{"data-slot":`sidebar-settings`,"data-reports-dirty":``,className:`flex w-full max-w-2xl flex-col gap-5 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6`,onSubmit:e=>{e.preventDefault(),S.success&&!m.some(([e])=>C(e))&&!T.isPending&&T.mutate(S.data)},children:[(0,p.jsx)(`p`,{id:`sidebar-limits-help`,className:`text-sm text-muted-foreground`,children:`Limits apply to this project on desktop and mobile. The overall budget is shared in section order: Needs You, Finished, then Working. Each section also respects its own limit. Unlimited removes only that constraint.`}),(0,p.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pinned tasks and groups containing a pin bypass both limits. A task group counts as one row. Archived uses only the overall limit; archived pins are not exempt.`}),m.map(([e,t])=>(0,p.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,p.jsx)(`label`,{htmlFor:`sidebar-${e}`,className:`text-sm font-medium`,children:t}),(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,p.jsx)(`input`,{id:`sidebar-${e}`,type:`number`,inputMode:`numeric`,min:`1`,step:`1`,value:y[e]??``,disabled:y[e]===null||T.isPending,"aria-invalid":C(e),"aria-describedby":C(e)?`sidebar-${e}-error sidebar-limits-help`:`sidebar-limits-help`,onChange:t=>x({...y,[e]:t.target.value}),className:`min-h-[44px] w-28 rounded-md border border-input bg-card px-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50`}),(0,p.jsxs)(`label`,{className:`flex min-h-[44px] cursor-pointer items-center gap-2 text-sm`,children:[(0,p.jsx)(`input`,{type:`checkbox`,"aria-label":`${t} Unlimited`,checked:y[e]===null,disabled:T.isPending,onChange:t=>x({...y,[e]:t.target.checked?null:String(r[e]??10)}),className:`size-4 accent-[var(--accent-strong)]`}),`Unlimited`]})]}),C(e)&&(0,p.jsx)(`p`,{id:`sidebar-${e}-error`,className:`text-sm text-danger`,children:`Enter a positive whole number or choose Unlimited.`})]},e)),(0,p.jsx)(u,{type:`submit`,className:`min-h-[44px] self-start`,variant:`primary`,disabled:!w||!S.success||m.some(([e])=>C(e))||T.isPending,children:T.isPending?`Saving…`:`Save sidebar limits`}),T.isError&&(0,p.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[`Could not save sidebar limits: `,T.error.message]}),T.isSuccess&&!w&&(0,p.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Sidebar limits saved.`})]})}function _(e){let t=i(e);return Object.fromEntries(m.map(([e])=>[e,t[e]===null?null:String(t[e])]))}function v(e,t){return m.every(([n])=>e[n]===t[n])}export{h as SidebarSection};
|
|
@@ -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{t as r}from"./utils-DSMR_WLb.js";import{d as i,u as a}from"./live-refetch-VoLPvzhe.js";import{S as o,di as s}from"./project-scope-context-BdqKyBHa.js";import{Bt as c,Wt as l,_ as u}from"./queries-C7VNk-nW.js";import{g as d}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as f}from"./toaster-Bo5vCbz-.js";import{O as p,T as m,X as h,Y as g,ct as _,l as v,ot as y,u as b}from"./design-icons-CzEoMH9c.js";import{t as x}from"./button-B7MKxYjT.js";import{t as S}from"./project-router-Bii3ofOk.js";import{f as C,l as w}from"./skills-pM_PouEs.js";import{En as T,V as E,Wn as D,bn as O}from"./index-CJFT0IZP.js";var k=e(t(),1),A=n(),j=e=>e.split(`@`)[0]||e,M={project:0,user:1,plugin:2,system:3,other:4},N={project:`This project`,user:`Your skills`,system:`Built in`,other:`Other`};function P(e){if(e.plugin)return{key:`plugin:${e.plugin}`,label:j(e.plugin),kind:`plugin`};let t=e.scope===`repo`?`project`:e.scope===`user`?`user`:e.scope===`system`?`system`:`other`;return{key:t,label:N[t],kind:t}}function F(e){let t=new Map;for(let n of e){let e=P(n),r=t.get(e.key)??{...e,skills:[]};r.skills.push(n),t.set(e.key,r)}return[...t.values()].sort((e,t)=>M[e.kind]-M[t.kind]||e.label.localeCompare(t.label))}function I(e){let t=e.plugin?`${j(e.plugin)}:`:``;return t&&e.name.startsWith(t)&&e.name.length>t.length?e.name.slice(t.length):e.name}var L={project:m,user:_,plugin:p,system:p,other:p};function R({groups:e,openId:t,searching:n,runner:r,account:i}){let[a,o]=(0,k.useState)(new Set),s=e=>o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,A.jsx)(`div`,{"data-slot":`skills-list`,className:`overflow-hidden rounded-xl border border-border bg-card`,children:e.map(e=>{let o=n||!a.has(e.key);return(0,A.jsxs)(`section`,{"data-slot":`skill-group`,"aria-label":e.label,className:`border-border not-first:border-t`,children:[(0,A.jsx)(z,{group:e,open:o,onToggle:()=>s(e.key)}),o?e.skills.map(e=>(0,A.jsx)(B,{skill:e,open:e.id===t,runner:r,account:i},C(e))):null]},e.key)})})}function z({group:e,open:t,onToggle:n}){let i=L[e.kind];return(0,A.jsx)(`h2`,{className:`m-0`,children:(0,A.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:n,className:`flex min-h-10 w-full items-center gap-2 bg-muted/45 px-3.5 text-left text-xs font-semibold text-muted-foreground focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:text-foreground`,children:[(0,A.jsx)(b,{"aria-hidden":`true`,className:r(`size-3.5 transition-transform motion-reduce:transition-none`,t&&`rotate-90`)}),(0,A.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),(0,A.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,A.jsx)(`span`,{className:`font-medium text-soft-foreground`,children:e.skills.length})]})})}function B({skill:e,open:t,runner:n,account:r}){let i=T({skill:e.id,skillPath:e.path,runner:n,...r?{account:r}:{}});return(0,A.jsxs)(`details`,{"data-slot":`skill-row`,"data-skill":e.id,"data-skill-path":e.path,name:`skill-details`,open:t||void 0,className:`group/skill border-t border-border/60 open:bg-sidebar-row-selected`,children:[(0,A.jsxs)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center gap-3 py-2 pr-3.5 pl-9 focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:bg-sidebar-row-hover [&::-webkit-details-marker]:hidden`,children:[(0,A.jsxs)(`span`,{className:`grid min-w-0 flex-1 grid-cols-1 items-center gap-x-4 gap-y-0.5 sm:grid-cols-[minmax(10rem,15rem)_minmax(0,1fr)]`,children:[(0,A.jsx)(`span`,{className:`truncate text-[13.5px] leading-snug font-semibold text-foreground`,title:e.name,children:I(e)}),e.description?(0,A.jsx)(`span`,{className:`min-w-0 line-clamp-2 text-[13px] leading-snug text-muted-foreground [overflow-wrap:anywhere] group-open/skill:hidden`,title:e.description,children:e.description}):null]}),(0,A.jsx)(v,{"data-slot":`skill-row-cue`,"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground transition-transform group-open/skill:rotate-180 motion-reduce:transition-none`})]}),(0,A.jsx)(`div`,{className:`pr-3.5 pb-4 pl-9`,children:(0,A.jsx)(E,{skill:e,heading:null,actions:(0,A.jsx)(x,{asChild:!0,size:`sm`,"data-action":`start-task`,children:(0,A.jsx)(S,{to:i,children:`Start task`})})})})]})}function V(){let e=u(),[t,n]=(0,k.useState)(null),[i,o]=(0,k.useState)(null),[s,c]=(0,k.useState)(``),[f]=d(),p=t??e.data?.defaultRunner,{runner:m}=a(p??`claude`),_=i?.runner===m?i.id:null,v=e=>o(e===null?null:{runner:m,id:e}),y=l(p,_),b=K(m,y.account),S=y.data??[];return(0,A.jsxs)(`div`,{"data-route":`skills`,className:`grid min-h-full w-full grid-cols-1 content-start gap-5 px-4 pt-7 pb-9 md:px-9 max-md:[padding-block-end:5rem]`,children:[(0,A.jsx)(`header`,{className:`flex flex-wrap items-start justify-between gap-4`,children:(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h1`,{className:`text-[26px] font-semibold tracking-tight leading-[1.2] text-foreground md:text-[28px]`,children:`Skills`}),(0,A.jsx)(`p`,{className:`mt-1 text-[13px] text-muted-foreground`,children:`The skills each agent loads in this project, as its runner reports them.`})]})}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(U,{runner:m,onChange:e=>{n(e),v(null)}}),(0,A.jsx)(W,{runner:m,account:_,onChange:v}),(0,A.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,"data-slot":`skills-count`,children:y.list?`${S.length} ${S.length===1?`skill`:`skills`}${y.list.source===`cache`?` · from cache`:``}`:null}),(0,A.jsxs)(x,{variant:`outline`,size:`sm`,onClick:()=>void b.run(),disabled:b.running||y.isPending,"data-slot":`skills-refresh`,children:[(0,A.jsx)(g,{"aria-hidden":`true`,className:r(`size-3.5`,b.running&&`motion-safe:animate-spin`)}),`Re-read`]})]}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(h,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,A.jsx)(D,{"aria-label":`Search skills`,placeholder:`Filter by name or description…`,value:s,onChange:e=>c(e.target.value),className:`h-10 rounded-lg border-border bg-card pl-9 text-[13px]`})]}),(0,A.jsx)(G,{query:y}),y.isPending?(0,A.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Loading skills…`}):(0,A.jsx)(H,{skills:S,search:s,openId:f.get(`skill`),runner:m,account:y.account??null,unchecked:y.unchecked})]})}function H({skills:e,search:t,openId:n,runner:r,account:i,unchecked:a}){if(e.length===0)return a?null:(0,A.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`No skills reported by this runner and account.`});let o=w(e,t);return o.length===0?(0,A.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`No skills match “`,t.trim(),`”.`]}):(0,A.jsx)(R,{groups:F(o),openId:n,searching:t.trim()!==``,runner:r,account:i})}function U({runner:e,onChange:t}){let n=i().data;return n?(0,A.jsx)(`div`,{role:`group`,"aria-label":`Runner`,className:`flex max-w-full gap-1 overflow-x-auto rounded-lg border border-border bg-muted/60 p-1`,children:n.runners.map(n=>(0,A.jsx)(`button`,{type:`button`,"aria-pressed":n.id===e,onClick:()=>t(n.id),className:`h-8 shrink-0 rounded-md border border-transparent px-3 text-[13px] font-normal text-muted-foreground transition-colors focus-visible:outline-2 aria-pressed:border-border aria-pressed:bg-card aria-pressed:font-semibold aria-pressed:text-foreground aria-pressed:shadow-xs pointer-hover:text-foreground max-md:h-11`,children:n.displayName},n.id))}):null}function W({runner:e,account:t,onChange:n}){let r=O().accounts.filter(t=>t.provider===e);return r.length===0?null:(0,A.jsxs)(`div`,{className:`relative inline-flex items-center`,children:[(0,A.jsxs)(`select`,{"aria-label":`Account`,value:t??``,onChange:e=>n(e.target.value||null),className:`h-[38px] appearance-none rounded-lg border border-border bg-card pr-8 pl-3 text-[13px] text-foreground focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,A.jsx)(`option`,{value:``,children:`Account: project default`}),r.map(e=>(0,A.jsx)(`option`,{value:e.id,children:e.label},e.id))]}),(0,A.jsx)(v,{"aria-hidden":`true`,className:`pointer-events-none absolute right-2.5 size-3.5 text-muted-foreground`})]})}function G({query:e}){let t=e.list?.problems??[];return!e.unchecked&&t.length===0?null:(0,A.jsxs)(`div`,{className:`grid gap-1.5 rounded-lg border border-pending/40 bg-pending/10 px-3.5 py-2.5 text-[13px]`,children:[e.unchecked&&!e.isPending?(0,A.jsxs)(`p`,{role:`status`,className:`flex gap-2`,children:[(0,A.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,A.jsxs)(`span`,{children:[`Skill list unavailable. `,e.list?.reason??e.error?.message,` You can still type a skill id when starting a task.`]})]}):null,t.map((e,t)=>(0,A.jsxs)(`p`,{role:`alert`,className:`flex gap-2 break-words`,children:[(0,A.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,A.jsxs)(`span`,{children:[e.message,e.path?` · ${e.path}`:``]})]},t))]})}function K(e,t){let n=s(),[r,i]=(0,k.useState)(!1),a=c.runnerSkills(e,t);return{running:r,run:async()=>{i(!0);try{n.setQueryData(a,await o(e,t,{refresh:!0})),await n.invalidateQueries({queryKey:a.slice(0,3)})}catch(e){f(e instanceof Error?e.message:String(e),{tone:`danger`})}finally{i(!1)}}}}export{V as SkillsRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./utils-DSMR_WLb.js";import{t as r}from"./bot-TkDIw4y-.js";import{r as i}from"./button-
|
|
1
|
+
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./utils-DSMR_WLb.js";import{t as r}from"./bot-TkDIw4y-.js";import{r as i}from"./button-B7MKxYjT.js";e();var a=t(),o=i(`inline-block shrink-0`,{variants:{tone:{success:``,pending:``,danger:``,accent:``,info:``,running:``,neutral:``},shape:{filled:`size-[7px] rounded-full`,ring:`size-[7px] rounded-full border-[1.5px] bg-transparent`,workers:`inline-flex size-[12px] items-center justify-center`},pulse:{true:`animate-pulse motion-reduce:animate-none`,false:``}},compoundVariants:[{shape:`filled`,tone:`success`,className:`bg-success`},{shape:`filled`,tone:`pending`,className:`bg-pending-strong`},{shape:`filled`,tone:`danger`,className:`bg-danger`},{shape:`filled`,tone:`accent`,className:`bg-accent-strong`},{shape:`filled`,tone:`info`,className:`bg-info`},{shape:`filled`,tone:`running`,className:`bg-status-running`},{shape:`filled`,tone:`neutral`,className:`bg-soft-foreground`},{shape:`ring`,tone:`success`,className:`border-success`},{shape:`ring`,tone:`pending`,className:`border-pending-strong`},{shape:`ring`,tone:`danger`,className:`border-danger`},{shape:`ring`,tone:`accent`,className:`border-accent-strong`},{shape:`ring`,tone:`info`,className:`border-info`},{shape:`ring`,tone:`running`,className:`border-status-running`},{shape:`ring`,tone:`neutral`,className:`border-soft-foreground`},{shape:`workers`,tone:`success`,className:`text-success`},{shape:`workers`,tone:`pending`,className:`text-pending-strong`},{shape:`workers`,tone:`danger`,className:`text-danger`},{shape:`workers`,tone:`accent`,className:`text-accent-icon`},{shape:`workers`,tone:`info`,className:`text-info`},{shape:`workers`,tone:`running`,className:`text-status-running`},{shape:`workers`,tone:`neutral`,className:`text-soft-foreground`}],defaultVariants:{tone:`neutral`,shape:`filled`,pulse:!1}});function s({className:e,tone:t=`neutral`,shape:i=`filled`,pulse:s=!1,...c}){return(0,a.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,"data-shape":i,"data-pulse":s?`true`:void 0,className:n(o({tone:t,shape:i,pulse:s,className:e})),...c,children:i===`workers`?(0,a.jsx)(r,{className:`size-[12px]`,"aria-hidden":`true`}):null})}export{s 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{t as r}from"./utils-DSMR_WLb.js";import{a as i}from"./dist-BW234Kg5.js";import{a,i as o,r as s,t as c}from"./dist-C5mlVBmd.js";import{t as l}from"./dist-Czz3Y5qH.js";import{t as u}from"./dist-DXO3xwbC.js";var d=e(t(),1),f=n(),p=`Switch`,[m,h]=o(p),[g,_]=m(p);function v(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:l,required:u,value:m=`on`,internal_do_not_use_render:h}=e,[_,v]=c({prop:n,defaultProp:i??!1,onChange:l,caller:p}),[y,b]=d.useState(null),[x,S]=d.useState(null),C={checked:_,setChecked:v,disabled:a,control:y,setControl:b,name:s,form:o,value:m,hasConsumerStoppedPropagationRef:d.useRef(!1),required:u,defaultChecked:i,isFormControl:!y||!!o||!!y.closest(`form`),bubbleInput:x,setBubbleInput:S};return(0,f.jsx)(g,{scope:t,...C,children:E(h)?h(C):r})}var y=`SwitchTrigger`,b=d.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{let{control:o,form:c,value:l,disabled:u,checked:p,required:m,setControl:h,setChecked:g,hasConsumerStoppedPropagationRef:v,isFormControl:b,bubbleInput:x}=_(y,e),S=i(r,h),C=d.useRef(p);return d.useEffect(()=>{let e=c?o?.ownerDocument.getElementById(c):o?.form;if(e instanceof HTMLFormElement){let t=()=>g(C.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,c,g]),(0,f.jsx)(a.button,{type:`button`,role:`switch`,"aria-checked":p,"aria-required":m,"data-state":D(p),"data-disabled":u?``:void 0,disabled:u,value:l,...n,ref:S,onClick:s(t,e=>{g(e=>!e),x&&b&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})})});b.displayName=y;var x=d.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,f.jsx)(v,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(b,{...d,ref:t,__scopeSwitch:n}),e&&(0,f.jsx)(T,{__scopeSwitch:n})]})})});x.displayName=p;var S=`SwitchThumb`,C=d.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=_(S,n);return(0,f.jsx)(a.span,{"data-state":D(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});C.displayName=S;var w=`SwitchBubbleInput`,T=d.forwardRef(({__scopeSwitch:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:c,required:p,disabled:m,name:h,value:g,form:v,bubbleInput:y,setBubbleInput:b}=_(w,e),x=i(n,b),S=l(s),C=u(r);d.useEffect(()=>{let e=y;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!o.current;if(S!==s&&n){let t=new Event(`click`,{bubbles:r});n.call(e,s),e.dispatchEvent(t)}},[y,S,s,o]);let T=d.useRef(s);return(0,f.jsx)(a.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??T.current,required:p,disabled:m,name:h,value:g,form:v,...t,tabIndex:-1,ref:x,style:{...t.style,...C,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});T.displayName=w;function E(e){return typeof e==`function`}function D(e){return e?`checked`:`unchecked`}var O=`data-[state=checked]:border-accent-strong data-[state=checked]:bg-accent-strong data-[state=unchecked]:border-muted-foreground/60 data-[state=unchecked]:bg-muted [.light_&]:data-[state=unchecked]:border-muted-foreground/35`,k=`data-[state=checked]:bg-white data-[state=unchecked]:bg-foreground/80 [.light_&]:data-[state=unchecked]:border [.light_&]:data-[state=unchecked]:border-muted-foreground/30 [.light_&]:data-[state=unchecked]:bg-card [.light_&]:data-[state=unchecked]:shadow-sm`;function A({className:e,size:t=`default`,...n}){return(0,f.jsx)(x,{"data-slot":`switch`,"data-size":t,className:r(`peer group/switch inline-flex shrink-0 items-center rounded-full border shadow-none transition-[color,background-color,border-color,box-shadow] outline-hidden focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-6 data-[size=default]:w-10 data-[size=sm]:h-3.5 data-[size=sm]:w-6`,O,e),...n,children:(0,f.jsx)(C,{"data-slot":`switch-thumb`,className:r(k,`pointer-events-none block rounded-full ring-0 motion-safe:transition-transform group-data-[size=default]/switch:size-[18px] group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-[state=checked]:translate-x-5 group-data-[size=default]/switch:data-[state=unchecked]:translate-x-0.5 group-data-[size=sm]/switch:data-[state=checked]:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-[state=unchecked]:translate-x-0`)})})}export{O as n,A as r,k as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{r as t,t as n}from"./utils-DSMR_WLb.js";import{t as r}from"./project-router-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{r as t,t as n}from"./utils-DSMR_WLb.js";import{t as r}from"./project-router-Bii3ofOk.js";var i=e();function a({to:e,active:a=!1,onClick:o,count:s,replace:c,className:l,children:u}){return(0,i.jsxs)(r,{to:e,...t({replace:c}),"aria-current":a?`page`:void 0,onClick:o,className:n(`-mb-px flex h-8 items-center rounded-t-md border-b-2 px-3 text-[13px] font-medium`,a?`border-foreground font-semibold text-foreground`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`,l),children:[u,s===void 0?null:(0,i.jsx)(`span`,{"data-slot":`tab-count`,className:`ml-1.5 text-[11.5px] font-normal text-soft-foreground`,children:s})]})}export{a 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{t as r}from"./utils-DSMR_WLb.js";import{Bt as i,Ct as a,Ft as o,Nn as s,Nt as c,Qn as l,Rt as u,di as d,ot as f,rt as p}from"./project-scope-context-BdqKyBHa.js";import{Bt as m,C as h,Qt as g,X as _,Y as v,vt as y}from"./queries-C7VNk-nW.js";import{h as b}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as x}from"./toaster-Bo5vCbz-.js";import{C as S,j as C,l as w}from"./design-icons-CzEoMH9c.js";import{t as T}from"./run-header-B-olCSdg.js";import{i as E,n as D,r as O}from"./git-toolbar-Pugtjt-9.js";import{t as k}from"./button-B7MKxYjT.js";import{a as A,i as j,o as M,r as N,s as P,t as F}from"./dialog-B531GGAo.js";import{b as I,f as L}from"./task-groups-BbnYlkYj.js";import{t as R}from"./centered-state-V15AR_qo.js";import{C as z,X as B,cn as V,en as H,w as U}from"./index-CJFT0IZP.js";import{t as W}from"./markdown-BBDDg-4t.js";import{t as G}from"./textarea-vJt9undk.js";import{t as K}from"./diff-BK789dS0.js";var q=e(t(),1),J=`no worktree — this task ran directly in the repo working tree`;function Y(e){let t=e=>({id:`commit`,label:`Commit`,enabled:!1,reason:e});return e.hasWorktree?e.run.status===`running`?t(`Commit unavailable — the agent is still working in this worktree`):e.changedFiles===void 0?t(`Commit unavailable — changes are still loading`):e.changedFiles===0?t(`Commit unavailable — no changes to commit`):{id:`commit`,label:`Commit`,enabled:!0}:t(`Commit unavailable — ${J}`)}function X(e){let t=e=>({id:`push`,label:`Push`,enabled:!1,reason:e});return e.hasWorktree?e.remote===void 0?t(`Push unavailable — no remote configured`):e.branch===void 0?t(`Push unavailable — the run has no branch to push`):e.run.status===`running`?t(`Push unavailable — the agent is still working in this worktree`):{id:`push`,label:`Push`,enabled:!0}:t(`Push unavailable — ${J}`)}function Z(e){let t=e=>({id:`create-pr`,label:`Draft PR`,enabled:!1,reason:e});return!e.hasWorktree||e.branch===void 0?t(`Draft PR unavailable — ${J}`):e.forge===null?t(`Draft PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?l(e.run)?t(`Draft PR unavailable — the run is waiting on a usage-limit hold; choose Don’t resume first`):I(e.run)?t(`Draft PR unavailable — the run is still active; wait for the review gate`):{id:`create-pr`,label:`Draft PR`,enabled:!0}:t(`Draft PR unavailable — ${e.forge.reason??`the forge is unreachable`}`)}function Q(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:Y(e),n=e.prUrl?[Y(e),X(e)]:[X(e),Z(e)],r=[];if(e.localHandoff&&e.cliHandoff!==!1){let t=e.hasSession?I(e.run)?{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — the session is still active in the engine`}:{id:`open-terminal`,label:`Open in terminal`,enabled:!0}:{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — no agent session to resume`};r.push(t)}return{primary:t,secondary:n,menu:r}}var $=n();function ee({run:e,open:t,onOpenChange:n}){let r=d(),[i,a]=(0,q.useState)(``),o=L(e),s=(0,q.useRef)(o);s.current=o,(0,q.useEffect)(()=>{t&&a(s.current)},[t]);let c=g({mutationFn:t=>p(e.id,t),onSuccess:t=>{x(`Committed ${t.sha.slice(0,7)}`),n(!1),r.invalidateQueries({queryKey:m.runs.changes(e.id)}),r.invalidateQueries({queryKey:m.runs.all})},onError:e=>x(e.message,{tone:`danger`})}),l=()=>{let e=i.trim();e.length===0||c.isPending||c.mutate(e)};return(0,$.jsx)(F,{open:t,onOpenChange:n,children:(0,$.jsxs)(N,{"data-slot":`commit-dialog`,children:[(0,$.jsxs)(M,{children:[(0,$.jsx)(P,{children:`Commit changes`}),(0,$.jsxs)(j,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,$.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,$.jsx)(G,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{B({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),l())}}),(0,$.jsxs)(A,{children:[(0,$.jsx)(k,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,$.jsx)(k,{"data-slot":`commit-confirm`,disabled:i.trim().length===0||c.isPending,onClick:l,children:c.isPending?`Committing…`:`Commit`})]})]})})}function te(){let{id:e}=b(),t=v(e);return t.isPending?(0,$.jsx)(U,{tab:`changes`}):t.isError?(0,$.jsx)(z,{tab:`changes`,error:t.error}):(0,$.jsx)(ne,{run:t.data})}function ne({run:e}){let t=y(),n=h(),r=_(e.id,I(e)),i=H(),[a,l]=(0,q.useState)(`unified`),[p,v]=(0,q.useState)(!0),[b,S]=(0,q.useState)(!1),[C,w]=(0,q.useState)(null),[E,k]=(0,q.useState)(!1),A=(0,q.useRef)(null),j=d(),M=()=>j.invalidateQueries({queryKey:m.runs.all}),N=e=>x(e.message,{tone:`danger`}),P=g({mutationFn:()=>u(e.id),onSuccess:e=>x(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:N}),F=g({mutationFn:()=>f(e.id),onSuccess:e=>{x(`Draft PR created — ${e.url}`),M()},onError:N}),L=g({mutationFn:()=>o(e.id),onError:e=>{if(e instanceof s&&e.command){navigator.clipboard.writeText(e.command).then(()=>x(`No terminal found — command copied to clipboard.`)).catch(()=>x(`Run manually: ${e.command}`));return}N(e)}}),R=g({mutationFn:t=>c(e.id,t),onError:N}),z=r.isError&&r.error instanceof s&&r.error.status===409,B=Q({run:e,cliHandoff:e.cliHandoff,hasWorktree:!!e.worktreePath&&!z,branch:e.branch,changedFiles:r.data?.stat.files,remote:n.data?.info?.remote,forge:t.data?.forge??null,localHandoff:t.data?.capabilities.localHandoff??!1,hasSession:V(e)!==void 0,prUrl:e.pullRequestUrl}),U=e=>{switch(e){case`commit`:k(!0);break;case`push`:P.mutate();break;case`create-pr`:F.mutate();break;case`open-terminal`:L.mutate();break;case`view-pr`:break}},G=r.data?.files??[],K=(0,q.useMemo)(()=>O(G),[G]),J=(0,q.useMemo)(()=>G.some(W),[G]),Y=i?a:`unified`;return(0,$.jsxs)(`div`,{"data-route":`task-changes`,className:`flex min-h-full flex-col`,children:[(0,$.jsx)(T,{run:e,tab:`changes`}),(0,$.jsx)(D,{bar:B,healthReady:t.data!==void 0,branch:e.branch,stat:r.data?.stat,mode:Y,wrap:p,preview:b,onModeChange:l,onWrapChange:v,onPreviewChange:J?S:void 0,onAction:U}),r.data?.repointedHead?(0,$.jsxs)(`p`,{"data-slot":`repointed-head-note`,className:`border-b px-4 py-2 text-xs text-soft-foreground md:px-9`,children:[`HEAD is on `,(0,$.jsx)(`code`,{children:r.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,$.jsx)(`code`,{children:r.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,(0,$.jsx)(re,{changes:r,changesRefused:z,fileCount:G.length,children:(0,$.jsx)(ie,{runId:e.id,files:G,tree:K,selected:C,selectFile:e=>{w(e),A.current?.scrollToPath(e)},diffRef:A,effectiveMode:Y,effectiveWrap:p,preview:b,localHandoff:t.data?.capabilities.localHandoff,onOpenInApp:R.mutate})}),(0,$.jsx)(ee,{run:e,open:E,onOpenChange:k})]})}function re({changes:e,changesRefused:t,fileCount:n,children:r}){return e.isPending?(0,$.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading changes…`}):e.isError?(0,$.jsx)(R,{icon:t?(0,$.jsx)(S,{size:16}):(0,$.jsx)(C,{size:16}),tone:t?`neutral`:`danger`,heading:`h2`,title:t?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):n===0?(0,$.jsx)(R,{icon:(0,$.jsx)(S,{size:16}),tone:`neutral`,heading:`h2`,title:`No changes yet`,subtitle:`The worktree matches its base branch. Changes appear here as the agent works.`}):r}function ie({runId:e,files:t,tree:n,selected:a,selectFile:o,diffRef:s,effectiveMode:c,effectiveWrap:l,preview:u,localHandoff:d,onOpenInApp:f}){let[p,m]=(0,q.useState)(!1);return(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-4 px-4 pb-9 pt-0 [--diff-sticky-top:0px] md:flex-row md:items-start md:gap-5 md:px-9 md:[--diff-sticky-top:1rem]`,children:[(0,$.jsxs)(`aside`,{"data-slot":`changes-tree-pane`,className:`w-full shrink-0 rounded-xl border border-border bg-card md:sticky md:top-4 md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain md:p-3.5 lg:w-[288px]`,children:[(0,$.jsxs)(`button`,{type:`button`,"data-slot":`changes-tree-toggle`,"aria-expanded":p,onClick:()=>m(e=>!e),className:`flex min-h-11 w-full items-center justify-between gap-2 px-3.5 py-2 text-left text-xs font-semibold text-foreground md:hidden`,children:[(0,$.jsxs)(`span`,{children:[`Changed files`,` `,(0,$.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,t.length,`)`]})]}),(0,$.jsx)(w,{size:16,"aria-hidden":`true`,className:r(`size-4 shrink-0 text-muted-foreground motion-safe:transition-transform`,p&&`rotate-180`)})]}),(0,$.jsx)(`h2`,{className:`mb-3 hidden border-b border-border pb-3 text-xs font-semibold md:block`,children:`Changed files`}),(0,$.jsx)(`div`,{className:r(p?`border-t border-border px-3.5 py-3 md:border-t-0 md:p-0`:`hidden md:block`),children:(0,$.jsx)(E,{root:n,selected:a,onSelect:e=>{o(e),m(!1)}})})]}),(0,$.jsx)(K,{files:t,viewRef:s,mode:c,wrap:l,preview:u,loadFileText:t=>ae(e,t),imageSrc:t=>i(e,t),onOpenInApp:d?e=>f(e):void 0,totals:!1,className:`min-w-0 flex-1`})]})}async function ae(e,t){try{let n=await a(e,t);return n.type!==`file`||n.binary||n.tooLarge?null:n.content??null}catch{return null}}export{te as TaskChangesRoute};
|
|
@@ -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{Nn as r,bt as i}from"./project-scope-context-BdqKyBHa.js";import{$t as a,Bt as o,Q as s,Y as c,Z as l}from"./queries-C7VNk-nW.js";import{h as u}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{S as d,j as f,ot as p}from"./design-icons-CzEoMH9c.js";import{t as m}from"./run-header-B-olCSdg.js";import{n as h}from"./diff-controls-BFqQNxRu.js";import{t as g}from"./project-router-Bii3ofOk.js";import{b as _}from"./task-groups-BbnYlkYj.js";import{t as v}from"./centered-state-V15AR_qo.js";import{C as y,en as b,hn as x,w as S,zt as C}from"./index-CJFT0IZP.js";import{t as w}from"./diff-BK789dS0.js";import{t as T}from"./change-counts-CW7O8g5Y.js";import{r as E,t as D}from"./commit-list-DtEqtn9o.js";var O=e(t(),1),k=n();function A(){let{id:e}=u(),t=c(e);return t.isPending?(0,k.jsx)(S,{tab:`changes`}):t.isError?(0,k.jsx)(y,{tab:`changes`,error:t.error}):(0,k.jsx)(j,{run:t.data})}function j({run:e}){let{sha:t}=u(),n=s(e.id,_(e)),i=n.data?.commits[0]?.sha;return(0,k.jsxs)(`div`,{"data-route":`task-commits`,className:`flex min-h-full flex-col`,children:[(0,k.jsx)(m,{run:e,tab:`commits`}),t?(0,k.jsx)(N,{runId:e.id,sha:t}):n.isPending?(0,k.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading commits…`}):n.isError?(0,k.jsx)(v,{icon:(0,k.jsx)(f,{size:16}),tone:n.error instanceof r&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof r&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,k.jsx)(v,{icon:(0,k.jsx)(f,{size:16}),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,k.jsx)(M,{run:e,commits:n.data.commits,selectedSha:i})]})}function M({run:e,commits:t,selectedSha:n}){let r=l(e.id,n),i=F(e.id,t),a=(0,O.useRef)(null),o=b(),[s,c]=(0,O.useState)(`unified`),[u,d]=(0,O.useState)(!0),m=o?s:`unified`;return(0,k.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-5 px-4 py-5 md:px-9 lg:flex-row lg:items-start`,children:[(0,k.jsxs)(`div`,{className:`w-full shrink-0 lg:w-[380px] xl:w-[420px]`,children:[(0,k.jsx)(D,{slot:`task-commits`,selectedSha:n,heading:(0,k.jsxs)(`h2`,{className:`text-sm font-semibold text-foreground`,children:[t.length,` `,t.length===1?`commit`:`commits`,` in this task`]}),className:`w-full`,commits:t.map(t=>({...t,href:`/tasks/${e.id}/commits/${t.sha}`,stat:i.get(t.sha)}))}),n&&r.data&&r.data.files.length>0?(0,k.jsx)(I,{runId:e.id,sha:n,files:r.data.files,onPick:e=>a.current?.scrollToPath(e)}):null]}),n?(0,k.jsx)(`section`,{"data-slot":`task-commit-preview`,"data-sha":n,className:`min-w-0 flex-1 overflow-hidden rounded-xl border border-border bg-card`,children:r.isPending?(0,k.jsx)(`p`,{className:`px-4 py-8 text-center text-xs text-muted-foreground`,children:`Loading commit diff…`}):r.isError?(0,k.jsx)(v,{icon:(0,k.jsx)(p,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load commit diff`,subtitle:r.error.message}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-2 border-b border-border px-4 py-3`,children:[(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`h3`,{className:`break-words text-sm leading-snug font-semibold text-foreground`,children:r.data.subject}),(0,k.jsxs)(`p`,{className:`mt-0.5 flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,k.jsx)(`span`,{children:r.data.author}),(0,k.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,k.jsx)(`span`,{title:r.data.when,children:C(r.data.when)}),(0,k.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,k.jsx)(`span`,{className:`font-mono select-all`,title:r.data.sha??n,children:(r.data.sha??n).slice(0,8)}),r.data.stat?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,k.jsx)(x,{stat:r.data.stat})]}):null]})]}),(0,k.jsx)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:(0,k.jsx)(h,{mode:s,wrap:u,onModeChange:c,onWrapChange:d})})]}),!r.data.files||r.data.files.length===0?(0,k.jsx)(v,{icon:(0,k.jsx)(f,{size:16}),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,k.jsx)(`div`,{className:`p-4 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem]`,children:(0,k.jsx)(w,{viewRef:a,files:r.data.files,mode:m,wrap:u,totals:!1,className:`min-w-0`})})]})}):null]})}function N({runId:e,sha:t}){return(0,k.jsx)(E,{commit:l(e,t),sha:t,backTo:`/tasks/${e}/commits`,backLabel:`All commits`,slot:`task-commit`,className:`mx-auto flex min-h-0 w-full max-w-[var(--measure)] flex-1 flex-col`,diffClassName:`px-4 py-4 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-9`})}var P=12;function F(e,t){let n=t.length<=P,r=a({queries:t.map(t=>({queryKey:o.runs.commit(e,t.sha),queryFn:({signal:n})=>i(e,t.sha,{signal:n}),enabled:n,retry:!1}))}),s=new Map;return r.forEach((e,n)=>{let r=t[n]?.sha;r&&e.data?.stat&&s.set(r,e.data.stat)}),s}function I({runId:e,sha:t,files:n,onPick:r}){return(0,k.jsxs)(`section`,{"data-slot":`task-commit-files`,className:`mt-4 rounded-xl border border-border bg-card p-4`,children:[(0,k.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1`,children:[(0,k.jsxs)(`h2`,{className:`text-sm font-semibold text-foreground`,children:[n.length,` `,n.length===1?`file`:`files`,` in`,` `,(0,k.jsx)(`span`,{className:`font-mono text-[13px] font-medium`,title:t,children:t.slice(0,8)})]}),(0,k.jsx)(g,{to:`/tasks/${e}/changes`,className:`text-xs text-muted-foreground hover:text-foreground`,children:`All task changes ›`})]}),(0,k.jsx)(`ul`,{className:`space-y-1`,children:n.map(e=>(0,k.jsx)(`li`,{children:(0,k.jsxs)(`button`,{type:`button`,"data-slot":`task-commit-file`,title:e.oldPath?`${e.oldPath} → ${e.path}`:e.path,onClick:()=>r(e.path),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2 text-left text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,children:[(0,k.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-[15px] shrink-0`}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 break-all`,children:e.path}),(0,k.jsx)(T,{adds:e.adds,dels:e.dels,className:`font-mono text-xs`})]})},e.path))})]})}export{A as TaskCommitsRoute};
|
|
@@ -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{t as r}from"./utils-DSMR_WLb.js";import{Nn as i,et as a,ut as o}from"./project-scope-context-BdqKyBHa.js";import{B as s,F as c,N as l,Y as u,et as d}from"./queries-C7VNk-nW.js";import{f,g as p,h as m,m as h}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{S as g,T as _,X as v,Y as y,ot as b,u as x}from"./design-icons-CzEoMH9c.js";import{t as S}from"./createLucideIcon-BHp8sXmF.js";import{n as C,t as w}from"./run-header-B-olCSdg.js";import{a as T,i as E,n as D,o as O,r as k}from"./file-preview-CDWTFZ4P.js";import{t as A}from"./button-B7MKxYjT.js";import{t as j}from"./centered-state-V15AR_qo.js";import{$n as M,C as N,Wn as P,w as F}from"./index-CJFT0IZP.js";import{r as I}from"./markdown-Dv0r75AX.js";var L=S(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),R=S(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),z=e(t(),1),B=n();function V({runId:e,path:t,artifactId:n,worktreePath:r}){let i=s(e,n?null:t),c=l(e,n),u=n?c:i,d=(0,z.useContext)(I),p=f(),m=p.pathname.replace(/\/files\/?$/,`/report`)+p.search,h=u.data,g=(0,z.useMemo)(()=>h?.type===`file`&&h.source!==`artifact`?{runId:e,...d,basePath:h.path}:null,[h,d,e]);if(!t&&!n)return(0,B.jsx)(k,{runId:e,path:null,className:`min-w-0 flex-1`});if(u.isPending)return(0,B.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(u.isError)return(0,B.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,B.jsx)(`h2`,{children:`Could not load this file`}),(0,B.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:u.error.message}),(0,B.jsx)(A,{variant:`outline`,onClick:()=>void u.refetch(),children:`Retry`})]});if(!h)return(0,B.jsx)(`p`,{role:`alert`,className:`p-4`,children:`No file data was returned.`});let _=E(h.path,r,t);if(h.type!==`file`)return(0,B.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,B.jsx)(`h2`,{children:h.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,B.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:_}),(0,B.jsx)(`p`,{className:`text-sm`,children:h.reason}),(0,B.jsx)(A,{variant:`outline`,onClick:()=>void u.refetch(),children:`Retry`})]});let v=h.artifact;return(0,B.jsx)(I.Provider,{value:g,children:(0,B.jsx)(D,{runId:e,entry:h,displayPath:_,documentPreview:!0,readerHref:m,className:`min-w-0 flex-1`,imageUrl:v?a(e,v.id,`image`):o(e,t),...v?{downloadUrl:a(e,v.id,`download`),snapshot:new Date(v.createdAt).toLocaleString()}:{}},v?.id??h.path)})}var H=new Map;function U(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var W=(0,z.createContext)(null);function G(){let{key:e}=f(),t=h()===`POP`,[n,r]=(0,z.useState)({key:e,generation:0});if(n.key===e)return n.generation;let i={key:e,generation:t?n.generation+1:n.generation};return r(i),i.generation}var K=()=>document.querySelector(`[data-slot="main"]`);function q(e,t){let n=(0,z.useRef)(null),r=f(),i=h()===`POP`?r.key:U(r.state),[a]=(0,z.useState)(()=>{let t=i?H.get(i):void 0;return t?.runId===e?t:null}),o=(0,z.useRef)(new Set(a?.folders??[])),s=(0,z.useRef)(new Set),[c,l]=(0,z.useState)(0),u=(0,z.useRef)(a===null),d=(0,z.useCallback)(()=>{u.current&&H.set(r.key,{runId:e,folders:new Set(o.current),tree:n.current?.scrollTop??0,main:K()?.scrollTop??0})},[r.key,e]),p=(0,z.useMemo)(()=>({isOpen:e=>o.current.has(e),setOpen:(e,t)=>{t?o.current.add(e):o.current.delete(e),d()},loading:(e,t)=>{a?.folders.has(e)&&(t?s.current.add(e):s.current.delete(e),l(s.current.size))}}),[a,d]);return(0,z.useEffect)(()=>{if(u.current||!a||!t||s.current.size>0)return;n.current&&(n.current.scrollTop=a.tree);let e=K();e&&(e.scrollTop=a.main),u.current=!0,d()},[a,t,c,d]),(0,z.useEffect)(()=>{d();let e=[n.current,K()].filter(e=>e!==null);for(let t of e)t.addEventListener(`scroll`,d,{passive:!0});return()=>{for(let t of e)t.removeEventListener(`scroll`,d)}},[d]),{tree:n,folders:p}}function J({runId:e,selected:t,onSelect:n}){return(0,B.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,B.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,B.jsx)(Y,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function Y({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=d(e,t),o=(0,z.useContext)(W);return(0,z.useEffect)(()=>{if(!(!t||!o))return o.loading(t,a.isPending),()=>o.loading(t,!1)},[o,t,a.isPending]),a.isPending?(0,B.jsx)(`li`,{"data-slot":`files-tree-loading`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Loading…`}):a.isError?(0,B.jsx)(`li`,{"data-slot":`files-tree-error`,className:`px-1.5 py-1 text-xs text-danger`,style:{paddingLeft:`${6+n*14}px`},children:a.error.message}):a.data.type===`dir`?a.data.entries.length===0?(0,B.jsx)(`li`,{"data-slot":`files-tree-empty`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Empty directory`}):(0,B.jsx)(B.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,B.jsx)(X,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,B.jsx)(Z,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function X({runId:e,name:t,path:n,depth:i,selected:a,onSelect:o}){let s=(0,z.useContext)(W),[c,l]=(0,z.useState)(()=>s?.isOpen(n)??!1);return(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":c?`open`:`closed`,"aria-expanded":c,onClick:()=>{s?.setOpen(n,!c),l(!c)},className:`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+i*14}px`},children:[(0,B.jsx)(x,{size:16,"aria-hidden":`true`,className:r(`order-last ml-auto size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,c&&`rotate-90`)}),(0,B.jsx)(_,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,B.jsx)(`span`,{className:`min-w-0 truncate font-normal`,children:t})]}),c?(0,B.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,B.jsx)(Y,{runId:e,path:n,depth:i+1,selected:a,onSelect:o})}):null]})}function Z({name:e,path:t,size:n,depth:i,selected:a,onSelect:o}){let s=a===t,c=O(t)?R:g;return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":s?`true`:void 0,onClick:()=>o(t),className:r(`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,s?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${6+i*14}px`},children:[(0,B.jsx)(c,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,B.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs tabular-nums text-soft-foreground`,children:T(n)})]})})}function Q(){let{id:e}=m(),t=u(e),n=G();return t.isPending?(0,B.jsx)(F,{tab:`files`}):t.isError?(0,B.jsx)(N,{tab:`files`,error:t.error}):(0,B.jsx)(C,{runId:t.data.id,children:(0,B.jsx)(ee,{run:t.data},`${t.data.id}:${n}`)})}function $(e,t,n,r){let i=s(e,r||n!==null?null:t),a=l(e,r?null:n);return r||t===null&&n===null?!0:!(n===null?i:a).isPending}function ee({run:e}){let t=d(e.id,``),n=c(e.id),[r,a]=p(),o=r.get(`path`),s=r.get(`artifact`),l=r.getAll(`path`).length>1||r.getAll(`artifact`).length>1||o!==null&&s!==null,[u,f]=(0,z.useState)(o??``);(0,z.useEffect)(()=>f(o??``),[o]);let m=(e,t)=>{let n=new URLSearchParams(r);n.delete(`path`),n.delete(`artifact`),n.set(e,t),a(n)},h=t.isError&&t.error instanceof i&&t.error.status===409,g=$(e.id,o,s,l),_=q(e.id,!t.isPending&&g);return(0,B.jsxs)(`div`,{"data-route":`task-files`,className:`flex min-h-full flex-col`,children:[(0,B.jsx)(w,{run:e,tab:`files`}),(0,B.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-4 pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),u.trim()&&m(`path`,u.trim())},children:[(0,B.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,B.jsx)(v,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,B.jsx)(P,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:u,onChange:e=>f(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,B.jsx)(A,{type:`submit`,variant:`outline`,className:`h-11 shrink-0`,disabled:!u.trim(),children:`Open file`})]}),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-col items-stretch gap-5 px-4 py-[22px] [--diff-sticky-top:1rem] md:flex-row md:items-start md:px-9`,children:[(0,B.jsxs)(`aside`,{ref:_.tree,"data-slot":`files-tree-pane`,className:`w-full shrink-0 rounded-xl border border-border bg-card p-3.5 md:sticky md:top-[var(--diff-sticky-top)] md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain lg:w-72`,children:[(0,B.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,B.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,B.jsx)(j,{icon:h?(0,B.jsx)(L,{}):(0,B.jsx)(b,{size:16}),tone:h?`neutral`:`danger`,heading:`h2`,title:h?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,B.jsx)(W.Provider,{value:_.folders,children:(0,B.jsx)(J,{runId:e.id,selected:o,onSelect:e=>m(`path`,e)})}),(0,B.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,B.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),n.isPending?(0,B.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):n.isError?(0,B.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):n.data.artifacts.length===0?(0,B.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,B.jsx)(`ul`,{children:n.data.artifacts.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,"data-slot":`artifact-row`,"aria-current":e.id===s?`true`:void 0,className:`group flex min-h-11 w-full items-center gap-2 rounded px-2 py-2 text-left text-xs text-foreground hover:bg-muted focus-visible:ring-2 aria-[current=true]:bg-muted aria-[current=true]:font-medium`,onClick:()=>m(`artifact`,e.id),children:[(0,B.jsx)(M,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 wrap-anywhere underline-offset-2 group-hover:underline`,children:e.name}),(0,B.jsx)(x,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground group-hover:text-foreground`})]})},e.id))}),(0,B.jsxs)(A,{variant:`outline`,size:`sm`,"data-action":`refresh-artifacts`,className:`mt-2 max-md:h-11 no-hover:h-11`,onClick:()=>void n.refetch(),children:[(0,B.jsx)(y,{"aria-hidden":`true`}),`Refresh published files`]})]})]}),l?(0,B.jsx)(`p`,{role:`alert`,className:`p-4`,children:`Invalid file link: choose either a path or a published artifact.`}):o!==null||s!==null||t.isSuccess?(0,B.jsx)(V,{runId:e.id,path:o,artifactId:s,worktreePath:e.worktreePath}):null]}),(0,B.jsx)(`p`,{className:`px-4 pb-6 text-xs text-muted-foreground md:px-9`,children:`Browsing files is read-only. Worktree contents may differ from your main checkout. Published files are snapshots.`})]})}export{Q as TaskFilesRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{n as t}from"./utils-DSMR_WLb.js";import{G as n,di as r}from"./project-scope-context-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{n as t}from"./utils-DSMR_WLb.js";import{G as n,di as r}from"./project-scope-context-BdqKyBHa.js";import{Bt as i,Qt as a,Y as o,bt as s,o as c,r as l,vt as u,xt as d}from"./queries-C7VNk-nW.js";import{h as f}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{g as p,p as m}from"./tasks-table-Cx7AM7lZ.js";import{F as h,ot as g,p as _}from"./design-icons-CzEoMH9c.js";import{t as v}from"./run-header-B-olCSdg.js";import{t as y}from"./external-link-BE6y205O.js";import{u as b}from"./reference-chip-rylFalfg.js";import{t as x}from"./button-B7MKxYjT.js";import{t as S}from"./project-router-Bii3ofOk.js";import{t as C}from"./centered-state-V15AR_qo.js";import{C as w,S as T,Xn as E}from"./index-CJFT0IZP.js";import{n as D,o as O,t as k}from"./use-hand-to-agent-state-BckHuhr8.js";var A=e(),j={issue:`Issue`,pr:`Pull request`};function M({kind:e}){let{id:t}=f(),n=o(t);return n.isPending?(0,A.jsx)(T,{kind:e}):n.isError?(0,A.jsx)(w,{tab:`github-item`,error:n.error}):(0,A.jsx)(N,{run:n.data,kind:e})}function N({run:e,kind:t}){let{n}=f(),r=Number(n),i=s(),a=d(),o=u(),l=a.isPending||o.isPending,p=m(e,i).some(e=>e.kind===t&&e.number===r),h=c(t,r,p);return(0,A.jsxs)(`div`,{"data-route":`task-github-item`,className:`flex min-h-full flex-col`,children:[(0,A.jsx)(v,{run:e,tab:{kind:t,number:r}}),p?(0,A.jsx)(V,{run:e,kind:t,number:r,repoBase:i,item:h}):l?(0,A.jsx)(T,{kind:t,number:r,heading:`h2`}):(0,A.jsx)(C,{icon:(0,A.jsx)(E,{size:16}),tone:`neutral`,heading:`h2`,title:`#${n} is not linked to this task`,subtitle:`Only the issues and pull requests this task references open here.`,actions:(0,A.jsx)(x,{asChild:!0,variant:`outline`,children:(0,A.jsx)(S,{to:`/tasks/${e.id}`,children:`Back to the session`})})})]})}function P(e,t){return e===`pr`&&t.data?.available===!0&&t.data.item!==null}function F(e,t,n,r){return e===`pr`?n?.[t]??r:r}function I({retry:e,kind:t,number:n}){return(0,A.jsx)(x,{variant:`outline`,disabled:e.isPending,onClick:()=>e.mutate(i.githubItem(t,n)),children:`Retry`})}function L({kind:e,number:t,error:n,retryButton:r}){return(0,A.jsx)(C,{icon:(0,A.jsx)(g,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load ${j[e].toLowerCase()} #${t}`,subtitle:n.message,actions:r})}function R({run:e,kind:n,number:r,repoBase:i,reason:a,retryError:o,retryButton:s}){let c=n===`pr`?h:_,l=p(e,i).find(e=>e.kind===`PR`==(n===`pr`)&&e.number===r)?.url;return(0,A.jsx)(C,{icon:(0,A.jsx)(c,{size:16}),tone:`neutral`,heading:`h2`,title:`GitHub is unavailable`,subtitle:o?.message??a,actions:(0,A.jsxs)(A.Fragment,{children:[s,l&&t(l)?(0,A.jsx)(x,{asChild:!0,variant:`outline`,children:(0,A.jsxs)(`a`,{href:l,target:`_blank`,rel:`noopener noreferrer`,children:[`open on GitHub`,(0,A.jsx)(y,{"aria-hidden":`true`})]})}):null]})})}function z({label:e,repoBase:t}){return(0,A.jsx)(C,{icon:(0,A.jsx)(b,{}),tone:`neutral`,heading:`h2`,title:`${e} was not found in ${H(t)}`,subtitle:`It may have been deleted, or the number points at a different repository.`})}function B({kind:e,item:t,labelColors:n,checks:r}){return(0,A.jsx)(`div`,{className:`min-w-0 px-0.5 md:px-2`,children:(0,A.jsx)(O,{item:t,colors:n??{},checks:r,backLink:null,subNav:null,children:e===`issue`?(0,A.jsx)(U,{item:t},t.url):null})})}function V({run:e,kind:t,number:i,repoBase:o,item:s}){let c=r(),u=a({mutationFn:e=>n(t,i,{refresh:!0}),onSuccess:(e,t)=>c.setQueryData(t,e)}),d=P(t,s),f=l(d?[i]:[],d),p=f.data?.available?f.data.checks:void 0,m=`${j[t]} #${i}`,h=(0,A.jsx)(I,{retry:u,kind:t,number:i});if(s.isPending)return(0,A.jsx)(T,{kind:t,number:i,heading:`h2`});if(s.isError)return(0,A.jsx)(L,{kind:t,number:i,error:u.error??s.error,retryButton:h});let g=s.data;return g.available?g.item?(0,A.jsx)(B,{kind:t,item:g.item,labelColors:g.labelColors,checks:F(t,i,p,g.item.checks)}):(0,A.jsx)(z,{label:m,repoBase:o}):(0,A.jsx)(R,{run:e,kind:t,number:i,repoBase:o,reason:g.reason,retryError:u.error,retryButton:h})}function H(e){if(!e)return`this repository`;try{return new URL(e).pathname.split(`/`).filter(Boolean).slice(0,2).join(`/`)||`this repository`}catch{return`this repository`}}function U({item:e}){let t=k();return(0,A.jsx)(D,{item:e,workflows:t.workflows.data?.workflows??[],skills:t.skillList,workflow:t.workflow,onWorkflowChange:t.setWorkflow,selectedSkills:t.selectedSkills,onSkillsChange:t.setSelectedSkills,engine:t.engine,onEngineChange:t.setEngine,queuedRunId:t.queued.get(e.url)??null,onQueued:t.onQueued},e.url)}export{M as TaskGithubItemRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Bn as e,Cn as t,Ir as n,On as r,Qn as i,kn as a}from"./project-scope-context-
|
|
1
|
+
import{Bn as e,Cn as t,Ir as n,On as r,Qn as i,kn as a}from"./project-scope-context-BdqKyBHa.js";import"./queries-C7VNk-nW.js";import"./attention-8bNiiAFt.js";function o(e,t){let n;for(let r of e)!r.sessionId||r.id===t||(!n||!r.startedAt||!n.startedAt||r.startedAt>=n.startedAt)&&(n=r);return n}function s(e,t){return e?.backend??t?.runner??`claude`}function c(e,t){let n;for(let r of e)r.removedBackend===void 0&&(t===void 0||r.sessionId!==t)||(!n||!r.startedAt||!n.startedAt||r.startedAt>=n.startedAt)&&(n=r);return n?.removedBackend===void 0?void 0:n}function l(e){let t=o(e.steps),n=c(e.steps,t?.sessionId)?void 0:t;return{sessionId:n?.sessionId,backend:s(n,e),profileId:n?.profileId}}function u(e){return e.command===void 0&&e.kind!==`plugin`}function d(e){let t=e.workflowCursor?.mode===`resume`?e.workflowCursor.stepId:void 0;if(t&&e.steps.find(e=>e.id===t)?.status===`failed`)return t;let n=o(e.steps);if(n)return n.synthetic===`continuation`&&n.continuesStepId!==void 0?n.continuesStepId:e.steps.find(e=>e.sessionId===n.sessionId)?.id??n.id}function f(e,t=!1){if(e.delegation?.role!==`worker`)return;let n=e.workflowDef?.steps;if(!n?.length)return;if(t)return n.find(u);let r=d(e);return(r?n.find(e=>e.id===r&&u(e)):void 0)??[...n].reverse().find(u)}var p=new Set([`queued`,`running`,`waiting`]);function m(e){return p.has(e)}function h(e){return i(e)?!1:e.status===`queued`||e.status===`running`||e.status===`waiting`}function g(e){return h(e)&&e.status!==`queued`}function _(t,n,r){return t.archived||!(t.status===`done`||t.status===`failed`||t.status===`cancelled`)||t.delegation?.role===`worker`||r!==void 0&&e(t)!==r?!1:n===`unpinned`?!t.pinned:n!==`pinned`||t.pinned===!0}var v=[`done`,`failed`];function y(e){return e.archived||i(e)||!v.includes(e.status)?!1:e.finishedAt!==void 0}function b(e){let t=e.finishedAt;return t===void 0||!y(e)?!1:e.seenAt===void 0||e.seenAt<t}var x=[`Needs you`,`Finished`,`Working`,`Archived`],S={waiting:0,review:1,running:2,queued:4,done:5,failed:6,cancelled:7},C=3,w=e=>i(e)?C:S[e.status]??9;function T(e){let n=e=>t[r(e).bucket];return[...e].sort((e,t)=>n(e)-n(t)||w(e)-w(t))[0]}function E(e,t){return t===`archived`?`Archived`:a(e)?`Needs you`:e.status===`waiting`||e.status===`running`||e.status===`queued`?`Working`:`Finished`}function D(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function O(e){let t=/^(\d{1,9}): (.+)$/.exec(e),n=t?.[1],r=t?.[2];return n===void 0||r===void 0?{ref:null,rest:e}:{ref:Number(n),rest:r}}function k(e,t){return t!==void 0&&O(e).ref===t}function A(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt));return new Map(t.map((e,t)=>[e.id,t+1]))}function j(e,t){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,n)=>{if(t!==`archived`){let t=Number(!!n.pinned)-Number(!!e.pinned);if(t!==0)return t}let r=w(e)-w(n);if(r!==0)return r;if(i(e)&&i(n)){let t=e.autoResumeAt.localeCompare(n.autoResumeAt);if(t!==0)return t}return e.status===`queued`&&n.status===`queued`?e.createdAt.localeCompare(n.createdAt):n.createdAt.localeCompare(e.createdAt)})}function M(e){return e.delegation?.role===`worker`}function N(e,t){if(e==null)return null;let n=t.find(t=>t.id===e);return!n||!M(n)?e:n.delegation?.parentRunId??e}function P(e,t,n=A(e)){let r=j(e,t).filter(e=>!M(e)),i=new Map,a=(e,t)=>{let n=i.get(e);n?n.push(t):i.set(e,[t])};for(let e of r)a(E(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null});return x.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function F(e,t={}){let r=typeof t==`number`?{overall:t}:n(t),i={"Needs you":`needsYou`,Finished:`finished`,Working:`working`},a=[],o=r.overall===void 0?10:r.overall??1/0;for(let t of e){let e=t.label===`Archived`?1/0:r[i[t.label]]??1/0,n=t.rows.filter(n=>{let r=n.run.pinned;return t.label!==`Archived`&&r?!0:o<=0||e<=0?!1:(--o,--e,!0)});n.length&&a.push({label:t.label,rows:n})}return a}function I(e,t){if(t.length===0)return[...e];let n=new Set(e.map(e=>e.id)),r=new Set,i=t.filter(e=>n.has(e.id)||r.has(e.id)?!1:(r.add(e.id),!0));return[...e,...i]}function L(e){let t=0,n=0,r=0;for(let i of e)if(!M(i)){if(i.archived){n+=1;continue}t+=1,a(i)&&(r+=1)}return{active:t,archived:n,waiting:r}}function R(t,n,r){return t.filter(t=>!t.archived&&(!r||e(t)===(n===`automations`)))}var z={"Needs you":`needs-you`,Finished:`finished`,Working:`working`},B=Object.keys(z),V=`section`;function H(e,t,n){let r=`${V}=${z[e]}`;return n?`/?origin=${t===`automations`?`automations`:`direct`}&${r}`:`/?${r}`}function U(e){return B.find(t=>z[t]===e)??null}function W(t,n){let r={active:0,automations:0,activeWaiting:0,automationsWaiting:0};for(let i of t){if(M(i)||i.archived)continue;let t=+!!a(i);n&&e(i)?(r.automations+=1,r.automationsWaiting+=t):(r.active+=1,r.activeWaiting+=t)}return r}export{_ as C,s as D,o as E,f as O,g as S,l as T,O as _,P as a,h as b,T as c,k as d,D as f,R as g,W as h,F as i,U as l,N as m,V as n,M as o,H as p,B as r,L as s,x as t,A as u,I as v,b as w,m as x,y};
|