@hearsay-tools/squawk 0.19.0-dev.9171 → 0.19.0-dev.9180

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 (151) hide show
  1. package/dist/ci-wait/controller.d.ts +7 -7
  2. package/dist/contract/hosts.d.ts +925 -0
  3. package/dist/contract/index.js +104 -2
  4. package/dist/core/server-hook-registry.d.ts +13 -0
  5. package/dist/core/server-hook-registry.js.map +1 -1
  6. package/dist/delegation/routes.d.ts +78 -78
  7. package/dist/features/hosts/admission.d.ts +52 -0
  8. package/dist/features/hosts/admission.js +89 -0
  9. package/dist/features/hosts/admission.js.map +1 -0
  10. package/dist/features/hosts/gateway.d.ts +14 -3
  11. package/dist/features/hosts/gateway.js +35 -21
  12. package/dist/features/hosts/gateway.js.map +1 -1
  13. package/dist/features/hosts/index.d.ts +7 -3
  14. package/dist/features/hosts/index.js +41 -7
  15. package/dist/features/hosts/index.js.map +1 -1
  16. package/dist/features/hosts/registry-reconciler.d.ts +41 -0
  17. package/dist/features/hosts/registry-reconciler.js +168 -0
  18. package/dist/features/hosts/registry-reconciler.js.map +1 -0
  19. package/dist/features/hosts/routes.d.ts +414 -48
  20. package/dist/features/hosts/routes.js +72 -62
  21. package/dist/features/hosts/routes.js.map +1 -1
  22. package/dist/features/hosts/runs-index-events.d.ts +23 -0
  23. package/dist/features/hosts/runs-index-events.js +116 -0
  24. package/dist/features/hosts/runs-index-events.js.map +1 -0
  25. package/dist/features/hosts/runs-index-patch.d.ts +203 -0
  26. package/dist/features/hosts/runs-index-patch.js +798 -0
  27. package/dist/features/hosts/runs-index-patch.js.map +1 -0
  28. package/dist/features/hosts/runs-index.d.ts +149 -0
  29. package/dist/features/hosts/runs-index.js +762 -0
  30. package/dist/features/hosts/runs-index.js.map +1 -0
  31. package/dist/features/hosts/runs-search.d.ts +28 -0
  32. package/dist/features/hosts/runs-search.js +151 -0
  33. package/dist/features/hosts/runs-search.js.map +1 -0
  34. package/dist/features/hosts/supervisor.d.ts +4 -0
  35. package/dist/features/hosts/supervisor.js +14 -6
  36. package/dist/features/hosts/supervisor.js.map +1 -1
  37. package/dist/features/reports/routes.d.ts +2 -2
  38. package/dist/features/webhooks/routes.d.ts +38 -38
  39. package/dist/plugin/index.d.ts +1 -1
  40. package/dist/plugin/index.js.map +1 -1
  41. package/dist/server/activity-routes.d.ts +23 -23
  42. package/dist/server/models-routes.d.ts +12 -12
  43. package/dist/server/project-settings-routes.d.ts +107 -107
  44. package/dist/server/projects-routes.d.ts +41 -41
  45. package/dist/server/provider-sign-in-routes.d.ts +2 -2
  46. package/dist/server/providers-routes.d.ts +58 -58
  47. package/dist/server/repo-routes.d.ts +13 -13
  48. package/dist/server/runner-install-routes.d.ts +10 -10
  49. package/dist/server/runners-routes.d.ts +10 -10
  50. package/dist/server/runs-routes.d.ts +330 -330
  51. package/dist/server/server.d.ts +1195 -1195
  52. package/dist/server/server.js +7 -1
  53. package/dist/server/server.js.map +1 -1
  54. package/dist/server/workspace-identity-routes.d.ts +5 -5
  55. package/dist/server/workspace-live-routes.d.ts +5 -5
  56. package/dist/server/workspace-routes.d.ts +85 -85
  57. package/dist/server/workspace-run-feed.d.ts +4 -0
  58. package/dist/server/workspace-run-feed.js +13 -0
  59. package/dist/server/workspace-run-feed.js.map +1 -1
  60. package/package.json +4 -4
  61. package/scripts/benchmark-hosts-runs-index-probes.ts +242 -0
  62. package/scripts/benchmark-hosts-runs-index.ts +776 -0
  63. package/web/dist/assets/accounts-section-BDUoikVg.js +1 -0
  64. package/web/dist/assets/activity-motion-CYdEr0hu.js +1 -0
  65. package/web/dist/assets/{activity-route-C2zP5vVV.js → activity-route-D8BPLoZj.js} +1 -1
  66. package/web/dist/assets/{agent-accounts-D_ZKAmaW.js → agent-accounts-C2ILQhZy.js} +1 -1
  67. package/web/dist/assets/{agent-config-section-CwK_izpU.js → agent-config-section-BO8w2cry.js} +2 -2
  68. package/web/dist/assets/agent-defaults-section-BBcv7Vbh.js +1 -0
  69. package/web/dist/assets/{appearance-DvoRcoRX.js → appearance-yF_NXlq5.js} +1 -1
  70. package/web/dist/assets/{archive-on-merge-field-DWPtF9dh.js → archive-on-merge-field-Dh1M21D6.js} +1 -1
  71. package/web/dist/assets/{ask-card-D-om0EtP.js → ask-card-2E9m5VRA.js} +1 -1
  72. package/web/dist/assets/attention-C7BUdd2s.js +1 -0
  73. package/web/dist/assets/automations-route-D27bK2j6.js +2 -0
  74. package/web/dist/assets/{commit-list-CPJLP4DU.js → commit-list-sFxchD2V.js} +1 -1
  75. package/web/dist/assets/{diff-BQJN6jzN.js → diff-C5-32cRp.js} +2 -2
  76. package/web/dist/assets/{diff-controls-AsSX7gfO.js → diff-controls-Ci36iPlK.js} +1 -1
  77. package/web/dist/assets/{diff-view-BW5bbiaq.js → diff-view-CCtuYJNL.js} +1 -1
  78. package/web/dist/assets/{discard-changes-dialog-Bv4yc0N1.js → discard-changes-dialog-BACqR1hj.js} +1 -1
  79. package/web/dist/assets/{file-preview-CnrFxbea.js → file-preview-B7T7jFYo.js} +1 -1
  80. package/web/dist/assets/{folder-browser-CFd1U5hn.js → folder-browser-3cBLlnE9.js} +1 -1
  81. package/web/dist/assets/{git-toolbar-C7iolhIi.js → git-toolbar-UkRnjuDs.js} +1 -1
  82. package/web/dist/assets/github-CkbZgMnJ.js +1 -0
  83. package/web/dist/assets/{global-activity-route-Dijwg4OL.js → global-activity-route-j37l-BQU.js} +1 -1
  84. package/web/dist/assets/hosts-iUyg8S3j.js +1 -0
  85. package/web/dist/assets/index-DkQ5xrLr.js +21 -0
  86. package/web/dist/assets/{label-CgU9vxuM.js → label-CWlxyeC-.js} +1 -1
  87. package/web/dist/assets/{markdown-Cljq4S1h.js → markdown-FIfZPsax.js} +1 -1
  88. package/web/dist/assets/{open-in-menu-BI7mnPPf.js → open-in-menu-Bf8JA2DJ.js} +1 -1
  89. package/web/dist/assets/{option-select-BcTkv-7t.js → option-select-DylfDjGi.js} +1 -1
  90. package/web/dist/assets/{preferences-section-CEKXGhEj.js → preferences-section-DjWfc1i-.js} +1 -1
  91. package/web/dist/assets/{preview-EtD19mg1.js → preview-BSFJfN4s.js} +1 -1
  92. package/web/dist/assets/{preview-pane-connected-CKRBfx7t.js → preview-pane-connected-CfiPFvTH.js} +2 -2
  93. package/web/dist/assets/{project-location-hufc_p8y.js → project-location-CEX0-MZp.js} +1 -1
  94. package/web/dist/assets/{project-router-Dc6KBQsv.js → project-router-CwD1firw.js} +1 -1
  95. package/web/dist/assets/{projects-section-vOFZ4lbx.js → projects-section-Czmf0wFK.js} +1 -1
  96. package/web/dist/assets/{prompt-templates-section-Caash2nq.js → prompt-templates-section-DK4CV73w.js} +1 -1
  97. package/web/dist/assets/queries-D9mg7sFY.js +1 -0
  98. package/web/dist/assets/{read-state-BeVNfGkB.js → read-state-BsTfJki5.js} +1 -1
  99. package/web/dist/assets/{reference-chip-BjerVjzM.js → reference-chip-CZKBU_Ud.js} +1 -1
  100. package/web/dist/assets/{remote-settings-notice-fNgh5LdN.js → remote-settings-notice-Dott-jyP.js} +1 -1
  101. package/web/dist/assets/repo-git-Djt3N2wP.js +1 -0
  102. package/web/dist/assets/{report-reader-CK1WDtEH.js → report-reader-CrdDix7Z.js} +1 -1
  103. package/web/dist/assets/{report-selection-CZ8eb9QP.js → report-selection-Y2F9NTAs.js} +1 -1
  104. package/web/dist/assets/{reports-B-GImLAo.js → reports-Iw4LUvz2.js} +1 -1
  105. package/web/dist/assets/{resources-section-ApF3gXrw.js → resources-section-D3wUzdUQ.js} +1 -1
  106. package/web/dist/assets/{review-notes-drafts-BdjEFs1G.js → review-notes-drafts-xyC7GvRB.js} +1 -1
  107. package/web/dist/assets/{review-panel-D4zmYH8O.js → review-panel-3x_2lbej.js} +1 -1
  108. package/web/dist/assets/{review-strip-BpHXklAn.js → review-strip-CDYpq9_S.js} +1 -1
  109. package/web/dist/assets/{run-detail-refresh-CE0vyYYA.js → run-detail-refresh-SYZM94ch.js} +1 -1
  110. package/web/dist/assets/{run-diff-ClfLRsHF.js → run-diff-D26PXp6r.js} +1 -1
  111. package/web/dist/assets/run-header-DZ0rkryR.js +2 -0
  112. package/web/dist/assets/{select-CwDhRDtw.js → select-DC_G2no3.js} +1 -1
  113. package/web/dist/assets/{session-context-section-C87jx7RB.js → session-context-section-DEUv-ISr.js} +1 -1
  114. package/web/dist/assets/{settings-agent-picker-Dk8yJ57U.js → settings-agent-picker-BrFN2RaQ.js} +1 -1
  115. package/web/dist/assets/{settings-save-bar-cu8BKCGT.js → settings-save-bar-C0pFHqte.js} +1 -1
  116. package/web/dist/assets/{settings-shell-mhQfQKf1.js → settings-shell-BWWbVxv-.js} +1 -1
  117. package/web/dist/assets/{sidebar-section-DOQ5N1L6.js → sidebar-section-BGo1zjJt.js} +1 -1
  118. package/web/dist/assets/{skills-DXJ1gQBD.js → skills-qFMQz6sm.js} +1 -1
  119. package/web/dist/assets/{status-dot-Bmn4xhch.js → status-dot-DTU7afRv.js} +1 -1
  120. package/web/dist/assets/{tab-link-6TltE1jl.js → tab-link-BJDe5cT4.js} +1 -1
  121. package/web/dist/assets/{task-changes-D9Sdmpmw.js → task-changes-DKJHAtKC.js} +2 -2
  122. package/web/dist/assets/{task-commits-A0UIqxpL.js → task-commits-Dtt60D0o.js} +1 -1
  123. package/web/dist/assets/{task-file-scope-ID220XKo.js → task-file-scope-FTt7SiGn.js} +1 -1
  124. package/web/dist/assets/{task-files-Id2tuAAG.js → task-files-DVz4222z.js} +1 -1
  125. package/web/dist/assets/{task-github-item-YKUcwp2o.js → task-github-item-CJpKQ6cU.js} +1 -1
  126. package/web/dist/assets/{task-groups-DCg4iOB9.js → task-groups-BvVfsQKd.js} +1 -1
  127. package/web/dist/assets/{task-thread-A_vkygGX.js → task-thread-DiYtqka4.js} +2 -2
  128. package/web/dist/assets/{thread-state-6-BzRrJ_.js → thread-state-pO7Wy_7R.js} +1 -1
  129. package/web/dist/assets/toaster-2ud_VdfV.js +4 -0
  130. package/web/dist/assets/{use-finish-run-DO-nnAaa.js → use-finish-run-5S30Eu3d.js} +1 -1
  131. package/web/dist/assets/{use-hand-to-agent-state-CADaL8U8.js → use-hand-to-agent-state-BB_VmbF7.js} +1 -1
  132. package/web/dist/assets/use-path-bases-npA-uKvg.js +1 -0
  133. package/web/dist/assets/use-workspace-config-save-DDI7_WtK.js +1 -0
  134. package/web/dist/assets/{workflows-DOLG-Rns.js → workflows-DLuBawpi.js} +2 -2
  135. package/web/dist/assets/{workspace-tools-DTCJVDTE.js → workspace-tools-D4jshe-2.js} +1 -1
  136. package/web/dist/assets/{worktrees-section-BOHDbywt.js → worktrees-section-CESTBOem.js} +5 -5
  137. package/web/dist/index.html +19 -19
  138. package/web/dist/assets/accounts-section-Bnr89jmC.js +0 -1
  139. package/web/dist/assets/activity-motion-BW0tAmYF.js +0 -1
  140. package/web/dist/assets/agent-defaults-section-RyEogH0g.js +0 -1
  141. package/web/dist/assets/attention-BI6592lk.js +0 -1
  142. package/web/dist/assets/automations-route-DfGE4xWT.js +0 -2
  143. package/web/dist/assets/github-DGElvfMU.js +0 -1
  144. package/web/dist/assets/hosts-CpDMDiQW.js +0 -1
  145. package/web/dist/assets/index-DPfg7xSB.js +0 -21
  146. package/web/dist/assets/queries-IlC9MZgh.js +0 -1
  147. package/web/dist/assets/repo-git-5MK_RAR6.js +0 -1
  148. package/web/dist/assets/run-header-BUe92WWr.js +0 -2
  149. package/web/dist/assets/toaster-DNnL8v10.js +0 -4
  150. package/web/dist/assets/use-path-bases-CFAmFn_E.js +0 -1
  151. package/web/dist/assets/use-workspace-config-save-DScW6_8J.js +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{$t as r,Gt as i,Vt as a,en as o,g as s}from"./queries-IlC9MZgh.js";import{E as c,Fi as l,n as u}from"./toaster-DNnL8v10.js";import{_ as d}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as f}from"./dist-CCX8mhHc.js";import{E as p,Q as m,Z as h,ct as g,d as _,k as v,rt as y,u as b,ut as x}from"./design-icons-QbNMZniQ.js";import{t as S}from"./button-BV_AiLj2.js";import{t as C}from"./project-router-Dc6KBQsv.js";import{c as w,d as T,f as E,n as D,t as O}from"./page-shell-BdjH5hyc.js";import{f as k,l as A}from"./skills-pM_PouEs.js";import{i as j}from"./agent-accounts-D_ZKAmaW.js";import{Yn as M,lr as N,q as P}from"./index-DPfg7xSB.js";import{t as F}from"./option-select-BcTkv-7t.js";var I=e(t(),1),L=n(),R=e=>e.split(`@`)[0]||e,z={project:0,user:1,plugin:2,system:3,other:4},B={project:`This project`,user:`Your skills`,system:`Built in`,other:`Other`};function V(e){if(e.plugin)return{key:`plugin:${e.plugin}`,label:R(e.plugin),kind:`plugin`};let t=e.scope===`repo`?`project`:e.scope===`user`?`user`:e.scope===`system`?`system`:`other`;return{key:t,label:B[t],kind:t}}function H(e){let t=new Map;for(let n of e){let e=V(n),r=t.get(e.key)??{...e,skills:[]};r.skills.push(n),t.set(e.key,r)}return[...t.values()].sort((e,t)=>z[e.kind]-z[t.kind]||e.label.localeCompare(t.label))}function U(e){let t=e.plugin?`${R(e.plugin)}:`:``;return t&&e.name.startsWith(t)&&e.name.length>t.length?e.name.slice(t.length):e.name}var W={project:p,user:x,plugin:v,system:v,other:v};function G({groups:e,openId:t,searching:n,runner:r,account:i}){let[a,o]=(0,I.useState)(new Set),s=e=>o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,L.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,L.jsxs)(`section`,{"data-slot":`skill-group`,"aria-label":e.label,className:`border-border not-first:border-t`,children:[(0,L.jsx)(K,{group:e,open:o,onToggle:()=>s(e.key)}),o?e.skills.map(e=>(0,L.jsx)(q,{skill:e,open:e.id===t,runner:r,account:i},k(e))):null]},e.key)})})}function K({group:e,open:t,onToggle:n}){let r=W[e.kind];return(0,L.jsx)(`h2`,{className:`m-0`,children:(0,L.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,L.jsx)(_,{"aria-hidden":`true`,className:f(`size-3.5 transition-transform motion-reduce:transition-none`,t&&`rotate-90`)}),(0,L.jsx)(r,{"aria-hidden":`true`,className:`size-3.5`}),(0,L.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,L.jsx)(`span`,{className:`font-medium text-soft-foreground`,children:e.skills.length})]})})}function q({skill:e,open:t,runner:n,account:r}){let i=M({skill:e.id,skillPath:e.path,runner:n,...r?{account:r}:{}});return(0,L.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,L.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,L.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,L.jsx)(`span`,{className:`truncate text-[13.5px] leading-snug font-semibold text-foreground`,title:e.name,children:U(e)}),e.description?(0,L.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,L.jsx)(b,{"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,L.jsx)(`div`,{className:`pr-3.5 pb-4 pl-9`,children:(0,L.jsx)(P,{skill:e,heading:null,actions:(0,L.jsx)(S,{asChild:!0,size:`sm`,"data-action":`start-task`,children:(0,L.jsx)(C,{to:i,children:`Start task`})})})})]})}function J(){let e=s(),[t,n]=(0,I.useState)(null),[a,o]=(0,I.useState)(null),[c,l]=(0,I.useState)(``),[u]=d(),p=t??e.data?.defaultRunner,{runner:g}=r(p??`claude`),_=a?.runner===g?a.id:null,v=e=>o(e===null?null:{runner:g,id:e}),y=i(p,_),b=$(g,y.account),x=y.data??[],O=A(x,c);return(0,L.jsxs)(T,{route:`skills`,density:y.isPending?`full`:E(O.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,L.jsxs)(w,{variant:`outline`,onClick:()=>void b.run(),disabled:b.running||y.isPending,"data-slot":`skills-refresh`,children:[(0,L.jsx)(h,{"aria-hidden":`true`,className:f(`size-3.5`,b.running&&`motion-safe:animate-spin`)}),`Re-read`]})},sparseFooter:!y.isPending&&O.length>0?(0,L.jsx)(D,{summary:`${O.length} ${O.length===1?`skill`:`skills`} available for this runner. Type / in New task to invoke one, or chain them into a workflow.`,actions:(0,L.jsx)(S,{variant:`outline`,size:`sm`,asChild:!0,children:(0,L.jsx)(C,{to:`/workflows`,children:`Open workflows`})})}):void 0,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(X,{runner:g,onChange:e=>{n(e),v(null)}}),(0,L.jsx)(Z,{runner:g,account:_,onChange:v}),(0,L.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,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(m,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,L.jsx)(N,{"aria-label":`Search skills`,placeholder:`Filter by name or description…`,value:c,onChange:e=>l(e.target.value),className:`h-10 rounded-lg border-border bg-card pl-9 text-[13px]`})]}),(0,L.jsx)(Q,{query:y}),y.isPending?(0,L.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Loading skills…`}):(0,L.jsx)(Y,{skills:x,matches:O,search:c,onClearSearch:()=>l(``),onRefresh:()=>void b.run(),openId:u.get(`skill`),runner:g,account:y.account??null,unchecked:y.unchecked})]})}function Y({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,L.jsx)(O,{icon:(0,L.jsx)(y,{}),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,L.jsx)(S,{variant:`outline`,onClick:i,children:`Re-read skills`})}):t.length===0?(0,L.jsx)(O,{icon:(0,L.jsx)(m,{}),title:`No skills match “${n.trim()}”.`,description:`Try a different keyword or clear the filter to browse every available skill.`,actions:(0,L.jsx)(S,{variant:`outline`,onClick:r,children:`Clear filter`})}):(0,L.jsx)(G,{groups:H(t),openId:a,searching:n.trim()!==``,runner:o,account:s})}function X({runner:e,onChange:t}){let n=o().data;return n?(0,L.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,L.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 Z({runner:e,account:t,onChange:n}){let r=j().accounts.filter(t=>t.provider===e);return r.length===0?null:(0,L.jsx)(F,{"aria-label":`Account`,value:t??``,onValueChange:e=>n(e||null),options:[{value:``,label:`Account: project default`},...r.map(e=>({value:e.id,label:e.label}))],className:`rounded-lg border-border bg-card text-[13px] text-foreground md:data-[size=default]:h-[38px]`})}function Q({query:e}){let t=e.list?.problems??[];return!e.unchecked&&t.length===0?null:(0,L.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,L.jsxs)(`p`,{role:`status`,className:`flex gap-2`,children:[(0,L.jsx)(g,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,L.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,L.jsxs)(`p`,{role:`alert`,className:`flex gap-2 break-words`,children:[(0,L.jsx)(g,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,L.jsxs)(`span`,{children:[e.message,e.path?` · ${e.path}`:``]})]},t))]})}function $(e,t){let n=l(),[r,i]=(0,I.useState)(!1),o=a.runnerSkills(e,t);return{running:r,run:async()=>{i(!0);try{n.setQueryData(o,await c(e,t,{refresh:!0})),await n.invalidateQueries({queryKey:o.slice(0,3)})}catch(e){u(e instanceof Error?e.message:String(e),{tone:`danger`})}finally{i(!1)}}}}export{J 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,Gt as i,Vt as a,en as o,g as s}from"./queries-D9mg7sFY.js";import{E as c,Fi as l,n as u}from"./toaster-2ud_VdfV.js";import{_ as d}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as f}from"./dist-CCX8mhHc.js";import{E as p,Q as m,Z as h,ct as g,d as _,k as v,rt as y,u as b,ut as x}from"./design-icons-QbNMZniQ.js";import{t as S}from"./button-BV_AiLj2.js";import{t as C}from"./project-router-CwD1firw.js";import{c as w,d as T,f as E,n as D,t as O}from"./page-shell-BdjH5hyc.js";import{f as k,l as A}from"./skills-pM_PouEs.js";import{i as j}from"./agent-accounts-C2ILQhZy.js";import{Yn as M,lr as N,q as P}from"./index-DkQ5xrLr.js";import{t as F}from"./option-select-DylfDjGi.js";var I=e(t(),1),L=n(),R=e=>e.split(`@`)[0]||e,z={project:0,user:1,plugin:2,system:3,other:4},B={project:`This project`,user:`Your skills`,system:`Built in`,other:`Other`};function V(e){if(e.plugin)return{key:`plugin:${e.plugin}`,label:R(e.plugin),kind:`plugin`};let t=e.scope===`repo`?`project`:e.scope===`user`?`user`:e.scope===`system`?`system`:`other`;return{key:t,label:B[t],kind:t}}function H(e){let t=new Map;for(let n of e){let e=V(n),r=t.get(e.key)??{...e,skills:[]};r.skills.push(n),t.set(e.key,r)}return[...t.values()].sort((e,t)=>z[e.kind]-z[t.kind]||e.label.localeCompare(t.label))}function U(e){let t=e.plugin?`${R(e.plugin)}:`:``;return t&&e.name.startsWith(t)&&e.name.length>t.length?e.name.slice(t.length):e.name}var W={project:p,user:x,plugin:v,system:v,other:v};function G({groups:e,openId:t,searching:n,runner:r,account:i}){let[a,o]=(0,I.useState)(new Set),s=e=>o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,L.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,L.jsxs)(`section`,{"data-slot":`skill-group`,"aria-label":e.label,className:`border-border not-first:border-t`,children:[(0,L.jsx)(K,{group:e,open:o,onToggle:()=>s(e.key)}),o?e.skills.map(e=>(0,L.jsx)(q,{skill:e,open:e.id===t,runner:r,account:i},k(e))):null]},e.key)})})}function K({group:e,open:t,onToggle:n}){let r=W[e.kind];return(0,L.jsx)(`h2`,{className:`m-0`,children:(0,L.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,L.jsx)(_,{"aria-hidden":`true`,className:f(`size-3.5 transition-transform motion-reduce:transition-none`,t&&`rotate-90`)}),(0,L.jsx)(r,{"aria-hidden":`true`,className:`size-3.5`}),(0,L.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,L.jsx)(`span`,{className:`font-medium text-soft-foreground`,children:e.skills.length})]})})}function q({skill:e,open:t,runner:n,account:r}){let i=M({skill:e.id,skillPath:e.path,runner:n,...r?{account:r}:{}});return(0,L.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,L.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,L.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,L.jsx)(`span`,{className:`truncate text-[13.5px] leading-snug font-semibold text-foreground`,title:e.name,children:U(e)}),e.description?(0,L.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,L.jsx)(b,{"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,L.jsx)(`div`,{className:`pr-3.5 pb-4 pl-9`,children:(0,L.jsx)(P,{skill:e,heading:null,actions:(0,L.jsx)(S,{asChild:!0,size:`sm`,"data-action":`start-task`,children:(0,L.jsx)(C,{to:i,children:`Start task`})})})})]})}function J(){let e=s(),[t,n]=(0,I.useState)(null),[a,o]=(0,I.useState)(null),[c,l]=(0,I.useState)(``),[u]=d(),p=t??e.data?.defaultRunner,{runner:g}=r(p??`claude`),_=a?.runner===g?a.id:null,v=e=>o(e===null?null:{runner:g,id:e}),y=i(p,_),b=$(g,y.account),x=y.data??[],O=A(x,c);return(0,L.jsxs)(T,{route:`skills`,density:y.isPending?`full`:E(O.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,L.jsxs)(w,{variant:`outline`,onClick:()=>void b.run(),disabled:b.running||y.isPending,"data-slot":`skills-refresh`,children:[(0,L.jsx)(h,{"aria-hidden":`true`,className:f(`size-3.5`,b.running&&`motion-safe:animate-spin`)}),`Re-read`]})},sparseFooter:!y.isPending&&O.length>0?(0,L.jsx)(D,{summary:`${O.length} ${O.length===1?`skill`:`skills`} available for this runner. Type / in New task to invoke one, or chain them into a workflow.`,actions:(0,L.jsx)(S,{variant:`outline`,size:`sm`,asChild:!0,children:(0,L.jsx)(C,{to:`/workflows`,children:`Open workflows`})})}):void 0,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(X,{runner:g,onChange:e=>{n(e),v(null)}}),(0,L.jsx)(Z,{runner:g,account:_,onChange:v}),(0,L.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,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(m,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,L.jsx)(N,{"aria-label":`Search skills`,placeholder:`Filter by name or description…`,value:c,onChange:e=>l(e.target.value),className:`h-10 rounded-lg border-border bg-card pl-9 text-[13px]`})]}),(0,L.jsx)(Q,{query:y}),y.isPending?(0,L.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Loading skills…`}):(0,L.jsx)(Y,{skills:x,matches:O,search:c,onClearSearch:()=>l(``),onRefresh:()=>void b.run(),openId:u.get(`skill`),runner:g,account:y.account??null,unchecked:y.unchecked})]})}function Y({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,L.jsx)(O,{icon:(0,L.jsx)(y,{}),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,L.jsx)(S,{variant:`outline`,onClick:i,children:`Re-read skills`})}):t.length===0?(0,L.jsx)(O,{icon:(0,L.jsx)(m,{}),title:`No skills match “${n.trim()}”.`,description:`Try a different keyword or clear the filter to browse every available skill.`,actions:(0,L.jsx)(S,{variant:`outline`,onClick:r,children:`Clear filter`})}):(0,L.jsx)(G,{groups:H(t),openId:a,searching:n.trim()!==``,runner:o,account:s})}function X({runner:e,onChange:t}){let n=o().data;return n?(0,L.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,L.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 Z({runner:e,account:t,onChange:n}){let r=j().accounts.filter(t=>t.provider===e);return r.length===0?null:(0,L.jsx)(F,{"aria-label":`Account`,value:t??``,onValueChange:e=>n(e||null),options:[{value:``,label:`Account: project default`},...r.map(e=>({value:e.id,label:e.label}))],className:`rounded-lg border-border bg-card text-[13px] text-foreground md:data-[size=default]:h-[38px]`})}function Q({query:e}){let t=e.list?.problems??[];return!e.unchecked&&t.length===0?null:(0,L.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,L.jsxs)(`p`,{role:`status`,className:`flex gap-2`,children:[(0,L.jsx)(g,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,L.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,L.jsxs)(`p`,{role:`alert`,className:`flex gap-2 break-words`,children:[(0,L.jsx)(g,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,L.jsxs)(`span`,{children:[e.message,e.path?` · ${e.path}`:``]})]},t))]})}function $(e,t){let n=l(),[r,i]=(0,I.useState)(!1),o=a.runnerSkills(e,t);return{running:r,run:async()=>{i(!0);try{n.setQueryData(o,await c(e,t,{refresh:!0})),await n.invalidateQueries({queryKey:o.slice(0,3)})}catch(e){u(e instanceof Error?e.message:String(e),{tone:`danger`})}finally{i(!1)}}}}export{J as SkillsRoute};
@@ -1 +1 @@
1
- import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{Hr as n}from"./toaster-DNnL8v10.js";import{o as r}from"./dist-CCX8mhHc.js";import{t as i}from"./bot-TkDIw4y-.js";import{r as a}from"./button-BV_AiLj2.js";e();var o=t(),s=a(`inline-block shrink-0`,{variants:{tone:{success:``,pending:``,danger:``,accent:``,info:``,running:``,neutral:``},shape:{filled:`size-[7px] rounded-full`,ring:`size-[7px] rounded-full border-[1.5px] bg-transparent`,workers:`inline-flex size-[12px] items-center justify-center`},pulse:{true:`animate-pulse motion-reduce:animate-none`,false:``}},compoundVariants:[{shape:`filled`,tone:`success`,className:`bg-success`},{shape:`filled`,tone:`pending`,className:`bg-pending-strong`},{shape:`filled`,tone:`danger`,className:`bg-danger`},{shape:`filled`,tone:`accent`,className:`bg-accent-strong`},{shape:`filled`,tone:`info`,className:`bg-info`},{shape:`filled`,tone:`running`,className:`bg-status-running`},{shape:`filled`,tone:`neutral`,className:`bg-soft-foreground`},{shape:`ring`,tone:`success`,className:`border-success`},{shape:`ring`,tone:`pending`,className:`border-pending-strong`},{shape:`ring`,tone:`danger`,className:`border-danger`},{shape:`ring`,tone:`accent`,className:`border-accent-strong`},{shape:`ring`,tone:`info`,className:`border-info`},{shape:`ring`,tone:`running`,className:`border-status-running`},{shape:`ring`,tone:`neutral`,className:`border-soft-foreground`},{shape:`workers`,tone:`success`,className:`text-success`},{shape:`workers`,tone:`pending`,className:`text-pending-strong`},{shape:`workers`,tone:`danger`,className:`text-danger`},{shape:`workers`,tone:`accent`,className:`text-accent-icon`},{shape:`workers`,tone:`info`,className:`text-info`},{shape:`workers`,tone:`running`,className:`text-status-running`},{shape:`workers`,tone:`neutral`,className:`text-soft-foreground`}],defaultVariants:{tone:`neutral`,shape:`filled`,pulse:!1}});function c({className:e,tone:t=`neutral`,shape:a=`filled`,pulse:c=!1,...l}){let u=n(),d=!!c&&!u;return(0,o.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,"data-shape":a,"data-pulse":d?`true`:void 0,className:r(s({tone:t,shape:a,pulse:d,className:e})),...l,children:a===`workers`?(0,o.jsx)(i,{className:`size-[12px]`,"aria-hidden":`true`}):null})}export{c as t};
1
+ import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{gr as n}from"./toaster-2ud_VdfV.js";import{o as r}from"./dist-CCX8mhHc.js";import{t as i}from"./bot-TkDIw4y-.js";import{r as a}from"./button-BV_AiLj2.js";e();var o=t(),s=a(`inline-block shrink-0`,{variants:{tone:{success:``,pending:``,danger:``,accent:``,info:``,running:``,neutral:``},shape:{filled:`size-[7px] rounded-full`,ring:`size-[7px] rounded-full border-[1.5px] bg-transparent`,workers:`inline-flex size-[12px] items-center justify-center`},pulse:{true:`animate-pulse motion-reduce:animate-none`,false:``}},compoundVariants:[{shape:`filled`,tone:`success`,className:`bg-success`},{shape:`filled`,tone:`pending`,className:`bg-pending-strong`},{shape:`filled`,tone:`danger`,className:`bg-danger`},{shape:`filled`,tone:`accent`,className:`bg-accent-strong`},{shape:`filled`,tone:`info`,className:`bg-info`},{shape:`filled`,tone:`running`,className:`bg-status-running`},{shape:`filled`,tone:`neutral`,className:`bg-soft-foreground`},{shape:`ring`,tone:`success`,className:`border-success`},{shape:`ring`,tone:`pending`,className:`border-pending-strong`},{shape:`ring`,tone:`danger`,className:`border-danger`},{shape:`ring`,tone:`accent`,className:`border-accent-strong`},{shape:`ring`,tone:`info`,className:`border-info`},{shape:`ring`,tone:`running`,className:`border-status-running`},{shape:`ring`,tone:`neutral`,className:`border-soft-foreground`},{shape:`workers`,tone:`success`,className:`text-success`},{shape:`workers`,tone:`pending`,className:`text-pending-strong`},{shape:`workers`,tone:`danger`,className:`text-danger`},{shape:`workers`,tone:`accent`,className:`text-accent-icon`},{shape:`workers`,tone:`info`,className:`text-info`},{shape:`workers`,tone:`running`,className:`text-status-running`},{shape:`workers`,tone:`neutral`,className:`text-soft-foreground`}],defaultVariants:{tone:`neutral`,shape:`filled`,pulse:!1}});function c({className:e,tone:t=`neutral`,shape:a=`filled`,pulse:c=!1,...l}){let u=n(),d=!!c&&!u;return(0,o.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,"data-shape":a,"data-pulse":d?`true`:void 0,className:r(s({tone:t,shape:a,pulse:d,className:e})),...l,children:a===`workers`?(0,o.jsx)(i,{className:`size-[12px]`,"aria-hidden":`true`}):null})}export{c as t};
@@ -1 +1 @@
1
- import{t as e}from"./react-runtime-CCIEwYL0.js";import{c as t,o as n}from"./dist-CCX8mhHc.js";import{t as r}from"./project-router-Dc6KBQsv.js";var i=e();function a({to:e,active:a=!1,onClick:o,count:s,replace:c,className:l,children:u}){return(0,i.jsxs)(r,{to:e,...t({replace:c}),"aria-current":a?`page`:void 0,onClick:o,className:n(`-mb-px flex h-8 items-center rounded-t-md border-b-2 px-3 text-[13px] font-medium`,a?`border-foreground font-semibold text-foreground`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`,l),children:[u,s===void 0?null:(0,i.jsx)(`span`,{"data-slot":`tab-count`,className:`ml-1.5 text-xs font-normal text-soft-foreground`,children:s})]})}export{a as t};
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{c as t,o as n}from"./dist-CCX8mhHc.js";import{t as r}from"./project-router-CwD1firw.js";var i=e();function a({to:e,active:a=!1,onClick:o,count:s,replace:c,className:l,children:u}){return(0,i.jsxs)(r,{to:e,...t({replace:c}),"aria-current":a?`page`:void 0,onClick:o,className:n(`-mb-px flex h-8 items-center rounded-t-md border-b-2 px-3 text-[13px] font-medium`,a?`border-foreground font-semibold text-foreground`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`,l),children:[u,s===void 0?null:(0,i.jsx)(`span`,{"data-slot":`tab-count`,className:`ml-1.5 text-xs font-normal text-soft-foreground`,children:s})]})}export{a as t};
@@ -1,5 +1,5 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{J as r,S as i,Vt as a,Y as o,un as s,vt as c}from"./queries-IlC9MZgh.js";import{Bt as l,Fi as u,Gt as d,Ot as f,Rt as p,Ut as m,Yn as h,mi as g,n as _,st as v,ut as ee}from"./toaster-DNnL8v10.js";import{g as y}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as b}from"./dist-CCX8mhHc.js";import{M as x,u as S,w as C}from"./design-icons-QbNMZniQ.js";import{t as te}from"./run-header-BUe92WWr.js";import{i as w,n as ne,r as T}from"./git-toolbar-C7iolhIi.js";import{t as E}from"./button-BV_AiLj2.js";import{a as D,i as O,o as k,r as A,s as j,t as M}from"./dialog-DKr-j9S6.js";import{b as N,f as P}from"./task-groups-DCg4iOB9.js";import{f as re,l as ie,m as ae}from"./page-shell-BdjH5hyc.js";import{t as F}from"./centered-state-N8vWM_Hw.js";import{D as oe,E as se,Vn as ce,gn as I,rt as L}from"./index-DPfg7xSB.js";import{t as R}from"./textarea-BGp28xFr.js";import{t as z}from"./markdown-BBDDg-4t.js";import{n as B,t as V}from"./review-notes-drafts-BdjEFs1G.js";import{t as H}from"./diff-BQJN6jzN.js";import{t as U}from"./code-workbench-B0GIezrD.js";import{t as W}from"./file-text-nGpo7MVd.js";import{i as le,n as G,r as ue}from"./selected-file-CfBWFB6p.js";var K=e(t(),1),q=`no worktree — this task ran directly in the repo working tree`;function J(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 — ${q}`)}function Y(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 — ${q}`)}function de(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 — ${q}`):e.forge===null?t(`Draft PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?g(e.run)?t(`Draft PR unavailable — the run is waiting on a usage-limit hold; choose Don’t resume first`):N(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 fe(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:J(e),n=e.prUrl?[J(e),Y(e)]:[Y(e),de(e)],r=[];if(e.localHandoff&&e.cliHandoff!==!1){let t=e.hasSession?N(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,primaryVariant:e.run.status===`review`?`outline`:`primary`,secondary:n,menu:r}}function pe(e,t){let[n=``,...r]=t.trim().split(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{J as r,S as i,Vt as a,Y as o,un as s,vt as c}from"./queries-D9mg7sFY.js";import{Bt as l,Cn as u,Fi as d,Gt as f,Ot as p,Rt as m,Ut as h,mi as g,n as _,st as v,ut as ee}from"./toaster-2ud_VdfV.js";import{g as y}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as b}from"./dist-CCX8mhHc.js";import{M as x,u as S,w as C}from"./design-icons-QbNMZniQ.js";import{t as te}from"./run-header-DZ0rkryR.js";import{i as w,n as ne,r as T}from"./git-toolbar-UkRnjuDs.js";import{t as E}from"./button-BV_AiLj2.js";import{a as D,i as O,o as k,r as A,s as j,t as M}from"./dialog-DKr-j9S6.js";import{b as N,f as P}from"./task-groups-BvVfsQKd.js";import{f as re,l as ie,m as ae}from"./page-shell-BdjH5hyc.js";import{t as F}from"./centered-state-N8vWM_Hw.js";import{D as oe,E as se,Vn as ce,gn as I,rt as L}from"./index-DkQ5xrLr.js";import{t as R}from"./textarea-BGp28xFr.js";import{t as z}from"./markdown-BBDDg-4t.js";import{n as B,t as V}from"./review-notes-drafts-xyC7GvRB.js";import{t as H}from"./diff-C5-32cRp.js";import{t as U}from"./code-workbench-B0GIezrD.js";import{t as W}from"./file-text-nGpo7MVd.js";import{i as le,n as G,r as ue}from"./selected-file-CfBWFB6p.js";var K=e(t(),1),q=`no worktree — this task ran directly in the repo working tree`;function J(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 — ${q}`)}function Y(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 — ${q}`)}function de(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 — ${q}`):e.forge===null?t(`Draft PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?g(e.run)?t(`Draft PR unavailable — the run is waiting on a usage-limit hold; choose Don’t resume first`):N(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 fe(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:J(e),n=e.prUrl?[J(e),Y(e)]:[Y(e),de(e)],r=[];if(e.localHandoff&&e.cliHandoff!==!1){let t=e.hasSession?N(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,primaryVariant:e.run.status===`review`?`outline`:`primary`,secondary:n,menu:r}}function pe(e,t){let[n=``,...r]=t.trim().split(`
2
2
  `),i=[n,...r.map(e=>e.trim()===``?``:` ${e.trimEnd()}`)].join(`
3
3
  `);return`- \`${me(e)}\` — ${i}`}function me({path:e,side:t,line:n}){let r=typeof n==`number`||n.start===n.end?String(typeof n==`number`?n:n.start):`${n.start}-${n.end}`;return t===`old`?`${e} (old ${r})`:`${e}:${r}`}function he(e,t,n){let r=V(e).notes;B(e,{open:!0,notes:`${r}${r===``||r.endsWith(`
4
4
  `)?``:`
5
- `}${pe(t,n)}`})}var X=n();function Z({run:e,open:t,onOpenChange:n}){let r=u(),[i,o]=(0,K.useState)(``),c=P(e),l=(0,K.useRef)(c);l.current=c,(0,K.useEffect)(()=>{t&&o(l.current)},[t]);let d=s({mutationFn:t=>v(e.id,t),onSuccess:t=>{_(`Committed ${ce(t.sha)}`),n(!1),r.invalidateQueries({queryKey:a.runs.changes(e.id)}),r.invalidateQueries({queryKey:a.runs.all})},onError:e=>_(e.message,{tone:`danger`})}),f=()=>{let e=i.trim();e.length===0||d.isPending||d.mutate(e)};return(0,X.jsx)(M,{open:t,onOpenChange:n,children:(0,X.jsxs)(A,{"data-slot":`commit-dialog`,children:[(0,X.jsxs)(k,{children:[(0,X.jsx)(j,{children:`Commit changes`}),(0,X.jsxs)(O,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,X.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,X.jsx)(R,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:i,onChange:e=>o(e.target.value),onKeyDown:e=>{L(e)&&(e.preventDefault(),f())}}),(0,X.jsxs)(D,{children:[(0,X.jsx)(E,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,X.jsx)(E,{"data-slot":`commit-confirm`,disabled:i.trim().length===0||d.isPending,onClick:f,children:d.isPending?`Committing…`:`Commit`})]})]})})}function ge(){let{id:e}=y(),t=r(e);return t.isPending?(0,X.jsx)(oe,{tab:`changes`}):t.isError?(0,X.jsx)(se,{tab:`changes`,error:t.error}):(0,X.jsx)(_e,{run:t.data},t.data.id)}function _e({run:e}){let t=c(),n=i(),r=o(e.id,N(e)),d=ae(),[f,p]=(0,K.useState)(`unified`),[g,v]=(0,K.useState)(!0),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(!1),C=u(),w=()=>C.invalidateQueries({queryKey:a.runs.all}),T=e=>_(e.message,{tone:`danger`}),E=s({mutationFn:()=>m(e.id),onSuccess:e=>_(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:T}),D=s({mutationFn:()=>ee(e.id),onSuccess:e=>{_(`Draft PR created — ${e.url}`),w()},onError:T}),O=s({mutationFn:()=>l(e.id),onError:e=>{if(e instanceof h&&e.command){navigator.clipboard.writeText(e.command).then(()=>_(`No terminal found — command copied to clipboard.`)).catch(()=>_(`Run manually: ${e.command}`));return}T(e)}}),k=$(r),A=fe({run:e,cliHandoff:e.cliHandoff,hasWorktree:!!e.worktreePath&&!k,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:I(e)!==void 0,prUrl:e.pullRequestUrl}),j=e=>{switch(e){case`commit`:S(!0);break;case`push`:E.mutate();break;case`create-pr`:D.mutate();break;case`open-terminal`:O.mutate();break;case`view-pr`:break}},M=r.data?.files??[],P=(0,K.useMemo)(()=>M.some(z),[M]),F=d?f:`unified`;return(0,X.jsxs)(ie,{route:`task-changes`,density:re(M.length),flushPadding:!0,children:[(0,X.jsx)(te,{run:e,tab:`changes`}),(0,X.jsx)(ne,{bar:A,healthReady:t.data!==void 0,branch:e.branch,stat:r.data?.stat,mode:F,wrap:g,preview:y,onModeChange:p,onWrapChange:v,onPreviewChange:P?b:void 0,onAction:j}),(0,X.jsx)(Q,{run:e,mode:F,wrap:g,preview:y}),(0,X.jsx)(Z,{run:e,open:x,onOpenChange:S})]})}function Q({run:e,mode:t=`unified`,wrap:n=!0,preview:r=!1,revealRef:i}){let a=c(),l=o(e.id,N(e)),u=s({mutationFn:t=>p(e.id,t),onError:e=>_(e.message,{tone:`danger`})}),d=$(l),f=l.data?.files??[],m=(0,K.useMemo)(()=>T(f),[f]),h=le(e.id),g=ue(e.id,`changes`,l.data?.files);return(0,K.useEffect)(()=>{if(i)return i.current=t=>f.some(e=>e.path===t)?(G(e.id,t),g.reveal(t),!0):!1,()=>{i.current=null}},[i,f,e.id,g]),(0,X.jsxs)(X.Fragment,{children:[l.data?.repointedHead?(0,X.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,X.jsx)(`code`,{children:l.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,X.jsx)(`code`,{children:l.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,(0,X.jsx)(ve,{changes:l,changesRefused:d,fileCount:f.length,children:(0,X.jsx)(ye,{runId:e.id,files:f,tree:m,selected:h,selectFile:t=>{G(e.id,t),g.reveal(t)},diffRef:g,effectiveMode:t,effectiveWrap:n,preview:r,localHandoff:a.data?.capabilities.localHandoff,onOpenInApp:u.mutate,onNote:e.status===`review`?(t,n)=>he(e.id,t,n):void 0})})]})}function $(e){return e.isError&&e.error instanceof h&&e.error.status===409}function ve({changes:e,changesRefused:t,fileCount:n,children:r}){return e.isPending?(0,X.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,X.jsx)(F,{icon:t?(0,X.jsx)(C,{size:16}):(0,X.jsx)(x,{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,X.jsx)(F,{icon:(0,X.jsx)(C,{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 ye({runId:e,files:t,tree:n,selected:r,selectFile:i,diffRef:a,effectiveMode:o,effectiveWrap:s,preview:c,localHandoff:l,onOpenInApp:u,onNote:p}){let[m,h]=(0,K.useState)(!1);return(0,X.jsx)(U,{className:`px-4 pb-9 pt-0 [--diff-sticky-top:0px] md:px-9`,treeSlot:`changes-tree-pane`,treeClassName:`rounded-xl border border-border bg-card md:sticky md:top-4 md:max-h-[calc(100dvh_-_64px_-_2rem)] md:overflow-y-auto md:overscroll-contain md:p-3.5`,tree:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{type:`button`,"data-slot":`changes-tree-toggle`,"aria-expanded":m,onClick:()=>h(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,X.jsxs)(`span`,{children:[`Changed files`,` `,(0,X.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,t.length,`)`]})]}),(0,X.jsx)(S,{size:16,"aria-hidden":`true`,className:b(`size-4 shrink-0 text-muted-foreground motion-safe:transition-transform`,m&&`rotate-180`)})]}),(0,X.jsx)(`h2`,{className:`mb-3 hidden border-b border-border pb-3 text-xs font-semibold md:block`,children:`Changed files`}),(0,X.jsx)(`div`,{className:b(m?`border-t border-border px-3.5 py-3 md:border-t-0 md:p-0`:`hidden md:block`),children:(0,X.jsx)(w,{root:n,selected:r,onSelect:e=>{i(e),h(!1)}})})]}),children:(0,X.jsx)(H,{files:t,viewRef:a,mode:o,wrap:s,preview:c,loadFileText:t=>W(()=>f(e,t)),imageSrc:t=>d(e,t),onOpenInApp:l?e=>u(e):void 0,onNote:p,totals:!1,className:`min-w-0 flex-1`})})}export{Q as ChangesPane,ge as TaskChangesRoute};
5
+ `}${pe(t,n)}`})}var X=n();function Z({run:e,open:t,onOpenChange:n}){let r=d(),[i,o]=(0,K.useState)(``),c=P(e),l=(0,K.useRef)(c);l.current=c,(0,K.useEffect)(()=>{t&&o(l.current)},[t]);let u=s({mutationFn:t=>v(e.id,t),onSuccess:t=>{_(`Committed ${ce(t.sha)}`),n(!1),r.invalidateQueries({queryKey:a.runs.changes(e.id)}),r.invalidateQueries({queryKey:a.runs.all})},onError:e=>_(e.message,{tone:`danger`})}),f=()=>{let e=i.trim();e.length===0||u.isPending||u.mutate(e)};return(0,X.jsx)(M,{open:t,onOpenChange:n,children:(0,X.jsxs)(A,{"data-slot":`commit-dialog`,children:[(0,X.jsxs)(k,{children:[(0,X.jsx)(j,{children:`Commit changes`}),(0,X.jsxs)(O,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,X.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,X.jsx)(R,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:i,onChange:e=>o(e.target.value),onKeyDown:e=>{L(e)&&(e.preventDefault(),f())}}),(0,X.jsxs)(D,{children:[(0,X.jsx)(E,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,X.jsx)(E,{"data-slot":`commit-confirm`,disabled:i.trim().length===0||u.isPending,onClick:f,children:u.isPending?`Committing…`:`Commit`})]})]})})}function ge(){let{id:e}=y(),t=r(e);return t.isPending?(0,X.jsx)(oe,{tab:`changes`}):t.isError?(0,X.jsx)(se,{tab:`changes`,error:t.error}):(0,X.jsx)(_e,{run:t.data},t.data.id)}function _e({run:e}){let t=c(),n=i(),r=o(e.id,N(e)),f=ae(),[p,m]=(0,K.useState)(`unified`),[g,v]=(0,K.useState)(!0),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(!1),C=d(),w=()=>C.invalidateQueries({queryKey:a.runs.all}),T=e=>_(e.message,{tone:`danger`}),E=s({mutationFn:()=>h(e.id),onSuccess:e=>_(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:T}),D=s({mutationFn:()=>ee(e.id),onSuccess:e=>{_(`Draft PR created — ${e.url}`),w()},onError:T}),O=s({mutationFn:()=>l(e.id),onError:e=>{if(e instanceof u&&e.command){navigator.clipboard.writeText(e.command).then(()=>_(`No terminal found — command copied to clipboard.`)).catch(()=>_(`Run manually: ${e.command}`));return}T(e)}}),k=$(r),A=fe({run:e,cliHandoff:e.cliHandoff,hasWorktree:!!e.worktreePath&&!k,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:I(e)!==void 0,prUrl:e.pullRequestUrl}),j=e=>{switch(e){case`commit`:S(!0);break;case`push`:E.mutate();break;case`create-pr`:D.mutate();break;case`open-terminal`:O.mutate();break;case`view-pr`:break}},M=r.data?.files??[],P=(0,K.useMemo)(()=>M.some(z),[M]),F=f?p:`unified`;return(0,X.jsxs)(ie,{route:`task-changes`,density:re(M.length),flushPadding:!0,children:[(0,X.jsx)(te,{run:e,tab:`changes`}),(0,X.jsx)(ne,{bar:A,healthReady:t.data!==void 0,branch:e.branch,stat:r.data?.stat,mode:F,wrap:g,preview:y,onModeChange:m,onWrapChange:v,onPreviewChange:P?b:void 0,onAction:j}),(0,X.jsx)(Q,{run:e,mode:F,wrap:g,preview:y}),(0,X.jsx)(Z,{run:e,open:x,onOpenChange:S})]})}function Q({run:e,mode:t=`unified`,wrap:n=!0,preview:r=!1,revealRef:i}){let a=c(),l=o(e.id,N(e)),u=s({mutationFn:t=>m(e.id,t),onError:e=>_(e.message,{tone:`danger`})}),d=$(l),f=l.data?.files??[],p=(0,K.useMemo)(()=>T(f),[f]),h=le(e.id),g=ue(e.id,`changes`,l.data?.files);return(0,K.useEffect)(()=>{if(i)return i.current=t=>f.some(e=>e.path===t)?(G(e.id,t),g.reveal(t),!0):!1,()=>{i.current=null}},[i,f,e.id,g]),(0,X.jsxs)(X.Fragment,{children:[l.data?.repointedHead?(0,X.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,X.jsx)(`code`,{children:l.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,X.jsx)(`code`,{children:l.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,(0,X.jsx)(ve,{changes:l,changesRefused:d,fileCount:f.length,children:(0,X.jsx)(ye,{runId:e.id,files:f,tree:p,selected:h,selectFile:t=>{G(e.id,t),g.reveal(t)},diffRef:g,effectiveMode:t,effectiveWrap:n,preview:r,localHandoff:a.data?.capabilities.localHandoff,onOpenInApp:u.mutate,onNote:e.status===`review`?(t,n)=>he(e.id,t,n):void 0})})]})}function $(e){return e.isError&&e.error instanceof u&&e.error.status===409}function ve({changes:e,changesRefused:t,fileCount:n,children:r}){return e.isPending?(0,X.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,X.jsx)(F,{icon:t?(0,X.jsx)(C,{size:16}):(0,X.jsx)(x,{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,X.jsx)(F,{icon:(0,X.jsx)(C,{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 ye({runId:e,files:t,tree:n,selected:r,selectFile:i,diffRef:a,effectiveMode:o,effectiveWrap:s,preview:c,localHandoff:l,onOpenInApp:u,onNote:d}){let[m,h]=(0,K.useState)(!1);return(0,X.jsx)(U,{className:`px-4 pb-9 pt-0 [--diff-sticky-top:0px] md:px-9`,treeSlot:`changes-tree-pane`,treeClassName:`rounded-xl border border-border bg-card md:sticky md:top-4 md:max-h-[calc(100dvh_-_64px_-_2rem)] md:overflow-y-auto md:overscroll-contain md:p-3.5`,tree:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{type:`button`,"data-slot":`changes-tree-toggle`,"aria-expanded":m,onClick:()=>h(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,X.jsxs)(`span`,{children:[`Changed files`,` `,(0,X.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,t.length,`)`]})]}),(0,X.jsx)(S,{size:16,"aria-hidden":`true`,className:b(`size-4 shrink-0 text-muted-foreground motion-safe:transition-transform`,m&&`rotate-180`)})]}),(0,X.jsx)(`h2`,{className:`mb-3 hidden border-b border-border pb-3 text-xs font-semibold md:block`,children:`Changed files`}),(0,X.jsx)(`div`,{className:b(m?`border-t border-border px-3.5 py-3 md:border-t-0 md:p-0`:`hidden md:block`),children:(0,X.jsx)(w,{root:n,selected:r,onSelect:e=>{i(e),h(!1)}})})]}),children:(0,X.jsx)(H,{files:t,viewRef:a,mode:o,wrap:s,preview:c,loadFileText:t=>W(()=>p(e,t)),imageSrc:t=>f(e,t),onOpenInApp:l?e=>u(e):void 0,onNote:d,totals:!1,className:`min-w-0 flex-1`})})}export{Q as ChangesPane,ge as TaskChangesRoute};
@@ -1 +1 @@
1
- import{t as e}from"./react-runtime-CCIEwYL0.js";import{J as t,Vt as n,X as r,Z as i,dn as a}from"./queries-IlC9MZgh.js";import{Tt as o,Yn as s,wt as c}from"./toaster-DNnL8v10.js";import{g as l}from"./chunk-KS7C4IRE-BdLLx37K.js";import{C as u,M as d}from"./design-icons-QbNMZniQ.js";import{t as f}from"./run-header-BUe92WWr.js";import{t as p}from"./project-router-Dc6KBQsv.js";import{b as m}from"./task-groups-DCg4iOB9.js";import{f as h,l as g,m as _}from"./page-shell-BdjH5hyc.js";import{t as v}from"./centered-state-N8vWM_Hw.js";import{Bn as y,D as b,E as x}from"./index-DPfg7xSB.js";import{t as S}from"./change-counts-BLLRvt46.js";import{t as C}from"./code-workbench-B0GIezrD.js";import{t as w}from"./file-text-nGpo7MVd.js";import{i as T,r as E,t as D}from"./commit-list-CPJLP4DU.js";import{i as O,n as k,r as A}from"./selected-file-CfBWFB6p.js";var j=e();function M(){let{id:e}=l(),n=t(e);return n.isPending?(0,j.jsx)(b,{tab:`changes`}):n.isError?(0,j.jsx)(x,{tab:`changes`,error:n.error}):(0,j.jsx)(N,{run:n.data})}function N({run:e}){let{sha:t}=l(),n=i(e.id,m(e)),r=_(),a=t??n.data?.commits[0]?.sha,o=t!==void 0&&(!r||n.isError||n.data?.commits.length===0);return(0,j.jsxs)(g,{route:`task-commits`,density:h(n.data?.commits.length??0),flushPadding:!0,children:[(0,j.jsx)(f,{run:e,tab:`commits`}),o?(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)(v,{icon:(0,j.jsx)(d,{size:16}),tone:n.error instanceof s&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof s&&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)(v,{icon:(0,j.jsx)(d,{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:a})]})}function P({run:e,commits:t,selectedSha:n}){let i=r(e.id,n),a=L(e.id,t),s=A(e.id,`commit:${n??``}`,i.data?.files),c=O(e.id);return(0,j.jsx)(C,{className:`px-4 py-5 md:px-9`,treeSlot:`task-commits-pane`,tree:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(D,{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:a.get(t.sha)}))}),n&&i.data&&i.data.files.length>0?(0,j.jsx)(R,{runId:e.id,sha:n,files:i.data.files,selected:c,onPick:t=>{k(e.id,t),s.reveal(t)}}):null]}),children:n?(0,j.jsx)(T,{commit:i,sha:n,slot:`task-commit-preview`,heading:`h3`,diffRef:s,loadFileText:t=>w(()=>o(e.id,n,t))}):null})}function F({runId:e,sha:t}){let n=r(e,t);return(0,j.jsx)(E,{commit:n,sha:t,diffRef:A(e,`commit:${t}`,n.data?.files),backTo:`/tasks/${e}/commits`,backLabel:`All commits`,slot:`task-commit`,loadFileText:n=>w(()=>o(e,t,n))})}var I=12;function L(e,t){let r=t.length<=I,i=a({queries:t.map(t=>({queryKey:n.runs.commit(e,t.sha),queryFn:({signal:n})=>c(e,t.sha,{signal:n}),enabled:r,retry:!1}))}),o=new Map;return i.forEach((e,n)=>{let r=t[n]?.sha;r&&e.data?.stat&&o.set(r,e.data.stat)}),o}function R({runId:e,sha:t,files:n,selected:r,onPick:i}){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)(y,{sha:t,variant:`inline`,className:`text-[13px] font-medium`})]}),(0,j.jsx)(p,{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,"aria-current":e.path===r?`true`:void 0,onClick:()=>i(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 aria-[current=true]:bg-muted aria-[current=true]:text-foreground`,children:[(0,j.jsx)(u,{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)(S,{adds:e.adds,dels:e.dels,className:`font-mono text-xs`})]})},e.path))})]})}export{M as TaskCommitsRoute};
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{J as t,Vt as n,X as r,Z as i,dn as a}from"./queries-D9mg7sFY.js";import{Cn as o,Tt as s,wt as c}from"./toaster-2ud_VdfV.js";import{g as l}from"./chunk-KS7C4IRE-BdLLx37K.js";import{C as u,M as d}from"./design-icons-QbNMZniQ.js";import{t as f}from"./run-header-DZ0rkryR.js";import{t as p}from"./project-router-CwD1firw.js";import{b as m}from"./task-groups-BvVfsQKd.js";import{f as h,l as g,m as _}from"./page-shell-BdjH5hyc.js";import{t as v}from"./centered-state-N8vWM_Hw.js";import{Bn as y,D as b,E as x}from"./index-DkQ5xrLr.js";import{t as S}from"./change-counts-BLLRvt46.js";import{t as C}from"./code-workbench-B0GIezrD.js";import{t as w}from"./file-text-nGpo7MVd.js";import{i as T,r as E,t as D}from"./commit-list-sFxchD2V.js";import{i as O,n as k,r as A}from"./selected-file-CfBWFB6p.js";var j=e();function M(){let{id:e}=l(),n=t(e);return n.isPending?(0,j.jsx)(b,{tab:`changes`}):n.isError?(0,j.jsx)(x,{tab:`changes`,error:n.error}):(0,j.jsx)(N,{run:n.data})}function N({run:e}){let{sha:t}=l(),n=i(e.id,m(e)),r=_(),a=t??n.data?.commits[0]?.sha,s=t!==void 0&&(!r||n.isError||n.data?.commits.length===0);return(0,j.jsxs)(g,{route:`task-commits`,density:h(n.data?.commits.length??0),flushPadding:!0,children:[(0,j.jsx)(f,{run:e,tab:`commits`}),s?(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)(v,{icon:(0,j.jsx)(d,{size:16}),tone:n.error instanceof o&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof o&&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)(v,{icon:(0,j.jsx)(d,{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:a})]})}function P({run:e,commits:t,selectedSha:n}){let i=r(e.id,n),a=L(e.id,t),o=A(e.id,`commit:${n??``}`,i.data?.files),c=O(e.id);return(0,j.jsx)(C,{className:`px-4 py-5 md:px-9`,treeSlot:`task-commits-pane`,tree:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(D,{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:a.get(t.sha)}))}),n&&i.data&&i.data.files.length>0?(0,j.jsx)(R,{runId:e.id,sha:n,files:i.data.files,selected:c,onPick:t=>{k(e.id,t),o.reveal(t)}}):null]}),children:n?(0,j.jsx)(T,{commit:i,sha:n,slot:`task-commit-preview`,heading:`h3`,diffRef:o,loadFileText:t=>w(()=>s(e.id,n,t))}):null})}function F({runId:e,sha:t}){let n=r(e,t);return(0,j.jsx)(E,{commit:n,sha:t,diffRef:A(e,`commit:${t}`,n.data?.files),backTo:`/tasks/${e}/commits`,backLabel:`All commits`,slot:`task-commit`,loadFileText:n=>w(()=>s(e,t,n))})}var I=12;function L(e,t){let r=t.length<=I,i=a({queries:t.map(t=>({queryKey:n.runs.commit(e,t.sha),queryFn:({signal:n})=>c(e,t.sha,{signal:n}),enabled:r,retry:!1}))}),o=new Map;return i.forEach((e,n)=>{let r=t[n]?.sha;r&&e.data?.stat&&o.set(r,e.data.stat)}),o}function R({runId:e,sha:t,files:n,selected:r,onPick:i}){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)(y,{sha:t,variant:`inline`,className:`text-[13px] font-medium`})]}),(0,j.jsx)(p,{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,"aria-current":e.path===r?`true`:void 0,onClick:()=>i(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 aria-[current=true]:bg-muted aria-[current=true]:text-foreground`,children:[(0,j.jsx)(u,{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)(S,{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{f as r,g as i}from"./chunk-KS7C4IRE-BdLLx37K.js";import{x as a}from"./index-DPfg7xSB.js";var o=e(t(),1),s=n();function c({runId:e,children:t}){let n=r(),i=(0,o.useMemo)(()=>({runId:e}),[e]);return n?(0,s.jsx)(l,{runId:e,children:t}):(0,s.jsx)(a.Provider,{value:i,children:t})}function l({runId:e,children:t}){let{projectId:n}=i(),r=(0,o.useMemo)(()=>({runId:e,...n?{projectId:n}:{}}),[e,n]);return(0,s.jsx)(a.Provider,{value:r,children:t})}export{c as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{f as r,g as i}from"./chunk-KS7C4IRE-BdLLx37K.js";import{x as a}from"./index-DkQ5xrLr.js";var o=e(t(),1),s=n();function c({runId:e,children:t}){let n=r(),i=(0,o.useMemo)(()=>({runId:e}),[e]);return n?(0,s.jsx)(l,{runId:e,children:t}):(0,s.jsx)(a.Provider,{value:i,children:t})}function l({runId:e,children:t}){let{projectId:n}=i(),r=(0,o.useMemo)(()=>({runId:e,...n?{projectId:n}:{}}),[e,n]);return(0,s.jsx)(a.Provider,{value:r,children:t})}export{c as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$ as r,J as i,M as a,P as o,z as s}from"./queries-IlC9MZgh.js";import{Yn as c,it as l,mt as u}from"./toaster-DNnL8v10.js";import{_ as d,g as f,h as p,p as m}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as h}from"./dist-CCX8mhHc.js";import{C as g,E as _,Q as v,Z as ee,ct as y,d as b}from"./design-icons-QbNMZniQ.js";import{t as x}from"./createLucideIcon-BHp8sXmF.js";import{t as S}from"./run-header-BUe92WWr.js";import{a as C,i as w,n as T,o as E,r as te}from"./file-preview-CnrFxbea.js";import{t as D}from"./button-BV_AiLj2.js";import{l as O}from"./page-shell-BdjH5hyc.js";import{t as k}from"./centered-state-N8vWM_Hw.js";import{t as A}from"./use-search-params-writer-DD5PEEZw.js";import{C as j,D as M,E as N,lr as P,vr as F,x as I,zn as L}from"./index-DPfg7xSB.js";import{t as R}from"./task-file-scope-ID220XKo.js";import{t as z}from"./code-workbench-B0GIezrD.js";import{t as B}from"./middle-truncated-name-jUQS2QzL.js";import{n as V,t as H}from"./selected-file-CfBWFB6p.js";var U=x(`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`}]]),ne=x(`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`}]]),W=e(t(),1),G=n();function K({runId:e,path:t,artifactId:n,worktreePath:r}){let i=s(e,n?null:t),o=a(e,n),c=n?o:i,d=(0,W.useContext)(I),f=m(),p=f.pathname.replace(/\/files\/?$/,`/report`)+f.search,h=c.data,g=(0,W.useMemo)(()=>h?.type===`file`&&h.source!==`artifact`?{runId:e,...d,basePath:h.path}:null,[h,d,e]);if(!t&&!n)return(0,G.jsx)(te,{runId:e,path:null,className:`min-w-0 flex-1`});if(c.isPending)return(0,G.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(c.isError)return(0,G.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,G.jsx)(`h2`,{children:`Could not load this file`}),(0,G.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:c.error.message}),(0,G.jsx)(D,{variant:`outline`,onClick:()=>void c.refetch(),children:`Retry`})]});if(!h)return(0,G.jsx)(`p`,{role:`alert`,className:`p-4`,children:`No file data was returned.`});let _=w(h.path,r,t);if(h.type!==`file`)return(0,G.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,G.jsx)(`h2`,{children:h.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,G.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:_}),(0,G.jsx)(`p`,{className:`text-sm`,children:h.reason}),(0,G.jsx)(D,{variant:`outline`,onClick:()=>void c.refetch(),children:`Retry`})]});let v=h.artifact;return(0,G.jsx)(I.Provider,{value:g,children:(0,G.jsx)(T,{runId:e,entry:h,displayPath:_,documentPreview:!0,readerHref:p,className:`min-w-0 flex-1`,imageUrl:v?l(e,v.id,`image`):u(e,t),...v?{downloadUrl:l(e,v.id,`download`),snapshot:(0,G.jsx)(L,{iso:v.createdAt})}:{}},v?.id??h.path)})}var q=new Map;function J(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var Y=(0,W.createContext)(null);function X(){let{key:e}=m(),t=p()===`POP`,[n,r]=(0,W.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 Z=()=>document.querySelector(`[data-slot="main"]`);function re(e,t){let n=(0,W.useRef)(null),r=m(),i=p()===`POP`?r.key:J(r.state),[a]=(0,W.useState)(()=>{let t=i?q.get(i):void 0;return t?.runId===e?t:null}),o=(0,W.useRef)(new Set(a?.folders??[])),s=(0,W.useRef)(new Set),[c,l]=(0,W.useState)(0),u=(0,W.useRef)(a===null),d=(0,W.useCallback)(()=>{u.current&&q.set(r.key,{runId:e,folders:new Set(o.current),tree:n.current?.scrollTop??0,main:Z()?.scrollTop??0})},[r.key,e]),f=(0,W.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,W.useEffect)(()=>{if(u.current||!a||!t||s.current.size>0)return;n.current&&(n.current.scrollTop=a.tree);let e=Z();e&&(e.scrollTop=a.main),u.current=!0,d()},[a,t,c,d]),(0,W.useEffect)(()=>{d();let e=[n.current,Z()].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:f}}function ie({runId:e,selected:t,onSelect:n}){return(0,G.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,G.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,G.jsx)(Q,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function Q({runId:e,path:t,depth:n,selected:i,onSelect:a}){let o=r(e,t),s=(0,W.useContext)(Y);return(0,W.useEffect)(()=>{if(!(!t||!s))return s.loading(t,o.isPending),()=>s.loading(t,!1)},[s,t,o.isPending]),o.isPending?(0,G.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…`}):o.isError?(0,G.jsx)(`li`,{"data-slot":`files-tree-error`,className:`px-1.5 py-1 text-xs text-danger`,style:{paddingLeft:`${6+n*14}px`},children:o.error.message}):o.data.type===`dir`?o.data.entries.length===0?(0,G.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,G.jsx)(G.Fragment,{children:o.data.entries.map(r=>r.type===`dir`?(0,G.jsx)(ae,{runId:e,name:r.chain??r.name,path:t===``?r.chain??r.name:`${t}/${r.chain??r.name}`,depth:n,selected:i,onSelect:a},r.name):(0,G.jsx)(oe,{name:r.name,path:t===``?r.name:`${t}/${r.name}`,size:r.size,depth:n,selected:i,onSelect:a},r.name))}):null}function ae({runId:e,name:t,path:n,depth:r,selected:i,onSelect:a}){let o=(0,W.useContext)(Y),[s,c]=(0,W.useState)(()=>o?.isOpen(n)??!1);return(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":s?`open`:`closed`,"aria-expanded":s,onClick:()=>{o?.setOpen(n,!s),c(!s)},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+r*14}px`},children:[(0,G.jsx)(b,{size:16,"aria-hidden":`true`,className:h(`order-last ml-auto size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,s&&`rotate-90`)}),(0,G.jsx)(_,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,G.jsx)(`span`,{title:n,className:`min-w-0 truncate font-normal`,children:t})]}),s?(0,G.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,G.jsx)(Q,{runId:e,path:n,depth:r+1,selected:i,onSelect:a})}):null]})}function oe({name:e,path:t,size:n,depth:r,selected:i,onSelect:a}){let o=i===t,s=E(t)?ne:g;return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":o?`true`:void 0,onClick:()=>a(t),className:h(`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`,o?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${6+r*14}px`},children:[(0,G.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,G.jsx)(B,{name:e,path:t}),n===void 0?null:(0,G.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs tabular-nums text-soft-foreground`,children:C(n)})]})})}function $(){let{id:e}=f(),t=i(e),n=X();return t.isPending?(0,G.jsx)(M,{tab:`files`}):t.isError?(0,G.jsx)(N,{tab:`files`,error:t.error}):(0,G.jsx)(R,{runId:t.data.id,children:(0,G.jsx)(le,{run:t.data},`${t.data.id}:${n}`)})}function se(e,t,n,r){let i=s(e,r||n!==null?null:t),o=a(e,r?null:n);return r||t===null&&n===null?!0:!(n===null?i:o).isPending}function ce(e,t,n,r){let i=e.id,a=e.worktreePath,[,o]=A(),s=p(),c=(0,W.useRef)(!1);(0,W.useEffect)(()=>{if(c.current)return;c.current=!0;let e=H(i);s===`POP`||t!==null||n!==null||e===null||o(t=>(t.set(`path`,e),t))},[s,n,t,i,o]),(0,W.useEffect)(()=>{t!==null&&!r&&V(i,j(t,a))},[r,t,i,a])}function le({run:e}){let t=r(e.id,``),n=o(e.id),[i,a]=d(),s=i.get(`path`),l=i.get(`artifact`),u=i.getAll(`path`).length>1||i.getAll(`artifact`).length>1||s!==null&&l!==null;ce(e,s,l,u);let[f,p]=(0,W.useState)(s??``);(0,W.useEffect)(()=>p(s??``),[s]);let m=(e,t)=>{let n=new URLSearchParams(i);n.delete(`path`),n.delete(`artifact`),n.set(e,t),a(n)},h=t.isError&&t.error instanceof c&&t.error.status===409,g=se(e.id,s,l,u),_=re(e.id,!t.isPending&&g);return(0,G.jsxs)(O,{route:`task-files`,density:ue(t.isError),flushPadding:!0,children:[(0,G.jsx)(S,{run:e,tab:`files`}),(0,G.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-4 pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),f.trim()&&m(`path`,f.trim())},children:[(0,G.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,G.jsx)(v,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,G.jsx)(P,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:f,onChange:e=>p(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,G.jsx)(D,{type:`submit`,variant:`outline`,className:`shrink-0`,disabled:!f.trim(),children:`Open file`})]}),(0,G.jsx)(z,{className:`flex-none gap-5 px-4 py-[22px] [--diff-sticky-top:1rem] md:gap-0 md:px-9`,treeRef:_.tree,treeSlot:`files-tree-pane`,treeClassName:`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:overflow-y-auto md:overscroll-contain`,tree:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,G.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,G.jsx)(k,{icon:h?(0,G.jsx)(U,{}):(0,G.jsx)(y,{size:16}),tone:h?`neutral`:`danger`,heading:`h2`,title:h?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,G.jsx)(Y.Provider,{value:_.folders,children:(0,G.jsx)(ie,{runId:e.id,selected:s,onSelect:e=>m(`path`,e)})}),(0,G.jsx)(de,{artifacts:n,artifactId:l,onSelect:e=>m(`artifact`,e)})]}),children:u?(0,G.jsx)(`p`,{role:`alert`,className:`p-4`,children:`Invalid file link: choose either a path or a published artifact.`}):s!==null||l!==null||t.isSuccess?(0,G.jsx)(K,{runId:e.id,path:s,artifactId:l,worktreePath:e.worktreePath}):null}),(0,G.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 ue(e){return e?`empty`:`full`}function de({artifacts:e,artifactId:t,onSelect:n}){return(0,G.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),e.isPending?(0,G.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):e.isError?(0,G.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):e.data.artifacts.length===0?(0,G.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,G.jsx)(`ul`,{children:e.data.artifacts.map(e=>(0,G.jsx)(`li`,{children:(0,G.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,G.jsx)(F,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 wrap-anywhere underline-offset-2 group-hover:underline`,children:e.name}),(0,G.jsx)(b,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground group-hover:text-foreground`})]})},e.id))}),(0,G.jsxs)(D,{variant:`outline`,size:`sm`,"data-action":`refresh-artifacts`,className:`mt-2`,onClick:()=>void e.refetch(),children:[(0,G.jsx)(ee,{"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{$ as r,J as i,M as a,P as o,z as s}from"./queries-D9mg7sFY.js";import{Cn as c,it as l,mt as u}from"./toaster-2ud_VdfV.js";import{_ as d,g as f,h as p,p as m}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as h}from"./dist-CCX8mhHc.js";import{C as g,E as _,Q as v,Z as ee,ct as y,d as b}from"./design-icons-QbNMZniQ.js";import{t as x}from"./createLucideIcon-BHp8sXmF.js";import{t as S}from"./run-header-DZ0rkryR.js";import{a as C,i as w,n as T,o as E,r as te}from"./file-preview-B7T7jFYo.js";import{t as D}from"./button-BV_AiLj2.js";import{l as O}from"./page-shell-BdjH5hyc.js";import{t as k}from"./centered-state-N8vWM_Hw.js";import{t as A}from"./use-search-params-writer-DD5PEEZw.js";import{C as j,D as M,E as N,lr as P,vr as F,x as I,zn as L}from"./index-DkQ5xrLr.js";import{t as R}from"./task-file-scope-FTt7SiGn.js";import{t as z}from"./code-workbench-B0GIezrD.js";import{t as B}from"./middle-truncated-name-jUQS2QzL.js";import{n as V,t as H}from"./selected-file-CfBWFB6p.js";var U=x(`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`}]]),ne=x(`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`}]]),W=e(t(),1),G=n();function K({runId:e,path:t,artifactId:n,worktreePath:r}){let i=s(e,n?null:t),o=a(e,n),c=n?o:i,d=(0,W.useContext)(I),f=m(),p=f.pathname.replace(/\/files\/?$/,`/report`)+f.search,h=c.data,g=(0,W.useMemo)(()=>h?.type===`file`&&h.source!==`artifact`?{runId:e,...d,basePath:h.path}:null,[h,d,e]);if(!t&&!n)return(0,G.jsx)(te,{runId:e,path:null,className:`min-w-0 flex-1`});if(c.isPending)return(0,G.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(c.isError)return(0,G.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,G.jsx)(`h2`,{children:`Could not load this file`}),(0,G.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:c.error.message}),(0,G.jsx)(D,{variant:`outline`,onClick:()=>void c.refetch(),children:`Retry`})]});if(!h)return(0,G.jsx)(`p`,{role:`alert`,className:`p-4`,children:`No file data was returned.`});let _=w(h.path,r,t);if(h.type!==`file`)return(0,G.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,G.jsx)(`h2`,{children:h.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,G.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:_}),(0,G.jsx)(`p`,{className:`text-sm`,children:h.reason}),(0,G.jsx)(D,{variant:`outline`,onClick:()=>void c.refetch(),children:`Retry`})]});let v=h.artifact;return(0,G.jsx)(I.Provider,{value:g,children:(0,G.jsx)(T,{runId:e,entry:h,displayPath:_,documentPreview:!0,readerHref:p,className:`min-w-0 flex-1`,imageUrl:v?l(e,v.id,`image`):u(e,t),...v?{downloadUrl:l(e,v.id,`download`),snapshot:(0,G.jsx)(L,{iso:v.createdAt})}:{}},v?.id??h.path)})}var q=new Map;function J(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var Y=(0,W.createContext)(null);function X(){let{key:e}=m(),t=p()===`POP`,[n,r]=(0,W.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 Z=()=>document.querySelector(`[data-slot="main"]`);function re(e,t){let n=(0,W.useRef)(null),r=m(),i=p()===`POP`?r.key:J(r.state),[a]=(0,W.useState)(()=>{let t=i?q.get(i):void 0;return t?.runId===e?t:null}),o=(0,W.useRef)(new Set(a?.folders??[])),s=(0,W.useRef)(new Set),[c,l]=(0,W.useState)(0),u=(0,W.useRef)(a===null),d=(0,W.useCallback)(()=>{u.current&&q.set(r.key,{runId:e,folders:new Set(o.current),tree:n.current?.scrollTop??0,main:Z()?.scrollTop??0})},[r.key,e]),f=(0,W.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,W.useEffect)(()=>{if(u.current||!a||!t||s.current.size>0)return;n.current&&(n.current.scrollTop=a.tree);let e=Z();e&&(e.scrollTop=a.main),u.current=!0,d()},[a,t,c,d]),(0,W.useEffect)(()=>{d();let e=[n.current,Z()].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:f}}function ie({runId:e,selected:t,onSelect:n}){return(0,G.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,G.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,G.jsx)(Q,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function Q({runId:e,path:t,depth:n,selected:i,onSelect:a}){let o=r(e,t),s=(0,W.useContext)(Y);return(0,W.useEffect)(()=>{if(!(!t||!s))return s.loading(t,o.isPending),()=>s.loading(t,!1)},[s,t,o.isPending]),o.isPending?(0,G.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…`}):o.isError?(0,G.jsx)(`li`,{"data-slot":`files-tree-error`,className:`px-1.5 py-1 text-xs text-danger`,style:{paddingLeft:`${6+n*14}px`},children:o.error.message}):o.data.type===`dir`?o.data.entries.length===0?(0,G.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,G.jsx)(G.Fragment,{children:o.data.entries.map(r=>r.type===`dir`?(0,G.jsx)(ae,{runId:e,name:r.chain??r.name,path:t===``?r.chain??r.name:`${t}/${r.chain??r.name}`,depth:n,selected:i,onSelect:a},r.name):(0,G.jsx)(oe,{name:r.name,path:t===``?r.name:`${t}/${r.name}`,size:r.size,depth:n,selected:i,onSelect:a},r.name))}):null}function ae({runId:e,name:t,path:n,depth:r,selected:i,onSelect:a}){let o=(0,W.useContext)(Y),[s,c]=(0,W.useState)(()=>o?.isOpen(n)??!1);return(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":s?`open`:`closed`,"aria-expanded":s,onClick:()=>{o?.setOpen(n,!s),c(!s)},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+r*14}px`},children:[(0,G.jsx)(b,{size:16,"aria-hidden":`true`,className:h(`order-last ml-auto size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,s&&`rotate-90`)}),(0,G.jsx)(_,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,G.jsx)(`span`,{title:n,className:`min-w-0 truncate font-normal`,children:t})]}),s?(0,G.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,G.jsx)(Q,{runId:e,path:n,depth:r+1,selected:i,onSelect:a})}):null]})}function oe({name:e,path:t,size:n,depth:r,selected:i,onSelect:a}){let o=i===t,s=E(t)?ne:g;return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":o?`true`:void 0,onClick:()=>a(t),className:h(`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`,o?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${6+r*14}px`},children:[(0,G.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,G.jsx)(B,{name:e,path:t}),n===void 0?null:(0,G.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs tabular-nums text-soft-foreground`,children:C(n)})]})})}function $(){let{id:e}=f(),t=i(e),n=X();return t.isPending?(0,G.jsx)(M,{tab:`files`}):t.isError?(0,G.jsx)(N,{tab:`files`,error:t.error}):(0,G.jsx)(R,{runId:t.data.id,children:(0,G.jsx)(le,{run:t.data},`${t.data.id}:${n}`)})}function se(e,t,n,r){let i=s(e,r||n!==null?null:t),o=a(e,r?null:n);return r||t===null&&n===null?!0:!(n===null?i:o).isPending}function ce(e,t,n,r){let i=e.id,a=e.worktreePath,[,o]=A(),s=p(),c=(0,W.useRef)(!1);(0,W.useEffect)(()=>{if(c.current)return;c.current=!0;let e=H(i);s===`POP`||t!==null||n!==null||e===null||o(t=>(t.set(`path`,e),t))},[s,n,t,i,o]),(0,W.useEffect)(()=>{t!==null&&!r&&V(i,j(t,a))},[r,t,i,a])}function le({run:e}){let t=r(e.id,``),n=o(e.id),[i,a]=d(),s=i.get(`path`),l=i.get(`artifact`),u=i.getAll(`path`).length>1||i.getAll(`artifact`).length>1||s!==null&&l!==null;ce(e,s,l,u);let[f,p]=(0,W.useState)(s??``);(0,W.useEffect)(()=>p(s??``),[s]);let m=(e,t)=>{let n=new URLSearchParams(i);n.delete(`path`),n.delete(`artifact`),n.set(e,t),a(n)},h=t.isError&&t.error instanceof c&&t.error.status===409,g=se(e.id,s,l,u),_=re(e.id,!t.isPending&&g);return(0,G.jsxs)(O,{route:`task-files`,density:ue(t.isError),flushPadding:!0,children:[(0,G.jsx)(S,{run:e,tab:`files`}),(0,G.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-4 pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),f.trim()&&m(`path`,f.trim())},children:[(0,G.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,G.jsx)(v,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,G.jsx)(P,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:f,onChange:e=>p(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,G.jsx)(D,{type:`submit`,variant:`outline`,className:`shrink-0`,disabled:!f.trim(),children:`Open file`})]}),(0,G.jsx)(z,{className:`flex-none gap-5 px-4 py-[22px] [--diff-sticky-top:1rem] md:gap-0 md:px-9`,treeRef:_.tree,treeSlot:`files-tree-pane`,treeClassName:`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:overflow-y-auto md:overscroll-contain`,tree:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,G.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,G.jsx)(k,{icon:h?(0,G.jsx)(U,{}):(0,G.jsx)(y,{size:16}),tone:h?`neutral`:`danger`,heading:`h2`,title:h?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,G.jsx)(Y.Provider,{value:_.folders,children:(0,G.jsx)(ie,{runId:e.id,selected:s,onSelect:e=>m(`path`,e)})}),(0,G.jsx)(de,{artifacts:n,artifactId:l,onSelect:e=>m(`artifact`,e)})]}),children:u?(0,G.jsx)(`p`,{role:`alert`,className:`p-4`,children:`Invalid file link: choose either a path or a published artifact.`}):s!==null||l!==null||t.isSuccess?(0,G.jsx)(K,{runId:e.id,path:s,artifactId:l,worktreePath:e.worktreePath}):null}),(0,G.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 ue(e){return e?`empty`:`full`}function de({artifacts:e,artifactId:t,onSelect:n}){return(0,G.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),e.isPending?(0,G.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):e.isError?(0,G.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):e.data.artifacts.length===0?(0,G.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,G.jsx)(`ul`,{children:e.data.artifacts.map(e=>(0,G.jsx)(`li`,{children:(0,G.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,G.jsx)(F,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 wrap-anywhere underline-offset-2 group-hover:underline`,children:e.name}),(0,G.jsx)(b,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground group-hover:text-foreground`})]})},e.id))}),(0,G.jsxs)(D,{variant:`outline`,size:`sm`,"data-action":`refresh-artifacts`,className:`mt-2`,onClick:()=>void e.refetch(),children:[(0,G.jsx)(ee,{"aria-hidden":`true`}),`Refresh published files`]})]})}export{$ as TaskFilesRoute};
@@ -1 +1 @@
1
- import{t as e}from"./react-runtime-CCIEwYL0.js";import{J as t,Vt as n,a as r,bt as i,n as a,un as o,vt as s,xt as c}from"./queries-IlC9MZgh.js";import{Fi as l,Y as u}from"./toaster-DNnL8v10.js";import{g as d}from"./chunk-KS7C4IRE-BdLLx37K.js";import{s as f}from"./dist-CCX8mhHc.js";import{S as p,T as m}from"./reference-chip-BjerVjzM.js";import{I as h,ct as g,m as _}from"./design-icons-QbNMZniQ.js";import{t as v}from"./run-header-BUe92WWr.js";import{t as y}from"./external-link-BE6y205O.js";import{t as b}from"./search-x-I9Q8pgUa.js";import{t as x}from"./button-BV_AiLj2.js";import{t as S}from"./project-router-Dc6KBQsv.js";import{l as C}from"./page-shell-BdjH5hyc.js";import{t as w}from"./centered-state-N8vWM_Hw.js";import{E as T,T as E,hr as D}from"./index-DPfg7xSB.js";import{l as O,n as k,t as A}from"./use-hand-to-agent-state-CADaL8U8.js";var j=e(),M={issue:`Issue`,pr:`Pull request`};function N({kind:e}){let{id:n}=d(),r=t(n);return r.isPending?(0,j.jsx)(E,{kind:e}):r.isError?(0,j.jsx)(T,{tab:`github-item`,error:r.error}):(0,j.jsx)(P,{run:r.data,kind:e})}function P({run:e,kind:t}){let{n}=d(),a=Number(n),o=i(),l=c(),u=s(),f=l.isPending||u.isPending,m=p(e,o).some(e=>e.kind===t&&e.number===a),h=r(t,a,m);return(0,j.jsxs)(C,{route:`task-github-item`,density:m?`full`:`empty`,flushPadding:!0,children:[(0,j.jsx)(v,{run:e,tab:{kind:t,number:a}}),m?(0,j.jsx)(H,{run:e,kind:t,number:a,repoBase:o,item:h}):f?(0,j.jsx)(E,{kind:t,number:a,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:r}){return(0,j.jsx)(x,{variant:`outline`,disabled:e.isPending,onClick:()=>e.mutate(n.githubItem(t,r)),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:t,number:n,repoBase:r,reason:i,retryError:a,retryButton:o}){let s=t===`pr`?h:_,c=m(e,r).find(e=>e.kind===`PR`==(t===`pr`)&&e.number===n)?.url;return(0,j.jsx)(w,{icon:(0,j.jsx)(s,{size:16}),tone:`neutral`,heading:`h2`,title:`GitHub is unavailable`,subtitle:a?.message??i,actions:(0,j.jsxs)(j.Fragment,{children:[o,c&&f(c)?(0,j.jsx)(x,{asChild:!0,variant:`outline`,children:(0,j.jsxs)(`a`,{href:c,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)(O,{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:n,repoBase:r,item:i}){let s=l(),c=o({mutationFn:e=>u(t,n,{refresh:!0}),onSuccess:(e,t)=>s.setQueryData(t,e)}),d=F(t,i),f=a(d?[n]:[],d),p=f.data?.available?f.data.checks:void 0,m=`${M[t]} #${n}`,h=(0,j.jsx)(L,{retry:c,kind:t,number:n});if(i.isPending)return(0,j.jsx)(E,{kind:t,number:n,heading:`h2`});if(i.isError)return(0,j.jsx)(R,{kind:t,number:n,error:c.error??i.error,retryButton:h});let g=i.data;return g.available?g.item?(0,j.jsx)(V,{kind:t,item:g.item,labelColors:g.labelColors,checks:I(t,n,p,g.item.checks)}):(0,j.jsx)(B,{label:m,repoBase:r}):(0,j.jsx)(z,{run:e,kind:t,number:n,repoBase:r,reason:g.reason,retryError:c.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)(k,{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{J as t,Vt as n,a as r,bt as i,n as a,un as o,vt as s,xt as c}from"./queries-D9mg7sFY.js";import{Fi as l,Y as u}from"./toaster-2ud_VdfV.js";import{g as d}from"./chunk-KS7C4IRE-BdLLx37K.js";import{S as f,T as p}from"./reference-chip-CZKBU_Ud.js";import{s as m}from"./dist-CCX8mhHc.js";import{I as h,ct as g,m as _}from"./design-icons-QbNMZniQ.js";import{t as v}from"./run-header-DZ0rkryR.js";import{t as y}from"./external-link-BE6y205O.js";import{t as b}from"./search-x-I9Q8pgUa.js";import{t as x}from"./button-BV_AiLj2.js";import{t as S}from"./project-router-CwD1firw.js";import{l as C}from"./page-shell-BdjH5hyc.js";import{t as w}from"./centered-state-N8vWM_Hw.js";import{E as T,T as E,hr as D}from"./index-DkQ5xrLr.js";import{l as O,n as k,t as A}from"./use-hand-to-agent-state-BB_VmbF7.js";var j=e(),M={issue:`Issue`,pr:`Pull request`};function N({kind:e}){let{id:n}=d(),r=t(n);return r.isPending?(0,j.jsx)(E,{kind:e}):r.isError?(0,j.jsx)(T,{tab:`github-item`,error:r.error}):(0,j.jsx)(P,{run:r.data,kind:e})}function P({run:e,kind:t}){let{n}=d(),a=Number(n),o=i(),l=c(),u=s(),p=l.isPending||u.isPending,m=f(e,o).some(e=>e.kind===t&&e.number===a),h=r(t,a,m);return(0,j.jsxs)(C,{route:`task-github-item`,density:m?`full`:`empty`,flushPadding:!0,children:[(0,j.jsx)(v,{run:e,tab:{kind:t,number:a}}),m?(0,j.jsx)(H,{run:e,kind:t,number:a,repoBase:o,item:h}):p?(0,j.jsx)(E,{kind:t,number:a,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:r}){return(0,j.jsx)(x,{variant:`outline`,disabled:e.isPending,onClick:()=>e.mutate(n.githubItem(t,r)),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:t,number:n,repoBase:r,reason:i,retryError:a,retryButton:o}){let s=t===`pr`?h:_,c=p(e,r).find(e=>e.kind===`PR`==(t===`pr`)&&e.number===n)?.url;return(0,j.jsx)(w,{icon:(0,j.jsx)(s,{size:16}),tone:`neutral`,heading:`h2`,title:`GitHub is unavailable`,subtitle:a?.message??i,actions:(0,j.jsxs)(j.Fragment,{children:[o,c&&m(c)?(0,j.jsx)(x,{asChild:!0,variant:`outline`,children:(0,j.jsxs)(`a`,{href:c,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)(O,{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:n,repoBase:r,item:i}){let s=l(),c=o({mutationFn:e=>u(t,n,{refresh:!0}),onSuccess:(e,t)=>s.setQueryData(t,e)}),d=F(t,i),f=a(d?[n]:[],d),p=f.data?.available?f.data.checks:void 0,m=`${M[t]} #${n}`,h=(0,j.jsx)(L,{retry:c,kind:t,number:n});if(i.isPending)return(0,j.jsx)(E,{kind:t,number:n,heading:`h2`});if(i.isError)return(0,j.jsx)(R,{kind:t,number:n,error:c.error??i.error,retryButton:h});let g=i.data;return g.available?g.item?(0,j.jsx)(V,{kind:t,item:g.item,labelColors:g.labelColors,checks:I(t,n,p,g.item.checks)}):(0,j.jsx)(B,{label:m,repoBase:r}):(0,j.jsx)(z,{run:e,kind:t,number:n,repoBase:r,reason:g.reason,retryError:c.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)(k,{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 +1 @@
1
- import"./queries-IlC9MZgh.js";import{Yt as e,br as t,mi as n,oi as r,si as i,ti as a}from"./toaster-DNnL8v10.js";import"./attention-BI6592lk.js";function o(e,t){let n;for(let r of e)!r.sessionId||r.id===t||(!n||!r.startedAt||!n.startedAt||r.startedAt>=n.startedAt)&&(n=r);return n}function s(e,t){return e?.backend??t?.runner??`claude`}function c(e,t){let n;for(let r of e)r.removedBackend===void 0&&(t===void 0||r.sessionId!==t)||(!n||!r.startedAt||!n.startedAt||r.startedAt>=n.startedAt)&&(n=r);return n?.removedBackend===void 0?void 0:n}function l(e){let t=o(e.steps),n=c(e.steps,t?.sessionId)?void 0:t;return{sessionId:n?.sessionId,backend:s(n,e),profileId:n?.profileId}}function u(e){return e.command===void 0&&e.kind!==`plugin`}function d(e){let t=e.workflowCursor?.mode===`resume`?e.workflowCursor.stepId:void 0;if(t&&e.steps.find(e=>e.id===t)?.status===`failed`)return t;let n=o(e.steps);if(n)return n.synthetic===`continuation`&&n.continuesStepId!==void 0?n.continuesStepId:e.steps.find(e=>e.sessionId===n.sessionId)?.id??n.id}function f(e,t=!1){if(e.delegation?.role!==`worker`)return;let n=e.workflowDef?.steps;if(!n?.length)return;if(t)return n.find(u);let r=d(e);return(r?n.find(e=>e.id===r&&u(e)):void 0)??[...n].reverse().find(u)}var p=new Set([`queued`,`running`,`waiting`]);function m(e){return p.has(e)}function h(e){return n(e)?!1:e.status===`queued`||e.status===`running`||e.status===`waiting`}function g(e){return h(e)&&e.status!==`queued`}function _(t,n,r){return t.archived||!(t.status===`done`||t.status===`failed`||t.status===`cancelled`)||t.delegation?.role===`worker`||r!==void 0&&e(t)!==r?!1:n===`unpinned`?!t.pinned:n!==`pinned`||t.pinned===!0}var v=[`done`,`failed`];function y(e){return e.archived||n(e)||!v.includes(e.status)?!1:e.finishedAt!==void 0}function b(e){let t=e.finishedAt;return t===void 0||!y(e)?!1:e.seenAt===void 0||e.seenAt<t}var x=[`Needs you`,`Finished`,`Working`,`Archived`],S={waiting:0,review:1,running:2,queued:4,done:5,failed:6,cancelled:7},C=3,w=e=>n(e)?C:S[e.status]??9;function T(e){let t=e=>a[r(e).bucket];return[...e].sort((e,n)=>t(e)-t(n)||w(e)-w(n))[0]}function E(e,t){return t===`archived`?`Archived`:i(e)?`Needs you`:e.status===`waiting`||e.status===`running`||e.status===`queued`?`Working`:`Finished`}function D(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function O(e){let t=/^(\d{1,9}): (.+)$/.exec(e),n=t?.[1],r=t?.[2];return n===void 0||r===void 0?{ref:null,rest:e}:{ref:Number(n),rest:r}}function k(e,t){return t!==void 0&&O(e).ref===t}function A(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt));return new Map(t.map((e,t)=>[e.id,t+1]))}function j(e,t){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,r)=>{if(t!==`archived`){let t=Number(!!r.pinned)-Number(!!e.pinned);if(t!==0)return t}let i=w(e)-w(r);if(i!==0)return i;if(n(e)&&n(r)){let t=e.autoResumeAt.localeCompare(r.autoResumeAt);if(t!==0)return t}return e.status===`queued`&&r.status===`queued`?e.createdAt.localeCompare(r.createdAt):r.createdAt.localeCompare(e.createdAt)})}function M(e){return e.delegation?.role===`worker`}function N(e,t){if(e==null)return null;let n=t.find(t=>t.id===e);return!n||!M(n)?e:n.delegation?.parentRunId??e}function P(e,t,n=A(e)){let r=j(e,t).filter(e=>!M(e)),i=new Map,a=(e,t)=>{let n=i.get(e);n?n.push(t):i.set(e,[t])};for(let e of r)a(E(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null});return x.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function F(e,n={}){let r=typeof n==`number`?{overall:n}:t(n),i={"Needs you":`needsYou`,Finished:`finished`,Working:`working`},a=[],o=r.overall===void 0?10:r.overall??1/0;for(let t of e){let e=t.label===`Archived`?1/0:r[i[t.label]]??1/0,n=t.rows.filter(n=>{let r=n.run.pinned;return t.label!==`Archived`&&r?!0:o<=0||e<=0?!1:(--o,--e,!0)});n.length&&a.push({label:t.label,rows:n})}return a}function I(e,t){if(t.length===0)return[...e];let n=new Set(e.map(e=>e.id)),r=new Set,i=t.filter(e=>n.has(e.id)||r.has(e.id)?!1:(r.add(e.id),!0));return[...e,...i]}function L(e){let t=0,n=0,r=0;for(let a of e)if(!M(a)){if(a.archived){n+=1;continue}t+=1,i(a)&&(r+=1)}return{active:t,archived:n,waiting:r}}function R(t,n,r){return t.filter(t=>!t.archived&&(!r||e(t)===(n===`automations`)))}var z={"Needs you":`needs-you`,Finished:`finished`,Working:`working`},B=Object.keys(z),V=`section`;function H(e,t,n){let r=`${V}=${z[e]}`;return n?`/?origin=${t===`automations`?`automations`:`direct`}&${r}`:`/?${r}`}function U(e){return B.find(t=>z[t]===e)??null}function W(t,n){let r={active:0,automations:0,activeWaiting:0,automationsWaiting:0};for(let a of t){if(M(a)||a.archived)continue;let t=+!!i(a);n&&e(a)?(r.automations+=1,r.automationsWaiting+=t):(r.active+=1,r.activeWaiting+=t)}return r}export{_ as C,s as D,o as E,f as O,g as S,l as T,O as _,P as a,h as b,T as c,k as d,D as f,R as g,W as h,F as i,U as l,N as m,V as n,M as o,H as p,B as r,L as s,x as t,A as u,I as v,b as w,m as x,y};
1
+ import"./queries-D9mg7sFY.js";import{Jn as e,mi as t,oi as n,si as r,ti as i,wr as a}from"./toaster-2ud_VdfV.js";import"./attention-C7BUdd2s.js";function o(e,t){let n;for(let r of e)!r.sessionId||r.id===t||(!n||!r.startedAt||!n.startedAt||r.startedAt>=n.startedAt)&&(n=r);return n}function s(e,t){return e?.backend??t?.runner??`claude`}function c(e,t){let n;for(let r of e)r.removedBackend===void 0&&(t===void 0||r.sessionId!==t)||(!n||!r.startedAt||!n.startedAt||r.startedAt>=n.startedAt)&&(n=r);return n?.removedBackend===void 0?void 0:n}function l(e){let t=o(e.steps),n=c(e.steps,t?.sessionId)?void 0:t;return{sessionId:n?.sessionId,backend:s(n,e),profileId:n?.profileId}}function u(e){return e.command===void 0&&e.kind!==`plugin`}function d(e){let t=e.workflowCursor?.mode===`resume`?e.workflowCursor.stepId:void 0;if(t&&e.steps.find(e=>e.id===t)?.status===`failed`)return t;let n=o(e.steps);if(n)return n.synthetic===`continuation`&&n.continuesStepId!==void 0?n.continuesStepId:e.steps.find(e=>e.sessionId===n.sessionId)?.id??n.id}function f(e,t=!1){if(e.delegation?.role!==`worker`)return;let n=e.workflowDef?.steps;if(!n?.length)return;if(t)return n.find(u);let r=d(e);return(r?n.find(e=>e.id===r&&u(e)):void 0)??[...n].reverse().find(u)}var p=new Set([`queued`,`running`,`waiting`]);function m(e){return p.has(e)}function h(e){return t(e)?!1:e.status===`queued`||e.status===`running`||e.status===`waiting`}function g(e){return h(e)&&e.status!==`queued`}function _(e,t,n){return e.archived||!(e.status===`done`||e.status===`failed`||e.status===`cancelled`)||e.delegation?.role===`worker`||n!==void 0&&a(e)!==n?!1:t===`unpinned`?!e.pinned:t!==`pinned`||e.pinned===!0}var v=[`done`,`failed`];function y(e){return e.archived||t(e)||!v.includes(e.status)?!1:e.finishedAt!==void 0}function b(e){let t=e.finishedAt;return t===void 0||!y(e)?!1:e.seenAt===void 0||e.seenAt<t}var x=[`Needs you`,`Finished`,`Working`,`Archived`],S={waiting:0,review:1,running:2,queued:4,done:5,failed:6,cancelled:7},C=3,w=e=>t(e)?C:S[e.status]??9;function T(e){let t=e=>i[n(e).bucket];return[...e].sort((e,n)=>t(e)-t(n)||w(e)-w(n))[0]}function E(e,t){return t===`archived`?`Archived`:r(e)?`Needs you`:e.status===`waiting`||e.status===`running`||e.status===`queued`?`Working`:`Finished`}function D(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function O(e){let t=/^(\d{1,9}): (.+)$/.exec(e),n=t?.[1],r=t?.[2];return n===void 0||r===void 0?{ref:null,rest:e}:{ref:Number(n),rest:r}}function k(e,t){return t!==void 0&&O(e).ref===t}function A(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt));return new Map(t.map((e,t)=>[e.id,t+1]))}function j(e,n){return e.filter(e=>n===`archived`?e.archived:!e.archived).sort((e,r)=>{if(n!==`archived`){let t=Number(!!r.pinned)-Number(!!e.pinned);if(t!==0)return t}let i=w(e)-w(r);if(i!==0)return i;if(t(e)&&t(r)){let t=e.autoResumeAt.localeCompare(r.autoResumeAt);if(t!==0)return t}return e.status===`queued`&&r.status===`queued`?e.createdAt.localeCompare(r.createdAt):r.createdAt.localeCompare(e.createdAt)})}function M(e){return e.delegation?.role===`worker`}function N(e,t){if(e==null)return null;let n=t.find(t=>t.id===e);return!n||!M(n)?e:n.delegation?.parentRunId??e}function P(e,t,n=A(e)){let r=j(e,t).filter(e=>!M(e)),i=new Map,a=(e,t)=>{let n=i.get(e);n?n.push(t):i.set(e,[t])};for(let e of r)a(E(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null});return x.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function F(t,n={}){let r=typeof n==`number`?{overall:n}:e(n),i={"Needs you":`needsYou`,Finished:`finished`,Working:`working`},a=[],o=r.overall===void 0?10:r.overall??1/0;for(let e of t){let t=e.label===`Archived`?1/0:r[i[e.label]]??1/0,n=e.rows.filter(n=>{let r=n.run.pinned;return e.label!==`Archived`&&r?!0:o<=0||t<=0?!1:(--o,--t,!0)});n.length&&a.push({label:e.label,rows:n})}return a}function I(e,t){if(t.length===0)return[...e];let n=new Set(e.map(e=>e.id)),r=new Set,i=t.filter(e=>n.has(e.id)||r.has(e.id)?!1:(r.add(e.id),!0));return[...e,...i]}function L(e){let t=0,n=0,i=0;for(let a of e)if(!M(a)){if(a.archived){n+=1;continue}t+=1,r(a)&&(i+=1)}return{active:t,archived:n,waiting:i}}function R(e,t,n){return e.filter(e=>!e.archived&&(!n||a(e)===(t===`automations`)))}var z={"Needs you":`needs-you`,Finished:`finished`,Working:`working`},B=Object.keys(z),V=`section`;function H(e,t,n){let r=`${V}=${z[e]}`;return n?`/?origin=${t===`automations`?`automations`:`direct`}&${r}`:`/?${r}`}function U(e){return B.find(t=>z[t]===e)??null}function W(e,t){let n={active:0,automations:0,activeWaiting:0,automationsWaiting:0};for(let i of e){if(M(i)||i.archived)continue;let e=+!!r(i);t&&a(i)?(n.automations+=1,n.automationsWaiting+=e):(n.active+=1,n.activeWaiting+=e)}return n}export{_ as C,s as D,o as E,f as O,g as S,l as T,O as _,P as a,h as b,T as c,k as d,D as f,R as g,W as h,F as i,U as l,N as m,V as n,M as o,H as p,B as r,L as s,x as t,A as u,I as v,b as w,m as x,y};