@hearsay-tools/squawk 0.19.0-dev.9054 → 0.19.0-dev.9065

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 (188) hide show
  1. package/dist/built-in-cli-commands.js +1 -1
  2. package/dist/built-in-cli-commands.js.map +1 -1
  3. package/dist/cli-dispatch.d.ts +1 -1
  4. package/dist/cli-dispatch.js +19 -4
  5. package/dist/cli-dispatch.js.map +1 -1
  6. package/dist/config.d.ts +1 -1
  7. package/dist/config.js +3 -0
  8. package/dist/config.js.map +1 -1
  9. package/dist/contract/health.d.ts +2 -2
  10. package/dist/contract/hosts.d.ts +141 -0
  11. package/dist/contract/index.d.ts +1 -0
  12. package/dist/contract/index.js +140 -8
  13. package/dist/contract/projects.d.ts +8 -2
  14. package/dist/contract/workspace.d.ts +10 -0
  15. package/dist/core/cli-registry.d.ts +1 -0
  16. package/dist/core/server-hook-registry.d.ts +4 -2
  17. package/dist/core/server-hook-registry.js.map +1 -1
  18. package/dist/delegation/routes.d.ts +4 -4
  19. package/dist/delegation/transport.d.ts +14 -14
  20. package/dist/features/automations/automations-routes.d.ts +150 -150
  21. package/dist/features/automations/automations-routes.js +4 -3
  22. package/dist/features/automations/automations-routes.js.map +1 -1
  23. package/dist/features/automations/tools.d.ts +8 -8
  24. package/dist/features/hosts/cli.d.ts +8 -0
  25. package/dist/features/hosts/cli.js +172 -0
  26. package/dist/features/hosts/cli.js.map +1 -0
  27. package/dist/features/hosts/index.d.ts +12 -0
  28. package/dist/features/hosts/index.js +34 -0
  29. package/dist/features/hosts/index.js.map +1 -0
  30. package/dist/features/hosts/registry.d.ts +52 -0
  31. package/dist/features/hosts/registry.js +198 -0
  32. package/dist/features/hosts/registry.js.map +1 -0
  33. package/dist/features/hosts/routes.d.ts +348 -0
  34. package/dist/features/hosts/routes.js +113 -0
  35. package/dist/features/hosts/routes.js.map +1 -0
  36. package/dist/features/hosts/ssh-config.d.ts +9 -0
  37. package/dist/features/hosts/ssh-config.js +59 -0
  38. package/dist/features/hosts/ssh-config.js.map +1 -0
  39. package/dist/home/entry-authorization.js +1 -1
  40. package/dist/home/entry-authorization.js.map +1 -1
  41. package/dist/home/home.d.ts +2 -0
  42. package/dist/home/home.js +1 -0
  43. package/dist/home/home.js.map +1 -1
  44. package/dist/home/migration-plan.js +1 -1
  45. package/dist/home/migration-plan.js.map +1 -1
  46. package/dist/index.js +2 -2
  47. package/dist/index.js.map +1 -1
  48. package/dist/runs/run-decode.d.ts +72 -72
  49. package/dist/serve-boot.d.ts +1 -1
  50. package/dist/serve-boot.js +4 -2
  51. package/dist/serve-boot.js.map +1 -1
  52. package/dist/serve-command.d.ts +2 -2
  53. package/dist/serve-command.js +47 -31
  54. package/dist/serve-command.js.map +1 -1
  55. package/dist/server/activity-routes.js +1 -1
  56. package/dist/server/activity-routes.js.map +1 -1
  57. package/dist/server/activity-sources.d.ts +1 -1
  58. package/dist/server/activity-sources.js +6 -4
  59. package/dist/server/activity-sources.js.map +1 -1
  60. package/dist/server/activity-topic.js +5 -2
  61. package/dist/server/activity-topic.js.map +1 -1
  62. package/dist/server/live-routes.d.ts +8 -7
  63. package/dist/server/live-routes.js +2 -2
  64. package/dist/server/live-routes.js.map +1 -1
  65. package/dist/server/models-routes.d.ts +12 -12
  66. package/dist/server/plugin-server-hooks.js +7 -4
  67. package/dist/server/plugin-server-hooks.js.map +1 -1
  68. package/dist/server/project-context.d.ts +3 -1
  69. package/dist/server/project-context.js +5 -1
  70. package/dist/server/project-context.js.map +1 -1
  71. package/dist/server/project-settings-routes.d.ts +107 -107
  72. package/dist/server/projects-routes.d.ts +107 -45
  73. package/dist/server/projects-routes.js +15 -8
  74. package/dist/server/projects-routes.js.map +1 -1
  75. package/dist/server/providers-routes.d.ts +16 -2
  76. package/dist/server/providers-routes.js +9 -4
  77. package/dist/server/providers-routes.js.map +1 -1
  78. package/dist/server/runs-routes.d.ts +4 -4
  79. package/dist/server/server-deps.d.ts +11 -4
  80. package/dist/server/server-deps.js +26 -9
  81. package/dist/server/server-deps.js.map +1 -1
  82. package/dist/server/server.d.ts +2811 -2710
  83. package/dist/server/server.js +23 -31
  84. package/dist/server/server.js.map +1 -1
  85. package/dist/server/start-server.js +22 -14
  86. package/dist/server/start-server.js.map +1 -1
  87. package/dist/server/workspace-identity-routes.d.ts +29 -0
  88. package/dist/server/workspace-identity-routes.js +21 -0
  89. package/dist/server/workspace-identity-routes.js.map +1 -0
  90. package/dist/server/workspace-live-routes.d.ts +28 -7
  91. package/dist/server/workspace-live-routes.js +5 -1
  92. package/dist/server/workspace-live-routes.js.map +1 -1
  93. package/dist/server/workspace-projects.d.ts +11 -8
  94. package/dist/server/workspace-projects.js +50 -12
  95. package/dist/server/workspace-projects.js.map +1 -1
  96. package/dist/server/workspace-routes.d.ts +1 -1
  97. package/dist/server/workspace-routes.js +2 -2
  98. package/dist/server/workspace-routes.js.map +1 -1
  99. package/dist/server/workspace-run-feed.d.ts +4 -4
  100. package/dist/server/workspace-run-feed.js +2 -0
  101. package/dist/server/workspace-run-feed.js.map +1 -1
  102. package/dist/task-cli/discovery.js +7 -0
  103. package/dist/task-cli/discovery.js.map +1 -1
  104. package/dist/workflows/continuation-admission.d.ts +72 -72
  105. package/dist/workflows/run/wait-engine.d.ts +72 -72
  106. package/dist/workspace/backups.d.ts +1 -1
  107. package/dist/workspace/backups.js +1 -1
  108. package/dist/workspace/backups.js.map +1 -1
  109. package/package.json +4 -4
  110. package/web/dist/assets/{accounts-section-BfswfXCZ.js → accounts-section-CdmTsc7W.js} +1 -1
  111. package/web/dist/assets/{activity-motion-CFx-RRu7.js → activity-motion-CrFzRrI5.js} +1 -1
  112. package/web/dist/assets/{activity-route-C2WO0whr.js → activity-route-CGRkPwJP.js} +1 -1
  113. package/web/dist/assets/{agent-accounts-BuceIkTR.js → agent-accounts-D_7QcFSx.js} +1 -1
  114. package/web/dist/assets/{agent-config-section-C7DGYIqM.js → agent-config-section-C6I_sRta.js} +1 -1
  115. package/web/dist/assets/{agent-defaults-section-FxdpHuW8.js → agent-defaults-section-CiOFMcep.js} +1 -1
  116. package/web/dist/assets/{appearance-DAxfuDE0.js → appearance-CBX1qOwx.js} +1 -1
  117. package/web/dist/assets/{archive-on-merge-field-BpizlPUF.js → archive-on-merge-field-BzxW7NJS.js} +1 -1
  118. package/web/dist/assets/{ask-card-D3d4Oe4i.js → ask-card-CKD_gFDN.js} +1 -1
  119. package/web/dist/assets/attention-DnxGjw_R.js +1 -0
  120. package/web/dist/assets/{automations-route-BUoBjY9i.js → automations-route-CoSNUId5.js} +1 -1
  121. package/web/dist/assets/{commit-list-D2Q1MPZh.js → commit-list-CCgF6z16.js} +1 -1
  122. package/web/dist/assets/{diff-C2sbzjCh.js → diff-BcseHLlM.js} +2 -2
  123. package/web/dist/assets/{diff-controls-CZRDx8kC.js → diff-controls-DhD4a7Z4.js} +1 -1
  124. package/web/dist/assets/{diff-view-COw1J8Ia.js → diff-view--Nv4Px8F.js} +1 -1
  125. package/web/dist/assets/{discard-changes-dialog-CHo6iyVf.js → discard-changes-dialog-CD2HMH7E.js} +1 -1
  126. package/web/dist/assets/{file-preview-B0lpYpjU.js → file-preview-BwrymAy7.js} +1 -1
  127. package/web/dist/assets/{folder-browser-CUUWpb8F.js → folder-browser-Civftk0W.js} +1 -1
  128. package/web/dist/assets/{git-toolbar-BeBHkFTl.js → git-toolbar-CYgIbgOf.js} +1 -1
  129. package/web/dist/assets/{github-CVzbyq44.js → github-CtYRNNDH.js} +1 -1
  130. package/web/dist/assets/{global-activity-route-BvvO5Ie1.js → global-activity-route-BXAhhLrt.js} +1 -1
  131. package/web/dist/assets/index-CXvWnyZg.js +21 -0
  132. package/web/dist/assets/label-feCJ3WOT.js +1 -0
  133. package/web/dist/assets/{markdown-CtFi6cFe.js → markdown-BAmUNyiK.js} +1 -1
  134. package/web/dist/assets/{open-in-menu-CI3ceNjU.js → open-in-menu-Bzca0KPF.js} +1 -1
  135. package/web/dist/assets/{option-select-CFhKFk8u.js → option-select-BxFrlK_-.js} +1 -1
  136. package/web/dist/assets/{preferences-section-DfgoVofd.js → preferences-section-ByeO0I87.js} +1 -1
  137. package/web/dist/assets/{preview-pane-connected-T-WG4X9k.js → preview-pane-connected-CJy9Miri.js} +1 -1
  138. package/web/dist/assets/{project-location-0VnTd5VW.js → project-location-Cq1K7hXN.js} +1 -1
  139. package/web/dist/assets/{project-router-C53GCY_8.js → project-router-j0uBi7Ep.js} +1 -1
  140. package/web/dist/assets/{projects-section-CwpogbCn.js → projects-section-P0RuBn2c.js} +1 -1
  141. package/web/dist/assets/{prompt-templates-section-R0rt2Tw4.js → prompt-templates-section-ChqZ2Gl4.js} +1 -1
  142. package/web/dist/assets/queries-CchoEEzj.js +1 -0
  143. package/web/dist/assets/{read-state-DOIKdUqa.js → read-state-c_RNJaXO.js} +1 -1
  144. package/web/dist/assets/{reference-chip-95DURw1q.js → reference-chip-z7dZJVH-.js} +1 -1
  145. package/web/dist/assets/{remote-settings-notice-BYv4X_Zz.js → remote-settings-notice-DYOP5Yxe.js} +1 -1
  146. package/web/dist/assets/{repo-git-j6gBX3Yk.js → repo-git-DcZTZ70-.js} +1 -1
  147. package/web/dist/assets/{report-reader-UaMV9dLk.js → report-reader-D0ud2uIA.js} +1 -1
  148. package/web/dist/assets/{report-selection-DAPzf1Aa.js → report-selection-BdGxjISG.js} +1 -1
  149. package/web/dist/assets/{reports-1A2Ciyw2.js → reports-BNO0jrQI.js} +1 -1
  150. package/web/dist/assets/{resources-section-CurFgvye.js → resources-section-CQkpzv63.js} +1 -1
  151. package/web/dist/assets/{review-notes-drafts-19pkn2vN.js → review-notes-drafts-B_Mb82AK.js} +1 -1
  152. package/web/dist/assets/{review-panel-DmHITJs8.js → review-panel-DcEmHodb.js} +1 -1
  153. package/web/dist/assets/{review-strip-DbtyWCrP.js → review-strip-En21aXDx.js} +1 -1
  154. package/web/dist/assets/{run-detail-refresh-DYY7EWeq.js → run-detail-refresh-C5qmRdgD.js} +1 -1
  155. package/web/dist/assets/{run-diff-CMX34CW6.js → run-diff-BvGvPk3g.js} +1 -1
  156. package/web/dist/assets/{run-header-BpLDqXvN.js → run-header-DE0wTSnO.js} +1 -1
  157. package/web/dist/assets/{select-CBMEsTi0.js → select--dGOlrzM.js} +1 -1
  158. package/web/dist/assets/{session-context-section-JUgAAE68.js → session-context-section-b4-i_DSE.js} +1 -1
  159. package/web/dist/assets/{settings-agent-picker-_38GTrVo.js → settings-agent-picker-BhyVKLRu.js} +1 -1
  160. package/web/dist/assets/{settings-save-bar-Czqju-k9.js → settings-save-bar-9D1QPg_P.js} +1 -1
  161. package/web/dist/assets/{settings-shell-Dpp7fksb.js → settings-shell-Ct4CWWvw.js} +1 -1
  162. package/web/dist/assets/{sidebar-section-DolOq65h.js → sidebar-section-azclPE--.js} +1 -1
  163. package/web/dist/assets/{skills-C3qgwzNL.js → skills-BizIiogS.js} +1 -1
  164. package/web/dist/assets/{tab-link-BGfSJ-ah.js → tab-link-BKlpD9sn.js} +1 -1
  165. package/web/dist/assets/{task-changes-BJLF9Ucs.js → task-changes-DjB5jujp.js} +1 -1
  166. package/web/dist/assets/{task-commits-DYPpdxyk.js → task-commits-cDkfIAvD.js} +1 -1
  167. package/web/dist/assets/{task-file-scope-BNDrHDCA.js → task-file-scope-DLVI8zBp.js} +1 -1
  168. package/web/dist/assets/{task-files-Df7x62S3.js → task-files-BVbjuEaL.js} +1 -1
  169. package/web/dist/assets/{task-github-item-Bi0FiK3t.js → task-github-item-DW5Rl7Me.js} +1 -1
  170. package/web/dist/assets/{task-groups-7p6Gvpg8.js → task-groups-CGCnVqHE.js} +1 -1
  171. package/web/dist/assets/{task-thread-LZb9EWfU.js → task-thread-DTLhAQbe.js} +1 -1
  172. package/web/dist/assets/{thread-state-jWJlcg17.js → thread-state-VRKiUyJj.js} +1 -1
  173. package/web/dist/assets/toaster-zMN8cNZQ.js +4 -0
  174. package/web/dist/assets/{use-finish-run-jfO-hFXU.js → use-finish-run-BK7gmbXh.js} +1 -1
  175. package/web/dist/assets/{use-hand-to-agent-state-TAYkI2TF.js → use-hand-to-agent-state-pINTYkY9.js} +1 -1
  176. package/web/dist/assets/use-path-bases-D1yBeTzY.js +1 -0
  177. package/web/dist/assets/use-workspace-config-save-9jm9qV6u.js +1 -0
  178. package/web/dist/assets/{workflows-Ko0had3b.js → workflows-D2h67tAS.js} +1 -1
  179. package/web/dist/assets/{workspace-tools-CtGDE8c4.js → workspace-tools-uIbmvTfR.js} +1 -1
  180. package/web/dist/assets/{worktrees-section--Q1J4xPE.js → worktrees-section-Cm1pcQ9g.js} +1 -1
  181. package/web/dist/index.html +14 -14
  182. package/web/dist/assets/attention-xl4bwNkx.js +0 -1
  183. package/web/dist/assets/index-WGWSicA9.js +0 -21
  184. package/web/dist/assets/label-DRXJ8ljY.js +0 -1
  185. package/web/dist/assets/queries-jsRcJKo6.js +0 -1
  186. package/web/dist/assets/toaster-C1BFyQ8i.js +0 -4
  187. package/web/dist/assets/use-path-bases-CeKWHR1g.js +0 -1
  188. package/web/dist/assets/use-workspace-config-save-D2fOudMd.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r,s as i}from"./dist-C_rn70hE.js";import{O as a,St as o,Ut as s,d as c,g as l,i as u,k as d,nn as f,on as p,qt as m,s as h,un as g}from"./queries-jsRcJKo6.js";import{Lr as _,R as v,X as y,Z as b,a as x,lt as S,n as C,si as w,tt as T,vi as E}from"./toaster-C1BFyQ8i.js";import{A as D,Z as O,_ as k,b as A,ct as j,d as M,ft as ee,h as N,l as P,mt as F,ot as I,r as L,rt as te,u as R,ut as ne}from"./design-icons-QbNMZniQ.js";import{t as z}from"./external-link-BE6y205O.js";import{t as re}from"./eye-B8okNWXU.js";import{t as ie}from"./loader-circle-CPBhhDbB.js";import{t as ae}from"./message-square-B-MD-8rD.js";import{t as oe}from"./play-CmVAj_fu.js";import{t as B}from"./button-C8jUIs8Q.js";import{i as se,r as ce,t as le}from"./popover-CvL6hQ5c.js";import{a as ue,i as de,o as fe,r as pe,s as me,t as he}from"./dialog-DRZuXvul.js";import{t as V}from"./project-router-C53GCY_8.js";import{a as ge,i as H,o as U,r as _e,s as ve,t as ye}from"./command-BiBq24zL.js";import{d as be,f as W,i as xe,o as Se,p as Ce,s as we,t as Te,u as Ee}from"./skills-pM_PouEs.js";import{a as De,t as Oe}from"./agent-accounts-BuceIkTR.js";import{$ as G,B as ke,G as Ae,H as je,Hn as Me,Q as Ne,Sr as Pe,U as Fe,Un as Ie,V as Le,Vn as K,W as Re,Z as ze,ar as q,at as Be,ct as Ve,dt as He,et as Ue,ft as We,jt as J,lt as Ge,ot as Ke,pt as qe,rt as Je,tt as Ye,z as Xe}from"./index-WGWSicA9.js";import{t as Ze}from"./textarea-vEsJAUAV.js";import{t as Qe}from"./markdown-CtFi6cFe.js";import{t as $e}from"./diff-C2sbzjCh.js";import{t as Y}from"./change-counts-wqSYI3W8.js";import{t as et}from"./option-select-CFhKFk8u.js";import{t as tt}from"./tab-link-BGfSJ-ah.js";var X=e(t(),1),Z=n(),nt={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function Q({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,Z.jsx)(P,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:r(t,`text-semantic-green`)}):e===`failing`?(0,Z.jsx)(k,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:r(t,`text-semantic-red`)}):e===`pending`?(0,Z.jsx)(ie,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:r(t,`animate-spin text-semantic-amber motion-reduce:animate-none`)}):e===`review`?(0,Z.jsx)(N,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-review`,className:r(t,`text-semantic-info`)}):e===`conflict`?(0,Z.jsx)(j,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-conflict`,className:r(t,`text-semantic-conflict`)}):(0,Z.jsx)(N,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:r(t,`text-soft-foreground`)})}function rt(e){return e?.available?e.mergeState:null}function it(e,t){return e&&t?.methods.includes(e)?e:t?.defaultMethod??t?.methods[0]??null}function at(e){return e.state===`merged`?`Merged`:e.state===`closed`?`Closed`:e.isDraft?`Draft`:e.mergeable===`conflicting`?`Conflicts must be resolved`:e.canMerge?`Ready to merge`:e.eligibility===`unknown`?`Merge blocked · Requirements unknown`:`Merge blocked`}function ot(e){return e===`approved`||e===`not-required`?`passing`:e===`review-required`?`review`:e===`unknown`?`unknown`:`failing`}function st(e){switch(e){case`approved`:return`Approved`;case`not-required`:return`Not required`;case`review-required`:return`Waiting for review`;case`changes-requested`:return`Changes requested`;case`unknown`:return`Unknown`}}function ct(e){return e===`mergeable`?`passing`:e===`conflicting`?`conflict`:`unknown`}function lt(e){return e===`conflicting`?`present`:e===`mergeable`?`none`:`unknown`}function ut(e){return e===!0?` · required`:e===null?` · requiredness unknown`:``}function dt(e){return e?.available===!1?e.reason:`GitHub could not load merge requirements.`}function ft(e,t,n){return!!(e&&(t.canMerge||t.canOverride&&n))}function $(e){return e?nt[e]:`Merge`}function pt(e){return e===`conflicting`?`true`:void 0}function mt({check:e}){return(0,Z.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(Q,{state:e.state}),(0,Z.jsxs)(`span`,{children:[e.name,` · `,e.state,ut(e.required)]})]}),e.url&&i(e.url)?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]})}function ht({reason:e}){return(0,Z.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:e})]})}function gt({state:e,selectedMethod:t,overrideRules:n,mergeEnabled:i,refreshPending:a,onRefresh:o,onRunAgent:s,onConfirm:c,onMethodChange:l,onOverrideChange:u}){let d=at(e),f=ot(e.reviewDecision),p=ct(e.mergeable);return(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[e.canMerge?(0,Z.jsx)(P,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-semantic-green`}):(0,Z.jsx)(j,{size:16,"aria-hidden":`true`,className:r(`mt-0.5 size-5 shrink-0`,e.mergeable===`conflicting`?`text-semantic-conflict`:`text-semantic-amber`)}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(`h3`,{className:`font-semibold`,children:d}),(0,Z.jsxs)(B,{type:`button`,variant:`ghost`,size:`sm`,disabled:a,onClick:o,children:[(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,className:r(`size-3.5`,a&&`animate-spin`)}),`Refresh`]})]}),(0,Z.jsxs)(`p`,{className:`mt-1 font-mono text-xs text-soft-foreground`,children:[e.headRef,` (`,Ie(e.headSha),`) → `,e.baseRef]}),(0,Z.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,Z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{state:f}),(0,Z.jsxs)(`span`,{children:[`Reviews: `,st(e.reviewDecision)]})]}),(0,Z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{state:p}),(0,Z.jsxs)(`span`,{children:[`Conflicts: `,lt(e.mergeable)]})]}),e.checks.length===0?(0,Z.jsx)(`li`,{children:`No checks configured`}):e.checks.map(e=>(0,Z.jsx)(mt,{check:e},e.name)),e.blockers.map(e=>(0,Z.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),e.mergeable===`conflicting`&&s?(0,Z.jsx)(B,{className:`mt-4`,onClick:s,children:`Run agent on this PR`}):null,e.canOverride?(0,Z.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 rounded-md border border-pending-strong/40 bg-pending/10 p-3 text-xs`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>u(e.target.checked),className:`mt-0.5 size-4 accent-accent-strong`}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,Z.jsx)(`span`,{className:`mt-0.5 block text-soft-foreground`,children:`GitHub will allow this only if your permissions can bypass the repository rules.`})]})]}):null,e.eligibility===`unknown`?(0,Z.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`GitHub could not confirm review and branch-protection requirements. Passing checks do not establish merge readiness.`}):null,e.state===`open`&&e.methods.length>0?(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col flex-wrap gap-2 sm:flex-row`,children:[(0,Z.jsx)(et,{"aria-label":`Merge method`,value:t??``,onValueChange:e=>l(e),options:e.methods.map(e=>({value:e,label:nt[e]})),className:`w-full min-w-0 flex-1 bg-background sm:w-auto`}),(0,Z.jsx)(B,{disabled:!i,onClick:c,children:$(t)})]}):null]})]})}function _t({number:e,state:t,selectedMethod:n,confirming:r,overrideRules:i,mergePending:a,mergeError:o,onOpenChange:s,onMerge:c}){return(0,Z.jsx)(he,{open:r,onOpenChange:s,children:(0,Z.jsxs)(pe,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,Z.jsxs)(fe,{children:[(0,Z.jsxs)(me,{children:[$(n),` pull request #`,e,`?`]}),(0,Z.jsx)(de,{asChild:!0,children:(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`p`,{children:[`This will merge “`,t.title,`” into `,t.baseRef,`. GitHub will re-check the exact reviewed head before changing the repository.`]}),i&&t.canOverride?(0,Z.jsx)(`p`,{"data-slot":`gh-bypass-warning`,className:`mt-4 text-sm text-semantic-amber`,children:`You are asking GitHub to bypass unmet repository requirements; GitHub may refuse if your permissions do not allow it.`}):null]})})]}),o?(0,Z.jsx)(`p`,{className:`text-sm text-danger`,children:o.message}):null,(0,Z.jsxs)(ue,{children:[(0,Z.jsx)(B,{variant:`outline`,disabled:a,onClick:()=>s(!1),children:`Cancel`}),(0,Z.jsx)(B,{disabled:a,onClick:c,children:a?`Merging…`:$(n)})]})]})})}function vt({number:e,onRunAgent:t}){let n=E(),r=c(),i=w({queryKey:s.githubMergeState(e),queryFn:({signal:t})=>b(e,{},{signal:t}),retry:!1}),a=rt(i.data),[o,l]=(0,X.useState)(null),[u,d]=(0,X.useState)(!1),[f,p]=(0,X.useState)(!1),m=g({mutationFn:t=>b(e,{refresh:!0}),onSuccess:(e,t)=>n.setQueryData(t,e),onError:e=>C(e instanceof Error?e.message:String(e),{tone:`danger`})}),h=it(o,a),_=()=>({mergeState:s.githubMergeState(e),list:s.githubPages(50),comments:s.githubComments(`pr`,e),item:s.githubItem(`pr`,e),refStatus:r===void 0?void 0:s.githubRefStatusOf(r)}),v=g({mutationFn:t=>{if(!a||!h)throw Error(`No merge method is available.`);return T(e,{method:h,expectedHeadSha:a.headSha,...f&&a.canOverride?{overrideRules:!0}:{}})},onSuccess:(t,r)=>{d(!1),C(`Pull request #${e} merged`),n.invalidateQueries({queryKey:r.mergeState}),n.invalidateQueries({queryKey:r.list}),n.invalidateQueries({queryKey:r.comments}),n.invalidateQueries({queryKey:r.item}),r.refStatus&&n.invalidateQueries({queryKey:r.refStatus})},onError:(e,t)=>{C(e instanceof Error?e.message:String(e),{tone:`danger`}),n.invalidateQueries({queryKey:t.mergeState})}});return i.isPending?(0,Z.jsx)(q,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`}):a?(0,Z.jsxs)(`section`,{"data-slot":`gh-merge-box`,"data-eligibility":a.eligibility,"data-conflicting":pt(a.mergeable),"aria-live":`polite`,className:`mt-6 rounded-lg border border-card-edge bg-card p-4 shadow-card`,children:[(0,Z.jsx)(gt,{state:a,selectedMethod:h,overrideRules:f,mergeEnabled:ft(h,a,f),refreshPending:m.isPending,onRefresh:()=>m.mutate(s.githubMergeState(e)),onRunAgent:t,onConfirm:()=>d(!0),onMethodChange:l,onOverrideChange:p}),(0,Z.jsx)(_t,{number:e,state:a,selectedMethod:h,confirming:u,overrideRules:f,mergePending:v.isPending,mergeError:v.error,onOpenChange:d,onMerge:()=>v.mutate(_())})]}):(0,Z.jsx)(ht,{reason:dt(i.data)})}function yt(e){let t=new Set;for(let n of e)for(let e of n.labels)t.add(e);return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function bt(e,t={}){let n=(t.query??``).trim().toLowerCase(),r=t.labels??[],i=n.replace(/^#/,``),a=i!==``&&/^\d+$/.test(i);return e.filter(e=>r.length>0&&!r.every(t=>e.labels.includes(t))||t.assignees?.length&&!e.assignees?.some(e=>t.assignees.some(t=>t.toLowerCase()===e.toLowerCase()))||t.author!==void 0&&e.author.toLowerCase()!==t.author.toLowerCase()||t.includeNumbers&&!t.includeNumbers.has(e.number)||t.excludeNumbers?.has(e.number)||t.projectId&&e.projectIds!==void 0&&!e.projectIds.includes(t.projectId)?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body??``}`.toLowerCase().includes(n))}function xt(e,t){let n=e.trim();if(n===``)return!1;let r=n.replace(/^#/,``);return/^\d+$/.test(r)?!t.some(e=>e.number===Number(r)):t.length===0}function St(e){if(!e||!/^[0-9a-fA-F]{6}$/.test(e))return{borderColor:`var(--border)`,color:`var(--muted-foreground)`};let t=`#${e}`;return{backgroundColor:`${t}22`,borderColor:`${t}66`,color:`color-mix(in srgb, ${t} 50%, var(--foreground))`}}function Ct(e){return!e||!/^[0-9a-fA-F]{6}$/.test(e)?{backgroundColor:`var(--border)`}:{backgroundColor:`#${e}`}}function wt({label:e,color:t,className:n}){return(0,Z.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,title:e,style:St(t),className:r(`rounded-full border px-1.5 py-px text-[12px] font-medium`,n),children:e})}function Tt(e){return e===`pr`?`pull request`:`issue`}function Et(e,t,n){return e===`pr`&&!!(t||n)}function Dt({backLink:e}){return e?(0,Z.jsxs)(V,{to:e.to,"data-slot":`gh-back`,className:`mb-3 inline-flex min-h-11 items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Z.jsx)(L,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}):null}var Ot=r(`text-sm`,`[&_[data-streamdown="code-block"]]:relative [&_[data-streamdown="code-block"]]:my-2.5 [&_[data-streamdown="code-block"]]:gap-0 [&_[data-streamdown="code-block"]]:overflow-hidden [&_[data-streamdown="code-block"]]:rounded-lg [&_[data-streamdown="code-block"]]:border [&_[data-streamdown="code-block"]]:border-border [&_[data-streamdown="code-block"]]:bg-background [&_[data-streamdown="code-block"]]:p-0 [&_[data-streamdown="code-block"]]:![content-visibility:visible] [&_[data-streamdown="code-block"]]:![contain-intrinsic-size:auto]`,`[&_[data-streamdown="code-block-header"]]:h-7 [&_[data-streamdown="code-block-header"]]:border-b [&_[data-streamdown="code-block-header"]]:border-border [&_[data-streamdown="code-block-header"]]:bg-muted/40 [&_[data-streamdown="code-block-header"]]:px-3 [&_[data-streamdown="code-block-header"]]:text-xs`,`[&_[data-streamdown="code-block-header"][data-language=""]]:hidden [&_[data-streamdown="code-block-header"]:not([data-language])]:hidden [&_[data-streamdown="code-block-header"]:has(>span:empty)]:hidden`,`[&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:absolute [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:top-1 [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:right-1.5 [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:mt-0 [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:h-auto`,`[&_[data-streamdown="code-block-actions"]]:border-0 [&_[data-streamdown="code-block-actions"]]:bg-transparent [&_[data-streamdown="code-block-actions"]]:p-0 [&_[data-streamdown="code-block-actions"]]:backdrop-blur-none`,`[&_[data-streamdown="image-fallback"]]:inline-flex [&_[data-streamdown="image-fallback"]]:rounded-md [&_[data-streamdown="image-fallback"]]:border [&_[data-streamdown="image-fallback"]]:border-dashed [&_[data-streamdown="image-fallback"]]:border-border [&_[data-streamdown="image-fallback"]]:bg-muted/40 [&_[data-streamdown="image-fallback"]]:px-3 [&_[data-streamdown="image-fallback"]]:py-2 [&_[data-streamdown="image-fallback"]]:not-italic [&_[data-streamdown="image-fallback"]]:after:content-["_—_open_on_GitHub_to_view"]`,`[&_[data-streamdown="code-block-body"]]:rounded-none [&_[data-streamdown="code-block-body"]]:border-0 [&_[data-streamdown="code-block-body"]]:bg-transparent [&_[data-streamdown="code-block-body"]]:px-3.5 [&_[data-streamdown="code-block-body"]]:py-2.5 [&_[data-streamdown="code-block-body"]]:pr-10`);function kt(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function At({item:e,kindWord:t,commentCount:n,hasDiffStat:r,additions:a,deletions:o}){return(0,Z.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{className:`tabular-nums`,children:[`#`,e.number]}),`·`,(0,Z.jsx)(`span`,{children:t}),`·`,(0,Z.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,Z.jsx)(K,{iso:e.createdAt,title:kt(e.createdAt)}),n?(0,Z.jsxs)(Z.Fragment,{children:[`·`,(0,Z.jsx)(rn,{count:n})]}):null,r?(0,Z.jsxs)(Z.Fragment,{children:[`·`,(0,Z.jsx)(`span`,{"data-slot":`gh-diffstat`,children:(0,Z.jsx)(Y,{adds:a??0,dels:o??0})})]}):null,`·`,i(e.url)?(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-open-link`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,Z.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]})}function jt({item:e,subNav:t,changes:n}){return e.kind===`pr`?t?(0,Z.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,Z.jsx)(tt,{to:J(`prs`,t.filter,e.number,``,t.narrows),active:!n,children:`Conversation`}),(0,Z.jsx)(tt,{to:J(`prs`,t.filter,e.number,`/changes`,t.narrows),active:n,children:`Changes`})]}):(0,Z.jsx)(V,{to:J(`prs`,null,e.number,`/changes`),"data-slot":`gh-files-changed`,className:`mt-3 inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground hover:underline`,children:`Files changed`}):null}function Mt({item:e,colors:t,checks:n}){return e.labels.length>0||n?(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,Z.jsx)(wt,{label:e,color:t[e]},e)),n?(0,Z.jsx)(an,{checks:n,url:e.url}):null]}):null}function Nt({item:e,colors:t,body:n}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{"data-slot":`gh-body`,className:r(`mt-5`,Ot),children:n?(0,Z.jsx)(Qe,{children:n}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`(no description)`})}),(0,Z.jsx)(Rt,{item:e,colors:t})]})}function Pt({item:e,colors:t,checks:n,comments:r,backLink:i,subNav:a,onRunAgent:o,afterHeading:s,headerAction:c,children:l}){let d=a?.changes??!1,f=Tt(e.kind),p=u(e.kind,e.number,!d).data?.detail,m=p?.body??e.body,h=p?.additions??e.additions,g=p?.deletions??e.deletions,_=Et(e.kind,h,g),v=r??e.comments;return(0,Z.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,Z.jsx)(Dt,{backLink:i}),(0,Z.jsxs)(`div`,{"data-slot":`gh-description-card`,className:e.kind===`pr`?`rounded-xl border border-border bg-card p-6`:void 0,children:[e.kind===`pr`?(0,Z.jsx)(Ft,{action:c,className:`mb-4`,children:(0,Z.jsxs)(`h2`,{className:`min-w-0 text-[22px] leading-snug font-semibold tracking-tight`,children:[`#`,e.number,` `,e.title]})}):null,(0,Z.jsx)(Ft,{action:e.kind===`pr`?void 0:c,children:(0,Z.jsx)(At,{item:e,kindWord:f,commentCount:v,hasDiffStat:_,additions:h,deletions:g})}),e.kind===`pr`?null:(0,Z.jsx)(`h2`,{className:`mt-2 text-[22px] leading-snug font-semibold tracking-tight`,children:e.title}),s,(0,Z.jsx)(jt,{item:e,subNav:a,changes:d}),(0,Z.jsx)(Mt,{item:e,colors:t,checks:n}),d&&e.kind===`pr`?(0,Z.jsx)(It,{item:e}):(0,Z.jsx)(Nt,{item:e,colors:t,body:m})]}),e.kind===`pr`?(0,Z.jsx)(vt,{number:e.number,onRunAgent:o}):null,l]})}function Ft({action:e,className:t,children:n}){return e?(0,Z.jsxs)(`div`,{"data-slot":`gh-header-row`,className:r(`flex flex-wrap items-center gap-x-3 gap-y-2`,t),children:[(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:n}),(0,Z.jsx)(`div`,{"data-slot":`gh-header-action`,className:`flex shrink-0 items-center gap-2`,children:e})]}):t?(0,Z.jsx)(`div`,{className:t,children:n}):(0,Z.jsx)(Z.Fragment,{children:n})}function It({item:e}){let t=E(),n=h(e.number),[a,o]=(0,X.useState)(``),[c,l]=(0,X.useState)(null),u=n.data,d=e=>u?.available?u.files.filter(t=>t.path.toLowerCase().includes(e.toLowerCase())):[],f=d(a),p=f.some(e=>e.path===c)?c:f[0]?.path??null,m=f.findIndex(e=>e.path===p),g=e=>{o(e);let t=d(e),n=p??c,r=t.some(e=>e.path===n)?n:t[0]?.path??n;r!==c&&l(r)},_=async()=>{let n=u?.available?u.headSha:null,r=s.githubPrChanges(e.number),i=await y(e.number,{refresh:!0});t.setQueryData(r,i),i.available&&n&&n!==i.headSha&&(l(i.files[0]?.path??null),C(`The reviewed revision changed.`))};if(n.isPending)return(0,Z.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(n.isError||!u)return(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!u.available)return(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:u.reason});let v=f.map(e=>({path:e.path,...e.previousPath?{oldPath:e.previousPath}:{},status:e.status===`removed`?`deleted`:e.status===`changed`?`modified`:e.status,adds:e.additions,dels:e.deletions,binary:e.patchUnavailableReason===`binary`,patch:e.patch??``})),b=i(e.url)?`${e.url}/files`:null,x=f.find(e=>e.path===p);return(0,Z.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,Z.jsxs)(`strong`,{children:[u.files.length,` changed files`]}),(0,Z.jsx)(Y,{adds:u.additions,dels:u.deletions}),(0,Z.jsx)(Me,{sha:u.headSha,variant:`inline`,prefix:`head `,className:`text-muted-foreground`}),(0,Z.jsx)(B,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void _(),children:`Refresh`})]}),u.truncated?(0,Z.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-pending-strong/40 bg-pending/10 p-3 text-xs`,children:[u.reason??`This response is incomplete.`,` `,b?(0,Z.jsx)(`a`,{href:b,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,Z.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,Z.jsxs)(`aside`,{className:`min-w-0`,children:[(0,Z.jsx)(`input`,{"aria-label":`Filter changed files`,value:a,onChange:e=>g(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,Z.jsx)(et,{"aria-label":`Select changed file`,value:p??``,onValueChange:l,options:f.map(e=>({value:e.path,label:e.path})),className:`mt-2 w-full min-w-0 bg-background lg:hidden`,contentClassName:`max-w-[calc(100vw-2rem)]`}),(0,Z.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:f.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>l(e.path),className:r(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,p===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,Z.jsx)(Y,{adds:e.additions,dels:e.deletions})]})},e.path))})]}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,Z.jsx)(B,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:m<=0,onClick:()=>l(f[m-1]?.path??null),children:(0,Z.jsx)(Pe,{})}),(0,Z.jsx)(B,{"aria-label":`Next file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:m<0||m>=f.length-1,onClick:()=>l(f[m+1]?.path??null),children:(0,Z.jsx)(M,{size:16})})]}),f.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($e,{files:v.filter(e=>e.path===p),wrap:!0,className:`min-w-0`}),x&&!x.patch?(0,Z.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,x.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function Lt(e){let t=e.filter(e=>e.kind===`review`).length,n=e.length-t,r=`${n} comment${n===1?``:`s`}`;return t===0?r:`${r} · ${t} review${t===1?``:`s`}`}function Rt({item:e,colors:t}){let n=u(e.kind,e.number),r=n.data,i=(0,X.useMemo)(()=>{let e=[...(r?.comments??[]).map(e=>({row:`comment`,comment:e})),...(r?.events??[]).map(e=>({row:`event`,event:e}))],t=e=>{let t=Date.parse(zt(e));return Number.isNaN(t)?-1/0:t};return e.sort((e,n)=>t(e)-t(n))},[r?.comments,r?.events]);return n.isPending?(0,Z.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,Z.jsx)(q,{className:`mb-3 h-3 w-24`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(q,{className:`h-14 w-full`}),(0,Z.jsx)(q,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,Z.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,Z.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,Z.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-xs font-semibold tracking-wide text-muted-foreground uppercase`,children:[`Activity · `,Lt(r.comments)]}),(0,Z.jsx)(`ul`,{className:`flex flex-col gap-5`,children:Bt(i).map(e=>e.group===`commits`?(0,Z.jsx)(Vt,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,Z.jsx)(Qt,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,Z.jsx)(Ut,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-thread-truncated`,className:`mt-4 inline-flex items-center gap-0.5 text-xs text-muted-foreground hover:text-foreground hover:underline`,children:[`thread truncated — open on GitHub`,(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var zt=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function Bt(e){let t=[],n=[],r=()=>{n.length!==0&&(n.length===1?t.push({group:`single`,entry:{row:`event`,event:n[0]}}):t.push({group:`commits`,commits:n}),n=[])};for(let i of e){if(i.row===`event`&&i.event.kind===`committed`&&i.row===`event`){let e=n[n.length-1];e&&e.actor!==i.event.actor&&r(),n.push(i.event);continue}r(),t.push({group:`single`,entry:i})}return r(),t}function Vt({commits:e,colors:t}){let[n,r]=(0,X.useState)(!1),i=e[0]?.actor??`?`;return n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":!0,onClick:()=>r(!1),className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:Ht.committed}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Z.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,Z.jsx)(Ut,{event:e,colors:t},e.id))]}):(0,Z.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":!1,onClick:()=>r(!0),className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:Ht.committed}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Z.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,Z.jsx)(K,{iso:e[e.length-1].createdAt,className:`shrink-0`})]})})}var Ht={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function Ut({event:e,colors:t}){return(0,Z.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:r(`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:Ht[e.kind]}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,Z.jsx)(Yt,{event:e,colors:t}),(0,Z.jsx)(K,{iso:e.createdAt,className:`shrink-0`}),e.url?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open ${e.kind} on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function Wt({event:e}){return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,Z.jsx)(Me,{sha:e.sha,variant:`inline`,className:`shrink-0 text-xs text-muted-foreground`}):null,e.message?(0,Z.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,Z.jsx)(Xt,{checks:e.checks})]})}function Gt({event:e,colors:t}){return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,Z.jsx)(`span`,{"data-slot":`gh-event-label`,style:St(e.label.color??t[e.label.name]),className:`max-w-[12rem] truncate rounded-full border px-1.5 py-px font-sans text-[12px]`,children:e.label.name}):null,(0,Z.jsx)(`span`,{className:`shrink-0`,children:`label`})]})}function Kt({event:e}){return(0,Z.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]})}function qt({event:e}){return(0,Z.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}var Jt={committed:e=>(0,Z.jsx)(Wt,{event:e}),labeled:(e,t)=>(0,Z.jsx)(Gt,{event:e,colors:t}),unlabeled:(e,t)=>(0,Z.jsx)(Gt,{event:e,colors:t}),assigned:e=>(0,Z.jsx)(Kt,{event:e}),unassigned:e=>(0,Z.jsx)(Kt,{event:e}),merged:()=>(0,Z.jsx)(`span`,{children:`merged this`}),closed:()=>(0,Z.jsx)(`span`,{children:`closed this`}),reopened:()=>(0,Z.jsx)(`span`,{children:`reopened this`}),head_ref_force_pushed:()=>(0,Z.jsx)(`span`,{children:`force-pushed`}),renamed:e=>(0,Z.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]}),"cross-referenced":e=>(0,Z.jsx)(qt,{event:e})};function Yt({event:e,colors:t}){return Jt[e.kind]?.(e,t)??null}function Xt({checks:e}){return e?(0,Z.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:r(`shrink-0`,tn[e]),children:en[e]}):null}var Zt={approved:{label:`Approved`,tone:`border-success/40 text-semantic-green`},changes_requested:{label:`Changes requested`,tone:`border-danger/40 text-semantic-red`},commented:{label:`Commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`Dismissed`,tone:`border-border text-muted-foreground`}};function Qt({comment:e}){let t=e.reviewState?Zt[e.reviewState]:null;return(0,Z.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Z.jsx)($t,{url:e.avatarUrl,login:e.author}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,Z.jsx)(K,{iso:e.createdAt}),t?(0,Z.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:r(`rounded-full border px-1.5 py-px font-sans text-[12px] font-medium`,t.tone),children:t.label}):null,(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open comment on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,Z.jsx)(`div`,{"data-slot":`gh-thread-body`,className:Ot,children:e.body?(0,Z.jsx)(Qe,{children:e.body}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`(no body)`})})]})}function $t({url:e,login:t}){let[n,r]=(0,X.useState)(!1);return e&&!n?(0,Z.jsx)(`img`,{src:e,alt:``,width:20,height:20,loading:`lazy`,onError:()=>r(!0),"data-slot":`gh-avatar`,className:`size-5 shrink-0 rounded-full`}):(0,Z.jsx)(`span`,{"data-slot":`gh-avatar-fallback`,"aria-hidden":`true`,className:`flex size-5 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var en={passing:`✓`,failing:`✗`,pending:`○`},tn={passing:`text-semantic-green`,failing:`text-semantic-red`,pending:`text-semantic-amber`},nn={passing:`Checks passing`,failing:`Checks failing`,pending:`Checks pending`};function rn({count:e}){return e?(0,Z.jsxs)(`span`,{"data-slot":`gh-comment-count`,"data-count":e,"aria-label":`${e} comment${e===1?``:`s`}`,className:`inline-flex shrink-0 items-center gap-0.5`,children:[(0,Z.jsx)(ae,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function an({checks:e,url:t}){let n=r(`text-xs font-medium`,tn[e],t&&`hover:underline`),i=`${en[e]} ${nn[e]}`;return t?(0,Z.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:i}):(0,Z.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:i})}function on({checks:e}){return(0,Z.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:nn[e],"aria-label":nn[e],className:r(`shrink-0 font-sans text-xs font-semibold`,tn[e]),children:en[e]})}function sn(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function cn(e,t=[]){let n=sn(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=ln(t)),n}function ln(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function un(e,t){return e.replace(/\{\{\s*number\s*\}\}/gi,()=>`#${t.number}`).replace(/\{\{\s*title\s*\}\}/gi,()=>t.title).replace(/\{\{\s*url\s*\}\}/gi,()=>t.url)}function dn(e,t){if(e.includes(t.url))return!0;let n=t.kind===`pr`?String.raw`(?:pull\s+request|pr)`:String.raw`issue`;return new RegExp(String.raw`\b${n}\s*#?\s*${t.number}\b`,`i`).test(e)}function fn(e,t,n){let r=(n??``).trim();if(!r)return cn(e,t);let i=sn(e),a=r.startsWith(i)?i+un(r.slice(i.length),e):un(r,e),o=dn(a,e)?a:`${i}\n\n${a}`;return t.length?o+ln(t):o}function pn(e){let t=[];for(let n of e.slice(0,8)){let e=new Set(t.map(e=>e.id)),r=n;for(let t=2;e.has(r);t++)r=`${n}-${t}`;t.push({id:r,name:n,skill:n,prompt:`{{task}}`})}return t}function mn(e,t,n,r,i={}){return t?{...i,workflow:t,task:fn(e,n.map(e=>e.id),r)}:n.length?{...i,steps:pn(n.map(e=>e.id)).map((e,t)=>({...e,...n[t]?.path===void 0?{}:{skillPath:n[t].path}})),task:fn(e,[],r)}:{...i,workflow:`quick-task`,task:fn(e,[],r)}}function hn(e){let t=o(),n=l(),r=f(),{runners:i,uninstalled:a,signedOut:s,accounts:c,repoAccount:u,accountFor:d}=De(),m=n.data?.defaultRunner,h=Re(e.runner,i,m??i[0]??`claude`),g=n.data?.modelsLocked===!0,_=d(h,e.account),v=p(h,!0,_??u?.[h]),y=Fe(g?null:e.model,h,r.data,n.data?.defaultModels,v.data),b=ke(y,v.data);return{runner:h,runnerExplicit:e.runner!==null,model:y,effort:g?``:je(e.effort,b),effortOptions:b,runners:i,uninstalled:a,signedOut:s,defaultRunner:m,canRun:t.isSuccess&&i.length>0,modelsLocked:g,providerPending:t.isPending,providerError:t.isError,accounts:c,account:_,repoAccount:u}}function gn(e){return{runner:Ae(e.runner,e.defaultRunner,e.runnerExplicit),model:e.modelsLocked?void 0:e.model||void 0,effort:e.modelsLocked?void 0:e.effort||void 0}}function _n(e){return{...gn(e),...e.account?{agentProfile:e.account}:{}}}function vn(e,t){return e.find(e=>e.id===t)?.label??(t===``?`Runner default`:t)}function yn(e,t){let{runners:n,uninstalled:r,signedOut:i}=e;return n.length>1||r.length>0||i.length>0||n.some(e=>Oe(t,e))}function bn({pick:e,onChange:t,disabled:n=!1,accounts:r=!1,layout:i}){let a=(0,X.useRef)(null),o=(0,X.useRef)(null),[s,c]=(0,X.useState)(()=>typeof window<`u`&&window.innerWidth<=767);(0,X.useLayoutEffect)(()=>{let e=a.current;if(i!==`row`||!e)return;let t=()=>{let t=window.innerWidth<=767||e.getBoundingClientRect().width<550,n=document.activeElement;o.current=n instanceof HTMLElement&&e.contains(n)?n:null,c(t)};t();let n=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return n?.observe(e),window.addEventListener(`resize`,t),()=>{n?.disconnect(),window.removeEventListener(`resize`,t)}},[i]),(0,X.useLayoutEffect)(()=>{let e=o.current;o.current=null,e&&e.isConnected&&document.activeElement!==e&&e.focus()},[s]);let u=hn(e),{runner:d,model:m,effort:h,effortOptions:g,runners:_,canRun:v,modelsLocked:y}=u,b=l(),x=f(),S=p(d,!0,u.account??u.repoAccount?.[d]),C=Le(d,x.data,S.data,[e.model,b.data?.defaultModels?.[d]]),w=n||!v,T=r?u.accounts:[],E=yn(u,T)?(0,Z.jsx)(Ye,{icon:(0,Z.jsx)(I,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,runners:_,uninstalled:u.uninstalled,signedOut:u.signedOut,value:d,accounts:T,account:r?u.account:null,repoAccount:r?u.repoAccount:void 0,disabled:w,onPick:(n,i)=>t(r?{runner:n,account:i,model:n===d?e.model:null,effort:e.effort}:{runner:n,account:null,model:null,effort:e.effort})},`runner`):null,O=(0,Z.jsx)(G,{icon:(0,Z.jsx)(A,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`model-pill`,ariaLabel:`Model`,label:vn(C,m),value:m,disabled:w,readOnly:y===!0,disabledHint:y?`Model selection is locked to native coding-agent settings.`:void 0,onPick:n=>{let r=ke(n,S.data);t({...e,model:n,effort:e.effort===null?null:je(e.effort,r)})},options:C.map(e=>({value:e.id,label:e.label,desc:e.desc})),status:Xe(d,x.data,S)},`model`),k=(0,Z.jsx)(G,{icon:(0,Z.jsx)(D,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`effort-pill`,ariaLabel:`Effort`,label:g.find(e=>e.value===h)?.label??`Runner default`,value:h,disabled:w,readOnly:y===!0,disabledHint:y?`Effort selection is locked to native coding-agent settings.`:void 0,onPick:n=>t({...e,effort:n}),options:g.map(e=>({value:e.value,label:e.label,desc:e.desc}))},`effort`);return i===`row`?(0,Z.jsx)(`div`,{ref:a,"data-slot":`engine-row-box`,children:(0,Z.jsx)(`div`,{"data-slot":`engine-row`,className:`engine-row`,role:`group`,"aria-label":`Agent settings`,children:(0,Z.jsx)(Ue,{fill:`model-pill`,children:s?[E,k,O]:[E,O,k]})})}):(0,Z.jsxs)(Ue,{children:[E,O,k]})}var xn={workflow:null,skills:[]},Sn=`cez-followup-selection`;function Cn(e){let t=e&&typeof e==`object`?e:{};return{workflow:typeof t.workflow==`string`?t.workflow:null,skills:Array.isArray(t.skills)?t.skills.flatMap(e=>typeof e==`string`?[{id:e}]:!e||typeof e!=`object`||typeof e.id!=`string`?[]:[{id:e.id,...typeof e.path==`string`?{path:e.path}:{}}]):[]}}function wn(){try{let e=localStorage.getItem(Sn);return e?Cn(JSON.parse(e)):{...xn}}catch{return{...xn}}}function Tn(e){try{localStorage.setItem(Sn,JSON.stringify(e))}catch{}}var En=`cez-followup-prompt:`;function Dn(e){try{return localStorage.getItem(En+e)??``}catch{return``}}function On(e,t){try{t===``?localStorage.removeItem(En+e):localStorage.setItem(En+e,t)}catch{}}function kn({item:e,workflows:t,skills:n,workflow:r,onWorkflowChange:o,selectedSkills:c,onSkillsChange:l,engine:u,onEngineChange:d,queuedRunId:f,onQueued:p}){let h=E(),_=a(),y=e.kind===`pr`?`PR`:`issue`,b=hn(u),x=m(b.runner,b.account),w=c.filter(e=>x.unchecked||e.path===void 0||n.some(t=>t.id===e.id&&(e.path===void 0||t.path===e.path))),T=w.length!==c.length,[D]=(0,X.useState)(()=>sn(e)),[O,k]=(0,X.useState)(()=>Dn(e.url)||D),A=(0,X.useRef)(null),j=(0,X.useRef)(null);(0,X.useEffect)(()=>{On(e.url,O===D?``:O)},[e.url,O,D]);let M=(0,X.useMemo)(()=>He(_.data?.promptTemplates),[_.data?.promptTemplates]),ee=e=>{let t=A.current,n=qe({prompt:O,base:D,selectionStart:t?.selectionStart??null,focused:document.activeElement===t,remembered:j.current}),r=Ge(O,n,e);k(r.text),j.current=r.caret,requestAnimationFrame(()=>{A.current?.focus(),A.current?.setSelectionRange(r.caret,r.caret)})},N=Ve(M,w.map(e=>e.id)),F=(0,X.useRef)(O);F.current=O;let I=(0,X.useRef)(``);(0,X.useEffect)(()=>{let e=We(F.current,I.current,N,D);I.current=e.applied,e.text!==F.current&&k(e.text)},[N,D]);let L=g({mutationFn:async()=>!b.canRun||T?null:S(mn(e,r,w,O,_n(b))),onSuccess:t=>{if(t===null)return;let n=t;n&&p(e.url,n.id),C(`Added to the queue — ${y} #${e.number}`),w.length>0&&_.data!==void 0&&v({skillUsage:w.reduce((e,t)=>Te(e,t.id),_.data.skillUsage)}).then(()=>h.invalidateQueries({queryKey:s.uiState})).catch(()=>{}),On(e.url,``),k(D),I.current=``,h.invalidateQueries({queryKey:s.runs.all})},onError:e=>C(e.message,{tone:`danger`})}),te=e=>{Be(e)&&(e.preventDefault(),!L.isPending&&b.canRun&&L.mutate())},R=e=>l(c.some(t=>W(t)===W(e))?c.filter(t=>W(t)!==W(e)):[...c,we(e)]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,Z.jsx)(`h3`,{className:`text-xl font-normal text-foreground`,children:`Hand this to the agent`}),(0,Z.jsxs)(`label`,{className:`gh-field gh-prompt-field`,children:[(0,Z.jsx)(`span`,{children:`Instructions for the agent`}),(0,Z.jsx)(Ze,{ref:A,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:O,onChange:e=>k(e.target.value),onSelect:e=>{j.current=e.currentTarget.selectionStart},onKeyDown:te,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`})]}),(0,Z.jsx)(Ne,{templates:M,onInsert:ee}),(0,Z.jsxs)(`div`,{className:`gh-handoff-settings`,children:[(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Workflow`}),(0,Z.jsx)(jn,{workflows:t,value:r,onChange:o})]}),(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Skills · select one or more`}),(0,Z.jsx)(Nn,{skills:n,skillUsage:_.data?.skillUsage,selected:c,onToggle:R})]}),c.length>0?(0,Z.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:c.map(e=>(0,Z.jsx)(An,{skill:e,skills:n,unchecked:x.unchecked,onRemove:()=>R(e)},W(e)))}):null,T?(0,Z.jsx)(`p`,{role:`alert`,children:`A selected skill path is unavailable. Remove it or choose a current copy before starting.`}):null,(0,Z.jsx)(bn,{layout:`row`,pick:u,onChange:d,disabled:L.isPending||!b.canRun,accounts:!0}),(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Account`}),(0,Z.jsx)(Mn,{resolved:b,disabled:L.isPending||!b.canRun,onPick:e=>d({...u,account:e})})]}),!b.providerPending&&!b.canRun?(0,Z.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[b.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,Z.jsx)(V,{to:`/settings/agent-defaults#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null]}),(0,Z.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[e.kind===`pr`?`PR`:`Issue`,` number and link remain attached to the task. Edit the prompt before starting. Cmd/Ctrl+Enter submits; Enter adds a new line.`]})]}),(0,Z.jsxs)(`div`,{"data-slot":`gh-handoff-actions`,className:`mt-[22px] flex flex-wrap items-center gap-2.5`,children:[i(e.url)?(0,Z.jsx)(B,{asChild:!0,variant:`outline`,children:(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open in GitHub`})}):null,(0,Z.jsxs)(B,{variant:`primary`,"data-action":`gh-run`,disabled:L.isPending||!b.canRun||T,onClick:()=>L.mutate(),children:[(0,Z.jsx)(oe,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,y]}),(0,Z.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-xs font-medium text-muted-foreground`,children:Ke()}),f?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,Z.jsx)(P,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,Z.jsx)(V,{to:`/tasks/${f}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-accent-text hover:underline`,children:`View task →`})]}):null]})]})}function An({skill:e,skills:t,unchecked:n,onRemove:r}){let i=t.find(t=>t.id===e.id&&(e.path===void 0||t.path===e.path)),a=[i?.name??e.id,e.path].filter(Boolean).join(` · `),o=!n&&e.path!==void 0&&!i?` (unavailable)`:n||!i?` (unchecked)`:``;return(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e.id,onClick:r,title:`Remove skill ${a}`,"aria-label":`Remove skill ${a}`,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[a,o,(0,Z.jsx)(F,{size:16,"aria-hidden":`true`,className:`size-3`})]})}function jn({workflows:e,value:t,onChange:n}){let[i,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(``),c=(0,X.useRef)(null),l=be(e,o);return(0,Z.jsxs)(le,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,Z.jsx)(se,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:r(Je,t&&`border-foreground/60 font-mono text-xs font-semibold text-foreground`),children:[(0,Z.jsx)(ee,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),(0,Z.jsx)(`span`,{className:`min-w-0 max-w-44 truncate`,children:t??`workflow`}),(0,Z.jsx)(R,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Z.jsx)(ce,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Z.jsxs)(ye,{shouldFilter:!1,children:[(0,Z.jsx)(ge,{placeholder:`Search workflows…`,value:o,onValueChange:s,onInput:()=>c.current?.scrollTo(0,0)}),(0,Z.jsxs)(ve,{ref:c,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[l.length===0?(0,Z.jsx)(_e,{children:`Nothing matches.`}):null,(0,Z.jsx)(H,{children:l.map(e=>{let r=t===e.name;return(0,Z.jsxs)(U,{value:`workflow ${e.name}`,keywords:Ce(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),a(!1)},children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,Z.jsx)(P,{size:16,"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-link-foreground`}):null]},e.name)})})]})]})})]})}function Mn({resolved:e,disabled:t,onPick:n}){let r=e.accounts.filter(t=>t.provider===e.runner),i=[...r.some(e=>e.id==="default")?[]:[{value:_,label:`Default`}],...r.map(e=>({value:e.id,label:e.label,...e.configDir?{desc:e.configDir}:{}}))],a=e.account??e.repoAccount?.[e.runner]??`default`;return(0,Z.jsx)(G,{icon:(0,Z.jsx)(ne,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),slot:`account-pill`,ariaLabel:`Account`,label:i.find(e=>e.value===a)?.label??`Default`,value:a,options:i,disabled:t,onPick:n})}function Nn({skills:e,skillUsage:t,selected:n,onToggle:i}){let[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(``),[l,u]=(0,X.useState)(null),d=(0,X.useRef)(null),{mostUsed:f,project:p,global:m,ranked:h}=Ee(e,s,t),g=(e,t)=>{let a=n.some(t=>W(t)===W(e));return(0,Z.jsxs)(U,{value:W(e),keywords:Ce(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.id,"data-selected":a?`true`:void 0,onSelect:()=>i(we(e)),children:[(0,Z.jsx)(`span`,{className:r(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.path?(0,Z.jsx)(`span`,{className:`min-w-0 truncate text-xs`,children:e.path}):null,e.description?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,Z.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),u(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,Z.jsx)(re,{"aria-hidden":`true`,className:`size-3.5`})}),a?(0,Z.jsx)(P,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},W(e))};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ze,{skill:l,onClose:()=>u(null)}),(0,Z.jsxs)(le,{open:a,onOpenChange:e=>{o(e),e||c(``)},children:[(0,Z.jsx)(se,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:r(Je,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,Z.jsx)(te,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),`skills`,n.length>0?` · ${n.length}`:``,(0,Z.jsx)(R,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Z.jsx)(ce,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Z.jsxs)(ye,{shouldFilter:!1,children:[(0,Z.jsx)(ge,{placeholder:`Search skills…`,value:s,onValueChange:c,onInput:()=>d.current?.scrollTo(0,0)}),(0,Z.jsxs)(ve,{ref:d,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[s.trim()&&!e.some(e=>e.id===s.trim())?(0,Z.jsx)(H,{children:(0,Z.jsxs)(U,{value:`typed-skill`,onSelect:()=>i({id:s.trim()}),children:[`Use skill id “`,s.trim(),`” (unchecked)`]})}):null,(h?h.length===0:f.length===0&&p.length===0&&m.length===0)?(0,Z.jsx)(_e,{children:`Nothing matches.`}):null,h?h.length>0?(0,Z.jsx)(H,{children:h.map(e=>g(e,xe(e)))}):null:(0,Z.jsxs)(Z.Fragment,{children:[f.length>0?(0,Z.jsx)(H,{heading:`Most used`,children:f.map(e=>g(e,xe(e)))}):null,p.length>0?(0,Z.jsx)(H,{heading:`Project skills`,children:p.map(e=>g(e,!0))}):null,m.length>0?(0,Z.jsx)(H,{heading:`Global`,children:m.map(e=>g(e,!1))}):null]})]})]})})]})]})}var Pn=new WeakMap;function Fn(){let e=wn(),t={workflow:e.workflow,selectedSkills:e.skills,engine:{runner:null,model:null,effort:null,account:null},queued:new Map},n=new Set;return{snapshot:()=>t,subscribe:e=>(n.add(e),()=>{n.delete(e)}),update:e=>{t={...t,...e},(e.workflow!==void 0||e.selectedSkills!==void 0)&&Tn({workflow:t.workflow,skills:[...t.selectedSkills]}),n.forEach(e=>e())}}}function In(){let e=E(),{projectId:t}=x(),n=Pn.get(e);n||Pn.set(e,n=new Map);let r=n.get(t);r||n.set(t,r=Fn());let{snapshot:i,subscribe:o,update:s}=r,c=(0,X.useSyncExternalStore)(o,i,i),l=d(),u=hn(c.engine),f=m(u.runner,u.account),p=a(),h=l.data?.workflows;(0,X.useEffect)(()=>{h&&c.workflow!==null&&!h.some(e=>e.name===c.workflow)&&s({workflow:null})},[s,h,c.workflow]);let g=(0,X.useMemo)(()=>Se(f.data??[],p.data?.skillUsage),[f.data,p.data?.skillUsage]);return{...c,workflows:l,skillList:g,skillsUnchecked:f.unchecked,setWorkflow:e=>s({workflow:e}),setSelectedSkills:e=>s({selectedSkills:e}),setEngine:e=>s({engine:e}),onQueued:(e,t)=>s({queued:new Map(i().queued).set(e,t)})}}export{an as a,Dt as c,Bt as d,yt as f,xt as h,$t as i,Pt as l,Ct as m,kn as n,on as o,bt as p,cn as r,rn as s,In as t,wt as u};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r,s as i}from"./dist-C_rn70hE.js";import{O as a,St as o,Ut as s,d as c,g as l,i as u,k as d,nn as f,on as p,qt as m,s as h,un as g}from"./queries-CchoEEzj.js";import{Lr as _,R as v,X as y,Z as b,a as x,lt as S,n as C,si as w,tt as T,vi as E}from"./toaster-zMN8cNZQ.js";import{A as D,Z as O,_ as k,b as A,ct as j,d as M,ft as ee,h as N,l as P,mt as F,ot as I,r as L,rt as te,u as R,ut as ne}from"./design-icons-QbNMZniQ.js";import{t as z}from"./external-link-BE6y205O.js";import{t as re}from"./eye-B8okNWXU.js";import{t as ie}from"./loader-circle-CPBhhDbB.js";import{t as ae}from"./message-square-B-MD-8rD.js";import{t as oe}from"./play-CmVAj_fu.js";import{t as B}from"./button-C8jUIs8Q.js";import{i as se,r as ce,t as le}from"./popover-CvL6hQ5c.js";import{a as ue,i as de,o as fe,r as pe,s as me,t as he}from"./dialog-DRZuXvul.js";import{t as V}from"./project-router-j0uBi7Ep.js";import{a as ge,i as H,o as U,r as _e,s as ve,t as ye}from"./command-BiBq24zL.js";import{d as be,f as W,i as xe,o as Se,p as Ce,s as we,t as Te,u as Ee}from"./skills-pM_PouEs.js";import{a as De,t as Oe}from"./agent-accounts-D_7QcFSx.js";import{$ as G,B as ke,G as Ae,H as je,Hn as Me,Q as Ne,Sr as Pe,U as Fe,Un as Ie,V as Le,Vn as K,W as Re,Z as ze,ar as q,at as Be,ct as Ve,dt as He,et as Ue,ft as We,jt as J,lt as Ge,ot as Ke,pt as qe,rt as Je,tt as Ye,z as Xe}from"./index-CXvWnyZg.js";import{t as Ze}from"./textarea-vEsJAUAV.js";import{t as Qe}from"./markdown-BAmUNyiK.js";import{t as $e}from"./diff-BcseHLlM.js";import{t as Y}from"./change-counts-wqSYI3W8.js";import{t as et}from"./option-select-BxFrlK_-.js";import{t as tt}from"./tab-link-BKlpD9sn.js";var X=e(t(),1),Z=n(),nt={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function Q({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,Z.jsx)(P,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:r(t,`text-semantic-green`)}):e===`failing`?(0,Z.jsx)(k,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:r(t,`text-semantic-red`)}):e===`pending`?(0,Z.jsx)(ie,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:r(t,`animate-spin text-semantic-amber motion-reduce:animate-none`)}):e===`review`?(0,Z.jsx)(N,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-review`,className:r(t,`text-semantic-info`)}):e===`conflict`?(0,Z.jsx)(j,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-conflict`,className:r(t,`text-semantic-conflict`)}):(0,Z.jsx)(N,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:r(t,`text-soft-foreground`)})}function rt(e){return e?.available?e.mergeState:null}function it(e,t){return e&&t?.methods.includes(e)?e:t?.defaultMethod??t?.methods[0]??null}function at(e){return e.state===`merged`?`Merged`:e.state===`closed`?`Closed`:e.isDraft?`Draft`:e.mergeable===`conflicting`?`Conflicts must be resolved`:e.canMerge?`Ready to merge`:e.eligibility===`unknown`?`Merge blocked · Requirements unknown`:`Merge blocked`}function ot(e){return e===`approved`||e===`not-required`?`passing`:e===`review-required`?`review`:e===`unknown`?`unknown`:`failing`}function st(e){switch(e){case`approved`:return`Approved`;case`not-required`:return`Not required`;case`review-required`:return`Waiting for review`;case`changes-requested`:return`Changes requested`;case`unknown`:return`Unknown`}}function ct(e){return e===`mergeable`?`passing`:e===`conflicting`?`conflict`:`unknown`}function lt(e){return e===`conflicting`?`present`:e===`mergeable`?`none`:`unknown`}function ut(e){return e===!0?` · required`:e===null?` · requiredness unknown`:``}function dt(e){return e?.available===!1?e.reason:`GitHub could not load merge requirements.`}function ft(e,t,n){return!!(e&&(t.canMerge||t.canOverride&&n))}function $(e){return e?nt[e]:`Merge`}function pt(e){return e===`conflicting`?`true`:void 0}function mt({check:e}){return(0,Z.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(Q,{state:e.state}),(0,Z.jsxs)(`span`,{children:[e.name,` · `,e.state,ut(e.required)]})]}),e.url&&i(e.url)?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]})}function ht({reason:e}){return(0,Z.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:e})]})}function gt({state:e,selectedMethod:t,overrideRules:n,mergeEnabled:i,refreshPending:a,onRefresh:o,onRunAgent:s,onConfirm:c,onMethodChange:l,onOverrideChange:u}){let d=at(e),f=ot(e.reviewDecision),p=ct(e.mergeable);return(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[e.canMerge?(0,Z.jsx)(P,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-semantic-green`}):(0,Z.jsx)(j,{size:16,"aria-hidden":`true`,className:r(`mt-0.5 size-5 shrink-0`,e.mergeable===`conflicting`?`text-semantic-conflict`:`text-semantic-amber`)}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(`h3`,{className:`font-semibold`,children:d}),(0,Z.jsxs)(B,{type:`button`,variant:`ghost`,size:`sm`,disabled:a,onClick:o,children:[(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,className:r(`size-3.5`,a&&`animate-spin`)}),`Refresh`]})]}),(0,Z.jsxs)(`p`,{className:`mt-1 font-mono text-xs text-soft-foreground`,children:[e.headRef,` (`,Ie(e.headSha),`) → `,e.baseRef]}),(0,Z.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,Z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{state:f}),(0,Z.jsxs)(`span`,{children:[`Reviews: `,st(e.reviewDecision)]})]}),(0,Z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{state:p}),(0,Z.jsxs)(`span`,{children:[`Conflicts: `,lt(e.mergeable)]})]}),e.checks.length===0?(0,Z.jsx)(`li`,{children:`No checks configured`}):e.checks.map(e=>(0,Z.jsx)(mt,{check:e},e.name)),e.blockers.map(e=>(0,Z.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),e.mergeable===`conflicting`&&s?(0,Z.jsx)(B,{className:`mt-4`,onClick:s,children:`Run agent on this PR`}):null,e.canOverride?(0,Z.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 rounded-md border border-pending-strong/40 bg-pending/10 p-3 text-xs`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>u(e.target.checked),className:`mt-0.5 size-4 accent-accent-strong`}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,Z.jsx)(`span`,{className:`mt-0.5 block text-soft-foreground`,children:`GitHub will allow this only if your permissions can bypass the repository rules.`})]})]}):null,e.eligibility===`unknown`?(0,Z.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`GitHub could not confirm review and branch-protection requirements. Passing checks do not establish merge readiness.`}):null,e.state===`open`&&e.methods.length>0?(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col flex-wrap gap-2 sm:flex-row`,children:[(0,Z.jsx)(et,{"aria-label":`Merge method`,value:t??``,onValueChange:e=>l(e),options:e.methods.map(e=>({value:e,label:nt[e]})),className:`w-full min-w-0 flex-1 bg-background sm:w-auto`}),(0,Z.jsx)(B,{disabled:!i,onClick:c,children:$(t)})]}):null]})]})}function _t({number:e,state:t,selectedMethod:n,confirming:r,overrideRules:i,mergePending:a,mergeError:o,onOpenChange:s,onMerge:c}){return(0,Z.jsx)(he,{open:r,onOpenChange:s,children:(0,Z.jsxs)(pe,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,Z.jsxs)(fe,{children:[(0,Z.jsxs)(me,{children:[$(n),` pull request #`,e,`?`]}),(0,Z.jsx)(de,{asChild:!0,children:(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`p`,{children:[`This will merge “`,t.title,`” into `,t.baseRef,`. GitHub will re-check the exact reviewed head before changing the repository.`]}),i&&t.canOverride?(0,Z.jsx)(`p`,{"data-slot":`gh-bypass-warning`,className:`mt-4 text-sm text-semantic-amber`,children:`You are asking GitHub to bypass unmet repository requirements; GitHub may refuse if your permissions do not allow it.`}):null]})})]}),o?(0,Z.jsx)(`p`,{className:`text-sm text-danger`,children:o.message}):null,(0,Z.jsxs)(ue,{children:[(0,Z.jsx)(B,{variant:`outline`,disabled:a,onClick:()=>s(!1),children:`Cancel`}),(0,Z.jsx)(B,{disabled:a,onClick:c,children:a?`Merging…`:$(n)})]})]})})}function vt({number:e,onRunAgent:t}){let n=E(),r=c(),i=w({queryKey:s.githubMergeState(e),queryFn:({signal:t})=>b(e,{},{signal:t}),retry:!1}),a=rt(i.data),[o,l]=(0,X.useState)(null),[u,d]=(0,X.useState)(!1),[f,p]=(0,X.useState)(!1),m=g({mutationFn:t=>b(e,{refresh:!0}),onSuccess:(e,t)=>n.setQueryData(t,e),onError:e=>C(e instanceof Error?e.message:String(e),{tone:`danger`})}),h=it(o,a),_=()=>({mergeState:s.githubMergeState(e),list:s.githubPages(50),comments:s.githubComments(`pr`,e),item:s.githubItem(`pr`,e),refStatus:r===void 0?void 0:s.githubRefStatusOf(r)}),v=g({mutationFn:t=>{if(!a||!h)throw Error(`No merge method is available.`);return T(e,{method:h,expectedHeadSha:a.headSha,...f&&a.canOverride?{overrideRules:!0}:{}})},onSuccess:(t,r)=>{d(!1),C(`Pull request #${e} merged`),n.invalidateQueries({queryKey:r.mergeState}),n.invalidateQueries({queryKey:r.list}),n.invalidateQueries({queryKey:r.comments}),n.invalidateQueries({queryKey:r.item}),r.refStatus&&n.invalidateQueries({queryKey:r.refStatus})},onError:(e,t)=>{C(e instanceof Error?e.message:String(e),{tone:`danger`}),n.invalidateQueries({queryKey:t.mergeState})}});return i.isPending?(0,Z.jsx)(q,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`}):a?(0,Z.jsxs)(`section`,{"data-slot":`gh-merge-box`,"data-eligibility":a.eligibility,"data-conflicting":pt(a.mergeable),"aria-live":`polite`,className:`mt-6 rounded-lg border border-card-edge bg-card p-4 shadow-card`,children:[(0,Z.jsx)(gt,{state:a,selectedMethod:h,overrideRules:f,mergeEnabled:ft(h,a,f),refreshPending:m.isPending,onRefresh:()=>m.mutate(s.githubMergeState(e)),onRunAgent:t,onConfirm:()=>d(!0),onMethodChange:l,onOverrideChange:p}),(0,Z.jsx)(_t,{number:e,state:a,selectedMethod:h,confirming:u,overrideRules:f,mergePending:v.isPending,mergeError:v.error,onOpenChange:d,onMerge:()=>v.mutate(_())})]}):(0,Z.jsx)(ht,{reason:dt(i.data)})}function yt(e){let t=new Set;for(let n of e)for(let e of n.labels)t.add(e);return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function bt(e,t={}){let n=(t.query??``).trim().toLowerCase(),r=t.labels??[],i=n.replace(/^#/,``),a=i!==``&&/^\d+$/.test(i);return e.filter(e=>r.length>0&&!r.every(t=>e.labels.includes(t))||t.assignees?.length&&!e.assignees?.some(e=>t.assignees.some(t=>t.toLowerCase()===e.toLowerCase()))||t.author!==void 0&&e.author.toLowerCase()!==t.author.toLowerCase()||t.includeNumbers&&!t.includeNumbers.has(e.number)||t.excludeNumbers?.has(e.number)||t.projectId&&e.projectIds!==void 0&&!e.projectIds.includes(t.projectId)?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body??``}`.toLowerCase().includes(n))}function xt(e,t){let n=e.trim();if(n===``)return!1;let r=n.replace(/^#/,``);return/^\d+$/.test(r)?!t.some(e=>e.number===Number(r)):t.length===0}function St(e){if(!e||!/^[0-9a-fA-F]{6}$/.test(e))return{borderColor:`var(--border)`,color:`var(--muted-foreground)`};let t=`#${e}`;return{backgroundColor:`${t}22`,borderColor:`${t}66`,color:`color-mix(in srgb, ${t} 50%, var(--foreground))`}}function Ct(e){return!e||!/^[0-9a-fA-F]{6}$/.test(e)?{backgroundColor:`var(--border)`}:{backgroundColor:`#${e}`}}function wt({label:e,color:t,className:n}){return(0,Z.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,title:e,style:St(t),className:r(`rounded-full border px-1.5 py-px text-[12px] font-medium`,n),children:e})}function Tt(e){return e===`pr`?`pull request`:`issue`}function Et(e,t,n){return e===`pr`&&!!(t||n)}function Dt({backLink:e}){return e?(0,Z.jsxs)(V,{to:e.to,"data-slot":`gh-back`,className:`mb-3 inline-flex min-h-11 items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Z.jsx)(L,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}):null}var Ot=r(`text-sm`,`[&_[data-streamdown="code-block"]]:relative [&_[data-streamdown="code-block"]]:my-2.5 [&_[data-streamdown="code-block"]]:gap-0 [&_[data-streamdown="code-block"]]:overflow-hidden [&_[data-streamdown="code-block"]]:rounded-lg [&_[data-streamdown="code-block"]]:border [&_[data-streamdown="code-block"]]:border-border [&_[data-streamdown="code-block"]]:bg-background [&_[data-streamdown="code-block"]]:p-0 [&_[data-streamdown="code-block"]]:![content-visibility:visible] [&_[data-streamdown="code-block"]]:![contain-intrinsic-size:auto]`,`[&_[data-streamdown="code-block-header"]]:h-7 [&_[data-streamdown="code-block-header"]]:border-b [&_[data-streamdown="code-block-header"]]:border-border [&_[data-streamdown="code-block-header"]]:bg-muted/40 [&_[data-streamdown="code-block-header"]]:px-3 [&_[data-streamdown="code-block-header"]]:text-xs`,`[&_[data-streamdown="code-block-header"][data-language=""]]:hidden [&_[data-streamdown="code-block-header"]:not([data-language])]:hidden [&_[data-streamdown="code-block-header"]:has(>span:empty)]:hidden`,`[&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:absolute [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:top-1 [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:right-1.5 [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:mt-0 [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:h-auto`,`[&_[data-streamdown="code-block-actions"]]:border-0 [&_[data-streamdown="code-block-actions"]]:bg-transparent [&_[data-streamdown="code-block-actions"]]:p-0 [&_[data-streamdown="code-block-actions"]]:backdrop-blur-none`,`[&_[data-streamdown="image-fallback"]]:inline-flex [&_[data-streamdown="image-fallback"]]:rounded-md [&_[data-streamdown="image-fallback"]]:border [&_[data-streamdown="image-fallback"]]:border-dashed [&_[data-streamdown="image-fallback"]]:border-border [&_[data-streamdown="image-fallback"]]:bg-muted/40 [&_[data-streamdown="image-fallback"]]:px-3 [&_[data-streamdown="image-fallback"]]:py-2 [&_[data-streamdown="image-fallback"]]:not-italic [&_[data-streamdown="image-fallback"]]:after:content-["_—_open_on_GitHub_to_view"]`,`[&_[data-streamdown="code-block-body"]]:rounded-none [&_[data-streamdown="code-block-body"]]:border-0 [&_[data-streamdown="code-block-body"]]:bg-transparent [&_[data-streamdown="code-block-body"]]:px-3.5 [&_[data-streamdown="code-block-body"]]:py-2.5 [&_[data-streamdown="code-block-body"]]:pr-10`);function kt(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function At({item:e,kindWord:t,commentCount:n,hasDiffStat:r,additions:a,deletions:o}){return(0,Z.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{className:`tabular-nums`,children:[`#`,e.number]}),`·`,(0,Z.jsx)(`span`,{children:t}),`·`,(0,Z.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,Z.jsx)(K,{iso:e.createdAt,title:kt(e.createdAt)}),n?(0,Z.jsxs)(Z.Fragment,{children:[`·`,(0,Z.jsx)(rn,{count:n})]}):null,r?(0,Z.jsxs)(Z.Fragment,{children:[`·`,(0,Z.jsx)(`span`,{"data-slot":`gh-diffstat`,children:(0,Z.jsx)(Y,{adds:a??0,dels:o??0})})]}):null,`·`,i(e.url)?(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-open-link`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,Z.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]})}function jt({item:e,subNav:t,changes:n}){return e.kind===`pr`?t?(0,Z.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,Z.jsx)(tt,{to:J(`prs`,t.filter,e.number,``,t.narrows),active:!n,children:`Conversation`}),(0,Z.jsx)(tt,{to:J(`prs`,t.filter,e.number,`/changes`,t.narrows),active:n,children:`Changes`})]}):(0,Z.jsx)(V,{to:J(`prs`,null,e.number,`/changes`),"data-slot":`gh-files-changed`,className:`mt-3 inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground hover:underline`,children:`Files changed`}):null}function Mt({item:e,colors:t,checks:n}){return e.labels.length>0||n?(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,Z.jsx)(wt,{label:e,color:t[e]},e)),n?(0,Z.jsx)(an,{checks:n,url:e.url}):null]}):null}function Nt({item:e,colors:t,body:n}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{"data-slot":`gh-body`,className:r(`mt-5`,Ot),children:n?(0,Z.jsx)(Qe,{children:n}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`(no description)`})}),(0,Z.jsx)(Rt,{item:e,colors:t})]})}function Pt({item:e,colors:t,checks:n,comments:r,backLink:i,subNav:a,onRunAgent:o,afterHeading:s,headerAction:c,children:l}){let d=a?.changes??!1,f=Tt(e.kind),p=u(e.kind,e.number,!d).data?.detail,m=p?.body??e.body,h=p?.additions??e.additions,g=p?.deletions??e.deletions,_=Et(e.kind,h,g),v=r??e.comments;return(0,Z.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,Z.jsx)(Dt,{backLink:i}),(0,Z.jsxs)(`div`,{"data-slot":`gh-description-card`,className:e.kind===`pr`?`rounded-xl border border-border bg-card p-6`:void 0,children:[e.kind===`pr`?(0,Z.jsx)(Ft,{action:c,className:`mb-4`,children:(0,Z.jsxs)(`h2`,{className:`min-w-0 text-[22px] leading-snug font-semibold tracking-tight`,children:[`#`,e.number,` `,e.title]})}):null,(0,Z.jsx)(Ft,{action:e.kind===`pr`?void 0:c,children:(0,Z.jsx)(At,{item:e,kindWord:f,commentCount:v,hasDiffStat:_,additions:h,deletions:g})}),e.kind===`pr`?null:(0,Z.jsx)(`h2`,{className:`mt-2 text-[22px] leading-snug font-semibold tracking-tight`,children:e.title}),s,(0,Z.jsx)(jt,{item:e,subNav:a,changes:d}),(0,Z.jsx)(Mt,{item:e,colors:t,checks:n}),d&&e.kind===`pr`?(0,Z.jsx)(It,{item:e}):(0,Z.jsx)(Nt,{item:e,colors:t,body:m})]}),e.kind===`pr`?(0,Z.jsx)(vt,{number:e.number,onRunAgent:o}):null,l]})}function Ft({action:e,className:t,children:n}){return e?(0,Z.jsxs)(`div`,{"data-slot":`gh-header-row`,className:r(`flex flex-wrap items-center gap-x-3 gap-y-2`,t),children:[(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:n}),(0,Z.jsx)(`div`,{"data-slot":`gh-header-action`,className:`flex shrink-0 items-center gap-2`,children:e})]}):t?(0,Z.jsx)(`div`,{className:t,children:n}):(0,Z.jsx)(Z.Fragment,{children:n})}function It({item:e}){let t=E(),n=h(e.number),[a,o]=(0,X.useState)(``),[c,l]=(0,X.useState)(null),u=n.data,d=e=>u?.available?u.files.filter(t=>t.path.toLowerCase().includes(e.toLowerCase())):[],f=d(a),p=f.some(e=>e.path===c)?c:f[0]?.path??null,m=f.findIndex(e=>e.path===p),g=e=>{o(e);let t=d(e),n=p??c,r=t.some(e=>e.path===n)?n:t[0]?.path??n;r!==c&&l(r)},_=async()=>{let n=u?.available?u.headSha:null,r=s.githubPrChanges(e.number),i=await y(e.number,{refresh:!0});t.setQueryData(r,i),i.available&&n&&n!==i.headSha&&(l(i.files[0]?.path??null),C(`The reviewed revision changed.`))};if(n.isPending)return(0,Z.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(n.isError||!u)return(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!u.available)return(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:u.reason});let v=f.map(e=>({path:e.path,...e.previousPath?{oldPath:e.previousPath}:{},status:e.status===`removed`?`deleted`:e.status===`changed`?`modified`:e.status,adds:e.additions,dels:e.deletions,binary:e.patchUnavailableReason===`binary`,patch:e.patch??``})),b=i(e.url)?`${e.url}/files`:null,x=f.find(e=>e.path===p);return(0,Z.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,Z.jsxs)(`strong`,{children:[u.files.length,` changed files`]}),(0,Z.jsx)(Y,{adds:u.additions,dels:u.deletions}),(0,Z.jsx)(Me,{sha:u.headSha,variant:`inline`,prefix:`head `,className:`text-muted-foreground`}),(0,Z.jsx)(B,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void _(),children:`Refresh`})]}),u.truncated?(0,Z.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-pending-strong/40 bg-pending/10 p-3 text-xs`,children:[u.reason??`This response is incomplete.`,` `,b?(0,Z.jsx)(`a`,{href:b,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,Z.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,Z.jsxs)(`aside`,{className:`min-w-0`,children:[(0,Z.jsx)(`input`,{"aria-label":`Filter changed files`,value:a,onChange:e=>g(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,Z.jsx)(et,{"aria-label":`Select changed file`,value:p??``,onValueChange:l,options:f.map(e=>({value:e.path,label:e.path})),className:`mt-2 w-full min-w-0 bg-background lg:hidden`,contentClassName:`max-w-[calc(100vw-2rem)]`}),(0,Z.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:f.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>l(e.path),className:r(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,p===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,Z.jsx)(Y,{adds:e.additions,dels:e.deletions})]})},e.path))})]}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,Z.jsx)(B,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:m<=0,onClick:()=>l(f[m-1]?.path??null),children:(0,Z.jsx)(Pe,{})}),(0,Z.jsx)(B,{"aria-label":`Next file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:m<0||m>=f.length-1,onClick:()=>l(f[m+1]?.path??null),children:(0,Z.jsx)(M,{size:16})})]}),f.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($e,{files:v.filter(e=>e.path===p),wrap:!0,className:`min-w-0`}),x&&!x.patch?(0,Z.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,x.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function Lt(e){let t=e.filter(e=>e.kind===`review`).length,n=e.length-t,r=`${n} comment${n===1?``:`s`}`;return t===0?r:`${r} · ${t} review${t===1?``:`s`}`}function Rt({item:e,colors:t}){let n=u(e.kind,e.number),r=n.data,i=(0,X.useMemo)(()=>{let e=[...(r?.comments??[]).map(e=>({row:`comment`,comment:e})),...(r?.events??[]).map(e=>({row:`event`,event:e}))],t=e=>{let t=Date.parse(zt(e));return Number.isNaN(t)?-1/0:t};return e.sort((e,n)=>t(e)-t(n))},[r?.comments,r?.events]);return n.isPending?(0,Z.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,Z.jsx)(q,{className:`mb-3 h-3 w-24`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(q,{className:`h-14 w-full`}),(0,Z.jsx)(q,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,Z.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,Z.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,Z.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-xs font-semibold tracking-wide text-muted-foreground uppercase`,children:[`Activity · `,Lt(r.comments)]}),(0,Z.jsx)(`ul`,{className:`flex flex-col gap-5`,children:Bt(i).map(e=>e.group===`commits`?(0,Z.jsx)(Vt,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,Z.jsx)(Qt,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,Z.jsx)(Ut,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-thread-truncated`,className:`mt-4 inline-flex items-center gap-0.5 text-xs text-muted-foreground hover:text-foreground hover:underline`,children:[`thread truncated — open on GitHub`,(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var zt=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function Bt(e){let t=[],n=[],r=()=>{n.length!==0&&(n.length===1?t.push({group:`single`,entry:{row:`event`,event:n[0]}}):t.push({group:`commits`,commits:n}),n=[])};for(let i of e){if(i.row===`event`&&i.event.kind===`committed`&&i.row===`event`){let e=n[n.length-1];e&&e.actor!==i.event.actor&&r(),n.push(i.event);continue}r(),t.push({group:`single`,entry:i})}return r(),t}function Vt({commits:e,colors:t}){let[n,r]=(0,X.useState)(!1),i=e[0]?.actor??`?`;return n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":!0,onClick:()=>r(!1),className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:Ht.committed}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Z.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,Z.jsx)(Ut,{event:e,colors:t},e.id))]}):(0,Z.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":!1,onClick:()=>r(!0),className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:Ht.committed}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Z.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,Z.jsx)(K,{iso:e[e.length-1].createdAt,className:`shrink-0`})]})})}var Ht={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function Ut({event:e,colors:t}){return(0,Z.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:r(`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:Ht[e.kind]}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,Z.jsx)(Yt,{event:e,colors:t}),(0,Z.jsx)(K,{iso:e.createdAt,className:`shrink-0`}),e.url?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open ${e.kind} on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function Wt({event:e}){return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,Z.jsx)(Me,{sha:e.sha,variant:`inline`,className:`shrink-0 text-xs text-muted-foreground`}):null,e.message?(0,Z.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,Z.jsx)(Xt,{checks:e.checks})]})}function Gt({event:e,colors:t}){return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,Z.jsx)(`span`,{"data-slot":`gh-event-label`,style:St(e.label.color??t[e.label.name]),className:`max-w-[12rem] truncate rounded-full border px-1.5 py-px font-sans text-[12px]`,children:e.label.name}):null,(0,Z.jsx)(`span`,{className:`shrink-0`,children:`label`})]})}function Kt({event:e}){return(0,Z.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]})}function qt({event:e}){return(0,Z.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}var Jt={committed:e=>(0,Z.jsx)(Wt,{event:e}),labeled:(e,t)=>(0,Z.jsx)(Gt,{event:e,colors:t}),unlabeled:(e,t)=>(0,Z.jsx)(Gt,{event:e,colors:t}),assigned:e=>(0,Z.jsx)(Kt,{event:e}),unassigned:e=>(0,Z.jsx)(Kt,{event:e}),merged:()=>(0,Z.jsx)(`span`,{children:`merged this`}),closed:()=>(0,Z.jsx)(`span`,{children:`closed this`}),reopened:()=>(0,Z.jsx)(`span`,{children:`reopened this`}),head_ref_force_pushed:()=>(0,Z.jsx)(`span`,{children:`force-pushed`}),renamed:e=>(0,Z.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]}),"cross-referenced":e=>(0,Z.jsx)(qt,{event:e})};function Yt({event:e,colors:t}){return Jt[e.kind]?.(e,t)??null}function Xt({checks:e}){return e?(0,Z.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:r(`shrink-0`,tn[e]),children:en[e]}):null}var Zt={approved:{label:`Approved`,tone:`border-success/40 text-semantic-green`},changes_requested:{label:`Changes requested`,tone:`border-danger/40 text-semantic-red`},commented:{label:`Commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`Dismissed`,tone:`border-border text-muted-foreground`}};function Qt({comment:e}){let t=e.reviewState?Zt[e.reviewState]:null;return(0,Z.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Z.jsx)($t,{url:e.avatarUrl,login:e.author}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,Z.jsx)(K,{iso:e.createdAt}),t?(0,Z.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:r(`rounded-full border px-1.5 py-px font-sans text-[12px] font-medium`,t.tone),children:t.label}):null,(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open comment on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,Z.jsx)(`div`,{"data-slot":`gh-thread-body`,className:Ot,children:e.body?(0,Z.jsx)(Qe,{children:e.body}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`(no body)`})})]})}function $t({url:e,login:t}){let[n,r]=(0,X.useState)(!1);return e&&!n?(0,Z.jsx)(`img`,{src:e,alt:``,width:20,height:20,loading:`lazy`,onError:()=>r(!0),"data-slot":`gh-avatar`,className:`size-5 shrink-0 rounded-full`}):(0,Z.jsx)(`span`,{"data-slot":`gh-avatar-fallback`,"aria-hidden":`true`,className:`flex size-5 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var en={passing:`✓`,failing:`✗`,pending:`○`},tn={passing:`text-semantic-green`,failing:`text-semantic-red`,pending:`text-semantic-amber`},nn={passing:`Checks passing`,failing:`Checks failing`,pending:`Checks pending`};function rn({count:e}){return e?(0,Z.jsxs)(`span`,{"data-slot":`gh-comment-count`,"data-count":e,"aria-label":`${e} comment${e===1?``:`s`}`,className:`inline-flex shrink-0 items-center gap-0.5`,children:[(0,Z.jsx)(ae,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function an({checks:e,url:t}){let n=r(`text-xs font-medium`,tn[e],t&&`hover:underline`),i=`${en[e]} ${nn[e]}`;return t?(0,Z.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:i}):(0,Z.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:i})}function on({checks:e}){return(0,Z.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:nn[e],"aria-label":nn[e],className:r(`shrink-0 font-sans text-xs font-semibold`,tn[e]),children:en[e]})}function sn(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function cn(e,t=[]){let n=sn(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=ln(t)),n}function ln(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function un(e,t){return e.replace(/\{\{\s*number\s*\}\}/gi,()=>`#${t.number}`).replace(/\{\{\s*title\s*\}\}/gi,()=>t.title).replace(/\{\{\s*url\s*\}\}/gi,()=>t.url)}function dn(e,t){if(e.includes(t.url))return!0;let n=t.kind===`pr`?String.raw`(?:pull\s+request|pr)`:String.raw`issue`;return new RegExp(String.raw`\b${n}\s*#?\s*${t.number}\b`,`i`).test(e)}function fn(e,t,n){let r=(n??``).trim();if(!r)return cn(e,t);let i=sn(e),a=r.startsWith(i)?i+un(r.slice(i.length),e):un(r,e),o=dn(a,e)?a:`${i}\n\n${a}`;return t.length?o+ln(t):o}function pn(e){let t=[];for(let n of e.slice(0,8)){let e=new Set(t.map(e=>e.id)),r=n;for(let t=2;e.has(r);t++)r=`${n}-${t}`;t.push({id:r,name:n,skill:n,prompt:`{{task}}`})}return t}function mn(e,t,n,r,i={}){return t?{...i,workflow:t,task:fn(e,n.map(e=>e.id),r)}:n.length?{...i,steps:pn(n.map(e=>e.id)).map((e,t)=>({...e,...n[t]?.path===void 0?{}:{skillPath:n[t].path}})),task:fn(e,[],r)}:{...i,workflow:`quick-task`,task:fn(e,[],r)}}function hn(e){let t=o(),n=l(),r=f(),{runners:i,uninstalled:a,signedOut:s,accounts:c,repoAccount:u,accountFor:d}=De(),m=n.data?.defaultRunner,h=Re(e.runner,i,m??i[0]??`claude`),g=n.data?.modelsLocked===!0,_=d(h,e.account),v=p(h,!0,_??u?.[h]),y=Fe(g?null:e.model,h,r.data,n.data?.defaultModels,v.data),b=ke(y,v.data);return{runner:h,runnerExplicit:e.runner!==null,model:y,effort:g?``:je(e.effort,b),effortOptions:b,runners:i,uninstalled:a,signedOut:s,defaultRunner:m,canRun:t.isSuccess&&i.length>0,modelsLocked:g,providerPending:t.isPending,providerError:t.isError,accounts:c,account:_,repoAccount:u}}function gn(e){return{runner:Ae(e.runner,e.defaultRunner,e.runnerExplicit),model:e.modelsLocked?void 0:e.model||void 0,effort:e.modelsLocked?void 0:e.effort||void 0}}function _n(e){return{...gn(e),...e.account?{agentProfile:e.account}:{}}}function vn(e,t){return e.find(e=>e.id===t)?.label??(t===``?`Runner default`:t)}function yn(e,t){let{runners:n,uninstalled:r,signedOut:i}=e;return n.length>1||r.length>0||i.length>0||n.some(e=>Oe(t,e))}function bn({pick:e,onChange:t,disabled:n=!1,accounts:r=!1,layout:i}){let a=(0,X.useRef)(null),o=(0,X.useRef)(null),[s,c]=(0,X.useState)(()=>typeof window<`u`&&window.innerWidth<=767);(0,X.useLayoutEffect)(()=>{let e=a.current;if(i!==`row`||!e)return;let t=()=>{let t=window.innerWidth<=767||e.getBoundingClientRect().width<550,n=document.activeElement;o.current=n instanceof HTMLElement&&e.contains(n)?n:null,c(t)};t();let n=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return n?.observe(e),window.addEventListener(`resize`,t),()=>{n?.disconnect(),window.removeEventListener(`resize`,t)}},[i]),(0,X.useLayoutEffect)(()=>{let e=o.current;o.current=null,e&&e.isConnected&&document.activeElement!==e&&e.focus()},[s]);let u=hn(e),{runner:d,model:m,effort:h,effortOptions:g,runners:_,canRun:v,modelsLocked:y}=u,b=l(),x=f(),S=p(d,!0,u.account??u.repoAccount?.[d]),C=Le(d,x.data,S.data,[e.model,b.data?.defaultModels?.[d]]),w=n||!v,T=r?u.accounts:[],E=yn(u,T)?(0,Z.jsx)(Ye,{icon:(0,Z.jsx)(I,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,runners:_,uninstalled:u.uninstalled,signedOut:u.signedOut,value:d,accounts:T,account:r?u.account:null,repoAccount:r?u.repoAccount:void 0,disabled:w,onPick:(n,i)=>t(r?{runner:n,account:i,model:n===d?e.model:null,effort:e.effort}:{runner:n,account:null,model:null,effort:e.effort})},`runner`):null,O=(0,Z.jsx)(G,{icon:(0,Z.jsx)(A,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`model-pill`,ariaLabel:`Model`,label:vn(C,m),value:m,disabled:w,readOnly:y===!0,disabledHint:y?`Model selection is locked to native coding-agent settings.`:void 0,onPick:n=>{let r=ke(n,S.data);t({...e,model:n,effort:e.effort===null?null:je(e.effort,r)})},options:C.map(e=>({value:e.id,label:e.label,desc:e.desc})),status:Xe(d,x.data,S)},`model`),k=(0,Z.jsx)(G,{icon:(0,Z.jsx)(D,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`effort-pill`,ariaLabel:`Effort`,label:g.find(e=>e.value===h)?.label??`Runner default`,value:h,disabled:w,readOnly:y===!0,disabledHint:y?`Effort selection is locked to native coding-agent settings.`:void 0,onPick:n=>t({...e,effort:n}),options:g.map(e=>({value:e.value,label:e.label,desc:e.desc}))},`effort`);return i===`row`?(0,Z.jsx)(`div`,{ref:a,"data-slot":`engine-row-box`,children:(0,Z.jsx)(`div`,{"data-slot":`engine-row`,className:`engine-row`,role:`group`,"aria-label":`Agent settings`,children:(0,Z.jsx)(Ue,{fill:`model-pill`,children:s?[E,k,O]:[E,O,k]})})}):(0,Z.jsxs)(Ue,{children:[E,O,k]})}var xn={workflow:null,skills:[]},Sn=`cez-followup-selection`;function Cn(e){let t=e&&typeof e==`object`?e:{};return{workflow:typeof t.workflow==`string`?t.workflow:null,skills:Array.isArray(t.skills)?t.skills.flatMap(e=>typeof e==`string`?[{id:e}]:!e||typeof e!=`object`||typeof e.id!=`string`?[]:[{id:e.id,...typeof e.path==`string`?{path:e.path}:{}}]):[]}}function wn(){try{let e=localStorage.getItem(Sn);return e?Cn(JSON.parse(e)):{...xn}}catch{return{...xn}}}function Tn(e){try{localStorage.setItem(Sn,JSON.stringify(e))}catch{}}var En=`cez-followup-prompt:`;function Dn(e){try{return localStorage.getItem(En+e)??``}catch{return``}}function On(e,t){try{t===``?localStorage.removeItem(En+e):localStorage.setItem(En+e,t)}catch{}}function kn({item:e,workflows:t,skills:n,workflow:r,onWorkflowChange:o,selectedSkills:c,onSkillsChange:l,engine:u,onEngineChange:d,queuedRunId:f,onQueued:p}){let h=E(),_=a(),y=e.kind===`pr`?`PR`:`issue`,b=hn(u),x=m(b.runner,b.account),w=c.filter(e=>x.unchecked||e.path===void 0||n.some(t=>t.id===e.id&&(e.path===void 0||t.path===e.path))),T=w.length!==c.length,[D]=(0,X.useState)(()=>sn(e)),[O,k]=(0,X.useState)(()=>Dn(e.url)||D),A=(0,X.useRef)(null),j=(0,X.useRef)(null);(0,X.useEffect)(()=>{On(e.url,O===D?``:O)},[e.url,O,D]);let M=(0,X.useMemo)(()=>He(_.data?.promptTemplates),[_.data?.promptTemplates]),ee=e=>{let t=A.current,n=qe({prompt:O,base:D,selectionStart:t?.selectionStart??null,focused:document.activeElement===t,remembered:j.current}),r=Ge(O,n,e);k(r.text),j.current=r.caret,requestAnimationFrame(()=>{A.current?.focus(),A.current?.setSelectionRange(r.caret,r.caret)})},N=Ve(M,w.map(e=>e.id)),F=(0,X.useRef)(O);F.current=O;let I=(0,X.useRef)(``);(0,X.useEffect)(()=>{let e=We(F.current,I.current,N,D);I.current=e.applied,e.text!==F.current&&k(e.text)},[N,D]);let L=g({mutationFn:async()=>!b.canRun||T?null:S(mn(e,r,w,O,_n(b))),onSuccess:t=>{if(t===null)return;let n=t;n&&p(e.url,n.id),C(`Added to the queue — ${y} #${e.number}`),w.length>0&&_.data!==void 0&&v({skillUsage:w.reduce((e,t)=>Te(e,t.id),_.data.skillUsage)}).then(()=>h.invalidateQueries({queryKey:s.uiState})).catch(()=>{}),On(e.url,``),k(D),I.current=``,h.invalidateQueries({queryKey:s.runs.all})},onError:e=>C(e.message,{tone:`danger`})}),te=e=>{Be(e)&&(e.preventDefault(),!L.isPending&&b.canRun&&L.mutate())},R=e=>l(c.some(t=>W(t)===W(e))?c.filter(t=>W(t)!==W(e)):[...c,we(e)]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,Z.jsx)(`h3`,{className:`text-xl font-normal text-foreground`,children:`Hand this to the agent`}),(0,Z.jsxs)(`label`,{className:`gh-field gh-prompt-field`,children:[(0,Z.jsx)(`span`,{children:`Instructions for the agent`}),(0,Z.jsx)(Ze,{ref:A,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:O,onChange:e=>k(e.target.value),onSelect:e=>{j.current=e.currentTarget.selectionStart},onKeyDown:te,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`})]}),(0,Z.jsx)(Ne,{templates:M,onInsert:ee}),(0,Z.jsxs)(`div`,{className:`gh-handoff-settings`,children:[(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Workflow`}),(0,Z.jsx)(jn,{workflows:t,value:r,onChange:o})]}),(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Skills · select one or more`}),(0,Z.jsx)(Nn,{skills:n,skillUsage:_.data?.skillUsage,selected:c,onToggle:R})]}),c.length>0?(0,Z.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:c.map(e=>(0,Z.jsx)(An,{skill:e,skills:n,unchecked:x.unchecked,onRemove:()=>R(e)},W(e)))}):null,T?(0,Z.jsx)(`p`,{role:`alert`,children:`A selected skill path is unavailable. Remove it or choose a current copy before starting.`}):null,(0,Z.jsx)(bn,{layout:`row`,pick:u,onChange:d,disabled:L.isPending||!b.canRun,accounts:!0}),(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Account`}),(0,Z.jsx)(Mn,{resolved:b,disabled:L.isPending||!b.canRun,onPick:e=>d({...u,account:e})})]}),!b.providerPending&&!b.canRun?(0,Z.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[b.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,Z.jsx)(V,{to:`/settings/agent-defaults#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null]}),(0,Z.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[e.kind===`pr`?`PR`:`Issue`,` number and link remain attached to the task. Edit the prompt before starting. Cmd/Ctrl+Enter submits; Enter adds a new line.`]})]}),(0,Z.jsxs)(`div`,{"data-slot":`gh-handoff-actions`,className:`mt-[22px] flex flex-wrap items-center gap-2.5`,children:[i(e.url)?(0,Z.jsx)(B,{asChild:!0,variant:`outline`,children:(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open in GitHub`})}):null,(0,Z.jsxs)(B,{variant:`primary`,"data-action":`gh-run`,disabled:L.isPending||!b.canRun||T,onClick:()=>L.mutate(),children:[(0,Z.jsx)(oe,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,y]}),(0,Z.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-xs font-medium text-muted-foreground`,children:Ke()}),f?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,Z.jsx)(P,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,Z.jsx)(V,{to:`/tasks/${f}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-accent-text hover:underline`,children:`View task →`})]}):null]})]})}function An({skill:e,skills:t,unchecked:n,onRemove:r}){let i=t.find(t=>t.id===e.id&&(e.path===void 0||t.path===e.path)),a=[i?.name??e.id,e.path].filter(Boolean).join(` · `),o=!n&&e.path!==void 0&&!i?` (unavailable)`:n||!i?` (unchecked)`:``;return(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e.id,onClick:r,title:`Remove skill ${a}`,"aria-label":`Remove skill ${a}`,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[a,o,(0,Z.jsx)(F,{size:16,"aria-hidden":`true`,className:`size-3`})]})}function jn({workflows:e,value:t,onChange:n}){let[i,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(``),c=(0,X.useRef)(null),l=be(e,o);return(0,Z.jsxs)(le,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,Z.jsx)(se,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:r(Je,t&&`border-foreground/60 font-mono text-xs font-semibold text-foreground`),children:[(0,Z.jsx)(ee,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),(0,Z.jsx)(`span`,{className:`min-w-0 max-w-44 truncate`,children:t??`workflow`}),(0,Z.jsx)(R,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Z.jsx)(ce,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Z.jsxs)(ye,{shouldFilter:!1,children:[(0,Z.jsx)(ge,{placeholder:`Search workflows…`,value:o,onValueChange:s,onInput:()=>c.current?.scrollTo(0,0)}),(0,Z.jsxs)(ve,{ref:c,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[l.length===0?(0,Z.jsx)(_e,{children:`Nothing matches.`}):null,(0,Z.jsx)(H,{children:l.map(e=>{let r=t===e.name;return(0,Z.jsxs)(U,{value:`workflow ${e.name}`,keywords:Ce(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),a(!1)},children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,Z.jsx)(P,{size:16,"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-link-foreground`}):null]},e.name)})})]})]})})]})}function Mn({resolved:e,disabled:t,onPick:n}){let r=e.accounts.filter(t=>t.provider===e.runner),i=[...r.some(e=>e.id==="default")?[]:[{value:_,label:`Default`}],...r.map(e=>({value:e.id,label:e.label,...e.configDir?{desc:e.configDir}:{}}))],a=e.account??e.repoAccount?.[e.runner]??`default`;return(0,Z.jsx)(G,{icon:(0,Z.jsx)(ne,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),slot:`account-pill`,ariaLabel:`Account`,label:i.find(e=>e.value===a)?.label??`Default`,value:a,options:i,disabled:t,onPick:n})}function Nn({skills:e,skillUsage:t,selected:n,onToggle:i}){let[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(``),[l,u]=(0,X.useState)(null),d=(0,X.useRef)(null),{mostUsed:f,project:p,global:m,ranked:h}=Ee(e,s,t),g=(e,t)=>{let a=n.some(t=>W(t)===W(e));return(0,Z.jsxs)(U,{value:W(e),keywords:Ce(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.id,"data-selected":a?`true`:void 0,onSelect:()=>i(we(e)),children:[(0,Z.jsx)(`span`,{className:r(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.path?(0,Z.jsx)(`span`,{className:`min-w-0 truncate text-xs`,children:e.path}):null,e.description?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,Z.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),u(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,Z.jsx)(re,{"aria-hidden":`true`,className:`size-3.5`})}),a?(0,Z.jsx)(P,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},W(e))};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ze,{skill:l,onClose:()=>u(null)}),(0,Z.jsxs)(le,{open:a,onOpenChange:e=>{o(e),e||c(``)},children:[(0,Z.jsx)(se,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:r(Je,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,Z.jsx)(te,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),`skills`,n.length>0?` · ${n.length}`:``,(0,Z.jsx)(R,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Z.jsx)(ce,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Z.jsxs)(ye,{shouldFilter:!1,children:[(0,Z.jsx)(ge,{placeholder:`Search skills…`,value:s,onValueChange:c,onInput:()=>d.current?.scrollTo(0,0)}),(0,Z.jsxs)(ve,{ref:d,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[s.trim()&&!e.some(e=>e.id===s.trim())?(0,Z.jsx)(H,{children:(0,Z.jsxs)(U,{value:`typed-skill`,onSelect:()=>i({id:s.trim()}),children:[`Use skill id “`,s.trim(),`” (unchecked)`]})}):null,(h?h.length===0:f.length===0&&p.length===0&&m.length===0)?(0,Z.jsx)(_e,{children:`Nothing matches.`}):null,h?h.length>0?(0,Z.jsx)(H,{children:h.map(e=>g(e,xe(e)))}):null:(0,Z.jsxs)(Z.Fragment,{children:[f.length>0?(0,Z.jsx)(H,{heading:`Most used`,children:f.map(e=>g(e,xe(e)))}):null,p.length>0?(0,Z.jsx)(H,{heading:`Project skills`,children:p.map(e=>g(e,!0))}):null,m.length>0?(0,Z.jsx)(H,{heading:`Global`,children:m.map(e=>g(e,!1))}):null]})]})]})})]})]})}var Pn=new WeakMap;function Fn(){let e=wn(),t={workflow:e.workflow,selectedSkills:e.skills,engine:{runner:null,model:null,effort:null,account:null},queued:new Map},n=new Set;return{snapshot:()=>t,subscribe:e=>(n.add(e),()=>{n.delete(e)}),update:e=>{t={...t,...e},(e.workflow!==void 0||e.selectedSkills!==void 0)&&Tn({workflow:t.workflow,skills:[...t.selectedSkills]}),n.forEach(e=>e())}}}function In(){let e=E(),{projectId:t}=x(),n=Pn.get(e);n||Pn.set(e,n=new Map);let r=n.get(t);r||n.set(t,r=Fn());let{snapshot:i,subscribe:o,update:s}=r,c=(0,X.useSyncExternalStore)(o,i,i),l=d(),u=hn(c.engine),f=m(u.runner,u.account),p=a(),h=l.data?.workflows;(0,X.useEffect)(()=>{h&&c.workflow!==null&&!h.some(e=>e.name===c.workflow)&&s({workflow:null})},[s,h,c.workflow]);let g=(0,X.useMemo)(()=>Se(f.data??[],p.data?.skillUsage),[f.data,p.data?.skillUsage]);return{...c,workflows:l,skillList:g,skillsUnchecked:f.unchecked,setWorkflow:e=>s({workflow:e}),setSelectedSkills:e=>s({selectedSkills:e}),setEngine:e=>s({engine:e}),onQueued:(e,t)=>s({queued:new Map(i().queued).set(e,t)})}}export{an as a,Dt as c,Bt as d,yt as f,xt as h,$t as i,Pt as l,Ct as m,kn as n,on as o,bt as p,cn as r,rn as s,In as t,wt as u};
@@ -0,0 +1 @@
1
+ import{Ft as e}from"./queries-CchoEEzj.js";import{n as t}from"./project-location-Cq1K7hXN.js";function n(){return{home:e().data?.homeDir??null,root:t()}}export{n as t};
@@ -0,0 +1 @@
1
+ import{Wt as e,un as t}from"./queries-CchoEEzj.js";import{n,un as r,vi as i}from"./toaster-zMN8cNZQ.js";function a(){let a=i();return t({mutationFn:e=>r(e),onSuccess:t=>a.setQueryData(e.config,t),onError:e=>n(e.message,{tone:`danger`})})}export{a as t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-C_rn70hE.js";import{O as i,Ut as a,k as o,qt as s,un as c}from"./queries-jsRcJKo6.js";import{M as l,Rn as u,j as d,n as f,p,u as m,vi as h}from"./toaster-C1BFyQ8i.js";import{h as g}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{C as _,K as v,Q as y,R as ee,W as te,X as ne,Z as re,a as b,ct as ie,dt as x,l as ae,lt as oe,mt as se,n as ce,ot as le,rt as S,st as ue,x as de,y as fe}from"./design-icons-QbNMZniQ.js";import{t as C}from"./button-C8jUIs8Q.js";import{i as w,o as pe,r as T,s as me,t as E}from"./dialog-DRZuXvul.js";import{c as D,f as he,u as ge}from"./page-shell-Dky5crRl.js";import{i as _e,l as ve,o as ye}from"./skills-pM_PouEs.js";import{t as be}from"./centered-state-BgSV4e79.js";import{En as O,an as k,cn as A,in as xe,j as Se,nn as j,on as Ce,rn as M,sn as N,sr as P,tn as F}from"./index-WGWSicA9.js";import{t as I}from"./textarea-vEsJAUAV.js";import{_ as L,a as we,c as Te,f as Ee,g as De,h as Oe,i as ke,m as Ae,n as je,o as Me,p as Ne,r as R,t as Pe,u as Fe}from"./sortable.esm-CAVTYaA3.js";import{t as Ie}from"./option-select-CFhKFk8u.js";import{t as Le}from"./discard-changes-dialog-CHo6iyVf.js";var z=e(t(),1);function B(e){let t=[];for(let n of e){if(n.kind===`plugin`||n.command||!n.skill||n.prompt!==void 0&&n.prompt!==`{{task}}`||n.name!==void 0&&n.name!==n.skill||n.timeoutMs!==void 0||n.model||n.effort!==void 0||n.runner||n.agentProfile||n.allowedTools||n.bashAllowlist||n.onFail)return null;t.push(n.skill)}return t.length?t:null}function Re(e,t){return{id:V(e,t),name:e,skill:e,prompt:`{{task}}`}}function V(e,t){let n=new Set(t.map(e=>e.id)),r=e;for(let t=2;n.has(r);t++)r=`${e}-${t}`;return r}function ze(e,t,n){return{id:V(e,n),[e]:t.trim()}}function H(e){if(!(e.kind===`plugin`||e.skill))return e.command===void 0?e.prompt===void 0?void 0:`prompt`:`command`}function Be(e,t,n){let r=e[t],i=r&&H(r);return!r||!i?[...e]:e.map((e,r)=>r===t?{...e,[i]:n}:e)}function U(e){return e.some(e=>{let t=H(e);return t!==void 0&&!e[t]?.trim()})}function Ve(e,t,n){let r=[...e];return r.splice(Math.max(0,Math.min(n,r.length)),0,t),r}function He(e,t,n){if(t===n||t<0||t>=e.length||n<0||n>=e.length)return[...e];let r=[...e],[i]=r.splice(t,1);return i===void 0?[...e]:(r.splice(n,0,i),r)}function Ue(e,t){return e.filter((e,n)=>n!==t)}function We(e){let t=e.map(e=>e.id),n=e.map(()=>({sources:[]}));return e.forEach((e,r)=>{if(!e.onFail)return;let i=e.onFail.retry,a=e.onFail.max??2,o=t.indexOf(i),s=n[r]?.sources??[];if(o===-1||o>=r){n[r]={link:{kind:o===-1?`missing`:`not-earlier`,target:i,max:a},sources:s};return}n[r]={link:{kind:`ok`,target:i,targetIndex:o,max:a},sources:s},n[o]?.sources.push(r)}),n}function W(e){let t=String(e),n=/^[A-Za-z0-9._][A-Za-z0-9 ._/-]*$/.test(t)&&!t.endsWith(` `),r=/^(true|false|yes|no|on|off|null|~)$/i.test(t)||/^[-+.]?\d/.test(t);return n&&!r?t:JSON.stringify(t)}function G(e,t,n){let r=` `.repeat(n);return!t.includes(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-C_rn70hE.js";import{O as i,Ut as a,k as o,qt as s,un as c}from"./queries-CchoEEzj.js";import{M as l,Rn as u,j as d,n as f,p,u as m,vi as h}from"./toaster-zMN8cNZQ.js";import{h as g}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{C as _,K as v,Q as y,R as ee,W as te,X as ne,Z as re,a as b,ct as ie,dt as x,l as ae,lt as oe,mt as se,n as ce,ot as le,rt as S,st as ue,x as de,y as fe}from"./design-icons-QbNMZniQ.js";import{t as C}from"./button-C8jUIs8Q.js";import{i as w,o as pe,r as T,s as me,t as E}from"./dialog-DRZuXvul.js";import{c as D,f as he,u as ge}from"./page-shell-Dky5crRl.js";import{i as _e,l as ve,o as ye}from"./skills-pM_PouEs.js";import{t as be}from"./centered-state-BgSV4e79.js";import{En as O,an as k,cn as A,in as xe,j as Se,nn as j,on as Ce,rn as M,sn as N,sr as P,tn as F}from"./index-CXvWnyZg.js";import{t as I}from"./textarea-vEsJAUAV.js";import{_ as L,a as we,c as Te,f as Ee,g as De,h as Oe,i as ke,m as Ae,n as je,o as Me,p as Ne,r as R,t as Pe,u as Fe}from"./sortable.esm-CAVTYaA3.js";import{t as Ie}from"./option-select-BxFrlK_-.js";import{t as Le}from"./discard-changes-dialog-CD2HMH7E.js";var z=e(t(),1);function B(e){let t=[];for(let n of e){if(n.kind===`plugin`||n.command||!n.skill||n.prompt!==void 0&&n.prompt!==`{{task}}`||n.name!==void 0&&n.name!==n.skill||n.timeoutMs!==void 0||n.model||n.effort!==void 0||n.runner||n.agentProfile||n.allowedTools||n.bashAllowlist||n.onFail)return null;t.push(n.skill)}return t.length?t:null}function Re(e,t){return{id:V(e,t),name:e,skill:e,prompt:`{{task}}`}}function V(e,t){let n=new Set(t.map(e=>e.id)),r=e;for(let t=2;n.has(r);t++)r=`${e}-${t}`;return r}function ze(e,t,n){return{id:V(e,n),[e]:t.trim()}}function H(e){if(!(e.kind===`plugin`||e.skill))return e.command===void 0?e.prompt===void 0?void 0:`prompt`:`command`}function Be(e,t,n){let r=e[t],i=r&&H(r);return!r||!i?[...e]:e.map((e,r)=>r===t?{...e,[i]:n}:e)}function U(e){return e.some(e=>{let t=H(e);return t!==void 0&&!e[t]?.trim()})}function Ve(e,t,n){let r=[...e];return r.splice(Math.max(0,Math.min(n,r.length)),0,t),r}function He(e,t,n){if(t===n||t<0||t>=e.length||n<0||n>=e.length)return[...e];let r=[...e],[i]=r.splice(t,1);return i===void 0?[...e]:(r.splice(n,0,i),r)}function Ue(e,t){return e.filter((e,n)=>n!==t)}function We(e){let t=e.map(e=>e.id),n=e.map(()=>({sources:[]}));return e.forEach((e,r)=>{if(!e.onFail)return;let i=e.onFail.retry,a=e.onFail.max??2,o=t.indexOf(i),s=n[r]?.sources??[];if(o===-1||o>=r){n[r]={link:{kind:o===-1?`missing`:`not-earlier`,target:i,max:a},sources:s};return}n[r]={link:{kind:`ok`,target:i,targetIndex:o,max:a},sources:s},n[o]?.sources.push(r)}),n}function W(e){let t=String(e),n=/^[A-Za-z0-9._][A-Za-z0-9 ._/-]*$/.test(t)&&!t.endsWith(` `),r=/^(true|false|yes|no|on|off|null|~)$/i.test(t)||/^[-+.]?\d/.test(t);return n&&!r?t:JSON.stringify(t)}function G(e,t,n){let r=` `.repeat(n);return!t.includes(`
2
2
  `)||/^\s/.test(t)?[`${r}${e}: ${W(t)}`]:[`${r}${e}: |`,...t.split(`
3
3
  `).map(e=>`${r} ${e}`)]}function K(e){let t=[];return e.name&&e.name!==e.id&&t.push(` name: ${W(e.name)}`),e.skill&&t.push(` skill: ${W(e.skill)}`),t}function q(e){let t=[];return e.model&&t.push(` model: ${W(e.model)}`),e.timeoutMs!==void 0&&t.push(` timeoutMs: ${e.timeoutMs}`),e.effort!==void 0&&t.push(` effort: ${W(e.effort)}`),e.runner&&t.push(` runner: ${W(e.runner)}`),e.agentProfile&&t.push(` agentProfile: ${W(e.agentProfile)}`),t}function J(e){let t=[];return e.allowedTools&&t.push(` allowedTools: [${e.allowedTools.map(W).join(`, `)}]`),e.bashAllowlist&&t.push(` bashAllowlist: [${e.bashAllowlist.map(W).join(`, `)}]`),t}function Y(e){return e.onFail?[` onFail:`,` retry: ${W(e.onFail.retry)}`,` max: ${e.onFail.max??2}`]:[]}function Ge(e){return[` - id: ${W(e.id)}`,...K(e),...e.prompt?G(`prompt`,e.prompt,4):[],...e.kind===`plugin`?[` kind: plugin`,` pluginKind: ${W(e.pluginKind)}`,...e.config===void 0?[]:[` config: ${JSON.stringify(e.config)}`]]:[],...q(e),...J(e),...e.command?G(`command`,e.command,4):[],...Y(e)]}function Ke(e,t,n){let r=[`name: ${W(e.trim()||`my-workflow`)}`];t.trim()&&r.push(...G(`description`,t.trim(),0));let i=B(n);if(i){r.push(`skills:`);for(let e of i)r.push(` - ${W(e)}`)}else if(n.length){r.push(`steps:`);for(let e of n)r.push(...Ge(e))}else r.push(`skills: []`);return`${r.join(`
4
4
  `)}\n`}function qe(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`chain`}function Je(e){let t=B(e)?`skill`:`step`;return`${e.length} ${t}${e.length===1?``:`s`}`}function Ye(e,t){let n=new Set,r=[];for(let t of e.steps.slice(0,8)){let e=t.id||`step`,i=e;for(let t=2;n.has(i);t++)i=`${e}-${t}`;n.add(i),r.push({...t,id:i})}return{name:e.name?.trim()||t,steps:r}}function Xe(e,t,n){let r=B(n);return{name:e.trim(),...t.trim()?{description:t.trim()}:{},...r?{skills:r}:{steps:[...n]}}}var X=n(),Z=[{value:`skill`,label:`Skill`,icon:S},{value:`prompt`,label:`Prompt`,icon:te},{value:`command`,label:`Command`,icon:le}],Q={prompt:{field:`Prompt the agent runs`,placeholder:`Review the change for {{task}}…`,add:`Add prompt step`,blank:`A prompt step needs text.`},command:{field:`Shell command`,placeholder:`npm test`,add:`Add command step`,blank:`A command step needs text.`}};function Ze({kind:e,onKindChange:t}){return(0,X.jsx)(`div`,{role:`radiogroup`,"aria-label":`Step kind`,"data-slot":`wb-add-kind`,className:`grid grid-cols-3 gap-0.5 rounded-lg border border-border bg-muted/60 p-1 sm:inline-flex sm:w-fit`,children:Z.map(n=>(0,X.jsxs)(`label`,{className:r(`flex min-h-11 cursor-pointer items-center justify-center gap-2 rounded-md border border-transparent px-2 py-1.5 sm:px-3 text-[13px] font-medium transition-colors has-[:focus-visible]:outline-2`,e===n.value?`border-border bg-card text-foreground shadow-xs`:`text-muted-foreground hover:text-foreground`),children:[(0,X.jsx)(`input`,{type:`radio`,name:`workflow-add-kind`,className:`sr-only`,value:n.value,checked:e===n.value,onChange:()=>t(n.value)}),(0,X.jsx)(n.icon,{"aria-hidden":`true`,className:`size-3.5 max-sm:hidden`}),n.label]},n.value))})}function Qe({query:e,onQueryChange:t,matches:n,skillsCount:r,error:i,selectedSkill:a,onSelectSkill:o}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(P,{"aria-label":`Filter skills`,placeholder:`Filter skills…`,value:e,onChange:e=>t(e.target.value)}),i===null?(0,X.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Available skills`,className:`grid max-h-80 gap-2 overflow-y-auto`,children:[n.map(e=>(0,X.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 rounded-lg py-2 has-[:checked]:bg-accent-strong/10 has-[:focus-visible]:outline-2`,children:[(0,X.jsx)(`input`,{type:`radio`,name:`workflow-add-skill`,className:`sr-only`,value:e.id,checked:a===e.id,onChange:()=>o(e.id)}),(0,X.jsxs)(`span`,{className:`min-w-0 break-words text-sm`,children:[(0,X.jsx)(`span`,{className:`block`,children:e.name}),(0,X.jsx)(`span`,{className:`mt-2 block text-xs text-muted-foreground`,children:e.description}),e.path?(0,X.jsx)(`span`,{className:`block break-all text-xs`,children:e.path}):null]})]},JSON.stringify([e.id,e.path]))),n.length===0?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r===0?`No skills available in this project.`:`No matching skills.`}):null]}):(0,X.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[`Could not load skills: `,i]}),e.trim()&&!n.some(t=>t.id===e.trim())?(0,X.jsxs)(C,{onClick:()=>o(e.trim()),children:[`Use skill id “`,e.trim(),`” (unchecked)`]}):null]})}function $e({open:e,onOpenChange:t,kind:n,onKindChange:i,text:a,onTextChange:o,stepsCount:s,onCloseAutoFocus:c,onCancel:l,onAdd:u,onAddText:d,...f}){let p=s>=8,m=f.selectedSkill;return(0,X.jsx)(E,{open:e,onOpenChange:t,children:(0,X.jsxs)(T,{"data-slot":`wb-add-dialog`,onCloseAutoFocus:c,className:`max-h-[85dvh] overflow-y-auto sm:max-w-[660px] [&_button]:min-h-11`,children:[(0,X.jsxs)(pe,{children:[(0,X.jsx)(me,{className:`text-xl font-normal`,children:`Add step`}),(0,X.jsx)(w,{className:`sr-only`,children:`Choose a skill, write a prompt or a shell command to append to this workflow.`})]}),(0,X.jsx)(Ze,{kind:n,onKindChange:i}),n===`skill`?(0,X.jsx)(Qe,{...f}):(0,X.jsx)(I,{"aria-label":Q[n].field,placeholder:Q[n].placeholder,value:a,rows:4,className:r(n===`command`&&`font-mono`),onChange:e=>o(e.target.value)}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,X.jsx)(C,{variant:`outline`,onClick:l,children:`Cancel`}),n===`skill`?(0,X.jsx)(C,{variant:`primary`,disabled:!m||p,onClick:()=>{m&&u(m)},children:`Add selected skill`}):(0,X.jsx)(C,{variant:`primary`,disabled:!a.trim()||p,onClick:()=>d(n,a),children:Q[n].add})]}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Append the new step, then reorder it in the existing canvas.`}),p?(0,X.jsxs)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:[`A workflow can contain up to `,8,` steps. Remove a step before adding another.`]}):null]})})}function et({kind:e,text:t,index:n,editing:i,onTextChange:a}){let o=(0,z.useId)(),s=!t.trim();return(0,X.jsxs)(X.Fragment,{children:[i?(0,X.jsx)(I,{"data-slot":`wb-step-text`,"aria-label":`Step ${n+1} ${e}`,"aria-invalid":s||void 0,"aria-describedby":s?o:void 0,value:t,rows:3,className:r(`mt-2`,e===`command`&&`font-mono`),onChange:e=>a(e.target.value)}):null,s?(0,X.jsx)(`p`,{id:o,"data-slot":`wb-step-text-error`,className:`mt-1 text-xs text-danger`,children:Q[e].blank}):null]})}function tt({kind:e,index:t,editing:n,onEditingChange:r}){return(0,X.jsxs)(C,{variant:`outline`,size:`sm`,className:`min-h-11`,"data-slot":`wb-step-edit`,"aria-label":n?`Done editing step ${t+1}`:`Edit ${e} of step ${t+1}`,"aria-expanded":n,onClick:()=>r(!n),children:[n?(0,X.jsx)(ae,{"aria-hidden":`true`,className:`size-4`}):(0,X.jsx)(v,{"aria-hidden":`true`,className:`size-4`}),n?`Done`:`Edit ${e}`]})}function nt({workflows:e,trimmedName:t,onLoadWorkflow:n}){return(0,X.jsx)(Ie,{id:`workflow-load`,"data-slot":`wb-load-picker`,"data-page-shell-action":``,"aria-label":`Workflow`,value:e.some(e=>e.name===t)?t:``,placeholder:`Choose a workflow`,onValueChange:t=>{let r=e.find(e=>e.name===t);r&&n(r)},options:e.map(e=>({value:e.name,label:e.name})),className:`w-56 max-w-full min-w-0 border-border bg-card font-medium text-foreground max-md:w-full`})}function rt({draft:e,trimmedName:t,nameRef:n,onDraft:r,renamedFrom:i}){return(0,X.jsxs)(`section`,{"data-slot":`wb-details`,"data-reports-dirty":``,className:`flex min-w-0 flex-col gap-3`,children:[(0,X.jsxs)(`div`,{"data-slot":`wb-details-line`,className:`grid min-w-0 gap-1.5 @xl:grid-cols-[96px_minmax(0,1fr)] @xl:items-center @xl:gap-x-3`,children:[(0,X.jsx)(`label`,{htmlFor:`workflow-name`,className:`text-xs font-medium text-foreground`,children:`Name`}),(0,X.jsx)(P,{id:`workflow-name`,ref:n,"data-slot":`wb-name`,"aria-label":`Workflow name`,spellCheck:!1,value:e.name,"aria-describedby":i===void 0?void 0:`workflow-rename-note`,onChange:t=>r({...e,name:t.target.value}),className:`h-10 bg-card text-sm max-md:h-11 @xl:max-w-sm`}),(0,X.jsx)(`p`,{id:`workflow-rename-note`,"aria-live":`polite`,className:`text-xs text-muted-foreground empty:hidden @xl:col-start-2`,children:i===void 0?null:(0,X.jsxs)(`span`,{"data-slot":`wb-rename-note`,children:[`Saving creates a new workflow “`,t,`”. “`,i,`” stays as it is.`]})})]}),(0,X.jsxs)(`div`,{"data-slot":`wb-details-line`,className:`grid min-w-0 gap-1.5 @xl:grid-cols-[96px_minmax(0,1fr)] @xl:items-center @xl:gap-x-3`,children:[(0,X.jsx)(`label`,{htmlFor:`workflow-description`,className:`text-xs font-medium text-foreground`,children:`Description`}),(0,X.jsx)(I,{id:`workflow-description`,"data-slot":`wb-description`,"aria-label":`Description`,rows:1,placeholder:`What this workflow does`,value:e.description,onChange:t=>r({...e,description:t.target.value}),className:`min-h-10 w-full bg-card px-3 py-2 text-sm max-md:min-h-11`})]})]})}function it({savedFile:e,autoOpen:t,onImportToggle:n,onExport:r,onAutoToggle:i,onDeleteRequest:a}){return(0,X.jsxs)(`div`,{"data-slot":`wb-actions`,className:`contents`,children:[(0,X.jsxs)(D,{type:`button`,variant:`outline`,"data-slot":`wb-import`,onClick:n,children:[(0,X.jsx)(oe,{"aria-hidden":`true`,className:`size-4`}),`Import`]}),(0,X.jsxs)(D,{type:`button`,variant:`outline`,"data-slot":`wb-export`,title:`Download workflow.yaml`,onClick:r,children:[(0,X.jsx)(de,{"aria-hidden":`true`,className:`size-4`}),`Export`]}),(0,X.jsxs)(D,{type:`button`,variant:`outline`,"data-slot":`wb-auto`,"aria-expanded":t,"aria-describedby":`wb-auto-hint`,title:`Auto-build: describe the chain in words and an agent drafts its steps for you to review`,onClick:i,children:[(0,X.jsx)(x,{"aria-hidden":`true`,className:`size-4`}),`Auto-build`]}),(0,X.jsx)(`span`,{id:`wb-auto-hint`,className:`sr-only`,children:`Describe the chain in words and an agent drafts its steps for you to review.`}),e?(0,X.jsxs)(D,{type:`button`,variant:`outline`,"data-slot":`wb-delete`,className:`text-danger hover:text-danger`,title:`Delete the saved workflow file`,onClick:a,children:[(0,X.jsx)(ue,{"aria-hidden":`true`,className:`size-4`}),`Delete`]}):null]})}function at({text:e,onTextChange:t,pending:n,onRun:r,onCancel:i}){return(0,X.jsxs)(`div`,{"data-slot":`wb-auto-panel`,className:`rounded-xl border border-border bg-card p-5 [&_button]:min-h-11`,children:[(0,X.jsx)(`h2`,{className:`text-lg font-normal`,children:`Build a chain from a prompt`}),(0,X.jsx)(`p`,{className:`mt-4 text-[13px] leading-relaxed text-muted-foreground`,children:`Describe the outcome. An agent proposes a title and ordered skill/check steps. Review the result, edit it, then Save.`}),(0,X.jsx)(I,{"data-slot":`wb-auto-text`,"aria-label":`Describe the chain to build`,rows:3,autoFocus:!0,placeholder:`e.g. Fix the bug, run the tests, then review the diff for regressions.`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),r())},className:`mt-4 min-h-[108px] bg-background p-4 text-sm`}),(0,X.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,X.jsxs)(C,{type:`button`,variant:`primary`,size:`sm`,"data-slot":`wb-auto-run`,disabled:n||e.trim()===``,onClick:r,children:[(0,X.jsx)(x,{"aria-hidden":`true`,className:`size-3`}),n?`Building…`:`Build chain`]}),(0,X.jsxs)(C,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto-cancel`,onClick:i,children:[(0,X.jsx)(se,{"aria-hidden":`true`,className:`size-4`}),`Cancel`]})]}),(0,X.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`Creates an editable draft. Review the generated name and steps before saving.`})]})}function ot({open:e,onOpenChange:t,text:n,onTextChange:r,error:i,pending:a,onRun:o,onCancel:s}){return(0,X.jsx)(E,{open:e,onOpenChange:t,children:(0,X.jsxs)(T,{showCloseButton:!1,"data-slot":`wb-import-panel`,className:`max-md:translate-x-0 max-md:translate-y-0 sm:max-w-[660px] rounded-xl border border-border bg-card p-5 [&_button]:min-h-11`,children:[(0,X.jsx)(me,{className:`text-xl font-normal`,children:`Import workflow YAML`}),(0,X.jsx)(w,{className:`sr-only`,children:`Paste a portable workflow definition to import.`}),(0,X.jsx)(I,{"data-slot":`wb-import-text`,"aria-label":`Workflow YAML to import`,rows:4,spellCheck:!1,placeholder:`name: my-flow
@@ -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{Ft as r,Zt as i,nn as a,vt as o,xt as s}from"./queries-jsRcJKo6.js";import{n as c}from"./toaster-C1BFyQ8i.js";import{n as l}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{t as u}from"./chevron-right-BENZ-1ZN.js";import{t as d}from"./external-link-BE6y205O.js";import{t as f}from"./button-C8jUIs8Q.js";import{t as p}from"./status-dot-BXf-Ubd0.js";import{f as m,o as h}from"./page-shell-Dky5crRl.js";import{t as g}from"./agents-settings-path-7X6_cvUg.js";import{Bn as _,Rn as v,cr as y,ir as b,ln as x,or as S,un as C}from"./index-WGWSicA9.js";var w=e(t(),1),T=n();function E(e){let t=e.replace(/\binstall\b/g,(e,t)=>t===0?`Install`:e),n=t.split(/(`[^`]+`)/g);if(n.length===1){let e=t.split(/(\bgh auth login\b)/g);return e.length===1?t:e.map((e,t)=>e===`gh auth login`?(0,T.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e},t):(0,T.jsx)(`span`,{children:e},t))}return n.map((e,t)=>e.startsWith("`")&&e.endsWith("`")&&e.length>2?(0,T.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e.slice(1,-1)},t):e?(0,T.jsx)(`span`,{children:e},t):null)}function D(e,t){let n=i(t,e);return n?{label:n.displayName,isAgent:!0}:{label:e,isAgent:!1}}function O({mode:e,version:t,rawVersion:n}){return e?(0,T.jsx)(`span`,{"data-slot":`tool-dry-run`,title:n,className:`shrink-0 rounded-full border border-border bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground`,children:e.label}):t?(0,T.jsxs)(`span`,{className:`min-w-0 break-words`,children:[`· `,t]}):null}var k=`h-8 text-xs font-medium max-md:h-11 no-hover:h-11`;function A({projectsDir:e,home:t,onAction:n}){return(0,T.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-card-edge bg-card px-6 py-4 shadow-card max-md:px-4`,"aria-labelledby":`projects-heading`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-3`,children:[(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`h2`,{id:`projects-heading`,className:`text-sm font-semibold text-foreground`,children:`Projects`}),(0,T.jsx)(`p`,{className:`mt-0.5 text-[13px] leading-[1.5] text-muted-foreground`,children:`Start a repository, open a local folder, or clone from GitHub.`})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,T.jsx)(f,{variant:`outline`,size:`sm`,className:k,"data-action":`new-project`,onClick:()=>n(`new`),children:`New project`}),(0,T.jsx)(f,{variant:`outline`,size:`sm`,className:k,onClick:()=>n(`local`),children:`Open local folder`}),(0,T.jsx)(f,{variant:`outline`,size:`sm`,className:k,onClick:()=>n(`clone`),children:`Clone from GitHub`})]})]}),e?(0,T.jsxs)(`p`,{"data-slot":`projects-checkout`,className:`flex min-w-0 items-baseline gap-1.5 text-xs text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`shrink-0`,children:`New clones go to`}),(0,T.jsx)(_,{value:e,bases:{home:t,root:null},className:`text-foreground`})]}):null]})}function j({recovery:e}){let t=`${k} ml-auto`;return e.kind===`settings`?(0,T.jsx)(f,{asChild:!0,variant:`outline`,size:`sm`,className:t,children:(0,T.jsxs)(l,{to:e.to,"data-slot":`tool-setup`,children:[e.label,(0,T.jsx)(u,{className:`size-3.5 shrink-0`,"aria-hidden":`true`})]})}):(0,T.jsx)(f,{asChild:!0,variant:`outline`,size:`sm`,className:t,children:(0,T.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,"data-slot":`tool-setup`,children:[e.label,(0,T.jsx)(d,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,T.jsx)(`span`,{className:`sr-only`,children:` (opens in a new tab)`})]})})}function M({health:e,runners:t,copying:n,onCopy:r,recheckStatus:i,onRecheck:a}){return(0,T.jsxs)(`section`,{className:`space-y-4 rounded-xl border border-card-edge bg-card p-6 shadow-card max-md:p-4`,"aria-labelledby":`tools-heading`,children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h2`,{id:`tools-heading`,className:`text-base font-semibold text-foreground`,children:`Tools diagnostics`}),(0,T.jsx)(`p`,{className:`mt-1 text-[13px] leading-[1.5] text-muted-foreground`,children:`Check the tools available to this local workspace.`})]}),(0,T.jsx)(f,{asChild:!0,variant:`outline`,size:`sm`,className:k,children:(0,T.jsxs)(l,{to:g,"data-slot":`tools-settings`,children:[`Tool settings`,(0,T.jsx)(u,{className:`size-3.5 shrink-0`,"aria-hidden":`true`})]})})]}),e.isError?(0,T.jsx)(`p`,{role:`alert`,className:`text-sm text-semantic-red`,children:`Could not refresh tool diagnostics. Recheck to retry.`}):null,!e.data&&!e.isError?(0,T.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Checking installed tools…`}):null,e.data?(0,T.jsx)(`dl`,{className:`divide-y divide-border border-y border-border text-[13px] leading-[1.5] text-muted-foreground`,children:e.data.checks.map(e=>{let n=x(e),r=D(e.name,t),i=v(e),a=C(e,t);return(0,T.jsxs)(`div`,{"data-slot":`tool-row`,"data-tool":e.name,"data-available":e.available,className:`grid grid-cols-1 gap-x-4 gap-y-1 py-3 sm:grid-cols-[160px_minmax(0,1fr)] sm:items-center`,children:[(0,T.jsxs)(`dt`,{className:`flex items-center gap-2.5`,children:[(0,T.jsx)(p,{tone:i.availability.tone,shape:i.availability.shape}),(0,T.jsx)(`span`,{className:r.isAgent?`text-[14px] font-semibold text-foreground`:`font-mono text-[13px] font-semibold text-foreground`,children:r.label})]}),(0,T.jsxs)(`dd`,{className:`flex min-w-0 items-center gap-x-1.5 text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`shrink-0`,children:i.availability.label}),(0,T.jsx)(O,{mode:i.mode,version:i.version,rawVersion:i.rawVersion}),a?(0,T.jsx)(j,{recovery:a}):null]}),n?(0,T.jsx)(`dd`,{"data-slot":`tool-hint`,className:`min-w-0 break-words text-xs leading-relaxed text-muted-foreground sm:col-start-2`,children:E(n)}):null]},e.name)})}):null,e.data?.checks.length===0?(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tool diagnostics reported by this server.`}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,T.jsx)(f,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,disabled:e.isFetching,onClick:()=>void a(),children:e.isFetching?`Checking tools…`:`Recheck tools`}),(0,T.jsx)(f,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,disabled:!e.data||n,onClick:()=>void r(),children:n?`Copying…`:`Copy diagnostics`}),(0,T.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`text-xs text-muted-foreground`,children:i?(0,T.jsx)(`span`,{"data-slot":`recheck-status`,children:i}):null})]})]})}function N(e,t){let n=e.filter(e=>e.available).length;return`Rechecked at ${t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})} — ${n} of ${e.length} ${e.length===1?`tool`:`tools`} available.`}function P(){let e=o(),t=s().data?.projectsDir,n=r().data?.homeDir??null,i=a().data,[l,u]=(0,w.useState)(null),[d,f]=(0,w.useState)(!1),[p,g]=(0,w.useState)(null),_=async()=>{g(null);let t=await e.refetch();t.isError||!t.data||g(N(t.data.checks,new Date))},v=async()=>{if(!(!e.data||d)){f(!0);try{await navigator.clipboard.writeText(JSON.stringify({version:e.data.version,checks:e.data.checks},null,2)),c(`Diagnostics copied`)}catch{c(`Could not copy diagnostics. Please try again.`,{tone:`danger`})}finally{f(!1)}}},x=e.data?.checks.length??4;return(0,T.jsxs)(h,{route:`workspace-tools`,density:e.data?m(x):`full`,bodyClassName:`gap-5`,header:{title:`Workspace tools`,subtitle:`Check local CLI tools, then add projects.`},children:[(0,T.jsx)(M,{health:e,runners:i,copying:d,onCopy:v,recheckStatus:p,onRecheck:_}),(0,T.jsx)(A,{projectsDir:t,home:n,onAction:u}),l===`new`?(0,T.jsx)(b,{open:!0,onOpenChange:e=>{e||u(null)}}):null,l===`local`?(0,T.jsx)(y,{open:!0,onOpenChange:e=>{e||u(null)}}):null,l===`clone`?(0,T.jsx)(S,{open:!0,onOpenChange:e=>{e||u(null)}}):null]})}export{P as WorkspaceToolsRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ft as r,Zt as i,nn as a,vt as o,xt as s}from"./queries-CchoEEzj.js";import{n as c}from"./toaster-zMN8cNZQ.js";import{n as l}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{t as u}from"./chevron-right-BENZ-1ZN.js";import{t as d}from"./external-link-BE6y205O.js";import{t as f}from"./button-C8jUIs8Q.js";import{t as p}from"./status-dot-BXf-Ubd0.js";import{f as m,o as h}from"./page-shell-Dky5crRl.js";import{t as g}from"./agents-settings-path-7X6_cvUg.js";import{Bn as _,Rn as v,cr as y,ir as b,ln as x,or as S,un as C}from"./index-CXvWnyZg.js";var w=e(t(),1),T=n();function E(e){let t=e.replace(/\binstall\b/g,(e,t)=>t===0?`Install`:e),n=t.split(/(`[^`]+`)/g);if(n.length===1){let e=t.split(/(\bgh auth login\b)/g);return e.length===1?t:e.map((e,t)=>e===`gh auth login`?(0,T.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e},t):(0,T.jsx)(`span`,{children:e},t))}return n.map((e,t)=>e.startsWith("`")&&e.endsWith("`")&&e.length>2?(0,T.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e.slice(1,-1)},t):e?(0,T.jsx)(`span`,{children:e},t):null)}function D(e,t){let n=i(t,e);return n?{label:n.displayName,isAgent:!0}:{label:e,isAgent:!1}}function O({mode:e,version:t,rawVersion:n}){return e?(0,T.jsx)(`span`,{"data-slot":`tool-dry-run`,title:n,className:`shrink-0 rounded-full border border-border bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground`,children:e.label}):t?(0,T.jsxs)(`span`,{className:`min-w-0 break-words`,children:[`· `,t]}):null}var k=`h-8 text-xs font-medium max-md:h-11 no-hover:h-11`;function A({projectsDir:e,home:t,onAction:n}){return(0,T.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-card-edge bg-card px-6 py-4 shadow-card max-md:px-4`,"aria-labelledby":`projects-heading`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-3`,children:[(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`h2`,{id:`projects-heading`,className:`text-sm font-semibold text-foreground`,children:`Projects`}),(0,T.jsx)(`p`,{className:`mt-0.5 text-[13px] leading-[1.5] text-muted-foreground`,children:`Start a repository, open a local folder, or clone from GitHub.`})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,T.jsx)(f,{variant:`outline`,size:`sm`,className:k,"data-action":`new-project`,onClick:()=>n(`new`),children:`New project`}),(0,T.jsx)(f,{variant:`outline`,size:`sm`,className:k,onClick:()=>n(`local`),children:`Open local folder`}),(0,T.jsx)(f,{variant:`outline`,size:`sm`,className:k,onClick:()=>n(`clone`),children:`Clone from GitHub`})]})]}),e?(0,T.jsxs)(`p`,{"data-slot":`projects-checkout`,className:`flex min-w-0 items-baseline gap-1.5 text-xs text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`shrink-0`,children:`New clones go to`}),(0,T.jsx)(_,{value:e,bases:{home:t,root:null},className:`text-foreground`})]}):null]})}function j({recovery:e}){let t=`${k} ml-auto`;return e.kind===`settings`?(0,T.jsx)(f,{asChild:!0,variant:`outline`,size:`sm`,className:t,children:(0,T.jsxs)(l,{to:e.to,"data-slot":`tool-setup`,children:[e.label,(0,T.jsx)(u,{className:`size-3.5 shrink-0`,"aria-hidden":`true`})]})}):(0,T.jsx)(f,{asChild:!0,variant:`outline`,size:`sm`,className:t,children:(0,T.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,"data-slot":`tool-setup`,children:[e.label,(0,T.jsx)(d,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,T.jsx)(`span`,{className:`sr-only`,children:` (opens in a new tab)`})]})})}function M({health:e,runners:t,copying:n,onCopy:r,recheckStatus:i,onRecheck:a}){return(0,T.jsxs)(`section`,{className:`space-y-4 rounded-xl border border-card-edge bg-card p-6 shadow-card max-md:p-4`,"aria-labelledby":`tools-heading`,children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h2`,{id:`tools-heading`,className:`text-base font-semibold text-foreground`,children:`Tools diagnostics`}),(0,T.jsx)(`p`,{className:`mt-1 text-[13px] leading-[1.5] text-muted-foreground`,children:`Check the tools available to this local workspace.`})]}),(0,T.jsx)(f,{asChild:!0,variant:`outline`,size:`sm`,className:k,children:(0,T.jsxs)(l,{to:g,"data-slot":`tools-settings`,children:[`Tool settings`,(0,T.jsx)(u,{className:`size-3.5 shrink-0`,"aria-hidden":`true`})]})})]}),e.isError?(0,T.jsx)(`p`,{role:`alert`,className:`text-sm text-semantic-red`,children:`Could not refresh tool diagnostics. Recheck to retry.`}):null,!e.data&&!e.isError?(0,T.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Checking installed tools…`}):null,e.data?(0,T.jsx)(`dl`,{className:`divide-y divide-border border-y border-border text-[13px] leading-[1.5] text-muted-foreground`,children:e.data.checks.map(e=>{let n=x(e),r=D(e.name,t),i=v(e),a=C(e,t);return(0,T.jsxs)(`div`,{"data-slot":`tool-row`,"data-tool":e.name,"data-available":e.available,className:`grid grid-cols-1 gap-x-4 gap-y-1 py-3 sm:grid-cols-[160px_minmax(0,1fr)] sm:items-center`,children:[(0,T.jsxs)(`dt`,{className:`flex items-center gap-2.5`,children:[(0,T.jsx)(p,{tone:i.availability.tone,shape:i.availability.shape}),(0,T.jsx)(`span`,{className:r.isAgent?`text-[14px] font-semibold text-foreground`:`font-mono text-[13px] font-semibold text-foreground`,children:r.label})]}),(0,T.jsxs)(`dd`,{className:`flex min-w-0 items-center gap-x-1.5 text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`shrink-0`,children:i.availability.label}),(0,T.jsx)(O,{mode:i.mode,version:i.version,rawVersion:i.rawVersion}),a?(0,T.jsx)(j,{recovery:a}):null]}),n?(0,T.jsx)(`dd`,{"data-slot":`tool-hint`,className:`min-w-0 break-words text-xs leading-relaxed text-muted-foreground sm:col-start-2`,children:E(n)}):null]},e.name)})}):null,e.data?.checks.length===0?(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tool diagnostics reported by this server.`}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,T.jsx)(f,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,disabled:e.isFetching,onClick:()=>void a(),children:e.isFetching?`Checking tools…`:`Recheck tools`}),(0,T.jsx)(f,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,disabled:!e.data||n,onClick:()=>void r(),children:n?`Copying…`:`Copy diagnostics`}),(0,T.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`text-xs text-muted-foreground`,children:i?(0,T.jsx)(`span`,{"data-slot":`recheck-status`,children:i}):null})]})]})}function N(e,t){let n=e.filter(e=>e.available).length;return`Rechecked at ${t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})} — ${n} of ${e.length} ${e.length===1?`tool`:`tools`} available.`}function P(){let e=o(),t=s().data?.projectsDir,n=r().data?.homeDir??null,i=a().data,[l,u]=(0,w.useState)(null),[d,f]=(0,w.useState)(!1),[p,g]=(0,w.useState)(null),_=async()=>{g(null);let t=await e.refetch();t.isError||!t.data||g(N(t.data.checks,new Date))},v=async()=>{if(!(!e.data||d)){f(!0);try{await navigator.clipboard.writeText(JSON.stringify({version:e.data.version,checks:e.data.checks},null,2)),c(`Diagnostics copied`)}catch{c(`Could not copy diagnostics. Please try again.`,{tone:`danger`})}finally{f(!1)}}},x=e.data?.checks.length??4;return(0,T.jsxs)(h,{route:`workspace-tools`,density:e.data?m(x):`full`,bodyClassName:`gap-5`,header:{title:`Workspace tools`,subtitle:`Check local CLI tools, then add projects.`},children:[(0,T.jsx)(M,{health:e,runners:i,copying:d,onCopy:v,recheckStatus:p,onRecheck:_}),(0,T.jsx)(A,{projectsDir:t,home:n,onAction:u}),l===`new`?(0,T.jsx)(b,{open:!0,onOpenChange:e=>{e||u(null)}}):null,l===`local`?(0,T.jsx)(y,{open:!0,onOpenChange:e=>{e||u(null)}}):null,l===`clone`?(0,T.jsx)(S,{open:!0,onOpenChange:e=>{e||u(null)}}):null]})}export{P as WorkspaceToolsRoute};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ut as r,g as i,un as a,vt as o}from"./queries-jsRcJKo6.js";import{Br as s,I as c,Rn as l,n as u,vi as d,zr as f}from"./toaster-C1BFyQ8i.js";import{d as p}from"./design-icons-QbNMZniQ.js";import{t as m}from"./project-router-C53GCY_8.js";import{t as h}from"./centered-state-BgSV4e79.js";import{hr as g}from"./index-WGWSicA9.js";import{n as _,r as v,t as y}from"./remote-settings-notice-BYv4X_Zz.js";import{n as b}from"./settings-field-Bhh8I9fJ.js";import{n as x}from"./project-location-0VnTd5VW.js";import{r as S}from"./settings-save-bar-Czqju-k9.js";import{n as C}from"./saved-draft-BwzBc-_Y.js";var w=e(t(),1),T=n();function E({copy:e,savedCommandCount:t,settingsAdmin:n,configPath:r,issue:i,invalid:a,children:o}){let s=e.slot;return(0,T.jsxs)(T.Fragment,{children:[t===0&&i===null?(0,T.jsx)(`p`,{"data-slot":`${s}-empty`,className:`text-xs text-muted-foreground`,children:e.empty}):null,o,n===!1?(0,T.jsxs)(`p`,{"data-slot":`${s}-readonly`,className:`text-xs text-foreground`,children:[`Edit `,(0,T.jsxs)(`code`,{children:[e.key,`.commands`]}),` in`,` `,r===null?(0,T.jsxs)(T.Fragment,{children:[`the project’s `,(0,T.jsx)(`code`,{children:`.ai/cezar/config.json`})]}):(0,T.jsx)(`code`,{className:`break-all`,children:r}),` `,`on the machine running Squawk. `,e.fileEditApplies,` No restart is needed. To edit here, the host operator runs `,(0,T.jsx)(`code`,{children:y}),`.`]}):null,i===null?null:(0,T.jsxs)(`p`,{"data-slot":`${s}-issue`,className:`text-xs text-danger`,children:[`config.json has an invalid `,e.key,` (`,i,`) — saving replaces it.`]}),a===null?null:(0,T.jsx)(`p`,{"data-slot":`${s}-invalid`,className:`text-xs text-danger`,children:a})]})}function D(e,t){let n=e.split(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ut as r,g as i,un as a,vt as o}from"./queries-CchoEEzj.js";import{Br as s,I as c,Rn as l,n as u,vi as d,zr as f}from"./toaster-zMN8cNZQ.js";import{d as p}from"./design-icons-QbNMZniQ.js";import{t as m}from"./project-router-j0uBi7Ep.js";import{t as h}from"./centered-state-BgSV4e79.js";import{hr as g}from"./index-CXvWnyZg.js";import{n as _,r as v,t as y}from"./remote-settings-notice-DYOP5Yxe.js";import{n as b}from"./settings-field-Bhh8I9fJ.js";import{n as x}from"./project-location-Cq1K7hXN.js";import{r as S}from"./settings-save-bar-9D1QPg_P.js";import{n as C}from"./saved-draft-BwzBc-_Y.js";var w=e(t(),1),T=n();function E({copy:e,savedCommandCount:t,settingsAdmin:n,configPath:r,issue:i,invalid:a,children:o}){let s=e.slot;return(0,T.jsxs)(T.Fragment,{children:[t===0&&i===null?(0,T.jsx)(`p`,{"data-slot":`${s}-empty`,className:`text-xs text-muted-foreground`,children:e.empty}):null,o,n===!1?(0,T.jsxs)(`p`,{"data-slot":`${s}-readonly`,className:`text-xs text-foreground`,children:[`Edit `,(0,T.jsxs)(`code`,{children:[e.key,`.commands`]}),` in`,` `,r===null?(0,T.jsxs)(T.Fragment,{children:[`the project’s `,(0,T.jsx)(`code`,{children:`.ai/cezar/config.json`})]}):(0,T.jsx)(`code`,{className:`break-all`,children:r}),` `,`on the machine running Squawk. `,e.fileEditApplies,` No restart is needed. To edit here, the host operator runs `,(0,T.jsx)(`code`,{children:y}),`.`]}):null,i===null?null:(0,T.jsxs)(`p`,{"data-slot":`${s}-issue`,className:`text-xs text-danger`,children:[`config.json has an invalid `,e.key,` (`,i,`) — saving replaces it.`]}),a===null?null:(0,T.jsx)(`p`,{"data-slot":`${s}-invalid`,className:`text-xs text-danger`,children:a})]})}function D(e,t){let n=e.split(`
2
2
  `).map(e=>e.trim()).filter(e=>e!==``),r=Number(t);return{commands:n,timeoutSeconds:r,invalid:n.length>20?`Enter at most 20 commands.`:n.some(e=>e.length>4e3)?`Keep each command under ${f.toLocaleString(`en-US`)} characters.`:t.trim()===``||!Number.isInteger(r)||r<1||r>7200?`Enter a whole number of seconds from 1 to ${s}.`:null}}var O={setup:{key:`worktreeSetup`,issueKey:`worktreeSetupIssue`,slot:`worktree-setup`,title:`Prepare new worktrees`,hint:`Runs in order in every new task and worker worktree before the agent starts. The first failure stops setup.`,empty:`No setup commands configured. No commands will run in new worktrees.`,label:`Worktree setup commands, one per line`,example:`npm ci`,fileEditApplies:`Valid file edits apply to new worktrees.`},teardown:{key:`worktreeTeardown`,issueKey:`worktreeTeardownIssue`,slot:`worktree-teardown`,title:`Stop worker services before destroy`,hint:`Runs in order in a worker’s worktree when the worker is destroyed, before its processes stop. The first failure stops teardown; destroy goes on and records it on the worker.`,empty:`No teardown commands configured. Destroy runs no commands in worker worktrees.`,label:`Worktree teardown commands, one per line`,example:`docker compose down`,fileEditApplies:`Valid file edits apply to the next worker destroy.`}};function k(e,t){return t?`One command per line, for example: ${e.example}`:void 0}function A({config:e,copy:t}){let n=d(),i=o(),f=v(),p=x(),m=p===null?null:`${p.replace(/\/$/,``)}/.ai/cezar/config.json`,h=i.data?.capabilities?.settingsAdmin===!0,g=e[t.key],y=e[t.issueKey],O=g?.commands??[],A=g?.timeoutSeconds??900,[j,M]=C(O.join(`
