@hearsay-tools/squawk 0.18.0-pr4355.8520 → 0.18.0-pr4358.8529.2

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 (137) hide show
  1. package/dist/runners/claude/config-files.js +1 -1
  2. package/dist/runners/claude/config-files.js.map +1 -1
  3. package/dist/runners/pi/display.d.ts +1 -1
  4. package/dist/runners/pi/display.js +1 -1
  5. package/dist/server/server.d.ts +8 -8
  6. package/package.json +4 -4
  7. package/web/dist/assets/accounts-section-BQBCIvIe.js +1 -0
  8. package/web/dist/assets/activity-motion-BoUcFlcy.js +2 -0
  9. package/web/dist/assets/{activity-motion-0wHCeUs7.css → activity-motion-DcKVM8fM.css} +1 -1
  10. package/web/dist/assets/activity-route-dsZrLgOz.js +1 -0
  11. package/web/dist/assets/agent-config-section-8C_KG8qw.js +7 -0
  12. package/web/dist/assets/agent-defaults-section-Cpg6ytin.js +1 -0
  13. package/web/dist/assets/appearance-CujGGeIB.js +1 -0
  14. package/web/dist/assets/archive-on-merge-field-BKFGWhTW.js +1 -0
  15. package/web/dist/assets/automations-route-CcCP4L7S.js +2 -0
  16. package/web/dist/assets/automations-route-CutF-cGn.css +1 -0
  17. package/web/dist/assets/{badge-D9JrXe0o.js → badge-DQ3U69Ht.js} +1 -1
  18. package/web/dist/assets/{button-BQ2y4XRB.js → button-B7MKxYjT.js} +1 -1
  19. package/web/dist/assets/change-counts-CW7O8g5Y.js +1 -0
  20. package/web/dist/assets/check-OP-CVgZG.js +1 -0
  21. package/web/dist/assets/circle-x-7nTlobAF.js +1 -0
  22. package/web/dist/assets/{command-CDt1BsZy.js → command-KdW7aO0N.js} +1 -1
  23. package/web/dist/assets/commit-list-DaVNfLE5.js +1 -0
  24. package/web/dist/assets/{dialog-BVF6dIeS.js → dialog-B531GGAo.js} +1 -1
  25. package/web/dist/assets/diff-CCzM8XxZ.js +3 -0
  26. package/web/dist/assets/diff-controls-C0gH_nhG.js +1 -0
  27. package/web/dist/assets/diff-view-C8P6QDsN.js +11 -0
  28. package/web/dist/assets/dist-Czz3Y5qH.js +1 -0
  29. package/web/dist/assets/file-preview-UYewjhvt.js +2 -0
  30. package/web/dist/assets/{folder-browser-Bn83Rjyn.js → folder-browser-Dg4CmonF.js} +1 -1
  31. package/web/dist/assets/format-BU7D3IfE.js +1 -0
  32. package/web/dist/assets/git-toolbar-Icz0Cr21.js +1 -0
  33. package/web/dist/assets/github-nBa7OE-M.js +1 -0
  34. package/web/dist/assets/global-activity-route-NYRbJrma.js +1 -0
  35. package/web/dist/assets/hourglass-CikYdGGQ.js +1 -0
  36. package/web/dist/assets/image-preview-BuZ5gCX-.js +1 -0
  37. package/web/dist/assets/index-B_cJa9gM.css +1 -0
  38. package/web/dist/assets/index-C4gjdVLi.js +21 -0
  39. package/web/dist/assets/{label-tOtTf55G.js → label-D1xUdJjL.js} +1 -1
  40. package/web/dist/assets/live-refetch-1_o4J83F.js +1 -0
  41. package/web/dist/assets/loader-circle-CPBhhDbB.js +1 -0
  42. package/web/dist/assets/{markdown-BWdW9XRr.js → markdown-RK9z1Cn3.js} +1 -1
  43. package/web/dist/assets/{notifications-section-taTezn_8.js → notifications-section-CPqz7gvQ.js} +1 -1
  44. package/web/dist/assets/open-in-menu-D4ACqxcC.js +1 -0
  45. package/web/dist/assets/preview-pane-connected-Cc8MoILP.js +3 -0
  46. package/web/dist/assets/{project-location-C9WLgY3A.js → project-location-CDQm9Gul.js} +1 -1
  47. package/web/dist/assets/projects-section-ClAkyY7D.js +1 -0
  48. package/web/dist/assets/prompt-templates-section-U3HnlNQb.js +1 -0
  49. package/web/dist/assets/queries-BvWsZhaH.js +1 -0
  50. package/web/dist/assets/{reference-chip-zRuFkaGy.js → reference-chip-Clhghu8I.js} +1 -1
  51. package/web/dist/assets/{remote-settings-notice-D94MJpB5.js → remote-settings-notice-CJcE3lxR.js} +1 -1
  52. package/web/dist/assets/repo-git-CTIUcfsM.js +1 -0
  53. package/web/dist/assets/{report-reader-CJ6cp2kG.js → report-reader-BxaTkr-v.js} +1 -1
  54. package/web/dist/assets/reports-Bz9ZRI-7.js +1 -0
  55. package/web/dist/assets/reports-DjDzVB_M.css +1 -0
  56. package/web/dist/assets/resources-section-Dj1Bjzmf.js +1 -0
  57. package/web/dist/assets/run-header-BXQ-HR4O.js +2 -0
  58. package/web/dist/assets/{run-header-CC7VUTg9.css → run-header-Ccnr9k0X.css} +1 -1
  59. package/web/dist/assets/save-cue-Cd3ZAPBS.js +1 -0
  60. package/web/dist/assets/select-BhUI2GEt.js +1 -0
  61. package/web/dist/assets/{session-context-section-DLsDHuRy.js → session-context-section-DcCwhluX.js} +2 -2
  62. package/web/dist/assets/settings-agent-picker-BdABOxwW.js +1 -0
  63. package/web/dist/assets/settings-field-DP9sYv5a.js +1 -0
  64. package/web/dist/assets/settings-select-CCIMGnyA.js +1 -0
  65. package/web/dist/assets/settings-shell-BUJWIyf6.js +1 -0
  66. package/web/dist/assets/settings-shell-iSd4xMWS.css +1 -0
  67. package/web/dist/assets/{sidebar-section-CVy7g4_W.js → sidebar-section-C-CH38q4.js} +1 -1
  68. package/web/dist/assets/skills-Be22BJDw.js +1 -0
  69. package/web/dist/assets/{status-dot-DtAOFiIi.js → status-dot-BRzVlF2X.js} +1 -1
  70. package/web/dist/assets/switch-SP8pw5uU.js +1 -0
  71. package/web/dist/assets/task-changes-D7ezDVM5.js +1 -0
  72. package/web/dist/assets/task-commits-DxjVd56-.js +1 -0
  73. package/web/dist/assets/task-files-CVcyteyQ.js +1 -0
  74. package/web/dist/assets/{task-github-item-CWb8Loh2.js → task-github-item-Bw46CXoB.js} +1 -1
  75. package/web/dist/assets/{task-groups-ClNnAPRA.js → task-groups-fk4Gq4hX.js} +1 -1
  76. package/web/dist/assets/task-thread-cVekDQbH.js +9 -0
  77. package/web/dist/assets/task-thread-nVvn3n6d.css +1 -0
  78. package/web/dist/assets/{tasks-table-CE_VVk0w.js → tasks-table-JFvtNCc1.js} +1 -1
  79. package/web/dist/assets/thread-state-DU6osVw_.js +4 -0
  80. package/web/dist/assets/use-hand-to-agent-state-B6h6kcQg.css +1 -0
  81. package/web/dist/assets/use-hand-to-agent-state-C0vpMYLO.js +1 -0
  82. package/web/dist/assets/workflows-C6suai0L.css +1 -0
  83. package/web/dist/assets/workflows-CsB1csR4.js +7 -0
  84. package/web/dist/assets/workspace-tools-BXxPB3zi.js +1 -0
  85. package/web/dist/assets/worktrees-section-BNnScarl.js +4 -0
  86. package/web/dist/index.html +21 -19
  87. package/web/dist/assets/accounts-section-D0y3orCa.js +0 -1
  88. package/web/dist/assets/activity-motion-CFeIt-pC.js +0 -2
  89. package/web/dist/assets/activity-route-BVbWS5Q5.js +0 -1
  90. package/web/dist/assets/agent-config-section-COtfc6N7.js +0 -1
  91. package/web/dist/assets/agent-defaults-section-B--HJaZT.js +0 -1
  92. package/web/dist/assets/appearance-CHIIs31D.js +0 -1
  93. package/web/dist/assets/archive-on-merge-field-CEyCpweg.js +0 -1
  94. package/web/dist/assets/automations-route-Bp4kXc55.js +0 -1
  95. package/web/dist/assets/commit-diff-panel-CDcHiHON.js +0 -1
  96. package/web/dist/assets/diff-Dm2WIoEL.js +0 -3
  97. package/web/dist/assets/diff-controls-BSWICnsb.js +0 -1
  98. package/web/dist/assets/diff-view-C43jYPPE.js +0 -11
  99. package/web/dist/assets/dist-C28wFbz0.js +0 -1
  100. package/web/dist/assets/file-preview-LlYpNJFW.js +0 -2
  101. package/web/dist/assets/format-BNCkW110.js +0 -1
  102. package/web/dist/assets/git-toolbar-CWfJ9oU_.js +0 -1
  103. package/web/dist/assets/github-BziZeaWA.js +0 -1
  104. package/web/dist/assets/global-activity-route-CZt_UpfZ.js +0 -1
  105. package/web/dist/assets/hourglass-B0lPAJvT.js +0 -1
  106. package/web/dist/assets/image-preview-CNBuRrK5.js +0 -1
  107. package/web/dist/assets/index-2DP8fWMQ.css +0 -1
  108. package/web/dist/assets/index-DpGDjVpg.js +0 -21
  109. package/web/dist/assets/live-refetch-CZb2VOyu.js +0 -1
  110. package/web/dist/assets/open-in-menu-xzDJ4_Tv.js +0 -1
  111. package/web/dist/assets/preview-pane-connected-CB4hFcz8.js +0 -3
  112. package/web/dist/assets/projects-section-laTG394n.js +0 -1
  113. package/web/dist/assets/prompt-templates-section-DPUJ8_cS.js +0 -1
  114. package/web/dist/assets/queries-DRpvYgai.js +0 -1
  115. package/web/dist/assets/repo-git-G3ku9G_N.js +0 -1
  116. package/web/dist/assets/reports-B7QAzibP.css +0 -1
  117. package/web/dist/assets/reports-CWTw3eQX.js +0 -1
  118. package/web/dist/assets/resources-section-CO2A8gbs.js +0 -1
  119. package/web/dist/assets/run-header-BqoJkEiw.js +0 -2
  120. package/web/dist/assets/settings-agent-picker-CAkQQ44N.js +0 -1
  121. package/web/dist/assets/settings-field-Bl6WuvGX.js +0 -1
  122. package/web/dist/assets/settings-shell-B7pg-fwi.js +0 -1
  123. package/web/dist/assets/settings-shell-xK8txSJo.css +0 -1
  124. package/web/dist/assets/skills-Ca0Mt5pt.js +0 -1
  125. package/web/dist/assets/switch-Bv2Zf1uU.js +0 -1
  126. package/web/dist/assets/task-changes-UGkjb4wT.js +0 -1
  127. package/web/dist/assets/task-commits-CfEQc81X.js +0 -1
  128. package/web/dist/assets/task-files-2W_kt5bL.js +0 -1
  129. package/web/dist/assets/task-thread-DtQ6uGfQ.css +0 -1
  130. package/web/dist/assets/task-thread-YdiWnqlo.js +0 -9
  131. package/web/dist/assets/thread-state-0FhmMvvC.js +0 -4
  132. package/web/dist/assets/use-hand-to-agent-state-C7esPJ-N.css +0 -1
  133. package/web/dist/assets/use-hand-to-agent-state-D2K59hO0.js +0 -1
  134. package/web/dist/assets/workflows-C21NystW.css +0 -1
  135. package/web/dist/assets/workflows-DxMmoBEB.js +0 -7
  136. package/web/dist/assets/workspace-tools-DZOAAbLs.js +0 -1
  137. package/web/dist/assets/worktrees-section-B2BoNa7k.js +0 -4
