@hearsay-tools/squawk 0.18.0-pr3531.6331 → 0.18.0-pr3531.6405

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 (325) hide show
  1. package/README.md +26 -4
  2. package/dist/autosave-git.d.ts +1 -1
  3. package/dist/autosave-git.js +2 -2
  4. package/dist/autosave-git.js.map +1 -1
  5. package/dist/ci-wait/controller.d.ts +1 -1
  6. package/dist/ci-wait/controller.js +2 -2
  7. package/dist/ci-wait/controller.js.map +1 -1
  8. package/dist/ci-wait/tools.d.ts +4 -4
  9. package/dist/cli-dispatch.d.ts +1 -4
  10. package/dist/cli-dispatch.js +24 -37
  11. package/dist/cli-dispatch.js.map +1 -1
  12. package/dist/config.d.ts +1 -0
  13. package/dist/config.js +5 -0
  14. package/dist/config.js.map +1 -1
  15. package/dist/contract/health.d.ts +0 -2
  16. package/dist/contract/index.js +494 -501
  17. package/dist/contract/run-search.d.ts +18 -20
  18. package/dist/contract/waits.d.ts +3 -3
  19. package/dist/core/claude-cli-runner.js +10 -8
  20. package/dist/core/claude-cli-runner.js.map +1 -1
  21. package/dist/core/omp-runner.js +6 -5
  22. package/dist/core/omp-runner.js.map +1 -1
  23. package/dist/core/product-env.d.ts +2 -2
  24. package/dist/core/product-env.js +3 -4
  25. package/dist/core/product-env.js.map +1 -1
  26. package/dist/delegation/destroy-observation.d.ts +4 -2
  27. package/dist/delegation/destroy-observation.js +4 -3
  28. package/dist/delegation/destroy-observation.js.map +1 -1
  29. package/dist/delegation/policy.d.ts +5 -0
  30. package/dist/delegation/policy.js +6 -1
  31. package/dist/delegation/policy.js.map +1 -1
  32. package/dist/delegation/process-liveness.d.ts +3 -0
  33. package/dist/delegation/process-liveness.js +33 -2
  34. package/dist/delegation/process-liveness.js.map +1 -1
  35. package/dist/delegation/provision.d.ts +0 -1
  36. package/dist/delegation/provision.js +2 -2
  37. package/dist/delegation/provision.js.map +1 -1
  38. package/dist/delegation/routes.d.ts +9 -9
  39. package/dist/delegation/service.js +2 -2
  40. package/dist/delegation/service.js.map +1 -1
  41. package/dist/delegation/transport.d.ts +15 -15
  42. package/dist/delegation/worker-cleanup.d.ts +2 -0
  43. package/dist/delegation/worker-cleanup.js +23 -5
  44. package/dist/delegation/worker-cleanup.js.map +1 -1
  45. package/dist/delegation/workspace-git.d.ts +2 -5
  46. package/dist/delegation/workspace-git.js +5 -11
  47. package/dist/delegation/workspace-git.js.map +1 -1
  48. package/dist/delegation/workspace-removal.d.ts +3 -0
  49. package/dist/delegation/workspace-removal.js +30 -39
  50. package/dist/delegation/workspace-removal.js.map +1 -1
  51. package/dist/delegation/workspace.js +3 -3
  52. package/dist/delegation/workspace.js.map +1 -1
  53. package/dist/delegation/worktree-teardown.d.ts +8 -0
  54. package/dist/delegation/worktree-teardown.js +36 -0
  55. package/dist/delegation/worktree-teardown.js.map +1 -0
  56. package/dist/detached-process.d.ts +0 -18
  57. package/dist/detached-process.js +1 -148
  58. package/dist/detached-process.js.map +1 -1
  59. package/dist/git-command.d.ts +14 -2
  60. package/dist/git-command.js +30 -3
  61. package/dist/git-command.js.map +1 -1
  62. package/dist/git-private-index.js +1 -2
  63. package/dist/git-private-index.js.map +1 -1
  64. package/dist/git-worktree-lock.js +5 -3
  65. package/dist/git-worktree-lock.js.map +1 -1
  66. package/dist/home/command.d.ts +4 -4
  67. package/dist/home/command.js +9 -15
  68. package/dist/home/command.js.map +1 -1
  69. package/dist/home/deprecation.d.ts +2 -4
  70. package/dist/home/deprecation.js +2 -3
  71. package/dist/home/deprecation.js.map +1 -1
  72. package/dist/home/display.d.ts +5 -4
  73. package/dist/home/display.js +7 -7
  74. package/dist/home/display.js.map +1 -1
  75. package/dist/home/entry.d.ts +1 -3
  76. package/dist/home/entry.js +3 -4
  77. package/dist/home/entry.js.map +1 -1
  78. package/dist/home/home.js +1 -2
  79. package/dist/home/home.js.map +1 -1
  80. package/dist/home/identity.d.ts +4 -3
  81. package/dist/home/identity.js +3 -5
  82. package/dist/home/identity.js.map +1 -1
  83. package/dist/home/legacy-recovery.d.ts +2 -2
  84. package/dist/home/legacy-recovery.js +4 -9
  85. package/dist/home/legacy-recovery.js.map +1 -1
  86. package/dist/home/legacy-source.d.ts +2 -3
  87. package/dist/home/legacy-source.js +3 -6
  88. package/dist/home/legacy-source.js.map +1 -1
  89. package/dist/home/migrate.d.ts +1 -1
  90. package/dist/home/migrate.js +1 -1
  91. package/dist/home/migrate.js.map +1 -1
  92. package/dist/home/migration-boot.d.ts +1 -2
  93. package/dist/home/migration-boot.js +2 -5
  94. package/dist/home/migration-boot.js.map +1 -1
  95. package/dist/home/migration-cli.js +4 -3
  96. package/dist/home/migration-cli.js.map +1 -1
  97. package/dist/home/private-files.js +2 -3
  98. package/dist/home/private-files.js.map +1 -1
  99. package/dist/home/recovery-watch.d.ts +1 -1
  100. package/dist/home/recovery-watch.js +3 -4
  101. package/dist/home/recovery-watch.js.map +1 -1
  102. package/dist/home/recovery.d.ts +3 -3
  103. package/dist/home/recovery.js +7 -8
  104. package/dist/home/recovery.js.map +1 -1
  105. package/dist/home/resolve.js +1 -2
  106. package/dist/home/resolve.js.map +1 -1
  107. package/dist/index.js +1 -1
  108. package/dist/index.js.map +1 -1
  109. package/dist/install-as-command.d.ts +1 -1
  110. package/dist/managed-install/launcher.d.ts +3 -3
  111. package/dist/managed-install/launcher.js +15 -17
  112. package/dist/managed-install/launcher.js.map +1 -1
  113. package/dist/preview/agent-address.d.ts +1 -1
  114. package/dist/preview/agent-address.js +2 -2
  115. package/dist/preview/agent-address.js.map +1 -1
  116. package/dist/preview/browser-launch.d.ts +2 -1
  117. package/dist/preview/browser-launch.js +12 -9
  118. package/dist/preview/browser-launch.js.map +1 -1
  119. package/dist/preview/chromium.d.ts +4 -0
  120. package/dist/preview/chromium.js +34 -7
  121. package/dist/preview/chromium.js.map +1 -1
  122. package/dist/process-wait/exit-file.d.ts +5 -3
  123. package/dist/process-wait/exit-file.js +7 -3
  124. package/dist/process-wait/exit-file.js.map +1 -1
  125. package/dist/process-wait/supervisor.d.ts +1 -1
  126. package/dist/process-wait/supervisor.js +10 -7
  127. package/dist/process-wait/supervisor.js.map +1 -1
  128. package/dist/project-migration/auto.d.ts +2 -5
  129. package/dist/project-migration/auto.js +5 -8
  130. package/dist/project-migration/auto.js.map +1 -1
  131. package/dist/project-migration/fresh.d.ts +1 -1
  132. package/dist/project-migration/fresh.js +2 -3
  133. package/dist/project-migration/fresh.js.map +1 -1
  134. package/dist/project-paths.d.ts +5 -8
  135. package/dist/project-paths.js +9 -12
  136. package/dist/project-paths.js.map +1 -1
  137. package/dist/release/compatibility.d.ts +2 -2
  138. package/dist/release/compatibility.js +4 -4
  139. package/dist/release/compatibility.js.map +1 -1
  140. package/dist/release/manifests.d.ts +7 -17
  141. package/dist/release/manifests.js +14 -42
  142. package/dist/release/manifests.js.map +1 -1
  143. package/dist/release/snapshot.d.ts +3 -3
  144. package/dist/release/snapshot.js +3 -3
  145. package/dist/release/stable.d.ts +1 -2
  146. package/dist/release/stable.js +1 -2
  147. package/dist/release/stable.js.map +1 -1
  148. package/dist/runs/run-exits.d.ts +301 -301
  149. package/dist/runs/run-exits.js +2 -0
  150. package/dist/runs/run-exits.js.map +1 -1
  151. package/dist/runs/run-index.js +16 -46
  152. package/dist/runs/run-index.js.map +1 -1
  153. package/dist/runs/run-references.d.ts +3 -0
  154. package/dist/runs/run-references.js +8 -1
  155. package/dist/runs/run-references.js.map +1 -1
  156. package/dist/runs/store.d.ts +10 -0
  157. package/dist/runs/store.js +18 -21
  158. package/dist/runs/store.js.map +1 -1
  159. package/dist/serve-command.js +1 -1
  160. package/dist/serve-command.js.map +1 -1
  161. package/dist/server/activity-sources.d.ts +2 -2
  162. package/dist/server/activity-sources.js +4 -4
  163. package/dist/server/activity-sources.js.map +1 -1
  164. package/dist/server/capabilities.d.ts +0 -5
  165. package/dist/server/capabilities.js +0 -1
  166. package/dist/server/capabilities.js.map +1 -1
  167. package/dist/server/create-project.js +2 -1
  168. package/dist/server/create-project.js.map +1 -1
  169. package/dist/server/forge/draft-pr.js +2 -1
  170. package/dist/server/forge/draft-pr.js.map +1 -1
  171. package/dist/server/git-changes.d.ts +18 -0
  172. package/dist/server/git-changes.js +22 -17
  173. package/dist/server/git-changes.js.map +1 -1
  174. package/dist/server/home-recovery-routes.d.ts +2 -3
  175. package/dist/server/home-recovery-routes.js +10 -11
  176. package/dist/server/home-recovery-routes.js.map +1 -1
  177. package/dist/server/project-context.d.ts +0 -2
  178. package/dist/server/project-context.js +1 -1
  179. package/dist/server/project-context.js.map +1 -1
  180. package/dist/server/repo-branches.js +2 -4
  181. package/dist/server/repo-branches.js.map +1 -1
  182. package/dist/server/repo-pull.js +2 -1
  183. package/dist/server/repo-pull.js.map +1 -1
  184. package/dist/server/reports-api.d.ts +2 -2
  185. package/dist/server/server.d.ts +2 -61
  186. package/dist/server/server.js +9 -38
  187. package/dist/server/server.js.map +1 -1
  188. package/dist/server/start-server.js +10 -13
  189. package/dist/server/start-server.js.map +1 -1
  190. package/dist/server/workspace-projects.d.ts +2 -7
  191. package/dist/server/workspace-projects.js +3 -15
  192. package/dist/server/workspace-projects.js.map +1 -1
  193. package/dist/server-install/npx-cache.d.ts +1 -1
  194. package/dist/server-install/npx-cache.js +4 -5
  195. package/dist/server-install/npx-cache.js.map +1 -1
  196. package/dist/server-install/platforms/macosx-migration.d.ts +2 -2
  197. package/dist/server-install/platforms/macosx-migration.js +2 -6
  198. package/dist/server-install/platforms/macosx-migration.js.map +1 -1
  199. package/dist/server-install/platforms/macosx-ngrok.d.ts +4 -6
  200. package/dist/server-install/platforms/macosx-ngrok.js +55 -57
  201. package/dist/server-install/platforms/macosx-ngrok.js.map +1 -1
  202. package/dist/server-install/platforms/ubuntu-vps-migration.d.ts +4 -4
  203. package/dist/server-install/platforms/ubuntu-vps-migration.js +17 -21
  204. package/dist/server-install/platforms/ubuntu-vps-migration.js.map +1 -1
  205. package/dist/server-install/platforms/ubuntu-vps-names.d.ts +13 -11
  206. package/dist/server-install/platforms/ubuntu-vps-names.js +15 -17
  207. package/dist/server-install/platforms/ubuntu-vps-names.js.map +1 -1
  208. package/dist/server-install/platforms/ubuntu-vps.d.ts +7 -11
  209. package/dist/server-install/platforms/ubuntu-vps.js +59 -62
  210. package/dist/server-install/platforms/ubuntu-vps.js.map +1 -1
  211. package/dist/skills-remote.js +2 -1
  212. package/dist/skills-remote.js.map +1 -1
  213. package/dist/skills.js +1 -4
  214. package/dist/skills.js.map +1 -1
  215. package/dist/subcommands.d.ts +2 -2
  216. package/dist/subcommands.js +8 -12
  217. package/dist/subcommands.js.map +1 -1
  218. package/dist/update-check.d.ts +1 -1
  219. package/dist/update-check.js +2 -3
  220. package/dist/update-check.js.map +1 -1
  221. package/dist/workflows/run/launch-context.d.ts +1 -1
  222. package/dist/workflows/run/launch-context.js +6 -6
  223. package/dist/workflows/run/launch-context.js.map +1 -1
  224. package/dist/workflows/run/run-cancel.js +10 -4
  225. package/dist/workflows/run/run-cancel.js.map +1 -1
  226. package/dist/workflows/run/usage-accounting.d.ts +3 -2
  227. package/dist/workflows/run/usage-accounting.js +8 -7
  228. package/dist/workflows/run/usage-accounting.js.map +1 -1
  229. package/dist/workflows/run/wait-engine.d.ts +72 -72
  230. package/dist/workflows/run-states.js +4 -3
  231. package/dist/workflows/run-states.js.map +1 -1
  232. package/dist/workflows/wait-scope.js +2 -2
  233. package/dist/workflows/wait-scope.js.map +1 -1
  234. package/dist/workspace/backup-cli.d.ts +1 -1
  235. package/dist/workspace/backup-cli.js +9 -14
  236. package/dist/workspace/backup-cli.js.map +1 -1
  237. package/dist/workspace/projects-cli.d.ts +0 -2
  238. package/dist/workspace/projects-cli.js +4 -27
  239. package/dist/workspace/projects-cli.js.map +1 -1
  240. package/dist/workspace/projects.d.ts +1 -5
  241. package/dist/workspace/projects.js +8 -5
  242. package/dist/workspace/projects.js.map +1 -1
  243. package/dist/worktree-setup.d.ts +0 -1
  244. package/dist/worktree-setup.js +1 -1
  245. package/dist/worktree-setup.js.map +1 -1
  246. package/package.json +4 -4
  247. package/scripts/benchmark-home.ts +3 -3
  248. package/scripts/benchmark-project-probes.mjs +1 -1
  249. package/scripts/benchmark-workspace-events.ts +1 -1
  250. package/scripts/mock-omp-rpc.mjs +3 -3
  251. package/web/dist/assets/activity-motion-u7cCOvIh.js +2 -0
  252. package/web/dist/assets/{activity-route-BJxCiEIp.js → activity-route-BthlzLJS.js} +1 -1
  253. package/web/dist/assets/agent-accounts-CbqP0u9A.js +18 -0
  254. package/web/dist/assets/{alert-dialog-h-3h9B4l.js → alert-dialog-CPBKJTj_.js} +1 -1
  255. package/web/dist/assets/attention-CCx8Iagl.js +1 -0
  256. package/web/dist/assets/{button-CS5tOblf.js → button-Czdi8NqC.js} +1 -1
  257. package/web/dist/assets/{centered-state-BmsqxbI8.js → centered-state-8l6wvu0C.js} +1 -1
  258. package/web/dist/assets/{cez-idle-NomdGTfa.js → cez-idle-xv7f96fc.js} +1 -1
  259. package/web/dist/assets/{commit-diff-panel-CtUOJAqz.js → commit-diff-panel-B1FnfuXx.js} +1 -1
  260. package/web/dist/assets/{dialog-Dw7fMdDQ.js → dialog-CkU56ywj.js} +1 -1
  261. package/web/dist/assets/{diff-DJyC6ofi.js → diff-DwhVa59f.js} +2 -2
  262. package/web/dist/assets/{diff-controls-BHF0Pvdc.js → diff-controls-DzcrZF8L.js} +1 -1
  263. package/web/dist/assets/{diff-view-20SWzhxR.js → diff-view-C4JhxweA.js} +1 -1
  264. package/web/dist/assets/{dist-DvNdR7gM.js → dist-D4TujV9O.js} +1 -1
  265. package/web/dist/assets/{dropdown-menu-D7f0O7xR.js → dropdown-menu-BN2BI4R1.js} +1 -1
  266. package/web/dist/assets/{es2015-CX0rgbM5.js → es2015-DnySZnV4.js} +1 -1
  267. package/web/dist/assets/{file-preview-C_c-tyCm.js → file-preview-xqxo9aYs.js} +1 -1
  268. package/web/dist/assets/{git-toolbar-Dm75uXLu.js → git-toolbar-B5EhJG95.js} +1 -1
  269. package/web/dist/assets/{github-BtFBo0G5.js → github-CGvl-B9Z.js} +1 -1
  270. package/web/dist/assets/{global-activity-route-Dr3RsNfM.js → global-activity-route-n_BdJZWx.js} +1 -1
  271. package/web/dist/assets/{image-preview-Dy3o8upo.js → image-preview-DpaJAUA9.js} +1 -1
  272. package/web/dist/assets/index-DS1HIBHa.css +1 -0
  273. package/web/dist/assets/index-O1VoICYw.js +17 -0
  274. package/web/dist/assets/{input-DIwJvCgi.js → input-Dilvz-YI.js} +1 -1
  275. package/web/dist/assets/{live-protocol-DBPXI6ks.js → live-protocol-DjH6ZQwI.js} +1 -1
  276. package/web/dist/assets/{nav-row-styles-CEA9c88Q.js → nav-row-styles-DoZBu-jT.js} +1 -1
  277. package/web/dist/assets/{preview-pane-connected-NLUpfhGa.js → preview-pane-connected-OWg6VXKi.js} +2 -2
  278. package/web/dist/assets/{project-router-BFKfAFvq.js → project-router-Coo_s3l-.js} +1 -1
  279. package/web/dist/assets/project-scope-context-WiGQMFsB.js +4 -0
  280. package/web/dist/assets/{prompt-template-menu-B8VpFfKO.js → prompt-template-menu-Ch7UoIKH.js} +1 -1
  281. package/web/dist/assets/queries-BLvbAnL8.js +1 -0
  282. package/web/dist/assets/{reference-chip-DMgD6d01.js → reference-chip-P6ytqWNt.js} +1 -1
  283. package/web/dist/assets/{repo-git-uAud743a.js → repo-git-ZeZnpwuR.js} +1 -1
  284. package/web/dist/assets/{report-reader-CdSUukXf.js → report-reader-D_uzPRmR.js} +1 -1
  285. package/web/dist/assets/reports-C49_pROg.js +1 -0
  286. package/web/dist/assets/run-header-BR1PGTJB.js +2 -0
  287. package/web/dist/assets/skills-BHpdpRR-.js +1 -0
  288. package/web/dist/assets/{tab-link-DDpdYMnv.js → tab-link-CONf2d_z.js} +1 -1
  289. package/web/dist/assets/{task-changes-Bh_7YAeI.js → task-changes-DqcCJDTC.js} +1 -1
  290. package/web/dist/assets/{task-commits-DfXEs6zT.js → task-commits-Jmpz5NtV.js} +1 -1
  291. package/web/dist/assets/{task-files-BRhNrDE4.js → task-files-BFSteFDh.js} +1 -1
  292. package/web/dist/assets/{task-github-item-BqZH0LVz.js → task-github-item-CIno99eX.js} +1 -1
  293. package/web/dist/assets/{task-thread-DvZKVSna.js → task-thread-BKkxwKd_.js} +5 -5
  294. package/web/dist/assets/{thread-state-FqUDnt89.js → thread-state-Bwt_th_-.js} +1 -1
  295. package/web/dist/assets/{toaster-CRVRHlMR.js → toaster-2NK3PogQ.js} +1 -1
  296. package/web/dist/assets/{use-desktop-DeG3Ha7y.js → use-desktop-CW-Femww.js} +1 -1
  297. package/web/dist/assets/{use-hand-to-agent-state-DeLboLqM.js → use-hand-to-agent-state-XV1UwyxH.js} +1 -1
  298. package/web/dist/assets/{useInfiniteQuery-BmfExLUr.js → useInfiniteQuery-BgLdxmcZ.js} +1 -1
  299. package/web/dist/assets/useQuery-CY8bJTYi.js +1 -0
  300. package/web/dist/assets/{workflows-DIB7faC8.js → workflows-DUCROjgb.js} +1 -1
  301. package/web/dist/assets/ws-8bmD25V4.js +1 -0
  302. package/web/dist/assets/{zoomable-image-UzXCYU7Z.js → zoomable-image-D0zshpve.js} +1 -1
  303. package/web/dist/index.html +25 -25
  304. package/web/dist/live-worker.js +1 -1
  305. package/dist/delegation/idle-test-app.d.ts +0 -4
  306. package/dist/delegation/idle-test-app.js +0 -186
  307. package/dist/delegation/idle-test-app.js.map +0 -1
  308. package/dist/delegation/windows-test-app.d.ts +0 -5
  309. package/dist/delegation/windows-test-app.js +0 -64
  310. package/dist/delegation/windows-test-app.js.map +0 -1
  311. package/dist/home/switch.d.ts +0 -2
  312. package/dist/home/switch.js +0 -3
  313. package/dist/home/switch.js.map +0 -1
  314. package/web/dist/assets/activity-motion-DC9hC5nV.js +0 -2
  315. package/web/dist/assets/agent-accounts-DnFoFuBJ.js +0 -18
  316. package/web/dist/assets/attention-VmnPpwJx.js +0 -1
  317. package/web/dist/assets/index-CrlovI4F.css +0 -1
  318. package/web/dist/assets/index-jbljrsnC.js +0 -17
  319. package/web/dist/assets/project-scope-context-DSkcNKO7.js +0 -4
  320. package/web/dist/assets/queries-sEwd08S5.js +0 -1
  321. package/web/dist/assets/reports-C842hFaD.js +0 -1
  322. package/web/dist/assets/run-header-Bj-L6zkj.js +0 -2
  323. package/web/dist/assets/skills-DFTYrwoH.js +0 -1
  324. package/web/dist/assets/useQuery-8pHkglP4.js +0 -1
  325. package/web/dist/assets/ws-CEQH0TUT.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{C as t,D as n,E as r,T as i,t as a,u as o}from"./button-CS5tOblf.js";import{i as s,t as c}from"./react-runtime-CCIEwYL0.js";import{N as l,i as u,s as d}from"./project-scope-context-DSkcNKO7.js";import{C as f,f as p,gt as m,u as h,xt as g}from"./queries-sEwd08S5.js";import{C as _,E as v,Q as y,ct as b,d as x}from"./design-icons-DmYTv2r1.js";import{t as S}from"./createLucideIcon-BHp8sXmF.js";import{d as C,t as w}from"./run-header-Bj-L6zkj.js";import{a as T,i as E,n as D,r as O}from"./file-preview-C_c-tyCm.js";import{t as k}from"./input-DIwJvCgi.js";import{t as A}from"./centered-state-BmsqxbI8.js";import{D as j,E as M,z as N}from"./index-jbljrsnC.js";var P=S(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),F=S(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),I=e(s(),1),L=c();function R({runId:e,path:n,artifactId:r}){let i=f(e,r?null:n),o=h(e,r),s=r?o:i,c=(0,I.useContext)(N),u=t(),p=u.pathname.replace(/\/files\/?$/,`/report`)+u.search,m=s.data,g=(0,I.useMemo)(()=>m?.type===`file`&&m.source!==`artifact`?{runId:e,...c,basePath:m.path}:null,[m,c,e]);if(!n&&!r)return(0,L.jsx)(O,{runId:e,path:null,className:`min-w-0 flex-1`});if(s.isPending)return(0,L.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(s.isError)return(0,L.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,L.jsx)(`h2`,{children:`Could not load this file`}),(0,L.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:s.error.message}),(0,L.jsx)(a,{variant:`outline`,onClick:()=>void s.refetch(),children:`Retry`})]});if(!m)return(0,L.jsx)(`p`,{role:`alert`,className:`p-4`,children:`No file data was returned.`});if(m.type!==`file`)return(0,L.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,L.jsx)(`h2`,{children:m.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,L.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:m.path}),(0,L.jsx)(`p`,{className:`text-sm`,children:m.reason}),(0,L.jsx)(a,{variant:`outline`,onClick:()=>void s.refetch(),children:`Retry`})]});let _=m.artifact;return(0,L.jsx)(N.Provider,{value:g,children:(0,L.jsx)(D,{runId:e,entry:m,documentPreview:!0,readerHref:p,className:`min-w-0 flex-1`,imageUrl:_?d(e,_.id,`image`):l(e,n),..._?{downloadUrl:d(e,_.id,`download`),snapshot:new Date(_.createdAt).toLocaleString()}:{}},_?.id??m.path)})}var z=new Map;function B(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var V=(0,I.createContext)(null);function H(){let{key:e}=t(),n=i()===`POP`,[r,a]=(0,I.useState)({key:e,generation:0});if(r.key===e)return r.generation;let o={key:e,generation:n?r.generation+1:r.generation};return a(o),o.generation}var U=()=>document.querySelector(`[data-slot="main"]`);function W(e,n){let r=(0,I.useRef)(null),a=t(),o=i()===`POP`?a.key:B(a.state),[s]=(0,I.useState)(()=>{let t=o?z.get(o):void 0;return t?.runId===e?t:null}),c=(0,I.useRef)(new Set(s?.folders??[])),l=(0,I.useRef)(new Set),[u,d]=(0,I.useState)(0),f=(0,I.useRef)(s===null),p=(0,I.useCallback)(()=>{f.current&&z.set(a.key,{runId:e,folders:new Set(c.current),tree:r.current?.scrollTop??0,main:U()?.scrollTop??0})},[a.key,e]),m=(0,I.useMemo)(()=>({isOpen:e=>c.current.has(e),setOpen:(e,t)=>{t?c.current.add(e):c.current.delete(e),p()},loading:(e,t)=>{s?.folders.has(e)&&(t?l.current.add(e):l.current.delete(e),d(l.current.size))}}),[s,p]);return(0,I.useEffect)(()=>{if(f.current||!s||!n||l.current.size>0)return;r.current&&(r.current.scrollTop=s.tree);let e=U();e&&(e.scrollTop=s.main),f.current=!0,p()},[s,n,u,p]),(0,I.useEffect)(()=>{p();let e=[r.current,U()].filter(e=>e!==null);for(let t of e)t.addEventListener(`scroll`,p,{passive:!0});return()=>{for(let t of e)t.removeEventListener(`scroll`,p)}},[p]),{tree:r,folders:m}}function G({runId:e,selected:t,onSelect:n}){return(0,L.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,L.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,L.jsx)(K,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function K({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=g(e,t),o=(0,I.useContext)(V);return(0,I.useEffect)(()=>{if(!(!t||!o))return o.loading(t,a.isPending),()=>o.loading(t,!1)},[o,t,a.isPending]),a.isPending?(0,L.jsx)(`li`,{"data-slot":`files-tree-loading`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Loading…`}):a.isError?(0,L.jsx)(`li`,{"data-slot":`files-tree-error`,className:`px-1.5 py-1 text-xs text-danger`,style:{paddingLeft:`${6+n*14}px`},children:a.error.message}):a.data.type===`dir`?a.data.entries.length===0?(0,L.jsx)(`li`,{"data-slot":`files-tree-empty`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Empty directory`}):(0,L.jsx)(L.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,L.jsx)(q,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,L.jsx)(J,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function q({runId:e,name:t,path:n,depth:r,selected:i,onSelect:a}){let s=(0,I.useContext)(V),[c,l]=(0,I.useState)(()=>s?.isOpen(n)??!1);return(0,L.jsxs)(`li`,{children:[(0,L.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":c?`open`:`closed`,"aria-expanded":c,onClick:()=>{s?.setOpen(n,!c),l(!c)},className:`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+r*14}px`},children:[(0,L.jsx)(x,{size:16,"aria-hidden":`true`,className:o(`order-last ml-auto size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,c&&`rotate-90`)}),(0,L.jsx)(v,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,L.jsx)(`span`,{className:`min-w-0 truncate font-normal`,children:t})]}),c?(0,L.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,L.jsx)(K,{runId:e,path:n,depth:r+1,selected:i,onSelect:a})}):null]})}function J({name:e,path:t,size:n,depth:r,selected:i,onSelect:a}){let s=i===t,c=T(t)?F:_;return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":s?`true`:void 0,onClick:()=>a(t),className:o(`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,s?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${6+r*14}px`},children:[(0,L.jsx)(c,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,L.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,L.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] tabular-nums text-soft-foreground`,children:E(n)})]})})}function Y(){let{id:e}=r(),t=m(e),n=H();return t.isPending?(0,L.jsx)(j,{tab:`files`}):t.isError?(0,L.jsx)(M,{tab:`files`,error:t.error}):(0,L.jsx)(C,{runId:t.data.id,children:(0,L.jsx)(Z,{run:t.data},`${t.data.id}:${n}`)})}function X(e,t,n,r){let i=f(e,r||n!==null?null:t),a=h(e,r?null:n);return r||t===null&&n===null?!0:!(n===null?i:a).isPending}function Z({run:e}){let t=g(e.id,``),r=p(e.id),[i,o]=n(),s=i.get(`path`),c=i.get(`artifact`),l=i.getAll(`path`).length>1||i.getAll(`artifact`).length>1||s!==null&&c!==null,[d,f]=(0,I.useState)(s??``);(0,I.useEffect)(()=>f(s??``),[s]);let m=(e,t)=>{let n=new URLSearchParams(i);n.delete(`path`),n.delete(`artifact`),n.set(e,t),o(n)},h=t.isError&&t.error instanceof u&&t.error.status===409,_=X(e.id,s,c,l),v=W(e.id,!t.isPending&&_);return(0,L.jsxs)(`div`,{"data-route":`task-files`,className:`flex min-h-full flex-col`,children:[(0,L.jsx)(w,{run:e,tab:`files`}),(0,L.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-[18px] pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),d.trim()&&m(`path`,d.trim())},children:[(0,L.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,L.jsx)(y,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,L.jsx)(k,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:d,onChange:e=>f(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,L.jsx)(a,{type:`submit`,variant:`outline`,className:`h-11 shrink-0`,disabled:!d.trim(),children:`Open file`})]}),(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-col items-stretch gap-5 px-[18px] py-[22px] [--diff-sticky-top:1rem] md:flex-row md:items-start md:px-9`,children:[(0,L.jsxs)(`aside`,{ref:v.tree,"data-slot":`files-tree-pane`,className:`w-full shrink-0 rounded-xl border border-border bg-card p-3.5 md:sticky md:top-[var(--diff-sticky-top)] md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain lg:w-72`,children:[(0,L.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,L.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,L.jsx)(A,{icon:h?(0,L.jsx)(P,{}):(0,L.jsx)(b,{size:16}),tone:h?`neutral`:`danger`,heading:`h2`,title:h?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,L.jsx)(V.Provider,{value:v.folders,children:(0,L.jsx)(G,{runId:e.id,selected:s,onSelect:e=>m(`path`,e)})}),(0,L.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,L.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),r.isPending?(0,L.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):r.isError?(0,L.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):r.data.artifacts.length===0?(0,L.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,L.jsx)(`ul`,{children:r.data.artifacts.map(e=>(0,L.jsx)(`li`,{children:(0,L.jsx)(`button`,{type:`button`,"aria-current":e.id===c?`true`:void 0,className:`min-h-11 w-full rounded px-2 py-2 text-left text-xs wrap-anywhere hover:bg-muted focus-visible:ring-2`,onClick:()=>m(`artifact`,e.id),children:e.name})},e.id))}),(0,L.jsx)(a,{variant:`ghost`,className:`min-h-11`,onClick:()=>void r.refetch(),children:`Refresh published files`})]})]}),l?(0,L.jsx)(`p`,{role:`alert`,className:`p-4`,children:`Invalid file link: choose either a path or a published artifact.`}):s!==null||c!==null||t.isSuccess?(0,L.jsx)(R,{runId:e.id,path:s,artifactId:c}):null]}),(0,L.jsx)(`p`,{className:`px-[18px] pb-6 text-xs text-muted-foreground md:px-9`,children:`Browsing files is read-only. Worktree contents may differ from your main checkout. Published files are snapshots.`})]})}export{Y as TaskFilesRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{C as t,D as n,E as r,T as i,t as a,u as o}from"./button-Czdi8NqC.js";import{i as s,t as c}from"./react-runtime-CCIEwYL0.js";import{N as l,i as u,s as d}from"./project-scope-context-WiGQMFsB.js";import{C as f,f as p,gt as m,u as h,xt as g}from"./queries-BLvbAnL8.js";import{C as _,E as v,Q as y,ct as b,d as x}from"./design-icons-DmYTv2r1.js";import{t as S}from"./createLucideIcon-BHp8sXmF.js";import{d as C,t as w}from"./run-header-BR1PGTJB.js";import{a as T,i as E,n as D,r as O}from"./file-preview-xqxo9aYs.js";import{t as k}from"./input-Dilvz-YI.js";import{t as A}from"./centered-state-8l6wvu0C.js";import{D as j,E as M,z as N}from"./index-O1VoICYw.js";var P=S(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),F=S(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),I=e(s(),1),L=c();function R({runId:e,path:n,artifactId:r}){let i=f(e,r?null:n),o=h(e,r),s=r?o:i,c=(0,I.useContext)(N),u=t(),p=u.pathname.replace(/\/files\/?$/,`/report`)+u.search,m=s.data,g=(0,I.useMemo)(()=>m?.type===`file`&&m.source!==`artifact`?{runId:e,...c,basePath:m.path}:null,[m,c,e]);if(!n&&!r)return(0,L.jsx)(O,{runId:e,path:null,className:`min-w-0 flex-1`});if(s.isPending)return(0,L.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(s.isError)return(0,L.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,L.jsx)(`h2`,{children:`Could not load this file`}),(0,L.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:s.error.message}),(0,L.jsx)(a,{variant:`outline`,onClick:()=>void s.refetch(),children:`Retry`})]});if(!m)return(0,L.jsx)(`p`,{role:`alert`,className:`p-4`,children:`No file data was returned.`});if(m.type!==`file`)return(0,L.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,L.jsx)(`h2`,{children:m.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,L.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:m.path}),(0,L.jsx)(`p`,{className:`text-sm`,children:m.reason}),(0,L.jsx)(a,{variant:`outline`,onClick:()=>void s.refetch(),children:`Retry`})]});let _=m.artifact;return(0,L.jsx)(N.Provider,{value:g,children:(0,L.jsx)(D,{runId:e,entry:m,documentPreview:!0,readerHref:p,className:`min-w-0 flex-1`,imageUrl:_?d(e,_.id,`image`):l(e,n),..._?{downloadUrl:d(e,_.id,`download`),snapshot:new Date(_.createdAt).toLocaleString()}:{}},_?.id??m.path)})}var z=new Map;function B(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var V=(0,I.createContext)(null);function H(){let{key:e}=t(),n=i()===`POP`,[r,a]=(0,I.useState)({key:e,generation:0});if(r.key===e)return r.generation;let o={key:e,generation:n?r.generation+1:r.generation};return a(o),o.generation}var U=()=>document.querySelector(`[data-slot="main"]`);function W(e,n){let r=(0,I.useRef)(null),a=t(),o=i()===`POP`?a.key:B(a.state),[s]=(0,I.useState)(()=>{let t=o?z.get(o):void 0;return t?.runId===e?t:null}),c=(0,I.useRef)(new Set(s?.folders??[])),l=(0,I.useRef)(new Set),[u,d]=(0,I.useState)(0),f=(0,I.useRef)(s===null),p=(0,I.useCallback)(()=>{f.current&&z.set(a.key,{runId:e,folders:new Set(c.current),tree:r.current?.scrollTop??0,main:U()?.scrollTop??0})},[a.key,e]),m=(0,I.useMemo)(()=>({isOpen:e=>c.current.has(e),setOpen:(e,t)=>{t?c.current.add(e):c.current.delete(e),p()},loading:(e,t)=>{s?.folders.has(e)&&(t?l.current.add(e):l.current.delete(e),d(l.current.size))}}),[s,p]);return(0,I.useEffect)(()=>{if(f.current||!s||!n||l.current.size>0)return;r.current&&(r.current.scrollTop=s.tree);let e=U();e&&(e.scrollTop=s.main),f.current=!0,p()},[s,n,u,p]),(0,I.useEffect)(()=>{p();let e=[r.current,U()].filter(e=>e!==null);for(let t of e)t.addEventListener(`scroll`,p,{passive:!0});return()=>{for(let t of e)t.removeEventListener(`scroll`,p)}},[p]),{tree:r,folders:m}}function G({runId:e,selected:t,onSelect:n}){return(0,L.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,L.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,L.jsx)(K,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function K({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=g(e,t),o=(0,I.useContext)(V);return(0,I.useEffect)(()=>{if(!(!t||!o))return o.loading(t,a.isPending),()=>o.loading(t,!1)},[o,t,a.isPending]),a.isPending?(0,L.jsx)(`li`,{"data-slot":`files-tree-loading`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Loading…`}):a.isError?(0,L.jsx)(`li`,{"data-slot":`files-tree-error`,className:`px-1.5 py-1 text-xs text-danger`,style:{paddingLeft:`${6+n*14}px`},children:a.error.message}):a.data.type===`dir`?a.data.entries.length===0?(0,L.jsx)(`li`,{"data-slot":`files-tree-empty`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Empty directory`}):(0,L.jsx)(L.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,L.jsx)(q,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,L.jsx)(J,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function q({runId:e,name:t,path:n,depth:r,selected:i,onSelect:a}){let s=(0,I.useContext)(V),[c,l]=(0,I.useState)(()=>s?.isOpen(n)??!1);return(0,L.jsxs)(`li`,{children:[(0,L.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":c?`open`:`closed`,"aria-expanded":c,onClick:()=>{s?.setOpen(n,!c),l(!c)},className:`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+r*14}px`},children:[(0,L.jsx)(x,{size:16,"aria-hidden":`true`,className:o(`order-last ml-auto size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,c&&`rotate-90`)}),(0,L.jsx)(v,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,L.jsx)(`span`,{className:`min-w-0 truncate font-normal`,children:t})]}),c?(0,L.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,L.jsx)(K,{runId:e,path:n,depth:r+1,selected:i,onSelect:a})}):null]})}function J({name:e,path:t,size:n,depth:r,selected:i,onSelect:a}){let s=i===t,c=T(t)?F:_;return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":s?`true`:void 0,onClick:()=>a(t),className:o(`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,s?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${6+r*14}px`},children:[(0,L.jsx)(c,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,L.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,L.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] tabular-nums text-soft-foreground`,children:E(n)})]})})}function Y(){let{id:e}=r(),t=m(e),n=H();return t.isPending?(0,L.jsx)(j,{tab:`files`}):t.isError?(0,L.jsx)(M,{tab:`files`,error:t.error}):(0,L.jsx)(C,{runId:t.data.id,children:(0,L.jsx)(Z,{run:t.data},`${t.data.id}:${n}`)})}function X(e,t,n,r){let i=f(e,r||n!==null?null:t),a=h(e,r?null:n);return r||t===null&&n===null?!0:!(n===null?i:a).isPending}function Z({run:e}){let t=g(e.id,``),r=p(e.id),[i,o]=n(),s=i.get(`path`),c=i.get(`artifact`),l=i.getAll(`path`).length>1||i.getAll(`artifact`).length>1||s!==null&&c!==null,[d,f]=(0,I.useState)(s??``);(0,I.useEffect)(()=>f(s??``),[s]);let m=(e,t)=>{let n=new URLSearchParams(i);n.delete(`path`),n.delete(`artifact`),n.set(e,t),o(n)},h=t.isError&&t.error instanceof u&&t.error.status===409,_=X(e.id,s,c,l),v=W(e.id,!t.isPending&&_);return(0,L.jsxs)(`div`,{"data-route":`task-files`,className:`flex min-h-full flex-col`,children:[(0,L.jsx)(w,{run:e,tab:`files`}),(0,L.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-[18px] pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),d.trim()&&m(`path`,d.trim())},children:[(0,L.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,L.jsx)(y,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,L.jsx)(k,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:d,onChange:e=>f(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,L.jsx)(a,{type:`submit`,variant:`outline`,className:`h-11 shrink-0`,disabled:!d.trim(),children:`Open file`})]}),(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-col items-stretch gap-5 px-[18px] py-[22px] [--diff-sticky-top:1rem] md:flex-row md:items-start md:px-9`,children:[(0,L.jsxs)(`aside`,{ref:v.tree,"data-slot":`files-tree-pane`,className:`w-full shrink-0 rounded-xl border border-border bg-card p-3.5 md:sticky md:top-[var(--diff-sticky-top)] md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain lg:w-72`,children:[(0,L.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,L.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,L.jsx)(A,{icon:h?(0,L.jsx)(P,{}):(0,L.jsx)(b,{size:16}),tone:h?`neutral`:`danger`,heading:`h2`,title:h?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,L.jsx)(V.Provider,{value:v.folders,children:(0,L.jsx)(G,{runId:e.id,selected:s,onSelect:e=>m(`path`,e)})}),(0,L.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,L.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),r.isPending?(0,L.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):r.isError?(0,L.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):r.data.artifacts.length===0?(0,L.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,L.jsx)(`ul`,{children:r.data.artifacts.map(e=>(0,L.jsx)(`li`,{children:(0,L.jsx)(`button`,{type:`button`,"aria-current":e.id===c?`true`:void 0,className:`min-h-11 w-full rounded px-2 py-2 text-left text-xs wrap-anywhere hover:bg-muted focus-visible:ring-2`,onClick:()=>m(`artifact`,e.id),children:e.name})},e.id))}),(0,L.jsx)(a,{variant:`ghost`,className:`min-h-11`,onClick:()=>void r.refetch(),children:`Refresh published files`})]})]}),l?(0,L.jsx)(`p`,{role:`alert`,className:`p-4`,children:`Invalid file link: choose either a path or a published artifact.`}):s!==null||c!==null||t.isSuccess?(0,L.jsx)(R,{runId:e.id,path:s,artifactId:c}):null]}),(0,L.jsx)(`p`,{className:`px-[18px] pb-6 text-xs text-muted-foreground md:px-9`,children:`Browsing files is read-only. Worktree contents may differ from your main checkout. Published files are snapshots.`})]})}export{Y as TaskFilesRoute};
@@ -1 +1 @@
1
- import{E as e,d as t,t as n}from"./button-CS5tOblf.js";import{t as r}from"./react-runtime-CCIEwYL0.js";import{Kr as i,et as a}from"./project-scope-context-DSkcNKO7.js";import{$ as o,$t as s,E as c,J as l,P as u,gt as d,k as f,n as p}from"./queries-sEwd08S5.js";import{S as m,et as h,y as g}from"./use-desktop-DeG3Ha7y.js";import{I as _,ct as v,m as y}from"./design-icons-DmYTv2r1.js";import{t as b}from"./run-header-Bj-L6zkj.js";import{u as x}from"./reference-chip-DMgD6d01.js";import{t as S}from"./project-router-BFKfAFvq.js";import{t as C}from"./centered-state-BmsqxbI8.js";import{E as w,T,sn as E}from"./index-jbljrsnC.js";import{n as D,o as O,t as k}from"./use-hand-to-agent-state-DeLboLqM.js";var A=r(),j={issue:`Issue`,pr:`Pull request`};function M({kind:t}){let{id:n}=e(),r=d(n);return r.isPending?(0,A.jsx)(T,{kind:t}):r.isError?(0,A.jsx)(w,{tab:`github-item`,error:r.error}):(0,A.jsx)(N,{run:r.data,kind:t})}function N({run:t,kind:r}){let{n:i}=e(),a=Number(i),s=l(),c=o(),d=u(),p=c.isPending||d.isPending,m=g(t,s).some(e=>e.kind===r&&e.number===a),h=f(r,a,m);return(0,A.jsxs)(`div`,{"data-route":`task-github-item`,className:`flex min-h-full flex-col`,children:[(0,A.jsx)(b,{run:t,tab:{kind:r,number:a}}),m?(0,A.jsx)(V,{run:t,kind:r,number:a,repoBase:s,item:h}):p?(0,A.jsx)(T,{kind:r,number:a,heading:`h2`}):(0,A.jsx)(C,{icon:(0,A.jsx)(E,{size:16}),tone:`neutral`,heading:`h2`,title:`#${i} is not linked to this task`,subtitle:`Only the issues and pull requests this task references open here.`,actions:(0,A.jsx)(n,{asChild:!0,variant:`outline`,children:(0,A.jsx)(S,{to:`/tasks/${t.id}`,children:`Back to the session`})})})]})}function P(e,t){return e===`pr`&&t.data?.available===!0&&t.data.item!==null}function F(e,t,n,r){return e===`pr`?n?.[t]??r:r}function I({retry:e,kind:t,number:r}){return(0,A.jsx)(n,{variant:`outline`,disabled:e.isPending,onClick:()=>e.mutate(p.githubItem(t,r)),children:`Retry`})}function L({kind:e,number:t,error:n,retryButton:r}){return(0,A.jsx)(C,{icon:(0,A.jsx)(v,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load ${j[e].toLowerCase()} #${t}`,subtitle:n.message,actions:r})}function R({run:e,kind:r,number:i,repoBase:a,reason:o,retryError:s,retryButton:c}){let l=r===`pr`?_:y,u=m(e,a).find(e=>e.kind===`PR`==(r===`pr`)&&e.number===i)?.url;return(0,A.jsx)(C,{icon:(0,A.jsx)(l,{size:16}),tone:`neutral`,heading:`h2`,title:`GitHub is unavailable`,subtitle:s?.message??o,actions:(0,A.jsxs)(A.Fragment,{children:[c,u&&t(u)?(0,A.jsx)(n,{asChild:!0,variant:`outline`,children:(0,A.jsxs)(`a`,{href:u,target:`_blank`,rel:`noopener noreferrer`,children:[`open on GitHub`,(0,A.jsx)(h,{"aria-hidden":`true`})]})}):null]})})}function z({label:e,repoBase:t}){return(0,A.jsx)(C,{icon:(0,A.jsx)(x,{}),tone:`neutral`,heading:`h2`,title:`${e} was not found in ${H(t)}`,subtitle:`It may have been deleted, or the number points at a different repository.`})}function B({kind:e,item:t,labelColors:n,checks:r}){return(0,A.jsx)(`div`,{className:`min-w-0 px-0.5 md:px-2`,children:(0,A.jsx)(O,{item:t,colors:n??{},checks:r,backLink:null,subNav:null,children:e===`issue`?(0,A.jsx)(U,{item:t},t.url):null})})}function V({run:e,kind:t,number:n,repoBase:r,item:o}){let l=i(),u=s({mutationFn:e=>a(t,n,{refresh:!0}),onSuccess:(e,t)=>l.setQueryData(t,e)}),d=P(t,o),f=c(d?[n]:[],d),p=f.data?.available?f.data.checks:void 0,m=`${j[t]} #${n}`,h=(0,A.jsx)(I,{retry:u,kind:t,number:n});if(o.isPending)return(0,A.jsx)(T,{kind:t,number:n,heading:`h2`});if(o.isError)return(0,A.jsx)(L,{kind:t,number:n,error:u.error??o.error,retryButton:h});let g=o.data;return g.available?g.item?(0,A.jsx)(B,{kind:t,item:g.item,labelColors:g.labelColors,checks:F(t,n,p,g.item.checks)}):(0,A.jsx)(z,{label:m,repoBase:r}):(0,A.jsx)(R,{run:e,kind:t,number:n,repoBase:r,reason:g.reason,retryError:u.error,retryButton:h})}function H(e){if(!e)return`this repository`;try{return new URL(e).pathname.split(`/`).filter(Boolean).slice(0,2).join(`/`)||`this repository`}catch{return`this repository`}}function U({item:e}){let t=k();return(0,A.jsx)(D,{item:e,workflows:t.workflows.data?.workflows??[],skills:t.skillList,workflow:t.workflow,onWorkflowChange:t.setWorkflow,selectedSkills:t.selectedSkills,onSkillsChange:t.setSelectedSkills,engine:t.engine,onEngineChange:t.setEngine,queuedRunId:t.queued.get(e.url)??null,onQueued:t.onQueued},e.url)}export{M as TaskGithubItemRoute};
1
+ import{E as e,d as t,t as n}from"./button-Czdi8NqC.js";import{t as r}from"./react-runtime-CCIEwYL0.js";import{Gr as i,et as a}from"./project-scope-context-WiGQMFsB.js";import{$ as o,$t as s,E as c,J as l,P as u,gt as d,k as f,n as p}from"./queries-BLvbAnL8.js";import{S as m,et as h,y as g}from"./use-desktop-CW-Femww.js";import{I as _,ct as v,m as y}from"./design-icons-DmYTv2r1.js";import{t as b}from"./run-header-BR1PGTJB.js";import{u as x}from"./reference-chip-P6ytqWNt.js";import{t as S}from"./project-router-Coo_s3l-.js";import{t as C}from"./centered-state-8l6wvu0C.js";import{E as w,T,sn as E}from"./index-O1VoICYw.js";import{n as D,o as O,t as k}from"./use-hand-to-agent-state-XV1UwyxH.js";var A=r(),j={issue:`Issue`,pr:`Pull request`};function M({kind:t}){let{id:n}=e(),r=d(n);return r.isPending?(0,A.jsx)(T,{kind:t}):r.isError?(0,A.jsx)(w,{tab:`github-item`,error:r.error}):(0,A.jsx)(N,{run:r.data,kind:t})}function N({run:t,kind:r}){let{n:i}=e(),a=Number(i),s=l(),c=o(),d=u(),p=c.isPending||d.isPending,m=g(t,s).some(e=>e.kind===r&&e.number===a),h=f(r,a,m);return(0,A.jsxs)(`div`,{"data-route":`task-github-item`,className:`flex min-h-full flex-col`,children:[(0,A.jsx)(b,{run:t,tab:{kind:r,number:a}}),m?(0,A.jsx)(V,{run:t,kind:r,number:a,repoBase:s,item:h}):p?(0,A.jsx)(T,{kind:r,number:a,heading:`h2`}):(0,A.jsx)(C,{icon:(0,A.jsx)(E,{size:16}),tone:`neutral`,heading:`h2`,title:`#${i} is not linked to this task`,subtitle:`Only the issues and pull requests this task references open here.`,actions:(0,A.jsx)(n,{asChild:!0,variant:`outline`,children:(0,A.jsx)(S,{to:`/tasks/${t.id}`,children:`Back to the session`})})})]})}function P(e,t){return e===`pr`&&t.data?.available===!0&&t.data.item!==null}function F(e,t,n,r){return e===`pr`?n?.[t]??r:r}function I({retry:e,kind:t,number:r}){return(0,A.jsx)(n,{variant:`outline`,disabled:e.isPending,onClick:()=>e.mutate(p.githubItem(t,r)),children:`Retry`})}function L({kind:e,number:t,error:n,retryButton:r}){return(0,A.jsx)(C,{icon:(0,A.jsx)(v,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load ${j[e].toLowerCase()} #${t}`,subtitle:n.message,actions:r})}function R({run:e,kind:r,number:i,repoBase:a,reason:o,retryError:s,retryButton:c}){let l=r===`pr`?_:y,u=m(e,a).find(e=>e.kind===`PR`==(r===`pr`)&&e.number===i)?.url;return(0,A.jsx)(C,{icon:(0,A.jsx)(l,{size:16}),tone:`neutral`,heading:`h2`,title:`GitHub is unavailable`,subtitle:s?.message??o,actions:(0,A.jsxs)(A.Fragment,{children:[c,u&&t(u)?(0,A.jsx)(n,{asChild:!0,variant:`outline`,children:(0,A.jsxs)(`a`,{href:u,target:`_blank`,rel:`noopener noreferrer`,children:[`open on GitHub`,(0,A.jsx)(h,{"aria-hidden":`true`})]})}):null]})})}function z({label:e,repoBase:t}){return(0,A.jsx)(C,{icon:(0,A.jsx)(x,{}),tone:`neutral`,heading:`h2`,title:`${e} was not found in ${H(t)}`,subtitle:`It may have been deleted, or the number points at a different repository.`})}function B({kind:e,item:t,labelColors:n,checks:r}){return(0,A.jsx)(`div`,{className:`min-w-0 px-0.5 md:px-2`,children:(0,A.jsx)(O,{item:t,colors:n??{},checks:r,backLink:null,subNav:null,children:e===`issue`?(0,A.jsx)(U,{item:t},t.url):null})})}function V({run:e,kind:t,number:n,repoBase:r,item:o}){let l=i(),u=s({mutationFn:e=>a(t,n,{refresh:!0}),onSuccess:(e,t)=>l.setQueryData(t,e)}),d=P(t,o),f=c(d?[n]:[],d),p=f.data?.available?f.data.checks:void 0,m=`${j[t]} #${n}`,h=(0,A.jsx)(I,{retry:u,kind:t,number:n});if(o.isPending)return(0,A.jsx)(T,{kind:t,number:n,heading:`h2`});if(o.isError)return(0,A.jsx)(L,{kind:t,number:n,error:u.error??o.error,retryButton:h});let g=o.data;return g.available?g.item?(0,A.jsx)(B,{kind:t,item:g.item,labelColors:g.labelColors,checks:F(t,n,p,g.item.checks)}):(0,A.jsx)(z,{label:m,repoBase:r}):(0,A.jsx)(R,{run:e,kind:t,number:n,repoBase:r,reason:g.reason,retryError:u.error,retryButton:h})}function H(e){if(!e)return`this repository`;try{return new URL(e).pathname.split(`/`).filter(Boolean).slice(0,2).join(`/`)||`this repository`}catch{return`this repository`}}function U({item:e}){let t=k();return(0,A.jsx)(D,{item:e,workflows:t.workflows.data?.workflows??[],skills:t.skillList,workflow:t.workflow,onWorkflowChange:t.setWorkflow,selectedSkills:t.selectedSkills,onSkillsChange:t.setSelectedSkills,engine:t.engine,onEngineChange:t.setEngine,queuedRunId:t.queued.get(e.url)??null,onQueued:t.onQueued},e.url)}export{M as TaskGithubItemRoute};