3
3
  `)),[N,P]=C(String(A)),{commands:F,timeoutSeconds:I,invalid:L}=D(j,N),R=F.length===O.length&&F.every((e,t)=>e===O[t])&&(F.length===0||I===A),z=a({mutationFn:e=>c(e),onSuccess:e=>{n.setQueryData(r.config,e),M(F.join(`
4
4
  `))},onError:e=>{u(e.message,{tone:`danger`}),e instanceof l&&e.status===409&&f()}}),B=()=>z.mutateAsync({[t.key]:F.length===0?null:{commands:F,...I===900?{}:{timeoutSeconds:I}}}),[V,H]=(0,w.useState)(null);S({dirty:h&&(y!==null&&y!==V||!R),holdsReload:h&&!R,invalid:L!==null,save:B,discard:()=>{M(O.join(`
@@ -59,27 +59,27 @@
59
59
  }
60
60
  })()
61
61
  </script>
62
- <script type="module" crossorigin src="/assets/index-WGWSicA9.js"></script>
62
+ <script type="module" crossorigin src="/assets/index-CXvWnyZg.js"></script>
63
63
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
64
64
  <link rel="modulepreload" crossorigin href="/assets/react-runtime-CCIEwYL0.js">
65
65
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-rHxsej31.js">
66
66
  <link rel="modulepreload" crossorigin href="/assets/dist-C_rn70hE.js">