@@ -0,0 +1 @@
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";var t=e(),n=`text-xs font-medium text-foreground`;function r({title:e,hint:n,children:r}){return(0,t.jsxs)(`section`,{className:`settings-field flex flex-col gap-2`,children:[(0,t.jsxs)(`div`,{children:[(0,t.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:e}),(0,t.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:n})]}),r]})}export{r as n,n as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DSMR_WLb.js";import{l as n}from"./design-icons-CzEoMH9c.js";var r=e();function i({className:e,children:i,...a}){return(0,r.jsxs)(`span`,{"data-slot":`settings-select`,className:`settings-select relative inline-block w-fit min-w-0 max-w-full align-middle`,children:[(0,r.jsx)(`select`,{...a,className:t(`appearance-none pr-8 max-w-full`,e),children:i}),(0,r.jsx)(n,{"aria-hidden":`true`,className:`pointer-events-none absolute right-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`})]})}export{i as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{En as r,Sn as i,Tn as a,bn as o,xn as s}from"./project-scope-context-C912rTJP.js";import{Ft as c,Ot as l,Pt as u,ht as d,jt as f,xt as p}from"./queries-BvWsZhaH.js";import{n as m,p as h,r as g}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as _}from"./toaster-Bo5vCbz-.js";import{l as v,u as y}from"./design-icons-CzEoMH9c.js";import{t as b}from"./plus-CxRU2X8C.js";import{t as x}from"./button-B7MKxYjT.js";import{n as ee,r as te,t as ne}from"./collapsible-BEV4FO-1.js";import{r as S}from"./switch-SP8pw5uU.js";import{t as C}from"./badge-DQ3U69Ht.js";import{n as w,s as T,t as E}from"./project-router-DucFIl_x.js";import"./attention-BFUaj1mU.js";import{Bn as D,Wn as O,dt as re,ft as k,gn as A,pt as j,z as M}from"./index-C4gjdVLi.js";import{t as ie}from"./textarea-vJt9undk.js";import{n as ae,t as oe}from"./saved-draft-BwzBc-_Y.js";import{ArchiveOnMergeField as se}from"./archive-on-merge-field-BKFGWhTW.js";import{a as ce,i as le,n as ue,t as de}from"./projects-section-ClAkyY7D.js";import{n as N}from"./settings-field-DP9sYv5a.js";import{t as fe}from"./project-location-CDQm9Gul.js";var P=e(t(),1),F={"needs-you":{label:`Needs you`,hint:`Asks a question, asks for permission, or waits for review`},failed:{label:`Failed`,hint:`Failed, with no scheduled resume`},done:{label:`Done`,hint:`Finished`},cancelled:{label:`Cancelled`,hint:`Was cancelled`},running:{label:`Running`,hint:`Runs an agent turn`},"waiting-workers":{label:`Waiting for agents`,hint:`Waits on its workers or their replies`},"waiting-ci":{label:`Waiting on CI`,hint:`Waits on a pull request's checks`},"waiting-timer":{label:`Waiting`,hint:`Waits on a timer`},"waiting-other":{label:`Any other wait`,hint:`Waits on anything else, including wait types added later`}},I=(e,t)=>e.length===t.length&&e.every(e=>t.includes(e)),L={name:``,description:``,url:``,token:``,tasks:!0,triggers:a,agent:!1};function R(e){return{name:e.name,description:e.description??``,url:e.url,token:``,tasks:e.tasks,triggers:e.triggers??a,agent:e.agent}}var z=e=>r.filter(t=>e.includes(t));function B(e){let t=e.description.trim();return{name:e.name.trim(),url:e.url.trim(),...t?{description:t}:{},...e.token?{token:e.token}:{},tasks:e.tasks,...I(e.triggers,a)?{}:{triggers:z(e.triggers)},agent:e.agent}}function pe(e){return e.name.trim()!==``||e.description.trim()!==``||e.url.trim()!==``||e.token!==``||e.tasks!==L.tasks||e.agent!==L.agent||!I(e.triggers,L.triggers)}function me(e,t){let n={},r=e.name.trim(),i=e.description.trim(),o=e.url.trim();return r!==t.name&&(n.name=r),i!==(t.description??``)&&(n.description=i),o!==t.url&&(n.url=o),e.token&&(n.token=e.token),e.tasks!==t.tasks&&(n.tasks=e.tasks),I(e.triggers,t.triggers??a)||(n.triggers=z(e.triggers)),e.agent!==t.agent&&(n.agent=e.agent),n}var V=n(),H=`flex flex-col gap-1 text-[13px]`,U=`text-[11px] text-muted-foreground`;function W({draft:e,onChange:t,tokenSet:n}){let a=(0,P.useId)(),c=(0,P.useId)(),l=(0,P.useId)(),u=(0,P.useId)(),d=(0,P.useId)(),f=(0,P.useId)(),p=(0,P.useId)(),m=(0,P.useId)(),h=(0,P.useId)(),g=(0,P.useId)();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(min(100%,14rem),1fr))] gap-3`,children:[(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:a,className:U,children:`Name`}),(0,V.jsx)(O,{id:a,"data-slot":`webhook-name`,autoComplete:`off`,maxLength:80,placeholder:`e.g. Team bot`,value:e.name,onChange:e=>t({name:e.target.value})})]}),(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:u,className:U,children:`URL`}),(0,V.jsx)(O,{id:u,"data-slot":`webhook-url`,type:`url`,inputMode:`url`,autoComplete:`off`,spellCheck:!1,maxLength:i,placeholder:`https://bot.example/hooks/cez`,value:e.url,onChange:e=>t({url:e.target.value})})]})]}),(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:c,className:U,children:`Description`}),(0,V.jsx)(ie,{id:c,"data-slot":`webhook-description`,"aria-describedby":l,rows:2,maxLength:o,placeholder:`e.g. Posts to the #releases channel. Use it for release notes.`,value:e.description,onChange:e=>t({description:e.target.value})}),(0,V.jsx)(`span`,{id:l,className:`text-[11px] text-soft-foreground`,children:`Agents read the name and description to decide when to use this webhook.`})]}),(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:d,className:U,children:`Token`}),(0,V.jsx)(O,{id:d,"data-slot":`webhook-token`,type:`password`,autoComplete:`new-password`,spellCheck:!1,maxLength:s,"aria-describedby":f,placeholder:n?`Token set — type to replace`:`Optional Bearer token`,value:e.token,onChange:e=>t({token:e.target.value})}),(0,V.jsx)(`span`,{id:f,className:`text-[11px] text-soft-foreground`,children:n?`The token is stored in ~/.cezar and never shown again. Leave it empty to keep it.`:`The token is stored in ~/.cezar, never in the repo. It is sent as a Bearer header.`})]}),(0,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3`,children:[(0,V.jsx)(S,{id:p,"aria-describedby":m,"data-slot":`webhook-tasks`,checked:e.tasks,onCheckedChange:e=>t({tasks:e})}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col text-[13px]`,children:[(0,V.jsx)(`label`,{htmlFor:p,className:`font-medium`,children:`Task notifications`}),(0,V.jsx)(`span`,{id:m,className:`text-[11px] text-soft-foreground`,children:`Tasks you hand off, or start with notify on, send their status here.`})]})]}),e.tasks?(0,V.jsxs)(`fieldset`,{"data-slot":`webhook-triggers`,className:`flex flex-col gap-1 sm:ps-[3.25rem]`,children:[(0,V.jsx)(`legend`,{className:`pbe-1 text-[11px] text-muted-foreground`,children:`Send a delivery when a task enters`}),(0,V.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(min(100%,15rem),1fr))] gap-x-3`,children:r.map(n=>(0,V.jsxs)(`label`,{className:`flex min-h-11 items-start gap-2.5 pbs-2 text-[13px]`,children:[(0,V.jsx)(`input`,{type:`checkbox`,"data-trigger":n,checked:e.triggers.includes(n),onChange:r=>t({triggers:r.target.checked?[...e.triggers,n]:e.triggers.filter(e=>e!==n)}),className:`mbs-0.5 size-[18px] shrink-0`}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:F[n].label}),(0,V.jsx)(`span`,{className:`text-[11px] text-soft-foreground`,children:F[n].hint})]})]},n))}),(0,V.jsx)(`p`,{className:`text-[11px] text-soft-foreground`,children:`Handing a task off and Send test always deliver.`})]}):null]}),(0,V.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3`,children:[(0,V.jsx)(S,{id:h,"aria-describedby":g,"data-slot":`webhook-agent`,checked:e.agent,onCheckedChange:e=>t({agent:e})}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col text-[13px]`,children:[(0,V.jsx)(`label`,{htmlFor:h,className:`font-medium`,children:`Let agents send reports`}),(0,V.jsx)(`span`,{id:g,className:`text-[11px] text-soft-foreground`,children:`Agents in this project may post a report here when the task calls for it.`})]})]})]})}var G=`max-sm:h-11`,K=(e,t)=>({tone:`alert`,text:`Not saved: ${e.message}. Fix the field and select ${t} again.`}),he=e=>e.dryRun?{tone:`ok`,text:`Dry run: nothing was sent.`}:e.ok?{tone:`ok`,text:`Delivered (HTTP ${e.status??200}).`}:{tone:`danger`,text:`Not delivered: ${e.error??`unknown error`}.`};function q({feedback:e}){return e?(0,V.jsx)(`p`,{"data-slot":e.tone===`alert`?`webhook-error`:`webhook-result`,role:e.tone===`alert`?`alert`:`status`,className:e.tone===`ok`?`text-[13px] text-muted-foreground`:`text-[13px] text-danger`,children:e.text}):null}var J=`rounded-md border border-border bg-background`,Y=`flex flex-col gap-3 border-bs border-border p-3`;function ge({projectId:e,webhook:t,defaultOpen:n=!1}){let r=u(),i=l(),a=f(),[o,s]=(0,P.useState)(n),[c,d]=ae(R(t),oe),[p,m]=(0,P.useState)(null),h=me(c,t),g=Object.keys(h).length>0;A(g);let y=c.name.trim()!==``&&c.url.trim()!==``,b=r.isPending||i.isPending||a.isPending,S={projectId:e,webhookId:t.id},w=e=>r.mutate({...S,...h},{onSuccess:()=>{d(e=>({...e,token:``})),e?e():_(`${c.name.trim()} saved`)},onError:e=>m(K(e,`Save`))}),T=()=>a.mutate(S,{onSuccess:e=>m(he(e)),onError:e=>m({tone:`danger`,text:e.message})});return(0,V.jsx)(`li`,{"data-slot":`webhook-card`,"data-webhook-id":t.id,className:J,children:(0,V.jsxs)(ne,{open:o,onOpenChange:s,children:[(0,V.jsx)(te,{asChild:!0,children:(0,V.jsxs)(`button`,{type:`button`,"data-action":`webhook-toggle`,className:`group flex min-h-11 w-full items-center gap-3 rounded-md p-3 text-start focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-foreground pointer-hover:bg-muted/50 active:bg-muted/50`,children:[(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,V.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,V.jsx)(`span`,{"data-slot":`webhook-card-name`,className:`min-w-0 break-words text-[13px] font-medium`,children:t.name}),t.tasks?(0,V.jsx)(C,{variant:`secondary`,"data-badge":`tasks`,children:`Task notifications`}):null,t.agent?(0,V.jsx)(C,{variant:`secondary`,"data-badge":`agent`,children:`Agents`}):null]}),(0,V.jsx)(`span`,{"data-slot":`webhook-card-url`,className:`truncate text-[12px] text-muted-foreground`,children:M(t.url)})]}),(0,V.jsx)(v,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground group-data-[state=open]:rotate-180`})]})}),(0,V.jsx)(ee,{children:(0,V.jsxs)(`form`,{"data-slot":`webhook-form`,"data-reports-dirty":``,className:Y,onSubmit:e=>{e.preventDefault(),m(null),y&&g&&w()},children:[(0,V.jsx)(W,{draft:c,tokenSet:t.tokenSet,onChange:e=>d(t=>({...t,...e}))}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(x,{type:`submit`,size:`sm`,className:G,"data-action":`webhook-save`,disabled:b||!y||!g,children:`Save`}),(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`outline`,"data-action":`webhook-test`,disabled:b||!y,onClick:()=>{m(null),g?w(T):T()},children:`Send test`}),t.tokenSet?(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`ghost`,"data-action":`webhook-clear-token`,disabled:b,onClick:()=>r.mutate({...S,token:``},{onSuccess:()=>_(`Webhook token cleared`),onError:e=>m({tone:`danger`,text:`Token not cleared: ${e.message}.`})}),children:`Clear token`}):null,(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`danger-ghost`,"data-action":`webhook-remove`,"aria-label":`Remove ${t.name}`,disabled:b,onClick:()=>i.mutate(S,{onSuccess:()=>_(`${t.name} removed`),onError:e=>m({tone:`danger`,text:`Not removed: ${e.message}.`})}),children:`Remove`})]}),(0,V.jsx)(q,{feedback:p})]})})]})})}function _e({projectId:e,onCreated:t,onCancel:n}){let r=d(),[i,a]=(0,P.useState)(L),[o,s]=(0,P.useState)(null),c=i.name.trim()!==``&&i.url.trim()!==``;return A(pe(i)),(0,V.jsxs)(`li`,{"data-slot":`webhook-card`,"data-draft":``,className:J,children:[(0,V.jsx)(`p`,{className:`p-3 text-[13px] font-medium`,children:`New webhook`}),(0,V.jsxs)(`form`,{"data-slot":`webhook-form`,"data-reports-dirty":``,"aria-label":`New webhook`,className:Y,onSubmit:n=>{n.preventDefault(),s(null),c&&r.mutate({projectId:e,...B(i)},{onSuccess:({webhook:e})=>{_(`${e.name} created`),t(e)},onError:e=>s(K(e,`Create`))})},children:[(0,V.jsx)(W,{draft:i,tokenSet:!1,onChange:e=>a(t=>({...t,...e}))}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(x,{type:`submit`,size:`sm`,className:G,"data-action":`webhook-create`,disabled:r.isPending||!c,children:`Create`}),(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`ghost`,"data-action":`webhook-cancel`,disabled:r.isPending,onClick:n,children:`Cancel`})]}),(0,V.jsx)(q,{feedback:o})]})]})}function ve({project:e}){let t=e.webhooks??[],[n,r]=(0,P.useState)(!1),[i,a]=(0,P.useState)(null),o=t.length>=16;return(0,V.jsx)(N,{title:`Webhooks`,hint:`A webhook gets a POST from Squawk. Tasks can send their status to it, and agents can send it reports.`,children:(0,V.jsxs)(`div`,{"data-slot":`project-webhooks`,className:`flex flex-col gap-3`,children:[t.length===0&&!n?(0,V.jsx)(`p`,{"data-slot":`webhooks-empty`,className:`text-[13px] text-soft-foreground`,children:`No webhooks yet. Add one to send task updates to a bot, or to let agents post reports.`}):null,t.length>0||n?(0,V.jsxs)(`ul`,{className:`flex flex-col gap-2`,children:[t.map(t=>(0,V.jsx)(ge,{projectId:e.id,webhook:t,defaultOpen:t.id===i},t.id)),n?(0,V.jsx)(_e,{projectId:e.id,onCancel:()=>r(!1),onCreated:e=>{a(e.id),r(!1)}}):null]}):null,n?null:(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(x,{type:`button`,size:`sm`,variant:`outline`,className:`max-sm:h-11`,"data-action":`webhook-add`,disabled:o,onClick:()=>r(!0),children:[(0,V.jsx)(b,{"aria-hidden":`true`}),`Add webhook`]}),o?(0,V.jsxs)(`span`,{className:`text-[11px] text-soft-foreground`,children:[`A project holds at most `,16,` webhooks.`]}):null]})]})})}function X(e){let t=new Date(e);return Number.isNaN(t.getTime())?`—`:t.toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`})}function Z(){let e=T(),t=p(),n=c();if(t.isPending)return(0,V.jsx)(`p`,{"data-slot":`project-general-loading`,className:`text-[13px] text-soft-foreground`,children:`Loading project…`});if(t.isError)return(0,V.jsxs)(`p`,{"data-slot":`project-general-error`,className:`text-[13px] text-danger`,children:[`Could not read the project registry — `,t.error.message]});let r=t.data,i=r?.projects.find(t=>t.id===e);return!r||!i?null:(0,V.jsxs)(`div`,{"data-slot":`project-general`,className:`flex w-full flex-col gap-5`,children:[(0,V.jsxs)(`section`,{className:`flex flex-col gap-5 rounded-lg border border-border bg-card p-5 [&_select]:min-h-11 [&_select]:w-full`,children:[(0,V.jsx)(`h2`,{className:`text-lg font-semibold`,children:`General`}),(0,V.jsx)(fe,{}),(0,V.jsx)(ye,{project:i}),(0,V.jsx)(N,{title:`Max parallel tasks`,hint:n.data?`The workspace limit (${n.data.resources.maxParallel}) still applies as an overall ceiling.`:`How many of this project's tasks may run at once. The workspace limit still applies as an overall ceiling.`,children:n.data?(0,V.jsx)(de,{project:i,workspaceMax:n.data.resources.maxParallel}):(0,V.jsx)(`p`,{className:`text-[13px] text-soft-foreground`,children:`Loading the workspace limit…`})}),(0,V.jsx)(ve,{project:i},i.id)]}),(0,V.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-5`,children:(0,V.jsx)(be,{project:i,bootProject:r.bootProject})})]})}function ye({project:e}){return(0,V.jsxs)(`dl`,{"data-slot":`project-facts`,className:`grid grid-cols-1 gap-4 text-[13px] sm:grid-cols-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Project`}),(0,V.jsx)(`dd`,{className:`mt-1 font-medium`,children:e.name})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Branch`}),(0,V.jsx)(`dd`,{className:`mt-1 break-all`,children:e.branch??`—`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Status`}),(0,V.jsxs)(`dd`,{"data-slot":`project-general-status`,className:e.status===`missing`?`mt-1 text-danger`:`mt-1`,children:[ue[e.status],e.status===`missing`?` — remove it below, or restore the folder`:null]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Added`}),(0,V.jsxs)(`dd`,{className:`mt-1`,children:[X(e.addedAt),(0,V.jsx)(`span`,{className:`text-soft-foreground`,children:e.source===`checkout`?` · cloned from GitHub`:` · opened locally`})]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Last opened`}),(0,V.jsx)(`dd`,{className:`mt-1`,children:X(e.lastOpenedAt)})]})]})}function be({project:e,bootProject:t}){let[n,r]=(0,P.useState)(null),i=ce(),a=h(),o=e.id===t;return(0,V.jsxs)(N,{title:`Remove from workspace`,hint:`Unregisters this project so it leaves the sidebar and the project list. Nothing on disk is deleted — the folder, its git history and its task history all stay, and opening it again re-registers it.`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsxs)(x,{type:`button`,variant:`outline`,size:`sm`,"data-action":`project-general-remove`,"aria-label":`Remove ${e.name} from the workspace — unregisters it, no files are deleted`,title:o?`Squawk is serving this project — it re-registers itself at every start`:void 0,disabled:o||i.isPending,onClick:()=>r(e),className:`text-danger`,children:[`Remove `,e.name]}),o?(0,V.jsx)(`span`,{"data-slot":`project-general-remove-boot`,className:`text-xs text-soft-foreground`,children:`Squawk is serving this project — it re-registers itself at every start.`}):null]}),(0,V.jsx)(le,{project:n,onOpenChange:e=>!e&&r(null),onConfirm:()=>{r(null),i.confirm(e,()=>void a(`/p/${encodeURIComponent(t)}`))}})]})}function xe(e){return e===`global`?{Link:m,NavLink:g}:{Link:E,NavLink:w}}function Q({scope:e,title:t,mobileTitle:n,description:r}){let i=D().name,a=e===`global`?`every project`:i??`this project`;return(0,V.jsxs)(`header`,{"data-slot":`settings-main-header`,className:`settings-route-header flex shrink-0 flex-col md:px-9 px-4 pt-7 pb-5`,children:[(0,V.jsxs)(`h1`,{className:`font-semibold tracking-tight leading-[1.2] text-foreground`,children:[(0,V.jsx)(`span`,{className:`md:hidden`,children:n}),(0,V.jsxs)(`span`,{className:`max-md:hidden`,children:[t,` `,(0,V.jsxs)(`span`,{className:`font-normal text-soft-foreground`,children:[`· `,a]})]})]}),(0,V.jsx)(`span`,{"data-slot":`settings-mobile-scope`,className:`mt-1 text-[13px] text-muted-foreground md:hidden`,children:e===`global`?`Applies to every project`:a}),r?(0,V.jsx)(`p`,{className:`mt-1 max-md:hidden text-[13px] text-muted-foreground`,children:r}):null,e===`global`?(0,V.jsx)(`span`,{"data-slot":`settings-scope-chip`,className:`sr-only`,children:`Global settings`}):null]})}function $({scope:e,activeId:t}){let{NavLink:n}=xe(e),r=j(e);return(0,V.jsxs)(`details`,{className:`settings-section-picker md:hidden`,children:[(0,V.jsxs)(`summary`,{children:[r.find(e=>e.id===t)?.title??`General`,(0,V.jsx)(v,{"aria-hidden":`true`,className:`size-5 text-muted-foreground`})]}),(0,V.jsxs)(`nav`,{"aria-label":`Settings sections`,"data-slot":`settings-nav-mobile`,"data-scope":e,children:[e===`project`?(0,V.jsx)(n,{to:`/settings`,end:!0,"data-slot":`settings-nav-index`,children:`General`}):null,r.map(t=>(0,V.jsx)(n,{to:k(e,t.id),"data-section":t.id,children:t.title},t.id))]})]},`${e}-${t}`)}function Se({section:e,scope:t}){let n=e.component;return(0,V.jsxs)(`div`,{"data-route":t===`global`?`settings-global-${e.id}`:`settings-${e.id}`,className:`settings-route flex min-h-full w-full flex-col`,children:[(0,V.jsx)(Q,{scope:t,title:e.title,description:e.description,mobileTitle:t===`global`?`Global settings`:`Project settings`}),(0,V.jsxs)(`div`,{className:`settings-route-body flex min-w-0 flex-1 flex-col md:flex-row`,children:[(0,V.jsxs)(`div`,{"data-slot":`settings-mobile-section`,className:`flex flex-col gap-2 md:hidden`,children:[(0,V.jsx)($,{scope:t,activeId:e.id}),e.description?(0,V.jsx)(`p`,{"data-slot":`settings-mobile-section-subtitle`,className:`px-1 text-[13px] leading-normal text-muted-foreground`,children:e.description}):null]}),(0,V.jsxs)(`section`,{className:`settings-panel min-w-0 self-start md:flex-1`,"aria-label":e.title,children:[(0,V.jsx)(`h2`,{className:`settings-panel-title sr-only`,children:e.title}),(0,V.jsx)(n,{})]})]})]})}function Ce(){return(0,V.jsxs)(`div`,{"data-route":`settings`,className:`settings-route flex min-h-full w-full flex-col`,children:[(0,V.jsx)(Q,{scope:`project`,title:`General`,mobileTitle:`Project settings`}),(0,V.jsxs)(`div`,{className:`settings-route-body flex min-w-0 flex-1 flex-col md:flex-row`,children:[(0,V.jsx)($,{scope:`project`,activeId:null}),(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-5`,children:[(0,V.jsx)(Z,{}),(0,V.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-5`,children:(0,V.jsx)(se,{})}),(0,V.jsx)(`h2`,{className:`settings-other-title mt-6 rounded-t-lg border border-b-0 border-border bg-card px-5 pt-5 text-base font-semibold md:hidden`,children:`Other project settings`}),(0,V.jsx)(`ul`,{"data-slot":`settings-index`,className:`mt-7 flex w-full flex-col gap-5 md:hidden`,children:j(`project`).map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(E,{to:k(`project`,e.id),"data-section":e.id,className:`flex items-center gap-3.5 rounded-lg border border-border bg-card p-4 transition-colors hover:bg-card-2`,children:[(0,V.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center text-accent-text`,children:(0,V.jsx)(e.icon,{"aria-hidden":`true`,className:`size-4`})}),(0,V.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:e.title}),(0,V.jsx)(`span`,{className:`block text-xs text-soft-foreground`,children:e.description})]}),(0,V.jsx)(y,{"aria-hidden":`true`,className:`size-4 shrink-0 text-soft-foreground`})]})},e.id))}),(0,V.jsxs)(`p`,{className:`mt-5 w-full text-[12px] text-soft-foreground`,children:[`Appearance, notifications, host resources and the project registry live in`,` `,(0,V.jsx)(m,{to:re,"data-slot":`settings-global-link`,className:`underline underline-offset-2 hover:text-foreground`,children:`Global settings`}),`.`]})]})]})]})}export{Ce as SettingsIndexRoute,Se as SettingsSectionRoute};
@@ -0,0 +1 @@
1
+ .settings-panel{border:1px solid var(--border);background:var(--card);border-radius:12px;width:100%;padding:24px}.settings-panel>[data-slot]{width:100%;max-width:none;margin:0;padding:0}.settings-panel .settings-field+.settings-field{border-block-start:1px solid var(--border);padding-block-start:22px}.settings-panel .settings-field h2{font-size:14px;font-weight:400}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),select,textarea:not([data-slot=code-editor-input])){background:var(--background);min-width:0;max-width:100%;min-height:44px;box-shadow:none;font-size:13px}.settings-panel .settings-field>:is(input,select,textarea:not([data-slot=code-editor-input])),.settings-panel .settings-field>.settings-select,.settings-panel .settings-field>.settings-select>select,.settings-panel [data-slot=agents-default-runner],.settings-panel [data-slot=projects-browse-root],.settings-panel [data-slot=projects-checkout-root]{width:100%;max-width:none}.settings-panel button:not([role=switch]):not([data-slot=project-tag-suggestion]){min-height:40px}.settings-panel [data-slot=resources-composer-defaults]{grid-template-columns:1fr;gap:24px}.settings-panel [data-slot=prompt-template-row]{border:1px solid var(--border);background:0 0;border-radius:8px;gap:6px;margin-block-end:0;padding:12px 14px}.settings-panel [data-slot=prompt-template-new]{border:0;border-block-end:1px solid var(--border);border-radius:0;gap:12px;padding-block:20px;padding-inline:0}.settings-panel [data-slot=agent-config-agents]{background:color-mix(in oklch, var(--muted) 60%, transparent);border:1px solid var(--border);border-radius:8px;gap:4px;width:fit-content;max-width:100%;padding:4px}.settings-panel [data-slot=agent-config-agent]{border:1px solid #0000}.settings-panel [data-slot=agent-config-agent][aria-selected=true]{background:var(--card);border-color:var(--border);color:var(--foreground);box-shadow:var(--shadow-xs)}.settings-panel [data-slot=projects-section] table{display:block}.settings-panel [data-slot=projects-section] :is(tbody,tr){min-width:0;display:grid}.settings-panel [data-slot=projects-section] thead{clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}.settings-panel [data-slot=projects-section] colgroup{display:none}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row]){gap:8px;padding-block:16px;padding-inline:0}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>:is(th,td){text-align:start;width:100%;min-width:0;max-width:none;padding-block:0;padding-inline:12px;display:block}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row]) .truncate{white-space:normal;overflow-wrap:anywhere}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row]) td:last-child{border-block-start:1px solid var(--border);padding-block-start:12px}:is(.settings-panel .settings-field:has([data-slot=resources-auto-resume]),.settings-panel .settings-field:has([data-slot=resources-monitoring-wake-mode])){position:relative}:is(.settings-panel .settings-field:has([data-slot=resources-auto-resume])>div:first-child,.settings-panel .settings-field:has([data-slot=resources-monitoring-wake-mode])>div:first-child){padding-inline-end:60px}.settings-panel [data-slot=resources-auto-resume],.settings-panel [data-slot=resources-monitoring-wake-mode]{position:absolute;inset-block-start:24px;inset-inline-end:0}.settings-panel [data-slot=agent-config-group] ul{flex-direction:column;gap:6px}.settings-panel [data-slot=agent-config-file]{border:1px solid var(--border);width:100%;color:var(--foreground);padding-block:10px;padding-inline:12px}.settings-panel [data-slot=agent-config-file][data-selected=true]{border-color:var(--accent-strong);color:var(--accent-text)}.settings-route{gap:0;padding:0}.settings-route-header{gap:0}.settings-route-body{gap:24px;width:100%;max-width:56rem;padding-block:8px 28px;padding-inline:36px}.settings-route[data-route=settings-agent-config] .settings-route-body{max-width:none}.settings-section-picker{border:1px solid var(--border);background:var(--card);border-radius:8px;width:100%;position:relative}.settings-section-picker summary{cursor:pointer;justify-content:space-between;align-items:center;min-height:48px;padding-block:12px;padding-inline:14px;font-size:14px;list-style:none;display:flex}.settings-section-picker summary::-webkit-details-marker{display:none}.settings-section-picker nav{border-block-start:1px solid var(--border);padding:4px;display:grid}.settings-section-picker nav a{border-radius:6px;padding:12px;font-size:13px}.settings-section-picker nav a[aria-current=page]{background:color-mix(in oklch, var(--accent-strong) 12%, transparent);color:var(--accent-text)}.settings-panel{border-radius:10px}.settings-panel h3,.settings-panel :is([data-slot=notifications-section],[data-slot=skills-settings-section]) h2{font-weight:400}.settings-panel :is([data-slot=notifications-section],[data-slot=skills-settings-section]) h2+p{margin-block-start:8px;line-height:1.6}.settings-panel :is([data-slot=notifications-section],[data-slot=skills-settings-section]) [role=switch]{margin-block-start:8px}.settings-panel [data-slot=appearance-section]{border:0;border-radius:0}.settings-panel [data-slot=appearance-section]>section{gap:12px}.settings-panel [data-slot=appearance-section]>section+section{border-block-start:1px solid var(--border);padding-block-start:24px}.settings-panel [data-slot=appearance-section] h2{font-size:14px;font-weight:400}.settings-panel [data-slot=appearance-section] h2+p{margin-block-start:8px}.settings-panel [data-slot=appearance-section] [role=radiogroup]{gap:4px}.settings-panel [data-slot=appearance-section] [role=radio]{border-radius:6px;padding-block:8px;padding-inline:14px;font-weight:400}.settings-panel [data-slot=notifications-permission]{margin-block:20px;margin-inline:0}.settings-panel [data-slot=notifications-permission][data-permission=denied]{color:var(--danger)}.settings-panel .settings-readout{border:1px solid var(--border);background:var(--background);overflow-wrap:anywhere;border-radius:6px;padding:12px;font-size:13px;line-height:1.6}.settings-panel .settings-disclosure{border-block-start:1px solid var(--border);color:var(--muted-foreground);padding-block-start:16px;font-size:12px}.settings-panel .settings-disclosure summary{cursor:pointer;padding-block:4px;padding-inline:0}.settings-panel .settings-disclosure>:not(summary){margin-block-start:12px}.settings-panel [data-slot=agent-defaults-section]{gap:20px}.settings-panel [data-slot=agent-defaults-section] .settings-field+.settings-field{padding-block-start:20px}.settings-panel [data-slot=agents-system-prompt]{min-height:192px}.settings-panel [data-slot=agents-task-runs]>h2{font-size:14px;font-weight:400}.settings-panel .settings-option-row{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.settings-panel .settings-option-row>div:first-child{flex:1;min-width:0}.settings-panel .settings-option-row h3{font-size:14px;font-weight:400}.settings-panel .settings-option-row p{margin-block-start:8px;line-height:1.6}.settings-panel .settings-option-row label{flex-shrink:0}.settings-panel .settings-option-row label>span{display:none}.settings-panel .settings-form-actions{border-block-start:1px solid var(--border);flex-wrap:wrap;gap:12px;padding-block-start:20px;display:flex}@media (width<=767px){.settings-route{gap:24px;padding-block:28px 32px;padding-inline:16px}.settings-route-header{padding:0}.settings-route-header h1{letter-spacing:-.01em;line-height:1.2}.settings-route-header>p{display:none}.settings-route-body{gap:20px;max-width:none;padding:0}.settings-panel{padding:16px}.settings-panel button:not([role=switch]):not([data-slot=project-tag-suggestion]):not([data-slot=prompt-template-skill-chip]){min-height:44px}.settings-panel [data-slot=agent-config-agents]{flex-wrap:wrap}.settings-panel [data-slot=agent-config-group] li{max-width:100%}.settings-panel [data-slot=appearance-section] [role=radiogroup]{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:100%;display:grid}.settings-panel [data-slot=appearance-section] [role=radiogroup][data-slot=appearance-width]{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-panel [data-slot=appearance-section] [role=radio]{white-space:nowrap;justify-content:center;padding-inline:8px;font-size:12px}.settings-panel [data-slot=appearance-section] [role=radiogroup][data-slot=appearance-density]{grid-template-columns:repeat(3,auto);gap:4px}.settings-panel [data-slot=appearance-section] [data-slot=appearance-density] [role=radio]{padding-inline:10px}.settings-panel .settings-resource-controls{align-items:stretch}.settings-panel [data-slot=agents-system-prompt]{min-height:192px}}.settings-panel .settings-retention-controls input{width:100%}.settings-panel .settings-retention-controls>span{display:none}.settings-panel .settings-appearance-preview{padding:20px}.settings-panel [data-slot=appearance-theme] svg,.settings-panel [data-slot=prompt-templates-section]>.settings-field>div:first-child>h2{display:none}.settings-panel [data-slot=prompt-templates-section]>.settings-field>div:first-child>p{margin-block-start:0}.settings-panel [data-slot=prompt-template-row]>label,.settings-panel [data-slot=prompt-template-row]>p,.settings-panel [data-slot=prompt-template-new]>label:not(:first-of-type){margin-block-start:6px}.settings-panel [data-slot=prompt-template-row] textarea{min-height:44px}.settings-panel [data-slot=prompt-template-skill-chip]{border:1px solid var(--border);background:var(--muted);border-radius:6px;min-height:28px;padding-block:2px;padding-inline:8px;font-size:12px}.settings-panel [data-slot=prompt-template-skill-chip]:hover{background:color-mix(in oklch, var(--danger) 10%, transparent);color:var(--danger)}.settings-panel [data-slot=prompt-template-skills-trigger]{border-radius:6px}.settings-panel [data-slot=accounts-defaults]{margin-block-start:8px}.settings-panel [data-slot=accounts-defaults] select{max-width:none}.settings-panel [data-slot=account-details]{background:var(--background)}.settings-route [data-slot=project-general]{gap:20px}.settings-route [data-slot=project-general]>section{border-radius:10px;padding:20px}.settings-route [data-slot=project-general] [data-slot=project-facts]{border-block-end:1px solid var(--border);padding-block-end:16px}:is(.settings-panel [data-slot=projects-section] .settings-field:has([data-slot=projects-browse-root])>div:nth-child(2),.settings-panel [data-slot=projects-section] .settings-field:has([data-slot=projects-checkout-root])>div:nth-child(2)){flex-wrap:wrap;row-gap:8px}.settings-panel [data-slot=settings-save-row]{align-items:center}.settings-panel [data-slot=settings-save-row]>*{margin:0}.settings-panel [data-slot=projects-section] .overflow-x-auto{border:0}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>:is(th,td){padding-inline:0}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>th{font-size:14px}@media (width<=767px){.settings-panel [data-slot=accounts-defaults] label{flex-direction:column;align-items:stretch}.settings-panel [data-slot=accounts-defaults] label>span{width:auto}.settings-route [data-slot=project-general]>section{padding:16px}}.settings-agent-picker{border:1px solid var(--border);background:var(--background);border-radius:6px;min-width:0}.settings-agent-picker summary{cursor:pointer;align-items:center;gap:10px;min-height:44px;padding-block:10px;padding-inline:12px;font-size:13px;list-style:none;display:flex}.settings-agent-picker summary::-webkit-details-marker{display:none}.settings-agent-picker [data-slot=agents-runner]{border:0;border-block-start:1px solid var(--border);flex-direction:column;width:100%;max-width:none;padding:4px;display:flex}.settings-agent-picker [role=radio]{white-space:normal;font-family:inherit}.settings-panel [data-slot=settings-config-editor]>[data-slot=agent-config-editor-frame]{margin-block-start:8px}.settings-route[data-route=settings] .settings-route-header>p,.settings-route[data-route=settings-global] .settings-route-header>p{display:block}.settings-route[data-route=settings] .settings-route-header h1,.settings-route[data-route=settings-global] .settings-route-header h1{font-weight:600}.settings-route[data-route=settings-global] [data-slot=settings-index] a>span:nth-child(2)>span:first-child{font-weight:400}.settings-route[data-route=settings-global] [data-slot=settings-index] a>span:nth-child(2)>span+span{margin-block-start:8px}.settings-route[data-route=settings-global] [data-slot=settings-index]+p{display:none}@media (width<=767px){.settings-route{gap:16px}.settings-route[data-route=settings] [data-slot=settings-index]{border:1px solid var(--border);background:var(--card);border-block-start:0;border-radius:0 0 10px 10px;gap:0;margin-block-start:0;padding-block:12px;padding-inline:16px}.settings-route[data-route=settings] [data-slot=settings-index] a{border:0;border-radius:0;padding-block:16px;padding-inline:0}.settings-route[data-route=settings] [data-slot=settings-index] a>span:first-child,.settings-route[data-route=settings] [data-slot=settings-index] a>span:nth-child(2)>span+span{display:none}.settings-route[data-route=settings] [data-slot=settings-index] a>span:nth-child(2)>span:first-child{color:var(--muted-foreground);font-size:13px;font-weight:400}.settings-panel .settings-resource-controls input{flex-basis:100%}.settings-panel [data-slot=resources-composer-defaults] :is(.settings-select,select){width:100%}}.settings-model-control{position:relative}.settings-model-control>svg{pointer-events:none;position:absolute;inset-block-start:50%;inset-inline-start:12px;transform:translateY(-50%)}.settings-panel .settings-model-control :is(select,output){padding-inline-start:36px}.settings-route [data-slot=button]{border-radius:8px;font-weight:400}.settings-panel [data-slot=button]{padding-inline:16px}.settings-route [data-slot=switch-thumb]{background:#fff}.settings-panel .settings-form-actions [data-variant=primary]{order:1}.settings-panel .settings-form-actions>span{order:2}.settings-panel [data-slot=settings-config-editor]{gap:12px}.settings-config-toolbar{flex-wrap:wrap;align-items:center;gap:12px;display:flex}.settings-config-file-row{flex-wrap:wrap;gap:10px;display:flex}.settings-config-file-row button{border:1px solid var(--border);background:var(--card);border-radius:8px;padding-block:10px;padding-inline:16px;font-size:12px;font-weight:400}.settings-config-file-row button[aria-pressed=true]{background:var(--card);color:var(--foreground);border-color:var(--border);box-shadow:var(--shadow-xs);font-weight:500}.settings-config-agent-choice{color:var(--muted-foreground);align-items:center;gap:8px;margin-inline-start:auto;font-size:12px;display:flex}.settings-panel .settings-config-agent-choice select{border:1px solid var(--border);border-radius:6px;min-height:36px;padding-block:6px;padding-inline:10px}.settings-config-content-heading{border-block-start:1px solid var(--border);margin-block-start:8px;padding-block-start:20px}.settings-config-content-heading h3{font-size:14px}.settings-config-content-heading p{color:var(--muted-foreground);margin-block-start:8px;font-size:12px}.settings-config-save-help{color:var(--muted-foreground);gap:8px;padding-block-start:8px;font-size:12px;display:grid}.settings-config-scopes{border-block-start:1px solid var(--border);gap:12px;padding-block-start:24px;display:grid}.settings-config-scopes h3{font-size:14px}.settings-panel [data-slot=accounts-defaults]{background:0 0;border:0;gap:12px;margin-block-start:12px;padding:0}.settings-panel [data-slot=accounts-defaults]>div:first-child>h3{font-size:14px}.settings-panel [data-slot=accounts-defaults]>div:first-child>p{margin-block-start:8px;font-size:12px}.settings-account-models{background:var(--background);border:1px solid var(--border);border-radius:8px;padding:14px}.settings-panel .settings-account-model{background:var(--background);border:1px solid var(--border);border-radius:8px;padding-block:10px;padding-inline:12px;position:relative}.settings-panel .settings-account-model select{min-height:24px;box-shadow:none;background:0 0;border:0;padding:0 36px 0 0;font-size:13px}@media (width<=767px){.settings-config-agent-choice{margin-inline-start:0}.settings-config-file-row{gap:8px}.settings-config-file-row button{padding-inline:12px}.settings-panel [data-slot=accounts-defaults] .settings-account-model{flex-flow:wrap;align-items:center}.settings-panel .settings-account-model select{flex:1;min-width:100px}}.settings-panel [data-slot=agent-config-path]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.settings-config-scopes [data-slot=agent-config-nav]{grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr));gap:20px;display:grid}.settings-config-scopes [data-slot=agent-config-file]{padding:8px;font-size:12px}.settings-panel [data-slot=accounts-defaults] .settings-model-agent-choice{color:var(--muted-foreground);flex-direction:row;align-items:center;gap:8px;font-size:12px;display:flex}.settings-panel .settings-model-agent-choice select{width:16rem;max-width:100%}.settings-config-scopes [data-slot=agent-config-group]>ul>li{width:100%;min-width:0}.settings-config-scopes [data-slot=agent-config-file]{min-width:0;max-width:100%}.settings-panel [data-slot=settings-config-editor] [data-slot=code-editor]{background:var(--background)}.settings-panel select{appearance:none;border:1px solid var(--border);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-position:right 12px center;background-repeat:no-repeat;border-radius:8px;padding-inline:12px 36px}.settings-panel .settings-select>select{background-image:none}.settings-panel .settings-option-row{align-items:center}.settings-panel .settings-option-row :is(select,output){width:16rem;min-width:0;max-width:100%}.settings-panel .settings-field>select{width:16rem;max-width:100%}.settings-panel .settings-field>.settings-select:has(>select:is([data-slot=resources-max-parallel],[data-slot=resources-max-monitoring])){width:8rem}.settings-panel .settings-resource-controls input[data-slot=resources-memory-limit],.settings-panel .settings-resource-controls input[data-slot=resources-monitoring-wake-interval]{flex:none;width:9rem}.settings-panel [data-slot=resources-composer-defaults] select{width:16rem;max-width:100%}@media (width<=767px){.settings-route-header{padding:0}}.settings-route-header h1{letter-spacing:-.01em;font-size:26px;font-weight:600;line-height:1.2}.settings-route-header>p{margin-block-start:4px;font-size:13px}@media (width>=768px){.settings-route-header{padding-block:28px 20px;padding-inline:36px}.settings-route-header h1{font-size:28px}}.settings-panel [data-slot=archive-on-merge-field]>div:first-child>label{font-size:14px;font-weight:400}.settings-panel [data-slot=archive-on-merge-field]>div:first-child>label+p{margin-block-start:4px;line-height:1.6}.settings-panel .settings-agent-card{gap:0;padding:0;scroll-margin-block-start:16px}.settings-agent-head{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px 16px;padding:12px 16px;display:flex}.settings-agent-heading{flex-wrap:wrap;flex:18rem;align-items:baseline;gap:2px 12px;min-width:0;display:flex}.settings-panel .settings-account-provider-title{color:var(--foreground);font-size:14px;font-weight:600}.settings-agent-summary{min-width:0;color:var(--muted-foreground);flex-wrap:wrap;align-items:center;gap:2px 0;font-size:12px;line-height:1.5;display:flex}.settings-agent-summary-item{overflow-wrap:anywhere;align-items:center;min-width:0;display:inline-flex}.settings-agent-summary-sep{color:var(--soft-foreground);padding-inline:6px}.settings-account-actions{flex-flow:wrap;align-items:center;gap:8px;display:flex}.settings-panel .settings-agent-card .settings-account-actions button:not([data-slot=account-rename-input]){min-height:32px;padding-inline:12px;font-size:12px}.settings-agent-accounts{flex-direction:column;display:flex}.settings-account-meta{border-block-start:1px solid var(--border);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:6px 16px;margin-inline:16px;padding-block:8px 10px;display:flex}.settings-account-readout{flex-direction:column;align-items:flex-start;gap:2px;min-width:0;display:flex}.settings-account-meta-line{min-width:0;color:var(--muted-foreground);flex-wrap:wrap;align-items:center;gap:2px 12px;font-size:12px;display:flex}.settings-account-label{color:var(--foreground);font-size:13px;font-weight:500}.settings-account-path{font-family:var(--font-mono);color:color-mix(in oklch, var(--foreground) 80%, transparent);overflow-wrap:anywhere;font-size:12px;line-height:1.5}.settings-account-hint{color:var(--muted-foreground);font-size:12px;line-height:1.5}.settings-account-line{border-block-start:1px solid var(--border);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:6px 16px;margin-inline:16px;padding-block:8px 10px;display:flex}.settings-agent-note{border-block-start:1px solid var(--border);color:var(--muted-foreground);margin-inline:16px;padding-block:8px 10px;font-size:12px;line-height:1.5}.settings-agent-card>section[aria-label=CLI\ installation]{border-block-start:1px solid var(--border);margin-inline:16px;padding-block:8px 10px}.settings-account-management{display:contents}.settings-account-management>span{color:var(--muted-foreground);flex-basis:100%;font-size:12px}.settings-account-management [data-slot=account-rename-input]{min-width:0;max-width:100%}@media (width<=767px){.settings-agent-head{padding:12px}.settings-account-meta,.settings-account-line,.settings-agent-note,.settings-agent-card>section[aria-label=CLI\ installation]{margin-inline:12px}.settings-panel .settings-agent-card .settings-account-actions button:not([data-slot=account-rename-input]){min-height:44px}}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),select,textarea:not([data-slot=code-editor-input])),.settings-panel [data-slot=code-editor]{border-color:var(--border)}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),select,textarea:not([data-slot=code-editor-input])):focus-visible{border-color:var(--ring)}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),select,textarea:not([data-slot=code-editor-input]))[aria-invalid=true]{border-color:var(--destructive)}.settings-panel [data-slot=code-editor]:focus-within{border-color:var(--ring)}.settings-panel :is(input,textarea)::placeholder{color:var(--soft-foreground);opacity:1}.settings-panel .settings-form-actions [data-variant=outline]:disabled{opacity:1;color:var(--muted-foreground);background:0 0}@media (width>=768px){.settings-panel{padding:20px 24px}}.settings-panel>:is([data-slot=agent-defaults-section],[data-slot=worktrees-section],[data-slot=projects-section],[data-slot=accounts-section]){gap:16px}.settings-panel .settings-field{gap:10px}.settings-panel .settings-field+.settings-field,.settings-panel [data-slot=agent-defaults-section] .settings-field+.settings-field{padding-block-start:18px}.settings-panel .settings-field h2+p{margin-block-start:4px;line-height:1.55}.settings-panel [data-slot=agents-task-runs]{gap:16px}.settings-panel [data-slot=agent-cards]{gap:12px}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row]){gap:6px;padding-block:12px}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>td:last-child{margin-block-start:4px;padding-block-start:12px}.settings-panel .settings-form-actions{padding-block-start:16px}.settings-panel [data-slot=appearance-section] [role=radiogroup]{background:color-mix(in oklch, var(--muted) 60%, transparent)}.settings-panel [data-slot=appearance-section] [role=radio][aria-checked=true]{background:var(--card);border-color:var(--border);color:var(--foreground);box-shadow:var(--shadow-xs);font-weight:500}.settings-panel .settings-select:has(>select[data-slot=project-max-parallel]){width:15rem;max-width:100%}@media (width<=767px){.settings-panel .settings-select:has(>select[data-slot=project-max-parallel]){width:100%}}@media (width<48rem),(any-pointer:coarse){[data-slot=agent-config-placeholder]{font-size:max(16px,1rem)}}
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{c as r}from"./utils-DSMR_WLb.js";import{Ir as i,Lr as a,P as o,di as s}from"./project-scope-context-C912rTJP.js";import{sn as c,y as l}from"./queries-DRpvYgai.js";import{t as u}from"./button-BQ2y4XRB.js";import{_n as d}from"./index-DpGDjVpg.js";var f=e(t(),1),p=n(),m=[[`overall`,`Overall`],[`needsYou`,`Needs You`],[`finished`,`Finished`],[`working`,`Working`]];function h(){let e=r(),t=l(e);return t.isPending?(0,p.jsx)(`p`,{role:`status`,className:`p-4 text-sm text-muted-foreground`,children:`Loading sidebar settings…`}):t.isError?(0,p.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,p.jsxs)(`p`,{role:`alert`,children:[`Sidebar settings did not load: `,t.error.message]}),(0,p.jsx)(u,{className:`min-h-[44px]`,onClick:()=>void t.refetch(),children:`Retry`})]}):(0,p.jsx)(g,{scope:e,initial:t.data.sidebarLimits??{}},e)}function g({scope:e,initial:t}){let n=s(),r=i(void 0),l=_(t),[h,g]=(0,f.useState)(()=>({values:l,saved:l,received:l})),{values:y,saved:b}=h,x=e=>g(t=>({...t,values:e})),S=a.safeParse(Object.fromEntries(m.map(([e])=>[e,y[e]===null?null:Number(y[e])]))),C=e=>y[e]!==null&&(y[e].trim()===``||!Number.isSafeInteger(Number(y[e]))||Number(y[e])<=0),w=m.some(([e])=>y[e]!==b[e]);d(w);let T=c({onMutate:()=>n.cancelQueries({queryKey:[e,`ui-state`],exact:!0}),mutationFn:t=>o({sidebarLimits:t},e),onSuccess:async t=>{await n.cancelQueries({queryKey:[e,`ui-state`],exact:!0}),n.setQueryData([e,`ui-state`],t);let r=_(t.sidebarLimits);g({values:r,saved:r,received:r})}});return!T.isPending&&!v(h.received,l)&&g({values:w?y:l,saved:l,received:l}),(0,p.jsxs)(`form`,{"data-slot":`sidebar-settings`,"data-reports-dirty":``,className:`flex w-full max-w-2xl flex-col gap-5 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6`,onSubmit:e=>{e.preventDefault(),S.success&&!m.some(([e])=>C(e))&&!T.isPending&&T.mutate(S.data)},children:[(0,p.jsx)(`p`,{id:`sidebar-limits-help`,className:`text-sm text-muted-foreground`,children:`Limits apply to this project on desktop and mobile. The overall budget is shared in section order: Needs You, Finished, then Working. Each section also respects its own limit. Unlimited removes only that constraint.`}),(0,p.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pinned tasks and groups containing a pin bypass both limits. A task group counts as one row. Archived uses only the overall limit; archived pins are not exempt.`}),m.map(([e,t])=>(0,p.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,p.jsx)(`label`,{htmlFor:`sidebar-${e}`,className:`text-sm font-medium`,children:t}),(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,p.jsx)(`input`,{id:`sidebar-${e}`,type:`number`,inputMode:`numeric`,min:`1`,step:`1`,value:y[e]??``,disabled:y[e]===null||T.isPending,"aria-invalid":C(e),"aria-describedby":C(e)?`sidebar-${e}-error sidebar-limits-help`:`sidebar-limits-help`,onChange:t=>x({...y,[e]:t.target.value}),className:`min-h-[44px] w-28 rounded-md border border-input bg-card px-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50`}),(0,p.jsxs)(`label`,{className:`flex min-h-[44px] cursor-pointer items-center gap-2 text-sm`,children:[(0,p.jsx)(`input`,{type:`checkbox`,"aria-label":`${t} Unlimited`,checked:y[e]===null,disabled:T.isPending,onChange:t=>x({...y,[e]:t.target.checked?null:String(r[e]??10)}),className:`size-4 accent-[var(--accent-strong)]`}),`Unlimited`]})]}),C(e)&&(0,p.jsx)(`p`,{id:`sidebar-${e}-error`,className:`text-sm text-danger`,children:`Enter a positive whole number or choose Unlimited.`})]},e)),(0,p.jsx)(u,{type:`submit`,className:`min-h-[44px] self-start`,variant:`primary`,disabled:!w||!S.success||m.some(([e])=>C(e))||T.isPending,children:T.isPending?`Saving…`:`Save sidebar limits`}),T.isError&&(0,p.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[`Could not save sidebar limits: `,T.error.message]}),T.isSuccess&&!w&&(0,p.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Sidebar limits saved.`})]})}function _(e){let t=i(e);return Object.fromEntries(m.map(([e])=>[e,t[e]===null?null:String(t[e])]))}function v(e,t){return m.every(([n])=>e[n]===t[n])}export{h as SidebarSection};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{c as r}from"./utils-DSMR_WLb.js";import{Ir as i,Lr as a,P as o,di as s}from"./project-scope-context-C912rTJP.js";import{Qt as c,y as l}from"./queries-BvWsZhaH.js";import{t as u}from"./button-B7MKxYjT.js";import{gn as d}from"./index-C4gjdVLi.js";var f=e(t(),1),p=n(),m=[[`overall`,`Overall`],[`needsYou`,`Needs You`],[`finished`,`Finished`],[`working`,`Working`]];function h(){let e=r(),t=l(e);return t.isPending?(0,p.jsx)(`p`,{role:`status`,className:`p-4 text-sm text-muted-foreground`,children:`Loading sidebar settings…`}):t.isError?(0,p.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,p.jsxs)(`p`,{role:`alert`,children:[`Sidebar settings did not load: `,t.error.message]}),(0,p.jsx)(u,{className:`min-h-[44px]`,onClick:()=>void t.refetch(),children:`Retry`})]}):(0,p.jsx)(g,{scope:e,initial:t.data.sidebarLimits??{}},e)}function g({scope:e,initial:t}){let n=s(),r=i(void 0),l=_(t),[h,g]=(0,f.useState)(()=>({values:l,saved:l,received:l})),{values:y,saved:b}=h,x=e=>g(t=>({...t,values:e})),S=a.safeParse(Object.fromEntries(m.map(([e])=>[e,y[e]===null?null:Number(y[e])]))),C=e=>y[e]!==null&&(y[e].trim()===``||!Number.isSafeInteger(Number(y[e]))||Number(y[e])<=0),w=m.some(([e])=>y[e]!==b[e]);d(w);let T=c({onMutate:()=>n.cancelQueries({queryKey:[e,`ui-state`],exact:!0}),mutationFn:t=>o({sidebarLimits:t},e),onSuccess:async t=>{await n.cancelQueries({queryKey:[e,`ui-state`],exact:!0}),n.setQueryData([e,`ui-state`],t);let r=_(t.sidebarLimits);g({values:r,saved:r,received:r})}});return!T.isPending&&!v(h.received,l)&&g({values:w?y:l,saved:l,received:l}),(0,p.jsxs)(`form`,{"data-slot":`sidebar-settings`,"data-reports-dirty":``,className:`flex w-full max-w-2xl flex-col gap-5 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6`,onSubmit:e=>{e.preventDefault(),S.success&&!m.some(([e])=>C(e))&&!T.isPending&&T.mutate(S.data)},children:[(0,p.jsx)(`p`,{id:`sidebar-limits-help`,className:`text-sm text-muted-foreground`,children:`Limits apply to this project on desktop and mobile. The overall budget is shared in section order: Needs You, Finished, then Working. Each section also respects its own limit. Unlimited removes only that constraint.`}),(0,p.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pinned tasks and groups containing a pin bypass both limits. A task group counts as one row. Archived uses only the overall limit; archived pins are not exempt.`}),m.map(([e,t])=>(0,p.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,p.jsx)(`label`,{htmlFor:`sidebar-${e}`,className:`text-sm font-medium`,children:t}),(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,p.jsx)(`input`,{id:`sidebar-${e}`,type:`number`,inputMode:`numeric`,min:`1`,step:`1`,value:y[e]??``,disabled:y[e]===null||T.isPending,"aria-invalid":C(e),"aria-describedby":C(e)?`sidebar-${e}-error sidebar-limits-help`:`sidebar-limits-help`,onChange:t=>x({...y,[e]:t.target.value}),className:`min-h-[44px] w-28 rounded-md border border-input bg-card px-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50`}),(0,p.jsxs)(`label`,{className:`flex min-h-[44px] cursor-pointer items-center gap-2 text-sm`,children:[(0,p.jsx)(`input`,{type:`checkbox`,"aria-label":`${t} Unlimited`,checked:y[e]===null,disabled:T.isPending,onChange:t=>x({...y,[e]:t.target.checked?null:String(r[e]??10)}),className:`size-4 accent-[var(--accent-strong)]`}),`Unlimited`]})]}),C(e)&&(0,p.jsx)(`p`,{id:`sidebar-${e}-error`,className:`text-sm text-danger`,children:`Enter a positive whole number or choose Unlimited.`})]},e)),(0,p.jsx)(u,{type:`submit`,className:`min-h-[44px] self-start`,variant:`primary`,disabled:!w||!S.success||m.some(([e])=>C(e))||T.isPending,children:T.isPending?`Saving…`:`Save sidebar limits`}),T.isError&&(0,p.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[`Could not save sidebar limits: `,T.error.message]}),T.isSuccess&&!w&&(0,p.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Sidebar limits saved.`})]})}function _(e){let t=i(e);return Object.fromEntries(m.map(([e])=>[e,t[e]===null?null:String(t[e])]))}function v(e,t){return m.every(([n])=>e[n]===t[n])}export{h as SidebarSection};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{d as i,u as a}from"./live-refetch-1_o4J83F.js";import{S as o,di as s}from"./project-scope-context-C912rTJP.js";import{Bt as c,Wt as l,_ as u}from"./queries-BvWsZhaH.js";import{g as d}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as f}from"./toaster-Bo5vCbz-.js";import{O as p,T as m,X as h,Y as g,ct as _,l as v,ot as y,u as b}from"./design-icons-CzEoMH9c.js";import{t as x}from"./button-B7MKxYjT.js";import{t as S}from"./project-router-DucFIl_x.js";import{f as C,l as w}from"./skills-pM_PouEs.js";import{En as T,V as E,Wn as D,bn as O}from"./index-C4gjdVLi.js";var k=e(t(),1),A=n(),j=e=>e.split(`@`)[0]||e,M={project:0,user:1,plugin:2,system:3,other:4},N={project:`This project`,user:`Your skills`,system:`Built in`,other:`Other`};function P(e){if(e.plugin)return{key:`plugin:${e.plugin}`,label:j(e.plugin),kind:`plugin`};let t=e.scope===`repo`?`project`:e.scope===`user`?`user`:e.scope===`system`?`system`:`other`;return{key:t,label:N[t],kind:t}}function F(e){let t=new Map;for(let n of e){let e=P(n),r=t.get(e.key)??{...e,skills:[]};r.skills.push(n),t.set(e.key,r)}return[...t.values()].sort((e,t)=>M[e.kind]-M[t.kind]||e.label.localeCompare(t.label))}function I(e){let t=e.plugin?`${j(e.plugin)}:`:``;return t&&e.name.startsWith(t)&&e.name.length>t.length?e.name.slice(t.length):e.name}var L={project:m,user:_,plugin:p,system:p,other:p};function R({groups:e,openId:t,searching:n,runner:r,account:i}){let[a,o]=(0,k.useState)(new Set),s=e=>o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,A.jsx)(`div`,{"data-slot":`skills-list`,className:`overflow-hidden rounded-xl border border-border bg-card`,children:e.map(e=>{let o=n||!a.has(e.key);return(0,A.jsxs)(`section`,{"data-slot":`skill-group`,"aria-label":e.label,className:`border-border not-first:border-t`,children:[(0,A.jsx)(z,{group:e,open:o,onToggle:()=>s(e.key)}),o?e.skills.map(e=>(0,A.jsx)(B,{skill:e,open:e.id===t,runner:r,account:i},C(e))):null]},e.key)})})}function z({group:e,open:t,onToggle:n}){let i=L[e.kind];return(0,A.jsx)(`h2`,{className:`m-0`,children:(0,A.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:n,className:`flex min-h-10 w-full items-center gap-2 bg-muted/45 px-3.5 text-left text-xs font-semibold text-muted-foreground focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:text-foreground`,children:[(0,A.jsx)(b,{"aria-hidden":`true`,className:r(`size-3.5 transition-transform motion-reduce:transition-none`,t&&`rotate-90`)}),(0,A.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),(0,A.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,A.jsx)(`span`,{className:`font-medium text-soft-foreground`,children:e.skills.length})]})})}function B({skill:e,open:t,runner:n,account:r}){let i=T({skill:e.id,skillPath:e.path,runner:n,...r?{account:r}:{}});return(0,A.jsxs)(`details`,{"data-slot":`skill-row`,"data-skill":e.id,"data-skill-path":e.path,name:`skill-details`,open:t||void 0,className:`group/skill border-t border-border/60 open:bg-sidebar-row-selected`,children:[(0,A.jsxs)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center gap-3 py-2 pr-3.5 pl-9 focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:bg-sidebar-row-hover [&::-webkit-details-marker]:hidden`,children:[(0,A.jsxs)(`span`,{className:`grid min-w-0 flex-1 grid-cols-1 items-center gap-x-4 gap-y-0.5 sm:grid-cols-[minmax(10rem,15rem)_minmax(0,1fr)]`,children:[(0,A.jsx)(`span`,{className:`truncate text-[13.5px] leading-snug font-semibold text-foreground`,title:e.name,children:I(e)}),e.description?(0,A.jsx)(`span`,{className:`min-w-0 line-clamp-2 text-[13px] leading-snug text-muted-foreground [overflow-wrap:anywhere] group-open/skill:hidden`,title:e.description,children:e.description}):null]}),(0,A.jsx)(v,{"data-slot":`skill-row-cue`,"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground transition-transform group-open/skill:rotate-180 motion-reduce:transition-none`})]}),(0,A.jsx)(`div`,{className:`pr-3.5 pb-4 pl-9`,children:(0,A.jsx)(E,{skill:e,heading:null,actions:(0,A.jsx)(x,{asChild:!0,size:`sm`,"data-action":`start-task`,children:(0,A.jsx)(S,{to:i,children:`Start task`})})})})]})}function V(){let e=u(),[t,n]=(0,k.useState)(null),[i,o]=(0,k.useState)(null),[s,c]=(0,k.useState)(``),[f]=d(),p=t??e.data?.defaultRunner,{runner:m}=a(p??`claude`),_=i?.runner===m?i.id:null,v=e=>o(e===null?null:{runner:m,id:e}),y=l(p,_),b=K(m,y.account),S=y.data??[];return(0,A.jsxs)(`div`,{"data-route":`skills`,className:`grid min-h-full w-full grid-cols-1 content-start gap-5 px-4 pt-7 pb-9 md:px-9 max-md:[padding-block-end:5rem]`,children:[(0,A.jsx)(`header`,{className:`flex flex-wrap items-start justify-between gap-4`,children:(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h1`,{className:`text-[26px] font-semibold tracking-tight leading-[1.2] text-foreground md:text-[28px]`,children:`Skills`}),(0,A.jsx)(`p`,{className:`mt-1 text-[13px] text-muted-foreground`,children:`The skills each agent loads in this project, as its runner reports them.`})]})}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(U,{runner:m,onChange:e=>{n(e),v(null)}}),(0,A.jsx)(W,{runner:m,account:_,onChange:v}),(0,A.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,"data-slot":`skills-count`,children:y.list?`${S.length} ${S.length===1?`skill`:`skills`}${y.list.source===`cache`?` · from cache`:``}`:null}),(0,A.jsxs)(x,{variant:`outline`,size:`sm`,onClick:()=>void b.run(),disabled:b.running||y.isPending,"data-slot":`skills-refresh`,children:[(0,A.jsx)(g,{"aria-hidden":`true`,className:r(`size-3.5`,b.running&&`motion-safe:animate-spin`)}),`Re-read`]})]}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(h,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,A.jsx)(D,{"aria-label":`Search skills`,placeholder:`Filter by name or description…`,value:s,onChange:e=>c(e.target.value),className:`h-10 rounded-lg border-border bg-card pl-9 text-[13px]`})]}),(0,A.jsx)(G,{query:y}),y.isPending?(0,A.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Loading skills…`}):(0,A.jsx)(H,{skills:S,search:s,openId:f.get(`skill`),runner:m,account:y.account??null,unchecked:y.unchecked})]})}function H({skills:e,search:t,openId:n,runner:r,account:i,unchecked:a}){if(e.length===0)return a?null:(0,A.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`No skills reported by this runner and account.`});let o=w(e,t);return o.length===0?(0,A.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`No skills match “`,t.trim(),`”.`]}):(0,A.jsx)(R,{groups:F(o),openId:n,searching:t.trim()!==``,runner:r,account:i})}function U({runner:e,onChange:t}){let n=i().data;return n?(0,A.jsx)(`div`,{role:`group`,"aria-label":`Runner`,className:`flex max-w-full gap-1 overflow-x-auto rounded-lg border border-border bg-muted/60 p-1`,children:n.runners.map(n=>(0,A.jsx)(`button`,{type:`button`,"aria-pressed":n.id===e,onClick:()=>t(n.id),className:`h-8 shrink-0 rounded-md border border-transparent px-3 text-[13px] font-normal text-muted-foreground transition-colors focus-visible:outline-2 aria-pressed:border-border aria-pressed:bg-card aria-pressed:font-semibold aria-pressed:text-foreground aria-pressed:shadow-xs pointer-hover:text-foreground max-md:h-11`,children:n.displayName},n.id))}):null}function W({runner:e,account:t,onChange:n}){let r=O().accounts.filter(t=>t.provider===e);return r.length===0?null:(0,A.jsxs)(`div`,{className:`relative inline-flex items-center`,children:[(0,A.jsxs)(`select`,{"aria-label":`Account`,value:t??``,onChange:e=>n(e.target.value||null),className:`h-[38px] appearance-none rounded-lg border border-border bg-card pr-8 pl-3 text-[13px] text-foreground focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,A.jsx)(`option`,{value:``,children:`Account: project default`}),r.map(e=>(0,A.jsx)(`option`,{value:e.id,children:e.label},e.id))]}),(0,A.jsx)(v,{"aria-hidden":`true`,className:`pointer-events-none absolute right-2.5 size-3.5 text-muted-foreground`})]})}function G({query:e}){let t=e.list?.problems??[];return!e.unchecked&&t.length===0?null:(0,A.jsxs)(`div`,{className:`grid gap-1.5 rounded-lg border border-pending/40 bg-pending/10 px-3.5 py-2.5 text-[13px]`,children:[e.unchecked&&!e.isPending?(0,A.jsxs)(`p`,{role:`status`,className:`flex gap-2`,children:[(0,A.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,A.jsxs)(`span`,{children:[`Skill list unavailable. `,e.list?.reason??e.error?.message,` You can still type a skill id when starting a task.`]})]}):null,t.map((e,t)=>(0,A.jsxs)(`p`,{role:`alert`,className:`flex gap-2 break-words`,children:[(0,A.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,A.jsxs)(`span`,{children:[e.message,e.path?` · ${e.path}`:``]})]},t))]})}function K(e,t){let n=s(),[r,i]=(0,k.useState)(!1),a=c.runnerSkills(e,t);return{running:r,run:async()=>{i(!0);try{n.setQueryData(a,await o(e,t,{refresh:!0})),await n.invalidateQueries({queryKey:a.slice(0,3)})}catch(e){f(e instanceof Error?e.message:String(e),{tone:`danger`})}finally{i(!1)}}}}export{V as SkillsRoute};
@@ -1 +1 @@
1
- import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./utils-DSMR_WLb.js";import{t as r}from"./bot-TkDIw4y-.js";import{r as i}from"./button-BQ2y4XRB.js";e();var a=t(),o=i(`inline-block shrink-0`,{variants:{tone:{success:``,pending:``,danger:``,accent:``,info:``,running:``,neutral:``},shape:{filled:`size-[7px] rounded-full`,ring:`size-[7px] rounded-full border-[1.5px] bg-transparent`,workers:`inline-flex size-[12px] items-center justify-center`},pulse:{true:`animate-pulse motion-reduce:animate-none`,false:``}},compoundVariants:[{shape:`filled`,tone:`success`,className:`bg-success`},{shape:`filled`,tone:`pending`,className:`bg-pending-strong`},{shape:`filled`,tone:`danger`,className:`bg-danger`},{shape:`filled`,tone:`accent`,className:`bg-accent-strong`},{shape:`filled`,tone:`info`,className:`bg-info`},{shape:`filled`,tone:`running`,className:`bg-status-running`},{shape:`filled`,tone:`neutral`,className:`bg-soft-foreground`},{shape:`ring`,tone:`success`,className:`border-success`},{shape:`ring`,tone:`pending`,className:`border-pending-strong`},{shape:`ring`,tone:`danger`,className:`border-danger`},{shape:`ring`,tone:`accent`,className:`border-accent-strong`},{shape:`ring`,tone:`info`,className:`border-info`},{shape:`ring`,tone:`running`,className:`border-status-running`},{shape:`ring`,tone:`neutral`,className:`border-soft-foreground`},{shape:`workers`,tone:`success`,className:`text-success`},{shape:`workers`,tone:`pending`,className:`text-pending-strong`},{shape:`workers`,tone:`danger`,className:`text-danger`},{shape:`workers`,tone:`accent`,className:`text-accent-icon`},{shape:`workers`,tone:`info`,className:`text-info`},{shape:`workers`,tone:`running`,className:`text-status-running`},{shape:`workers`,tone:`neutral`,className:`text-soft-foreground`}],defaultVariants:{tone:`neutral`,shape:`filled`,pulse:!1}});function s({className:e,tone:t=`neutral`,shape:i=`filled`,pulse:s=!1,...c}){return(0,a.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,"data-shape":i,"data-pulse":s?`true`:void 0,className:n(o({tone:t,shape:i,pulse:s,className:e})),...c,children:i===`workers`?(0,a.jsx)(r,{className:`size-[12px]`,"aria-hidden":`true`}):null})}export{s as t};
1
+ import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./utils-DSMR_WLb.js";import{t as r}from"./bot-TkDIw4y-.js";import{r as i}from"./button-B7MKxYjT.js";e();var a=t(),o=i(`inline-block shrink-0`,{variants:{tone:{success:``,pending:``,danger:``,accent:``,info:``,running:``,neutral:``},shape:{filled:`size-[7px] rounded-full`,ring:`size-[7px] rounded-full border-[1.5px] bg-transparent`,workers:`inline-flex size-[12px] items-center justify-center`},pulse:{true:`animate-pulse motion-reduce:animate-none`,false:``}},compoundVariants:[{shape:`filled`,tone:`success`,className:`bg-success`},{shape:`filled`,tone:`pending`,className:`bg-pending-strong`},{shape:`filled`,tone:`danger`,className:`bg-danger`},{shape:`filled`,tone:`accent`,className:`bg-accent-strong`},{shape:`filled`,tone:`info`,className:`bg-info`},{shape:`filled`,tone:`running`,className:`bg-status-running`},{shape:`filled`,tone:`neutral`,className:`bg-soft-foreground`},{shape:`ring`,tone:`success`,className:`border-success`},{shape:`ring`,tone:`pending`,className:`border-pending-strong`},{shape:`ring`,tone:`danger`,className:`border-danger`},{shape:`ring`,tone:`accent`,className:`border-accent-strong`},{shape:`ring`,tone:`info`,className:`border-info`},{shape:`ring`,tone:`running`,className:`border-status-running`},{shape:`ring`,tone:`neutral`,className:`border-soft-foreground`},{shape:`workers`,tone:`success`,className:`text-success`},{shape:`workers`,tone:`pending`,className:`text-pending-strong`},{shape:`workers`,tone:`danger`,className:`text-danger`},{shape:`workers`,tone:`accent`,className:`text-accent-icon`},{shape:`workers`,tone:`info`,className:`text-info`},{shape:`workers`,tone:`running`,className:`text-status-running`},{shape:`workers`,tone:`neutral`,className:`text-soft-foreground`}],defaultVariants:{tone:`neutral`,shape:`filled`,pulse:!1}});function s({className:e,tone:t=`neutral`,shape:i=`filled`,pulse:s=!1,...c}){return(0,a.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,"data-shape":i,"data-pulse":s?`true`:void 0,className:n(o({tone:t,shape:i,pulse:s,className:e})),...c,children:i===`workers`?(0,a.jsx)(r,{className:`size-[12px]`,"aria-hidden":`true`}):null})}export{s as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{a as i}from"./dist-BW234Kg5.js";import{a,i as o,r as s,t as c}from"./dist-C5mlVBmd.js";import{t as l}from"./dist-Czz3Y5qH.js";import{t as u}from"./dist-DXO3xwbC.js";var d=e(t(),1),f=n(),p=`Switch`,[m,h]=o(p),[g,_]=m(p);function v(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:l,required:u,value:m=`on`,internal_do_not_use_render:h}=e,[_,v]=c({prop:n,defaultProp:i??!1,onChange:l,caller:p}),[y,b]=d.useState(null),[x,S]=d.useState(null),C={checked:_,setChecked:v,disabled:a,control:y,setControl:b,name:s,form:o,value:m,hasConsumerStoppedPropagationRef:d.useRef(!1),required:u,defaultChecked:i,isFormControl:!y||!!o||!!y.closest(`form`),bubbleInput:x,setBubbleInput:S};return(0,f.jsx)(g,{scope:t,...C,children:E(h)?h(C):r})}var y=`SwitchTrigger`,b=d.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{let{control:o,form:c,value:l,disabled:u,checked:p,required:m,setControl:h,setChecked:g,hasConsumerStoppedPropagationRef:v,isFormControl:b,bubbleInput:x}=_(y,e),S=i(r,h),C=d.useRef(p);return d.useEffect(()=>{let e=c?o?.ownerDocument.getElementById(c):o?.form;if(e instanceof HTMLFormElement){let t=()=>g(C.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,c,g]),(0,f.jsx)(a.button,{type:`button`,role:`switch`,"aria-checked":p,"aria-required":m,"data-state":D(p),"data-disabled":u?``:void 0,disabled:u,value:l,...n,ref:S,onClick:s(t,e=>{g(e=>!e),x&&b&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})})});b.displayName=y;var x=d.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,f.jsx)(v,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(b,{...d,ref:t,__scopeSwitch:n}),e&&(0,f.jsx)(T,{__scopeSwitch:n})]})})});x.displayName=p;var S=`SwitchThumb`,C=d.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=_(S,n);return(0,f.jsx)(a.span,{"data-state":D(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});C.displayName=S;var w=`SwitchBubbleInput`,T=d.forwardRef(({__scopeSwitch:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:c,required:p,disabled:m,name:h,value:g,form:v,bubbleInput:y,setBubbleInput:b}=_(w,e),x=i(n,b),S=l(s),C=u(r);d.useEffect(()=>{let e=y;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!o.current;if(S!==s&&n){let t=new Event(`click`,{bubbles:r});n.call(e,s),e.dispatchEvent(t)}},[y,S,s,o]);let T=d.useRef(s);return(0,f.jsx)(a.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??T.current,required:p,disabled:m,name:h,value:g,form:v,...t,tabIndex:-1,ref:x,style:{...t.style,...C,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});T.displayName=w;function E(e){return typeof e==`function`}function D(e){return e?`checked`:`unchecked`}var O=`data-[state=checked]:border-accent-strong data-[state=checked]:bg-accent-strong data-[state=unchecked]:border-muted-foreground/60 data-[state=unchecked]:bg-muted [.light_&]:data-[state=unchecked]:border-muted-foreground/35`,k=`data-[state=checked]:bg-white data-[state=unchecked]:bg-foreground/80 [.light_&]:data-[state=unchecked]:border [.light_&]:data-[state=unchecked]:border-muted-foreground/30 [.light_&]:data-[state=unchecked]:bg-card [.light_&]:data-[state=unchecked]:shadow-sm`;function A({className:e,size:t=`default`,...n}){return(0,f.jsx)(x,{"data-slot":`switch`,"data-size":t,className:r(`peer group/switch inline-flex shrink-0 items-center rounded-full border shadow-none transition-[color,background-color,border-color,box-shadow] outline-hidden focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-6 data-[size=default]:w-10 data-[size=sm]:h-3.5 data-[size=sm]:w-6`,O,e),...n,children:(0,f.jsx)(C,{"data-slot":`switch-thumb`,className:r(k,`pointer-events-none block rounded-full ring-0 motion-safe:transition-transform group-data-[size=default]/switch:size-[18px] group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-[state=checked]:translate-x-5 group-data-[size=default]/switch:data-[state=unchecked]:translate-x-0.5 group-data-[size=sm]/switch:data-[state=checked]:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-[state=unchecked]:translate-x-0`)})})}export{O as n,A as r,k as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{Bt as i,Ct as a,Ft as o,Nn as s,Nt as c,Qn as l,Rt as u,di as d,ot as f,rt as p}from"./project-scope-context-C912rTJP.js";import{Bt as m,C as h,Qt as g,X as _,Y as v,vt as y}from"./queries-BvWsZhaH.js";import{h as b}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as x}from"./toaster-Bo5vCbz-.js";import{C as S,j as C,l as w}from"./design-icons-CzEoMH9c.js";import{t as T}from"./run-header-BXQ-HR4O.js";import{i as E,n as D,r as O}from"./git-toolbar-Icz0Cr21.js";import{t as k}from"./button-B7MKxYjT.js";import{a as A,i as j,o as M,r as N,s as P,t as F}from"./dialog-B531GGAo.js";import{b as I,f as L}from"./task-groups-fk4Gq4hX.js";import{t as R}from"./centered-state-V15AR_qo.js";import{C as z,X as B,cn as V,en as H,w as U}from"./index-C4gjdVLi.js";import{t as W}from"./markdown-BBDDg-4t.js";import{t as G}from"./textarea-vJt9undk.js";import{t as K}from"./diff-CCzM8XxZ.js";var q=e(t(),1),J=`no worktree — this task ran directly in the repo working tree`;function Y(e){let t=e=>({id:`commit`,label:`Commit`,enabled:!1,reason:e});return e.hasWorktree?e.run.status===`running`?t(`Commit unavailable — the agent is still working in this worktree`):e.changedFiles===void 0?t(`Commit unavailable — changes are still loading`):e.changedFiles===0?t(`Commit unavailable — no changes to commit`):{id:`commit`,label:`Commit`,enabled:!0}:t(`Commit unavailable — ${J}`)}function X(e){let t=e=>({id:`push`,label:`Push`,enabled:!1,reason:e});return e.hasWorktree?e.remote===void 0?t(`Push unavailable — no remote configured`):e.branch===void 0?t(`Push unavailable — the run has no branch to push`):e.run.status===`running`?t(`Push unavailable — the agent is still working in this worktree`):{id:`push`,label:`Push`,enabled:!0}:t(`Push unavailable — ${J}`)}function Z(e){let t=e=>({id:`create-pr`,label:`Draft PR`,enabled:!1,reason:e});return!e.hasWorktree||e.branch===void 0?t(`Draft PR unavailable — ${J}`):e.forge===null?t(`Draft PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?l(e.run)?t(`Draft PR unavailable — the run is waiting on a usage-limit hold; choose Don’t resume first`):I(e.run)?t(`Draft PR unavailable — the run is still active; wait for the review gate`):{id:`create-pr`,label:`Draft PR`,enabled:!0}:t(`Draft PR unavailable — ${e.forge.reason??`the forge is unreachable`}`)}function Q(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:Y(e),n=e.prUrl?[Y(e),X(e)]:[X(e),Z(e)],r=[];if(e.localHandoff&&e.cliHandoff!==!1){let t=e.hasSession?I(e.run)?{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — the session is still active in the engine`}:{id:`open-terminal`,label:`Open in terminal`,enabled:!0}:{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — no agent session to resume`};r.push(t)}return{primary:t,secondary:n,menu:r}}var $=n();function ee({run:e,open:t,onOpenChange:n}){let r=d(),[i,a]=(0,q.useState)(``),o=L(e),s=(0,q.useRef)(o);s.current=o,(0,q.useEffect)(()=>{t&&a(s.current)},[t]);let c=g({mutationFn:t=>p(e.id,t),onSuccess:t=>{x(`Committed ${t.sha.slice(0,7)}`),n(!1),r.invalidateQueries({queryKey:m.runs.changes(e.id)}),r.invalidateQueries({queryKey:m.runs.all})},onError:e=>x(e.message,{tone:`danger`})}),l=()=>{let e=i.trim();e.length===0||c.isPending||c.mutate(e)};return(0,$.jsx)(F,{open:t,onOpenChange:n,children:(0,$.jsxs)(N,{"data-slot":`commit-dialog`,children:[(0,$.jsxs)(M,{children:[(0,$.jsx)(P,{children:`Commit changes`}),(0,$.jsxs)(j,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,$.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,$.jsx)(G,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{B({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),l())}}),(0,$.jsxs)(A,{children:[(0,$.jsx)(k,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,$.jsx)(k,{"data-slot":`commit-confirm`,disabled:i.trim().length===0||c.isPending,onClick:l,children:c.isPending?`Committing…`:`Commit`})]})]})})}function te(){let{id:e}=b(),t=v(e);return t.isPending?(0,$.jsx)(U,{tab:`changes`}):t.isError?(0,$.jsx)(z,{tab:`changes`,error:t.error}):(0,$.jsx)(ne,{run:t.data})}function ne({run:e}){let t=y(),n=h(),r=_(e.id,I(e)),i=H(),[a,l]=(0,q.useState)(`unified`),[p,v]=(0,q.useState)(!0),[b,S]=(0,q.useState)(!1),[C,w]=(0,q.useState)(null),[E,k]=(0,q.useState)(!1),A=(0,q.useRef)(null),j=d(),M=()=>j.invalidateQueries({queryKey:m.runs.all}),N=e=>x(e.message,{tone:`danger`}),P=g({mutationFn:()=>u(e.id),onSuccess:e=>x(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:N}),F=g({mutationFn:()=>f(e.id),onSuccess:e=>{x(`Draft PR created — ${e.url}`),M()},onError:N}),L=g({mutationFn:()=>o(e.id),onError:e=>{if(e instanceof s&&e.command){navigator.clipboard.writeText(e.command).then(()=>x(`No terminal found — command copied to clipboard.`)).catch(()=>x(`Run manually: ${e.command}`));return}N(e)}}),R=g({mutationFn:t=>c(e.id,t),onError:N}),z=r.isError&&r.error instanceof s&&r.error.status===409,B=Q({run:e,cliHandoff:e.cliHandoff,hasWorktree:!!e.worktreePath&&!z,branch:e.branch,changedFiles:r.data?.stat.files,remote:n.data?.info?.remote,forge:t.data?.forge??null,localHandoff:t.data?.capabilities.localHandoff??!1,hasSession:V(e)!==void 0,prUrl:e.pullRequestUrl}),U=e=>{switch(e){case`commit`:k(!0);break;case`push`:P.mutate();break;case`create-pr`:F.mutate();break;case`open-terminal`:L.mutate();break;case`view-pr`:break}},G=r.data?.files??[],K=(0,q.useMemo)(()=>O(G),[G]),J=(0,q.useMemo)(()=>G.some(W),[G]),Y=i?a:`unified`;return(0,$.jsxs)(`div`,{"data-route":`task-changes`,className:`flex min-h-full flex-col`,children:[(0,$.jsx)(T,{run:e,tab:`changes`}),(0,$.jsx)(D,{bar:B,healthReady:t.data!==void 0,branch:e.branch,stat:r.data?.stat,mode:Y,wrap:p,preview:b,onModeChange:l,onWrapChange:v,onPreviewChange:J?S:void 0,onAction:U}),r.data?.repointedHead?(0,$.jsxs)(`p`,{"data-slot":`repointed-head-note`,className:`border-b px-4 py-2 text-xs text-soft-foreground md:px-9`,children:[`HEAD is on `,(0,$.jsx)(`code`,{children:r.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,$.jsx)(`code`,{children:r.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,(0,$.jsx)(re,{changes:r,changesRefused:z,fileCount:G.length,children:(0,$.jsx)(ie,{runId:e.id,files:G,tree:K,selected:C,selectFile:e=>{w(e),A.current?.scrollToPath(e)},diffRef:A,effectiveMode:Y,effectiveWrap:p,preview:b,localHandoff:t.data?.capabilities.localHandoff,onOpenInApp:R.mutate})}),(0,$.jsx)(ee,{run:e,open:E,onOpenChange:k})]})}function re({changes:e,changesRefused:t,fileCount:n,children:r}){return e.isPending?(0,$.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading changes…`}):e.isError?(0,$.jsx)(R,{icon:t?(0,$.jsx)(S,{size:16}):(0,$.jsx)(C,{size:16}),tone:t?`neutral`:`danger`,heading:`h2`,title:t?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):n===0?(0,$.jsx)(R,{icon:(0,$.jsx)(S,{size:16}),tone:`neutral`,heading:`h2`,title:`No changes yet`,subtitle:`The worktree matches its base branch. Changes appear here as the agent works.`}):r}function ie({runId:e,files:t,tree:n,selected:a,selectFile:o,diffRef:s,effectiveMode:c,effectiveWrap:l,preview:u,localHandoff:d,onOpenInApp:f}){let[p,m]=(0,q.useState)(!1);return(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-4 px-4 pb-9 pt-0 [--diff-sticky-top:0px] md:flex-row md:items-start md:gap-5 md:px-9 md:[--diff-sticky-top:1rem]`,children:[(0,$.jsxs)(`aside`,{"data-slot":`changes-tree-pane`,className:`w-full shrink-0 rounded-xl border border-border bg-card md:sticky md:top-4 md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain md:p-3.5 lg:w-[288px]`,children:[(0,$.jsxs)(`button`,{type:`button`,"data-slot":`changes-tree-toggle`,"aria-expanded":p,onClick:()=>m(e=>!e),className:`flex min-h-11 w-full items-center justify-between gap-2 px-3.5 py-2 text-left text-xs font-semibold text-foreground md:hidden`,children:[(0,$.jsxs)(`span`,{children:[`Changed files`,` `,(0,$.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,t.length,`)`]})]}),(0,$.jsx)(w,{size:16,"aria-hidden":`true`,className:r(`size-4 shrink-0 text-muted-foreground motion-safe:transition-transform`,p&&`rotate-180`)})]}),(0,$.jsx)(`h2`,{className:`mb-3 hidden border-b border-border pb-3 text-xs font-semibold md:block`,children:`Changed files`}),(0,$.jsx)(`div`,{className:r(p?`border-t border-border px-3.5 py-3 md:border-t-0 md:p-0`:`hidden md:block`),children:(0,$.jsx)(E,{root:n,selected:a,onSelect:e=>{o(e),m(!1)}})})]}),(0,$.jsx)(K,{files:t,viewRef:s,mode:c,wrap:l,preview:u,loadFileText:t=>ae(e,t),imageSrc:t=>i(e,t),onOpenInApp:d?e=>f(e):void 0,totals:!1,className:`min-w-0 flex-1`})]})}async function ae(e,t){try{let n=await a(e,t);return n.type!==`file`||n.binary||n.tooLarge?null:n.content??null}catch{return null}}export{te as TaskChangesRoute};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Nn as r,bt as i}from"./project-scope-context-C912rTJP.js";import{$t as a,Bt as o,Q as s,Y as c,Z as l}from"./queries-BvWsZhaH.js";import{h as u}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{S as d,j as f,ot as p}from"./design-icons-CzEoMH9c.js";import{t as m}from"./run-header-BXQ-HR4O.js";import{n as h}from"./diff-controls-C0gH_nhG.js";import{t as g}from"./project-router-DucFIl_x.js";import{b as _}from"./task-groups-fk4Gq4hX.js";import{t as v}from"./centered-state-V15AR_qo.js";import{C as y,en as b,hn as x,w as S,zt as C}from"./index-C4gjdVLi.js";import{t as w}from"./diff-CCzM8XxZ.js";import{t as T}from"./change-counts-CW7O8g5Y.js";import{r as E,t as D}from"./commit-list-DaVNfLE5.js";var O=e(t(),1),k=n();function A(){let{id:e}=u(),t=c(e);return t.isPending?(0,k.jsx)(S,{tab:`changes`}):t.isError?(0,k.jsx)(y,{tab:`changes`,error:t.error}):(0,k.jsx)(j,{run:t.data})}function j({run:e}){let{sha:t}=u(),n=s(e.id,_(e)),i=n.data?.commits[0]?.sha;return(0,k.jsxs)(`div`,{"data-route":`task-commits`,className:`flex min-h-full flex-col`,children:[(0,k.jsx)(m,{run:e,tab:`commits`}),t?(0,k.jsx)(N,{runId:e.id,sha:t}):n.isPending?(0,k.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading commits…`}):n.isError?(0,k.jsx)(v,{icon:(0,k.jsx)(f,{size:16}),tone:n.error instanceof r&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof r&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,k.jsx)(v,{icon:(0,k.jsx)(f,{size:16}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`This task hasn't committed anything on its branch. Autosave commits and any the agent makes appear here.`}):(0,k.jsx)(M,{run:e,commits:n.data.commits,selectedSha:i})]})}function M({run:e,commits:t,selectedSha:n}){let r=l(e.id,n),i=F(e.id,t),a=(0,O.useRef)(null),o=b(),[s,c]=(0,O.useState)(`unified`),[u,d]=(0,O.useState)(!0),m=o?s:`unified`;return(0,k.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-5 px-4 py-5 md:px-9 lg:flex-row lg:items-start`,children:[(0,k.jsxs)(`div`,{className:`w-full shrink-0 lg:w-[380px] xl:w-[420px]`,children:[(0,k.jsx)(D,{slot:`task-commits`,selectedSha:n,heading:(0,k.jsxs)(`h2`,{className:`text-sm font-semibold text-foreground`,children:[t.length,` `,t.length===1?`commit`:`commits`,` in this task`]}),className:`w-full`,commits:t.map(t=>({...t,href:`/tasks/${e.id}/commits/${t.sha}`,stat:i.get(t.sha)}))}),n&&r.data&&r.data.files.length>0?(0,k.jsx)(I,{runId:e.id,sha:n,files:r.data.files,onPick:e=>a.current?.scrollToPath(e)}):null]}),n?(0,k.jsx)(`section`,{"data-slot":`task-commit-preview`,"data-sha":n,className:`min-w-0 flex-1 overflow-hidden rounded-xl border border-border bg-card`,children:r.isPending?(0,k.jsx)(`p`,{className:`px-4 py-8 text-center text-xs text-muted-foreground`,children:`Loading commit diff…`}):r.isError?(0,k.jsx)(v,{icon:(0,k.jsx)(p,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load commit diff`,subtitle:r.error.message}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-2 border-b border-border px-4 py-3`,children:[(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`h3`,{className:`break-words text-sm leading-snug font-semibold text-foreground`,children:r.data.subject}),(0,k.jsxs)(`p`,{className:`mt-0.5 flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,k.jsx)(`span`,{children:r.data.author}),(0,k.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,k.jsx)(`span`,{title:r.data.when,children:C(r.data.when)}),(0,k.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,k.jsx)(`span`,{className:`font-mono select-all`,title:r.data.sha??n,children:(r.data.sha??n).slice(0,8)}),r.data.stat?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,k.jsx)(x,{stat:r.data.stat})]}):null]})]}),(0,k.jsx)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:(0,k.jsx)(h,{mode:s,wrap:u,onModeChange:c,onWrapChange:d})})]}),!r.data.files||r.data.files.length===0?(0,k.jsx)(v,{icon:(0,k.jsx)(f,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,k.jsx)(`div`,{className:`p-4 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem]`,children:(0,k.jsx)(w,{viewRef:a,files:r.data.files,mode:m,wrap:u,totals:!1,className:`min-w-0`})})]})}):null]})}function N({runId:e,sha:t}){return(0,k.jsx)(E,{commit:l(e,t),sha:t,backTo:`/tasks/${e}/commits`,backLabel:`All commits`,slot:`task-commit`,className:`mx-auto flex min-h-0 w-full max-w-[var(--measure)] flex-1 flex-col`,diffClassName:`px-4 py-4 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-9`})}var P=12;function F(e,t){let n=t.length<=P,r=a({queries:t.map(t=>({queryKey:o.runs.commit(e,t.sha),queryFn:({signal:n})=>i(e,t.sha,{signal:n}),enabled:n,retry:!1}))}),s=new Map;return r.forEach((e,n)=>{let r=t[n]?.sha;r&&e.data?.stat&&s.set(r,e.data.stat)}),s}function I({runId:e,sha:t,files:n,onPick:r}){return(0,k.jsxs)(`section`,{"data-slot":`task-commit-files`,className:`mt-4 rounded-xl border border-border bg-card p-4`,children:[(0,k.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1`,children:[(0,k.jsxs)(`h2`,{className:`text-sm font-semibold text-foreground`,children:[n.length,` `,n.length===1?`file`:`files`,` in`,` `,(0,k.jsx)(`span`,{className:`font-mono text-[13px] font-medium`,title:t,children:t.slice(0,8)})]}),(0,k.jsx)(g,{to:`/tasks/${e}/changes`,className:`text-xs text-muted-foreground hover:text-foreground`,children:`All task changes ›`})]}),(0,k.jsx)(`ul`,{className:`space-y-1`,children:n.map(e=>(0,k.jsx)(`li`,{children:(0,k.jsxs)(`button`,{type:`button`,"data-slot":`task-commit-file`,title:e.oldPath?`${e.oldPath} → ${e.path}`:e.path,onClick:()=>r(e.path),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2 text-left text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,children:[(0,k.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-[15px] shrink-0`}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 break-all`,children:e.path}),(0,k.jsx)(T,{adds:e.adds,dels:e.dels,className:`font-mono text-xs`})]})},e.path))})]})}export{A as TaskCommitsRoute};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{Nn as i,et as a,ut as o}from"./project-scope-context-C912rTJP.js";import{B as s,F as c,N as l,Y as u,et as d}from"./queries-BvWsZhaH.js";import{f,g as p,h as m,m as h}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{S as g,T as _,X as v,Y as y,ot as b,u as x}from"./design-icons-CzEoMH9c.js";import{t as S}from"./createLucideIcon-BHp8sXmF.js";import{n as C,t as w}from"./run-header-BXQ-HR4O.js";import{a as T,i as E,n as D,o as O,r as k}from"./file-preview-UYewjhvt.js";import{t as A}from"./button-B7MKxYjT.js";import{t as j}from"./centered-state-V15AR_qo.js";import{$n as M,C as N,Wn as P,w as F}from"./index-C4gjdVLi.js";import{r as I}from"./markdown-RK9z1Cn3.js";var L=S(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),R=S(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),z=e(t(),1),B=n();function V({runId:e,path:t,artifactId:n,worktreePath:r}){let i=s(e,n?null:t),c=l(e,n),u=n?c:i,d=(0,z.useContext)(I),p=f(),m=p.pathname.replace(/\/files\/?$/,`/report`)+p.search,h=u.data,g=(0,z.useMemo)(()=>h?.type===`file`&&h.source!==`artifact`?{runId:e,...d,basePath:h.path}:null,[h,d,e]);if(!t&&!n)return(0,B.jsx)(k,{runId:e,path:null,className:`min-w-0 flex-1`});if(u.isPending)return(0,B.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(u.isError)return(0,B.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,B.jsx)(`h2`,{children:`Could not load this file`}),(0,B.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:u.error.message}),(0,B.jsx)(A,{variant:`outline`,onClick:()=>void u.refetch(),children:`Retry`})]});if(!h)return(0,B.jsx)(`p`,{role:`alert`,className:`p-4`,children:`No file data was returned.`});let _=E(h.path,r,t);if(h.type!==`file`)return(0,B.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,B.jsx)(`h2`,{children:h.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,B.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:_}),(0,B.jsx)(`p`,{className:`text-sm`,children:h.reason}),(0,B.jsx)(A,{variant:`outline`,onClick:()=>void u.refetch(),children:`Retry`})]});let v=h.artifact;return(0,B.jsx)(I.Provider,{value:g,children:(0,B.jsx)(D,{runId:e,entry:h,displayPath:_,documentPreview:!0,readerHref:m,className:`min-w-0 flex-1`,imageUrl:v?a(e,v.id,`image`):o(e,t),...v?{downloadUrl:a(e,v.id,`download`),snapshot:new Date(v.createdAt).toLocaleString()}:{}},v?.id??h.path)})}var H=new Map;function U(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var W=(0,z.createContext)(null);function G(){let{key:e}=f(),t=h()===`POP`,[n,r]=(0,z.useState)({key:e,generation:0});if(n.key===e)return n.generation;let i={key:e,generation:t?n.generation+1:n.generation};return r(i),i.generation}var K=()=>document.querySelector(`[data-slot="main"]`);function q(e,t){let n=(0,z.useRef)(null),r=f(),i=h()===`POP`?r.key:U(r.state),[a]=(0,z.useState)(()=>{let t=i?H.get(i):void 0;return t?.runId===e?t:null}),o=(0,z.useRef)(new Set(a?.folders??[])),s=(0,z.useRef)(new Set),[c,l]=(0,z.useState)(0),u=(0,z.useRef)(a===null),d=(0,z.useCallback)(()=>{u.current&&H.set(r.key,{runId:e,folders:new Set(o.current),tree:n.current?.scrollTop??0,main:K()?.scrollTop??0})},[r.key,e]),p=(0,z.useMemo)(()=>({isOpen:e=>o.current.has(e),setOpen:(e,t)=>{t?o.current.add(e):o.current.delete(e),d()},loading:(e,t)=>{a?.folders.has(e)&&(t?s.current.add(e):s.current.delete(e),l(s.current.size))}}),[a,d]);return(0,z.useEffect)(()=>{if(u.current||!a||!t||s.current.size>0)return;n.current&&(n.current.scrollTop=a.tree);let e=K();e&&(e.scrollTop=a.main),u.current=!0,d()},[a,t,c,d]),(0,z.useEffect)(()=>{d();let e=[n.current,K()].filter(e=>e!==null);for(let t of e)t.addEventListener(`scroll`,d,{passive:!0});return()=>{for(let t of e)t.removeEventListener(`scroll`,d)}},[d]),{tree:n,folders:p}}function J({runId:e,selected:t,onSelect:n}){return(0,B.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,B.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,B.jsx)(Y,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function Y({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=d(e,t),o=(0,z.useContext)(W);return(0,z.useEffect)(()=>{if(!(!t||!o))return o.loading(t,a.isPending),()=>o.loading(t,!1)},[o,t,a.isPending]),a.isPending?(0,B.jsx)(`li`,{"data-slot":`files-tree-loading`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Loading…`}):a.isError?(0,B.jsx)(`li`,{"data-slot":`files-tree-error`,className:`px-1.5 py-1 text-xs text-danger`,style:{paddingLeft:`${6+n*14}px`},children:a.error.message}):a.data.type===`dir`?a.data.entries.length===0?(0,B.jsx)(`li`,{"data-slot":`files-tree-empty`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Empty directory`}):(0,B.jsx)(B.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,B.jsx)(X,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,B.jsx)(Z,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function X({runId:e,name:t,path:n,depth:i,selected:a,onSelect:o}){let s=(0,z.useContext)(W),[c,l]=(0,z.useState)(()=>s?.isOpen(n)??!1);return(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":c?`open`:`closed`,"aria-expanded":c,onClick:()=>{s?.setOpen(n,!c),l(!c)},className:`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+i*14}px`},children:[(0,B.jsx)(x,{size:16,"aria-hidden":`true`,className:r(`order-last ml-auto size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,c&&`rotate-90`)}),(0,B.jsx)(_,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,B.jsx)(`span`,{className:`min-w-0 truncate font-normal`,children:t})]}),c?(0,B.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,B.jsx)(Y,{runId:e,path:n,depth:i+1,selected:a,onSelect:o})}):null]})}function Z({name:e,path:t,size:n,depth:i,selected:a,onSelect:o}){let s=a===t,c=O(t)?R:g;return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":s?`true`:void 0,onClick:()=>o(t),className:r(`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,s?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${6+i*14}px`},children:[(0,B.jsx)(c,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,B.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs tabular-nums text-soft-foreground`,children:T(n)})]})})}function Q(){let{id:e}=m(),t=u(e),n=G();return t.isPending?(0,B.jsx)(F,{tab:`files`}):t.isError?(0,B.jsx)(N,{tab:`files`,error:t.error}):(0,B.jsx)(C,{runId:t.data.id,children:(0,B.jsx)(ee,{run:t.data},`${t.data.id}:${n}`)})}function $(e,t,n,r){let i=s(e,r||n!==null?null:t),a=l(e,r?null:n);return r||t===null&&n===null?!0:!(n===null?i:a).isPending}function ee({run:e}){let t=d(e.id,``),n=c(e.id),[r,a]=p(),o=r.get(`path`),s=r.get(`artifact`),l=r.getAll(`path`).length>1||r.getAll(`artifact`).length>1||o!==null&&s!==null,[u,f]=(0,z.useState)(o??``);(0,z.useEffect)(()=>f(o??``),[o]);let m=(e,t)=>{let n=new URLSearchParams(r);n.delete(`path`),n.delete(`artifact`),n.set(e,t),a(n)},h=t.isError&&t.error instanceof i&&t.error.status===409,g=$(e.id,o,s,l),_=q(e.id,!t.isPending&&g);return(0,B.jsxs)(`div`,{"data-route":`task-files`,className:`flex min-h-full flex-col`,children:[(0,B.jsx)(w,{run:e,tab:`files`}),(0,B.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-4 pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),u.trim()&&m(`path`,u.trim())},children:[(0,B.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,B.jsx)(v,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,B.jsx)(P,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:u,onChange:e=>f(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,B.jsx)(A,{type:`submit`,variant:`outline`,className:`h-11 shrink-0`,disabled:!u.trim(),children:`Open file`})]}),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-col items-stretch gap-5 px-4 py-[22px] [--diff-sticky-top:1rem] md:flex-row md:items-start md:px-9`,children:[(0,B.jsxs)(`aside`,{ref:_.tree,"data-slot":`files-tree-pane`,className:`w-full shrink-0 rounded-xl border border-border bg-card p-3.5 md:sticky md:top-[var(--diff-sticky-top)] md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain lg:w-72`,children:[(0,B.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,B.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,B.jsx)(j,{icon:h?(0,B.jsx)(L,{}):(0,B.jsx)(b,{size:16}),tone:h?`neutral`:`danger`,heading:`h2`,title:h?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,B.jsx)(W.Provider,{value:_.folders,children:(0,B.jsx)(J,{runId:e.id,selected:o,onSelect:e=>m(`path`,e)})}),(0,B.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,B.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),n.isPending?(0,B.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):n.isError?(0,B.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):n.data.artifacts.length===0?(0,B.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,B.jsx)(`ul`,{children:n.data.artifacts.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,"data-slot":`artifact-row`,"aria-current":e.id===s?`true`:void 0,className:`group flex min-h-11 w-full items-center gap-2 rounded px-2 py-2 text-left text-xs text-foreground hover:bg-muted focus-visible:ring-2 aria-[current=true]:bg-muted aria-[current=true]:font-medium`,onClick:()=>m(`artifact`,e.id),children:[(0,B.jsx)(M,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 wrap-anywhere underline-offset-2 group-hover:underline`,children:e.name}),(0,B.jsx)(x,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground group-hover:text-foreground`})]})},e.id))}),(0,B.jsxs)(A,{variant:`outline`,size:`sm`,"data-action":`refresh-artifacts`,className:`mt-2 max-md:h-11 no-hover:h-11`,onClick:()=>void n.refetch(),children:[(0,B.jsx)(y,{"aria-hidden":`true`}),`Refresh published files`]})]})]}),l?(0,B.jsx)(`p`,{role:`alert`,className:`p-4`,children:`Invalid file link: choose either a path or a published artifact.`}):o!==null||s!==null||t.isSuccess?(0,B.jsx)(V,{runId:e.id,path:o,artifactId:s,worktreePath:e.worktreePath}):null]}),(0,B.jsx)(`p`,{className:`px-4 pb-6 text-xs text-muted-foreground md:px-9`,children:`Browsing files is read-only. Worktree contents may differ from your main checkout. Published files are snapshots.`})]})}export{Q as TaskFilesRoute};
@@ -1 +1 @@
1
- import{t as e}from"./react-runtime-CCIEwYL0.js";import{n as t}from"./utils-DSMR_WLb.js";import{G as n,di as r}from"./project-scope-context-C912rTJP.js";import{Bt as i,Y as a,bt as o,o as s,r as c,sn as l,vt as u,xt as d}from"./queries-DRpvYgai.js";import{h as f}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{g as p,p as m}from"./tasks-table-CE_VVk0w.js";import{F as h,ot as g,p as _}from"./design-icons-CzEoMH9c.js";import{t as v}from"./run-header-BqoJkEiw.js";import{t as y}from"./external-link-BE6y205O.js";import{u as b}from"./reference-chip-zRuFkaGy.js";import{t as x}from"./button-BQ2y4XRB.js";import{t as S}from"./project-router-DucFIl_x.js";import{t as C}from"./centered-state-V15AR_qo.js";import{C as w,S as T,Xn as E}from"./index-DpGDjVpg.js";import{n as D,o as O,t as k}from"./use-hand-to-agent-state-D2K59hO0.js";var A=e(),j={issue:`Issue`,pr:`Pull request`};function M({kind:e}){let{id:t}=f(),n=a(t);return n.isPending?(0,A.jsx)(T,{kind:e}):n.isError?(0,A.jsx)(w,{tab:`github-item`,error:n.error}):(0,A.jsx)(N,{run:n.data,kind:e})}function N({run:e,kind:t}){let{n}=f(),r=Number(n),i=o(),a=d(),c=u(),l=a.isPending||c.isPending,p=m(e,i).some(e=>e.kind===t&&e.number===r),h=s(t,r,p);return(0,A.jsxs)(`div`,{"data-route":`task-github-item`,className:`flex min-h-full flex-col`,children:[(0,A.jsx)(v,{run:e,tab:{kind:t,number:r}}),p?(0,A.jsx)(V,{run:e,kind:t,number:r,repoBase:i,item:h}):l?(0,A.jsx)(T,{kind:t,number:r,heading:`h2`}):(0,A.jsx)(C,{icon:(0,A.jsx)(E,{size:16}),tone:`neutral`,heading:`h2`,title:`#${n} is not linked to this task`,subtitle:`Only the issues and pull requests this task references open here.`,actions:(0,A.jsx)(x,{asChild:!0,variant:`outline`,children:(0,A.jsx)(S,{to:`/tasks/${e.id}`,children:`Back to the session`})})})]})}function P(e,t){return e===`pr`&&t.data?.available===!0&&t.data.item!==null}function F(e,t,n,r){return e===`pr`?n?.[t]??r:r}function I({retry:e,kind:t,number:n}){return(0,A.jsx)(x,{variant:`outline`,disabled:e.isPending,onClick:()=>e.mutate(i.githubItem(t,n)),children:`Retry`})}function L({kind:e,number:t,error:n,retryButton:r}){return(0,A.jsx)(C,{icon:(0,A.jsx)(g,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load ${j[e].toLowerCase()} #${t}`,subtitle:n.message,actions:r})}function R({run:e,kind:n,number:r,repoBase:i,reason:a,retryError:o,retryButton:s}){let c=n===`pr`?h:_,l=p(e,i).find(e=>e.kind===`PR`==(n===`pr`)&&e.number===r)?.url;return(0,A.jsx)(C,{icon:(0,A.jsx)(c,{size:16}),tone:`neutral`,heading:`h2`,title:`GitHub is unavailable`,subtitle:o?.message??a,actions:(0,A.jsxs)(A.Fragment,{children:[s,l&&t(l)?(0,A.jsx)(x,{asChild:!0,variant:`outline`,children:(0,A.jsxs)(`a`,{href:l,target:`_blank`,rel:`noopener noreferrer`,children:[`open on GitHub`,(0,A.jsx)(y,{"aria-hidden":`true`})]})}):null]})})}function z({label:e,repoBase:t}){return(0,A.jsx)(C,{icon:(0,A.jsx)(b,{}),tone:`neutral`,heading:`h2`,title:`${e} was not found in ${H(t)}`,subtitle:`It may have been deleted, or the number points at a different repository.`})}function B({kind:e,item:t,labelColors:n,checks:r}){return(0,A.jsx)(`div`,{className:`min-w-0 px-0.5 md:px-2`,children:(0,A.jsx)(O,{item:t,colors:n??{},checks:r,backLink:null,subNav:null,children:e===`issue`?(0,A.jsx)(U,{item:t},t.url):null})})}function V({run:e,kind:t,number:i,repoBase:a,item:o}){let s=r(),u=l({mutationFn:e=>n(t,i,{refresh:!0}),onSuccess:(e,t)=>s.setQueryData(t,e)}),d=P(t,o),f=c(d?[i]:[],d),p=f.data?.available?f.data.checks:void 0,m=`${j[t]} #${i}`,h=(0,A.jsx)(I,{retry:u,kind:t,number:i});if(o.isPending)return(0,A.jsx)(T,{kind:t,number:i,heading:`h2`});if(o.isError)return(0,A.jsx)(L,{kind:t,number:i,error:u.error??o.error,retryButton:h});let g=o.data;return g.available?g.item?(0,A.jsx)(B,{kind:t,item:g.item,labelColors:g.labelColors,checks:F(t,i,p,g.item.checks)}):(0,A.jsx)(z,{label:m,repoBase:a}):(0,A.jsx)(R,{run:e,kind:t,number:i,repoBase:a,reason:g.reason,retryError:u.error,retryButton:h})}function H(e){if(!e)return`this repository`;try{return new URL(e).pathname.split(`/`).filter(Boolean).slice(0,2).join(`/`)||`this repository`}catch{return`this repository`}}function U({item:e}){let t=k();return(0,A.jsx)(D,{item:e,workflows:t.workflows.data?.workflows??[],skills:t.skillList,workflow:t.workflow,onWorkflowChange:t.setWorkflow,selectedSkills:t.selectedSkills,onSkillsChange:t.setSelectedSkills,engine:t.engine,onEngineChange:t.setEngine,queuedRunId:t.queued.get(e.url)??null,onQueued:t.onQueued},e.url)}export{M as TaskGithubItemRoute};
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{n as t}from"./utils-DSMR_WLb.js";import{G as n,di as r}from"./project-scope-context-C912rTJP.js";import{Bt as i,Qt as a,Y as o,bt as s,o as c,r as l,vt as u,xt as d}from"./queries-BvWsZhaH.js";import{h as f}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{g as p,p as m}from"./tasks-table-JFvtNCc1.js";import{F as h,ot as g,p as _}from"./design-icons-CzEoMH9c.js";import{t as v}from"./run-header-BXQ-HR4O.js";import{t as y}from"./external-link-BE6y205O.js";import{u as b}from"./reference-chip-Clhghu8I.js";import{t as x}from"./button-B7MKxYjT.js";import{t as S}from"./project-router-DucFIl_x.js";import{t as C}from"./centered-state-V15AR_qo.js";import{C as w,S as T,Xn as E}from"./index-C4gjdVLi.js";import{n as D,o as O,t as k}from"./use-hand-to-agent-state-C0vpMYLO.js";var A=e(),j={issue:`Issue`,pr:`Pull request`};function M({kind:e}){let{id:t}=f(),n=o(t);return n.isPending?(0,A.jsx)(T,{kind:e}):n.isError?(0,A.jsx)(w,{tab:`github-item`,error:n.error}):(0,A.jsx)(N,{run:n.data,kind:e})}function N({run:e,kind:t}){let{n}=f(),r=Number(n),i=s(),a=d(),o=u(),l=a.isPending||o.isPending,p=m(e,i).some(e=>e.kind===t&&e.number===r),h=c(t,r,p);return(0,A.jsxs)(`div`,{"data-route":`task-github-item`,className:`flex min-h-full flex-col`,children:[(0,A.jsx)(v,{run:e,tab:{kind:t,number:r}}),p?(0,A.jsx)(V,{run:e,kind:t,number:r,repoBase:i,item:h}):l?(0,A.jsx)(T,{kind:t,number:r,heading:`h2`}):(0,A.jsx)(C,{icon:(0,A.jsx)(E,{size:16}),tone:`neutral`,heading:`h2`,title:`#${n} is not linked to this task`,subtitle:`Only the issues and pull requests this task references open here.`,actions:(0,A.jsx)(x,{asChild:!0,variant:`outline`,children:(0,A.jsx)(S,{to:`/tasks/${e.id}`,children:`Back to the session`})})})]})}function P(e,t){return e===`pr`&&t.data?.available===!0&&t.data.item!==null}function F(e,t,n,r){return e===`pr`?n?.[t]??r:r}function I({retry:e,kind:t,number:n}){return(0,A.jsx)(x,{variant:`outline`,disabled:e.isPending,onClick:()=>e.mutate(i.githubItem(t,n)),children:`Retry`})}function L({kind:e,number:t,error:n,retryButton:r}){return(0,A.jsx)(C,{icon:(0,A.jsx)(g,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load ${j[e].toLowerCase()} #${t}`,subtitle:n.message,actions:r})}function R({run:e,kind:n,number:r,repoBase:i,reason:a,retryError:o,retryButton:s}){let c=n===`pr`?h:_,l=p(e,i).find(e=>e.kind===`PR`==(n===`pr`)&&e.number===r)?.url;return(0,A.jsx)(C,{icon:(0,A.jsx)(c,{size:16}),tone:`neutral`,heading:`h2`,title:`GitHub is unavailable`,subtitle:o?.message??a,actions:(0,A.jsxs)(A.Fragment,{children:[s,l&&t(l)?(0,A.jsx)(x,{asChild:!0,variant:`outline`,children:(0,A.jsxs)(`a`,{href:l,target:`_blank`,rel:`noopener noreferrer`,children:[`open on GitHub`,(0,A.jsx)(y,{"aria-hidden":`true`})]})}):null]})})}function z({label:e,repoBase:t}){return(0,A.jsx)(C,{icon:(0,A.jsx)(b,{}),tone:`neutral`,heading:`h2`,title:`${e} was not found in ${H(t)}`,subtitle:`It may have been deleted, or the number points at a different repository.`})}function B({kind:e,item:t,labelColors:n,checks:r}){return(0,A.jsx)(`div`,{className:`min-w-0 px-0.5 md:px-2`,children:(0,A.jsx)(O,{item:t,colors:n??{},checks:r,backLink:null,subNav:null,children:e===`issue`?(0,A.jsx)(U,{item:t},t.url):null})})}function V({run:e,kind:t,number:i,repoBase:o,item:s}){let c=r(),u=a({mutationFn:e=>n(t,i,{refresh:!0}),onSuccess:(e,t)=>c.setQueryData(t,e)}),d=P(t,s),f=l(d?[i]:[],d),p=f.data?.available?f.data.checks:void 0,m=`${j[t]} #${i}`,h=(0,A.jsx)(I,{retry:u,kind:t,number:i});if(s.isPending)return(0,A.jsx)(T,{kind:t,number:i,heading:`h2`});if(s.isError)return(0,A.jsx)(L,{kind:t,number:i,error:u.error??s.error,retryButton:h});let g=s.data;return g.available?g.item?(0,A.jsx)(B,{kind:t,item:g.item,labelColors:g.labelColors,checks:F(t,i,p,g.item.checks)}):(0,A.jsx)(z,{label:m,repoBase:o}):(0,A.jsx)(R,{run:e,kind:t,number:i,repoBase:o,reason:g.reason,retryError:u.error,retryButton:h})}function H(e){if(!e)return`this repository`;try{return new URL(e).pathname.split(`/`).filter(Boolean).slice(0,2).join(`/`)||`this repository`}catch{return`this repository`}}function U({item:e}){let t=k();return(0,A.jsx)(D,{item:e,workflows:t.workflows.data?.workflows??[],skills:t.skillList,workflow:t.workflow,onWorkflowChange:t.setWorkflow,selectedSkills:t.selectedSkills,onSkillsChange:t.setSelectedSkills,engine:t.engine,onEngineChange:t.setEngine,queuedRunId:t.queued.get(e.url)??null,onQueued:t.onQueued},e.url)}export{M as TaskGithubItemRoute};
@@ -1 +1 @@
1
- import{Bn as e,Cn as t,Ir as n,On as r,Qn as i,kn as a}from"./project-scope-context-C912rTJP.js";import"./queries-DRpvYgai.js";import"./attention-BFUaj1mU.js";function o(e,t){let n;for(let r of e)!r.sessionId||r.id===t||(!n||!r.startedAt||!n.startedAt||r.startedAt>=n.startedAt)&&(n=r);return n}function s(e,t){return e?.backend??t?.runner??`claude`}function c(e,t){let n;for(let r of e)r.removedBackend===void 0&&(t===void 0||r.sessionId!==t)||(!n||!r.startedAt||!n.startedAt||r.startedAt>=n.startedAt)&&(n=r);return n?.removedBackend===void 0?void 0:n}function l(e){let t=o(e.steps),n=c(e.steps,t?.sessionId)?void 0:t;return{sessionId:n?.sessionId,backend:s(n,e),profileId:n?.profileId}}function u(e){return e.command===void 0&&e.kind!==`plugin`}function d(e){let t=e.workflowCursor?.mode===`resume`?e.workflowCursor.stepId:void 0;if(t&&e.steps.find(e=>e.id===t)?.status===`failed`)return t;let n=o(e.steps);if(n)return n.synthetic===`continuation`&&n.continuesStepId!==void 0?n.continuesStepId:e.steps.find(e=>e.sessionId===n.sessionId)?.id??n.id}function f(e,t=!1){if(e.delegation?.role!==`worker`)return;let n=e.workflowDef?.steps;if(!n?.length)return;if(t)return n.find(u);let r=d(e);return(r?n.find(e=>e.id===r&&u(e)):void 0)??[...n].reverse().find(u)}var p=new Set([`queued`,`running`,`waiting`]);function m(e){return p.has(e)}function h(e){return i(e)?!1:e.status===`queued`||e.status===`running`||e.status===`waiting`}function g(e){return h(e)&&e.status!==`queued`}function _(t,n,r){return t.archived||!(t.status===`done`||t.status===`failed`||t.status===`cancelled`)||t.delegation?.role===`worker`||r!==void 0&&e(t)!==r?!1:n===`unpinned`?!t.pinned:n!==`pinned`||t.pinned===!0}var v=[`done`,`failed`];function y(e){return e.archived||i(e)||!v.includes(e.status)?!1:e.finishedAt!==void 0}function b(e){let t=e.finishedAt;return t===void 0||!y(e)?!1:e.seenAt===void 0||e.seenAt<t}var x=[`Needs you`,`Finished`,`Working`,`Archived`],S={waiting:0,review:1,running:2,queued:4,done:5,failed:6,cancelled:7},C=3,w=e=>i(e)?C:S[e.status]??9;function T(e){let n=e=>t[r(e).bucket];return[...e].sort((e,t)=>n(e)-n(t)||w(e)-w(t))[0]}function E(e,t){return t===`archived`?`Archived`:a(e)?`Needs you`:e.status===`waiting`||e.status===`running`||e.status===`queued`?`Working`:`Finished`}function D(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function O(e){let t=/^(\d{1,9}): (.+)$/.exec(e),n=t?.[1],r=t?.[2];return n===void 0||r===void 0?{ref:null,rest:e}:{ref:Number(n),rest:r}}function k(e,t){return t!==void 0&&O(e).ref===t}function A(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt));return new Map(t.map((e,t)=>[e.id,t+1]))}function j(e,t){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,n)=>{if(t!==`archived`){let t=Number(!!n.pinned)-Number(!!e.pinned);if(t!==0)return t}let r=w(e)-w(n);if(r!==0)return r;if(i(e)&&i(n)){let t=e.autoResumeAt.localeCompare(n.autoResumeAt);if(t!==0)return t}return e.status===`queued`&&n.status===`queued`?e.createdAt.localeCompare(n.createdAt):n.createdAt.localeCompare(e.createdAt)})}function M(e){return e.delegation?.role===`worker`}function N(e,t){if(e==null)return null;let n=t.find(t=>t.id===e);return!n||!M(n)?e:n.delegation?.parentRunId??e}function P(e,t,n=A(e)){let r=j(e,t).filter(e=>!M(e)),i=new Map,a=(e,t)=>{let n=i.get(e);n?n.push(t):i.set(e,[t])};for(let e of r)a(E(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null});return x.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function F(e,t={}){let r=typeof t==`number`?{overall:t}:n(t),i={"Needs you":`needsYou`,Finished:`finished`,Working:`working`},a=[],o=r.overall===void 0?10:r.overall??1/0;for(let t of e){let e=t.label===`Archived`?1/0:r[i[t.label]]??1/0,n=t.rows.filter(n=>{let r=n.run.pinned;return t.label!==`Archived`&&r?!0:o<=0||e<=0?!1:(--o,--e,!0)});n.length&&a.push({label:t.label,rows:n})}return a}function I(e,t){if(t.length===0)return[...e];let n=new Set(e.map(e=>e.id)),r=new Set,i=t.filter(e=>n.has(e.id)||r.has(e.id)?!1:(r.add(e.id),!0));return[...e,...i]}function L(e){let t=0,n=0,r=0;for(let i of e)if(!M(i)){if(i.archived){n+=1;continue}t+=1,a(i)&&(r+=1)}return{active:t,archived:n,waiting:r}}function R(t,n,r){return t.filter(t=>!t.archived&&(!r||e(t)===(n===`automations`)))}var z={"Needs you":`needs-you`,Finished:`finished`,Working:`working`},B=Object.keys(z),V=`section`;function H(e,t,n){let r=`${V}=${z[e]}`;return n?`/?origin=${t===`automations`?`automations`:`direct`}&${r}`:`/?${r}`}function U(e){return B.find(t=>z[t]===e)??null}function W(t,n){let r={active:0,automations:0,activeWaiting:0,automationsWaiting:0};for(let i of t){if(M(i)||i.archived)continue;let t=+!!a(i);n&&e(i)?(r.automations+=1,r.automationsWaiting+=t):(r.active+=1,r.activeWaiting+=t)}return r}export{_ as C,s as D,o as E,f as O,g as S,l as T,O as _,P as a,h as b,T as c,k as d,D as f,R as g,W as h,F as i,U as l,N as m,V as n,M as o,H as p,B as r,L as s,x as t,A as u,I as v,b as w,m as x,y};
1
+ import{Bn as e,Cn as t,Ir as n,On as r,Qn as i,kn as a}from"./project-scope-context-C912rTJP.js";import"./queries-BvWsZhaH.js";import"./attention-BFUaj1mU.js";function o(e,t){let n;for(let r of e)!r.sessionId||r.id===t||(!n||!r.startedAt||!n.startedAt||r.startedAt>=n.startedAt)&&(n=r);return n}function s(e,t){return e?.backend??t?.runner??`claude`}function c(e,t){let n;for(let r of e)r.removedBackend===void 0&&(t===void 0||r.sessionId!==t)||(!n||!r.startedAt||!n.startedAt||r.startedAt>=n.startedAt)&&(n=r);return n?.removedBackend===void 0?void 0:n}function l(e){let t=o(e.steps),n=c(e.steps,t?.sessionId)?void 0:t;return{sessionId:n?.sessionId,backend:s(n,e),profileId:n?.profileId}}function u(e){return e.command===void 0&&e.kind!==`plugin`}function d(e){let t=e.workflowCursor?.mode===`resume`?e.workflowCursor.stepId:void 0;if(t&&e.steps.find(e=>e.id===t)?.status===`failed`)return t;let n=o(e.steps);if(n)return n.synthetic===`continuation`&&n.continuesStepId!==void 0?n.continuesStepId:e.steps.find(e=>e.sessionId===n.sessionId)?.id??n.id}function f(e,t=!1){if(e.delegation?.role!==`worker`)return;let n=e.workflowDef?.steps;if(!n?.length)return;if(t)return n.find(u);let r=d(e);return(r?n.find(e=>e.id===r&&u(e)):void 0)??[...n].reverse().find(u)}var p=new Set([`queued`,`running`,`waiting`]);function m(e){return p.has(e)}function h(e){return i(e)?!1:e.status===`queued`||e.status===`running`||e.status===`waiting`}function g(e){return h(e)&&e.status!==`queued`}function _(t,n,r){return t.archived||!(t.status===`done`||t.status===`failed`||t.status===`cancelled`)||t.delegation?.role===`worker`||r!==void 0&&e(t)!==r?!1:n===`unpinned`?!t.pinned:n!==`pinned`||t.pinned===!0}var v=[`done`,`failed`];function y(e){return e.archived||i(e)||!v.includes(e.status)?!1:e.finishedAt!==void 0}function b(e){let t=e.finishedAt;return t===void 0||!y(e)?!1:e.seenAt===void 0||e.seenAt<t}var x=[`Needs you`,`Finished`,`Working`,`Archived`],S={waiting:0,review:1,running:2,queued:4,done:5,failed:6,cancelled:7},C=3,w=e=>i(e)?C:S[e.status]??9;function T(e){let n=e=>t[r(e).bucket];return[...e].sort((e,t)=>n(e)-n(t)||w(e)-w(t))[0]}function E(e,t){return t===`archived`?`Archived`:a(e)?`Needs you`:e.status===`waiting`||e.status===`running`||e.status===`queued`?`Working`:`Finished`}function D(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function O(e){let t=/^(\d{1,9}): (.+)$/.exec(e),n=t?.[1],r=t?.[2];return n===void 0||r===void 0?{ref:null,rest:e}:{ref:Number(n),rest:r}}function k(e,t){return t!==void 0&&O(e).ref===t}function A(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt));return new Map(t.map((e,t)=>[e.id,t+1]))}function j(e,t){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,n)=>{if(t!==`archived`){let t=Number(!!n.pinned)-Number(!!e.pinned);if(t!==0)return t}let r=w(e)-w(n);if(r!==0)return r;if(i(e)&&i(n)){let t=e.autoResumeAt.localeCompare(n.autoResumeAt);if(t!==0)return t}return e.status===`queued`&&n.status===`queued`?e.createdAt.localeCompare(n.createdAt):n.createdAt.localeCompare(e.createdAt)})}function M(e){return e.delegation?.role===`worker`}function N(e,t){if(e==null)return null;let n=t.find(t=>t.id===e);return!n||!M(n)?e:n.delegation?.parentRunId??e}function P(e,t,n=A(e)){let r=j(e,t).filter(e=>!M(e)),i=new Map,a=(e,t)=>{let n=i.get(e);n?n.push(t):i.set(e,[t])};for(let e of r)a(E(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null});return x.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function F(e,t={}){let r=typeof t==`number`?{overall:t}:n(t),i={"Needs you":`needsYou`,Finished:`finished`,Working:`working`},a=[],o=r.overall===void 0?10:r.overall??1/0;for(let t of e){let e=t.label===`Archived`?1/0:r[i[t.label]]??1/0,n=t.rows.filter(n=>{let r=n.run.pinned;return t.label!==`Archived`&&r?!0:o<=0||e<=0?!1:(--o,--e,!0)});n.length&&a.push({label:t.label,rows:n})}return a}function I(e,t){if(t.length===0)return[...e];let n=new Set(e.map(e=>e.id)),r=new Set,i=t.filter(e=>n.has(e.id)||r.has(e.id)?!1:(r.add(e.id),!0));return[...e,...i]}function L(e){let t=0,n=0,r=0;for(let i of e)if(!M(i)){if(i.archived){n+=1;continue}t+=1,a(i)&&(r+=1)}return{active:t,archived:n,waiting:r}}function R(t,n,r){return t.filter(t=>!t.archived&&(!r||e(t)===(n===`automations`)))}var z={"Needs you":`needs-you`,Finished:`finished`,Working:`working`},B=Object.keys(z),V=`section`;function H(e,t,n){let r=`${V}=${z[e]}`;return n?`/?origin=${t===`automations`?`automations`:`direct`}&${r}`:`/?${r}`}function U(e){return B.find(t=>z[t]===e)??null}function W(t,n){let r={active:0,automations:0,activeWaiting:0,automationsWaiting:0};for(let i of t){if(M(i)||i.archived)continue;let t=+!!a(i);n&&e(i)?(r.automations+=1,r.automationsWaiting+=t):(r.active+=1,r.activeWaiting+=t)}return r}export{_ as C,s as D,o as E,f as O,g as S,l as T,O as _,P as a,h as b,T as c,k as d,D as f,R as g,W as h,F as i,U as l,N as m,V as n,M as o,H as p,B as r,L as s,x as t,A as u,I as v,b as w,m as x,y};