@hearsay-tools/squawk 0.19.0-dev.8648 → 0.19.0-pr4419.8657

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/delegation/routes.d.ts +65 -65
  2. package/dist/runners/codex/codex-app-server-runner.js +2 -42
  3. package/dist/runners/codex/codex-app-server-runner.js.map +1 -1
  4. package/dist/runners/codex/codex-questions.d.ts +5 -0
  5. package/dist/runners/codex/codex-questions.js +55 -0
  6. package/dist/runners/codex/codex-questions.js.map +1 -0
  7. package/dist/runners/opencode/opencode-questions.js +9 -1
  8. package/dist/runners/opencode/opencode-questions.js.map +1 -1
  9. package/dist/server/automations-routes.d.ts +150 -150
  10. package/dist/server/project-settings-routes.d.ts +107 -107
  11. package/dist/server/runners-routes.d.ts +10 -10
  12. package/dist/server/runs-routes.d.ts +16 -16
  13. package/dist/server/server.d.ts +8 -8
  14. package/package.json +4 -4
  15. package/web/dist/assets/{accounts-section-RDVTJfi7.js → accounts-section-B9Hypl0g.js} +1 -1
  16. package/web/dist/assets/{activity-motion-B7km8QVK.js → activity-motion-DGlEy383.js} +1 -1
  17. package/web/dist/assets/{activity-route-CjE0yxn0.js → activity-route-Dgzzvc1C.js} +1 -1
  18. package/web/dist/assets/{agent-config-section-DQ1RaVK2.js → agent-config-section-CDjUBgnZ.js} +1 -1
  19. package/web/dist/assets/{agent-defaults-section-Dzm7jIza.js → agent-defaults-section-D9w6Arbq.js} +1 -1
  20. package/web/dist/assets/{appearance-DQLHHfI4.js → appearance-Ciu3klj7.js} +1 -1
  21. package/web/dist/assets/{automations-route-BcdL5f0K.js → automations-route-CuTrlJe_.js} +2 -2
  22. package/web/dist/assets/{commit-list-CN1zX-0X.js → commit-list-hmnkwJgy.js} +1 -1
  23. package/web/dist/assets/{diff-hxqBOfZH.js → diff-Bph54Mj6.js} +2 -2
  24. package/web/dist/assets/{diff-controls-BRa3141W.js → diff-controls-D6zRC-Ch.js} +1 -1
  25. package/web/dist/assets/{diff-view-CwlKCj5V.js → diff-view-DmmXxueT.js} +1 -1
  26. package/web/dist/assets/{file-preview-VvCzp02k.js → file-preview-DLiwl3fv.js} +1 -1
  27. package/web/dist/assets/{git-toolbar-BulcGzsv.js → git-toolbar-DMB3ZSSD.js} +1 -1
  28. package/web/dist/assets/github-FbXescpa.js +1 -0
  29. package/web/dist/assets/{global-activity-route-C4-bmfh_.js → global-activity-route-DjrD5AkK.js} +1 -1
  30. package/web/dist/assets/{image-preview-Pgf8bnzY.js → image-preview-BZAATe5s.js} +1 -1
  31. package/web/dist/assets/index-Bd4H0_xW.css +1 -0
  32. package/web/dist/assets/{index-DNQcTHxV.js → index-cS5ELSRA.js} +6 -6
  33. package/web/dist/assets/{markdown-9L65ixU6.js → markdown-DBhG8Ap2.js} +1 -1
  34. package/web/dist/assets/{notifications-section-QWmuj2j2.js → notifications-section-C8UK7f5C.js} +1 -1
  35. package/web/dist/assets/play-BY_SWlhj.js +1 -0
  36. package/web/dist/assets/preview-pane-connected-EbemQD3m.js +3 -0
  37. package/web/dist/assets/{projects-section-DxubjpZI.js → projects-section-BzneiDK3.js} +1 -1
  38. package/web/dist/assets/{prompt-templates-section-CkQneT1G.js → prompt-templates-section-WO6Xiv1C.js} +1 -1
  39. package/web/dist/assets/{remote-settings-notice-COojb6XK.js → remote-settings-notice-BCmpPIT0.js} +1 -1
  40. package/web/dist/assets/{repo-git-Mgk4Qcmo.js → repo-git-DBWXyzHg.js} +1 -1
  41. package/web/dist/assets/{report-reader-zWwalJDN.js → report-reader-DYr8I-SW.js} +1 -1
  42. package/web/dist/assets/reports-CR7j7BEy.js +1 -0
  43. package/web/dist/assets/{resources-section-Cb2WIqNv.js → resources-section-CiPTx574.js} +1 -1
  44. package/web/dist/assets/run-header-Sse1VUYh.js +2 -0
  45. package/web/dist/assets/{select-y3oRuA2s.js → select-CmF4qPJi.js} +1 -1
  46. package/web/dist/assets/{session-context-section-CiPNMiL7.js → session-context-section-B5P8F_s5.js} +2 -2
  47. package/web/dist/assets/{settings-agent-picker-CJJJncuA.js → settings-agent-picker-Byi8AjNU.js} +1 -1
  48. package/web/dist/assets/settings-shell-e0iMUIPe.js +1 -0
  49. package/web/dist/assets/{sidebar-section-VOYJarPd.js → sidebar-section-CsHTxgwu.js} +1 -1
  50. package/web/dist/assets/{skills-BySF3yBA.js → skills-8Hl9CjlR.js} +1 -1
  51. package/web/dist/assets/{task-changes-NUwvUglx.js → task-changes-CwyUr6Mq.js} +1 -1
  52. package/web/dist/assets/task-commits-CWVxea1v.js +1 -0
  53. package/web/dist/assets/{task-files-Bu-L_NRW.js → task-files-CrNywZLV.js} +1 -1
  54. package/web/dist/assets/{task-github-item-DhiTqCjk.js → task-github-item-BiDV7gjB.js} +1 -1
  55. package/web/dist/assets/task-thread-CbAxAUZB.css +1 -0
  56. package/web/dist/assets/task-thread-DYZiyJqH.js +12 -0
  57. package/web/dist/assets/{thread-state-B_ZqjjRr.js → thread-state-DCUR4Djq.js} +1 -1
  58. package/web/dist/assets/{use-hand-to-agent-state-K864D69i.js → use-hand-to-agent-state-jy8ex2Zf.js} +1 -1
  59. package/web/dist/assets/{workflows-DlTkuM0J.js → workflows-DhEJXkD0.js} +3 -3
  60. package/web/dist/assets/{workspace-tools-BRK7f1Hk.js → workspace-tools-DrUvrG9H.js} +1 -1
  61. package/web/dist/assets/{worktrees-section-BXI0-7HH.js → worktrees-section-CTVeHaAF.js} +4 -4
  62. package/web/dist/index.html +3 -3
  63. package/web/dist/assets/github-By3yOcFH.js +0 -1
  64. package/web/dist/assets/index-C69_Sk06.css +0 -1
  65. package/web/dist/assets/play-CmVAj_fu.js +0 -1
  66. package/web/dist/assets/preview-pane-connected-DAM2Snwh.js +0 -3
  67. package/web/dist/assets/reports-BCHWt3zy.js +0 -1
  68. package/web/dist/assets/run-header-DeprqSP7.js +0 -2
  69. package/web/dist/assets/settings-shell-CLToW28f.js +0 -1
  70. package/web/dist/assets/task-commits-CpV1Hz9L.js +0 -1
  71. package/web/dist/assets/task-thread-CKkTeQdi.js +0 -9
  72. package/web/dist/assets/task-thread-DzADOhZd.css +0 -1