67
67
  <link rel="modulepreload" crossorigin href="/assets/live-protocol-DMhTnCmf.js">
68
- <link rel="modulepreload" crossorigin href="/assets/toaster-C1BFyQ8i.js">
69
- <link rel="modulepreload" crossorigin href="/assets/queries-jsRcJKo6.js">
68
+ <link rel="modulepreload" crossorigin href="/assets/toaster-zMN8cNZQ.js">
69
+ <link rel="modulepreload" crossorigin href="/assets/queries-CchoEEzj.js">
70
70
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-Czpn1I53.js">
71
71
  <link rel="modulepreload" crossorigin href="/assets/chunk-KS7C4IRE-Cg8l-LDN.js">
72
72
  <link rel="modulepreload" crossorigin href="/assets/cez-idle-CdswdDRd.js">
73
- <link rel="modulepreload" crossorigin href="/assets/run-detail-refresh-DYY7EWeq.js">
73
+ <link rel="modulepreload" crossorigin href="/assets/run-detail-refresh-C5qmRdgD.js">
74
74
  <link rel="modulepreload" crossorigin href="/assets/es2015-CUEfzDjB.js">
75
- <link rel="modulepreload" crossorigin href="/assets/label-DRXJ8ljY.js">
75
+ <link rel="modulepreload" crossorigin href="/assets/label-feCJ3WOT.js">
76
76
  <link rel="modulepreload" crossorigin href="/assets/design-icons-QbNMZniQ.js">
