@wjarka/cezarion 0.16.0 → 0.17.0

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 (907) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +594 -207
  3. package/dist/agent-config/account-identity.d.ts +3 -19
  4. package/dist/agent-config/account-identity.js +8 -5
  5. package/dist/agent-config/account-identity.js.map +1 -1
  6. package/dist/agent-config/catalog.d.ts +3 -14
  7. package/dist/agent-config/catalog.js.map +1 -1
  8. package/dist/agent-config/files.d.ts +2 -6
  9. package/dist/agent-config/files.js +2 -6
  10. package/dist/agent-config/files.js.map +1 -1
  11. package/dist/agent-config/model-settings/types.d.ts +1 -1
  12. package/dist/agent-config/seed.d.ts +11 -3
  13. package/dist/agent-config/seed.js +52 -48
  14. package/dist/agent-config/seed.js.map +1 -1
  15. package/dist/agent-config/service.js +3 -2
  16. package/dist/agent-config/service.js.map +1 -1
  17. package/dist/agent-config/validate.d.ts +1 -4
  18. package/dist/agent-config/validate.js.map +1 -1
  19. package/dist/application-update/helper.d.ts +2 -2
  20. package/dist/application-update/helper.js +7 -12
  21. package/dist/application-update/helper.js.map +1 -1
  22. package/dist/application-update/launcher.d.ts +4 -0
  23. package/dist/application-update/launcher.js +18 -12
  24. package/dist/application-update/launcher.js.map +1 -1
  25. package/dist/application-update/service.d.ts +3 -3
  26. package/dist/application-update/service.js +1 -1
  27. package/dist/application-update/service.js.map +1 -1
  28. package/dist/archive-on-merge-setting.d.ts +15 -0
  29. package/dist/archive-on-merge-setting.js +14 -0
  30. package/dist/archive-on-merge-setting.js.map +1 -0
  31. package/dist/artifacts/cli.d.ts +8 -0
  32. package/dist/artifacts/cli.js +21 -2
  33. package/dist/artifacts/cli.js.map +1 -1
  34. package/dist/artifacts/resolve.js +2 -1
  35. package/dist/artifacts/resolve.js.map +1 -1
  36. package/dist/artifacts/store.js.map +1 -1
  37. package/dist/automations/automation-cli.d.ts +59 -0
  38. package/dist/automations/automation-cli.js +509 -0
  39. package/dist/automations/automation-cli.js.map +1 -0
  40. package/dist/automations/builtin-skill.d.ts +7 -0
  41. package/dist/automations/builtin-skill.js +14 -0
  42. package/dist/automations/builtin-skill.js.map +1 -0
  43. package/dist/automations/github-baseline.d.ts +3 -0
  44. package/dist/automations/github-baseline.js +17 -0
  45. package/dist/automations/github-baseline.js.map +1 -0
  46. package/dist/automations/github-poller.d.ts +23 -4
  47. package/dist/automations/github-poller.js +157 -88
  48. package/dist/automations/github-poller.js.map +1 -1
  49. package/dist/automations/prompts.d.ts +12 -0
  50. package/dist/automations/prompts.js +160 -0
  51. package/dist/automations/prompts.js.map +1 -0
  52. package/dist/automations/schedule-runner.d.ts +43 -24
  53. package/dist/automations/schedule-runner.js +207 -20
  54. package/dist/automations/schedule-runner.js.map +1 -1
  55. package/dist/automations/scheduler.d.ts +10 -2
  56. package/dist/automations/scheduler.js +200 -54
  57. package/dist/automations/scheduler.js.map +1 -1
  58. package/dist/automations/service.d.ts +777 -0
  59. package/dist/automations/service.js +444 -0
  60. package/dist/automations/service.js.map +1 -0
  61. package/dist/automations/store.d.ts +17 -7
  62. package/dist/automations/store.js +88 -17
  63. package/dist/automations/store.js.map +1 -1
  64. package/dist/automations/task-template.d.ts +7 -2
  65. package/dist/automations/task-template.js +93 -44
  66. package/dist/automations/task-template.js.map +1 -1
  67. package/dist/automations/tool-adapter.d.ts +6 -0
  68. package/dist/automations/tool-adapter.js +108 -0
  69. package/dist/automations/tool-adapter.js.map +1 -0
  70. package/dist/automations/types.d.ts +1 -405
  71. package/dist/automations/types.js +1 -218
  72. package/dist/automations/types.js.map +1 -1
  73. package/dist/autosave-cleanup.d.ts +26 -0
  74. package/dist/autosave-cleanup.js +87 -0
  75. package/dist/autosave-cleanup.js.map +1 -0
  76. package/dist/autosave-git.d.ts +3 -0
  77. package/dist/autosave-git.js +67 -35
  78. package/dist/autosave-git.js.map +1 -1
  79. package/dist/autosave-group.d.ts +8 -0
  80. package/dist/autosave-group.js +61 -0
  81. package/dist/autosave-group.js.map +1 -0
  82. package/dist/autosave-holders.d.ts +31 -4
  83. package/dist/autosave-holders.js +92 -7
  84. package/dist/autosave-holders.js.map +1 -1
  85. package/dist/autosave-windows.d.ts +14 -0
  86. package/dist/autosave-windows.js +36 -2
  87. package/dist/autosave-windows.js.map +1 -1
  88. package/dist/ci-wait/client.d.ts +20 -3
  89. package/dist/ci-wait/client.js +40 -44
  90. package/dist/ci-wait/client.js.map +1 -1
  91. package/dist/ci-wait/controller.d.ts +622 -36
  92. package/dist/ci-wait/controller.js +152 -20
  93. package/dist/ci-wait/controller.js.map +1 -1
  94. package/dist/ci-wait/errors.d.ts +19 -0
  95. package/dist/ci-wait/errors.js +180 -2
  96. package/dist/ci-wait/errors.js.map +1 -1
  97. package/dist/ci-wait/github.d.ts +25 -1
  98. package/dist/ci-wait/github.js +76 -9
  99. package/dist/ci-wait/github.js.map +1 -1
  100. package/dist/ci-wait/mcp.d.ts +0 -1
  101. package/dist/ci-wait/mcp.js +0 -2
  102. package/dist/ci-wait/mcp.js.map +1 -1
  103. package/dist/ci-wait/supervisor.d.ts +7 -0
  104. package/dist/ci-wait/supervisor.js +113 -17
  105. package/dist/ci-wait/supervisor.js.map +1 -1
  106. package/dist/ci-wait/tools.d.ts +536 -16
  107. package/dist/ci-wait/tools.js +165 -20
  108. package/dist/ci-wait/tools.js.map +1 -1
  109. package/dist/config.d.ts +3 -17
  110. package/dist/config.js +4 -60
  111. package/dist/config.js.map +1 -1
  112. package/dist/contract/active-provider.d.ts +12 -0
  113. package/dist/contract/agent-profiles.d.ts +2 -10
  114. package/dist/contract/ask-schema.d.ts +22 -4
  115. package/dist/contract/ask.d.ts +6 -4
  116. package/dist/contract/attachments.d.ts +35 -0
  117. package/dist/contract/attention.d.ts +46 -37
  118. package/dist/contract/automation-requests.d.ts +308 -0
  119. package/dist/contract/automation-schedule.d.ts +40 -11
  120. package/dist/contract/automation-storage.d.ts +512 -0
  121. package/dist/contract/automations.d.ts +421 -40
  122. package/dist/contract/ci-wait.d.ts +41 -4
  123. package/dist/contract/config-requests.d.ts +36 -0
  124. package/dist/contract/conversations.d.ts +24 -10
  125. package/dist/contract/defined.d.ts +8 -0
  126. package/dist/contract/delegation.d.ts +312 -8
  127. package/dist/contract/events.d.ts +24 -3
  128. package/dist/contract/github-requests.d.ts +26 -0
  129. package/dist/contract/github.d.ts +60 -27
  130. package/dist/contract/handoff.d.ts +43 -0
  131. package/dist/contract/health.d.ts +2 -2
  132. package/dist/contract/image-path.d.ts +6 -0
  133. package/dist/contract/index.d.ts +31 -0
  134. package/dist/contract/index.js +3756 -1525
  135. package/dist/contract/live-coordination.d.ts +158 -0
  136. package/dist/contract/live-limits.d.ts +8 -0
  137. package/dist/contract/live.d.ts +123 -0
  138. package/dist/contract/pending-ask.d.ts +58 -0
  139. package/dist/contract/permissions.d.ts +54 -0
  140. package/dist/contract/preview.d.ts +33 -0
  141. package/dist/contract/project-limits.d.ts +33 -0
  142. package/dist/contract/projects.d.ts +486 -20
  143. package/dist/contract/provider-requests.d.ts +77 -0
  144. package/dist/contract/query-requests.d.ts +52 -0
  145. package/dist/contract/repo-requests.d.ts +12 -0
  146. package/dist/contract/run-labels.d.ts +8 -0
  147. package/dist/contract/run-limits.d.ts +8 -0
  148. package/dist/contract/run-predicates.d.ts +32 -0
  149. package/dist/contract/run-requests.d.ts +33 -0
  150. package/dist/contract/run-search.d.ts +193 -0
  151. package/dist/contract/runs.d.ts +2232 -1894
  152. package/dist/contract/scheduled-tasks.d.ts +187 -0
  153. package/dist/contract/skills.d.ts +22 -772
  154. package/dist/contract/team-skill-ref.d.ts +10 -0
  155. package/dist/{core → contract}/tool-display.d.ts +4 -10
  156. package/dist/contract/ui-state-requests.d.ts +60 -0
  157. package/dist/contract/version.d.ts +3 -0
  158. package/dist/contract/voice.d.ts +213 -0
  159. package/dist/contract/waits.d.ts +1204 -0
  160. package/dist/contract/workflow-file.d.ts +37 -0
  161. package/dist/contract/workflow-requests.d.ts +7 -0
  162. package/dist/contract/workflows.d.ts +1 -2
  163. package/dist/contract/workspace.d.ts +34 -82
  164. package/dist/contract/zoned-time.d.ts +2 -11
  165. package/dist/core/agent-env.d.ts +4 -16
  166. package/dist/core/agent-env.js +14 -16
  167. package/dist/core/agent-env.js.map +1 -1
  168. package/dist/core/agent-profiles.d.ts +28 -40
  169. package/dist/core/agent-profiles.js +56 -51
  170. package/dist/core/agent-profiles.js.map +1 -1
  171. package/dist/core/agent-runner.d.ts +88 -44
  172. package/dist/core/agent-runner.js +17 -18
  173. package/dist/core/agent-runner.js.map +1 -1
  174. package/dist/core/ask.d.ts +3 -0
  175. package/dist/core/ask.js +12 -0
  176. package/dist/core/ask.js.map +1 -1
  177. package/dist/core/backend-detect.js +16 -2
  178. package/dist/core/backend-detect.js.map +1 -1
  179. package/dist/core/claude-cli-runner.d.ts +23 -4
  180. package/dist/core/claude-cli-runner.js +280 -76
  181. package/dist/core/claude-cli-runner.js.map +1 -1
  182. package/dist/core/claude-model-catalog.d.ts +2 -10
  183. package/dist/core/claude-model-catalog.js +2 -10
  184. package/dist/core/claude-model-catalog.js.map +1 -1
  185. package/dist/core/claude-ui-mapper.d.ts +2 -2
  186. package/dist/core/claude-ui-mapper.js +94 -2
  187. package/dist/core/claude-ui-mapper.js.map +1 -1
  188. package/dist/core/codex-app-server-runner.d.ts +3 -4
  189. package/dist/core/codex-app-server-runner.js +146 -51
  190. package/dist/core/codex-app-server-runner.js.map +1 -1
  191. package/dist/core/codex-app-server-transport.d.ts +4 -3
  192. package/dist/core/codex-app-server-transport.js +11 -7
  193. package/dist/core/codex-app-server-transport.js.map +1 -1
  194. package/dist/core/codex-approvals.d.ts +12 -0
  195. package/dist/core/codex-approvals.js +161 -0
  196. package/dist/core/codex-approvals.js.map +1 -0
  197. package/dist/core/codex-permissions.d.ts +1 -1
  198. package/dist/core/codex-ui-mapper.js +45 -1
  199. package/dist/core/codex-ui-mapper.js.map +1 -1
  200. package/dist/core/cursor-acp-runner.d.ts +1 -1
  201. package/dist/core/cursor-acp-runner.js +39 -15
  202. package/dist/core/cursor-acp-runner.js.map +1 -1
  203. package/dist/core/cursor-cli-flags.d.ts +19 -0
  204. package/dist/core/cursor-cli-flags.js +47 -0
  205. package/dist/core/cursor-cli-flags.js.map +1 -0
  206. package/dist/core/cursor-model-catalog.d.ts +22 -0
  207. package/dist/core/cursor-model-catalog.js +53 -24
  208. package/dist/core/cursor-model-catalog.js.map +1 -1
  209. package/dist/core/cursor-print-capabilities.d.ts +16 -0
  210. package/dist/core/cursor-print-capabilities.js +141 -0
  211. package/dist/core/cursor-print-capabilities.js.map +1 -0
  212. package/dist/core/cursor-print-process.d.ts +31 -0
  213. package/dist/core/cursor-print-process.js +117 -0
  214. package/dist/core/cursor-print-process.js.map +1 -0
  215. package/dist/core/cursor-print-runner.d.ts +31 -0
  216. package/dist/core/cursor-print-runner.js +555 -0
  217. package/dist/core/cursor-print-runner.js.map +1 -0
  218. package/dist/core/cursor-print-tool-catalog.d.ts +10 -0
  219. package/dist/core/cursor-print-tool-catalog.js +91 -0
  220. package/dist/core/cursor-print-tool-catalog.js.map +1 -0
  221. package/dist/core/cursor-print-ui-mapper.d.ts +47 -0
  222. package/dist/core/cursor-print-ui-mapper.js +553 -0
  223. package/dist/core/cursor-print-ui-mapper.js.map +1 -0
  224. package/dist/core/cursor-runner.d.ts +24 -0
  225. package/dist/core/cursor-runner.js +149 -0
  226. package/dist/core/cursor-runner.js.map +1 -0
  227. package/dist/core/cursor-ui-mapper.js +5 -2
  228. package/dist/core/cursor-ui-mapper.js.map +1 -1
  229. package/dist/core/defined.d.ts +1 -0
  230. package/dist/core/defined.js +2 -0
  231. package/dist/core/defined.js.map +1 -0
  232. package/dist/core/hook-items.d.ts +14 -0
  233. package/dist/core/hook-items.js +13 -0
  234. package/dist/core/hook-items.js.map +1 -0
  235. package/dist/core/host-model-catalog.d.ts +2 -9
  236. package/dist/core/host-model-catalog.js +2 -9
  237. package/dist/core/host-model-catalog.js.map +1 -1
  238. package/dist/core/managed-session.js +15 -3
  239. package/dist/core/managed-session.js.map +1 -1
  240. package/dist/core/model-identity.d.ts +4 -21
  241. package/dist/core/model-identity.js.map +1 -1
  242. package/dist/core/model-presets.d.ts +2 -13
  243. package/dist/core/model-presets.js +2 -13
  244. package/dist/core/model-presets.js.map +1 -1
  245. package/dist/core/omp-model-catalog.js.map +1 -1
  246. package/dist/core/omp-runner.d.ts +6 -7
  247. package/dist/core/omp-runner.js +92 -33
  248. package/dist/core/omp-runner.js.map +1 -1
  249. package/dist/core/omp-ui-mapper.js +1 -1
  250. package/dist/core/omp-ui-mapper.js.map +1 -1
  251. package/dist/core/opencode-model-catalog.js.map +1 -1
  252. package/dist/core/opencode-permissions.d.ts +52 -0
  253. package/dist/core/opencode-permissions.js +101 -0
  254. package/dist/core/opencode-permissions.js.map +1 -0
  255. package/dist/core/opencode-server-runner.d.ts +10 -9
  256. package/dist/core/opencode-server-runner.js +286 -28
  257. package/dist/core/opencode-server-runner.js.map +1 -1
  258. package/dist/core/opencode-session-error.d.ts +15 -7
  259. package/dist/core/opencode-session-error.js +25 -9
  260. package/dist/core/opencode-session-error.js.map +1 -1
  261. package/dist/core/opencode-ui-mapper.js +2 -2
  262. package/dist/core/opencode-ui-mapper.js.map +1 -1
  263. package/dist/core/pi-model-catalog.js.map +1 -1
  264. package/dist/core/pi-runner.d.ts +12 -4
  265. package/dist/core/pi-runner.js +171 -63
  266. package/dist/core/pi-runner.js.map +1 -1
  267. package/dist/core/pi-ui-mapper.js +1 -1
  268. package/dist/core/pi-ui-mapper.js.map +1 -1
  269. package/dist/core/process-usage.d.ts +5 -0
  270. package/dist/core/process-usage.js +24 -4
  271. package/dist/core/process-usage.js.map +1 -1
  272. package/dist/core/provider-auth.d.ts +16 -107
  273. package/dist/core/provider-auth.js +16 -132
  274. package/dist/core/provider-auth.js.map +1 -1
  275. package/dist/core/runner-factory.d.ts +4 -1
  276. package/dist/core/runner-factory.js +3 -3
  277. package/dist/core/runner-factory.js.map +1 -1
  278. package/dist/core/runner-runtime.d.ts +22 -0
  279. package/dist/core/runner-runtime.js +66 -5
  280. package/dist/core/runner-runtime.js.map +1 -1
  281. package/dist/core/runner-tool-grants.d.ts +21 -0
  282. package/dist/core/runner-tool-grants.js +64 -0
  283. package/dist/core/runner-tool-grants.js.map +1 -0
  284. package/dist/core/secret-redaction.d.ts +3 -20
  285. package/dist/core/secret-redaction.js +3 -20
  286. package/dist/core/secret-redaction.js.map +1 -1
  287. package/dist/core/session-process.d.ts +22 -2
  288. package/dist/core/session-process.js +170 -12
  289. package/dist/core/session-process.js.map +1 -1
  290. package/dist/core/shell-env.d.ts +2 -15
  291. package/dist/core/shell-env.js +2 -15
  292. package/dist/core/shell-env.js.map +1 -1
  293. package/dist/core/ui-events.d.ts +60 -47
  294. package/dist/core/ui-events.js +0 -23
  295. package/dist/core/ui-events.js.map +1 -1
  296. package/dist/core/usage-limit.js.map +1 -1
  297. package/dist/data-gitignore.js +3 -1
  298. package/dist/data-gitignore.js.map +1 -1
  299. package/dist/delegation/capacity.d.ts +4 -8
  300. package/dist/delegation/capacity.js +4 -8
  301. package/dist/delegation/capacity.js.map +1 -1
  302. package/dist/delegation/cli.js +123 -21
  303. package/dist/delegation/cli.js.map +1 -1
  304. package/dist/delegation/context.d.ts +19 -3
  305. package/dist/delegation/context.js +217 -22
  306. package/dist/delegation/context.js.map +1 -1
  307. package/dist/delegation/conversations.d.ts +4 -3
  308. package/dist/delegation/conversations.js +7 -5
  309. package/dist/delegation/conversations.js.map +1 -1
  310. package/dist/delegation/destroy-observation.d.ts +1 -1
  311. package/dist/delegation/destroy-observation.js.map +1 -1
  312. package/dist/delegation/effort.js.map +1 -1
  313. package/dist/delegation/execution-identity.d.ts +1 -1
  314. package/dist/delegation/execution-identity.js +41 -7
  315. package/dist/delegation/execution-identity.js.map +1 -1
  316. package/dist/delegation/idle-test-app.d.ts +4 -0
  317. package/dist/delegation/idle-test-app.js +174 -0
  318. package/dist/delegation/idle-test-app.js.map +1 -0
  319. package/dist/delegation/input.js.map +1 -1
  320. package/dist/delegation/park-notice.d.ts +42 -0
  321. package/dist/delegation/park-notice.js +71 -0
  322. package/dist/delegation/park-notice.js.map +1 -0
  323. package/dist/delegation/policy.d.ts +2 -0
  324. package/dist/delegation/policy.js +9 -1
  325. package/dist/delegation/policy.js.map +1 -1
  326. package/dist/delegation/process-liveness.d.ts +10 -15
  327. package/dist/delegation/process-liveness.js +11 -35
  328. package/dist/delegation/process-liveness.js.map +1 -1
  329. package/dist/delegation/provision.js +21 -19
  330. package/dist/delegation/provision.js.map +1 -1
  331. package/dist/delegation/questions.d.ts +3 -1
  332. package/dist/delegation/questions.js +10 -5
  333. package/dist/delegation/questions.js.map +1 -1
  334. package/dist/delegation/readiness.d.ts +2 -2
  335. package/dist/delegation/results.d.ts +4 -1
  336. package/dist/delegation/results.js +49 -18
  337. package/dist/delegation/results.js.map +1 -1
  338. package/dist/delegation/retry-backoff.d.ts +8 -0
  339. package/dist/delegation/retry-backoff.js +8 -0
  340. package/dist/delegation/retry-backoff.js.map +1 -1
  341. package/dist/delegation/routes.d.ts +114 -30
  342. package/dist/delegation/routes.js +4 -1
  343. package/dist/delegation/routes.js.map +1 -1
  344. package/dist/delegation/scratch-cleanup.d.ts +4 -5
  345. package/dist/delegation/scratch-cleanup.js +10 -8
  346. package/dist/delegation/scratch-cleanup.js.map +1 -1
  347. package/dist/delegation/service.d.ts +12 -4
  348. package/dist/delegation/service.js +76 -28
  349. package/dist/delegation/service.js.map +1 -1
  350. package/dist/delegation/transport.d.ts +154 -70
  351. package/dist/delegation/wait.d.ts +11 -0
  352. package/dist/delegation/wait.js +24 -0
  353. package/dist/delegation/wait.js.map +1 -1
  354. package/dist/delegation/windows-test-app.d.ts +5 -0
  355. package/dist/delegation/windows-test-app.js +63 -0
  356. package/dist/delegation/windows-test-app.js.map +1 -0
  357. package/dist/delegation/windows-workspace-identity.d.ts +3 -0
  358. package/dist/delegation/windows-workspace-identity.js +22 -0
  359. package/dist/delegation/windows-workspace-identity.js.map +1 -0
  360. package/dist/delegation/workspace.d.ts +5 -10
  361. package/dist/delegation/workspace.js +136 -75
  362. package/dist/delegation/workspace.js.map +1 -1
  363. package/dist/detached-process.d.ts +103 -0
  364. package/dist/detached-process.js +301 -0
  365. package/dist/detached-process.js.map +1 -0
  366. package/dist/discovery/catalog.d.ts +2 -1
  367. package/dist/discovery/catalog.js.map +1 -1
  368. package/dist/discovery/cli.js +3 -1
  369. package/dist/discovery/cli.js.map +1 -1
  370. package/dist/git-diff-base.d.ts +6 -61
  371. package/dist/git-diff-base.js +6 -70
  372. package/dist/git-diff-base.js.map +1 -1
  373. package/dist/git-index-copy.d.ts +4 -0
  374. package/dist/git-index-copy.js +10 -0
  375. package/dist/git-index-copy.js.map +1 -0
  376. package/dist/git-worktree-lock.d.ts +2 -4
  377. package/dist/git-worktree-lock.js +2 -4
  378. package/dist/git-worktree-lock.js.map +1 -1
  379. package/dist/git-worktree-release.d.ts +2 -2
  380. package/dist/git-worktree-release.js.map +1 -1
  381. package/dist/git-worktree.d.ts +47 -76
  382. package/dist/git-worktree.js +240 -94
  383. package/dist/git-worktree.js.map +1 -1
  384. package/dist/handoff.d.ts +51 -41
  385. package/dist/handoff.js +130 -78
  386. package/dist/handoff.js.map +1 -1
  387. package/dist/index.js +60 -39
  388. package/dist/index.js.map +1 -1
  389. package/dist/merge-observations.d.ts +13 -0
  390. package/dist/merge-observations.js +55 -0
  391. package/dist/merge-observations.js.map +1 -0
  392. package/dist/open-url.js +4 -14
  393. package/dist/open-url.js.map +1 -1
  394. package/dist/paths.d.ts +10 -13
  395. package/dist/paths.js +36 -17
  396. package/dist/paths.js.map +1 -1
  397. package/dist/planner.d.ts +2 -1
  398. package/dist/planner.js +9 -6
  399. package/dist/planner.js.map +1 -1
  400. package/dist/preview/agent-address.d.ts +34 -0
  401. package/dist/preview/agent-address.js +51 -0
  402. package/dist/preview/agent-address.js.map +1 -0
  403. package/dist/preview/agent-marker.d.ts +17 -0
  404. package/dist/preview/agent-marker.js +71 -0
  405. package/dist/preview/agent-marker.js.map +1 -0
  406. package/dist/preview/cdp-proxy.d.ts +54 -0
  407. package/dist/preview/cdp-proxy.js +151 -0
  408. package/dist/preview/cdp-proxy.js.map +1 -0
  409. package/dist/preview/cdp.d.ts +39 -3
  410. package/dist/preview/cdp.js +155 -57
  411. package/dist/preview/cdp.js.map +1 -1
  412. package/dist/preview/chromium.d.ts +18 -6
  413. package/dist/preview/chromium.js +112 -25
  414. package/dist/preview/chromium.js.map +1 -1
  415. package/dist/preview/dev-server.d.ts +1 -1
  416. package/dist/preview/dev-server.js +20 -44
  417. package/dist/preview/dev-server.js.map +1 -1
  418. package/dist/preview/host.d.ts +70 -3
  419. package/dist/preview/host.js +314 -28
  420. package/dist/preview/host.js.map +1 -1
  421. package/dist/preview/registration.d.ts +10 -5
  422. package/dist/preview/registration.js +2 -0
  423. package/dist/preview/registration.js.map +1 -1
  424. package/dist/preview/session.d.ts +2 -0
  425. package/dist/preview/session.js +10 -0
  426. package/dist/preview/session.js.map +1 -1
  427. package/dist/process-wait/exit-file.d.ts +29 -0
  428. package/dist/process-wait/exit-file.js +67 -0
  429. package/dist/process-wait/exit-file.js.map +1 -0
  430. package/dist/process-wait/supervisor.d.ts +30 -0
  431. package/dist/process-wait/supervisor.js +71 -0
  432. package/dist/process-wait/supervisor.js.map +1 -0
  433. package/dist/release/snapshot.d.ts +6 -6
  434. package/dist/runs/agent-tmpdir.d.ts +51 -36
  435. package/dist/runs/agent-tmpdir.js +389 -132
  436. package/dist/runs/agent-tmpdir.js.map +1 -1
  437. package/dist/runs/auto-name.d.ts +6 -6
  438. package/dist/runs/auto-name.js +1 -1
  439. package/dist/runs/auto-name.js.map +1 -1
  440. package/dist/runs/client-request.d.ts +3 -3
  441. package/dist/runs/client-request.js +3 -3
  442. package/dist/runs/client-request.js.map +1 -1
  443. package/dist/runs/delegation-state.d.ts +11 -2
  444. package/dist/runs/delegation-state.js.map +1 -1
  445. package/dist/runs/event-history-agent-context.d.ts +14 -0
  446. package/dist/runs/event-history-agent-context.js +105 -0
  447. package/dist/runs/event-history-agent-context.js.map +1 -0
  448. package/dist/runs/event-history-context.d.ts +15 -0
  449. package/dist/runs/event-history-context.js +109 -0
  450. package/dist/runs/event-history-context.js.map +1 -0
  451. package/dist/runs/event-history.d.ts +4 -1
  452. package/dist/runs/event-history.js +29 -130
  453. package/dist/runs/event-history.js.map +1 -1
  454. package/dist/runs/history-stream.d.ts +2 -0
  455. package/dist/runs/history-stream.js +62 -0
  456. package/dist/runs/history-stream.js.map +1 -0
  457. package/dist/runs/legacy-index.d.ts +6 -19
  458. package/dist/runs/legacy-index.js +6 -19
  459. package/dist/runs/legacy-index.js.map +1 -1
  460. package/dist/runs/live-item-snapshots.d.ts +13 -0
  461. package/dist/runs/live-item-snapshots.js +79 -0
  462. package/dist/runs/live-item-snapshots.js.map +1 -0
  463. package/dist/runs/loaded-run-healing.d.ts +3 -0
  464. package/dist/runs/loaded-run-healing.js +17 -0
  465. package/dist/runs/loaded-run-healing.js.map +1 -0
  466. package/dist/runs/outcome-commit.d.ts +98 -0
  467. package/dist/runs/outcome-commit.js +132 -0
  468. package/dist/runs/outcome-commit.js.map +1 -0
  469. package/dist/runs/pull-requests.d.ts +14 -0
  470. package/dist/runs/pull-requests.js +96 -0
  471. package/dist/runs/pull-requests.js.map +1 -0
  472. package/dist/runs/raw-record.d.ts +3 -15
  473. package/dist/runs/raw-record.js +3 -15
  474. package/dist/runs/raw-record.js.map +1 -1
  475. package/dist/runs/retention.d.ts +2 -2
  476. package/dist/runs/retention.js +7 -0
  477. package/dist/runs/retention.js.map +1 -1
  478. package/dist/runs/review-gate.d.ts +1 -1
  479. package/dist/runs/review-gate.js.map +1 -1
  480. package/dist/runs/run-claims.d.ts +2 -9
  481. package/dist/runs/run-claims.js.map +1 -1
  482. package/dist/runs/run-database.d.ts +29 -34
  483. package/dist/runs/run-database.js +124 -46
  484. package/dist/runs/run-database.js.map +1 -1
  485. package/dist/runs/run-index.d.ts +6 -25
  486. package/dist/runs/run-index.js +25 -38
  487. package/dist/runs/run-index.js.map +1 -1
  488. package/dist/runs/run-row.d.ts +5 -34
  489. package/dist/runs/run-row.js +13 -38
  490. package/dist/runs/run-row.js.map +1 -1
  491. package/dist/runs/store.d.ts +1597 -744
  492. package/dist/runs/store.js +1231 -739
  493. package/dist/runs/store.js.map +1 -1
  494. package/dist/runs/task-markers.d.ts +1 -0
  495. package/dist/runs/task-markers.js +5 -1
  496. package/dist/runs/task-markers.js.map +1 -1
  497. package/dist/runs/task-refs.d.ts +3 -3
  498. package/dist/runs/transcript-facts-fold.d.ts +64 -0
  499. package/dist/runs/transcript-facts-fold.js +109 -0
  500. package/dist/runs/transcript-facts-fold.js.map +1 -0
  501. package/dist/runs/transcript-facts-load.d.ts +11 -0
  502. package/dist/runs/transcript-facts-load.js +66 -0
  503. package/dist/runs/transcript-facts-load.js.map +1 -0
  504. package/dist/runs/transcript-facts-queue.d.ts +30 -0
  505. package/dist/runs/transcript-facts-queue.js +227 -0
  506. package/dist/runs/transcript-facts-queue.js.map +1 -0
  507. package/dist/runs/transcript-facts-worker.d.ts +15 -0
  508. package/dist/runs/transcript-facts-worker.js +26 -0
  509. package/dist/runs/transcript-facts-worker.js.map +1 -0
  510. package/dist/runs/transcript-facts.d.ts +13 -51
  511. package/dist/runs/transcript-facts.js +86 -202
  512. package/dist/runs/transcript-facts.js.map +1 -1
  513. package/dist/runs/ui-event-sink.d.ts +5 -30
  514. package/dist/runs/ui-event-sink.js +8 -30
  515. package/dist/runs/ui-event-sink.js.map +1 -1
  516. package/dist/runs/webhook.d.ts +104 -38
  517. package/dist/runs/webhook.js +180 -77
  518. package/dist/runs/webhook.js.map +1 -1
  519. package/dist/server/app-type.d.ts +2 -17
  520. package/dist/server/archive-on-merge.d.ts +35 -0
  521. package/dist/server/archive-on-merge.js +202 -0
  522. package/dist/server/archive-on-merge.js.map +1 -0
  523. package/dist/server/capabilities.d.ts +3 -15
  524. package/dist/server/capabilities.js +6 -19
  525. package/dist/server/capabilities.js.map +1 -1
  526. package/dist/server/checkout-progress.d.ts +10 -0
  527. package/dist/server/checkout-progress.js +27 -0
  528. package/dist/server/checkout-progress.js.map +1 -0
  529. package/dist/server/checkout.d.ts +10 -19
  530. package/dist/server/checkout.js +15 -45
  531. package/dist/server/checkout.js.map +1 -1
  532. package/dist/server/cockpit-ownership.d.ts +2 -0
  533. package/dist/server/cockpit-ownership.js +9 -0
  534. package/dist/server/cockpit-ownership.js.map +1 -1
  535. package/dist/server/cold-repo-handles.d.ts +2 -7
  536. package/dist/server/cold-repo-handles.js +2 -7
  537. package/dist/server/cold-repo-handles.js.map +1 -1
  538. package/dist/server/completion-actions.d.ts +30 -0
  539. package/dist/server/completion-actions.js +204 -0
  540. package/dist/server/completion-actions.js.map +1 -0
  541. package/dist/server/create-project.d.ts +71 -0
  542. package/dist/server/create-project.js +448 -0
  543. package/dist/server/create-project.js.map +1 -0
  544. package/dist/server/forge/github-filters.d.ts +7 -1
  545. package/dist/server/forge/github-filters.js +66 -51
  546. package/dist/server/forge/github-filters.js.map +1 -1
  547. package/dist/server/forge/github-merge-requirements.d.ts +18 -0
  548. package/dist/server/forge/github-merge-requirements.js +137 -0
  549. package/dist/server/forge/github-merge-requirements.js.map +1 -0
  550. package/dist/server/forge/github.d.ts +98 -111
  551. package/dist/server/forge/github.js +625 -306
  552. package/dist/server/forge/github.js.map +1 -1
  553. package/dist/server/forge/types.d.ts +25 -22
  554. package/dist/server/fs-browse.d.ts +3 -28
  555. package/dist/server/fs-browse.js.map +1 -1
  556. package/dist/server/git-changes.d.ts +5 -15
  557. package/dist/server/git-changes.js +3 -50
  558. package/dist/server/git-changes.js.map +1 -1
  559. package/dist/server/git.d.ts +3 -1
  560. package/dist/server/git.js +12 -0
  561. package/dist/server/git.js.map +1 -1
  562. package/dist/server/github.d.ts +1 -1
  563. package/dist/server/github.js +1 -1
  564. package/dist/server/github.js.map +1 -1
  565. package/dist/server/launch-key.d.ts +2 -4
  566. package/dist/server/launch-key.js +2 -4
  567. package/dist/server/launch-key.js.map +1 -1
  568. package/dist/server/live-routes.d.ts +68 -0
  569. package/dist/server/live-routes.js +147 -0
  570. package/dist/server/live-routes.js.map +1 -0
  571. package/dist/server/open-in-app.d.ts +4 -13
  572. package/dist/server/open-in-app.js +5 -41
  573. package/dist/server/open-in-app.js.map +1 -1
  574. package/dist/server/open-in-targets.d.ts +42 -0
  575. package/dist/server/open-in-targets.js +110 -0
  576. package/dist/server/open-in-targets.js.map +1 -0
  577. package/dist/server/open-in-terminal.d.ts +3 -0
  578. package/dist/server/open-in-terminal.js +6 -26
  579. package/dist/server/open-in-terminal.js.map +1 -1
  580. package/dist/server/preview-cdp-socket.d.ts +21 -0
  581. package/dist/server/preview-cdp-socket.js +112 -0
  582. package/dist/server/preview-cdp-socket.js.map +1 -0
  583. package/dist/server/preview-socket.d.ts +11 -11
  584. package/dist/server/preview-socket.js +22 -22
  585. package/dist/server/preview-socket.js.map +1 -1
  586. package/dist/server/preview-sockets.d.ts +14 -0
  587. package/dist/server/preview-sockets.js +18 -0
  588. package/dist/server/preview-sockets.js.map +1 -0
  589. package/dist/server/project-context.d.ts +54 -18
  590. package/dist/server/project-context.js +178 -5
  591. package/dist/server/project-context.js.map +1 -1
  592. package/dist/server/provider-action-gate.d.ts +0 -2
  593. package/dist/server/provider-action-gate.js +0 -21
  594. package/dist/server/provider-action-gate.js.map +1 -1
  595. package/dist/server/provider-auth-runtime.d.ts +3 -18
  596. package/dist/server/provider-auth-runtime.js +3 -18
  597. package/dist/server/provider-auth-runtime.js.map +1 -1
  598. package/dist/server/repo-branches.d.ts +3 -9
  599. package/dist/server/repo-branches.js +6 -22
  600. package/dist/server/repo-branches.js.map +1 -1
  601. package/dist/server/run-event-feed.d.ts +20 -0
  602. package/dist/server/run-event-feed.js +190 -0
  603. package/dist/server/run-event-feed.js.map +1 -0
  604. package/dist/server/server-deps.d.ts +37 -0
  605. package/dist/server/server-deps.js +114 -0
  606. package/dist/server/server-deps.js.map +1 -0
  607. package/dist/server/server.d.ts +14082 -11998
  608. package/dist/server/server.js +785 -1647
  609. package/dist/server/server.js.map +1 -1
  610. package/dist/server/start-run-options.d.ts +82 -0
  611. package/dist/server/start-run-options.js +111 -0
  612. package/dist/server/start-run-options.js.map +1 -0
  613. package/dist/server/validators.d.ts +3 -29
  614. package/dist/server/validators.js +1 -2
  615. package/dist/server/validators.js.map +1 -1
  616. package/dist/server/ws.d.ts +3 -23
  617. package/dist/server/ws.js +3 -23
  618. package/dist/server/ws.js.map +1 -1
  619. package/dist/server-install/engine.d.ts +6 -9
  620. package/dist/server-install/engine.js +2 -9
  621. package/dist/server-install/engine.js.map +1 -1
  622. package/dist/server-install/platforms/ubuntu-vps.d.ts +1 -1
  623. package/dist/server-install/state.d.ts +2 -4
  624. package/dist/server-install/state.js +2 -4
  625. package/dist/server-install/state.js.map +1 -1
  626. package/dist/server-install/steps.d.ts +2 -5
  627. package/dist/server-install/steps.js +3 -6
  628. package/dist/server-install/steps.js.map +1 -1
  629. package/dist/server-install/types.d.ts +3 -6
  630. package/dist/server-install/types.js +2 -5
  631. package/dist/server-install/types.js.map +1 -1
  632. package/dist/server-install/ui.d.ts +2 -8
  633. package/dist/server-install/ui.js +3 -3
  634. package/dist/server-install/ui.js.map +1 -1
  635. package/dist/session-context.d.ts +64 -0
  636. package/dist/session-context.js +264 -0
  637. package/dist/session-context.js.map +1 -0
  638. package/dist/skills-provision.d.ts +62 -0
  639. package/dist/skills-provision.js +325 -0
  640. package/dist/skills-provision.js.map +1 -0
  641. package/dist/skills-remote.d.ts +29 -27
  642. package/dist/skills-remote.js +236 -100
  643. package/dist/skills-remote.js.map +1 -1
  644. package/dist/skills.d.ts +25 -36
  645. package/dist/skills.js +43 -54
  646. package/dist/skills.js.map +1 -1
  647. package/dist/subcommands.d.ts +11 -0
  648. package/dist/subcommands.js +24 -0
  649. package/dist/subcommands.js.map +1 -0
  650. package/dist/task-cli/cli.js +78 -25
  651. package/dist/task-cli/cli.js.map +1 -1
  652. package/dist/task-cli/discovery.d.ts +4 -2
  653. package/dist/task-cli/discovery.js +14 -13
  654. package/dist/task-cli/discovery.js.map +1 -1
  655. package/dist/task-cli/hint.d.ts +20 -0
  656. package/dist/task-cli/hint.js +14 -0
  657. package/dist/task-cli/hint.js.map +1 -0
  658. package/dist/task-cli/http.d.ts +1 -0
  659. package/dist/task-cli/http.js +3 -1
  660. package/dist/task-cli/http.js.map +1 -1
  661. package/dist/task-cli/projections.d.ts +14 -11
  662. package/dist/task-cli/projections.js +15 -11
  663. package/dist/task-cli/projections.js.map +1 -1
  664. package/dist/task-cli/watch.d.ts +18 -10
  665. package/dist/task-cli/watch.js +128 -20
  666. package/dist/task-cli/watch.js.map +1 -1
  667. package/dist/ui-state.d.ts +17 -3
  668. package/dist/ui-state.js +56 -9
  669. package/dist/ui-state.js.map +1 -1
  670. package/dist/update-check.d.ts +0 -10
  671. package/dist/update-check.js +1 -16
  672. package/dist/update-check.js.map +1 -1
  673. package/dist/voice/decide.d.ts +32 -0
  674. package/dist/voice/decide.js +297 -0
  675. package/dist/voice/decide.js.map +1 -0
  676. package/dist/voice/decision-log.d.ts +52 -0
  677. package/dist/voice/decision-log.js +107 -0
  678. package/dist/voice/decision-log.js.map +1 -0
  679. package/dist/voice/engine.d.ts +119 -0
  680. package/dist/voice/engine.js +60 -0
  681. package/dist/voice/engine.js.map +1 -0
  682. package/dist/voice/fake-engine.d.ts +10 -0
  683. package/dist/voice/fake-engine.js +192 -0
  684. package/dist/voice/fake-engine.js.map +1 -0
  685. package/dist/voice/jev-engine.d.ts +17 -0
  686. package/dist/voice/jev-engine.js +110 -0
  687. package/dist/voice/jev-engine.js.map +1 -0
  688. package/dist/voice/pending-ask.d.ts +17 -0
  689. package/dist/voice/pending-ask.js +50 -0
  690. package/dist/voice/pending-ask.js.map +1 -0
  691. package/dist/voice/routes.d.ts +115 -0
  692. package/dist/voice/routes.js +91 -0
  693. package/dist/voice/routes.js.map +1 -0
  694. package/dist/voice/sentence.d.ts +21 -0
  695. package/dist/voice/sentence.js +61 -0
  696. package/dist/voice/sentence.js.map +1 -0
  697. package/dist/voice/thresholds.d.ts +28 -0
  698. package/dist/voice/thresholds.js +29 -0
  699. package/dist/voice/thresholds.js.map +1 -0
  700. package/dist/webhooks/cli.d.ts +18 -0
  701. package/dist/webhooks/cli.js +145 -0
  702. package/dist/webhooks/cli.js.map +1 -0
  703. package/dist/webhooks/prompt.d.ts +5 -0
  704. package/dist/webhooks/prompt.js +26 -0
  705. package/dist/webhooks/prompt.js.map +1 -0
  706. package/dist/workflows/active-run.d.ts +167 -0
  707. package/dist/workflows/active-run.js +21 -0
  708. package/dist/workflows/active-run.js.map +1 -0
  709. package/dist/workflows/continuation-admission.d.ts +913 -0
  710. package/dist/workflows/continuation-admission.js +265 -0
  711. package/dist/workflows/continuation-admission.js.map +1 -0
  712. package/dist/workflows/execution-account.d.ts +13 -0
  713. package/dist/workflows/execution-account.js +18 -0
  714. package/dist/workflows/execution-account.js.map +1 -0
  715. package/dist/workflows/input-acknowledgement.d.ts +152 -0
  716. package/dist/workflows/input-acknowledgement.js +38 -0
  717. package/dist/workflows/input-acknowledgement.js.map +1 -0
  718. package/dist/workflows/line-order.d.ts +5 -0
  719. package/dist/workflows/line-order.js +25 -0
  720. package/dist/workflows/line-order.js.map +1 -0
  721. package/dist/workflows/outcome-batches.d.ts +20 -0
  722. package/dist/workflows/outcome-batches.js +25 -0
  723. package/dist/workflows/outcome-batches.js.map +1 -0
  724. package/dist/workflows/question-routing.d.ts +8 -0
  725. package/dist/workflows/question-routing.js +18 -0
  726. package/dist/workflows/question-routing.js.map +1 -0
  727. package/dist/workflows/run-scheduling.d.ts +35 -0
  728. package/dist/workflows/run-scheduling.js +61 -0
  729. package/dist/workflows/run-scheduling.js.map +1 -0
  730. package/dist/workflows/run-states.d.ts +190 -0
  731. package/dist/workflows/run-states.js +295 -0
  732. package/dist/workflows/run-states.js.map +1 -0
  733. package/dist/workflows/run.d.ts +1296 -278
  734. package/dist/workflows/run.js +5730 -3265
  735. package/dist/workflows/run.js.map +1 -1
  736. package/dist/workflows/turn-end.d.ts +116 -0
  737. package/dist/workflows/turn-end.js +68 -0
  738. package/dist/workflows/turn-end.js.map +1 -0
  739. package/dist/workflows/types.d.ts +35 -130
  740. package/dist/workflows/types.js +47 -100
  741. package/dist/workflows/types.js.map +1 -1
  742. package/dist/workflows/waits.d.ts +74 -0
  743. package/dist/workflows/waits.js +197 -0
  744. package/dist/workflows/waits.js.map +1 -0
  745. package/dist/workspace/agent-accounts.d.ts +5 -38
  746. package/dist/workspace/agent-accounts.js +14 -40
  747. package/dist/workspace/agent-accounts.js.map +1 -1
  748. package/dist/workspace/agent-profiles.d.ts +40 -16
  749. package/dist/workspace/agent-profiles.js +77 -17
  750. package/dist/workspace/agent-profiles.js.map +1 -1
  751. package/dist/workspace/config.d.ts +48 -49
  752. package/dist/workspace/config.js +68 -72
  753. package/dist/workspace/config.js.map +1 -1
  754. package/dist/workspace/migrations.d.ts +3 -13
  755. package/dist/workspace/migrations.js.map +1 -1
  756. package/dist/workspace/projects-cli.d.ts +1 -1
  757. package/dist/workspace/projects-cli.js.map +1 -1
  758. package/dist/workspace/projects.d.ts +15 -18
  759. package/dist/workspace/projects.js +20 -16
  760. package/dist/workspace/projects.js.map +1 -1
  761. package/dist/workspace/semaphore.d.ts +11 -45
  762. package/dist/workspace/semaphore.js +6 -18
  763. package/dist/workspace/semaphore.js.map +1 -1
  764. package/dist/workspace/ui-state.d.ts +6 -4
  765. package/dist/workspace/ui-state.js +6 -4
  766. package/dist/workspace/ui-state.js.map +1 -1
  767. package/dist/workspace/webhooks.d.ts +40 -0
  768. package/dist/workspace/webhooks.js +146 -0
  769. package/dist/workspace/webhooks.js.map +1 -0
  770. package/dist/worktree-manifest.d.ts +165 -0
  771. package/dist/worktree-manifest.js +530 -0
  772. package/dist/worktree-manifest.js.map +1 -0
  773. package/dist/worktree-setup.js.map +1 -1
  774. package/package.json +6 -5
  775. package/scripts/benchmark-run-store-fixture.ts +7 -3
  776. package/scripts/check-pack.mjs +3 -1
  777. package/scripts/inline-contract.mjs +80 -27
  778. package/scripts/install-as-command.mjs +3 -1
  779. package/scripts/measure-transcript-facts-health.mjs +87 -0
  780. package/scripts/measure-transcript-facts-lag.mjs +68 -0
  781. package/scripts/mock-ci-tool.mjs +49 -6
  782. package/scripts/mock-claude-model-refusal.mjs +42 -0
  783. package/scripts/mock-claude.mjs +833 -591
  784. package/scripts/mock-codex-app-server.mjs +785 -418
  785. package/scripts/mock-cursor-acp.mjs +296 -125
  786. package/scripts/mock-cursor-print.mjs +256 -0
  787. package/scripts/mock-deferred-turn-start.mjs +16 -0
  788. package/scripts/mock-delivery-control.d.mts +23 -0
  789. package/scripts/mock-delivery-control.mjs +80 -0
  790. package/scripts/mock-env-record.mjs +11 -0
  791. package/scripts/mock-failure-control.d.mts +13 -0
  792. package/scripts/mock-failure-control.mjs +68 -0
  793. package/scripts/mock-multi-pr.mjs +7 -0
  794. package/scripts/mock-nudge.mjs +45 -0
  795. package/scripts/mock-omp-rpc.mjs +429 -255
  796. package/scripts/mock-opencode-serve.mjs +972 -557
  797. package/scripts/mock-pi-rpc.mjs +558 -331
  798. package/scripts/mock-runner-crash.mjs +18 -2
  799. package/scripts/mock-session-context.d.mts +5 -0
  800. package/scripts/mock-session-context.mjs +56 -0
  801. package/scripts/mock-silent-tail.mjs +10 -3
  802. package/scripts/pi-default-tools.mjs +22 -0
  803. package/scripts/pi-project-skills.mjs +59 -0
  804. package/scripts/probe-cursor-print.mjs +627 -0
  805. package/scripts/transcript-facts-fixture.mjs +53 -0
  806. package/scripts/voice-replay.ts +50 -0
  807. package/scripts/windows-workspace-identity.cs +208 -0
  808. package/scripts/windows-workspace-identity.ps1 +10 -0
  809. package/web/dist/assets/alert-dialog-DfctKUMw.js +1 -0
  810. package/web/dist/assets/button-CeupvoKG.js +41 -0
  811. package/web/dist/assets/centered-state-hDsyXrnH.js +1 -0
  812. package/web/dist/assets/cez-idle-D3aj_9lp.js +1 -0
  813. package/web/dist/assets/diff-BnIXZK3i2.js +3 -0
  814. package/web/dist/assets/diff-controls-GewpW9aF.js +1 -0
  815. package/web/dist/assets/diff-view-Byo7gpvW.js +11 -0
  816. package/web/dist/assets/dropdown-menu-COj_J5wd.js +6 -0
  817. package/web/dist/assets/eye-B8okNWXU.js +1 -0
  818. package/web/dist/assets/git-toolbar-DY0z0n4S.js +1 -0
  819. package/web/dist/assets/github-DwU6ALRK.js +1 -0
  820. package/web/dist/assets/{image-preview-FOEfqpZP.js → image-preview-C_t9q45f.js} +1 -1
  821. package/web/dist/assets/index-BOfE8pyD.js +34 -0
  822. package/web/dist/assets/index-D9HpsmdW.css +1 -0
  823. package/web/dist/assets/live-protocol-Uce2NwEX.js +64 -0
  824. package/web/dist/assets/live-worker-BizfZSoh.ts +33 -0
  825. package/web/dist/assets/markdown-BBDDg-4t.js +1 -0
  826. package/web/dist/assets/nav-row-styles-AoIhhIwf.js +1 -0
  827. package/web/dist/assets/popover-D56fhiXj.js +1 -0
  828. package/web/dist/assets/preview-pane-connected-BmVqfSU5.js +3 -0
  829. package/web/dist/assets/reference-chip-gQNk-4jc.js +1 -0
  830. package/web/dist/assets/repo-git-B5ECDUuv.js +1 -0
  831. package/web/dist/assets/{repo-git-CoKp-g9K.css → repo-git-DVXNOJDT.css} +1 -1
  832. package/web/dist/assets/run-header-C0Y1NvEM.js +2 -0
  833. package/web/dist/assets/run-header-CC7VUTg9.css +1 -0
  834. package/web/dist/assets/skills-DUeTkZ9z.js +1 -0
  835. package/web/dist/assets/status-dot-1PR0i69P.js +1 -0
  836. package/web/dist/assets/tab-link-DmWk4l5O.js +1 -0
  837. package/web/dist/assets/task-changes-DKZXuW89.js +1 -0
  838. package/web/dist/assets/task-commits-BZ6KxWdF.js +1 -0
  839. package/web/dist/assets/task-files-DlF7Apcn.js +2 -0
  840. package/web/dist/assets/task-github-item-CVPo3geZ.js +1 -0
  841. package/web/dist/assets/task-thread-DtQ6uGfQ.css +1 -0
  842. package/web/dist/assets/task-thread-mm4-ECyo.js +9 -0
  843. package/web/dist/assets/thread-state-CIw2BlhT.js +4 -0
  844. package/web/dist/assets/use-hand-to-agent-state-BCDjzHnG.js +1 -0
  845. package/web/dist/assets/use-hand-to-agent-state-C7esPJ-N.css +1 -0
  846. package/web/dist/assets/workflows-D8vYD-ql.js +7 -0
  847. package/web/dist/assets/zoomable-image-CxQSsfcn.js +1 -0
  848. package/web/dist/index.html +13 -17
  849. package/web/dist/live-worker.js +4 -0
  850. package/dist/core/tool-display.js +0 -179
  851. package/dist/core/tool-display.js.map +0 -1
  852. package/dist/runs/human-ask-summary.d.ts +0 -9
  853. package/dist/runs/human-ask-summary.js +0 -39
  854. package/dist/runs/human-ask-summary.js.map +0 -1
  855. package/dist/runs/run-search.d.ts +0 -29
  856. package/dist/runs/run-search.js +0 -63
  857. package/dist/runs/run-search.js.map +0 -1
  858. package/dist/skills-banner.d.ts +0 -22
  859. package/dist/skills-banner.js +0 -41
  860. package/dist/skills-banner.js.map +0 -1
  861. package/dist/skills-update.d.ts +0 -88
  862. package/dist/skills-update.js +0 -392
  863. package/dist/skills-update.js.map +0 -1
  864. package/dist/todos.d.ts +0 -48
  865. package/dist/todos.js +0 -201
  866. package/dist/todos.js.map +0 -1
  867. package/web/dist/assets/agent-accounts-CFOBMVHc.js +0 -1
  868. package/web/dist/assets/alert-dialog-BrpNUwMt.js +0 -1
  869. package/web/dist/assets/button-C_rd7CPp.js +0 -43
  870. package/web/dist/assets/compare-variants-D6WXhvXA.js +0 -1
  871. package/web/dist/assets/diff-DrEARXTV.js +0 -3
  872. package/web/dist/assets/diff-controls-B1-j7nFg.js +0 -1
  873. package/web/dist/assets/diff-view-DvGLjdTk.js +0 -6
  874. package/web/dist/assets/dropdown-menu-BegOZFrj.js +0 -1
  875. package/web/dist/assets/format-DpNe3S0A.js +0 -1
  876. package/web/dist/assets/git-toolbar-Cw4ljmhB.js +0 -1
  877. package/web/dist/assets/github-CfV5sqL0.js +0 -1
  878. package/web/dist/assets/index-DgWWlOLy.js +0 -13
  879. package/web/dist/assets/index-fBFnuvxu.css +0 -1
  880. package/web/dist/assets/nav-row-styles-vp2JbhuJ.js +0 -1
  881. package/web/dist/assets/popover-BohP6WTx.js +0 -1
  882. package/web/dist/assets/preview-pane-connected-qTA5KNoJ.js +0 -3
  883. package/web/dist/assets/preview-state-vuMviq6q.js +0 -1
  884. package/web/dist/assets/prompt-templates-Cubdut_C.js +0 -15
  885. package/web/dist/assets/repo-git-Cf4t5PD0.js +0 -1
  886. package/web/dist/assets/run-diff-BpkUW37Z.js +0 -3
  887. package/web/dist/assets/run-header-68WHf9wV.js +0 -1
  888. package/web/dist/assets/run-header-8GObNx6F.css +0 -1
  889. package/web/dist/assets/search-x-I9Q8pgUa.js +0 -1
  890. package/web/dist/assets/skills-DFBiAuJG.js +0 -1
  891. package/web/dist/assets/skills-DiVIgKeU.js +0 -1
  892. package/web/dist/assets/square-terminal-B6RYYieR.js +0 -1
  893. package/web/dist/assets/status-dot-CqTJHSP9.js +0 -1
  894. package/web/dist/assets/tab-link-B07Hu4QX.js +0 -1
  895. package/web/dist/assets/task-changes--lQF6EYf.js +0 -1
  896. package/web/dist/assets/task-commits-Cx0qy4DN.js +0 -1
  897. package/web/dist/assets/task-files-D50s-gKW.js +0 -2
  898. package/web/dist/assets/task-github-item-DaqmSwYT.js +0 -1
  899. package/web/dist/assets/task-thread-BPQ64lui.js +0 -7
  900. package/web/dist/assets/task-thread-zNE2Q9E-.css +0 -1
  901. package/web/dist/assets/textarea-D20O4Pw0.js +0 -1
  902. package/web/dist/assets/thread-state-DWcFMrvb.js +0 -4
  903. package/web/dist/assets/use-hand-to-agent-state-BLIGmwbd.css +0 -1
  904. package/web/dist/assets/use-hand-to-agent-state-Cy9eyyfL.js +0 -1
  905. package/web/dist/assets/utils-JsL3ZsJf.js +0 -64
  906. package/web/dist/assets/workflows-jwG7uxqi.js +0 -11
  907. package/web/dist/assets/zoomable-image-BJJ64KGc.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,M as i,t as a}from"./button-CeupvoKG.js";import{Aa as o,D as s,E as c,F as l,Ha as u,Ir as d,J as f,Ja as p,K as m,M as h,Mt as g,Ni as _,U as v,Ut as y,Xr as ee,Z as b,Zr as te,fn as ne,gn as x,i as S,jt as re,ka as ie,l as ae,nt as C,p as oe,r as se,rt as ce,t as le,tt as ue,xt as de}from"./dropdown-menu-COj_J5wd.js";import{In as w,Ot as fe,Pn as pe,U as me,Ut as he,Y as ge,Zt as T,gt as _e,ht as ve,i as E,mt as D,pt as O,t as k}from"./centered-state-hDsyXrnH.js";import{t as A}from"./createLucideIcon-BHp8sXmF.js";import{a as j,g as ye,o as M,t as N}from"./status-dot-1PR0i69P.js";import{l as P,n as be,y as xe}from"./nav-row-styles-AoIhhIwf.js";import{n as F,r as Se}from"./diff-controls-GewpW9aF.js";import{i as Ce,r as we,t as Te}from"./git-toolbar-DY0z0n4S.js";import{t as I}from"./info-DA1x_4bz.js";import{c as Ee,i as De,l as Oe,t as ke}from"./reference-chip-gQNk-4jc.js";import{a as L,c as R,i as z,n as B,o as V,r as H,s as U,t as W}from"./alert-dialog-DfctKUMw.js";import{C as Ae,D as je,E as Me,O as Ne,Qt as Pe,S as Fe,T as Ie,Xt as Le,Zt as G,_ as Re,b as ze,dt as Be,g as Ve,h as He,k as K,pr as Ue,v as We,w as Ge,x as Ke,xr as q,y as qe}from"./index-BOfE8pyD.js";import{t as Je}from"./markdown-BBDDg-4t.js";import{t as J}from"./diff-BnIXZK3i2.js";var Y=e(t(),1);function Ye(e,t){let n=u(t),r=n.getQueryCache();return Y.useSyncExternalStore(Y.useCallback(e=>r.subscribe(p.batchCalls(e)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}var Xe=A(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),Ze=A(`git-pull-request-create`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 9v12`,key:`1sc30k`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v3`,key:`1jb6z3`}],[`path`,{d:`M18 15v6`,key:`9wciyi`}],[`path`,{d:`M21 18h-6`,key:`139f0c`}]]),X=n();function Qe(){let e=i(),t=O(),n=u(),a=Ye({queryKey:E.repo})>0,o=t.data?.info?t.data:null,s=He(e,o,`screen`);return(0,X.jsxs)(`div`,{"data-route":`repo-git`,"data-slot":`git-screen`,className:be,children:[(0,X.jsxs)(`div`,{className:`mb-[16px] flex items-center gap-[8px]`,children:[(0,X.jsx)(`h1`,{className:r(P,`min-w-0 flex-1`),children:`Git`}),(0,X.jsx)(`button`,{type:`button`,"data-slot":`git-screen-refresh`,"aria-label":`Refresh the repository`,title:`Refresh the repository`,disabled:a,onClick:()=>{n.invalidateQueries({queryKey:E.repo}),n.invalidateQueries({queryKey:E.worktrees})},className:`-my-2 -mr-[10px] flex size-11 shrink-0 items-center justify-center rounded-md text-soft-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-60`,children:(0,X.jsx)(de,{size:17,"aria-hidden":`true`,className:r(`size-[17px]`,a&&`motion-safe:animate-spin`)})})]}),o?.info?(0,X.jsx)(`div`,{className:`mb-[16px]`,children:(0,X.jsx)(ze,{scope:e,repo:o,info:o.info,variant:`screen`},e)}):t.isPending?(0,X.jsx)(`p`,{"data-slot":`git-screen-loading`,role:`status`,className:`mb-[16px] px-[10px] text-[13px] text-soft-foreground`,children:`Loading the checkout…`}):t.isError?(0,X.jsxs)(`p`,{"data-slot":`git-screen-error`,role:`alert`,className:`mb-[16px] px-[10px] text-[13px] text-danger`,children:[`Could not load the repository: `,t.error.message]}):(0,X.jsx)(`p`,{"data-slot":`git-screen-not-git`,className:`mb-[16px] px-[10px] text-[13px] text-soft-foreground`,children:`Not a git repository.`}),t.isPending?null:(0,X.jsx)(We,{branch:o?.info?.branch??null,counts:s,variant:`screen`})]})}function $e(){let e=ve(),t=K(),[n,r]=(0,Y.useState)(`unified`),[i,a]=(0,Y.useState)(!1),[o,s]=(0,Y.useState)(!1),[c,l]=(0,Y.useState)(null),u=(0,Y.useRef)(null),d=e.isError&&e.error instanceof y&&e.error.status===409,p=e.data?.files??[],m=(0,Y.useMemo)(()=>we(p),[p]),h=(0,Y.useMemo)(()=>p.some(Je),[p]),_=t?n:`unified`,v=!t||i;return(0,X.jsxs)(`section`,{"data-slot":`repo-changes`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{"data-slot":`repo-changes-toolbar`,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 px-[18px] py-[22px] md:px-9`,children:[(0,X.jsx)(`span`,{className:`text-sm`,children:e.data?`${e.data.stat.files} files changed ·`:`Uncommitted changes`}),e.data?(0,X.jsx)(Te,{stat:e.data.stat}):null,(0,X.jsxs)(`span`,{className:`ml-auto flex items-center gap-1`,children:[(0,X.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,X.jsx)(F,{mode:n,wrap:i,onModeChange:r,onWrapChange:a})}),h?(0,X.jsx)(Se,{preview:o,onPreviewChange:s}):null]})]}),e.isPending?(0,X.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading changes…`}):e.isError?(0,X.jsx)(k,{icon:d?(0,X.jsx)(f,{size:16}):(0,X.jsx)(g,{size:16}),tone:d?`neutral`:`danger`,heading:`h2`,title:d?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):p.length===0?(0,X.jsx)(k,{icon:(0,X.jsx)(f,{size:16}),tone:`neutral`,heading:`h2`,title:`Working tree clean`,subtitle:`No uncommitted changes in the main working tree. Edits show up here as they happen.`}):(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-5 md:flex-row md:items-start px-[18px] pb-9 pt-0 [--diff-sticky-top:1rem] md:px-9`,children:[(0,X.jsxs)(`aside`,{"data-slot":`changes-tree-pane`,className:`md:sticky md:top-4 md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] w-full md:w-60 shrink-0 overflow-y-auto overscroll-contain rounded-xl border border-border bg-card p-3.5 lg:w-[250px]`,children:[(0,X.jsx)(`h2`,{className:`mb-3 border-b border-border pb-3 text-xs font-semibold`,children:`Changed files`}),(0,X.jsx)(Ce,{root:m,selected:c,onSelect:e=>{l(e),u.current?.scrollToPath(e)}})]}),(0,X.jsx)(J,{files:p,viewRef:u,mode:_,wrap:v,preview:o,className:`min-w-0 flex-1`})]})]})}function et({repo:e,info:t}){let{sha:n}=ie(),r=e.log,i=(0,Y.useMemo)(()=>je(r),[r]);if(n)return(0,X.jsx)(rt,{sha:n});let a=Ie(e,t),o=a&&a.behind>0?(0,X.jsx)(nt,{info:t,tracking:a}):null;return r.length===0?(0,X.jsxs)(X.Fragment,{children:[o?(0,X.jsx)(`div`,{className:`px-[8px] pt-[12px] md:px-[20px]`,children:o}):null,(0,X.jsx)(k,{icon:(0,X.jsx)(C,{size:16}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`The log is empty — this repository has no commits to show.`})]}):(0,X.jsxs)(`div`,{"data-slot":`repo-commits`,className:`flex flex-col gap-[2px] px-[8px] pt-[12px] pb-[20px] md:px-[20px]`,children:[o,i.map(e=>(0,X.jsxs)(`section`,{"data-slot":`repo-commit-day`,"aria-label":e.label,className:`flex flex-col`,children:[(0,X.jsx)(`h2`,{className:`px-[10px] pt-[14px] pb-[4px] text-[11px] font-medium text-soft-foreground`,children:e.label}),(0,X.jsx)(`ul`,{className:`flex flex-col`,children:e.commits.map(e=>(0,X.jsxs)(`li`,{className:`flex min-h-[52px] items-center gap-[14px] rounded-[6px] hover:bg-sidebar-row-hover`,children:[(0,X.jsxs)(M,{to:`/git/commits/${e.hash}`,"data-slot":`commit-row`,"data-sha":e.hash,className:`flex min-h-[52px] min-w-0 flex-1 flex-col justify-center gap-[3px] rounded-[6px] px-[10px] py-[6px] focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,X.jsx)(`span`,{"data-slot":`commit-row-subject`,className:`truncate text-[13px] text-foreground`,children:e.subject}),(0,X.jsxs)(`span`,{"data-slot":`commit-row-meta`,className:`flex min-w-0 items-center gap-[6px] text-[11px] text-soft-foreground`,children:[(0,X.jsx)(`span`,{className:`shrink-0 font-mono`,children:e.hash}),(0,X.jsxs)(`span`,{className:`truncate`,children:[`· `,e.author,` · `,Ne(e.when)]})]})]}),(0,X.jsx)(tt,{source:e.source})]},e.hash))})]},e.label))]})}function tt({source:e}){let t=`hidden max-w-[45%] shrink-0 items-center gap-[5px] pr-[10px] text-[11.5px] text-soft-foreground md:flex`;return e?(0,X.jsxs)(M,{to:`/tasks/${e.runId}`,"data-slot":`commit-source`,"data-source":`task`,"aria-label":`From the task ${e.title}${e.prNumber===null?``:`, pull request #${e.prNumber}`}`,className:r(t,`rounded-[4px] hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`),children:[e.prNumber===null?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ce,{"aria-hidden":`true`,className:`size-[11px] shrink-0 text-merged-text`}),(0,X.jsxs)(`span`,{className:`shrink-0 text-muted-foreground`,children:[`PR #`,e.prNumber]})]}),(0,X.jsx)(h,{"aria-hidden":`true`,className:`size-[12px] shrink-0`}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title})]}):(0,X.jsx)(`span`,{"data-slot":`commit-source`,"data-source":`unknown`,className:t,children:`no task found`})}function nt({info:e,tracking:t}){let n=Fe(i(),e),r=(0,Y.useRef)(null);return(0,X.jsxs)(`div`,{"data-slot":`git-incoming`,className:`mb-[4px] flex min-h-[40px] items-center gap-[8px] rounded-[8px] border border-border px-[10px] py-[6px]`,children:[(0,X.jsx)(Xe,{"aria-hidden":`true`,className:`size-[14px] shrink-0 text-inbox-count-foreground`}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1 text-[12.5px] text-muted-foreground`,children:[t.behind,` commit`,t.behind===1?``:`s`,` on `,t.ref,` `,t.behind===1?`is`:`are`,` not in your checkout yet`]}),(0,X.jsxs)(`button`,{ref:r,type:`button`,"data-action":`repo-pull-incoming`,disabled:!n.hasRemote||n.pulling,onClick:()=>void n.pull(),className:`inline-flex h-[26px] shrink-0 items-center gap-[4px] rounded-[6px] bg-muted px-[10px] text-[12px] font-medium text-foreground hover:brightness-110 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 max-md:h-11 [&>svg]:size-[12px]`,children:[n.pulling?(0,X.jsx)(ye,{"aria-hidden":`true`,className:`motion-safe:animate-spin`}):(0,X.jsx)(c,{"aria-hidden":`true`}),`Pull`]}),(0,X.jsx)(Ke,{checkout:n,returnFocus:r})]})}function rt({sha:e}){let t=_e(e),n=K(),[r,i]=(0,Y.useState)(`unified`),[o,c]=(0,Y.useState)(!1),l=t.isError&&t.error instanceof y&&t.error.status===409,u=n?r:`unified`,d=!n||o;return(0,X.jsxs)(`section`,{"data-slot":`repo-commit`,"data-sha":e,className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,X.jsx)(a,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,X.jsxs)(M,{to:n?`/git`:Ae,children:[(0,X.jsx)(s,{size:16,"aria-hidden":`true`}),`All recent commits`]})}),t.data?(0,X.jsx)(Be,{stat:t.data.stat}):null,(0,X.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,X.jsx)(F,{mode:r,wrap:o,onModeChange:i,onWrapChange:c})})]}),t.isPending?(0,X.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):t.isError?(0,X.jsx)(k,{icon:l?(0,X.jsx)(Oe,{}):(0,X.jsx)(g,{size:16}),tone:l?`neutral`:`danger`,heading:`h2`,title:l?`Commit not found`:`Could not load the commit`,subtitle:t.error.message}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:t.data.subject}),(0,X.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[t.data.author,` · `,t.data.when,` ·`,` `,(0,X.jsx)(`span`,{className:`font-mono select-all`,children:t.data.sha})]})]}),t.data.files.length===0?(0,X.jsx)(k,{icon:(0,X.jsx)(C,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,X.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:1rem] md:px-6`,children:(0,X.jsx)(J,{files:t.data.files,mode:u,wrap:d,className:`min-w-0`})})]})]})}var Z=`Squash-merged branches may show as not landed without GitHub`;function it(e){let t=[],n=[],r=[];for(let i of e)if(i.class===`orphan`)r.push(i);else if(i.class!==`not-landed`)continue;else i.pr&&(i.pr.state===`open`||i.pr.state===`draft`)?n.push(i):t.push(i);return[{key:`no-pr`,title:`No pull request`,note:`nobody sees this work until you act`,rows:t},{key:`pr-open`,title:`Pull request open`,rows:n},{key:`deleted`,title:`Task deleted`,note:`this branch is the only copy of the work`,rows:r}].filter(e=>e.rows.length>0)}function at(e){return e.filter(e=>e.class===`active`&&e.runId!==null&&e.ahead>0&&(e.runStatus===`done`||e.runStatus===`failed`||e.runStatus===`cancelled`)).length}var ot={done:`success`,failed:`danger`,cancelled:`neutral`};function st(){let e=D(),t=fe(),n=i(),r=ge(),[a,o]=(0,Y.useState)(null);if(e.isPending)return(0,X.jsx)(`p`,{"data-slot":`not-landed-loading`,role:`status`,className:`px-[28px] py-[20px] text-[13px] text-soft-foreground`,children:`Loading branches…`});if(e.isError)return(0,X.jsx)(k,{icon:(0,X.jsx)(g,{size:16}),tone:`danger`,heading:`h2`,title:`Could not classify the branches`,subtitle:e.error.message});let s=it(e.data.branches),c=at(e.data.branches),l=c>0?(0,X.jsxs)(`p`,{"data-slot":`not-landed-retained`,className:`flex items-start gap-[6px] px-[10px] pt-[6px] text-[11.5px] leading-[17px] text-soft-foreground`,children:[(0,X.jsx)(I,{"aria-hidden":`true`,className:`mt-[2.5px] size-[12px] shrink-0`}),(0,X.jsxs)(`span`,{children:[c,` finished task`,c===1?` still has its`:`s still have their`,` worktree and commits not on the base, so `,c===1?`it is`:`they are`,` not listed here.`,` `,`They show here once the worktree is reclaimed in `,(0,X.jsx)(M,{to:Ge.cleanup,className:`underline underline-offset-2 hover:text-foreground`,children:`Cleanup`}),`.`]})]}):null,u=new Map((t.data??[]).map(e=>[e.id,e.finishedAt]));return(0,X.jsxs)(De,{projectId:n,repoBase:r,requests:s.flatMap(e=>e.rows).flatMap(e=>e.pr?[{projectId:n,kind:`PR`,number:e.pr.number}]:[]),children:[(0,X.jsxs)(`div`,{"data-slot":`repo-not-landed`,className:`flex flex-col gap-[2px] px-[8px] pt-[12px] pb-[calc(90px+env(safe-area-inset-bottom))] md:px-[20px] md:pb-[20px]`,children:[e.data.prStateKnown?null:(0,X.jsx)(ct,{}),l,s.length===0?(0,X.jsx)(k,{icon:(0,X.jsx)(Ue,{size:16}),tone:`neutral`,heading:`h2`,title:c>0?`Nothing else waiting to land`:`Everything landed`,subtitle:c>0?`Every other finished task's commits are on the base branch, or it made none.`:`Every finished task's commits are on the base branch, or it made none.`}):(0,X.jsxs)(X.Fragment,{children:[s.map(e=>(0,X.jsxs)(`section`,{"data-slot":`not-landed-group`,"data-group":e.key,"aria-label":e.title,className:`flex flex-col`,children:[(0,X.jsxs)(`h2`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-[6px] px-[10px] pt-[14px] pb-[6px] text-[11px] text-soft-foreground`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:e.title}),(0,X.jsx)(`span`,{children:e.rows.length}),e.note?(0,X.jsxs)(`span`,{children:[`· `,e.note]}):null]}),(0,X.jsx)(`ul`,{className:`flex flex-col`,children:e.rows.map(e=>(0,X.jsx)(lt,{entry:e,finishedAt:e.runId?u.get(e.runId):void 0,onDelete:()=>o(e)},e.name))})]},e.key)),(0,X.jsxs)(`p`,{"data-slot":`not-landed-note`,className:`flex items-start gap-[6px] px-[10px] pt-[14px] text-[11.5px] leading-[17px] text-soft-foreground`,children:[(0,X.jsx)(I,{"aria-hidden":`true`,className:`mt-[2.5px] size-[12px] shrink-0`}),`Delete branch is in each row's … menu. It confirms and names the commits it drops. Nothing on this list can be bulk-deleted.`]})]})]}),(0,X.jsx)(dt,{entry:a,onClose:()=>o(null)})]})}function ct({className:e}){return(0,X.jsxs)(`p`,{"data-slot":`git-no-forge`,className:r(`flex items-start gap-[6px] px-[10px] pt-[6px] text-[11.5px] leading-[17px] text-soft-foreground`,e),children:[(0,X.jsx)(I,{"aria-hidden":`true`,className:`mt-[2.5px] size-[12px] shrink-0`}),Z,`.`]})}function lt({entry:e,finishedAt:t,onDelete:n}){let i=u(),a=e.class===`orphan`,o=e.pr&&(e.pr.state===`open`||e.pr.state===`draft`)?e.pr:null,s=!a&&e.runId!==null&&!o,c=a?`No task · last commit “${e.lastCommit.subject}”`:e.title??e.name,l=j(t??e.lastCommit.at),d=a||!e.runStatus?l?`${l} ago`:``:`${e.runStatus}${l?` ${l} ago`:``}`,f=w({mutationFn:()=>ne(e.runId),onSuccess:e=>{_(`Draft PR created — ${e.url}`),i.invalidateQueries({queryKey:E.repoBranches}),i.invalidateQueries({queryKey:E.runs.all})},onError:e=>_(e instanceof y&&e.manual?`${e.message} — ${e.manual}`:e.message,{tone:`danger`})}),p=()=>void navigator.clipboard.writeText(e.name).then(()=>_(`Copied ${e.name}`),()=>_(`Could not copy the branch name`,{tone:`danger`})),h=`inline-flex h-[28px] shrink-0 items-center gap-[5px] rounded-[6px] px-[10px] text-[12px] font-medium text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 [&>svg]:size-[12px]`;return(0,X.jsxs)(`li`,{"data-slot":`not-landed-row`,"data-branch":e.name,"data-branch-class":e.class,className:`flex min-h-[56px] items-center gap-[12px] rounded-[6px] px-[10px] py-[6px] hover:bg-sidebar-row-hover`,children:[(0,X.jsx)(`span`,{className:`flex size-[12px] shrink-0 items-center justify-center`,children:a?(0,X.jsx)(xe,{"aria-label":`Task deleted`,className:`size-[12px] text-soft-foreground`}):(0,X.jsx)(N,{tone:e.runStatus&&ot[e.runStatus]||`neutral`,"aria-label":e.runStatus??void 0})}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[3px]`,children:[e.runId?(0,X.jsx)(M,{to:`/tasks/${e.runId}`,"data-slot":`not-landed-title`,className:`min-w-0 truncate rounded-[2px] text-[13px] text-foreground hover:underline underline-offset-2 focus-visible:outline-2 focus-visible:outline-ring`,children:c}):(0,X.jsx)(`span`,{"data-slot":`not-landed-title`,className:`min-w-0 truncate text-[13px] text-muted-foreground`,title:c,children:c}),(0,X.jsxs)(`span`,{"data-slot":`not-landed-meta`,className:`flex min-w-0 items-center gap-[6px] text-[11px] text-soft-foreground`,children:[(0,X.jsx)(`span`,{className:`shrink-0 font-mono text-muted-foreground`,children:e.name}),(0,X.jsxs)(`span`,{className:`shrink-0`,children:[`· `,e.ahead,` commit`,e.ahead===1?``:`s`]}),e.diffStat?(0,X.jsxs)(`span`,{className:`flex shrink-0 gap-[4px] tabular-nums`,children:[(0,X.jsxs)(`span`,{className:`text-success`,children:[`+`,e.diffStat.additions]}),(0,X.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.diffStat.deletions]})]}):null,d?(0,X.jsxs)(`span`,{className:`truncate`,children:[`· `,d]}):null]})]}),e.pr?(0,X.jsxs)(`span`,{"data-slot":`not-landed-pr`,className:`hidden shrink-0 items-center gap-[4px] text-[11.5px] text-muted-foreground md:flex`,children:[(0,X.jsx)(ke,{plain:!0,reference:{kind:`PR`,number:e.pr.number,url:e.pr.url},taskTitle:e.title??e.name,status:e.pr.state===`draft`?`draft`:e.pr.state===`closed`?`closed`:void 0}),(0,X.jsx)(ut,{entry:e})]}):null,e.runId?(0,X.jsx)(M,{to:`/tasks/${e.runId}`,"data-action":`not-landed-open`,className:r(h,`hidden border border-border hover:bg-muted md:inline-flex`),children:`Open task`}):null,s?(0,X.jsxs)(`button`,{type:`button`,"data-action":`not-landed-create-pr`,disabled:f.isPending,onClick:()=>f.mutate(),className:r(h,`hidden bg-muted hover:brightness-110 md:inline-flex`),children:[(0,X.jsx)(Ze,{"aria-hidden":`true`}),f.isPending?`Creating…`:`Create draft PR`]}):null,a?(0,X.jsxs)(`button`,{type:`button`,"data-action":`not-landed-copy`,onClick:p,className:r(h,`hidden border border-border hover:bg-muted md:inline-flex`),children:[(0,X.jsx)(v,{"aria-hidden":`true`}),`Copy branch`]}):null,(0,X.jsxs)(le,{children:[(0,X.jsx)(oe,{"data-action":`not-landed-more`,"aria-label":`More actions for ${e.name}`,className:`flex size-[28px] shrink-0 items-center justify-center rounded-[6px] text-soft-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring max-md:size-11`,children:(0,X.jsx)(m,{"aria-hidden":`true`,className:`size-[14px]`})}),(0,X.jsxs)(se,{align:`end`,className:`w-52`,children:[e.runId?(0,X.jsx)(S,{asChild:!0,className:`md:hidden`,children:(0,X.jsx)(M,{to:`/tasks/${e.runId}`,children:`Open task`})}):null,s?(0,X.jsx)(S,{className:`md:hidden`,disabled:f.isPending,onSelect:()=>f.mutate(),children:`Create draft PR`}):null,(0,X.jsx)(S,{className:r(!a&&`md:hidden`),onSelect:p,children:`Copy branch`}),(0,X.jsx)(ae,{className:`md:hidden`}),(0,X.jsx)(S,{"data-action":`not-landed-delete`,variant:`destructive`,onSelect:n,children:`Delete branch…`})]})]})]})}function ut({entry:e}){let t=pe(Ee(`PR`,e.pr?.number).status),n=e.pr?.state;return(0,X.jsxs)(`span`,{"data-slot":`not-landed-pr-state`,children:[`· `,n===`draft`||n===`closed`?n:t?t.label.toLowerCase():`open`]})}function dt({entry:e,onClose:t}){let n=u(),[r,i]=(0,Y.useState)(``),a=(0,Y.useId)(),o=w({mutationFn:e=>x({names:[e],confirm:e}),onSuccess:e=>{let t=e.dropped?.length??0;_(e.deleted.length>0?`Deleted ${e.deleted[0]}${t?` and ${t} commit${t===1?``:`s`} with it`:``}`:e.refused[0]?.reason??`Nothing was deleted`),n.invalidateQueries({queryKey:E.repo}),s()},onError:e=>_(e.message,{tone:`danger`})}),s=()=>{i(``),t()},c=e!==null&&r.trim()===e.name,l=e?`${e.ahead} commit${e.ahead===1?``:`s`}`:``;return(0,X.jsx)(W,{open:e!==null,onOpenChange:e=>!e&&!o.isPending&&s(),children:(0,X.jsxs)(z,{"data-slot":`delete-branch-dialog`,children:[(0,X.jsxs)(U,{children:[(0,X.jsxs)(R,{children:[`Delete `,e?.name,`?`]}),(0,X.jsx)(L,{asChild:!0,children:(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`p`,{children:e?.class===`orphan`?`Its task was deleted, so this branch is the only copy of the work.`:(0,X.jsxs)(X.Fragment,{children:[`This drops the work of `,(0,X.jsx)(`span`,{className:`font-medium text-foreground`,children:e?.title??e?.name}),`. It is not on the base branch`,e?.pr?``:` and no pull request carries it`,`.`]})}),(0,X.jsxs)(`p`,{"data-slot":`delete-branch-dropped`,children:[l,` will be dropped`,e?.diffStat?` (+${e.diffStat.additions} −${e.diffStat.deletions})`:``,`, the latest “`,e?.lastCommit.subject,`”`,` `,`(`,(0,X.jsx)(`span`,{className:`font-mono`,children:e?.lastCommit.sha.slice(0,7)}),`).`]})]})})]}),(0,X.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),c&&e&&o.mutate(e.name)},className:`flex flex-col gap-[6px]`,children:[(0,X.jsxs)(`label`,{htmlFor:a,className:`text-[12.5px] text-muted-foreground`,children:[`Type `,(0,X.jsx)(`span`,{className:`font-mono text-foreground`,children:e?.name}),` to confirm`]}),(0,X.jsx)(Pe,{id:a,"data-slot":`delete-branch-confirm`,autoComplete:`off`,spellCheck:!1,value:r,onChange:e=>i(e.target.value),className:`h-11 font-mono`})]}),(0,X.jsxs)(V,{children:[(0,X.jsx)(H,{className:`h-11`,disabled:o.isPending,children:`Keep it`}),(0,X.jsx)(B,{"data-action":`delete-branch-confirm`,className:`h-11 bg-danger text-danger-foreground hover:brightness-[0.96]`,disabled:!c||o.isPending,onClick:t=>{t.preventDefault(),c&&e&&o.mutate(e.name)},children:o.isPending?`Deleting…`:`Delete branch`})]})]})})}function ft({base:e}){let t=D(),n=u(),[r,i]=(0,Y.useState)({merged:!1,empty:!1}),[a,o]=(0,Y.useState)(!1),s=(t.data?.branches??[]).filter(e=>e.class===`merged`),c=(t.data?.branches??[]).filter(e=>e.class===`empty`),l=[...s,...c],d=w({mutationFn:e=>x({names:e}),onSuccess:e=>{let t=e.refused.length;_(`Deleted ${e.deleted.length} branch${e.deleted.length===1?``:`es`}${t?`; kept ${t} that ${t===1?`is`:`are`} no longer safe to delete`:``}`),n.invalidateQueries({queryKey:E.repo})},onError:e=>{n.invalidateQueries({queryKey:E.repo}),_(e.message,{tone:`danger`})}});if(t.isPending)return(0,X.jsx)(`p`,{"data-slot":`cleanup-branches-loading`,className:`text-[13px] text-soft-foreground`,children:`Loading branches…`});if(t.isError)return(0,X.jsxs)(`p`,{"data-slot":`cleanup-branches-error`,className:`text-[13px] text-danger`,children:[`Branches did not load: `,t.error.message]});let f=l.length,p=`branch${f===1?``:`es`}`;return(0,X.jsxs)(`section`,{"data-slot":`cleanup-branches`,"aria-labelledby":`cleanup-branches-title`,className:`flex flex-col rounded-[8px] border border-border`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-[10px] border-b border-border px-[14px] py-[12px] md:flex-row md:items-center`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,X.jsxs)(`h2`,{id:`cleanup-branches-title`,className:`text-[13px] font-semibold text-foreground`,children:[`Branches safe to delete · `,f]}),(0,X.jsxs)(`p`,{className:`text-[11.5px] leading-[17px] text-soft-foreground`,children:[`Their work is already on `,e,`, or they have none. Deleting loses nothing.`]})]}),(0,X.jsxs)(`button`,{type:`button`,"data-action":`cleanup-branches-delete`,disabled:f===0||d.isPending,onClick:()=>o(!0),className:`inline-flex h-[28px] shrink-0 items-center gap-[5px] self-start rounded-[6px] bg-muted px-[10px] text-[12px] font-medium text-foreground hover:brightness-110 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 disabled:hover:brightness-100 max-md:h-11 md:self-center`,children:[(0,X.jsx)(re,{"aria-hidden":`true`,className:`size-[12px]`}),d.isPending?`Deleting…`:`Delete ${f} ${p}`]})]}),(0,X.jsx)(Q,{kind:`merged`,title:`Merged into ${e}`,hint:t.data.prStateKnown?`including squash-merged PRs, read from the PR state`:Z.toLowerCase(),rows:s,open:r.merged,onToggle:()=>i(e=>({...e,merged:!e.merged}))}),(0,X.jsx)(Q,{kind:`empty`,title:`Empty`,hint:`no commits beyond the fork point`,rows:c,open:r.empty,onToggle:()=>i(e=>({...e,empty:!e.empty}))}),(0,X.jsx)(W,{open:a,onOpenChange:o,children:(0,X.jsxs)(z,{children:[(0,X.jsxs)(U,{children:[(0,X.jsxs)(R,{children:[`Delete `,f,` `,p,`?`]}),(0,X.jsxs)(L,{children:[s.length,` merged into `,e,` and `,c.length,` empty. Their work is already on `,e,`, or they have none. Anything that stopped being safe since this list loaded is kept.`]})]}),(0,X.jsxs)(V,{children:[(0,X.jsx)(H,{children:`Keep them`}),(0,X.jsxs)(B,{"data-action":`cleanup-branches-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{d.mutate(l.map(e=>e.name)),o(!1)},children:[`Delete `,f,` `,p]})]})]})})]})}function Q({kind:e,title:t,hint:n,rows:i,open:a,onToggle:o}){let s=`cleanup-branches-${e}`;return(0,X.jsxs)(`div`,{"data-slot":`cleanup-branch-group`,"data-group":e,className:`border-b border-border last:border-0`,children:[(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":a,"aria-controls":s,disabled:i.length===0,onClick:o,className:`flex min-h-[44px] w-full items-center gap-[12px] px-[14px] py-[4px] text-left hover:bg-sidebar-row-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring disabled:hover:bg-transparent`,children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,X.jsxs)(`span`,{className:`truncate text-[12.5px] text-foreground`,children:[t,` · `,i.length]}),(0,X.jsx)(`span`,{className:`truncate text-[11px] text-soft-foreground`,children:n})]}),i.length>0?(0,X.jsx)(l,{"aria-hidden":`true`,className:r(`size-[13px] shrink-0 text-soft-foreground transition-transform motion-reduce:transition-none`,a&&`rotate-90`)}):null]}),a?(0,X.jsx)(`ul`,{id:s,"aria-label":t,className:`flex flex-col pb-[6px]`,children:i.map(e=>(0,X.jsxs)(`li`,{"data-slot":`cleanup-branch-row`,"data-branch":e.name,className:`flex min-h-[32px] items-center gap-[10px] px-[14px] pl-[26px] text-[11.5px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 font-mono text-muted-foreground`,children:e.name}),e.runId?(0,X.jsx)(M,{to:`/tasks/${e.runId}`,className:`min-w-0 flex-1 truncate text-soft-foreground underline-offset-2 hover:text-foreground hover:underline`,children:e.title??`Open the task`}):(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-soft-foreground`,children:e.lastCommit.subject}),e.pr?(0,X.jsxs)(`span`,{className:`shrink-0 text-soft-foreground`,children:[`PR #`,e.pr.number]}):null,(0,X.jsx)(`span`,{className:`shrink-0 tabular-nums text-soft-foreground`,children:j(e.lastCommit.at)})]},e.name))}):null]})}function $(){let e=he(),t=me().data?.targets.find(e=>e.id===`finder`),n=w({mutationFn:e=>d(e,t.id),onError:e=>_(e.message,{tone:`danger`})}),r=u(),[i,a]=(0,Y.useState)(!1),o=()=>Promise.all([r.invalidateQueries({queryKey:E.worktrees}),r.invalidateQueries({queryKey:E.repoBranches})]),s=w({mutationFn:e=>te(),onSuccess:(e,t)=>{o();let n=e.reclaimed.length,r=Math.max(0,t-n);_(n===0?r>0?`Nothing was reclaimed — the worktrees past the keep limit have uncommitted work or are in use`:`Nothing to reclaim — no finished worktrees exceed the keep limit`:`Reclaimed ${n} worktree${n===1?``:`s`} (branch kept)${r>0?` · ${r} kept: uncommitted work or in use`:``}`)},onError:e=>_(e.message,{tone:`danger`})}),c=w({mutationFn:e=>ee(e.runId),onSuccess:(e,t)=>{o(),_(`Reclaimed the worktree of ${t.title} (branch kept)`)},onError:e=>{o(),_(e.message,{tone:`danger`})}});if(e.isPending)return(0,X.jsx)(`p`,{"data-slot":`worktrees-loading`,className:`text-[13px] text-soft-foreground`,children:`Loading worktrees…`});if(e.isError)return(0,X.jsxs)(`p`,{"data-slot":`worktrees-error`,className:`text-[13px] text-danger`,children:[`Worktrees did not load: `,e.error.message]});let{worktrees:l,totalBytes:f,keep:p}=e.data,m=s.isPending||c.isPending,h=l.filter(e=>e.pastKeep),g=h.length>0,v=h.some(e=>e.sizeBytes===null)?null:h.reduce((e,t)=>e+(t.sizeBytes??0),0),y=g?v?`Reclaim ${T(v)} now`:`Reclaim ${h.length} now`:`Reclaim now`,b=f?T(f):null;return(0,X.jsxs)(`section`,{"data-slot":`worktrees-panel`,"aria-labelledby":`worktrees-panel-title`,className:`flex flex-col rounded-[8px] border border-border`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-[10px] border-b border-border px-[14px] py-[12px] md:flex-row md:items-center`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,X.jsxs)(`h2`,{id:`worktrees-panel-title`,className:`text-[13px] font-semibold text-foreground`,children:[`Worktrees on disk`,b?` · ${b}`:``]}),(0,X.jsxs)(`p`,{"data-slot":`worktrees-retention`,className:`text-[11.5px] leading-[17px] text-soft-foreground`,children:[p===0?`Retention is unlimited (`:`Retention keeps the newest ${p} finished checkout${p===1?``:`s`} (`,(0,X.jsx)(M,{to:`/settings/worktrees`,"data-slot":`worktrees-retention-link`,className:`underline-offset-2 hover:text-foreground hover:underline`,children:`Settings › Worktrees`}),p===0?`), so nothing is reclaimed on its own.`:`) and reclaims the rest.`,` `,`Reclaim removes the directory only; the branch stays, so its work stays recoverable.`]})]}),(0,X.jsxs)(`button`,{type:`button`,"data-action":`worktrees-reclaim-now`,disabled:m||!g,title:g?void 0:`Nothing past the keep limit to reclaim`,onClick:()=>a(!0),className:`inline-flex h-[28px] shrink-0 items-center gap-[5px] self-start rounded-[6px] bg-muted px-[10px] text-[12px] font-medium text-foreground hover:brightness-110 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 disabled:hover:brightness-100 max-md:h-11 md:self-center`,children:[(0,X.jsx)(q,{"aria-hidden":`true`,className:`size-[12px]`}),y]})]}),l.length===0?(0,X.jsx)(`p`,{"data-slot":`worktrees-empty`,className:`px-[14px] py-[12px] text-[12.5px] text-soft-foreground`,children:`No task worktrees on disk.`}):(0,X.jsx)(`ul`,{"aria-label":`Task worktrees on disk`,className:`flex flex-col`,children:l.map(e=>(0,X.jsx)(ht,{worktree:e,keep:p,disabled:m,onOpen:t?()=>n.mutate(e.runId):void 0,opening:n.isPending,onReclaim:()=>c.mutate(e)},e.runId))}),(0,X.jsx)(W,{open:i,onOpenChange:a,children:(0,X.jsxs)(z,{children:[(0,X.jsxs)(U,{children:[(0,X.jsx)(R,{children:`Reclaim old worktrees?`}),(0,X.jsxs)(L,{children:[h.length,` finished worktree`,h.length===1?``:`s`,` beyond the keep limit`,v?` (${T(v)})`:``,` `,h.length===1?`is`:`are`,` reclaimed now, directory only. Their branches are kept, so the work stays recoverable.`]})]}),(0,X.jsxs)(V,{children:[(0,X.jsx)(H,{children:`Keep them`}),(0,X.jsx)(B,{"data-action":`worktrees-confirm`,onClick:()=>{s.mutate(h.length),a(!1)},children:y})]})]})})]})}var pt=new Set([`queued`,`running`,`waiting`,`review`]);function mt(e,t){return pt.has(e.status)||!e.reclaimable?{label:`in use`,tone:`in-use`}:e.pastKeep?{label:`reclaimable`,tone:`plain`}:{label:t>0?`kept · newest ${t}`:`kept`,tone:`plain`}}function ht({worktree:e,keep:t,disabled:n,onOpen:i,opening:a,onReclaim:o}){let s=mt(e,t),c=j(e.finishedAt??void 0),l=e.status===`review`?`at review`:c?`${e.status} ${c} ago`:e.status,u=(0,X.jsx)(`span`,{"data-slot":`worktree-state`,"data-state":s.tone===`in-use`?`in-use`:e.pastKeep?`reclaimable`:`kept`,className:r(`text-[11.5px]`,s.tone===`in-use`?`text-status-running`:`text-soft-foreground`),children:s.label}),d=`flex size-[28px] shrink-0 items-center justify-center rounded-[6px] text-soft-foreground hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 max-md:size-11`;return(0,X.jsxs)(`li`,{"data-slot":`worktree-row`,"data-run":e.runId,className:`flex min-h-[44px] items-center gap-[12px] border-b border-border px-[14px] py-[4px] last:border-0`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,X.jsx)(`span`,{className:`truncate text-[12.5px] text-foreground`,title:e.title,children:e.title}),(0,X.jsxs)(`span`,{className:`truncate font-mono text-[10.5px] text-soft-foreground`,children:[e.branch??e.runId.slice(0,8),` · `,l,(0,X.jsxs)(`span`,{className:`md:hidden`,children:[` · `,s.label]})]})]}),(0,X.jsx)(`span`,{"data-slot":`worktree-size`,className:`shrink-0 text-[11.5px] tabular-nums text-muted-foreground`,children:e.sizeBytes===null?`—`:T(e.sizeBytes)||`0 kB`}),(0,X.jsx)(`span`,{className:`hidden shrink-0 md:inline`,children:u}),i?(0,X.jsx)(`button`,{type:`button`,className:d,"aria-label":`Open folder for ${e.title}`,title:`Open folder`,disabled:a,onClick:i,children:(0,X.jsx)(b,{"aria-hidden":`true`,className:`size-[13px]`})}):null,s.tone===`in-use`?null:(0,X.jsx)(`button`,{type:`button`,"data-action":`worktree-reclaim`,"aria-label":`Reclaim the worktree of ${e.title} (branch kept)`,title:`Reclaim the directory (branch kept)`,disabled:n,onClick:o,className:d,children:(0,X.jsx)(q,{"aria-hidden":`true`,className:`size-[13px]`})})]})}function gt({section:e,index:t=!1}){let n=O(),r=K(),[i]=o();if(t&&!r&&i.get(`view`)!==`repo`)return(0,X.jsx)(Qe,{});if(n.isPending)return(0,X.jsx)(Le,{});if(n.isError)return(0,X.jsxs)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:[(0,X.jsx)(G,{}),(0,X.jsx)(k,{icon:(0,X.jsx)(g,{size:16}),tone:`danger`,title:`Could not load the repository`,subtitle:n.error.message})]});let a=n.data.info;return a?(0,X.jsx)(_t,{repo:n.data,info:a,section:e}):(0,X.jsxs)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:[(0,X.jsx)(G,{}),(0,X.jsx)(k,{icon:(0,X.jsx)(ue,{size:16}),tone:`neutral`,title:`Not a git repository`,subtitle:`cezar is running outside a git repository — start it inside one to browse changes, commits and branches.`})]})}function _t({repo:e,info:t,section:n}){return(0,X.jsxs)(`div`,{"data-route":`repo-git`,"data-git-section":n,className:`flex min-h-full flex-col`,children:[(0,X.jsx)(G,{}),(0,X.jsxs)(`header`,{"data-slot":`repo-header`,className:`flex flex-col gap-1 px-[18px] pt-[18px] md:min-h-[61px] md:flex-row md:items-center md:gap-[10px] md:border-b md:border-border md:px-7 md:py-4`,children:[(0,X.jsx)(`h1`,{className:`min-w-0 flex-1 truncate text-2xl font-semibold tracking-tight md:text-[15px] md:tracking-normal`,children:qe(n,t.branch)}),(0,X.jsx)(`p`,{"data-slot":`repo-meta`,className:`min-w-0 truncate text-[12px] text-soft-foreground md:text-[11.5px]`,children:(0,X.jsx)(vt,{repo:e,info:t,section:n})})]}),n===`main`?(0,X.jsx)(et,{repo:e,info:t}):n===`not-landed`?(0,X.jsx)(st,{}):n===`cleanup`?(0,X.jsxs)(`div`,{"data-slot":`repo-cleanup`,className:`flex flex-col gap-[16px] px-[18px] pt-[12px] pb-[calc(90px+env(safe-area-inset-bottom))] md:px-[20px] md:pb-[20px]`,children:[(0,X.jsx)($,{}),(0,X.jsx)(ft,{base:e.baseBranch??t.branch})]}):n===`branches`?(0,X.jsx)(Ve,{repo:e,info:t}):(0,X.jsx)($e,{})]})}function vt({repo:e,info:t,section:n}){let r=e.baseBranch??t.branch;switch(n){case`main`:return(0,X.jsxs)(X.Fragment,{children:[e.log.length===0?`no commits yet`:`latest ${e.log.length} commit${e.log.length===1?``:`s`} in the main checkout`,e.tracking?` · ${Me(e.tracking)}`:``]});case`not-landed`:return(0,X.jsxs)(X.Fragment,{children:[`finished tasks whose commits are not on `,r]});case`branches`:return(0,X.jsx)(yt,{repo:e,info:t});case`changes`:return(0,X.jsxs)(X.Fragment,{children:[e.status.length,` uncommitted file`,e.status.length===1?``:`s`,` in the main checkout`]});case`cleanup`:return(0,X.jsxs)(X.Fragment,{children:[`nothing here can delete work that is not on `,r]})}}function yt({repo:e,info:t}){let n=Re(e,D().data?.branches).length;return(0,X.jsxs)(X.Fragment,{children:[n,` branch`,n===1?``:`es`,` · on `,t.branch]})}export{gt as RepoGitRoute};
@@ -1 +1 @@
1
- [data-slot=repo-tabs]>a{padding-inline:0}[data-slot=repo-branches]>div{border-radius:10px}[data-slot=repo-branches] [data-action=switch-branch]{font-weight:500}[data-slot=branch-create]{border-bottom:1px solid var(--border);padding-bottom:16px}[data-slot=repo-branches] input[aria-label=Filter\ branches]{background:var(--card)}
1
+ [data-slot=repo-tabs]>a{padding-inline:0}[data-slot=repo-branches]>div{border-radius:10px}[data-slot=repo-branches] [data-action=switch-branch]{font-weight:500}[data-slot=branch-create]{border-block-end:1px solid var(--border);padding-block-end:16px}[data-slot=repo-branches] input[aria-label=Filter\ branches]{background:var(--card)}
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{D as r,E as i,t as a}from"./button-CeupvoKG.js";import{Ai as o,Ha as s,Ir as c,Jt as l,K as u,Lr as d,Ni as f,P as p,R as ee,Rt as m,T as h,Ta as g,U as _,Ut as te,_n as v,a as y,i as b,jt as ne,k as x,ka as S,l as C,n as w,oa as T,ot as E,p as D,r as O,t as k,yt as A}from"./dropdown-menu-COj_J5wd.js";import{$t as j,B as re,F as ie,G as ae,In as M,Ot as oe,U as se,V as ce,W as N,Y as le,an as ue,at as de,cn as fe,en as pe,i as P,nt as me,on as he,sn as ge,tn as _e,tt as ve,un as ye,vt as be,wt as xe,xn as F,yn as Se}from"./centered-state-hDsyXrnH.js";import{t as I}from"./createLucideIcon-BHp8sXmF.js";import{t as Ce}from"./app-window-CSHwDX9N.js";import{f as we,n as Te,o as L,p as Ee,t as De}from"./status-dot-1PR0i69P.js";import{i as Oe,r as ke,t as Ae}from"./popover-D56fhiXj.js";import{t as je}from"./info-DA1x_4bz.js";import{n as Me,t as R}from"./tab-link-DmWk4l5O.js";import{i as Ne,n as Pe,t as z}from"./reference-chip-gQNk-4jc.js";import{a as B,c as V,i as H,n as U,o as W,r as G,s as K,t as Fe}from"./alert-dialog-DfctKUMw.js";import{$n as Ie,$t as Le,A as Re,J as ze,M as Be,Mt as Ve,Nt as He,Pt as Ue,Qn as We,Sr as Ge,Vt as Ke,X as qe,Z as Je,Zn as Ye,ar as Xe,at as q,cn as Ze,cr as Qe,ct as $e,en as et,er as tt,et as nt,it as J,j as rt,jt as it,lt as at,mr as ot,nr as st,sn as ct,sr as lt,st as ut,tn as dt,tr as ft}from"./index-BOfE8pyD.js";var pt=I(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),mt=I(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),ht=I(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),Y=e(t(),1),X=n();function gt(e){let t=s();return M({mutationFn:t=>l(e,t),onSuccess:()=>t.invalidateQueries({queryKey:P.runs.all}),onError:e=>f(e.message,{tone:`danger`})})}function _t(e){return e.archived?`Unarchive`:`Archive task`}function vt({run:e,open:t,onOpenChange:n,onConfirm:r}){return(0,X.jsx)(Fe,{open:t,onOpenChange:n,children:(0,X.jsxs)(H,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,X.jsxs)(K,{children:[(0,X.jsx)(V,{children:`Archive task?`}),(0,X.jsxs)(B,{children:[`Move “`,(0,X.jsx)(`span`,{className:`font-medium text-foreground`,title:F(e),children:F(e)}),`” out of Active tasks. You can restore it from Archived.`]})]}),(0,X.jsxs)(W,{children:[(0,X.jsx)(G,{children:`Cancel`}),(0,X.jsx)(U,{className:`bg-accent-strong text-accent-strong-foreground hover:brightness-[0.96]`,onClick:r,children:`Archive task`})]})]})})}function Z({run:e,className:t,compactOnMobile:n=!1}){let[r,o]=(0,Y.useState)(!1),s=gt(e.id),c=_t(e);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(a,{type:`button`,variant:`outline`,"data-slot":`archive-action`,"aria-label":c,title:e.archived?`Put this task back in Active tasks`:`Move this task out of Active tasks`,disabled:s.isPending,className:i(`h-11 gap-[7px] px-3`,n&&`max-md:size-11 max-md:px-0`,t),onClick:()=>e.archived?s.mutate(!1):o(!0),children:[e.archived?(0,X.jsx)(Ge,{"aria-hidden":`true`}):(0,X.jsx)(h,{"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:i(n&&`max-md:sr-only`),children:c})]}),(0,X.jsx)(vt,{run:e,open:r,onOpenChange:o,onConfirm:()=>{s.mutate(!0),o(!1)}})]})}function yt({run:e}){let t=N(e.id),n=q(e),i=e.status===`done`?e.completionAction:void 0,o=n.archive?e.archiveBlocker:void 0,s=i&&i.phase!==`complete`;if(!s&&!o)return null;let c=e.pullRequestUrl??e.pullRequests?.find(e=>e.url)?.url;return(0,X.jsxs)(`section`,{"data-slot":`completion-status`,"aria-label":`Completion action`,className:`grid min-w-0 gap-2 rounded-lg border border-border bg-card p-3 [margin-block:0.75rem]`,children:[s?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`text-sm [overflow-wrap:anywhere]`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:i.phase===`blocked`?`Completion blocked`:`Completion pending`}),` · `,i.message||(i.phase===`blocked`?`Completion needs attention.`:`Checking completion actions.`)]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[c&&r(c)?(0,X.jsx)(a,{variant:`outline`,asChild:!0,children:(0,X.jsx)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,children:`Open PR`})}):null,e.autoMergePr?(0,X.jsx)(a,{variant:`outline`,disabled:t.isPending,onClick:()=>t.mutate({autoMergePr:!1},{onError:e=>f(e.message,{tone:`danger`})}),children:t.isPending?`Saving…`:`Disable auto-merge`}):null]})]}):null,o?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`text-sm [overflow-wrap:anywhere]`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:`Archive blocked`}),` · `,o.message]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[o.runId?(0,X.jsx)(a,{variant:`outline`,asChild:!0,children:(0,X.jsx)(L,{to:`/tasks/${o.runId}`,children:`Open blocking task`})}):null,o.pullRequestUrl&&r(o.pullRequestUrl)?(0,X.jsx)(a,{variant:`outline`,asChild:!0,children:(0,X.jsx)(`a`,{href:o.pullRequestUrl,target:`_blank`,rel:`noopener noreferrer`,children:`Open blocking PR`})}):null,n.archive?(0,X.jsx)(Z,{run:e}):null]})]}):null]})}var bt=[`running`,`queued`,`waiting`];function xt(e,{queuePosition:t,now:n=new Date}){let r=o(e),i=r.label.charAt(0).toUpperCase()+r.label.slice(1),a=t===void 0?i:`${i} #${t}`,s=bt.includes(e.status)?Ct(e,n):void 0;return s?{attention:r,label:a,nextCheck:s}:{attention:r,label:a}}function St(e){return e.nextCheck?`${e.label} · Next check ${e.nextCheck.text}`:e.label}function Ct(e,t){let n;for(let t of Array.isArray(e.waits)?e.waits:[]){if(t?.kind!==`timer`||t.phase!==`open`)continue;let e=new Date(t.deadline);Number.isFinite(e.getTime())&&(!n||e<n)&&(n=e)}if(n)return{at:n.toISOString(),text:Te(n,t)}}async function Q(e,t){try{await navigator.clipboard.writeText(e),f(t)}catch{f(`Run manually: ${e}`)}}function wt(e){let t=le(),n=de(),r=(0,Y.useMemo)(()=>ye(e,t),[e,t]);return{referenceProjectId:n,repoBase:t,references:r,requests:(0,Y.useMemo)(()=>n===void 0?[]:r.filter(e=>j(e,t)).map(e=>({projectId:n,kind:e.kind,number:e.number})),[r,n,t])}}function Tt(e){return M({mutationFn:()=>d(e.id),onError:e=>{if(e instanceof te&&e.command){Q(e.command,`No terminal found — command copied to clipboard.`);return}f(e.message,{tone:`danger`})}})}function $(e,t){let n=se(),r=me(),i=M({mutationFn:t=>c(e.id,t),onError:e=>f(e.message,{tone:`danger`})}),a=T(r.data),o=e=>!r.isSuccess||a.includes(e??`claude`);return{canResumeHere:t&&o(nt(e)),choices:e.worktreePath?(n.data?.targets??[]).filter(e=>{let t=He(e.id);return t===void 0||o(t)}).map(t=>({target:t,...Je(e,t.id)?{suffix:` (resume)`,title:`Resume this run's session`}:{}})):[],open:i}}function Et({run:e,canResume:t,onResume:n}){let{canResumeHere:r,choices:i,open:o}=$(e,t),s=J(e);return!r&&i.length===0&&!s?null:(0,X.jsxs)(X.Fragment,{children:[r||i.length>0?(0,X.jsxs)(`div`,{className:`task-open-targets flex flex-wrap gap-3`,children:[r?(0,X.jsxs)(a,{variant:`outline`,"data-target":`terminal-resume`,onClick:n,children:[(0,X.jsx)(Xe,{}),`Terminal (resume session)`]}):null,i.map(({target:e,suffix:t,title:n})=>{let r=Ue(e);return(0,X.jsxs)(a,{variant:`outline`,"data-target":e.id,title:n,disabled:o.isPending,onClick:()=>o.mutate(e.id),children:[(0,X.jsx)(r,{"aria-hidden":`true`}),e.label,t??``]},e.id)}),e.worktreePath?(0,X.jsxs)(a,{variant:`outline`,onClick:()=>{let t=e.worktreePath;t&&navigator.clipboard.writeText(t).then(()=>f(`Worktree path copied`)).catch(()=>f(`Path: ${t}`))},children:[(0,X.jsx)(_,{}),`Copy worktree path`]}):null]}):null,s?(0,X.jsxs)(`div`,{"data-slot":`resume-command`,className:`mt-5 border-t border-border pt-5`,children:[(0,X.jsx)(`h3`,{className:`text-base font-medium`,children:`Resume in a terminal`}),(0,X.jsx)(`pre`,{className:`my-4 whitespace-pre-wrap break-all rounded-lg border border-border bg-background p-4 text-xs`,children:s}),(0,X.jsxs)(a,{variant:`outline`,onClick:()=>void Q(s,`Command copied to clipboard.`),children:[(0,X.jsx)(_,{}),`Copy resume command`]})]}):null]})}function Dt({run:e,canResume:t,onResume:n}){let{canResumeHere:r,choices:i,open:o}=$(e,t),s=J(e),c=e.worktreePath;if(!r&&i.length===0&&!s&&!c)return null;let l=`max-md:min-h-11`;return(0,X.jsxs)(`div`,{"data-slot":`workspace-tools`,className:`flex min-w-0 flex-wrap gap-2`,children:[r||i.length>0?(0,X.jsx)(Ve,{choices:i,onPick:e=>o.mutate(e),disabled:o.isPending,triggerVariant:`outline`,className:l,leading:r?(0,X.jsxs)(b,{"data-target":`terminal-resume`,onSelect:n,children:[(0,X.jsx)(Xe,{"aria-hidden":`true`}),`Terminal (resume session)`]}):void 0}):null,c?(0,X.jsxs)(a,{variant:`outline`,size:`sm`,className:l,onClick:()=>void Q(c,`Worktree path copied`),children:[(0,X.jsx)(_,{"aria-hidden":`true`}),`Copy worktree path`]}):null,s?(0,X.jsxs)(a,{variant:`outline`,size:`sm`,"data-slot":`resume-command`,title:s,className:l,onClick:()=>void Q(s,`Command copied to clipboard.`),children:[(0,X.jsx)(_,{"aria-hidden":`true`}),`Copy resume command`]}):null]})}function Ot({run:e,canResume:t,onResume:n,onOpen:r,onClose:i}){let{canResumeHere:o,choices:s}=$(e,t);return!o&&s.length===0?null:r?(0,X.jsx)(b,{onSelect:r,children:`Open in…`}):(0,X.jsxs)(`section`,{"aria-label":`Open task worktree in…`,className:`task-action-panel my-5 rounded-xl border border-border bg-card p-6`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsx)(`h2`,{className:`text-lg font-medium`,children:`Open task worktree in…`}),(0,X.jsx)(a,{variant:`ghost`,size:`icon`,"aria-label":`Close worktree chooser`,onClick:i,children:(0,X.jsx)(m,{})})]}),e.worktreePath?(0,X.jsx)(`p`,{className:`my-4 break-all text-xs text-muted-foreground`,children:e.worktreePath}):null,(0,X.jsx)(`div`,{className:`mt-4`,children:(0,X.jsx)(Et,{run:e,canResume:t,onResume:n})})]})}function kt({branch:e}){let[t,n]=(0,Y.useState)(null),r=(0,Y.useRef)(null);(0,Y.useEffect)(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]);let i=t===e,a=async()=>{r.current!==null&&clearTimeout(r.current),n(null);try{if(!navigator.clipboard?.writeText)throw Error(`Clipboard unavailable`);await navigator.clipboard.writeText(e),n(e),r.current=setTimeout(()=>n(null),2e3)}catch{f(`Could not copy branch. Select and copy: ${e}`)}};return(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-center gap-1`,children:[(0,X.jsx)(`span`,{"data-slot":`branch-chip`,className:`min-w-0 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-[11px] font-medium break-all`,children:e}),(0,X.jsxs)(`button`,{type:`button`,"aria-label":i?`Copied branch name`:`Copy branch name`,onClick:()=>void a(),className:`inline-flex min-h-11 shrink-0 items-center gap-1 rounded-sm px-2 text-xs font-medium text-foreground hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-link-foreground md:min-h-8`,children:[(0,X.jsx)(_,{className:`size-3.5`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{"aria-live":`polite`,children:i?`Copied`:`Copy`})]})]})}function At({run:e}){let t=le(),n=de(),i=r=>n===void 0?void 0:he(n,e.id,r,t),a=(0,Y.useMemo)(()=>ye(e,t),[e,t]),o=[],s=[],c=a.filter(e=>e.kind===`PR`);for(let t of c)o.push((0,X.jsx)(z,{reference:t,to:i(t),taskTitle:F(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`,conflictAction:(0,X.jsx)(ze,{run:e,prNumber:t.number})},_e(t)));let l=fe(e);l&&r(l)&&!c.some(e=>e.url===l)&&o.push((0,X.jsx)(z,{reference:{kind:`PR`,url:l},taskTitle:F(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},`pr`));let u=a.filter(e=>e.kind===`Issue`);for(let t of u)s.push((0,X.jsx)(z,{reference:t,to:i(t),taskTitle:F(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},_e(t)));let d=ue(e,t);if(d&&r(d)&&!u.some(e=>e.url===d)){let t=pe(d);s.push((0,X.jsx)(z,{reference:{kind:`Issue`,...t?{number:Number(t)}:{},url:d},to:t?i({kind:`Issue`,number:Number(t),url:d}):void 0,taskTitle:F(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},`issue`))}return o.length===0&&s.length===0?null:(0,X.jsx)(`div`,{"data-slot":`linked-references`,className:`flex min-w-0 flex-col gap-3`,children:[[`PR`,`PRs`,o],[`Issue`,`Issues`,s]].map(([e,t,n])=>n.length>0?(0,X.jsxs)(`div`,{"data-reference-kind":e,className:`grid min-w-0 grid-cols-[5rem_minmax(0,1fr)] items-center gap-x-2 gap-y-1`,children:[(0,X.jsx)(`span`,{className:`font-medium text-foreground`,children:t}),(0,X.jsx)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:n})]},e):null)})}function jt(){let e=we(),t=ve();return Le(t.data?.projects?.find(n=>n.id===(e??t.data?.bootProject)))}var Mt=e=>e.map(e=>`${e.name}: ${et(e.url)}`).join(`
2
+ `);function Nt(e){return jt().length>0||e.notify===!0}function Pt({run:e}){let t=jt(),n=t.length>0,r=ce(e.id),[i,o]=(0,Y.useState)(null),s=e.notify===!0;return!n&&!s?null:(0,X.jsxs)(X.Fragment,{children:[s?(0,X.jsxs)(k,{children:[(0,X.jsx)(D,{asChild:!0,children:(0,X.jsxs)(a,{variant:`outline`,size:`sm`,"data-slot":`notifying-chip`,className:`h-11 gap-1.5 md:h-[30px]`,"aria-label":n?`Notifying ${dt(t)} — webhook actions`:`Notifying — webhook actions`,title:n?Mt(t):void 0,children:[(0,X.jsx)(De,{tone:`success`}),(0,X.jsx)(`span`,{children:`Notifying`}),(0,X.jsx)(p,{"aria-hidden":`true`,className:`size-3.5`})]})}),(0,X.jsxs)(O,{align:`end`,"data-slot":`notifying-menu`,className:`w-[240px] max-w-[calc(100vw-2rem)] p-2`,children:[n?(0,X.jsx)(y,{"data-slot":`notifying-targets`,className:`flex flex-col gap-0.5 px-2 py-1.5 text-[11px] font-normal text-muted-foreground`,children:t.map(e=>(0,X.jsx)(`span`,{"data-webhook-target":e.id,className:`truncate`,title:et(e.url),children:e.name},e.id))}):null,n?(0,X.jsxs)(b,{className:`min-h-11`,onSelect:()=>o(`note`),children:[(0,X.jsx)(Me,{"aria-hidden":`true`}),` Send a note…`]}):null,(0,X.jsxs)(b,{variant:`destructive`,className:`min-h-11`,disabled:r.isPending,onSelect:()=>r.mutate({notify:!1},{onSuccess:()=>f(`Stopped notifying the webhook`),onError:e=>f(`Could not stop notifying. ${e.message}`,{tone:`danger`})}),children:[(0,X.jsx)(pt,{"aria-hidden":`true`}),` Stop notifying`]})]})]}):(0,X.jsxs)(a,{variant:`outline`,size:`sm`,"data-action":`handoff`,className:`size-11 px-0 md:h-[30px] md:w-auto md:px-2.5`,"aria-label":`Hand off to webhook`,onClick:()=>o(`handoff`),children:[(0,X.jsx)(lt,{"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`max-md:sr-only`,children:`Hand off`})]}),n?(0,X.jsx)(Ft,{mode:i,targets:t,pending:r.isPending,onOpenChange:e=>!e&&o(null),onSubmit:e=>r.mutate({notify:!0,...e?{message:e}:{}},{onSuccess:()=>{o(null),f(i===`note`?`Note sent to the webhook`:`Handed off to the webhook`)},onError:e=>f(`Could not hand off. ${e.message}`,{tone:`danger`})})}):null]})}function Ft({mode:e,targets:t,pending:n,onOpenChange:r,onSubmit:i}){let o=(0,Y.useId)(),s=(0,Y.useId)(),[c,l]=(0,Y.useState)(``);(0,Y.useEffect)(()=>{e!==null&&l(``)},[e]);let u=e===`note`,d=dt(t);return(0,X.jsx)(Ye,{open:e!==null,onOpenChange:e=>{e||l(``),r(e)},children:(0,X.jsx)(We,{"data-slot":`handoff-dialog`,className:`max-sm:top-auto max-sm:bottom-0 max-sm:left-0 max-sm:max-w-none max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-b-none max-sm:rounded-t-xl max-sm:border-x-0 max-sm:border-b-0 max-sm:pb-[max(1.5rem,env(safe-area-inset-bottom))] max-sm:data-[state=open]:slide-in-from-bottom max-sm:data-[state=open]:zoom-in-100 max-sm:data-[state=closed]:slide-out-to-bottom max-sm:data-[state=closed]:zoom-out-100`,children:(0,X.jsxs)(`form`,{className:`grid gap-4`,onSubmit:e=>{e.preventDefault(),i(c.trim())},children:[(0,X.jsxs)(ft,{className:`text-left`,children:[(0,X.jsx)(st,{children:u?`Send a note to ${t.length===1?`the webhook`:`the webhooks`}`:`Hand off to webhook`}),(0,X.jsx)(Ie,{children:(0,X.jsx)(`span`,{"data-webhook-destination":``,title:Mt(t),children:u?`${d} ${t.length===1?`gets`:`get`} this note with the task's current status.`:`${d} will start receiving this task's status updates. Add a note (optional).`})})]}),(0,X.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,X.jsx)(`label`,{htmlFor:o,className:`text-[13px] font-medium`,children:`Note`}),(0,X.jsx)(it,{id:o,"data-slot":`handoff-note`,"aria-describedby":s,rows:4,maxLength:1e5,className:`min-h-24`,placeholder:`e.g. Take over from here, ping me when the PR is green`,value:c,onChange:e=>l(e.target.value)}),(0,X.jsxs)(`p`,{id:s,className:`flex items-center gap-1.5 text-[12px] text-muted-foreground`,children:[(0,X.jsx)(je,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`The note goes to the webhook only, not to the agent.`]})]}),(0,X.jsxs)(tt,{className:`gap-2 max-sm:flex-col-reverse max-sm:[&>button]:h-11 max-sm:[&>button]:w-full`,children:[(0,X.jsx)(a,{type:`button`,variant:`ghost`,className:`sm:h-9`,onClick:()=>r(!1),children:`Cancel`}),(0,X.jsxs)(a,{type:`submit`,variant:`contrast`,className:`sm:h-9`,"data-action":`handoff-submit`,disabled:n||u&&c.trim()===``,children:[(0,X.jsx)(lt,{"aria-hidden":`true`}),u?`Send note`:`Hand off`]})]})]})})})}function It({runId:e,children:t}){let n=g(),r=(0,Y.useMemo)(()=>({runId:e}),[e]);return n?(0,X.jsx)(Lt,{runId:e,children:t}):(0,X.jsx)(Ze.Provider,{value:r,children:t})}function Lt({runId:e,children:t}){let{projectId:n}=S(),r=(0,Y.useMemo)(()=>({runId:e,...n?{projectId:n}:{}}),[e,n]);return(0,X.jsx)(Ze.Provider,{value:r,children:t})}function Rt({id:e}){return(0,X.jsxs)(L,{to:`/tasks/${e}`,"aria-label":`Parent task ${e}`,"data-slot":`mobile-parent-task-link`,className:`inline-flex shrink-0 items-center justify-center gap-1 rounded-sm px-2 text-[13px] text-muted-foreground [min-block-size:2.75rem] [min-inline-size:2.75rem] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring active:bg-muted active:text-foreground`,children:[(0,X.jsx)(x,{"aria-hidden":!0,className:`shrink-0 [block-size:1.2cap] [inline-size:auto]`}),`Parent`]})}function zt({id:e}){let t=be(e),n=t.data?F(t.data):e;return(0,X.jsxs)(`div`,{"data-slot":`parent-task`,className:`flex min-w-0 flex-wrap items-center gap-x-2 text-[13px] text-muted-foreground`,children:[(0,X.jsxs)(L,{to:`/tasks/${e}`,"aria-label":`Parent task ${e}`,title:`Parent · ${n}`,"data-slot":`parent-task-link`,className:`flex min-h-11 min-w-0 max-w-full items-center gap-2 rounded-sm text-muted-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring active:text-foreground`,children:[(0,X.jsx)(x,{"aria-hidden":!0,className:`h-[1.2cap] w-auto shrink-0`}),(0,X.jsx)(`span`,{className:`shrink-0`,children:`Parent`}),(0,X.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,X.jsx)(`span`,{className:`min-w-0 overflow-clip text-ellipsis whitespace-nowrap`,children:n})]}),t.isError?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{children:`Parent record unavailable or deleted`}),(0,X.jsx)(a,{variant:`outline`,className:`min-h-11`,onClick:()=>void t.refetch(),children:`Retry parent task`})]}):null]})}var Bt=3,Vt=(e,t)=>e.kind===t.kind&&e.number===t.number;function Ht(e,t,n=Bt){let r=t?e.findIndex(e=>Vt(e,t)):-1;if(e.length<=n||r<n)return{inline:e.slice(0,n),overflow:e.slice(n)};let i=[...e.slice(0,n-1),e[r]];return{inline:i,overflow:e.filter(e=>!i.includes(e))}}var Ut=(e,t)=>`/tasks/${e}/${t.kind}/${t.number}`;function Wt({tab:e}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(e.kind===`pr`?E:ee,{"aria-hidden":`true`,className:`mr-1 size-3.5 shrink-0`}),(0,X.jsx)(`span`,{className:`sr-only`,children:e.kind===`pr`?`Pull request`:`Issue`}),` #`,e.number,(0,X.jsx)(Pe,{kind:e.kind===`pr`?`PR`:`Issue`,number:e.number,className:`ml-1`})]})}function Gt(e,t){let n=e[0],r=e.length+ +!!t;return n?`Preview :${n.port}${r>1?` +${r-1}`:``}`:t?`Preview · agent`:`Preview`}function Kt({servers:e}){let t=Ke();if(t===null)return null;let n=t.agentLive===!0,r=e[0],i=e.length+ +!!n===1?r?{port:r.port}:{agent:!0}:{};return(0,X.jsxs)(a,{variant:`outline`,size:`sm`,"data-slot":`preview-toggle`,className:`max-md:h-11`,"aria-pressed":t.open,onClick:()=>t.openPane(i),children:[(0,X.jsx)(Ce,{"aria-hidden":`true`}),Gt(e,n),t.live?(0,X.jsx)(De,{tone:`success`,"aria-label":`Preview is live`}):null]})}function qt({run:e,tab:t=`session`,onMarkedUnread:n}){let r=o(e),a=q(e),[s,c]=(0,Y.useState)(!1),[l,u]=(0,Y.useState)(!1),d=Jt(e,n),f=oe(),p=ie(),ee=xt(e,{queuePosition:e.status===`queued`?Se(f.data??[]).get(e.id):void 0}),m=Be(),h=rt(),g=m!==null&&!h?m:null,_=g!==null,{referenceProjectId:te,repoBase:v,requests:y}=wt(e),ne=(0,Y.useMemo)(()=>ge(e,v),[e,v]),x=typeof t==`object`?t:null,{inline:S,overflow:C}=Ht(ne,x),w=(0,Y.useRef)(null),T=x?`${x.kind}#${x.number}`:null;(0,Y.useEffect)(()=>{!T||h||w.current?.querySelector(`[aria-current="page"]`)?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[T,S.map(e=>`${e.kind}#${e.number}`).join(`,`),h]);let E=e.worktreePath&&p.data?.capabilities?.preview===!0?(0,X.jsx)(Kt,{servers:e.previewServers??[]}):null,A=(0,X.jsx)(Qt,{run:e,actions:d,onOpenChooser:()=>u(!0),onToggleNotes:()=>c(e=>!e)}),j=!e.archiveBlocker&&a.archive&&(t!==`session`||!qe(e))?(0,X.jsx)(Z,{run:e}):null,re=Nt(e);return(0,X.jsx)(Ne,{projectId:te,repoBase:v,requests:y,children:(0,X.jsxs)(`header`,{"data-slot":`run-header`,className:i(`relative z-20 bg-background px-[18px] md:px-9 md:pt-7`,_?`pt-0`:`pt-[18px]`,t===`session`&&`md:sticky md:top-0`),children:[e.archived&&e.autoArchive?.reason===`pull-requests-merged`&&e.autoArchive.archivedAt===e.archivedAt?(0,X.jsx)(`p`,{"data-slot":`auto-archive-reason`,className:`text-[13px] text-muted-foreground`,children:`Archived automatically after all associated PRs merged.`}):null,(0,X.jsx)(yt,{run:e}),(0,X.jsxs)(`div`,{className:`w-full`,children:[e.delegation?.role===`worker`?(0,X.jsx)(zt,{id:e.delegation.parentRunId}):null,g?(0,X.jsxs)(Re,{slot:g,children:[(0,X.jsx)(Zt,{run:e}),e.delegation?.role===`worker`?(0,X.jsx)(Rt,{id:e.delegation.parentRunId}):null,A]}):(0,X.jsxs)(`div`,{"data-slot":`run-title-row`,className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 md:flex-nowrap`,children:[(0,X.jsx)(`p`,{"data-slot":`session-kind`,className:`text-[12px] font-semibold tracking-[0.14em] text-muted-foreground uppercase md:hidden`,children:e.delegation?.role===`worker`?`Worker session`:e.delegation?.role===`root`?`Parent session`:`Task session`}),(0,X.jsx)(Xt,{run:e}),(0,X.jsx)(ut,{dot:r.tone,shape:r.shape,pulse:r.pulse,className:`max-md:hidden`,children:St(ee)}),(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1 md:gap-2.5`,children:[j,E,(0,X.jsx)(Pt,{run:e}),A]})]}),g&&(j||E||re)?(0,X.jsxs)(`div`,{"data-slot":`run-mobile-actions`,className:`flex flex-wrap items-center gap-2 pt-2`,children:[j,E,(0,X.jsx)(Pt,{run:e})]}):null,(0,X.jsxs)(`div`,{ref:w,"data-slot":`run-tabs`,"data-phone-bar":_||void 0,className:`mt-3 flex flex-wrap items-end gap-1 border-b border-border md:mt-5 max-md:flex-nowrap max-md:overflow-x-auto max-md:border-b-0 max-md:shadow-[inset_0_-1px_0_var(--border)] max-md:gap-0 max-md:[&>*]:mb-0 max-md:[&>*]:shrink-0 max-md:[&>a]:min-h-11 max-md:[&>a]:px-3.5 max-md:[&>a]:text-[13.5px]`,children:[(0,X.jsx)(R,{to:`/tasks/${e.id}`,active:t===`session`,replace:_,children:`Session`}),(0,X.jsx)(R,{to:`/tasks/${e.id}/changes`,active:t===`changes`,replace:_,count:e.diffStat&&e.diffStat.files>0?e.diffStat.files:void 0,children:`Changes`}),(0,X.jsx)(R,{to:`/tasks/${e.id}/commits`,active:t===`commits`,replace:_,children:`Commits`}),(0,X.jsx)(R,{to:`/tasks/${e.id}/files`,active:t===`files`,replace:_,children:`Files`}),S.map(t=>(0,X.jsx)(R,{to:Ut(e.id,t),active:x!==null&&Vt(t,x),replace:_,children:(0,X.jsx)(Wt,{tab:t})},`${t.kind}-${t.number}`)),C.length>0?(0,X.jsxs)(k,{children:[(0,X.jsxs)(D,{"data-slot":`run-tabs-more`,"aria-label":`${C.length} more linked items`,className:`-mb-px flex h-8 items-center rounded-t-md border-b-2 border-transparent px-3 text-[13px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-link-foreground max-md:min-h-11 max-md:px-3.5 max-md:text-[13.5px]`,children:[`+`,C.length]}),(0,X.jsx)(O,{align:`end`,children:C.map(t=>(0,X.jsx)(b,{asChild:!0,children:(0,X.jsx)(L,{to:Ut(e.id,t),replace:_,children:(0,X.jsx)(Wt,{tab:t})})},`${t.kind}-${t.number}`))})]}):null]}),s?(0,X.jsx)(en,{runId:e.id,onClose:()=>c(!1)}):null,l?(0,X.jsx)(Ot,{run:e,canResume:q(e).terminal,onResume:()=>d.terminal.mutate(),onClose:()=>u(!1)}):null]}),(0,X.jsx)($t,{run:e,actions:d})]})})}function Jt(e,t){let n=s(),r=Ee(),[i,a]=(0,Y.useState)(null),o=()=>n.invalidateQueries({queryKey:P.runs.all}),c=e=>f(e.message,{tone:`danger`}),l=ae(),u={isPending:l.isPending,mutate:()=>l.mutate({id:e.id,pinned:!e.pinned})},d=re();return{pin:u,markUnread:{isPending:d.isPending,mutate:()=>{t?.(),d.mutate(e.id,{onError:c})}},delete:M({mutationFn:()=>v(e.id),onSuccess:()=>{o(),r(`/`)},onError:c}),terminal:Tt(e),confirming:i,setConfirming:a}}function Yt(e){let t=N(e.id),n=F(e);return{title:n,editor:at(n,e=>t.mutate({title:e},{onError:e=>f(e.message,{tone:`danger`})}))}}function Xt({run:e}){let{title:t,editor:n}=Yt(e);return n.editing?(0,X.jsx)($e,{editor:n,className:`flex-1 text-[16px] font-semibold`}):(0,X.jsxs)(`span`,{className:`group flex min-w-0 items-center gap-1`,children:[(0,X.jsx)(`h1`,{className:`line-clamp-2 min-w-0 break-words text-2xl font-semibold tracking-tight`,title:e.task,children:t}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Rename task`,onClick:n.begin,className:`shrink-0 rounded-sm p-1 text-soft-foreground opacity-0 transition-opacity group-hover:opacity-100 hover:bg-muted hover:text-foreground focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,X.jsx)(Qe,{className:`size-3.5`,"aria-hidden":`true`})})]})}function Zt({run:e}){let{title:t,editor:n}=Yt(e);return(0,X.jsxs)(Ae,{open:n.editing,onOpenChange:e=>{e?n.begin():n.commit()},children:[(0,X.jsx)(`div`,{"data-slot":`mobile-run-title`,className:`flex min-w-0 flex-1 flex-col gap-px`,children:(0,X.jsx)(`h1`,{className:`truncate text-[15px] leading-tight font-semibold text-foreground`,title:e.task,children:t})}),(0,X.jsx)(Oe,{asChild:!0,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Rename task`,className:`flex size-11 shrink-0 items-center justify-center rounded-sm text-soft-foreground hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,X.jsx)(Qe,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,X.jsx)(ke,{align:`end`,className:`w-64 max-w-[calc(100vw-16px)] p-2`,onEscapeKeyDown:e=>{e.preventDefault(),n.cancel()},children:(0,X.jsx)($e,{editor:n,className:`text-[16px] font-semibold`})})]})}function Qt({run:e,actions:t,onToggleNotes:n,onOpenChooser:r}){let i=q(e),o=J(e),s=N(e.id),c=(0,Y.useId)();return(0,X.jsxs)(k,{children:[(0,X.jsx)(D,{asChild:!0,children:(0,X.jsx)(a,{variant:`ghost`,size:`icon-sm`,className:`size-11`,"aria-label":`Run actions`,children:(0,X.jsx)(u,{"aria-hidden":`true`})})}),(0,X.jsxs)(O,{align:`end`,"data-slot":`run-actions-menu`,className:`w-[270px] max-w-[calc(100vw-2rem)] p-3`,children:[(0,X.jsx)(y,{className:`px-2 py-3 text-[12px] font-normal text-muted-foreground`,children:`TASK ACTIONS`}),(0,X.jsxs)(b,{onSelect:n,children:[(0,X.jsx)(ot,{"aria-hidden":`true`}),` Notes / handoff`]}),(0,X.jsx)(Ot,{run:e,canResume:i.terminal,onResume:()=>t.terminal.mutate(),onOpen:r}),o?(0,X.jsxs)(b,{onSelect:()=>void Q(o,`Command copied to clipboard.`),children:[(0,X.jsx)(_,{"aria-hidden":`true`}),` Copy resume command`]}):null,i.markUnread?(0,X.jsxs)(b,{disabled:t.markUnread.isPending,onSelect:()=>t.markUnread.mutate(),children:[(0,X.jsx)(mt,{"aria-hidden":`true`}),` Mark unread`]}):null,i.pin?(0,X.jsxs)(w,{"data-slot":`pin-run`,className:`min-h-11`,checked:!!e.pinned,disabled:t.pin.isPending,onCheckedChange:()=>t.pin.mutate(),children:[e.pinned?(0,X.jsx)(ht,{"aria-hidden":`true`}):(0,X.jsx)(A,{"aria-hidden":`true`}),e.pinned?`Unpin task`:`Pin task`]}):null,(0,X.jsx)(C,{}),(0,X.jsx)(y,{className:`text-xs text-muted-foreground`,children:`AFTER DONE`}),(0,X.jsx)(w,{"data-slot":`archive-when-done`,className:`min-h-11`,checked:e.archiveWhenDone===!0,disabled:s.isPending,onCheckedChange:e=>s.mutate({archiveWhenDone:e},{onError:e=>f(e.message,{tone:`danger`})}),children:`Archive when Done`}),(0,X.jsx)(w,{"data-slot":`auto-merge-pr`,className:`min-h-11`,checked:e.autoMergePr===!0,disabled:s.isPending,"aria-describedby":c,onCheckedChange:e=>s.mutate({autoMergePr:e},{onError:e=>f(e.message,{tone:`danger`})}),children:`Auto-merge PR`}),(0,X.jsx)(`p`,{id:c,className:`text-xs text-muted-foreground [padding-inline:0.5rem] [padding-block:0.5rem]`,children:`After Done, auto-merge can mark a draft PR ready. It waits for current-head CI and GitHub rules. Merge comes before archive.`}),i.deleteRun?(0,X.jsx)(C,{}):null,i.deleteRun?(0,X.jsxs)(b,{variant:`destructive`,onSelect:()=>t.setConfirming(`delete`),children:[(0,X.jsx)(ne,{"aria-hidden":`true`}),` Delete task…`]}):null]})]})}function $t({run:e,actions:t}){let n=t.confirming;return(0,X.jsx)(Fe,{open:n!==null,onOpenChange:e=>!e&&t.setConfirming(null),children:(0,X.jsxs)(H,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,X.jsxs)(K,{children:[(0,X.jsx)(V,{className:`text-danger`,children:`Delete task permanently?`}),(0,X.jsx)(B,{children:(0,X.jsxs)(X.Fragment,{children:[`Delete “`,(0,X.jsx)(`span`,{className:`font-medium text-foreground`,title:F(e),children:F(e)}),`” and its transcript, worktree and branch. This cannot be undone.`]})})]}),(0,X.jsxs)(W,{children:[(0,X.jsx)(G,{children:`Cancel`}),(0,X.jsx)(U,{className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{t.delete.mutate(),t.setConfirming(null)},children:`Delete task`})]})]})})}function en({runId:e,onClose:t}){let n=xe(e);return(0,X.jsxs)(`div`,{"data-slot":`notes-panel`,className:`my-5 rounded-xl border border-border bg-card p-6`,children:[(0,X.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,X.jsx)(`h2`,{className:`text-lg font-medium`,children:`Notes / handoff`}),(0,X.jsx)(a,{variant:`ghost`,size:`icon`,"aria-label":`Close notes`,onClick:t,children:(0,X.jsx)(m,{})})]}),n.isPending?(0,X.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`Loading notes…`}):n.isError?(0,X.jsx)(`p`,{className:`text-xs text-danger`,children:n.error.message}):n.data.trim().length>0?(0,X.jsx)(It,{runId:e,children:(0,X.jsx)(ct,{children:n.data})}):(0,X.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`No notes yet — the handoff file is seeded when the task starts.`}),(0,X.jsxs)(`div`,{className:`mt-4 flex gap-3`,children:[(0,X.jsx)(a,{variant:`outline`,disabled:!n.data?.trim(),onClick:()=>void Q(n.data??``,`Notes copied`),children:`Copy notes`}),(0,X.jsx)(a,{variant:`outline`,onClick:t,children:`Close`})]})]})}export{Dt as a,xt as c,At as i,Z as l,It as n,Tt as o,kt as r,wt as s,qt as t};
@@ -0,0 +1 @@
1
+ [data-slot=task-confirmation]{border-radius:12px;padding:24px}[data-slot=task-confirmation] [data-slot=alert-dialog-title]{font-size:20px;font-weight:500}[data-slot=task-confirmation] [data-slot=alert-dialog-description]{font-size:13px;line-height:1.6}@media (width<=767px){[data-slot=notes-panel],.task-action-panel{padding:18px}}[data-slot=run-actions-menu] [role^=menuitem]>svg{display:none}@media (hover:hover) and (pointer:fine){[data-slot=parent-task-link]:hover{color:var(--foreground);text-underline-offset:.2em;text-decoration:underline}}@media (width<=767px){[data-slot=run-title-row]{grid-template-columns:minmax(0,1fr) auto auto;gap:6px;display:grid}[data-slot=run-title-row] [data-slot=session-kind]{grid-area:1/1}[data-slot=run-title-row]>.group{grid-area:2/1/auto/-1;max-width:100%}[data-slot=run-title-row]>.group h1{font-size:20px;line-height:1.4}[data-slot=run-title-row]>[data-slot=pill]{grid-area:1/2}[data-slot=run-title-row]>span:last-child{grid-area:1/3}}[data-slot=notes-panel] .thread-markdown{color:var(--muted-foreground);font-size:13px;line-height:1.6}[data-slot=notes-panel] .thread-markdown :is(h1,h2,h3){color:var(--foreground);margin-block:20px 8px;font-size:16px;font-weight:400;line-height:1.5}[data-slot=notes-panel]>div:first-child h2,.task-action-panel h2{font-size:18px;font-weight:400}[data-slot=notes-panel] button,.task-action-panel button{font-size:13px;font-weight:400}.task-action-panel h3{font-size:16px;font-weight:400}[data-slot=run-tabs]{gap:calc(var(--spacing) * 6)}[data-slot=run-tabs]>a,[data-slot=run-tabs]>[data-slot=run-tabs-more]{height:44px;padding-inline:4px;font-size:12px;font-weight:400}[data-slot=run-tabs]>a[aria-current=page]{color:var(--accent-text);border-block-end-color:var(--accent-strong)}@media (width<=767px){[data-slot=run-tabs]{gap:calc(var(--spacing) * 5)}}[data-slot=run-tabs]{margin-block-start:calc(var(--spacing) * 3)}[data-slot=run-tabs]>a[aria-current=page]{font-weight:600}@media (width<=767px){[data-slot=run-tabs][data-phone-bar]{margin-block-start:0}[data-slot=run-tabs][data-phone-bar]>a,[data-slot=run-tabs][data-phone-bar]>[data-slot=run-tabs-more]{color:var(--soft-foreground);font-weight:500}[data-slot=run-tabs][data-phone-bar]>a[aria-current=page]{color:var(--foreground);border-block-end-color:var(--foreground);border-block-end-width:2px;font-weight:600}[data-slot=run-tabs][data-phone-bar]>a [data-slot=tab-count]{color:var(--soft-foreground);font-size:11.5px}}@media (width>=768px){[data-slot=run-header]{padding-block-start:calc(var(--spacing) * 5.5)}[data-slot=run-title-row]{flex-wrap:nowrap;align-items:center;gap:12px;display:flex}[data-slot=run-title-row]>.group{flex:1;min-width:0;max-width:none}[data-slot=run-title-row] h1{letter-spacing:-.7px;font-size:25px}[data-slot=run-title-row]>span:last-child{margin-inline-start:0}}[data-slot=run-header]{container-type:inline-size}@container (width<=240px){[data-slot=run-title-row]{flex-wrap:wrap;display:flex}[data-slot=run-title-row]>.group{flex-basis:100%;order:1}}
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,M as i,t as a}from"./button-CeupvoKG.js";import{Aa as o,F as s,Ha as c,Mt as l,N as u,Ni as d,P as f,Qr as p,St as m,ht as h,qr as g,xt as _,zt as ee}from"./dropdown-menu-COj_J5wd.js";import{$ as v,Bt as y,In as b,L as x,Nt as S,i as C,t as te}from"./centered-state-hDsyXrnH.js";import{L as w}from"./live-protocol-Uce2NwEX.js";import{o as T}from"./status-dot-1PR0i69P.js";import{An as E,Nn as D,Qt as O,Rn as k,gt as ne,in as A,jn as j,on as M}from"./index-BOfE8pyD.js";import{t as N}from"./skill-empty-hint-oOtzR3v0.js";var P=e(t(),1),F=[[`.ai`,`cezar`,`skills`],[`.ai`,`skills`],[`.claude`,`skills`],[`.agents`,`skills`],[`skills`]];function I(e){let t=e.split(`/`).slice(0,-1);if((e===`SKILL.md`||e.endsWith(`/SKILL.md`)||t.at(-1)===`commands`)&&t.pop(),t[0]===`plugins`&&t[1])return{kind:`plugin`,name:t[1]};for(let e of F){let n=re(t,e);if(n!==-1&&(e.length>1||n===t.length-1)){t.splice(n,e.length);break}}return t.length>0?{kind:`directory`,name:t.join(`/`)}:null}function re(e,t){for(let n=e.length-t.length;n>=0;n--)if(t.every((t,r)=>e[n+r]===t))return n;return-1}var L=[{id:`project`,label:`This project`,sources:new Set([`ai`,`cezar`,`agents`])},{id:`global`,label:`Global`,sources:new Set([`global`])},{id:`builtin`,label:`Built-in`,sources:new Set([`builtin`])}],R=(e,t,n,r)=>({key:e,label:t,kind:n,locked:r,items:[],children:[]});function ie(e){let t=L.map(e=>R(`source\u0000${e.id}`,e.label,`source`,!0)),n=new Map;for(let r of e){let{skill:e}=r;if(!e.team){let n=L.findIndex(t=>t.sources.has(e.source));t[n===-1?0:n].items.push(r);continue}let{repo:i,path:a}=e.team,o=n.get(i);o||(o=R(`repo\u0000${i}`,i,`repo`,!1),n.set(i,o));let s=I(a);if(!s){o.items.push(r);continue}let c=`${o.key}\u0000${s.kind}\u0000${s.name}`,l=o.children.find(e=>e.key===c);l||(l=R(c,s.name,s.kind,!1),o.children.push(l)),l.items.push(r)}for(let e of n.values())e.children.sort((e,t)=>e.label.localeCompare(t.label));let r=[...n.values()].sort((e,t)=>e.label.localeCompare(t.label));return[t[0],...r,t[1],t[2]].filter(e=>e.items.length>0||e.children.length>0)}function z(e){return e.flatMap(e=>[e.key,...z(e.children)])}function B(e){return[...e.items,...e.children.flatMap(B)]}function V(e,t){let n=B(e);if(e.locked)return{enabled:n.length,total:n.length,state:`on`,refs:[]};let r=[],i=0;for(let{skill:e}of n)e.team&&(r.push({repo:e.team.repo,name:e.name}),t(e)&&i++);let a=i===0?`off`:i===r.length?`on`:`mixed`;return{enabled:i,total:r.length,state:a,refs:r}}function H(e,t){if(t.trim()===``)return null;let n=new Set,r=(e,i)=>{let a=[...i,e.label];for(let{skill:r,key:i}of e.items){let e=[r.description??``,...a].join(` `);D(r.name,e,t)>0&&n.add(i)}for(let t of e.children)r(t,a)};for(let t of e)r(t,[]);return n}function U(e,t){let n=[],r=(e,i)=>{let a=[...i,e.key],o=e.items.some(e=>t.has(e.key));o&&n.push(...a.filter(e=>!n.includes(e)));for(let t of e.children)o=r(t,a)||o;return o};for(let t of e)r(t,[]);return n}function W(e){let t=e?.disabledTeamSkills;if(!Array.isArray(t))return[];let n=[];for(let e of t){let t=w.safeParse(e);t.success&&n.push(t.data)}return n}var G=(e,t)=>e.repo===t.repo&&e.name===t.name;function K(e){return e.team?{repo:e.team.repo,name:e.name}:void 0}function q(e,t,n){let r=new Map;for(let e of t)r.has(e.name)||r.set(e.name,e);let i=[],a=new Set;for(let t of e){let e=K(t);if(!e)continue;let o=JSON.stringify([e.repo,e.name]);if(a.has(o))continue;a.add(o);let s=n(e),c=r.get(t.name),l=c?K(c):void 0;s&&c&&!(l&&G(l,e))?i.push({skill:t,on:s,hiddenBy:c.team?.repo??c.source}):i.push({skill:t,on:s})}return i}var J=new Map;function ae(e){let t=J.get(e);return t||(t={chain:Promise.resolve(),latest:0},J.set(e,t)),t}function oe(e){let t=c(),n=v(e),[r,i]=P.useState(0),a=P.useMemo(()=>W(n.data),[n.data]),o=P.useCallback(e=>!a.some(t=>G(t,e)),[a]),s=P.useCallback(n=>{let r=[e,`ui-state`],a=[e,`skills`],o=t.getQueryData(r),s=n(W(o));t.setQueryData(r,{...o,disabledTeamSkills:s});let c=ae(e),l=++c.latest;i(e=>e+1),c.chain=c.chain.then(async()=>{try{let n=await g({disabledTeamSkills:s},e);l===c.latest&&(t.setQueryData(r,n),t.invalidateQueries({queryKey:a}))}catch(e){d(e instanceof Error?e.message:String(e),{tone:`danger`}),l===c.latest&&t.invalidateQueries({queryKey:r})}finally{i(e=>e-1)}})},[e,t]);return{disabled:a,isOn:o,toggle:P.useCallback(e=>{let t={repo:e.repo,name:e.name};s(e=>e.some(e=>G(e,t))?e.filter(e=>!G(e,t)):[...e,t])},[s]),setMany:P.useCallback((e,t)=>{let n=e.map(e=>({repo:e.repo,name:e.name}));s(e=>{if(t)return e.filter(e=>!n.some(t=>G(e,t)));let r=[...e];for(let e of n)r.some(t=>G(t,e))||r.push(e);return r})},[s]),pending:r>0,ready:n.isSuccess}}var Y=n(),X=`__bm`,se=`__import`,Z=e=>e.team?`${e.team.repo}\u0000${e.name}`:e.path,ce=e=>e.source!==`team`&&e.source!==`builtin`;function le(){return(0,Y.jsx)(`div`,{"data-route":`skills`,className:`mx-auto min-h-full w-full px-[18px] py-6 md:p-9`,children:(0,Y.jsx)(ue,{})})}function ue(){let e=S(),t=y(),n=x(),[r]=o(),[a,s]=(0,P.useState)(``),c=oe(i()),u=de(),d=(0,P.useMemo)(()=>e.data??[],[e.data]),f=(0,P.useMemo)(()=>n.data??[],[n.data]),p=n.isSuccess,m=(0,P.useMemo)(()=>fe(d,p?f:null,c.isOn),[d,f,p,c.isOn]),h=(0,P.useMemo)(()=>ie(m),[m]),g=new Map;for(let e of m)g.set(e.skill.name,(g.get(e.skill.name)??0)+1);let _=e=>(g.get(e.name)??0)>1&&e.team!==void 0,v=e=>{let t=K(e);return t&&p?c.isOn(t):!0},b=e=>{let t=K(e);return t?{ariaLabel:_(e)?`Enable ${e.name} from ${t.repo}`:`Enable ${e.name}`,checked:v(e),disabled:!p||!c.ready,locked:!1,onCheckedChange:()=>c.toggle(t)}:{ariaLabel:`${e.name} is always enabled`,checked:!0,disabled:!0,locked:!0,onCheckedChange:()=>{}}},C=e=>`/skills?skill=${encodeURIComponent(e.name)}${_(e)?`&repo=${encodeURIComponent(e.team.repo)}`:``}`,w=r.get(`skill`),E=pe(m,w,r.get(`repo`),v)?.key??null,D=me(h,E),O=e=>{s(e);let t=H(h,e);t&&t.size>0&&D.open(U(h,t))};if(e.isError)return(0,Y.jsx)(te,{icon:(0,Y.jsx)(l,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:e.error.message});let k=w===X,A=p&&f.length===0&&!e.isPending,j=e.isPending?[]:Q({tree:h,matches:H(h,a),isOpen:D.isOpen,onFold:D.toggle,openKey:E,workflows:t.data?.workflows??[],activationFor:b,linkFor:C,groupActivationFor:e=>V(e,v),switchable:p&&c.ready,onActivate:c.setMany});return(0,Y.jsxs)(`div`,{"data-slot":`skills-section`,className:`@container flex min-w-0 flex-col gap-[22px]`,children:[(0,Y.jsxs)(`header`,{className:`flex flex-col gap-4 @min-[700px]:flex-row @min-[700px]:items-center @min-[700px]:justify-between`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h1`,{className:`text-[25px] font-semibold md:text-[30px]`,children:`Skills`}),(0,Y.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground md:text-[13px]`,children:`Markdown playbooks your agents can follow.`})]}),(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,Y.jsxs)(T,{to:k?`/skills`:`/skills?skill=${X}`,"data-slot":`bookmarklets-row`,"aria-current":k?`page`:void 0,"aria-expanded":k,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium aria-[current=page]:bg-accent-strong/10 hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,Y.jsx)(ee,{"aria-hidden":`true`,className:`size-4 text-link-foreground`}),`Run from GitHub`]})})]}),k?(0,Y.jsx)(`section`,{"data-slot":`skills-bookmarklets`,className:`min-w-0 rounded-xl border border-border bg-card p-5`,children:(0,Y.jsx)(ne,{skills:m.filter(e=>v(e.skill)&&!e.hiddenBy).map(e=>e.skill)})}):null,(0,Y.jsx)(ge,{query:a,onQuery:O,refreshing:u.isPending,onRefresh:()=>u.mutate(),onFoldAll:D.setAll}),(0,Y.jsxs)(`section`,{"data-slot":`skills-list`,"aria-label":`Skills`,className:`flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-card p-2 @min-[520px]:p-3`,children:[n.isError?(0,Y.jsx)(_e,{message:n.error.message,retrying:n.isFetching,onRetry:()=>void n.refetch()}):null,(0,Y.jsx)(`div`,{"data-slot":`skill-rows`,className:`min-h-0 overflow-y-auto md:max-h-[calc(100dvh-260px)]`,children:e.isPending?(0,Y.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`min-h-72 p-3 text-[13px] text-muted-foreground`,children:`Loading skills…`}):j.length>0?(0,Y.jsxs)(`table`,{"data-slot":`skills-table`,className:`w-full table-fixed border-collapse text-left`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`border-b border-border text-[12px] text-muted-foreground`,children:[(0,Y.jsx)(`th`,{scope:`col`,className:`px-2 py-2 font-semibold`,children:`Skill / group`}),(0,Y.jsx)(`th`,{scope:`col`,className:`hidden w-[30%] px-2 py-2 font-semibold @min-[520px]:table-cell`,children:`Used by`}),(0,Y.jsx)(`th`,{scope:`col`,className:`w-[116px] px-2 py-2 text-right font-semibold`,children:`Enabled`})]})}),(0,Y.jsx)(`tbody`,{children:j})]}):(0,Y.jsx)(`p`,{className:`px-2.5 py-2 text-xs leading-relaxed text-soft-foreground`,children:m.length>0?`(no skills match)`:(0,Y.jsx)(N,{})})}),A?(0,Y.jsxs)(`p`,{"data-slot":`skills-team-empty`,className:`px-2.5 py-2 text-xs leading-relaxed text-soft-foreground`,children:[`No team skills. To add a source, list it under `,(0,Y.jsx)(`span`,{className:`font-mono`,children:`skillsRepos`}),` in`,` `,(0,Y.jsx)(`span`,{className:`font-mono`,children:`.ai/cezar/config.json`}),`, then Refresh.`]}):null]})]})}function de(){let e=c();return b({mutationFn:()=>p(),onSuccess:t=>{e.setQueryData(C.skills,t),e.invalidateQueries({queryKey:C.importableSkills}),d(`Team skills refreshed.`)},onError:e=>d(e.message,{tone:`danger`})})}function fe(e,t,n){let r=new Set(e.filter(ce).map(e=>e.name)),i=t?q(t.filter(e=>!r.has(e.name)),e,n):[],a=(e,t)=>({skill:e,key:Z(e),...t?{hiddenBy:t}:{}}),o=new Set((t??[]).map(Z)),s=[...e.filter(e=>e.source!==`team`||!o.has(Z(e))).map(e=>a(e)),...i.map(e=>a(e.skill,e.on?e.hiddenBy:void 0))].sort((e,t)=>e.skill.name.localeCompare(t.skill.name)),c=new Map(s.map(e=>[e.skill,e]));return j(s.map(e=>e.skill)).map(e=>c.get(e))}function pe(e,t,n,r){if(t===null||t===X)return null;if(t===se)return e.find(e=>!r(e.skill))??null;let i=e.filter(e=>e.skill.name===t);return i.find(e=>n===null||e.skill.team?.repo===n)??i[0]??null}function me(e,t){let[n,r]=(0,P.useState)({}),i=e=>r(t=>({...t,...Object.fromEntries(e.map(e=>[e,!0]))})),a=t?U(e,new Set([t])).join(``):``;return(0,P.useEffect)(()=>{a&&r(e=>({...e,...Object.fromEntries(a.split(``).map(e=>[e,!0]))}))},[a]),{isOpen:(e,t)=>n[e.key]??t===0,toggle:(e,t)=>r(n=>({...n,[e]:t})),open:i,setAll:t=>r(Object.fromEntries(z(e).map(e=>[e,t])))}}function Q(e){let t=[],n=t=>e.matches===null||e.matches.has(t.key),r=e=>e.items.some(n)||e.children.some(r),i=(a,o)=>{if(!r(a))return;let s=e.isOpen(a,o);if(t.push((0,Y.jsx)(ye,{node:a,depth:o,open:s,onFold:()=>e.onFold(a.key,!s),activation:e.groupActivationFor(a),switchable:e.switchable,onActivate:e.onActivate},a.key)),s){for(let r of a.items.filter(n)){let n=r.key===e.openKey,i=k(e.workflows,r.skill.name),a=e.activationFor(r.skill);t.push((0,Y.jsx)(xe,{item:r,depth:o+1,href:n?`/skills`:e.linkFor(r.skill),expanded:n,usedBy:i,activation:a},r.key)),n&&t.push((0,Y.jsx)(he,{skill:r.skill,usedBy:i,activation:a},`${r.key}\u0000detail`))}for(let e of a.children)i(e,o+1)}};for(let t of e.tree)i(t,0);return t}function he({skill:e,usedBy:t,activation:n}){return(0,Y.jsx)(`tr`,{"data-slot":`skill-detail-row`,children:(0,Y.jsx)(`td`,{colSpan:3,className:`border-b border-border px-3 pb-5 @min-[520px]:px-5`,children:(0,Y.jsx)(`div`,{"data-slot":`skills-detail`,className:`min-w-0 rounded-lg border border-border bg-background p-4 md:p-5`,children:(0,Y.jsx)(A,{skill:e,usedBy:t,activation:n})})})})}function ge({query:e,onQuery:t,refreshing:n,onRefresh:i,onFoldAll:o}){return(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsxs)(`div`,{className:`sw-search relative min-w-0 basis-full sm:basis-auto sm:flex-1`,children:[(0,Y.jsx)(m,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,Y.jsx)(O,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:e,onChange:e=>t(e.target.value),className:`h-11 min-w-0 bg-card pl-9 text-xs`})]}),(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,title:`git fetch the team skills repos`,disabled:n,onClick:i,className:`flex h-11 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-55`,children:[(0,Y.jsx)(_,{"aria-hidden":`true`,className:r(`size-3`,n&&`motion-safe:animate-spin`)}),n?`Refreshing…`:`Refresh`]}),(0,Y.jsx)(a,{type:`button`,variant:`outline`,"data-slot":`skills-expand-all`,className:`h-11 text-xs`,onClick:()=>o(!0),children:`Expand groups`}),(0,Y.jsx)(a,{type:`button`,variant:`outline`,"data-slot":`skills-collapse-all`,className:`h-11 text-xs`,onClick:()=>o(!1),children:`Collapse groups`})]})}function _e({message:e,retrying:t,onRetry:n}){return(0,Y.jsxs)(`div`,{role:`alert`,"data-slot":`skills-importable-error`,className:`flex flex-col items-start gap-2 rounded-lg border border-border bg-background p-3 text-xs text-muted-foreground`,children:[(0,Y.jsxs)(`span`,{children:[`Could not load the team skills, so they cannot be switched right now. Your saved choice is kept.`,` `,e]}),(0,Y.jsx)(a,{type:`button`,variant:`outline`,size:`sm`,className:`min-h-11`,disabled:t,onClick:n,children:`Retry`})]})}var ve={repo:`repository`,plugin:`plugin`,directory:`directory`},$=e=>({paddingInlineStart:`${e*16}px`});function ye({node:e,depth:t,open:n,onFold:i,activation:a,switchable:o,onActivate:c}){let l=n?f:s,u=ve[e.kind],d=e.locked||o;return(0,Y.jsxs)(`tr`,{"data-slot":`skill-group-row`,"data-group":e.label,"data-kind":e.kind,"data-level":t,className:r(`border-b border-border`,t===0&&`bg-muted/40`),children:[(0,Y.jsx)(`th`,{scope:`row`,className:`min-w-0 p-0 text-left font-normal`,children:(0,Y.jsx)(`span`,{className:`flex min-w-0`,style:$(t),children:(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`skill-group-toggle`,"aria-expanded":n,onClick:i,className:`flex min-h-11 min-w-0 flex-1 items-center gap-2 rounded-md px-2 text-left hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-link-foreground`,children:[(0,Y.jsx)(l,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),(0,Y.jsx)(`span`,{className:r(`min-w-0 [overflow-wrap:anywhere]`,t===0?`text-[13px] font-semibold`:`text-[13px] font-medium`),children:e.label}),u?(0,Y.jsx)(`span`,{className:`shrink-0 text-[12px] text-soft-foreground`,children:u}):null]})})}),(0,Y.jsx)(`td`,{"aria-hidden":`true`,className:`hidden @min-[520px]:table-cell`}),(0,Y.jsx)(`td`,{className:`px-1 py-0 text-right`,children:(0,Y.jsxs)(`span`,{className:`inline-flex items-center justify-end gap-1`,children:[(0,Y.jsx)(`span`,{"data-slot":`skill-group-count`,className:`text-[12px] tabular-nums text-muted-foreground`,children:d?`${a.enabled} / ${a.total}`:`—`}),(0,Y.jsx)(be,{label:e.label,locked:e.locked,state:d?a.state:null,disabled:e.locked||!o||a.total===0,onClick:()=>c(a.refs,a.state!==`on`)})]})})]})}function be({label:e,locked:t,state:n,disabled:i,onClick:a}){return(0,Y.jsx)(`button`,{type:`button`,role:`checkbox`,"data-slot":`skill-group-switch`,"data-state":n??`unknown`,"aria-checked":n===null?void 0:n===`mixed`?`mixed`:n===`on`,"aria-busy":n===null||void 0,"aria-label":t?`${e} skills are always enabled`:`Enable all skills in ${e}`,disabled:i,onClick:a,className:`group/check inline-flex size-11 shrink-0 items-center justify-center rounded-md focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-link-foreground disabled:cursor-default`,children:(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:r(`inline-flex size-5 items-center justify-center rounded border-2 transition-colors`,n===`on`||n===`mixed`?`border-accent-strong bg-accent-strong text-accent-strong-foreground`:`border-muted-foreground bg-card text-transparent`,n===null&&`border-dashed border-soft-foreground`,`group-disabled/check:opacity-60`),children:n===`mixed`?(0,Y.jsx)(h,{className:`size-3.5`}):(0,Y.jsx)(u,{className:`size-3.5`})})})}function xe({item:e,depth:t,href:n,expanded:i,usedBy:a,activation:o}){let{skill:s,hiddenBy:c}=e,l=E(s),u=[...new Set(a.map(e=>e.split(` › `)[0]))];return(0,Y.jsxs)(`tr`,{"data-slot":`skill-table-row`,className:r(`border-b border-border`,i&&`border-transparent`),children:[(0,Y.jsx)(`td`,{className:`min-w-0 p-0`,style:$(t),children:(0,Y.jsxs)(T,{to:n,"data-slot":`skill-row`,"data-skill":s.name,"data-repo":s.team?.repo,"data-project":l?`true`:void 0,"data-enabled":o.checked?`true`:void 0,"aria-current":i?`page`:void 0,"aria-expanded":i,className:r(`selection-row flex min-h-11 min-w-0 flex-col justify-center gap-1 rounded-md px-3 py-2 transition-colors hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-link-foreground`,i&&`bg-accent-strong/10`),children:[(0,Y.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:(0,Y.jsx)(`span`,{className:r(`min-w-0 break-words text-[13px]`,l?`font-semibold text-foreground`:`font-normal text-muted-foreground`),children:s.name})}),s.description?(0,Y.jsx)(`span`,{className:`line-clamp-1 text-xs leading-relaxed text-supporting-foreground`,children:s.description}):null,u.length>0?(0,Y.jsxs)(`span`,{"data-slot":`skill-used-by-inline`,className:`text-xs text-supporting-foreground @min-[520px]:hidden`,children:[`Used by `,u.join(`, `)]}):null,c?(0,Y.jsxs)(`span`,{"data-slot":`skill-hidden-by`,className:`min-w-0 text-xs text-supporting-foreground [overflow-wrap:anywhere]`,children:[`hidden by `,c]}):null]})}),(0,Y.jsx)(`td`,{"data-slot":`skill-used-by-cell`,className:`hidden px-2 py-2 align-middle text-xs text-supporting-foreground @min-[520px]:table-cell`,children:u.length>0?(0,Y.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:u.join(`, `)}):(0,Y.jsx)(`span`,{className:`text-soft-foreground`,children:`—`})}),(0,Y.jsx)(`td`,{className:`px-1 py-0 text-right align-middle`,children:(0,Y.jsx)(`span`,{className:`inline-flex justify-end`,children:(0,Y.jsx)(M,{skill:s,activation:o})})})]})}export{le as SkillsRoute};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,w as i}from"./button-CeupvoKG.js";import{Ca as a,Da as o,Ea as s,Ht as c,_a as l,ga as u,va as d}from"./dropdown-menu-COj_J5wd.js";import{t as f}from"./createLucideIcon-BHp8sXmF.js";var p=f(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),m=f(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),h=e(t(),1),g=n(),_=/^\/p\/([^/]+)(?=\/|$)/;function v(e){let t=_.exec(e)?.[1];return t===void 0?null:decodeURIComponent(t)}function y(e){let t=_.exec(e);if(!t)return e;let n=e.slice(t[0].length);return n===``?`/`:n}function b(e,t){return!t.startsWith(`/`)||t===`/p`||t.startsWith(`/p/`)?t:`/p/${encodeURIComponent(e)}${t}`}function x(e,t){return e===null?t:typeof t==`string`?b(e,t):t.pathname===void 0?t:{...t,pathname:b(e,t.pathname)}}function S(){let{projectId:e}=c(),{pathname:t}=s();return e??v(t)}function C(){let e=S();return(0,h.useCallback)(t=>x(e,t),[e])}function w(){let{pathname:e}=s();return(0,h.useMemo)(()=>y(e),[e])}function T(e){let{pathname:t}=s();return(0,h.useMemo)(()=>a(e,y(t)),[e,t])}function E({to:e,...t}){let n=C();return(0,g.jsx)(u,{...t,to:n(e)})}function D({to:e,...t}){let n=C();return(0,g.jsx)(l,{...t,to:n(e)})}function O({to:e,...t}){let n=C();return(0,g.jsx)(d,{...t,to:n(e)})}function k(){let e=o(),t=C();return(0,h.useMemo)(()=>((n,r)=>typeof n==`number`?e(n):e(t(n),r)),[e,t])}function A(e,t=Date.now()){if(!e)return``;let n=new Date(e).getTime();if(Number.isNaN(n))return``;let r=Math.max(0,(t-n)/1e3);return r<60?`${Math.floor(r)}s`:r<3600?`${Math.floor(r/60)}m`:r<86400?`${Math.floor(r/3600)}h`:`${Math.floor(r/86400)}d`}function j(e){return!Number.isFinite(e)||e<=0?`0`:e>=1e6?`${(Math.floor(e/1e5)/10).toFixed(1)}M`:e>=1e3?`${(Math.floor(e/100)/10).toFixed(1)}k`:String(Math.floor(e))}function M(e,t=new Date){let n=e.toDateString()===t.toDateString();return new Intl.DateTimeFormat(void 0,n?{timeStyle:`short`}:{dateStyle:`medium`,timeStyle:`short`}).format(e)}function N(e,t){let n=e?Date.parse(e):NaN;if(!Number.isFinite(n)||n<=t)return`scheduled`;let r=Math.max(1,Math.floor((n-t)/6e4));if(r<60)return`resumes in ${r}m`;let i=new Date(n),a=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`}).format(i);return n-t<864e5?`resumes ${a}`:`resumes ${new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(i)} ${a}`}var P=i(`inline-block shrink-0`,{variants:{tone:{success:``,pending:``,danger:``,accent:``,info:``,running:``,neutral:``},shape:{filled:`size-[7px] rounded-full`,ring:`size-[7px] rounded-full border-[1.5px] bg-transparent`,workers:`inline-flex size-[12px] items-center justify-center`},pulse:{true:`animate-pulse motion-reduce:animate-none`,false:``}},compoundVariants:[{shape:`filled`,tone:`success`,className:`bg-success`},{shape:`filled`,tone:`pending`,className:`bg-pending-strong`},{shape:`filled`,tone:`danger`,className:`bg-danger`},{shape:`filled`,tone:`accent`,className:`bg-accent-strong`},{shape:`filled`,tone:`info`,className:`bg-info`},{shape:`filled`,tone:`running`,className:`bg-status-running`},{shape:`filled`,tone:`neutral`,className:`bg-soft-foreground`},{shape:`ring`,tone:`success`,className:`border-success`},{shape:`ring`,tone:`pending`,className:`border-pending-strong`},{shape:`ring`,tone:`danger`,className:`border-danger`},{shape:`ring`,tone:`accent`,className:`border-accent-strong`},{shape:`ring`,tone:`info`,className:`border-info`},{shape:`ring`,tone:`running`,className:`border-status-running`},{shape:`ring`,tone:`neutral`,className:`border-soft-foreground`},{shape:`workers`,tone:`success`,className:`text-success`},{shape:`workers`,tone:`pending`,className:`text-pending-strong`},{shape:`workers`,tone:`danger`,className:`text-danger`},{shape:`workers`,tone:`accent`,className:`text-accent-icon`},{shape:`workers`,tone:`info`,className:`text-info`},{shape:`workers`,tone:`running`,className:`text-status-running`},{shape:`workers`,tone:`neutral`,className:`text-soft-foreground`}],defaultVariants:{tone:`neutral`,shape:`filled`,pulse:!1}});function F({className:e,tone:t=`neutral`,shape:n=`filled`,pulse:i=!1,...a}){return(0,g.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,"data-shape":n,className:r(P({tone:t,shape:n,pulse:i,className:e})),...a,children:n===`workers`?(0,g.jsx)(p,{className:`size-[12px]`,"aria-hidden":`true`}):null})}export{p as _,A as a,O as c,y as d,S as f,m as g,w as h,N as i,v as l,T as m,M as n,E as o,k as p,j as r,D as s,F as t,x as u};
@@ -0,0 +1 @@
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{E as t,T as n}from"./button-CeupvoKG.js";import{t as r}from"./createLucideIcon-BHp8sXmF.js";import{o as i}from"./status-dot-1PR0i69P.js";var a=r(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),o=e();function s({to:e,active:r=!1,onClick:a,count:s,replace:c,className:l,children:u}){return(0,o.jsxs)(i,{to:e,...n({replace:c}),"aria-current":r?`page`:void 0,onClick:a,className:t(`-mb-px flex h-8 items-center rounded-t-md border-b-2 px-3 text-[13px] font-medium`,r?`border-foreground font-semibold text-foreground`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`,l),children:[u,s===void 0?null:(0,o.jsx)(`span`,{"data-slot":`tab-count`,className:`ml-1.5 text-[11.5px] font-normal text-soft-foreground`,children:s})]})}export{a as n,s as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./button-CeupvoKG.js";import{Fr as i,Ha as a,J as o,Lr as s,Ni as c,Ut as l,Wr as u,fn as d,ka as f,li as p,nn as m,nt as h,pr as g}from"./dropdown-menu-COj_J5wd.js";import{An as _,F as v,In as y,i as b,pt as x,t as S,vt as C,xn as w,yt as T}from"./centered-state-hDsyXrnH.js";import{t as E}from"./run-header-C0Y1NvEM.js";import{i as D,n as O,r as k}from"./git-toolbar-DY0z0n4S.js";import{$n as A,En as j,Jt as M,Qn as N,Zn as P,er as F,jt as I,k as L,nr as R,qt as z,tr as B,tt as V}from"./index-BOfE8pyD.js";import{t as H}from"./markdown-BBDDg-4t.js";import{t as U}from"./diff-BnIXZK3i2.js";var W=e(t(),1),G=e=>e===`running`||e===`queued`||e===`waiting`,K=`no worktree — this task ran directly in the repo working tree`;function q(e){let t=e=>({id:`commit`,label:`Commit`,enabled:!1,reason:e});return e.hasWorktree?e.status===`running`?t(`Commit unavailable — the agent is still working in this worktree`):e.changedFiles===void 0?t(`Commit unavailable — changes are still loading`):e.changedFiles===0?t(`Commit unavailable — no changes to commit`):{id:`commit`,label:`Commit`,enabled:!0}:t(`Commit unavailable — ${K}`)}function J(e){let t=e=>({id:`push`,label:`Push`,enabled:!1,reason:e});return e.hasWorktree?e.remote===void 0?t(`Push unavailable — no remote configured`):e.branch===void 0?t(`Push unavailable — the run has no branch to push`):e.status===`running`?t(`Push unavailable — the agent is still working in this worktree`):{id:`push`,label:`Push`,enabled:!0}:t(`Push unavailable — ${K}`)}function Y(e){let t=e=>({id:`create-pr`,label:`Create PR`,enabled:!1,reason:e});return!e.hasWorktree||e.branch===void 0?t(`Create PR unavailable — ${K}`):e.forge===null?t(`Create PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?G(e.status)?t(`Create PR unavailable — the run is still active; wait for the review gate`):{id:`create-pr`,label:`Create PR`,enabled:!0}:t(`Create PR unavailable — ${e.forge.reason??`the forge is unreachable`}`)}function X(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:q(e),n=e.prUrl?[q(e),J(e)]:[J(e),Y(e)],r=[];if(e.localHandoff){let t=e.hasSession?G(e.status)?{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — the session is still active in the engine`}:{id:`open-terminal`,label:`Open in terminal`,enabled:!0}:{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — no agent session to resume`};r.push(t)}return{primary:t,secondary:n,menu:r}}var Z=n();function Q({run:e,open:t,onOpenChange:n}){let i=a(),[o,s]=(0,W.useState)(``),l=w(e),u=(0,W.useRef)(l);u.current=l,(0,W.useEffect)(()=>{t&&s(u.current)},[t]);let d=y({mutationFn:t=>m(e.id,t),onSuccess:t=>{c(`Committed ${t.sha.slice(0,7)}`),n(!1),i.invalidateQueries({queryKey:b.runs.changes(e.id)}),i.invalidateQueries({queryKey:b.runs.all})},onError:e=>c(e.message,{tone:`danger`})}),f=()=>{let e=o.trim();e.length===0||d.isPending||d.mutate(e)};return(0,Z.jsx)(P,{open:t,onOpenChange:n,children:(0,Z.jsxs)(N,{"data-slot":`commit-dialog`,children:[(0,Z.jsxs)(B,{children:[(0,Z.jsx)(R,{children:`Commit changes`}),(0,Z.jsxs)(A,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,Z.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,Z.jsx)(I,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{j({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),f())}}),(0,Z.jsxs)(F,{children:[(0,Z.jsx)(r,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,Z.jsx)(r,{"data-slot":`commit-confirm`,disabled:o.trim().length===0||d.isPending,onClick:f,children:d.isPending?`Committing…`:`Commit`})]})]})})}function $(){let{id:e}=f(),t=C(e);return t.isPending?(0,Z.jsx)(M,{tab:`changes`}):t.isError?(0,Z.jsx)(z,{tab:`changes`,error:t.error}):(0,Z.jsx)(ee,{run:t.data})}function ee({run:e}){let t=v(),n=x(),r=T(e.id,_(e)),o=L(),[f,p]=(0,W.useState)(`unified`),[m,h]=(0,W.useState)(!1),[g,S]=(0,W.useState)(!1),[C,w]=(0,W.useState)(null),[D,A]=(0,W.useState)(!1),j=(0,W.useRef)(null),M=a(),N=()=>M.invalidateQueries({queryKey:b.runs.all}),P=e=>c(e.message,{tone:`danger`}),F=y({mutationFn:()=>u(e.id),onSuccess:e=>c(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:P}),I=y({mutationFn:()=>d(e.id),onSuccess:e=>{c(`Draft PR created — ${e.url}`),N()},onError:P}),R=y({mutationFn:()=>s(e.id),onError:e=>{if(e instanceof l&&e.command){navigator.clipboard.writeText(e.command).then(()=>c(`No terminal found — command copied to clipboard.`)).catch(()=>c(`Run manually: ${e.command}`));return}P(e)}}),z=y({mutationFn:t=>i(e.id,t),onError:P}),B=r.isError&&r.error instanceof l&&r.error.status===409,U=X({status:e.status,hasWorktree:!!e.worktreePath&&!B,branch:e.branch,changedFiles:r.data?.stat.files,remote:n.data?.info?.remote,forge:t.data?.forge??null,localHandoff:t.data?.capabilities.localHandoff??!1,hasSession:V(e)!==void 0,prUrl:e.pullRequestUrl}),G=e=>{switch(e){case`commit`:A(!0);break;case`push`:F.mutate();break;case`create-pr`:I.mutate();break;case`open-terminal`:R.mutate();break;case`view-pr`:break}},K=r.data?.files??[],q=(0,W.useMemo)(()=>k(K),[K]),J=(0,W.useMemo)(()=>K.some(H),[K]),Y=o?f:`unified`,$=!o||m;return(0,Z.jsxs)(`div`,{"data-route":`task-changes`,className:`flex min-h-full flex-col`,children:[(0,Z.jsx)(E,{run:e,tab:`changes`}),(0,Z.jsx)(O,{bar:U,branch:e.branch,stat:r.data?.stat,mode:Y,wrap:$,preview:g,onModeChange:p,onWrapChange:h,onPreviewChange:J?S:void 0,onAction:G}),r.data?.repointedHead?(0,Z.jsxs)(`p`,{"data-slot":`repointed-head-note`,className:`border-b px-4 py-2 text-xs text-soft-foreground md:px-9`,children:[`HEAD is on `,(0,Z.jsx)(`code`,{children:r.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,Z.jsx)(`code`,{children:r.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,(0,Z.jsx)(te,{changes:r,changesRefused:B,fileCount:K.length,children:(0,Z.jsx)(ne,{runId:e.id,files:K,tree:q,selected:C,selectFile:e=>{w(e),j.current?.scrollToPath(e)},diffRef:j,effectiveMode:Y,effectiveWrap:$,preview:g,localHandoff:t.data?.capabilities.localHandoff,onOpenInApp:z.mutate})}),(0,Z.jsx)(Q,{run:e,open:D,onOpenChange:A})]})}function te({changes:e,changesRefused:t,fileCount:n,children:r}){return e.isPending?(0,Z.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading changes…`}):e.isError?(0,Z.jsx)(S,{icon:t?(0,Z.jsx)(o,{size:16}):(0,Z.jsx)(h,{size:16}),tone:t?`neutral`:`danger`,heading:`h2`,title:t?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):n===0?(0,Z.jsx)(S,{icon:(0,Z.jsx)(o,{size:16}),tone:`neutral`,heading:`h2`,title:`No changes yet`,subtitle:`The worktree matches its base branch. Changes appear here as the agent works.`}):r}function ne({runId:e,files:t,tree:n,selected:r,selectFile:i,diffRef:a,effectiveMode:o,effectiveWrap:s,preview:c,localHandoff:l,onOpenInApp:u}){return(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-5 md:flex-row md:items-start px-[18px] pb-9 pt-0 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-9`,children:[(0,Z.jsxs)(`aside`,{"data-slot":`changes-tree-pane`,className:`md:sticky md:top-4 max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] w-full md:w-60 shrink-0 overflow-y-auto overscroll-contain rounded-xl border border-border bg-card p-3.5 md:block lg:w-[250px]`,children:[(0,Z.jsx)(`h2`,{className:`mb-3 border-b border-border pb-3 text-xs font-semibold`,children:`Changed files`}),(0,Z.jsx)(D,{root:n,selected:r,onSelect:i})]}),(0,Z.jsx)(U,{files:t,viewRef:a,mode:o,wrap:s,preview:c,loadFileText:t=>re(e,t),imageSrc:t=>p(e,t),onOpenInApp:l?e=>u(e):void 0,className:`min-w-0 flex-1`})]})}async function re(e,t){try{let n=await g(e,t);return n.type!==`file`||n.binary||n.tooLarge?null:n.content??null}catch{return null}}export{$ as TaskChangesRoute};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,t as i}from"./button-CeupvoKG.js";import{D as a,J as o,Mt as s,St as c,Ut as l,ka as u,nt as d,q as f}from"./dropdown-menu-COj_J5wd.js";import{An as p,bt as m,t as h,vt as g,xt as _,yt as v}from"./centered-state-hDsyXrnH.js";import{t as y}from"./run-header-C0Y1NvEM.js";import{o as b}from"./status-dot-1PR0i69P.js";import{n as x}from"./diff-controls-GewpW9aF.js";import{l as S}from"./reference-chip-gQNk-4jc.js";import{Jt as C,Qt as w,dt as T,k as E,qt as D}from"./index-BOfE8pyD.js";import{t as O}from"./lib-BQXq3kEf.js";import{t as k}from"./diff-BnIXZK3i2.js";var A=e(t(),1),j=n(),M=77;function N({slot:e,commits:t,className:n,heading:i}){let[a,o]=(0,A.useState)(``),s=a.trim().toLowerCase(),l=s?t.filter(e=>e.subject.toLowerCase().includes(s)):t,u=l.length>150,d=(0,A.useRef)(null),f=(0,A.useRef)(null),[p,m]=(0,A.useState)(0);(0,A.useLayoutEffect)(()=>{if(!u)return;let e=()=>{let e=d.current,t=f.current;!e||!t||m(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[u]);let h=l.map(n=>(0,j.jsx)(P,{commit:n,detailed:e===`task-commits`&&t.length===1},n.sha));return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`label`,{className:`relative mb-[22px] block`,children:[(0,j.jsx)(c,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-3.5 left-3 size-4 text-muted-foreground`}),(0,j.jsx)(w,{"aria-label":`Search commit messages`,placeholder:`Search commit messages…`,value:a,onChange:e=>o(e.target.value),className:`h-11 bg-card pl-10`})]}),(0,j.jsxs)(`div`,{ref:e=>{d.current=e,e&&(f.current=e.closest(`[data-slot="main"]`))},"data-slot":e,"data-virtualized":u,className:r(`flex flex-col divide-y divide-border rounded-xl border border-border bg-card px-4 py-1 md:px-5`,n),children:[i?(0,j.jsx)(`div`,{className:`flex min-h-14 flex-wrap items-center gap-2 py-4`,children:i}):null,l.length===0?(0,j.jsx)(`p`,{role:`status`,className:`py-5 text-sm text-muted-foreground`,children:`No loaded commits match your search.`}):null,u?(0,j.jsx)(O,{scrollRef:f,startMargin:p,itemSize:M,children:h}):h]})]})}function P({commit:e,detailed:t}){return(0,j.jsx)(`div`,{className:`[contain-intrinsic-block-size:auto_77px] [content-visibility:auto]`,children:(0,j.jsxs)(b,{"data-slot":`commit-row`,"data-sha":e.sha,to:e.href,className:r(`flex min-h-[76px] min-w-0 flex-col items-start gap-3 rounded-sm py-4 hover:bg-muted`,!t&&`md:flex-row md:items-center md:py-3`),children:[(0,j.jsx)(d,{size:16,"aria-hidden":`true`,className:r(`shrink-0 text-accent-text`,t?`size-[22px]`:`size-4`)}),(0,j.jsxs)(`span`,{className:r(`min-w-0 w-full`,!t&&`md:w-auto md:flex-1`),children:[(0,j.jsx)(`span`,{className:r(`block font-normal`,t?`text-[22px] leading-snug`:`text-[13px] md:truncate`),children:e.subject}),(0,j.jsxs)(`span`,{className:`mt-1 block truncate text-[11px] text-soft-foreground`,children:[e.author,` · `,e.when]})]}),(0,j.jsx)(`span`,{className:`shrink-0 rounded-md bg-muted px-2 py-1 font-mono text-[11px] text-muted-foreground`,children:e.shaLabel}),t?(0,j.jsxs)(`span`,{className:`inline-flex min-h-11 items-center gap-2 rounded-lg bg-action px-3 text-xs font-medium text-action-foreground`,children:[(0,j.jsx)(o,{size:16,"aria-hidden":`true`,className:`size-4`}),`View changes`]}):null]})})}function F(){let{id:e}=u(),t=g(e);return t.isPending?(0,j.jsx)(C,{tab:`changes`}):t.isError?(0,j.jsx)(D,{tab:`changes`,error:t.error}):(0,j.jsx)(I,{run:t.data})}function I({run:e}){let{sha:t}=u(),n=_(e.id,p(e));return(0,j.jsxs)(`div`,{"data-route":`task-commits`,className:`flex min-h-full flex-col`,children:[(0,j.jsx)(y,{run:e,tab:`commits`}),t?(0,j.jsx)(L,{runId:e.id,sha:t}):n.isPending?(0,j.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commits…`}):n.isError?(0,j.jsx)(h,{icon:(0,j.jsx)(d,{size:16}),tone:n.error instanceof l&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof l&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,j.jsx)(h,{icon:(0,j.jsx)(d,{size:16}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`This task hasn't committed anything on its branch. Autosave commits and any the agent makes appear here.`}):(0,j.jsxs)(`div`,{className:`px-[18px] py-[22px] md:px-9`,children:[(0,j.jsx)(N,{slot:`task-commits`,heading:(0,j.jsxs)(`h2`,{className:`text-base font-semibold`,children:[n.data.commits.length,` `,n.data.commits.length===1?`commit`:`commits`,` in this task`]}),className:`w-full`,commits:n.data.commits.map(t=>({...t,shaLabel:t.sha.slice(0,8),href:`/tasks/${e.id}/commits/${t.sha}`}))}),(0,j.jsx)(R,{run:e})]})]})}function L({runId:e,sha:t}){let n=m(e,t),r=E(),[o,c]=(0,A.useState)(`unified`),[u,f]=(0,A.useState)(!1),p=n.isError&&n.error instanceof l&&n.error.status===409,g=r?o:`unified`,_=!r||u;return(0,j.jsxs)(`section`,{"data-slot":`task-commit`,"data-sha":t,className:`mx-auto flex min-h-0 w-full max-w-[var(--measure)] flex-1 flex-col`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,j.jsx)(i,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,j.jsxs)(b,{to:`/tasks/${e}/commits`,children:[(0,j.jsx)(a,{size:16,"aria-hidden":`true`}),`All commits`]})}),n.data?(0,j.jsx)(T,{stat:n.data.stat}):null,(0,j.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,j.jsx)(x,{mode:o,wrap:u,onModeChange:c,onWrapChange:f})})]}),n.isPending?(0,j.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):n.isError?(0,j.jsx)(h,{icon:p?(0,j.jsx)(S,{}):(0,j.jsx)(s,{size:16}),tone:p?`neutral`:`danger`,heading:`h2`,title:p?`Commit not found`:`Could not load the commit`,subtitle:n.error.message}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,j.jsx)(`h2`,{className:`text-sm font-semibold`,children:n.data.subject}),(0,j.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[n.data.author,` · `,n.data.when,` ·`,` `,(0,j.jsx)(`span`,{className:`font-mono select-all`,children:n.data.sha})]})]}),n.data.files.length===0?(0,j.jsx)(h,{icon:(0,j.jsx)(d,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,j.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-6`,children:(0,j.jsx)(k,{files:n.data.files,mode:g,wrap:_,className:`min-w-0`})})]})]})}function R({run:e}){let t=v(e.id,p(e));return t.isPending?(0,j.jsx)(`p`,{className:`mt-[22px] text-xs text-muted-foreground`,children:`Loading changed files…`}):t.isError?(0,j.jsxs)(`p`,{role:`status`,className:`mt-[22px] text-xs text-danger`,children:[`Could not load changed files: `,t.error.message]}):t.data.files.length===0?null:(0,j.jsxs)(`section`,{"data-slot":`task-commit-files`,className:`mt-[22px] rounded-[10px] border border-border bg-card p-5`,children:[(0,j.jsxs)(`h2`,{className:`mb-4 text-[16px] font-semibold`,children:[t.data.files.length,` changed files`]}),(0,j.jsx)(`ul`,{className:`space-y-4`,children:t.data.files.map(t=>(0,j.jsx)(`li`,{children:(0,j.jsxs)(b,{to:`/tasks/${e.id}/changes`,className:`flex min-h-11 items-center gap-2 text-xs text-muted-foreground hover:text-foreground`,children:[(0,j.jsx)(f,{size:16,"aria-hidden":`true`,className:`size-[15px] shrink-0`}),(0,j.jsx)(`span`,{className:`break-all`,children:t.path})]})},t.path))})]})}export{F as TaskCommitsRoute};
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,t as i}from"./button-CeupvoKG.js";import{Aa as a,F as o,Mt as s,St as c,Ut as l,X as u,Y as d,Yt as f,ka as p,li as m,q as h,xn as g}from"./dropdown-menu-COj_J5wd.js";import{Ct as _,f as v,p as y,t as b,vt as x,w as S}from"./centered-state-hDsyXrnH.js";import{t as C}from"./createLucideIcon-BHp8sXmF.js";import{n as w,t as T}from"./run-header-C0Y1NvEM.js";import{Jt as E,Qt as D,cn as O,dn as k,ln as A,qt as ee,sn as j,un as M}from"./index-BOfE8pyD.js";var N=C(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),P=C(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),F=C(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),I=C(`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`}]]),L=C(`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`}]]),R=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`avif`]);function z(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:R.has(t.slice(n+1).toLowerCase())}function B(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return z(e)||n>0&&t.slice(n+1).toLowerCase()===`svg`}var V=e(t(),1);function H(e){return e.tooLarge?`too-large`:B(e.path)?`image`:e.binary?`binary`:`text`}function U(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}var W=n();function G({runId:e,path:t,className:n}){let r=_(e,t??void 0);if(t===null)return(0,W.jsx)(q,{className:n,children:(0,W.jsx)(b,{icon:(0,W.jsx)(d,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(r.isPending)return(0,W.jsx)(q,{className:n,children:(0,W.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(r.isError){let e=r.error instanceof l&&r.error.status===409;return(0,W.jsx)(q,{className:n,children:(0,W.jsx)(b,{icon:e?(0,W.jsx)(F,{}):(0,W.jsx)(s,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:r.error.message})})}return r.data.type===`file`?(0,W.jsx)(K,{runId:e,entry:r.data,className:n}):(0,W.jsx)(q,{className:n,children:(0,W.jsx)(b,{icon:(0,W.jsx)(P,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function K({runId:e,entry:t,className:n,imageUrl:r,downloadUrl:i,snapshot:a,documentPreview:o=!1}){let[s,c]=(0,V.useState)(!1),l=o&&/\.(?:md|markdown)$/i.test(t.path),u=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(t.path),d=o&&u&&t.size<=10*1024*1024?`image`:H(t);return(0,W.jsxs)(q,{className:n,children:[(0,W.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,W.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,W.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:U(t.size)})]}),a||i||l?(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border px-4 py-2 text-xs`,children:[a?(0,W.jsxs)(`span`,{children:[`Published snapshot · `,a]}):null,i?(0,W.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-accent-text underline`,href:i,children:`Download`}):null,l?(0,W.jsx)(`button`,{className:`min-h-11 rounded px-2 text-accent-text underline focus-visible:ring-2`,onClick:()=>c(e=>!e),children:s?`Preview`:`View source`}):null]}):null,d===`image`&&(!o||u)?(0,W.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,W.jsx)(`img`,{"data-slot":`file-preview-image`,src:r??m(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):d===`too-large`?(0,W.jsx)(b,{icon:(0,W.jsx)(N,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${U(t.size)} — past the preview cap. Open it in your editor instead.`}):d===`binary`?(0,W.jsx)(b,{icon:(0,W.jsx)(P,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${U(t.size)} of binary data — no text preview.`}):l&&!s?(0,W.jsx)(`div`,{className:`p-4`,children:(0,W.jsx)(j,{document:!0,children:t.content??``})}):(0,W.jsx)(X,{path:t.path,text:t.content??``})]})}function q({className:e,children:t}){return(0,W.jsx)(`section`,{"data-slot":`file-preview`,className:r(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var J=1500;function Y(e,t){let n=(0,V.useMemo)(()=>t.split(`
2
+ `).map(e=>[{content:e}]),[t]),r=(0,V.useMemo)(()=>k(e),[e]),i=n.length>J,[a,o]=(0,V.useState)(null);return(0,V.useEffect)(()=>{if(r===null||i)return;let n=!1;return A(t,r).then(r=>{n||o({key:`${e}\0${t}`,tokens:r.tokens})}),()=>{n=!0}},[e,t,r,i]),r===null||i?n:a?.key===`${e}\0${t}`?a.tokens:M(t,r)?.tokens??n}function X({path:e,text:t}){let n=Y(e,t);return(0,W.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":k(e)??`plaintext`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7]`,children:n.map((e,t)=>(0,W.jsxs)(`div`,{className:`flex px-4`,children:[(0,W.jsx)(`span`,{className:`w-10 shrink-0 select-none pr-3 text-right tabular-nums text-soft-foreground`,children:t+1}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre pr-4`,children:e.map((e,t)=>(0,W.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})}function Z({runId:e,path:t,artifactId:n}){let r=S(e,n?null:t),a=v(e,n),o=n?a:r,s=(0,V.useContext)(O),c=o.data,l=(0,V.useMemo)(()=>c?.type===`file`&&c.source!==`artifact`?{runId:e,...s,basePath:c.path}:null,[c,s,e]);if(!t&&!n)return(0,W.jsx)(G,{runId:e,path:null,className:`min-w-0 flex-1`});if(o.isPending)return(0,W.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(o.isError)return(0,W.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,W.jsx)(`h2`,{children:`Could not load this file`}),(0,W.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:o.error.message}),(0,W.jsx)(i,{variant:`outline`,onClick:()=>void o.refetch(),children:`Retry`})]});if(!c)return(0,W.jsx)(`p`,{role:`alert`,className:`p-4`,children:`No file data was returned.`});if(c.type!==`file`)return(0,W.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,W.jsx)(`h2`,{children:c.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,W.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:c.path}),(0,W.jsx)(`p`,{className:`text-sm`,children:c.reason}),(0,W.jsx)(i,{variant:`outline`,onClick:()=>void o.refetch(),children:`Retry`})]});let u=c.artifact;return(0,W.jsx)(O.Provider,{value:l,children:(0,W.jsx)(K,{runId:e,entry:c,documentPreview:!0,className:`min-w-0 flex-1`,imageUrl:u?f(e,u.id,`image`):g(e,t),...u?{downloadUrl:f(e,u.id,`download`),snapshot:new Date(u.createdAt).toLocaleString()}:{}},u?.id??c.path)})}function Q({runId:e,selected:t,onSelect:n}){return(0,W.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,W.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,W.jsx)($,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function $({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=_(e,t);return a.isPending?(0,W.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,W.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,W.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,W.jsx)(W.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,W.jsx)(te,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,W.jsx)(ne,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function te({runId:e,name:t,path:n,depth:i,selected:a,onSelect:s}){let[c,l]=(0,V.useState)(!1);return(0,W.jsxs)(`li`,{children:[(0,W.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":c?`open`:`closed`,"aria-expanded":c,onClick:()=>l(e=>!e),className:`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+i*14}px`},children:[(0,W.jsx)(o,{size:16,"aria-hidden":`true`,className:r(`order-last ml-auto size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,c&&`rotate-90`)}),(0,W.jsx)(u,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,W.jsx)(`span`,{className:`min-w-0 truncate font-normal`,children:t})]}),c?(0,W.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,W.jsx)($,{runId:e,path:n,depth:i+1,selected:a,onSelect:s})}):null]})}function ne({name:e,path:t,size:n,depth:i,selected:a,onSelect:o}){let s=a===t,c=B(t)?L:h;return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":s?`true`:void 0,onClick:()=>o(t),className:r(`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,s?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${6+i*14}px`},children:[(0,W.jsx)(c,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,W.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,W.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] tabular-nums text-soft-foreground`,children:U(n)})]})})}function re(){let{id:e}=p(),t=x(e);return t.isPending?(0,W.jsx)(E,{tab:`files`}):t.isError?(0,W.jsx)(ee,{tab:`files`,error:t.error}):(0,W.jsx)(w,{runId:t.data.id,children:(0,W.jsx)(ie,{run:t.data},t.data.id)})}function ie({run:e}){let t=_(e.id,``),n=y(e.id),[r,o]=a(),u=r.get(`path`),d=r.get(`artifact`),f=r.getAll(`path`).length>1||r.getAll(`artifact`).length>1||u!==null&&d!==null,[p,m]=(0,V.useState)(u??``);(0,V.useEffect)(()=>m(u??``),[u]);let h=(e,t)=>{let n=new URLSearchParams(r);n.delete(`path`),n.delete(`artifact`),n.set(e,t),o(n)},g=t.isError&&t.error instanceof l&&t.error.status===409;return(0,W.jsxs)(`div`,{"data-route":`task-files`,className:`flex min-h-full flex-col`,children:[(0,W.jsx)(T,{run:e,tab:`files`}),(0,W.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-[18px] pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),p.trim()&&h(`path`,p.trim())},children:[(0,W.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,W.jsx)(c,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,W.jsx)(D,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:p,onChange:e=>m(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,W.jsx)(i,{type:`submit`,variant:`outline`,className:`h-11 shrink-0`,disabled:!p.trim(),children:`Open file`})]}),(0,W.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,W.jsxs)(`aside`,{"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,W.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,W.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,W.jsx)(b,{icon:g?(0,W.jsx)(I,{}):(0,W.jsx)(s,{size:16}),tone:g?`neutral`:`danger`,heading:`h2`,title:g?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,W.jsx)(Q,{runId:e.id,selected:u,onSelect:e=>h(`path`,e)}),(0,W.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,W.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),n.isPending?(0,W.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):n.isError?(0,W.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):n.data.artifacts.length===0?(0,W.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,W.jsx)(`ul`,{children:n.data.artifacts.map(e=>(0,W.jsx)(`li`,{children:(0,W.jsx)(`button`,{type:`button`,"aria-current":e.id===d?`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:()=>h(`artifact`,e.id),children:e.name})},e.id))}),(0,W.jsx)(i,{variant:`ghost`,className:`min-h-11`,onClick:()=>void n.refetch(),children:`Refresh published files`})]})]}),f?(0,W.jsx)(`p`,{role:`alert`,className:`p-4`,children:`Invalid file link: choose either a path or a published artifact.`}):u!==null||d!==null||t.isSuccess?(0,W.jsx)(Z,{runId:e.id,path:u,artifactId:d}):null]}),(0,W.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{re as TaskFilesRoute};
@@ -0,0 +1 @@
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{D as t,t as n}from"./button-CeupvoKG.js";import{Ha as r,Mt as i,R as a,Vn as o,ka as s,ot as c}from"./dropdown-menu-COj_J5wd.js";import{A as l,D as u,F as d,In as f,Y as p,i as m,sn as h,t as g,tt as _,un as v,vt as y}from"./centered-state-hDsyXrnH.js";import{t as b}from"./run-header-C0Y1NvEM.js";import{o as x}from"./status-dot-1PR0i69P.js";import{s as S}from"./popover-D56fhiXj.js";import{l as C}from"./reference-chip-gQNk-4jc.js";import{Kt as w,dr as T,qt as E}from"./index-BOfE8pyD.js";import{n as D,o as O,t as k}from"./use-hand-to-agent-state-BCDjzHnG.js";var A=e(),j={issue:`Issue`,pr:`Pull request`};function M({kind:e}){let{id:t}=s(),n=y(t);return n.isPending?(0,A.jsx)(w,{kind:e}):n.isError?(0,A.jsx)(E,{tab:`github-item`,error:n.error}):(0,A.jsx)(N,{run:n.data,kind:e})}function N({run:e,kind:t}){let{n:r}=s(),i=Number(r),a=p(),o=_(),c=d(),u=o.isPending||c.isPending,f=h(e,a).some(e=>e.kind===t&&e.number===i),m=l(t,i,f);return(0,A.jsxs)(`div`,{"data-route":`task-github-item`,className:`flex min-h-full flex-col`,children:[(0,A.jsx)(b,{run:e,tab:{kind:t,number:i}}),f?(0,A.jsx)(P,{run:e,kind:t,number:i,repoBase:a,item:m}):u?(0,A.jsx)(w,{kind:t,number:i,heading:`h2`}):(0,A.jsx)(g,{icon:(0,A.jsx)(T,{size:16}),tone:`neutral`,heading:`h2`,title:`#${r} 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)(x,{to:`/tasks/${e.id}`,children:`Back to the session`})})})]})}function P({run:e,kind:s,number:l,repoBase:d,item:p}){let h=r(),_=f({mutationFn:e=>o(s,l,{refresh:!0}),onSuccess:(e,t)=>h.setQueryData(t,e)}),y=s===`pr`&&p.data?.available===!0&&p.data.item!==null,b=u(y?[l]:[],y),x=b.data?.available?b.data.checks:void 0,T=`${j[s]} #${l}`,E=s===`pr`?c:a,D=(0,A.jsx)(n,{variant:`outline`,disabled:_.isPending,onClick:()=>_.mutate(m.githubItem(s,l)),children:`Retry`});if(p.isPending)return(0,A.jsx)(w,{kind:s,number:l,heading:`h2`});if(p.isError){let e=_.error??p.error;return(0,A.jsx)(g,{icon:(0,A.jsx)(i,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load ${j[s].toLowerCase()} #${l}`,subtitle:e.message,actions:D})}let k=p.data;if(!k.available){let r=v(e,d).find(e=>e.kind===`PR`==(s===`pr`)&&e.number===l)?.url;return(0,A.jsx)(g,{icon:(0,A.jsx)(E,{size:16}),tone:`neutral`,heading:`h2`,title:`GitHub is unavailable`,subtitle:_.error?.message??k.reason,actions:(0,A.jsxs)(A.Fragment,{children:[D,r&&t(r)?(0,A.jsx)(n,{asChild:!0,variant:`outline`,children:(0,A.jsxs)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,children:[`open on GitHub`,(0,A.jsx)(S,{"aria-hidden":`true`})]})}):null]})})}return k.item?(0,A.jsx)(`div`,{className:`min-w-0 px-0.5 md:px-2`,children:(0,A.jsx)(O,{item:k.item,colors:k.labelColors??{},checks:s===`pr`?x?.[l]??k.item.checks:k.item.checks,backLink:null,subNav:null,children:s===`issue`?(0,A.jsx)(I,{item:k.item},k.item.url):null})}):(0,A.jsx)(g,{icon:(0,A.jsx)(C,{}),tone:`neutral`,heading:`h2`,title:`${T} was not found in ${F(d)}`,subtitle:`It may have been deleted, or the number points at a different repository.`})}function F(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 I({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};
@@ -0,0 +1 @@
1
+ .session-composer [data-slot=composer-editor]{border-color:var(--ring);border-radius:12px}.session-composer [data-slot=session-controls]{padding-block:0 10px;padding-inline:12px}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr) max-content;gap:8px;min-width:0;display:grid}.session-engine-controls [data-slot$=pill]{width:100%;min-width:0}.session-engine-controls [data-slot$=pill]>svg:last-child{margin-inline-start:auto}.session-engine-controls [data-slot=session-runner-value]{width:100%;min-width:0}.session-composer [data-slot=composer-toolbar]{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding-block:0 12px;padding-inline:12px;display:grid}.session-composer [data-slot=composer-toolbar]>[data-slot=session-controls]{grid-area:1/1/auto/-1;min-width:0;padding:0}.session-composer [data-slot=composer-footer-start]{flex-wrap:nowrap;grid-area:2/1;gap:8px}.session-composer [aria-label=Attach\ files],.session-composer [aria-label=Start\ dictation]{border:1px solid var(--border);border-radius:9px;width:44px;height:44px}.session-composer [data-slot=follow-up-model-pill]{min-height:44px}.session-composer [data-slot=follow-up-model-pill]>svg:last-child{margin-inline-start:auto}.session-composer [data-slot=composer-submit-row]{flex:none;grid-area:2/2;margin:0}[data-slot=run-actions-menu] [role^=menuitem]{min-height:44px}[data-route=task-thread] [data-slot=thread-dock]{container:thread-dock/inline-size}[data-route=task-thread] [data-slot=thread-jump]{position:fixed;inset-block-end:calc(24px + env(safe-area-inset-bottom,0px));inset-inline-end:24px}@media (width>=768px){[data-slot=main]:has([data-route=task-thread]){scroll-padding-block:calc(var(--thread-header-height,0px) + 8px) calc(var(--thread-footer-height,0px) + 8px)}[data-route=task-thread] [data-slot=thread-dock]{position:sticky;inset-block-end:0}[data-route=task-thread] [data-slot=thread-jump]{margin-block-end:8px;position:absolute;inset-block-end:100%}[data-route=task-thread] [data-slot=thread-footer-content]{--thread-footer-limit:min(60dvh, calc(var(--thread-viewport-height,100dvh) - var(--thread-header-height,0px) - var(--spacing) * 5.5));max-block-size:var(--thread-footer-limit)}[data-route=task-thread] [data-slot=thread-footer-content]>:not([data-slot=run-activity-dock]){flex-shrink:0}[data-route=task-thread] [data-slot=run-activity-dock]{overscroll-behavior-block:contain;min-block-size:46px;overflow-y:auto}[data-route=task-thread] [data-slot=thread-footer-content]>[data-slot=composer]{min-block-size:0;max-block-size:calc(var(--thread-footer-limit) - 46px - var(--spacing) * 2.5);flex-direction:column;display:flex}[data-route=task-thread] [data-slot=composer-editor]{flex-direction:column;min-block-size:0;display:flex;overflow-y:auto}[data-route=task-thread] [data-slot=composer-editor]>textarea{flex-shrink:1;min-block-size:44px}[data-route=task-thread] [data-slot=composer-thumbs]{flex-wrap:nowrap;flex-shrink:0;max-block-size:60px;overflow:auto}[data-route=task-thread] [data-slot=composer-toolbar]{flex-shrink:0}@container thread-dock (width<=680px){[data-slot=thread-dock]>div{padding-inline:8px}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr) max-content}.session-engine-controls :is([data-slot=runner-pill],[data-slot=session-runner-value],[data-slot=follow-up-effort-pill]){gap:6px;padding-inline:8px}.session-engine-controls :is([data-slot=runner-pill],[data-slot=follow-up-effort-pill])>svg:last-child{display:none}}@container thread-dock (width<=400px){.session-composer [data-slot=archive-action]{width:44px;min-width:44px;padding-inline:0}.session-composer [data-slot=archive-action]>span{display:none}}}@media (width<=767px){[data-slot=run-title-row]>.group{max-width:calc(100% - 52px)}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr)}.session-engine-controls [data-slot=follow-up-model-pill]{grid-area:2/1/auto/-1}.session-engine-controls [data-slot=follow-up-effort-pill]{grid-area:1/2}.task-open-targets{flex-direction:column;align-items:flex-start}}[data-route=task-thread] [data-slot=assistant-message] :is(h1,h2,h3,h4,strong,[data-streamdown=strong]){color:var(--foreground)}[data-route=task-thread] [data-slot=assistant-message] h2{font-size:20px;line-height:1.4}@media (width<=767px){[data-route=task-thread] [data-slot=assistant-message] h2{letter-spacing:-.4px;font-size:18px}}[data-route=task-thread] .session-composer [data-slot=composer-editor]{border-color:var(--composer-border)}[data-route=task-thread] [data-slot=session-conversation]{overflow-anchor:none}@media (width<=767px){[data-route=task-thread] [data-slot=thread-dock]{overflow-anchor:none}[data-route=task-thread] [data-slot=thread-tail-anchor]{overflow-anchor:auto}}[data-route=task-thread] [data-slot=session-conversation]{padding-block:calc(var(--spacing) * 5.5) calc(var(--spacing) * 4);gap:calc(var(--spacing) * 4)}[data-route=task-thread] [data-slot=thread-row]{padding-block-end:calc(var(--spacing) * 4)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:is(p,ul,ol,table,blockquote){margin-block:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:first-child,[data-route=task-thread] [data-slot=user-bubble] .thread-markdown>:first-child{margin-block-start:0}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:last-child,[data-route=task-thread] [data-slot=user-bubble] .thread-markdown>:last-child{margin-block-end:0}@media (width<=767px){[data-route=task-thread] [data-slot=session-conversation]{padding-block:calc(var(--spacing) * 4);gap:calc(var(--spacing) * 3.5)}[data-route=task-thread] [data-slot=thread-row]{padding-block-end:calc(var(--spacing) * 3.5)}}[data-route=task-thread] [data-slot=thread-footer][data-state=closed]{border-block-start:0;margin-block-start:0;padding-block-start:0}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>p:has(>:is(strong,[data-streamdown=strong]):only-child){margin-block-end:calc(var(--spacing) * 1)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>p:has(>:is(strong,[data-streamdown=strong]):only-child)+p{margin-block-start:calc(var(--spacing) * 1)}[data-route=task-thread] [data-slot=tool-card]{background:var(--task-brand-bg);border-radius:7px}[data-route=task-thread] [data-slot=tool-card]>button{padding-block:calc(var(--spacing) * 2.5);padding-inline:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=tool-card]>[data-slot=collapsible-content]>div{background:0 0;border-block-start:0}[data-route=task-thread] [data-slot=tool-output] pre,[data-route=task-thread] [data-slot=tool-error]{padding-block:calc(var(--spacing) * 2) calc(var(--spacing) * 2.5);padding-inline:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=tool-output-fade]{--tw-gradient-to:var(--task-brand-bg)}[data-slot=task-split][data-pane=open] [data-route=task-thread] [data-slot=session-conversation],[data-slot=task-split][data-pane=open] [data-route=task-thread] [data-slot=thread-dock]>div{padding-inline:18px}