@@ -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,pi as s}from"./project-scope-context-Rv6S_BXt.js";import{Qt as c,y as l}from"./queries-qCF-eOqZ.js";import{t as u}from"./button-B7MKxYjT.js";import{gn as d}from"./index-DNQcTHxV.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};
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,pi as s}from"./project-scope-context-Rv6S_BXt.js";import{Qt as c,y as l}from"./queries-qCF-eOqZ.js";import{t as u}from"./button-B7MKxYjT.js";import{_n as d}from"./index-cS5ELSRA.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};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{m as i,p as a}from"./live-reads-Crd6fVGH.js";import{S as o,pi as s}from"./project-scope-context-Rv6S_BXt.js";import{n as c}from"./toaster-BXnLIU3z.js";import{Bt as l,Wt as u,_ as d}from"./queries-qCF-eOqZ.js";import{g as f}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{O as p,T as m,X as h,Y as g,ct as _,l as v,ot as y,tt as b,u as x}from"./design-icons-CzEoMH9c.js";import{t as S}from"./button-B7MKxYjT.js";import{t as C}from"./project-router-CLJTc7gv.js";import{f as w,l as T}from"./skills-pM_PouEs.js";import{d as E,n as D,s as O,t as k,u as A}from"./page-shell-7pLJMOgh.js";import{En as j,V as M,Wn as N,bn as P}from"./index-DNQcTHxV.js";var F=e(t(),1),I=n(),L=e=>e.split(`@`)[0]||e,R={project:0,user:1,plugin:2,system:3,other:4},z={project:`This project`,user:`Your skills`,system:`Built in`,other:`Other`};function B(e){if(e.plugin)return{key:`plugin:${e.plugin}`,label:L(e.plugin),kind:`plugin`};let t=e.scope===`repo`?`project`:e.scope===`user`?`user`:e.scope===`system`?`system`:`other`;return{key:t,label:z[t],kind:t}}function V(e){let t=new Map;for(let n of e){let e=B(n),r=t.get(e.key)??{...e,skills:[]};r.skills.push(n),t.set(e.key,r)}return[...t.values()].sort((e,t)=>R[e.kind]-R[t.kind]||e.label.localeCompare(t.label))}function H(e){let t=e.plugin?`${L(e.plugin)}:`:``;return t&&e.name.startsWith(t)&&e.name.length>t.length?e.name.slice(t.length):e.name}var U={project:m,user:_,plugin:p,system:p,other:p};function W({groups:e,openId:t,searching:n,runner:r,account:i}){let[a,o]=(0,F.useState)(new Set),s=e=>o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,I.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,I.jsxs)(`section`,{"data-slot":`skill-group`,"aria-label":e.label,className:`border-border not-first:border-t`,children:[(0,I.jsx)(G,{group:e,open:o,onToggle:()=>s(e.key)}),o?e.skills.map(e=>(0,I.jsx)(K,{skill:e,open:e.id===t,runner:r,account:i},w(e))):null]},e.key)})})}function G({group:e,open:t,onToggle:n}){let i=U[e.kind];return(0,I.jsx)(`h2`,{className:`m-0`,children:(0,I.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,I.jsx)(x,{"aria-hidden":`true`,className:r(`size-3.5 transition-transform motion-reduce:transition-none`,t&&`rotate-90`)}),(0,I.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,I.jsx)(`span`,{className:`font-medium text-soft-foreground`,children:e.skills.length})]})})}function K({skill:e,open:t,runner:n,account:r}){let i=j({skill:e.id,skillPath:e.path,runner:n,...r?{account:r}:{}});return(0,I.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,I.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,I.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,I.jsx)(`span`,{className:`truncate text-[13.5px] leading-snug font-semibold text-foreground`,title:e.name,children:H(e)}),e.description?(0,I.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,I.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,I.jsx)(`div`,{className:`pr-3.5 pb-4 pl-9`,children:(0,I.jsx)(M,{skill:e,heading:null,actions:(0,I.jsx)(S,{asChild:!0,size:`sm`,"data-action":`start-task`,children:(0,I.jsx)(C,{to:i,children:`Start task`})})})})]})}function q(){let e=d(),[t,n]=(0,F.useState)(null),[i,o]=(0,F.useState)(null),[s,c]=(0,F.useState)(``),[l]=f(),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=u(p,_),b=Q(m,y.account),x=y.data??[],w=T(x,s);return(0,I.jsxs)(A,{route:`skills`,density:y.isPending?`full`:E(w.length),className:`max-md:[padding-block-end:5rem]`,bodyClassName:`gap-5`,header:{title:`Skills`,subtitle:`The skills each agent loads in this project, as its runner reports them.`,secondaryActions:(0,I.jsxs)(O,{variant:`outline`,onClick:()=>void b.run(),disabled:b.running||y.isPending,"data-slot":`skills-refresh`,children:[(0,I.jsx)(g,{"aria-hidden":`true`,className:r(`size-3.5`,b.running&&`motion-safe:animate-spin`)}),`Re-read`]})},sparseFooter:!y.isPending&&w.length>0?(0,I.jsx)(D,{summary:`${w.length} ${w.length===1?`skill`:`skills`} available for this runner. Type / in New task to invoke one, or chain them into a workflow.`,actions:(0,I.jsx)(S,{variant:`outline`,size:`sm`,asChild:!0,className:`max-md:min-h-11`,children:(0,I.jsx)(C,{to:`/workflows`,children:`Open workflows`})})}):void 0,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(Y,{runner:m,onChange:e=>{n(e),v(null)}}),(0,I.jsx)(X,{runner:m,account:_,onChange:v}),(0,I.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,"data-slot":`skills-count`,children:y.list?`${x.length} ${x.length===1?`skill`:`skills`}${y.list.source===`cache`?` · from cache`:``}`:null})]}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.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,I.jsx)(N,{"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,I.jsx)(Z,{query:y}),y.isPending?(0,I.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Loading skills…`}):(0,I.jsx)(J,{skills:x,matches:w,search:s,onClearSearch:()=>c(``),onRefresh:()=>void b.run(),openId:l.get(`skill`),runner:m,account:y.account??null,unchecked:y.unchecked})]})}function J({skills:e,matches:t,search:n,onClearSearch:r,onRefresh:i,openId:a,runner:o,account:s,unchecked:c}){return e.length===0?c?null:(0,I.jsx)(k,{icon:(0,I.jsx)(b,{}),title:`No skills reported by this runner and account.`,description:`Add a skill to this repository or your runner home, then re-read to refresh the inventory.`,actions:(0,I.jsx)(S,{variant:`outline`,className:`max-md:min-h-11`,onClick:i,children:`Re-read skills`})}):t.length===0?(0,I.jsx)(k,{icon:(0,I.jsx)(h,{}),title:`No skills match “${n.trim()}”.`,description:`Try a different keyword or clear the filter to browse every available skill.`,actions:(0,I.jsx)(S,{variant:`outline`,className:`max-md:min-h-11`,onClick:r,children:`Clear filter`})}):(0,I.jsx)(W,{groups:V(t),openId:a,searching:n.trim()!==``,runner:o,account:s})}function Y({runner:e,onChange:t}){let n=i().data;return n?(0,I.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,I.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 X({runner:e,account:t,onChange:n}){let r=P().accounts.filter(t=>t.provider===e);return r.length===0?null:(0,I.jsxs)(`div`,{className:`relative inline-flex items-center`,children:[(0,I.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,I.jsx)(`option`,{value:``,children:`Account: project default`}),r.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))]}),(0,I.jsx)(v,{"aria-hidden":`true`,className:`pointer-events-none absolute right-2.5 size-3.5 text-muted-foreground`})]})}function Z({query:e}){let t=e.list?.problems??[];return!e.unchecked&&t.length===0?null:(0,I.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,I.jsxs)(`p`,{role:`status`,className:`flex gap-2`,children:[(0,I.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,I.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,I.jsxs)(`p`,{role:`alert`,className:`flex gap-2 break-words`,children:[(0,I.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,I.jsxs)(`span`,{children:[e.message,e.path?` · ${e.path}`:``]})]},t))]})}function Q(e,t){let n=s(),[r,i]=(0,F.useState)(!1),a=l.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){c(e instanceof Error?e.message:String(e),{tone:`danger`})}finally{i(!1)}}}}export{q as SkillsRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{m as i,p as a}from"./live-reads-Crd6fVGH.js";import{S as o,pi as s}from"./project-scope-context-Rv6S_BXt.js";import{n as c}from"./toaster-BXnLIU3z.js";import{Bt as l,Wt as u,_ as d}from"./queries-qCF-eOqZ.js";import{g as f}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{O as p,T as m,X as h,Y as g,ct as _,l as v,ot as y,tt as b,u as x}from"./design-icons-CzEoMH9c.js";import{t as S}from"./button-B7MKxYjT.js";import{t as C}from"./project-router-CLJTc7gv.js";import{f as w,l as T}from"./skills-pM_PouEs.js";import{d as E,n as D,s as O,t as k,u as A}from"./page-shell-7pLJMOgh.js";import{Dn as j,H as M,Kn as N,xn as P}from"./index-cS5ELSRA.js";var F=e(t(),1),I=n(),L=e=>e.split(`@`)[0]||e,R={project:0,user:1,plugin:2,system:3,other:4},z={project:`This project`,user:`Your skills`,system:`Built in`,other:`Other`};function B(e){if(e.plugin)return{key:`plugin:${e.plugin}`,label:L(e.plugin),kind:`plugin`};let t=e.scope===`repo`?`project`:e.scope===`user`?`user`:e.scope===`system`?`system`:`other`;return{key:t,label:z[t],kind:t}}function V(e){let t=new Map;for(let n of e){let e=B(n),r=t.get(e.key)??{...e,skills:[]};r.skills.push(n),t.set(e.key,r)}return[...t.values()].sort((e,t)=>R[e.kind]-R[t.kind]||e.label.localeCompare(t.label))}function H(e){let t=e.plugin?`${L(e.plugin)}:`:``;return t&&e.name.startsWith(t)&&e.name.length>t.length?e.name.slice(t.length):e.name}var U={project:m,user:_,plugin:p,system:p,other:p};function W({groups:e,openId:t,searching:n,runner:r,account:i}){let[a,o]=(0,F.useState)(new Set),s=e=>o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,I.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,I.jsxs)(`section`,{"data-slot":`skill-group`,"aria-label":e.label,className:`border-border not-first:border-t`,children:[(0,I.jsx)(G,{group:e,open:o,onToggle:()=>s(e.key)}),o?e.skills.map(e=>(0,I.jsx)(K,{skill:e,open:e.id===t,runner:r,account:i},w(e))):null]},e.key)})})}function G({group:e,open:t,onToggle:n}){let i=U[e.kind];return(0,I.jsx)(`h2`,{className:`m-0`,children:(0,I.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,I.jsx)(x,{"aria-hidden":`true`,className:r(`size-3.5 transition-transform motion-reduce:transition-none`,t&&`rotate-90`)}),(0,I.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,I.jsx)(`span`,{className:`font-medium text-soft-foreground`,children:e.skills.length})]})})}function K({skill:e,open:t,runner:n,account:r}){let i=j({skill:e.id,skillPath:e.path,runner:n,...r?{account:r}:{}});return(0,I.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,I.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,I.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,I.jsx)(`span`,{className:`truncate text-[13.5px] leading-snug font-semibold text-foreground`,title:e.name,children:H(e)}),e.description?(0,I.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,I.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,I.jsx)(`div`,{className:`pr-3.5 pb-4 pl-9`,children:(0,I.jsx)(M,{skill:e,heading:null,actions:(0,I.jsx)(S,{asChild:!0,size:`sm`,"data-action":`start-task`,children:(0,I.jsx)(C,{to:i,children:`Start task`})})})})]})}function q(){let e=d(),[t,n]=(0,F.useState)(null),[i,o]=(0,F.useState)(null),[s,c]=(0,F.useState)(``),[l]=f(),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=u(p,_),b=Q(m,y.account),x=y.data??[],w=T(x,s);return(0,I.jsxs)(A,{route:`skills`,density:y.isPending?`full`:E(w.length),className:`max-md:[padding-block-end:5rem]`,bodyClassName:`gap-5`,header:{title:`Skills`,subtitle:`The skills each agent loads in this project, as its runner reports them.`,secondaryActions:(0,I.jsxs)(O,{variant:`outline`,onClick:()=>void b.run(),disabled:b.running||y.isPending,"data-slot":`skills-refresh`,children:[(0,I.jsx)(g,{"aria-hidden":`true`,className:r(`size-3.5`,b.running&&`motion-safe:animate-spin`)}),`Re-read`]})},sparseFooter:!y.isPending&&w.length>0?(0,I.jsx)(D,{summary:`${w.length} ${w.length===1?`skill`:`skills`} available for this runner. Type / in New task to invoke one, or chain them into a workflow.`,actions:(0,I.jsx)(S,{variant:`outline`,size:`sm`,asChild:!0,className:`max-md:min-h-11`,children:(0,I.jsx)(C,{to:`/workflows`,children:`Open workflows`})})}):void 0,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(Y,{runner:m,onChange:e=>{n(e),v(null)}}),(0,I.jsx)(X,{runner:m,account:_,onChange:v}),(0,I.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,"data-slot":`skills-count`,children:y.list?`${x.length} ${x.length===1?`skill`:`skills`}${y.list.source===`cache`?` · from cache`:``}`:null})]}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.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,I.jsx)(N,{"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,I.jsx)(Z,{query:y}),y.isPending?(0,I.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Loading skills…`}):(0,I.jsx)(J,{skills:x,matches:w,search:s,onClearSearch:()=>c(``),onRefresh:()=>void b.run(),openId:l.get(`skill`),runner:m,account:y.account??null,unchecked:y.unchecked})]})}function J({skills:e,matches:t,search:n,onClearSearch:r,onRefresh:i,openId:a,runner:o,account:s,unchecked:c}){return e.length===0?c?null:(0,I.jsx)(k,{icon:(0,I.jsx)(b,{}),title:`No skills reported by this runner and account.`,description:`Add a skill to this repository or your runner home, then re-read to refresh the inventory.`,actions:(0,I.jsx)(S,{variant:`outline`,className:`max-md:min-h-11`,onClick:i,children:`Re-read skills`})}):t.length===0?(0,I.jsx)(k,{icon:(0,I.jsx)(h,{}),title:`No skills match “${n.trim()}”.`,description:`Try a different keyword or clear the filter to browse every available skill.`,actions:(0,I.jsx)(S,{variant:`outline`,className:`max-md:min-h-11`,onClick:r,children:`Clear filter`})}):(0,I.jsx)(W,{groups:V(t),openId:a,searching:n.trim()!==``,runner:o,account:s})}function Y({runner:e,onChange:t}){let n=i().data;return n?(0,I.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,I.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 X({runner:e,account:t,onChange:n}){let r=P().accounts.filter(t=>t.provider===e);return r.length===0?null:(0,I.jsxs)(`div`,{className:`relative inline-flex items-center`,children:[(0,I.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,I.jsx)(`option`,{value:``,children:`Account: project default`}),r.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))]}),(0,I.jsx)(v,{"aria-hidden":`true`,className:`pointer-events-none absolute right-2.5 size-3.5 text-muted-foreground`})]})}function Z({query:e}){let t=e.list?.problems??[];return!e.unchecked&&t.length===0?null:(0,I.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,I.jsxs)(`p`,{role:`status`,className:`flex gap-2`,children:[(0,I.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,I.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,I.jsxs)(`p`,{role:`alert`,className:`flex gap-2 break-words`,children:[(0,I.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,I.jsxs)(`span`,{children:[e.message,e.path?` · ${e.path}`:``]})]},t))]})}function Q(e,t){let n=s(),[r,i]=(0,F.useState)(!1),a=l.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){c(e instanceof Error?e.message:String(e),{tone:`danger`})}finally{i(!1)}}}}export{q as SkillsRoute};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-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,ot as d,pi as f,rt as p}from"./project-scope-context-Rv6S_BXt.js";import{n as m}from"./toaster-BXnLIU3z.js";import{Bt as h,C as g,Qt as _,X as v,Y as y,vt as b}from"./queries-qCF-eOqZ.js";import{h as x}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{C as S,j as C,l as w}from"./design-icons-CzEoMH9c.js";import{t as T}from"./run-header-DeprqSP7.js";import{i as E,n as D,r as ee}from"./git-toolbar-BulcGzsv.js";import{t as O}from"./button-B7MKxYjT.js";import{a as k,i as A,o as j,r as M,s as N,t as P}from"./dialog-B531GGAo.js";import{b as F,f as I}from"./task-groups-4tzKGROI.js";import{c as L,d as R}from"./page-shell-7pLJMOgh.js";import{t as z}from"./centered-state-V15AR_qo.js";import{C as B,X as V,cn as H,en as U,w as W}from"./index-DNQcTHxV.js";import{t as G}from"./markdown-BBDDg-4t.js";import{t as K}from"./textarea-vJt9undk.js";import{t as q}from"./diff-hxqBOfZH.js";var J=e(t(),1),Y=`no worktree — this task ran directly in the repo working tree`;function X(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 — ${Y}`)}function Z(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 — ${Y}`)}function Q(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 — ${Y}`):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`):F(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 te(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:X(e),n=e.prUrl?[X(e),Z(e)]:[Z(e),Q(e)],r=[];if(e.localHandoff&&e.cliHandoff!==!1){let t=e.hasSession?F(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 ne({run:e,open:t,onOpenChange:n}){let r=f(),[i,a]=(0,J.useState)(``),o=I(e),s=(0,J.useRef)(o);s.current=o,(0,J.useEffect)(()=>{t&&a(s.current)},[t]);let c=_({mutationFn:t=>p(e.id,t),onSuccess:t=>{m(`Committed ${t.sha.slice(0,7)}`),n(!1),r.invalidateQueries({queryKey:h.runs.changes(e.id)}),r.invalidateQueries({queryKey:h.runs.all})},onError:e=>m(e.message,{tone:`danger`})}),l=()=>{let e=i.trim();e.length===0||c.isPending||c.mutate(e)};return(0,$.jsx)(P,{open:t,onOpenChange:n,children:(0,$.jsxs)(M,{"data-slot":`commit-dialog`,children:[(0,$.jsxs)(j,{children:[(0,$.jsx)(N,{children:`Commit changes`}),(0,$.jsxs)(A,{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)(K,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{V({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)(k,{children:[(0,$.jsx)(O,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,$.jsx)(O,{"data-slot":`commit-confirm`,disabled:i.trim().length===0||c.isPending,onClick:l,children:c.isPending?`Committing…`:`Commit`})]})]})})}function re(){let{id:e}=x(),t=y(e);return t.isPending?(0,$.jsx)(W,{tab:`changes`}):t.isError?(0,$.jsx)(B,{tab:`changes`,error:t.error}):(0,$.jsx)(ie,{run:t.data})}function ie({run:e}){let t=b(),n=g(),r=v(e.id,F(e)),i=U(),[a,l]=(0,J.useState)(`unified`),[p,y]=(0,J.useState)(!0),[x,S]=(0,J.useState)(!1),[C,w]=(0,J.useState)(null),[E,O]=(0,J.useState)(!1),k=(0,J.useRef)(null),A=f(),j=()=>A.invalidateQueries({queryKey:h.runs.all}),M=e=>m(e.message,{tone:`danger`}),N=_({mutationFn:()=>u(e.id),onSuccess:e=>m(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:M}),P=_({mutationFn:()=>d(e.id),onSuccess:e=>{m(`Draft PR created — ${e.url}`),j()},onError:M}),I=_({mutationFn:()=>o(e.id),onError:e=>{if(e instanceof s&&e.command){navigator.clipboard.writeText(e.command).then(()=>m(`No terminal found — command copied to clipboard.`)).catch(()=>m(`Run manually: ${e.command}`));return}M(e)}}),z=_({mutationFn:t=>c(e.id,t),onError:M}),B=r.isError&&r.error instanceof s&&r.error.status===409,V=te({run:e,cliHandoff:e.cliHandoff,hasWorktree:!!e.worktreePath&&!B,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:H(e)!==void 0,prUrl:e.pullRequestUrl}),W=e=>{switch(e){case`commit`:O(!0);break;case`push`:N.mutate();break;case`create-pr`:P.mutate();break;case`open-terminal`:I.mutate();break;case`view-pr`:break}},K=r.data?.files??[],q=(0,J.useMemo)(()=>ee(K),[K]),Y=(0,J.useMemo)(()=>K.some(G),[K]),X=i?a:`unified`;return(0,$.jsxs)(L,{route:`task-changes`,density:R(K.length),flushPadding:!0,children:[(0,$.jsx)(T,{run:e,tab:`changes`}),(0,$.jsx)(D,{bar:V,healthReady:t.data!==void 0,branch:e.branch,stat:r.data?.stat,mode:X,wrap:p,preview:x,onModeChange:l,onWrapChange:y,onPreviewChange:Y?S:void 0,onAction:W}),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)(ae,{changes:r,changesRefused:B,fileCount:K.length,children:(0,$.jsx)(oe,{runId:e.id,files:K,tree:q,selected:C,selectFile:e=>{w(e),k.current?.scrollToPath(e)},diffRef:k,effectiveMode:X,effectiveWrap:p,preview:x,localHandoff:t.data?.capabilities.localHandoff,onOpenInApp:z.mutate})}),(0,$.jsx)(ne,{run:e,open:E,onOpenChange:O})]})}function ae({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)(z,{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)(z,{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 oe({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,J.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)(q,{files:t,viewRef:s,mode:c,wrap:l,preview:u,loadFileText:t=>se(e,t),imageSrc:t=>i(e,t),onOpenInApp:d?e=>f(e):void 0,totals:!1,className:`min-w-0 flex-1`})]})}async function se(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{re as TaskChangesRoute};
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,ot as d,pi as f,rt as p}from"./project-scope-context-Rv6S_BXt.js";import{n as m}from"./toaster-BXnLIU3z.js";import{Bt as h,C as g,Qt as _,X as v,Y as y,vt as b}from"./queries-qCF-eOqZ.js";import{h as x}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{C as S,j as C,l as w}from"./design-icons-CzEoMH9c.js";import{t as T}from"./run-header-Sse1VUYh.js";import{i as E,n as D,r as ee}from"./git-toolbar-DMB3ZSSD.js";import{t as O}from"./button-B7MKxYjT.js";import{a as k,i as A,o as j,r as M,s as N,t as P}from"./dialog-B531GGAo.js";import{b as F,f as I}from"./task-groups-4tzKGROI.js";import{c as L,d as R}from"./page-shell-7pLJMOgh.js";import{t as z}from"./centered-state-V15AR_qo.js";import{T as B,Z as V,ln as H,tn as U,w as W}from"./index-cS5ELSRA.js";import{t as G}from"./markdown-BBDDg-4t.js";import{t as K}from"./textarea-vJt9undk.js";import{t as q}from"./diff-Bph54Mj6.js";var J=e(t(),1),Y=`no worktree — this task ran directly in the repo working tree`;function X(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 — ${Y}`)}function Z(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 — ${Y}`)}function Q(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 — ${Y}`):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`):F(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 te(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:X(e),n=e.prUrl?[X(e),Z(e)]:[Z(e),Q(e)],r=[];if(e.localHandoff&&e.cliHandoff!==!1){let t=e.hasSession?F(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 ne({run:e,open:t,onOpenChange:n}){let r=f(),[i,a]=(0,J.useState)(``),o=I(e),s=(0,J.useRef)(o);s.current=o,(0,J.useEffect)(()=>{t&&a(s.current)},[t]);let c=_({mutationFn:t=>p(e.id,t),onSuccess:t=>{m(`Committed ${t.sha.slice(0,7)}`),n(!1),r.invalidateQueries({queryKey:h.runs.changes(e.id)}),r.invalidateQueries({queryKey:h.runs.all})},onError:e=>m(e.message,{tone:`danger`})}),l=()=>{let e=i.trim();e.length===0||c.isPending||c.mutate(e)};return(0,$.jsx)(P,{open:t,onOpenChange:n,children:(0,$.jsxs)(M,{"data-slot":`commit-dialog`,children:[(0,$.jsxs)(j,{children:[(0,$.jsx)(N,{children:`Commit changes`}),(0,$.jsxs)(A,{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)(K,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{V({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)(k,{children:[(0,$.jsx)(O,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,$.jsx)(O,{"data-slot":`commit-confirm`,disabled:i.trim().length===0||c.isPending,onClick:l,children:c.isPending?`Committing…`:`Commit`})]})]})})}function re(){let{id:e}=x(),t=y(e);return t.isPending?(0,$.jsx)(B,{tab:`changes`}):t.isError?(0,$.jsx)(W,{tab:`changes`,error:t.error}):(0,$.jsx)(ie,{run:t.data})}function ie({run:e}){let t=b(),n=g(),r=v(e.id,F(e)),i=U(),[a,l]=(0,J.useState)(`unified`),[p,y]=(0,J.useState)(!0),[x,S]=(0,J.useState)(!1),[C,w]=(0,J.useState)(null),[E,O]=(0,J.useState)(!1),k=(0,J.useRef)(null),A=f(),j=()=>A.invalidateQueries({queryKey:h.runs.all}),M=e=>m(e.message,{tone:`danger`}),N=_({mutationFn:()=>u(e.id),onSuccess:e=>m(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:M}),P=_({mutationFn:()=>d(e.id),onSuccess:e=>{m(`Draft PR created — ${e.url}`),j()},onError:M}),I=_({mutationFn:()=>o(e.id),onError:e=>{if(e instanceof s&&e.command){navigator.clipboard.writeText(e.command).then(()=>m(`No terminal found — command copied to clipboard.`)).catch(()=>m(`Run manually: ${e.command}`));return}M(e)}}),z=_({mutationFn:t=>c(e.id,t),onError:M}),B=r.isError&&r.error instanceof s&&r.error.status===409,V=te({run:e,cliHandoff:e.cliHandoff,hasWorktree:!!e.worktreePath&&!B,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:H(e)!==void 0,prUrl:e.pullRequestUrl}),W=e=>{switch(e){case`commit`:O(!0);break;case`push`:N.mutate();break;case`create-pr`:P.mutate();break;case`open-terminal`:I.mutate();break;case`view-pr`:break}},K=r.data?.files??[],q=(0,J.useMemo)(()=>ee(K),[K]),Y=(0,J.useMemo)(()=>K.some(G),[K]),X=i?a:`unified`;return(0,$.jsxs)(L,{route:`task-changes`,density:R(K.length),flushPadding:!0,children:[(0,$.jsx)(T,{run:e,tab:`changes`}),(0,$.jsx)(D,{bar:V,healthReady:t.data!==void 0,branch:e.branch,stat:r.data?.stat,mode:X,wrap:p,preview:x,onModeChange:l,onWrapChange:y,onPreviewChange:Y?S:void 0,onAction:W}),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)(ae,{changes:r,changesRefused:B,fileCount:K.length,children:(0,$.jsx)(oe,{runId:e.id,files:K,tree:q,selected:C,selectFile:e=>{w(e),k.current?.scrollToPath(e)},diffRef:k,effectiveMode:X,effectiveWrap:p,preview:x,localHandoff:t.data?.capabilities.localHandoff,onOpenInApp:z.mutate})}),(0,$.jsx)(ne,{run:e,open:E,onOpenChange:O})]})}function ae({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)(z,{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)(z,{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 oe({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,J.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)(q,{files:t,viewRef:s,mode:c,wrap:l,preview:u,loadFileText:t=>se(e,t),imageSrc:t=>i(e,t),onOpenInApp:d?e=>f(e):void 0,totals:!1,className:`min-w-0 flex-1`})]})}async function se(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{re 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-Rv6S_BXt.js";import{$t as a,Bt as o,Q as s,Y as c,Z as l}from"./queries-qCF-eOqZ.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-Sse1VUYh.js";import{n as h}from"./diff-controls-D6zRC-Ch.js";import{t as g}from"./project-router-CLJTc7gv.js";import{b as _}from"./task-groups-4tzKGROI.js";import{c as v,d as y}from"./page-shell-7pLJMOgh.js";import{t as b}from"./centered-state-V15AR_qo.js";import{Bt as x,T as S,gn as C,tn as w,w as T}from"./index-cS5ELSRA.js";import{t as E}from"./diff-Bph54Mj6.js";import{t as D}from"./change-counts-CW7O8g5Y.js";import{r as O,t as k}from"./commit-list-hmnkwJgy.js";var A=e(t(),1),j=n();function M(){let{id:e}=u(),t=c(e);return t.isPending?(0,j.jsx)(S,{tab:`changes`}):t.isError?(0,j.jsx)(T,{tab:`changes`,error:t.error}):(0,j.jsx)(N,{run:t.data})}function N({run:e}){let{sha:t}=u(),n=s(e.id,_(e)),i=n.data?.commits[0]?.sha;return(0,j.jsxs)(v,{route:`task-commits`,density:y(n.data?.commits.length??0),flushPadding:!0,children:[(0,j.jsx)(m,{run:e,tab:`commits`}),t?(0,j.jsx)(F,{runId:e.id,sha:t}):n.isPending?(0,j.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,j.jsx)(b,{icon:(0,j.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,j.jsx)(b,{icon:(0,j.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,j.jsx)(P,{run:e,commits:n.data.commits,selectedSha:i})]})}function P({run:e,commits:t,selectedSha:n}){let r=l(e.id,n),i=L(e.id,t),a=(0,A.useRef)(null),o=w(),[s,c]=(0,A.useState)(`unified`),[u,d]=(0,A.useState)(!0),m=o?s:`unified`;return(0,j.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,j.jsxs)(`div`,{className:`w-full shrink-0 lg:w-[380px] xl:w-[420px]`,children:[(0,j.jsx)(k,{slot:`task-commits`,selectedSha:n,heading:(0,j.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,j.jsx)(R,{runId:e.id,sha:n,files:r.data.files,onPick:e=>a.current?.scrollToPath(e)}):null]}),n?(0,j.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,j.jsx)(`p`,{className:`px-4 py-8 text-center text-xs text-muted-foreground`,children:`Loading commit diff…`}):r.isError?(0,j.jsx)(b,{icon:(0,j.jsx)(p,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load commit diff`,subtitle:r.error.message}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-2 border-b border-border px-4 py-3`,children:[(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`h3`,{className:`break-words text-sm leading-snug font-semibold text-foreground`,children:r.data.subject}),(0,j.jsxs)(`p`,{className:`mt-0.5 flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,j.jsx)(`span`,{children:r.data.author}),(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,j.jsx)(`span`,{title:r.data.when,children:x(r.data.when)}),(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,j.jsx)(`span`,{className:`font-mono select-all`,title:r.data.sha??n,children:(r.data.sha??n).slice(0,8)}),r.data.stat?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,j.jsx)(C,{stat:r.data.stat})]}):null]})]}),(0,j.jsx)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:(0,j.jsx)(h,{mode:s,wrap:u,onModeChange:c,onWrapChange:d})})]}),!r.data.files||r.data.files.length===0?(0,j.jsx)(b,{icon:(0,j.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,j.jsx)(`div`,{className:`p-4 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem]`,children:(0,j.jsx)(E,{viewRef:a,files:r.data.files,mode:m,wrap:u,totals:!1,className:`min-w-0`})})]})}):null]})}function F({runId:e,sha:t}){return(0,j.jsx)(O,{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 I=12;function L(e,t){let n=t.length<=I,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 R({runId:e,sha:t,files:n,onPick:r}){return(0,j.jsxs)(`section`,{"data-slot":`task-commit-files`,className:`mt-4 rounded-xl border border-border bg-card p-4`,children:[(0,j.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1`,children:[(0,j.jsxs)(`h2`,{className:`text-sm font-semibold text-foreground`,children:[n.length,` `,n.length===1?`file`:`files`,` in`,` `,(0,j.jsx)(`span`,{className:`font-mono text-[13px] font-medium`,title:t,children:t.slice(0,8)})]}),(0,j.jsx)(g,{to:`/tasks/${e}/changes`,className:`text-xs text-muted-foreground hover:text-foreground`,children:`All task changes ›`})]}),(0,j.jsx)(`ul`,{className:`space-y-1`,children:n.map(e=>(0,j.jsx)(`li`,{children:(0,j.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,j.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-[15px] shrink-0`}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 break-all`,children:e.path}),(0,j.jsx)(D,{adds:e.adds,dels:e.dels,className:`font-mono text-xs`})]})},e.path))})]})}export{M as TaskCommitsRoute};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{Nn as i,et as a,ut as o}from"./project-scope-context-Rv6S_BXt.js";import{B as s,F as c,N as l,Y as u,et as d}from"./queries-qCF-eOqZ.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-DeprqSP7.js";import{a as T,i as E,n as D,o as O,r as k}from"./file-preview-VvCzp02k.js";import{t as A}from"./button-B7MKxYjT.js";import{c as j}from"./page-shell-7pLJMOgh.js";import{t as M}from"./centered-state-V15AR_qo.js";import{$n as N,C as P,Wn as F,w as I}from"./index-DNQcTHxV.js";import{r as L}from"./markdown-9L65ixU6.js";var R=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`}]]),z=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`}]]),B=e(t(),1),V=n();function H({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,B.useContext)(L),p=f(),m=p.pathname.replace(/\/files\/?$/,`/report`)+p.search,h=u.data,g=(0,B.useMemo)(()=>h?.type===`file`&&h.source!==`artifact`?{runId:e,...d,basePath:h.path}:null,[h,d,e]);if(!t&&!n)return(0,V.jsx)(k,{runId:e,path:null,className:`min-w-0 flex-1`});if(u.isPending)return(0,V.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(u.isError)return(0,V.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,V.jsx)(`h2`,{children:`Could not load this file`}),(0,V.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:u.error.message}),(0,V.jsx)(A,{variant:`outline`,onClick:()=>void u.refetch(),children:`Retry`})]});if(!h)return(0,V.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,V.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,V.jsx)(`h2`,{children:h.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,V.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:_}),(0,V.jsx)(`p`,{className:`text-sm`,children:h.reason}),(0,V.jsx)(A,{variant:`outline`,onClick:()=>void u.refetch(),children:`Retry`})]});let v=h.artifact;return(0,V.jsx)(L.Provider,{value:g,children:(0,V.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 U=new Map;function W(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var G=(0,B.createContext)(null);function K(){let{key:e}=f(),t=h()===`POP`,[n,r]=(0,B.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 q=()=>document.querySelector(`[data-slot="main"]`);function J(e,t){let n=(0,B.useRef)(null),r=f(),i=h()===`POP`?r.key:W(r.state),[a]=(0,B.useState)(()=>{let t=i?U.get(i):void 0;return t?.runId===e?t:null}),o=(0,B.useRef)(new Set(a?.folders??[])),s=(0,B.useRef)(new Set),[c,l]=(0,B.useState)(0),u=(0,B.useRef)(a===null),d=(0,B.useCallback)(()=>{u.current&&U.set(r.key,{runId:e,folders:new Set(o.current),tree:n.current?.scrollTop??0,main:q()?.scrollTop??0})},[r.key,e]),p=(0,B.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,B.useEffect)(()=>{if(u.current||!a||!t||s.current.size>0)return;n.current&&(n.current.scrollTop=a.tree);let e=q();e&&(e.scrollTop=a.main),u.current=!0,d()},[a,t,c,d]),(0,B.useEffect)(()=>{d();let e=[n.current,q()].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 Y({runId:e,selected:t,onSelect:n}){return(0,V.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,V.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,V.jsx)(X,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function X({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=d(e,t),o=(0,B.useContext)(G);return(0,B.useEffect)(()=>{if(!(!t||!o))return o.loading(t,a.isPending),()=>o.loading(t,!1)},[o,t,a.isPending]),a.isPending?(0,V.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,V.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,V.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,V.jsx)(V.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,V.jsx)(Z,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,V.jsx)(Q,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function Z({runId:e,name:t,path:n,depth:i,selected:a,onSelect:o}){let s=(0,B.useContext)(G),[c,l]=(0,B.useState)(()=>s?.isOpen(n)??!1);return(0,V.jsxs)(`li`,{children:[(0,V.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,V.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,V.jsx)(_,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,V.jsx)(`span`,{className:`min-w-0 truncate font-normal`,children:t})]}),c?(0,V.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,V.jsx)(X,{runId:e,path:n,depth:i+1,selected:a,onSelect:o})}):null]})}function Q({name:e,path:t,size:n,depth:i,selected:a,onSelect:o}){let s=a===t,c=O(t)?z:g;return(0,V.jsx)(`li`,{children:(0,V.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,V.jsx)(c,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,V.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,V.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs tabular-nums text-soft-foreground`,children:T(n)})]})})}function $(){let{id:e}=m(),t=u(e),n=K();return t.isPending?(0,V.jsx)(I,{tab:`files`}):t.isError?(0,V.jsx)(P,{tab:`files`,error:t.error}):(0,V.jsx)(C,{runId:t.data.id,children:(0,V.jsx)(te,{run:t.data},`${t.data.id}:${n}`)})}function ee(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 te({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,B.useState)(o??``);(0,B.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=ee(e.id,o,s,l),_=J(e.id,!t.isPending&&g);return(0,V.jsxs)(j,{route:`task-files`,density:ne(t.isError),flushPadding:!0,children:[(0,V.jsx)(w,{run:e,tab:`files`}),(0,V.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,V.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,V.jsx)(v,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,V.jsx)(F,{"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,V.jsx)(A,{type:`submit`,variant:`outline`,className:`h-11 shrink-0`,disabled:!u.trim(),children:`Open file`})]}),(0,V.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,V.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,V.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,V.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,V.jsx)(M,{icon:h?(0,V.jsx)(R,{}):(0,V.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,V.jsx)(G.Provider,{value:_.folders,children:(0,V.jsx)(Y,{runId:e.id,selected:o,onSelect:e=>m(`path`,e)})}),(0,V.jsx)(re,{artifacts:n,artifactId:s,onSelect:e=>m(`artifact`,e)})]}),l?(0,V.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,V.jsx)(H,{runId:e.id,path:o,artifactId:s,worktreePath:e.worktreePath}):null]}),(0,V.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.`})]})}function ne(e){return e?`empty`:`full`}function re({artifacts:e,artifactId:t,onSelect:n}){return(0,V.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),e.isPending?(0,V.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):e.isError?(0,V.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):e.data.artifacts.length===0?(0,V.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,V.jsx)(`ul`,{children:e.data.artifacts.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(`button`,{type:`button`,"data-slot":`artifact-row`,"aria-current":e.id===t?`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:()=>n(e.id),children:[(0,V.jsx)(N,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 wrap-anywhere underline-offset-2 group-hover:underline`,children:e.name}),(0,V.jsx)(x,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground group-hover:text-foreground`})]})},e.id))}),(0,V.jsxs)(A,{variant:`outline`,size:`sm`,"data-action":`refresh-artifacts`,className:`mt-2 max-md:h-11 no-hover:h-11`,onClick:()=>void e.refetch(),children:[(0,V.jsx)(y,{"aria-hidden":`true`}),`Refresh published files`]})]})}export{$ as TaskFilesRoute};
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-Rv6S_BXt.js";import{B as s,F as c,N as l,Y as u,et as d}from"./queries-qCF-eOqZ.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-Sse1VUYh.js";import{a as T,i as E,n as D,o as O,r as k}from"./file-preview-DLiwl3fv.js";import{t as A}from"./button-B7MKxYjT.js";import{c as j}from"./page-shell-7pLJMOgh.js";import{t as M}from"./centered-state-V15AR_qo.js";import{Kn as N,T as P,tr as F,w as I}from"./index-cS5ELSRA.js";import{r as L}from"./markdown-DBhG8Ap2.js";var R=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`}]]),z=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`}]]),B=e(t(),1),V=n();function H({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,B.useContext)(L),p=f(),m=p.pathname.replace(/\/files\/?$/,`/report`)+p.search,h=u.data,g=(0,B.useMemo)(()=>h?.type===`file`&&h.source!==`artifact`?{runId:e,...d,basePath:h.path}:null,[h,d,e]);if(!t&&!n)return(0,V.jsx)(k,{runId:e,path:null,className:`min-w-0 flex-1`});if(u.isPending)return(0,V.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(u.isError)return(0,V.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,V.jsx)(`h2`,{children:`Could not load this file`}),(0,V.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:u.error.message}),(0,V.jsx)(A,{variant:`outline`,onClick:()=>void u.refetch(),children:`Retry`})]});if(!h)return(0,V.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,V.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,V.jsx)(`h2`,{children:h.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,V.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:_}),(0,V.jsx)(`p`,{className:`text-sm`,children:h.reason}),(0,V.jsx)(A,{variant:`outline`,onClick:()=>void u.refetch(),children:`Retry`})]});let v=h.artifact;return(0,V.jsx)(L.Provider,{value:g,children:(0,V.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 U=new Map;function W(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var G=(0,B.createContext)(null);function K(){let{key:e}=f(),t=h()===`POP`,[n,r]=(0,B.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 q=()=>document.querySelector(`[data-slot="main"]`);function J(e,t){let n=(0,B.useRef)(null),r=f(),i=h()===`POP`?r.key:W(r.state),[a]=(0,B.useState)(()=>{let t=i?U.get(i):void 0;return t?.runId===e?t:null}),o=(0,B.useRef)(new Set(a?.folders??[])),s=(0,B.useRef)(new Set),[c,l]=(0,B.useState)(0),u=(0,B.useRef)(a===null),d=(0,B.useCallback)(()=>{u.current&&U.set(r.key,{runId:e,folders:new Set(o.current),tree:n.current?.scrollTop??0,main:q()?.scrollTop??0})},[r.key,e]),p=(0,B.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,B.useEffect)(()=>{if(u.current||!a||!t||s.current.size>0)return;n.current&&(n.current.scrollTop=a.tree);let e=q();e&&(e.scrollTop=a.main),u.current=!0,d()},[a,t,c,d]),(0,B.useEffect)(()=>{d();let e=[n.current,q()].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 Y({runId:e,selected:t,onSelect:n}){return(0,V.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,V.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,V.jsx)(X,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function X({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=d(e,t),o=(0,B.useContext)(G);return(0,B.useEffect)(()=>{if(!(!t||!o))return o.loading(t,a.isPending),()=>o.loading(t,!1)},[o,t,a.isPending]),a.isPending?(0,V.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,V.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,V.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,V.jsx)(V.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,V.jsx)(Z,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,V.jsx)(Q,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function Z({runId:e,name:t,path:n,depth:i,selected:a,onSelect:o}){let s=(0,B.useContext)(G),[c,l]=(0,B.useState)(()=>s?.isOpen(n)??!1);return(0,V.jsxs)(`li`,{children:[(0,V.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,V.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,V.jsx)(_,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,V.jsx)(`span`,{className:`min-w-0 truncate font-normal`,children:t})]}),c?(0,V.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,V.jsx)(X,{runId:e,path:n,depth:i+1,selected:a,onSelect:o})}):null]})}function Q({name:e,path:t,size:n,depth:i,selected:a,onSelect:o}){let s=a===t,c=O(t)?z:g;return(0,V.jsx)(`li`,{children:(0,V.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,V.jsx)(c,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,V.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,V.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs tabular-nums text-soft-foreground`,children:T(n)})]})})}function $(){let{id:e}=m(),t=u(e),n=K();return t.isPending?(0,V.jsx)(P,{tab:`files`}):t.isError?(0,V.jsx)(I,{tab:`files`,error:t.error}):(0,V.jsx)(C,{runId:t.data.id,children:(0,V.jsx)(te,{run:t.data},`${t.data.id}:${n}`)})}function ee(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 te({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,B.useState)(o??``);(0,B.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=ee(e.id,o,s,l),_=J(e.id,!t.isPending&&g);return(0,V.jsxs)(j,{route:`task-files`,density:ne(t.isError),flushPadding:!0,children:[(0,V.jsx)(w,{run:e,tab:`files`}),(0,V.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,V.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,V.jsx)(v,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,V.jsx)(N,{"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,V.jsx)(A,{type:`submit`,variant:`outline`,className:`h-11 shrink-0`,disabled:!u.trim(),children:`Open file`})]}),(0,V.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,V.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,V.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,V.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,V.jsx)(M,{icon:h?(0,V.jsx)(R,{}):(0,V.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,V.jsx)(G.Provider,{value:_.folders,children:(0,V.jsx)(Y,{runId:e.id,selected:o,onSelect:e=>m(`path`,e)})}),(0,V.jsx)(re,{artifacts:n,artifactId:s,onSelect:e=>m(`artifact`,e)})]}),l?(0,V.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,V.jsx)(H,{runId:e.id,path:o,artifactId:s,worktreePath:e.worktreePath}):null]}),(0,V.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.`})]})}function ne(e){return e?`empty`:`full`}function re({artifacts:e,artifactId:t,onSelect:n}){return(0,V.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),e.isPending?(0,V.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):e.isError?(0,V.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):e.data.artifacts.length===0?(0,V.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,V.jsx)(`ul`,{children:e.data.artifacts.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(`button`,{type:`button`,"data-slot":`artifact-row`,"aria-current":e.id===t?`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:()=>n(e.id),children:[(0,V.jsx)(F,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 wrap-anywhere underline-offset-2 group-hover:underline`,children:e.name}),(0,V.jsx)(x,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground group-hover:text-foreground`})]})},e.id))}),(0,V.jsxs)(A,{variant:`outline`,size:`sm`,"data-action":`refresh-artifacts`,className:`mt-2 max-md:h-11 no-hover:h-11`,onClick:()=>void e.refetch(),children:[(0,V.jsx)(y,{"aria-hidden":`true`}),`Refresh published files`]})]})}export{$ 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,pi as r}from"./project-scope-context-Rv6S_BXt.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-qCF-eOqZ.js";import{h as f}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{g as p,p as m}from"./tasks-table-C5uoZMFs.js";import{F as h,ot as g,p as _}from"./design-icons-CzEoMH9c.js";import{t as v}from"./run-header-DeprqSP7.js";import{t as y}from"./external-link-BE6y205O.js";import{u as b}from"./reference-chip-D0v0keVC.js";import{t as x}from"./button-B7MKxYjT.js";import{t as S}from"./project-router-CLJTc7gv.js";import{c as C}from"./page-shell-7pLJMOgh.js";import{t as w}from"./centered-state-V15AR_qo.js";import{C as T,S as E,Xn as D}from"./index-DNQcTHxV.js";import{n as O,o as k,t as A}from"./use-hand-to-agent-state-K864D69i.js";var j=e(),M={issue:`Issue`,pr:`Pull request`};function N({kind:e}){let{id:t}=f(),n=o(t);return n.isPending?(0,j.jsx)(E,{kind:e}):n.isError?(0,j.jsx)(T,{tab:`github-item`,error:n.error}):(0,j.jsx)(P,{run:n.data,kind:e})}function P({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,j.jsxs)(C,{route:`task-github-item`,density:p?`full`:`empty`,flushPadding:!0,children:[(0,j.jsx)(v,{run:e,tab:{kind:t,number:r}}),p?(0,j.jsx)(H,{run:e,kind:t,number:r,repoBase:i,item:h}):l?(0,j.jsx)(E,{kind:t,number:r,heading:`h2`}):(0,j.jsx)(w,{icon:(0,j.jsx)(D,{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,j.jsx)(x,{asChild:!0,variant:`outline`,children:(0,j.jsx)(S,{to:`/tasks/${e.id}`,children:`Back to the session`})})})]})}function F(e,t){return e===`pr`&&t.data?.available===!0&&t.data.item!==null}function I(e,t,n,r){return e===`pr`?n?.[t]??r:r}function L({retry:e,kind:t,number:n}){return(0,j.jsx)(x,{variant:`outline`,disabled:e.isPending,onClick:()=>e.mutate(i.githubItem(t,n)),children:`Retry`})}function R({kind:e,number:t,error:n,retryButton:r}){return(0,j.jsx)(w,{icon:(0,j.jsx)(g,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load ${M[e].toLowerCase()} #${t}`,subtitle:n.message,actions:r})}function z({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,j.jsx)(w,{icon:(0,j.jsx)(c,{size:16}),tone:`neutral`,heading:`h2`,title:`GitHub is unavailable`,subtitle:o?.message??a,actions:(0,j.jsxs)(j.Fragment,{children:[s,l&&t(l)?(0,j.jsx)(x,{asChild:!0,variant:`outline`,children:(0,j.jsxs)(`a`,{href:l,target:`_blank`,rel:`noopener noreferrer`,children:[`open on GitHub`,(0,j.jsx)(y,{"aria-hidden":`true`})]})}):null]})})}function B({label:e,repoBase:t}){return(0,j.jsx)(w,{icon:(0,j.jsx)(b,{}),tone:`neutral`,heading:`h2`,title:`${e} was not found in ${U(t)}`,subtitle:`It may have been deleted, or the number points at a different repository.`})}function V({kind:e,item:t,labelColors:n,checks:r}){return(0,j.jsx)(`div`,{className:`min-w-0 px-0.5 md:px-2`,children:(0,j.jsx)(k,{item:t,colors:n??{},checks:r,backLink:null,subNav:null,children:e===`issue`?(0,j.jsx)(W,{item:t},t.url):null})})}function H({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=F(t,s),f=l(d?[i]:[],d),p=f.data?.available?f.data.checks:void 0,m=`${M[t]} #${i}`,h=(0,j.jsx)(L,{retry:u,kind:t,number:i});if(s.isPending)return(0,j.jsx)(E,{kind:t,number:i,heading:`h2`});if(s.isError)return(0,j.jsx)(R,{kind:t,number:i,error:u.error??s.error,retryButton:h});let g=s.data;return g.available?g.item?(0,j.jsx)(V,{kind:t,item:g.item,labelColors:g.labelColors,checks:I(t,i,p,g.item.checks)}):(0,j.jsx)(B,{label:m,repoBase:o}):(0,j.jsx)(z,{run:e,kind:t,number:i,repoBase:o,reason:g.reason,retryError:u.error,retryButton:h})}function U(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 W({item:e}){let t=A();return(0,j.jsx)(O,{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{N as TaskGithubItemRoute};
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{n as t}from"./utils-DSMR_WLb.js";import{G as n,pi as r}from"./project-scope-context-Rv6S_BXt.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-qCF-eOqZ.js";import{h as f}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{g as p,p as m}from"./tasks-table-C5uoZMFs.js";import{F as h,ot as g,p as _}from"./design-icons-CzEoMH9c.js";import{t as v}from"./run-header-Sse1VUYh.js";import{t as y}from"./external-link-BE6y205O.js";import{u as b}from"./reference-chip-D0v0keVC.js";import{t as x}from"./button-B7MKxYjT.js";import{t as S}from"./project-router-CLJTc7gv.js";import{c as C}from"./page-shell-7pLJMOgh.js";import{t as w}from"./centered-state-V15AR_qo.js";import{C as T,Qn as E,w as D}from"./index-cS5ELSRA.js";import{n as O,o as k,t as A}from"./use-hand-to-agent-state-jy8ex2Zf.js";var j=e(),M={issue:`Issue`,pr:`Pull request`};function N({kind:e}){let{id:t}=f(),n=o(t);return n.isPending?(0,j.jsx)(T,{kind:e}):n.isError?(0,j.jsx)(D,{tab:`github-item`,error:n.error}):(0,j.jsx)(P,{run:n.data,kind:e})}function P({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,j.jsxs)(C,{route:`task-github-item`,density:p?`full`:`empty`,flushPadding:!0,children:[(0,j.jsx)(v,{run:e,tab:{kind:t,number:r}}),p?(0,j.jsx)(H,{run:e,kind:t,number:r,repoBase:i,item:h}):l?(0,j.jsx)(T,{kind:t,number:r,heading:`h2`}):(0,j.jsx)(w,{icon:(0,j.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,j.jsx)(x,{asChild:!0,variant:`outline`,children:(0,j.jsx)(S,{to:`/tasks/${e.id}`,children:`Back to the session`})})})]})}function F(e,t){return e===`pr`&&t.data?.available===!0&&t.data.item!==null}function I(e,t,n,r){return e===`pr`?n?.[t]??r:r}function L({retry:e,kind:t,number:n}){return(0,j.jsx)(x,{variant:`outline`,disabled:e.isPending,onClick:()=>e.mutate(i.githubItem(t,n)),children:`Retry`})}function R({kind:e,number:t,error:n,retryButton:r}){return(0,j.jsx)(w,{icon:(0,j.jsx)(g,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load ${M[e].toLowerCase()} #${t}`,subtitle:n.message,actions:r})}function z({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,j.jsx)(w,{icon:(0,j.jsx)(c,{size:16}),tone:`neutral`,heading:`h2`,title:`GitHub is unavailable`,subtitle:o?.message??a,actions:(0,j.jsxs)(j.Fragment,{children:[s,l&&t(l)?(0,j.jsx)(x,{asChild:!0,variant:`outline`,children:(0,j.jsxs)(`a`,{href:l,target:`_blank`,rel:`noopener noreferrer`,children:[`open on GitHub`,(0,j.jsx)(y,{"aria-hidden":`true`})]})}):null]})})}function B({label:e,repoBase:t}){return(0,j.jsx)(w,{icon:(0,j.jsx)(b,{}),tone:`neutral`,heading:`h2`,title:`${e} was not found in ${U(t)}`,subtitle:`It may have been deleted, or the number points at a different repository.`})}function V({kind:e,item:t,labelColors:n,checks:r}){return(0,j.jsx)(`div`,{className:`min-w-0 px-0.5 md:px-2`,children:(0,j.jsx)(k,{item:t,colors:n??{},checks:r,backLink:null,subNav:null,children:e===`issue`?(0,j.jsx)(W,{item:t},t.url):null})})}function H({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=F(t,s),f=l(d?[i]:[],d),p=f.data?.available?f.data.checks:void 0,m=`${M[t]} #${i}`,h=(0,j.jsx)(L,{retry:u,kind:t,number:i});if(s.isPending)return(0,j.jsx)(T,{kind:t,number:i,heading:`h2`});if(s.isError)return(0,j.jsx)(R,{kind:t,number:i,error:u.error??s.error,retryButton:h});let g=s.data;return g.available?g.item?(0,j.jsx)(V,{kind:t,item:g.item,labelColors:g.labelColors,checks:I(t,i,p,g.item.checks)}):(0,j.jsx)(B,{label:m,repoBase:o}):(0,j.jsx)(z,{run:e,kind:t,number:i,repoBase:o,reason:g.reason,retryError:u.error,retryButton:h})}function U(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 W({item:e}){let t=A();return(0,j.jsx)(O,{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{N as TaskGithubItemRoute};
@@ -0,0 +1 @@
1
+ [data-slot=main]:has([data-route=task-thread]){overflow-y:clip}[data-route=task-thread]{block-size:100%;min-block-size:0;overflow:clip}[data-route=task-thread] [data-slot=thread-workspace]{flex:1 1 0;min-block-size:0;min-inline-size:0;display:flex;overflow:clip}[data-route=task-thread] [data-slot=thread-main]{flex-direction:column;flex:1 1 0;min-block-size:0;min-inline-size:0;display:flex;position:relative;overflow:clip}[data-route=task-thread] [data-slot=thread-transcript]{overscroll-behavior-block:contain;flex:1 1 0;min-block-size:0;scroll-padding-block:12px;overflow-y:auto}[data-route=task-thread] [data-slot=thread-activity-sidebar]{overscroll-behavior-block:contain;border-inline-start:1px solid var(--border);background:var(--card);flex:0 0 320px;min-block-size:0;overflow-y:auto}.session-composer [data-slot=composer-editor]{border-color:var(--ring);border-radius:12px}.session-composer [data-slot=session-controls]{padding-block:0 10px;padding-inline:12px}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr) max-content;gap:8px;min-inline-size:0;display:grid}.session-engine-controls [data-slot$=pill]{inline-size:100%;min-inline-size:0}.session-engine-controls [data-slot$=pill]>svg:last-child{margin-inline-start:auto}.session-engine-controls [data-slot=session-runner-value]{inline-size:100%;min-inline-size:0}.session-composer [data-slot=composer-toolbar]{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding-block:0 12px;padding-inline:12px;display:grid}.session-composer [data-slot=composer-toolbar]>[data-slot=session-controls]{grid-area:1/1/auto/-1;min-inline-size:0;padding:0}.session-composer [data-slot=composer-footer-start]{flex-wrap:nowrap;grid-area:2/1;gap:8px}.session-composer [aria-label=Attach\ files],.session-composer [aria-label=Start\ dictation]{border:1px solid var(--border);border-radius:9px;block-size:44px;inline-size:44px}.session-composer [data-slot=follow-up-model-pill]{min-block-size:44px}.session-composer [data-slot=follow-up-model-pill]>svg:last-child{margin-inline-start:auto}.session-composer [data-slot=composer-submit-row]{flex:none;grid-area:2/2;margin:0}.session-composer [data-slot=composer-toolbar]:has([data-folded]){grid-template-columns:auto minmax(0,1fr) auto}.session-composer [data-slot=composer-toolbar]:has([data-folded])>[data-slot=session-controls]{grid-area:1/2;align-self:center}.session-composer [data-slot=composer-toolbar]:has([data-folded])>[data-slot=composer-footer-start]{grid-area:1/1}.session-composer [data-slot=composer-toolbar]:has([data-folded])>[data-slot=composer-submit-row]{grid-area:1/3}[data-slot=run-actions-menu] [role^=menuitem]{min-block-size:44px}[data-route=task-thread] [data-slot=thread-dock]{z-index:10;border-block-start:1px solid var(--border);background:var(--background);flex:none;position:relative;container:thread-dock/inline-size}[data-route=task-thread] [data-slot=thread-jump]{margin-block-end:8px;padding-inline:16px;position:absolute;inset-block-end:100%;inset-inline:0}[data-route=task-thread] [data-slot=thread-footer-content]{--thread-footer-limit:min(58dvh, calc(var(--thread-viewport-height,100dvh) - var(--thread-header-height,0px) - 96px));max-block-size:var(--thread-footer-limit);min-block-size:0}[data-route=task-thread] [data-slot=thread-footer-content] [data-slot=thread-composer-slot]{flex-direction:column;flex:0 auto;min-block-size:0;display:flex}[data-route=task-thread] [data-slot=thread-footer-content] [data-slot=thread-composer-slot][hidden]{display:none}[data-route=task-thread] [data-slot=thread-footer-content] [data-slot=composer]{min-block-size:0;max-block-size:var(--thread-footer-limit);flex-direction:column;display:flex}[data-route=task-thread] [data-slot=composer-editor]{flex-direction:column;min-block-size:0;display:flex;overflow-y:auto}[data-route=task-thread] [data-slot=composer-editor]>textarea{flex-shrink:1;min-block-size:44px}[data-route=task-thread] [data-slot=composer-thumbs]{flex-wrap:nowrap;flex-shrink:0;max-block-size:60px;overflow:auto}[data-route=task-thread] [data-slot=composer-toolbar]{flex-shrink:0}[data-route=task-thread] [data-slot=thread-dock] [data-slot=review-panel],[data-route=task-thread] [data-slot=thread-dock] [data-slot=review-banner],[data-route=task-thread] [data-slot=thread-dock] [data-slot=review-actions]{min-block-size:0;max-block-size:var(--thread-footer-limit)}[data-route=task-thread] [data-slot=thread-dock] [data-slot=review-banner]{overscroll-behavior-block:contain;overflow-y:auto}[data-route=task-thread] [data-slot=thread-dock] [data-slot=review-notes]{overscroll-behavior-block:contain;max-block-size:min(24dvh,180px);overflow-y:auto}[data-route=task-thread] [data-slot=thread-dock] [data-slot=ask-card]{min-block-size:0;max-block-size:var(--thread-footer-limit);flex-direction:column;display:flex;overflow:clip}[data-route=task-thread] [data-slot=ask-body]{overscroll-behavior-block:contain;flex:auto;min-block-size:0;overflow-y:auto}@media (width>=768px){[data-route=task-thread] [data-slot=thread-jump]{padding-inline:64px}@container thread-dock (width<=680px){[data-slot=thread-dock]>[data-slot=thread-footer-content]{padding-inline:8px}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr) max-content}.session-engine-controls :is([data-slot=runner-pill],[data-slot=session-runner-value],[data-slot=follow-up-effort-pill]){gap:6px;padding-inline:8px}.session-engine-controls :is([data-slot=runner-pill],[data-slot=follow-up-effort-pill])>svg:last-child{display:none}}}@media (width<=767px){[data-slot=run-title-row]>.group{max-inline-size:calc(100% - 52px)}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr)}.session-engine-controls [data-slot=follow-up-model-pill]{grid-area:2/1/auto/-1}.session-engine-controls [data-slot=follow-up-effort-pill]{grid-area:1/2}.task-open-targets{flex-direction:column;align-items:flex-start}[data-route=task-thread] [data-slot=thread-footer-content]{--thread-footer-limit:min(64dvh, calc(var(--thread-viewport-height,100dvh) - var(--thread-header-height,0px) - 80px))}}[data-route=task-thread] [data-slot=assistant-message] :is(h1,h2,h3,h4,strong,[data-streamdown=strong]){color:var(--foreground)}[data-route=task-thread] [data-slot=assistant-message] h2{font-size:20px;line-height:1.4}@media (width<=767px){[data-route=task-thread] [data-slot=assistant-message] h2{letter-spacing:-.4px;font-size:18px}}[data-route=task-thread] .session-composer [data-slot=composer-editor]{border-color:var(--composer-border)}[data-route=task-thread] [data-slot=session-conversation]{overflow-anchor:none;padding-block:calc(var(--spacing) * 5.5) calc(var(--spacing) * 4);gap:calc(var(--spacing) * 4)}[data-route=task-thread] [data-slot=thread-row]{padding-block-end:calc(var(--spacing) * 4)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:is(p,ul,ol,table,blockquote){margin-block:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:first-child,[data-route=task-thread] [data-slot=user-bubble] .thread-markdown>:first-child{margin-block-start:0}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:last-child,[data-route=task-thread] [data-slot=user-bubble] .thread-markdown>:last-child{margin-block-end:0}@media (width<=767px){[data-route=task-thread] [data-slot=session-conversation]{padding-block:calc(var(--spacing) * 4);gap:calc(var(--spacing) * 3.5)}[data-route=task-thread] [data-slot=thread-row]{padding-block-end:calc(var(--spacing) * 3.5)}}[data-route=task-thread] [data-slot=thread-footer][data-state=closed]{border-block-start:0;margin-block-start:0;padding-block-start:0}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>p:has(>:is(strong,[data-streamdown=strong]):only-child){margin-block-end:calc(var(--spacing) * 1)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>p:has(>:is(strong,[data-streamdown=strong]):only-child)+p{margin-block-start:calc(var(--spacing) * 1)}[data-route=task-thread] [data-slot=tool-card]{background:var(--task-brand-bg);border-radius:7px}[data-route=task-thread] [data-slot=tool-card]>button{padding-block:calc(var(--spacing) * 2.5);padding-inline:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=tool-card]>[data-slot=collapsible-content]>div{background:0 0;border-block-start:0}[data-route=task-thread] [data-slot=tool-output] pre,[data-route=task-thread] [data-slot=tool-error]{padding-block:calc(var(--spacing) * 2) calc(var(--spacing) * 2.5);padding-inline:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=tool-output-fade]{--tw-gradient-to:var(--task-brand-bg)}[data-slot=task-split][data-pane=open] [data-route=task-thread] [data-slot=session-conversation],[data-slot=task-split][data-pane=open] [data-route=task-thread] [data-slot=thread-dock]>[data-slot=thread-footer-content]{padding-inline:18px}[data-route=task-thread] [data-slot=ask-card]{scroll-margin-block:24px}[data-route=task-thread] [data-slot=composer-submit-row]>button{font-size:13px}