77
77
  <link rel="modulepreload" crossorigin href="/assets/dist-BuF3mvCA.js">
78
78
  <link rel="modulepreload" crossorigin href="/assets/dist-DudPJH39.js">
79
79
  <link rel="modulepreload" crossorigin href="/assets/popover-CvL6hQ5c.js">
80
- <link rel="modulepreload" crossorigin href="/assets/attention-xl4bwNkx.js">
81
- <link rel="modulepreload" crossorigin href="/assets/task-groups-7p6Gvpg8.js">
82
- <link rel="modulepreload" crossorigin href="/assets/reference-chip-95DURw1q.js">
80
+ <link rel="modulepreload" crossorigin href="/assets/attention-DnxGjw_R.js">
81
+ <link rel="modulepreload" crossorigin href="/assets/task-groups-CGCnVqHE.js">
82
+ <link rel="modulepreload" crossorigin href="/assets/reference-chip-z7dZJVH-.js">
83
83
  <link rel="modulepreload" crossorigin href="/assets/createLucideIcon-BHp8sXmF.js">
84
84
  <link rel="modulepreload" crossorigin href="/assets/bot-TkDIw4y-.js">
85
85
  <link rel="modulepreload" crossorigin href="/assets/external-link-BE6y205O.js">
@@ -90,12 +90,12 @@
90
90
  <link rel="modulepreload" crossorigin href="/assets/dist-BSUJIXeE.js">
91
91
  <link rel="modulepreload" crossorigin href="/assets/dropdown-menu-DjtKUK8F.js">
92
92
  <link rel="modulepreload" crossorigin href="/assets/own-lookup-DS54wXvD.js">
93
- <link rel="modulepreload" crossorigin href="/assets/open-in-menu-CI3ceNjU.js">
93
+ <link rel="modulepreload" crossorigin href="/assets/open-in-menu-Bzca0KPF.js">
94
94
  <link rel="modulepreload" crossorigin href="/assets/check-OP-CVgZG.js">
95
95
  <link rel="modulepreload" crossorigin href="/assets/chevron-down-CHGyCDBH.js">
96
96
  <link rel="modulepreload" crossorigin href="/assets/nav-row-styles-CgP5uNp4.js">
97
97
  <link rel="modulepreload" crossorigin href="/assets/chevron-right-BENZ-1ZN.js">
98
- <link rel="modulepreload" crossorigin href="/assets/folder-browser-CUUWpb8F.js">
98
+ <link rel="modulepreload" crossorigin href="/assets/folder-browser-Civftk0W.js">
99
99
  <link rel="modulepreload" crossorigin href="/assets/eye-B8okNWXU.js">
100
100
  <link rel="modulepreload" crossorigin href="/assets/loader-circle-CPBhhDbB.js">
101
101
  <link rel="modulepreload" crossorigin href="/assets/play-CmVAj_fu.js">
@@ -105,18 +105,18 @@
105
105
  <link rel="modulepreload" crossorigin href="/assets/switch-CAKeV99j.js">
106
106
  <link rel="modulepreload" crossorigin href="/assets/badge-B6B-xYQQ.js">
107
107
  <link rel="modulepreload" crossorigin href="/assets/dialog-DRZuXvul.js">
108
- <link rel="modulepreload" crossorigin href="/assets/project-router-C53GCY_8.js">
109
- <link rel="modulepreload" crossorigin href="/assets/read-state-DOIKdUqa.js">
108
+ <link rel="modulepreload" crossorigin href="/assets/project-router-j0uBi7Ep.js">
109
+ <link rel="modulepreload" crossorigin href="/assets/read-state-c_RNJaXO.js">
110
110
  <link rel="modulepreload" crossorigin href="/assets/status-dot-BXf-Ubd0.js">
111
111
  <link rel="modulepreload" crossorigin href="/assets/use-search-params-writer-ClMScnNe.js">
112
- <link rel="modulepreload" crossorigin href="/assets/report-selection-DAPzf1Aa.js">
112
+ <link rel="modulepreload" crossorigin href="/assets/report-selection-BdGxjISG.js">
113
113
  <link rel="modulepreload" crossorigin href="/assets/page-shell-Dky5crRl.js">
114
114
  <link rel="modulepreload" crossorigin href="/assets/diff-stat-Dy4uLuyP.js">
115
115
  <link rel="modulepreload" crossorigin href="/assets/format-BU7D3IfE.js">
116
116
  <link rel="modulepreload" crossorigin href="/assets/command-BiBq24zL.js">
117
117
  <link rel="modulepreload" crossorigin href="/assets/project-order-AcHI4Dcl.js">
118
118
  <link rel="modulepreload" crossorigin href="/assets/skills-pM_PouEs.js">
119
- <link rel="modulepreload" crossorigin href="/assets/agent-accounts-BuceIkTR.js">
119
+ <link rel="modulepreload" crossorigin href="/assets/agent-accounts-D_7QcFSx.js">
120
120
  <link rel="modulepreload" crossorigin href="/assets/control-locations-kCPVEtOM.js">
121
121
  <link rel="modulepreload" crossorigin href="/assets/agents-settings-path-7X6_cvUg.js">
122
122
  <link rel="modulepreload" crossorigin href="/assets/centered-state-BgSV4e79.js">
@@ -1 +0,0 @@
1
- import{Nn as e,On as t}from"./toaster-C1BFyQ8i.js";function n(n){return t[e(n).bucket]<=t.waiting}export{n as t};