@open-mercato/cezar 0.19.0-pr1908.4332 → 0.19.0-pr1908.4707

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 (608) hide show
  1. package/README.md +3 -2
  2. package/dist/agent-config/account-identity.js +3 -0
  3. package/dist/agent-config/account-identity.js.map +1 -1
  4. package/dist/agent-config/catalog.d.ts +7 -1
  5. package/dist/agent-config/catalog.js +174 -4
  6. package/dist/agent-config/catalog.js.map +1 -1
  7. package/dist/agent-config/model-settings/gemini.d.ts +8 -0
  8. package/dist/agent-config/model-settings/gemini.js +16 -0
  9. package/dist/agent-config/model-settings/gemini.js.map +1 -0
  10. package/dist/agent-config/model-settings/kimi.d.ts +7 -0
  11. package/dist/agent-config/model-settings/kimi.js +13 -0
  12. package/dist/agent-config/model-settings/kimi.js.map +1 -0
  13. package/dist/agent-config/model-settings/omp.d.ts +11 -0
  14. package/dist/agent-config/model-settings/omp.js +17 -0
  15. package/dist/agent-config/model-settings/omp.js.map +1 -0
  16. package/dist/agent-config/model-settings/shared.d.ts +6 -0
  17. package/dist/agent-config/model-settings/shared.js +17 -3
  18. package/dist/agent-config/model-settings/shared.js.map +1 -1
  19. package/dist/agent-config/models.js +6 -0
  20. package/dist/agent-config/models.js.map +1 -1
  21. package/dist/agent-config/validate.js +15 -0
  22. package/dist/agent-config/validate.js.map +1 -1
  23. package/dist/automations/automation-cli.d.ts +2 -0
  24. package/dist/automations/automation-cli.js +82 -2
  25. package/dist/automations/automation-cli.js.map +1 -1
  26. package/dist/automations/deferred-start.d.ts +5 -4
  27. package/dist/automations/deferred-start.js +5 -1
  28. package/dist/automations/deferred-start.js.map +1 -1
  29. package/dist/automations/paused-work.d.ts +24 -0
  30. package/dist/automations/paused-work.js +61 -0
  31. package/dist/automations/paused-work.js.map +1 -0
  32. package/dist/automations/pr-head.d.ts +3 -0
  33. package/dist/automations/pr-head.js +8 -4
  34. package/dist/automations/pr-head.js.map +1 -1
  35. package/dist/automations/prompts.js +1 -0
  36. package/dist/automations/prompts.js.map +1 -1
  37. package/dist/automations/store.d.ts +16 -0
  38. package/dist/automations/store.js +44 -0
  39. package/dist/automations/store.js.map +1 -1
  40. package/dist/automations/task-template.js +1 -0
  41. package/dist/automations/task-template.js.map +1 -1
  42. package/dist/automations/templates.js +1 -0
  43. package/dist/automations/templates.js.map +1 -1
  44. package/dist/automations/types.d.ts +24 -0
  45. package/dist/automations/types.js +2 -0
  46. package/dist/automations/types.js.map +1 -1
  47. package/dist/automations/validate-input.d.ts +188 -0
  48. package/dist/automations/validate-input.js +85 -0
  49. package/dist/automations/validate-input.js.map +1 -0
  50. package/dist/config.d.ts +12 -5
  51. package/dist/config.js +4 -12
  52. package/dist/config.js.map +1 -1
  53. package/dist/contract/agent-config.d.ts +9 -0
  54. package/dist/contract/agent-profiles.d.ts +74 -20
  55. package/dist/contract/agent.d.ts +12 -0
  56. package/dist/contract/artifacts.d.ts +138 -0
  57. package/dist/contract/assets.d.ts +83 -0
  58. package/dist/contract/automations.d.ts +158 -0
  59. package/dist/contract/dashboard-costs.d.ts +2 -0
  60. package/dist/contract/dashboard.d.ts +8 -0
  61. package/dist/contract/deferred-start.d.ts +33 -0
  62. package/dist/contract/dispatch.d.ts +9 -0
  63. package/dist/contract/events.d.ts +6 -0
  64. package/dist/contract/github.d.ts +13 -0
  65. package/dist/contract/health.d.ts +12 -0
  66. package/dist/contract/impact.d.ts +134 -0
  67. package/dist/contract/index.d.ts +6 -0
  68. package/dist/contract/index.js +2955 -2547
  69. package/dist/contract/managers.d.ts +79 -0
  70. package/dist/contract/runners.d.ts +15 -0
  71. package/dist/contract/runs.d.ts +292 -0
  72. package/dist/contract/skills.d.ts +67 -0
  73. package/dist/contract/telemetry.d.ts +5 -1
  74. package/dist/contract/transfer.d.ts +1932 -0
  75. package/dist/contract/workflows.d.ts +87 -0
  76. package/dist/contract/workspace-layouts.d.ts +6 -0
  77. package/dist/contract/workspace.d.ts +111 -37
  78. package/dist/core/agent-env.js +43 -1
  79. package/dist/core/agent-env.js.map +1 -1
  80. package/dist/core/agent-errors.d.ts +3 -0
  81. package/dist/core/agent-errors.js +13 -0
  82. package/dist/core/agent-errors.js.map +1 -1
  83. package/dist/core/agent-model-policy.d.ts +1 -1
  84. package/dist/core/agent-model-policy.js +1 -1
  85. package/dist/core/agent-model-policy.js.map +1 -1
  86. package/dist/core/agent-profiles.d.ts +19 -3
  87. package/dist/core/agent-profiles.js +27 -3
  88. package/dist/core/agent-profiles.js.map +1 -1
  89. package/dist/core/agent-runner.d.ts +44 -10
  90. package/dist/core/agent-runner.js +21 -7
  91. package/dist/core/agent-runner.js.map +1 -1
  92. package/dist/core/antigravity-runner.js +2 -1
  93. package/dist/core/antigravity-runner.js.map +1 -1
  94. package/dist/core/backend-detect.d.ts +3 -2
  95. package/dist/core/backend-detect.js +80 -1
  96. package/dist/core/backend-detect.js.map +1 -1
  97. package/dist/core/claude-cli-runner.js +30 -3
  98. package/dist/core/claude-cli-runner.js.map +1 -1
  99. package/dist/core/claude-model-catalog.d.ts +6 -1
  100. package/dist/core/claude-model-catalog.js +20 -0
  101. package/dist/core/claude-model-catalog.js.map +1 -1
  102. package/dist/core/claude-usage-status.d.ts +8 -0
  103. package/dist/core/claude-usage-status.js +48 -0
  104. package/dist/core/claude-usage-status.js.map +1 -0
  105. package/dist/core/codex-app-server-runner.d.ts +8 -0
  106. package/dist/core/codex-app-server-runner.js +84 -13
  107. package/dist/core/codex-app-server-runner.js.map +1 -1
  108. package/dist/core/codex-model-catalog.js +42 -0
  109. package/dist/core/codex-model-catalog.js.map +1 -1
  110. package/dist/core/codex-ui-mapper.d.ts +7 -0
  111. package/dist/core/codex-ui-mapper.js +12 -2
  112. package/dist/core/codex-ui-mapper.js.map +1 -1
  113. package/dist/core/copilot-acp-runner.js +5 -1
  114. package/dist/core/copilot-acp-runner.js.map +1 -1
  115. package/dist/core/cursor-agent-runner.js +5 -1
  116. package/dist/core/cursor-agent-runner.js.map +1 -1
  117. package/dist/core/gemini-acp-runner.d.ts +37 -0
  118. package/dist/core/gemini-acp-runner.js +537 -0
  119. package/dist/core/gemini-acp-runner.js.map +1 -0
  120. package/dist/core/gemini-credentials.d.ts +21 -0
  121. package/dist/core/gemini-credentials.js +80 -0
  122. package/dist/core/gemini-credentials.js.map +1 -0
  123. package/dist/core/gemini-sessions.d.ts +18 -0
  124. package/dist/core/gemini-sessions.js +41 -0
  125. package/dist/core/gemini-sessions.js.map +1 -0
  126. package/dist/core/gemini-ui-mapper.d.ts +30 -0
  127. package/dist/core/gemini-ui-mapper.js +80 -0
  128. package/dist/core/gemini-ui-mapper.js.map +1 -0
  129. package/dist/core/junie-runner.js +2 -1
  130. package/dist/core/junie-runner.js.map +1 -1
  131. package/dist/core/kimi-home.d.ts +7 -0
  132. package/dist/core/kimi-home.js +13 -0
  133. package/dist/core/kimi-home.js.map +1 -0
  134. package/dist/core/kimi-model-catalog.d.ts +17 -0
  135. package/dist/core/kimi-model-catalog.js +45 -0
  136. package/dist/core/kimi-model-catalog.js.map +1 -0
  137. package/dist/core/kimi-runner.d.ts +90 -0
  138. package/dist/core/kimi-runner.js +874 -0
  139. package/dist/core/kimi-runner.js.map +1 -0
  140. package/dist/core/kimi-ui-mapper.d.ts +71 -0
  141. package/dist/core/kimi-ui-mapper.js +399 -0
  142. package/dist/core/kimi-ui-mapper.js.map +1 -0
  143. package/dist/core/model-identity.js +11 -0
  144. package/dist/core/model-identity.js.map +1 -1
  145. package/dist/core/model-presets.js +10 -0
  146. package/dist/core/model-presets.js.map +1 -1
  147. package/dist/core/omp-rpc-runner.d.ts +41 -0
  148. package/dist/core/omp-rpc-runner.js +451 -0
  149. package/dist/core/omp-rpc-runner.js.map +1 -0
  150. package/dist/core/omp-ui-mapper.d.ts +56 -0
  151. package/dist/core/omp-ui-mapper.js +468 -0
  152. package/dist/core/omp-ui-mapper.js.map +1 -0
  153. package/dist/core/opencode-http.d.ts +2 -0
  154. package/dist/core/opencode-http.js +2 -2
  155. package/dist/core/opencode-http.js.map +1 -1
  156. package/dist/core/opencode-server-runner.d.ts +3 -1
  157. package/dist/core/opencode-server-runner.js +197 -25
  158. package/dist/core/opencode-server-runner.js.map +1 -1
  159. package/dist/core/opencode-v2-events.d.ts +11 -0
  160. package/dist/core/opencode-v2-events.js +105 -0
  161. package/dist/core/opencode-v2-events.js.map +1 -0
  162. package/dist/core/pi-runner.js +5 -1
  163. package/dist/core/pi-runner.js.map +1 -1
  164. package/dist/core/private-mcp.d.ts +1 -1
  165. package/dist/core/private-mcp.js +2 -2
  166. package/dist/core/private-mcp.js.map +1 -1
  167. package/dist/core/process-signals.d.ts +29 -0
  168. package/dist/core/process-signals.js +85 -0
  169. package/dist/core/process-signals.js.map +1 -0
  170. package/dist/core/provider-auth.d.ts +25 -2
  171. package/dist/core/provider-auth.js +132 -12
  172. package/dist/core/provider-auth.js.map +1 -1
  173. package/dist/core/runner-factory.d.ts +1 -0
  174. package/dist/core/runner-factory.js +38 -1
  175. package/dist/core/runner-factory.js.map +1 -1
  176. package/dist/core/runner-model-catalog.d.ts +8 -0
  177. package/dist/core/runner-model-catalog.js +3 -0
  178. package/dist/core/runner-model-catalog.js.map +1 -1
  179. package/dist/core/tool-display.js +2 -0
  180. package/dist/core/tool-display.js.map +1 -1
  181. package/dist/core/ui-events.d.ts +1 -1
  182. package/dist/core/usage-limit.d.ts +2 -2
  183. package/dist/core/usage-limit.js +5 -3
  184. package/dist/core/usage-limit.js.map +1 -1
  185. package/dist/data-gitignore.d.ts +1 -1
  186. package/dist/data-gitignore.js +1 -0
  187. package/dist/data-gitignore.js.map +1 -1
  188. package/dist/dispatch/engine.d.ts +4 -0
  189. package/dist/dispatch/engine.js +9 -0
  190. package/dist/dispatch/engine.js.map +1 -1
  191. package/dist/e2e-setup.d.ts +8 -3
  192. package/dist/e2e-setup.js +31 -16
  193. package/dist/e2e-setup.js.map +1 -1
  194. package/dist/handoff.d.ts +2 -2
  195. package/dist/handoff.js +5 -5
  196. package/dist/handoff.js.map +1 -1
  197. package/dist/impact/demo-review.json +781 -0
  198. package/dist/impact/diff.d.ts +21 -0
  199. package/dist/impact/diff.js +81 -0
  200. package/dist/impact/diff.js.map +1 -0
  201. package/dist/impact/evidence.d.ts +67 -0
  202. package/dist/impact/evidence.js +238 -0
  203. package/dist/impact/evidence.js.map +1 -0
  204. package/dist/impact/impact-cli.d.ts +12 -0
  205. package/dist/impact/impact-cli.js +141 -0
  206. package/dist/impact/impact-cli.js.map +1 -0
  207. package/dist/impact/launch.d.ts +46 -0
  208. package/dist/impact/launch.js +145 -0
  209. package/dist/impact/launch.js.map +1 -0
  210. package/dist/impact/model.d.ts +551 -0
  211. package/dist/impact/model.js +188 -0
  212. package/dist/impact/model.js.map +1 -0
  213. package/dist/impact/publish.d.ts +30 -0
  214. package/dist/impact/publish.js +119 -0
  215. package/dist/impact/publish.js.map +1 -0
  216. package/dist/impact/render.d.ts +41 -0
  217. package/dist/impact/render.js +109 -0
  218. package/dist/impact/render.js.map +1 -0
  219. package/dist/impact/template.html +670 -0
  220. package/dist/impact/validate.d.ts +25 -0
  221. package/dist/impact/validate.js +273 -0
  222. package/dist/impact/validate.js.map +1 -0
  223. package/dist/index.js +19 -4
  224. package/dist/index.js.map +1 -1
  225. package/dist/managers/engine.js +5 -2
  226. package/dist/managers/engine.js.map +1 -1
  227. package/dist/pack-check.d.ts +1 -0
  228. package/dist/pack-check.js +14 -0
  229. package/dist/pack-check.js.map +1 -1
  230. package/dist/paths.d.ts +6 -0
  231. package/dist/paths.js +19 -1
  232. package/dist/paths.js.map +1 -1
  233. package/dist/runs/agent-error-telemetry.js +7 -4
  234. package/dist/runs/agent-error-telemetry.js.map +1 -1
  235. package/dist/runs/agent-tmpdir.d.ts +25 -6
  236. package/dist/runs/agent-tmpdir.js +136 -25
  237. package/dist/runs/agent-tmpdir.js.map +1 -1
  238. package/dist/runs/artifacts.d.ts +52 -0
  239. package/dist/runs/artifacts.js +243 -0
  240. package/dist/runs/artifacts.js.map +1 -0
  241. package/dist/runs/event-history.d.ts +12 -0
  242. package/dist/runs/event-history.js +61 -0
  243. package/dist/runs/event-history.js.map +1 -1
  244. package/dist/runs/project-assets.d.ts +9 -0
  245. package/dist/runs/project-assets.js +57 -0
  246. package/dist/runs/project-assets.js.map +1 -0
  247. package/dist/runs/review-gate.d.ts +10 -0
  248. package/dist/runs/review-gate.js +12 -0
  249. package/dist/runs/review-gate.js.map +1 -1
  250. package/dist/runs/store.d.ts +70 -4
  251. package/dist/runs/store.js +139 -26
  252. package/dist/runs/store.js.map +1 -1
  253. package/dist/server/agent-setup.d.ts +1 -1
  254. package/dist/server/agent-setup.js +2 -1
  255. package/dist/server/agent-setup.js.map +1 -1
  256. package/dist/server/artifacts.d.ts +33 -0
  257. package/dist/server/artifacts.js +133 -0
  258. package/dist/server/artifacts.js.map +1 -0
  259. package/dist/server/dashboard.d.ts +5 -0
  260. package/dist/server/forge/github-assets.d.ts +7 -0
  261. package/dist/server/forge/github-assets.js +100 -0
  262. package/dist/server/forge/github-assets.js.map +1 -0
  263. package/dist/server/forge/github.d.ts +11 -0
  264. package/dist/server/forge/github.js +42 -0
  265. package/dist/server/forge/github.js.map +1 -1
  266. package/dist/server/open-in-app.js +3 -0
  267. package/dist/server/open-in-app.js.map +1 -1
  268. package/dist/server/provider-action-gate.js +12 -4
  269. package/dist/server/provider-action-gate.js.map +1 -1
  270. package/dist/server/server.d.ts +10012 -6701
  271. package/dist/server/server.js +353 -193
  272. package/dist/server/server.js.map +1 -1
  273. package/dist/server/star-count.d.ts +5 -5
  274. package/dist/server/star-count.js +5 -5
  275. package/dist/server/star-count.js.map +1 -1
  276. package/dist/server-install/steps.js +1 -0
  277. package/dist/server-install/steps.js.map +1 -1
  278. package/dist/skills-provision.js +7 -1
  279. package/dist/skills-provision.js.map +1 -1
  280. package/dist/skills.d.ts +10 -6
  281. package/dist/skills.js +11 -6
  282. package/dist/skills.js.map +1 -1
  283. package/dist/transfer/automations-file.d.ts +46 -0
  284. package/dist/transfer/automations-file.js +172 -0
  285. package/dist/transfer/automations-file.js.map +1 -0
  286. package/dist/transfer/config-bundle.d.ts +100 -0
  287. package/dist/transfer/config-bundle.js +430 -0
  288. package/dist/transfer/config-bundle.js.map +1 -0
  289. package/dist/webhooks/outbox.js +83 -63
  290. package/dist/webhooks/outbox.js.map +1 -1
  291. package/dist/workflows/graph.d.ts +27 -0
  292. package/dist/workflows/load.js +2 -2
  293. package/dist/workflows/load.js.map +1 -1
  294. package/dist/workflows/resume-fallback.d.ts +13 -6
  295. package/dist/workflows/resume-fallback.js +26 -6
  296. package/dist/workflows/resume-fallback.js.map +1 -1
  297. package/dist/workflows/run.d.ts +121 -10
  298. package/dist/workflows/run.js +363 -61
  299. package/dist/workflows/run.js.map +1 -1
  300. package/dist/workflows/templates.d.ts +27 -16
  301. package/dist/workflows/templates.js +17 -0
  302. package/dist/workflows/templates.js.map +1 -1
  303. package/dist/workflows/types.d.ts +21 -0
  304. package/dist/workflows/types.js +3 -1
  305. package/dist/workflows/types.js.map +1 -1
  306. package/dist/workspace/agent-accounts.d.ts +27 -15
  307. package/dist/workspace/agent-accounts.js +4 -14
  308. package/dist/workspace/agent-accounts.js.map +1 -1
  309. package/dist/workspace/agent-profiles.js +3 -0
  310. package/dist/workspace/agent-profiles.js.map +1 -1
  311. package/dist/workspace/config.d.ts +12 -6
  312. package/dist/workspace/config.js +3 -13
  313. package/dist/workspace/config.js.map +1 -1
  314. package/dist/workspace/dashboard-costs.d.ts +1 -0
  315. package/dist/workspace/dashboard-costs.js +1 -0
  316. package/dist/workspace/dashboard-costs.js.map +1 -1
  317. package/dist/workspace/dashboard-insights.d.ts +1 -0
  318. package/dist/workspace/dashboard-insights.js +5 -2
  319. package/dist/workspace/dashboard-insights.js.map +1 -1
  320. package/dist/workspace/dashboard-overview.js +2 -0
  321. package/dist/workspace/dashboard-overview.js.map +1 -1
  322. package/dist/workspace/dashboard.d.ts +1 -0
  323. package/package.json +5 -4
  324. package/scripts/check-pack.mjs +3 -2
  325. package/scripts/copy-assets.mjs +17 -0
  326. package/scripts/mock-claude.mjs +106 -1
  327. package/scripts/mock-gemini-acp.mjs +195 -0
  328. package/scripts/mock-kimi-acp.mjs +126 -0
  329. package/scripts/mock-omp-rpc.mjs +194 -0
  330. package/skills/change-impact/SKILL.md +117 -0
  331. package/skills/change-impact/references/analysis-contract.md +141 -0
  332. package/skills/change-impact/references/public-api.md +92 -0
  333. package/skills/change-impact/references/visual-contract.md +71 -0
  334. package/web/dist/assets/{active-forge-DEmP_h4r.js → active-forge-DO2AaQ-s.js} +1 -1
  335. package/web/dist/assets/agent-task-pickers-CZpw4vcZ.js +1 -0
  336. package/web/dist/assets/{alert-dialog-BZkKvKiu.js → alert-dialog-BihfE0uZ.js} +1 -1
  337. package/web/dist/assets/arrow-down-DACdHKjc.js +1 -0
  338. package/web/dist/assets/arrow-left-BtT8zuL0.js +1 -0
  339. package/web/dist/assets/arrow-up-BAPSgozC.js +1 -0
  340. package/web/dist/assets/ask-answer-Co3javaA.js +1 -0
  341. package/web/dist/assets/{ask-card-CfNUHYt9.js → ask-card-DLtNyMH_.js} +2 -2
  342. package/web/dist/assets/assets-view-CLCckPll.js +1 -0
  343. package/web/dist/assets/{automation-format-BPrWgGBz.js → automation-format-BXwiLf2G.js} +1 -1
  344. package/web/dist/assets/automations-route-JizzZrRf.js +1 -0
  345. package/web/dist/assets/blink-1oEUjxch.webp +0 -0
  346. package/web/dist/assets/blink-B4Y4PYCR.webp +0 -0
  347. package/web/dist/assets/blink-BpqW08tf.webp +0 -0
  348. package/web/dist/assets/blink-C380t2a5.webp +0 -0
  349. package/web/dist/assets/blink-CLn5VMYQ.webp +0 -0
  350. package/web/dist/assets/blink-Cn_tI5Yd.webp +0 -0
  351. package/web/dist/assets/blink-D4EaTnc2.webp +0 -0
  352. package/web/dist/assets/blink-DY4Sm5aw.webp +0 -0
  353. package/web/dist/assets/blink-mcM10OfP.webp +0 -0
  354. package/web/dist/assets/body-CXEwT_gR.webp +0 -0
  355. package/web/dist/assets/body-D-UrLURv.webp +0 -0
  356. package/web/dist/assets/body-D7Q8eJDv.webp +0 -0
  357. package/web/dist/assets/body-DdNSx4-d.webp +0 -0
  358. package/web/dist/assets/body-DlFNtp32.webp +0 -0
  359. package/web/dist/assets/body-EreQeu3g.webp +0 -0
  360. package/web/dist/assets/body-Goc64z5o.webp +0 -0
  361. package/web/dist/assets/body-_FLmHm_q.webp +0 -0
  362. package/web/dist/assets/body-v5xTmq5E.webp +0 -0
  363. package/web/dist/assets/{bot-qZRkHkDp.js → bot-Cm-PLA1M.js} +1 -1
  364. package/web/dist/assets/{button-BrxohNcK.js → button-BqkA8Ovk.js} +1 -1
  365. package/web/dist/assets/{centered-state-CSW_o4N7.js → centered-state-CquGIOsq.js} +1 -1
  366. package/web/dist/assets/check-B1z-_MCO.js +1 -0
  367. package/web/dist/assets/chevron-left-CDAxCC2p.js +1 -0
  368. package/web/dist/assets/chevron-right-DPaV033p.js +1 -0
  369. package/web/dist/assets/chunk-KS7C4IRE-DtL2Gzw3.js +3 -0
  370. package/web/dist/assets/{circle-alert-COKQc-87.js → circle-alert-B7VNkPC2.js} +1 -1
  371. package/web/dist/assets/circle-check-LWKCYKhA.js +1 -0
  372. package/web/dist/assets/{collapsible-BJ0sxcz9.js → collapsible-BuSDxSYs.js} +1 -1
  373. package/web/dist/assets/command-CfdVVS0V.js +1 -0
  374. package/web/dist/assets/{commit-list-HXZj01RO.js → commit-list-D5Nuv2HC.js} +1 -1
  375. package/web/dist/assets/compare-variants-BBOnUKfp.js +1 -0
  376. package/web/dist/assets/composer-BPIW4tmM.js +18 -0
  377. package/web/dist/assets/composer-attachments-DyC9yyGs.js +3 -0
  378. package/web/dist/assets/concerned-BIuYysOA.webp +0 -0
  379. package/web/dist/assets/concerned-BWTrkjRS.webp +0 -0
  380. package/web/dist/assets/concerned-BW_ywmzK.webp +0 -0
  381. package/web/dist/assets/concerned-CXQVACqJ.webp +0 -0
  382. package/web/dist/assets/concerned-DdsJa1t2.webp +0 -0
  383. package/web/dist/assets/concerned-Dlln-1nu.webp +0 -0
  384. package/web/dist/assets/concerned-DrSCYUQV.webp +0 -0
  385. package/web/dist/assets/concerned-TOjmS1qX.webp +0 -0
  386. package/web/dist/assets/concerned-tIx9dV3J.webp +0 -0
  387. package/web/dist/assets/dashboard-B_ytEQ_y.js +44 -0
  388. package/web/dist/assets/diff-BQScRHXz.js +3 -0
  389. package/web/dist/assets/diff-stat-CxDTnfya.js +1 -0
  390. package/web/dist/assets/diff-view-8m9Rnct7.js +13 -0
  391. package/web/dist/assets/{directional-usage-BtjgT5nc.js → directional-usage-BerE4wJK.js} +1 -1
  392. package/web/dist/assets/dist-Br4Ra_c5.js +1 -0
  393. package/web/dist/assets/{download-DH68Y5Vz.js → download-HBguClwD.js} +1 -1
  394. package/web/dist/assets/dropdown-menu-CDv5Teql.js +1 -0
  395. package/web/dist/assets/excited-8dK2gfAF.webp +0 -0
  396. package/web/dist/assets/excited-B-w6ozXs.webp +0 -0
  397. package/web/dist/assets/excited-B4Sch7Ub.webp +0 -0
  398. package/web/dist/assets/excited-BPQk8ECE.webp +0 -0
  399. package/web/dist/assets/excited-BRFi0cue.webp +0 -0
  400. package/web/dist/assets/excited-BvbUAHvw.webp +0 -0
  401. package/web/dist/assets/excited-CCH-VUDr.webp +0 -0
  402. package/web/dist/assets/excited-TMExhEMj.webp +0 -0
  403. package/web/dist/assets/excited-cSRbau5J.webp +0 -0
  404. package/web/dist/assets/{external-link-BVYdhpSK.js → external-link-Bclznsu3.js} +1 -1
  405. package/web/dist/assets/file-preview-DQ7iQhe0.js +2 -0
  406. package/web/dist/assets/{file-DYpKJvYs.js → file-rCLi_p-R.js} +1 -1
  407. package/web/dist/assets/file-tree-Bm38qEZP.js +1 -0
  408. package/web/dist/assets/focused-XMnI1Trp.webp +0 -0
  409. package/web/dist/assets/{folder-CeFUSrsO.js → folder-leteY9jH.js} +1 -1
  410. package/web/dist/assets/follow-up-engine-Q1EcpRpB.js +1 -0
  411. package/web/dist/assets/git-pull-request-CURFMFaU.js +1 -0
  412. package/web/dist/assets/{git-pull-request-draft-DL1VMp1L.js → git-pull-request-draft-BZgJrUou.js} +1 -1
  413. package/web/dist/assets/git-tab-loading-CF0flOMS.js +1 -0
  414. package/web/dist/assets/github-DcvXvc4J.js +1 -0
  415. package/web/dist/assets/happy-B7LJPne_.webp +0 -0
  416. package/web/dist/assets/happy-CCpAho8w.webp +0 -0
  417. package/web/dist/assets/happy-Ch9wxHii.webp +0 -0
  418. package/web/dist/assets/happy-CnoCjXOf.webp +0 -0
  419. package/web/dist/assets/happy-DVeEwiyo.webp +0 -0
  420. package/web/dist/assets/happy-URIT6hFl.webp +0 -0
  421. package/web/dist/assets/happy-ZufSdCLm.webp +0 -0
  422. package/web/dist/assets/happy-kfLwwDLp.webp +0 -0
  423. package/web/dist/assets/happy-nVffy2Sx.webp +0 -0
  424. package/web/dist/assets/{host-usage-o1rC0TiP.js → host-usage-CX8OXl8q.js} +1 -1
  425. package/web/dist/assets/icon-tooltip-BMkyRHLt.js +1 -0
  426. package/web/dist/assets/impact-control-Deh1F44q.js +1 -0
  427. package/web/dist/assets/impact-model-Dj6tIycu.js +1 -0
  428. package/web/dist/assets/index-DuW72uFI.js +33 -0
  429. package/web/dist/assets/index-jRkTI5kE.css +2 -0
  430. package/web/dist/assets/{input-BxjGaO_P.js → input-BO795Un9.js} +1 -1
  431. package/web/dist/assets/laptop-D2EKUOdE.webp +0 -0
  432. package/web/dist/assets/layers-YoqiEcNh.js +1 -0
  433. package/web/dist/assets/layout-cards-Cvq2XaJL.js +1 -0
  434. package/web/dist/assets/{layout-grid-C4d5rrDE.js → layout-grid-CSvbdC6i.js} +1 -1
  435. package/web/dist/assets/left-BBmAC9hS.webp +0 -0
  436. package/web/dist/assets/left-BUX98ijg.webp +0 -0
  437. package/web/dist/assets/left-CCrTs359.webp +0 -0
  438. package/web/dist/assets/left-CxWtAZHp.webp +0 -0
  439. package/web/dist/assets/left-DDCoVDRG.webp +0 -0
  440. package/web/dist/assets/left-DFGwPnRL.webp +0 -0
  441. package/web/dist/assets/left-D_qxT7z_.webp +0 -0
  442. package/web/dist/assets/left-QXVHT2zO.webp +0 -0
  443. package/web/dist/assets/left-S_rwAL-X.webp +0 -0
  444. package/web/dist/assets/leg-left-0EW5L4pu.webp +0 -0
  445. package/web/dist/assets/leg-left-BGo9dZbQ.webp +0 -0
  446. package/web/dist/assets/leg-left-BZ8ETYLj.webp +0 -0
  447. package/web/dist/assets/leg-left-BahG1x_b.webp +0 -0
  448. package/web/dist/assets/leg-left-C-DJQ3Pt.webp +0 -0
  449. package/web/dist/assets/leg-left-C6ZvH8fW.webp +0 -0
  450. package/web/dist/assets/leg-left-DsfFyCf7.webp +0 -0
  451. package/web/dist/assets/leg-left-Iq6VC-OZ.webp +0 -0
  452. package/web/dist/assets/leg-left-rVU9cV-d.webp +0 -0
  453. package/web/dist/assets/leg-right-2MnCGKHj.webp +0 -0
  454. package/web/dist/assets/leg-right-BCgv_Tjj.webp +0 -0
  455. package/web/dist/assets/leg-right-BOxKTHZ9.webp +0 -0
  456. package/web/dist/assets/leg-right-BeDSbUV7.webp +0 -0
  457. package/web/dist/assets/leg-right-BwrF93s6.webp +0 -0
  458. package/web/dist/assets/leg-right-CU-y_n5h.webp +0 -0
  459. package/web/dist/assets/leg-right-DKSfNi2y.webp +0 -0
  460. package/web/dist/assets/leg-right-Dq0ze2e4.webp +0 -0
  461. package/web/dist/assets/leg-right-t34e1CvD.webp +0 -0
  462. package/web/dist/assets/lib-BQXq3kEf.js +1 -0
  463. package/web/dist/assets/loader-circle-DjzuGw6j.js +1 -0
  464. package/web/dist/assets/manager-chat-C4QqN-w6.js +1 -0
  465. package/web/dist/assets/manager-index-BGNDfiIy.js +1 -0
  466. package/web/dist/assets/manager-new-Dek6H9Bg.js +2 -0
  467. package/web/dist/assets/managers-Dufza9IX.js +1 -0
  468. package/web/dist/assets/{markdown-Di8pirEb.js → markdown-CP2EQDsL.js} +1 -1
  469. package/web/dist/assets/{markdown-rDA5iFAU.js → markdown-YWy3FUHK.js} +2 -2
  470. package/web/dist/assets/mascot-picker-0_LGzV_f.js +1 -0
  471. package/web/dist/assets/{message-square-CstvkIHe.js → message-square-beq8DjLH.js} +1 -1
  472. package/web/dist/assets/new-task-form-BgMiEphZ.js +2 -0
  473. package/web/dist/assets/pencil-RUM53auZ.js +1 -0
  474. package/web/dist/assets/picker-pill-BO6YUs1F.js +1 -0
  475. package/web/dist/assets/play-Cj3p2Q5t.js +1 -0
  476. package/web/dist/assets/plus-Bdmhj8CR.js +1 -0
  477. package/web/dist/assets/portrait-BJ2e30PF.webp +0 -0
  478. package/web/dist/assets/portrait-BeDbYw8Z.webp +0 -0
  479. package/web/dist/assets/portrait-Bq7D7LzX.webp +0 -0
  480. package/web/dist/assets/portrait-C6HtaggP.webp +0 -0
  481. package/web/dist/assets/portrait-CcOzDXGs.webp +0 -0
  482. package/web/dist/assets/portrait-D44z6yep.webp +0 -0
  483. package/web/dist/assets/portrait-DHLQRy13.webp +0 -0
  484. package/web/dist/assets/portrait-DU3qlTxc.webp +0 -0
  485. package/web/dist/assets/portrait-q94U_uD6.webp +0 -0
  486. package/web/dist/assets/project-router-xmadY-N9.js +1 -0
  487. package/web/dist/assets/queries-ba5qZ3kd.js +1 -0
  488. package/web/dist/assets/reasoning-effort-pill-B8Z1RaXL.js +1 -0
  489. package/web/dist/assets/reference-chip-C9pVQk05.js +1 -0
  490. package/web/dist/assets/reference-conflict-action-DxUm18aD.js +1 -0
  491. package/web/dist/assets/repo-git-DFf8ZGZv.js +1 -0
  492. package/web/dist/assets/right-BFOa1Ihi.webp +0 -0
  493. package/web/dist/assets/right-BLsBZrK1.webp +0 -0
  494. package/web/dist/assets/right-BVU3rYuj.webp +0 -0
  495. package/web/dist/assets/right-BbES4jIG.webp +0 -0
  496. package/web/dist/assets/right-C2klSA-G.webp +0 -0
  497. package/web/dist/assets/right-Cte2BTL5.webp +0 -0
  498. package/web/dist/assets/right-Dz7jYN17.webp +0 -0
  499. package/web/dist/assets/right-W2oGaUHb.webp +0 -0
  500. package/web/dist/assets/right-XJjUU0AU.webp +0 -0
  501. package/web/dist/assets/run-actions-CLIUiXwS.js +1 -0
  502. package/web/dist/assets/{run-diff-CFHlmgGA.js → run-diff-CxS_a1EO.js} +2 -2
  503. package/web/dist/assets/{save-C4TDysfG.js → save-zfKVAo2Y.js} +1 -1
  504. package/web/dist/assets/{scroll-within-D3mqUngk.js → scroll-within-DhWf-4MN.js} +1 -1
  505. package/web/dist/assets/search-CCE2KMtX.js +1 -0
  506. package/web/dist/assets/{search-x-BkezzsKh.js → search-x-BxcYdvqm.js} +1 -1
  507. package/web/dist/assets/{settings-2-DIHmg7wZ.js → settings-2-B0yYRU0q.js} +1 -1
  508. package/web/dist/assets/sheet-DxqNqi5S.js +1 -0
  509. package/web/dist/assets/skills-BmQ9hZ2c.js +1 -0
  510. package/web/dist/assets/sortable.esm-Dj7Kk-Wk.js +5 -0
  511. package/web/dist/assets/square--LrBHma0.js +1 -0
  512. package/web/dist/assets/standing-C42GacCE.webp +0 -0
  513. package/web/dist/assets/standing-C5Tul1Nv.webp +0 -0
  514. package/web/dist/assets/standing-CUU2Jka6.webp +0 -0
  515. package/web/dist/assets/standing-Ca5nprIS.webp +0 -0
  516. package/web/dist/assets/standing-CgOaMKRT.webp +0 -0
  517. package/web/dist/assets/standing-ClF4PE2-.webp +0 -0
  518. package/web/dist/assets/standing-CoS9fBjb.webp +0 -0
  519. package/web/dist/assets/standing-DZrhVTuG.webp +0 -0
  520. package/web/dist/assets/standing-MhG0Chks.webp +0 -0
  521. package/web/dist/assets/status-dot-Dxb9pPsK.js +1 -0
  522. package/web/dist/assets/tabs-CmEFauE4.js +1 -0
  523. package/web/dist/assets/{tag-B56iP2zA.js → tag-TWBVKabJ.js} +1 -1
  524. package/web/dist/assets/task-commits-sdhrDSta.js +1 -0
  525. package/web/dist/assets/{task-graph-ZjFyDrAV.js → task-graph-DqXUw-PM.js} +1 -1
  526. package/web/dist/assets/task-notes-ur3eZYQs.js +1 -0
  527. package/web/dist/assets/task-workspace-BvamqKbw.js +28 -0
  528. package/web/dist/assets/terminal-CmRAOyqu.js +1 -0
  529. package/web/dist/assets/terminal-drawer-BiRjtnip.js +1 -0
  530. package/web/dist/assets/{terminal-pane-CeYi-FvS.js → terminal-pane-YnSc_Vhs.js} +2 -2
  531. package/web/dist/assets/{textarea-BXN4nZ0d.js → textarea-C58jseO-.js} +1 -1
  532. package/web/dist/assets/toaster-5ad4wwJ9.js +1 -0
  533. package/web/dist/assets/tooltip-45rfBiq8.js +1 -0
  534. package/web/dist/assets/tracker-CcyqVPEo.js +4 -0
  535. package/web/dist/assets/triangle-alert-C1mTIqxM.js +1 -0
  536. package/web/dist/assets/typing-left-BWPbVi7e.webp +0 -0
  537. package/web/dist/assets/typing-right-HDY0V90O.webp +0 -0
  538. package/web/dist/assets/{upload-D_kW6AjR.js → upload-C2gxSnMR.js} +1 -1
  539. package/web/dist/assets/use-now-DD2atNhs.js +1 -0
  540. package/web/dist/assets/utils-Br_dqwn-.js +60 -0
  541. package/web/dist/assets/{workflow-j8scU63W.js → workflow-WvO4bTRt.js} +1 -1
  542. package/web/dist/assets/workflow-graph-B2oESW5u.js +13 -0
  543. package/web/dist/assets/worktree-lifecycle-BxYvSKsA.js +1 -0
  544. package/web/dist/assets/{worktree-lifecycle-operation-mYB7KCpQ.js → worktree-lifecycle-operation-BRID04bW.js} +1 -1
  545. package/web/dist/assets/x-CZSnHsZ4.js +1 -0
  546. package/web/dist/assets/{zoomable-image-CW-pQ6ZO.js → zoomable-image-DCITEnK-.js} +1 -1
  547. package/web/dist/index.html +70 -60
  548. package/web/dist/assets/agent-task-pickers-8skJH9bS.js +0 -1
  549. package/web/dist/assets/arrow-down-cBTb_EjO.js +0 -1
  550. package/web/dist/assets/arrow-left-BvR1Oqhc.js +0 -1
  551. package/web/dist/assets/arrow-up-Cn0IS81u.js +0 -1
  552. package/web/dist/assets/ask-answer-Cfb0vEFv.js +0 -1
  553. package/web/dist/assets/automations-route-B4axw9eb.js +0 -1
  554. package/web/dist/assets/check-B5omShEO.js +0 -1
  555. package/web/dist/assets/chevron-left-D74_-PJ_.js +0 -1
  556. package/web/dist/assets/chevron-right-C3fLn_fF.js +0 -1
  557. package/web/dist/assets/circle-check-j6r9xbE5.js +0 -1
  558. package/web/dist/assets/compare-variants-CDrFR7P_.js +0 -1
  559. package/web/dist/assets/composer-GntpkeQD.js +0 -18
  560. package/web/dist/assets/composer-attachments-Xa-qW8Eq.js +0 -3
  561. package/web/dist/assets/dashboard-CJW-Xk7f.js +0 -44
  562. package/web/dist/assets/diff-RPASOQVF.js +0 -3
  563. package/web/dist/assets/diff-view-Ckaab4uQ.js +0 -13
  564. package/web/dist/assets/file-preview-DOSEbcqV.js +0 -2
  565. package/web/dist/assets/git-tab-loading-DhclV71X.js +0 -1
  566. package/web/dist/assets/git-toolbar-Bk-3i42V.js +0 -1
  567. package/web/dist/assets/github-TdBnzj-H.js +0 -1
  568. package/web/dist/assets/icon-tooltip-CUJLXOxf.js +0 -1
  569. package/web/dist/assets/index-CDhEdFaZ.js +0 -33
  570. package/web/dist/assets/index-Dk1VTlxY.css +0 -2
  571. package/web/dist/assets/layout-cards-BYOEsNbu.js +0 -1
  572. package/web/dist/assets/lib-D2__YoPr.js +0 -1
  573. package/web/dist/assets/loader-circle-DCpZCAyT.js +0 -1
  574. package/web/dist/assets/manager-chat-B1Taq3Eg.js +0 -1
  575. package/web/dist/assets/manager-index-COwisKDf.js +0 -1
  576. package/web/dist/assets/manager-new-BdJPiBs2.js +0 -2
  577. package/web/dist/assets/manager-pickers-CvYpd5cU.js +0 -1
  578. package/web/dist/assets/managers-CDiETPHi.js +0 -1
  579. package/web/dist/assets/pencil-DWtoOm2f.js +0 -1
  580. package/web/dist/assets/picker-pill-DQICTO2N.js +0 -1
  581. package/web/dist/assets/play-BYwEI1EA.js +0 -1
  582. package/web/dist/assets/plus-BPopgSYQ.js +0 -1
  583. package/web/dist/assets/popover-DzdYqnHw.js +0 -1
  584. package/web/dist/assets/project-router-CmpQcVZp.js +0 -1
  585. package/web/dist/assets/queries-DOHu2y2B.js +0 -1
  586. package/web/dist/assets/reference-chip-ty5g_OLC.js +0 -1
  587. package/web/dist/assets/reference-conflict-action-B2LrO-o3.js +0 -1
  588. package/web/dist/assets/repo-git-CyoBxHfP.js +0 -1
  589. package/web/dist/assets/sheet-7RYAcp_E.js +0 -1
  590. package/web/dist/assets/skills-BBqk5FoM.js +0 -1
  591. package/web/dist/assets/sortable.esm-O2daV3YI.js +0 -5
  592. package/web/dist/assets/square-BPbl10lx.js +0 -1
  593. package/web/dist/assets/status-dot-C_5ryAFi.js +0 -1
  594. package/web/dist/assets/tabs-EEnYYrJF.js +0 -1
  595. package/web/dist/assets/task-commits-DFalvqkF.js +0 -1
  596. package/web/dist/assets/task-notes-DRDKGsIw.js +0 -1
  597. package/web/dist/assets/task-workspace-D2ak5sTE.js +0 -28
  598. package/web/dist/assets/terminal-B-JX8x9P.js +0 -1
  599. package/web/dist/assets/terminal-drawer-S0cBMANF.js +0 -1
  600. package/web/dist/assets/toaster-DrFdGtNN.js +0 -3
  601. package/web/dist/assets/tooltip-p6YPEpXC.js +0 -1
  602. package/web/dist/assets/tracker-CFDEuaFt.js +0 -4
  603. package/web/dist/assets/triangle-alert-Crbc2knA.js +0 -1
  604. package/web/dist/assets/use-now-DQpgbshl.js +0 -1
  605. package/web/dist/assets/utils-Df_1kJEk.js +0 -60
  606. package/web/dist/assets/workflow-graph-Cye5SBdg.js +0 -13
  607. package/web/dist/assets/worktree-lifecycle-Da61xsLH.js +0 -1
  608. package/web/dist/assets/x-sQR-jRBj.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{$ as r,At as i,Ft as a,Nt as o,Q as s,Rt as c,Z as l,_ as u,a as d,c as f,d as p,h as m,i as h,jt as ee,l as g,mt as te,o as ne,s as _,ut as v,v as re,zt as ie}from"./utils-Br_dqwn-.js";var ae=/^[\w!#$%&'*.^`|~+-]+$/,oe=(e,t,n={})=>{if(!ae.test(e))throw Error(`Invalid cookie name`);let r=`${e}=${t}`;if(e.startsWith(`__Secure-`)&&!n.secure)throw Error(`__Secure- Cookie must have Secure attributes`);if(e.startsWith(`__Host-`)){if(!n.secure)throw Error(`__Host- Cookie must have Secure attributes`);if(n.path!==`/`)throw Error(`__Host- Cookie must have Path attributes with "/"`);if(n.domain)throw Error(`__Host- Cookie must not have Domain attributes`)}for(let e of[`domain`,`path`,`sameSite`,`priority`])if(n[e]&&/[;\r\n]/.test(n[e]))throw Error(`${e} must not contain ";", "\\r", or "\\n"`);if(n&&typeof n.maxAge==`number`&&n.maxAge>=0){if(n.maxAge>3456e4)throw Error(`Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.`);r+=`; Max-Age=${n.maxAge|0}`}if(n.domain&&n.prefix!==`host`&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw Error(`Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw Error(`Partitioned Cookie must have Secure attributes`);r+=`; Partitioned`}return r},se=(e,t,n)=>(t=encodeURIComponent(t),oe(e,t,n)),ce=(e,t)=>(e=e.replace(/\/+$/,``),e+=`/`,t=t.replace(/^\/+/,``),e+t),le=(e,t)=>{for(let[n,r]of Object.entries(t)){let t=RegExp(`/:`+n+`(?:{[^/]+})?\\??`);e=e.replace(t,r?`/${r}`:``)}return e},ue=e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.set(n,r);return t},de=(e,t)=>{switch(t){case`ws`:return e.replace(/^http/,`ws`);case`http`:return e.replace(/^ws/,`http`)}},fe=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,`/`):e.replace(/\/index(?=\?|$)/,``);function y(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function pe(e,t){if(!y(e)&&!y(t))return t;let n={...e};for(let e in t){let r=t[e];y(n[e])&&y(r)?n[e]=pe(n[e],r):n[e]=r}return n}var me=(e,t)=>new Proxy(()=>{},{get(n,r){if(!(typeof r!=`string`||r===`then`))return me(e,[...t,r])},apply(n,r,i){return e({path:t,args:i})}}),he=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){let t=new FormData;for(let[n,r]of Object.entries(e.form))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.append(n,r);this.rBody=t}e.json&&(this.rBody=JSON.stringify(e.json),this.cType=`application/json`),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase(),r={...e?.header,...typeof t?.headers==`function`?await t.headers():t?.headers};if(e?.cookie){let t=[];for(let[n,r]of Object.entries(e.cookie))t.push(se(n,r,{path:`/`}));r.Cookie=t.join(`,`)}this.cType&&(r[`Content-Type`]=this.cType);let i=new Headers(r??void 0),a=this.url;a=fe(a),a=le(a,this.pathParams),this.queryParams&&(a=a+`?`+this.queryParams.toString()),n=this.method.toUpperCase();let o=!(n===`GET`||n===`HEAD`);return(t?.fetch||fetch)(a,{body:o?this.rBody:void 0,method:n,headers:i,...t?.init})}},ge=(e,t)=>me(function n(r){let i=t?.buildSearchParams??ue,a=[...r.path],o=a.slice(-3).reverse();if(o[0]===`toString`)return o[1]===`name`?o[2]||``:n.toString();if(o[0]===`valueOf`)return o[1]===`name`?o[2]||``:n;let s=``;if(/^\$/.test(o[0])){let e=a.pop();e&&(s=e.replace(/^\$/,``))}let c=ce(e,a.join(`/`));if(s===`url`||s===`path`){let t=c;return r.args[0]&&(r.args[0].param&&(t=le(c,r.args[0].param)),r.args[0].query&&(t=t+`?`+i(r.args[0].query).toString())),t=fe(t),s===`url`?new URL(t):t.slice(e.replace(/\/+$/,``).length).replace(/^\/?/,`/`)}if(s===`ws`){let e=de(r.args[0]&&r.args[0].param?le(c,r.args[0].param):c,`ws`),n=new URL(e),i=r.args[0]?.query;return i&&Object.entries(i).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,t)):n.searchParams.set(e,t)}),((...e)=>t?.webSocket!==void 0&&typeof t.webSocket==`function`?t.webSocket(...e):new WebSocket(...e))(n.toString())}let l=new he(c,s,{buildSearchParams:i});if(s){t??={};let e={...r.args[1]},n=t.headers,i=e.headers;n&&i&&(e.headers=async()=>({...typeof n==`function`?await n():n,...typeof i==`function`?await i():i}));let a=pe(t,e);return l.fetch(r.args[0],a)}return l},[]);function _e(e={}){let{baseUrl:t=``,token:n,headers:r,fetch:i}=e;return ge(t,{headers:{...n?{Authorization:`Bearer ${n}`}:{},...r},...i?{fetch:i}:{}})}var b=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ve=new class extends b{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ye={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},x=new class{#e=ye;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function be(e){setTimeout(e,0)}var xe=typeof window>`u`||`Deno`in globalThis;function S(){}function Se(e,t){return typeof e==`function`?e(t):e}function Ce(e){return typeof e==`number`&&e>=0&&e!==1/0}function we(e,t){return Math.max(e+(t||0)-Date.now(),0)}function C(e,t){return typeof e==`function`?e(t):e}function w(e,t){return typeof e==`function`?e(t):e}function Te(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==De(o,t.options))return!1}else if(!Oe(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ee(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(T(t.options.mutationKey)!==T(a))return!1}else if(!Oe(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function De(e,t){return(t?.queryKeyHashFn||T)(e)}function T(e){return JSON.stringify(e,(e,t)=>Me(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Oe(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Oe(e[n],t[n])):!1}var ke=Object.prototype.hasOwnProperty;function Ae(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=je(e)&&je(t);if(!r&&!(Me(e)&&Me(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ke.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Ae(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function E(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function je(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Me(e){if(!Ne(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Ne(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Ne(e){return Object.prototype.toString.call(e)===`[object Object]`}function Pe(e){return new Promise(t=>{x.setTimeout(t,e)})}function Fe(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Ae(e,t)}function Ie(e){return e}function Le(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Re(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ze=Symbol();function Be(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ze?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ve(e,t){return typeof e==`function`?e(...t):!!e}function He(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var D=(()=>{let e=()=>xe;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ue(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var We=be;function Ge(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=We,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var O=Ge(),Ke=new class extends b{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function qe(e){return Math.min(1e3*2**e,3e4)}function Je(e){return(e??`online`)!==`online`||Ke.isOnline()}var Ye=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Xe(e){let t=!1,n=0,r,i=Ue(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Ye(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>ve.isFocused()&&(e.networkMode===`always`||Ke.isOnline())&&e.canRun(),u=()=>Je(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(D.isServer()?0:3),o=e.retryDelay??qe,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),Pe(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Ze=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ce(this.gcTime)&&(this.#e=x.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(D.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(x.clearTimeout(this.#e),this.#e=void 0)}};function Qe(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{He(e,()=>t.signal,()=>n=!0)},u=Be(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Re:Le;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?et:$e,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:$e(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function $e(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function et(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function tt(e,t){return t?$e(e,t)!=null:!1}function nt(e,t){return!t||!e.getPreviousPageParam?!1:et(e,t)!=null}var rt=class extends Ze{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ot(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ot(this.options);e.data!==void 0&&(this.setState(at(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Fe(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(S).catch(S):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>w(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ze||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>C(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!we(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Be(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Qe(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Xe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ye&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Ye){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...it(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...at(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),O.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function it(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Je(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function at(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ot(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var st=class extends b{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=Ue(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),lt(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ut(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ut(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof w(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!E(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&dt(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||w(this.options.enabled,this.#t)!==w(t.enabled,this.#t)||C(this.options.staleTime,this.#t)!==C(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||w(this.options.enabled,this.#t)!==w(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return pt(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(S)),t}#g(){this.#b();let e=C(this.options.staleTime,this.#t);if(D.isServer()||this.#r.isStale||!Ce(e))return;let t=we(this.#r.dataUpdatedAt,e)+1;this.#d=x.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(D.isServer()||w(this.options.enabled,this.#t)===!1||!Ce(this.#p)||this.#p===0)&&(this.#f=x.setInterval(()=>{(this.options.refetchIntervalInBackground||ve.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(x.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(x.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&lt(e,t),o=i&&dt(e,n,t,r);(a||o)&&(l={...l,...it(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=Fe(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=Fe(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let ee=l.fetchStatus===`fetching`,g=m===`pending`,te=m===`error`,ne=g&&ee,_=d!==void 0,v={status:m,fetchStatus:l.fetchStatus,isPending:g,isSuccess:m===`success`,isError:te,isInitialLoading:ne,isLoading:ne,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:ee,isRefetching:ee&&!g,isLoadingError:te&&!_,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:te&&_,isStale:ft(e,t),refetch:this.refetch,promise:this.#o,isEnabled:w(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=v.data!==void 0,r=v.status===`error`&&!t,i=e=>{r?e.reject(v.error):t&&e.resolve(v.data)},a=()=>{let e=this.#o=v.promise=Ue();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||v.data!==o.value)&&a();break;case`rejected`:(!r||v.error!==o.reason)&&a();break}}return v}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!E(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){O.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function ct(e,t){return w(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&w(t.retryOnMount,e)===!1)}function lt(e,t){return ct(e,t)||e.state.data!==void 0&&ut(e,t,t.refetchOnMount)}function ut(e,t,n){if(w(t.enabled,e)!==!1&&C(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&ft(e,t)}return!1}function dt(e,t,n,r){return(e!==t||w(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&ft(e,n)}function ft(e,t){return w(t.enabled,e)!==!1&&e.isStaleByTime(C(t.staleTime,e))}function pt(e,t){return!E(e.getCurrentResult(),t)}var mt=class extends st{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:tt(t,n.data),hasPreviousPage:nt(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},ht=class extends Ze{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||gt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Xe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),O.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function gt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var _t=class extends b{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),E(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&T(t.mutationKey)!==T(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??gt();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){O.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function vt(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function yt(e,t,n){let r=e.slice(0);return r[t]=n,r}var bt=class extends b{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,O.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!E(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(vt(e,n).forEach(e=>{e.destroy()}),vt(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=Ae(this.#a,t(e))),this.#a}return e}#f(){return this.#r?.combine!==void 0&&this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new st(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=yt(this.#t,n,t),this.#h())}#h(){if(this.hasListeners()){let e=this.#u(this.#t,this.#l),t=this.#f(),n=this.#a,r=t?n:this.#d(e,this.#r?.combine);(t||n!==r)&&O.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},k=e(t(),1),xt=n(),St=k.createContext(void 0),A=e=>{let t=k.useContext(St);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ct=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,xt.jsx)(St.Provider,{value:e,children:t})),wt=k.createContext(!1),Tt=()=>k.useContext(wt);wt.Provider;function Et(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Dt=k.createContext(Et()),Ot=()=>k.useContext(Dt),kt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Ve(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},At=e=>{k.useEffect(()=>{e.clearReset()},[e])},jt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Ve(n,[e.error,r])),Mt=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Nt=(e,t)=>e.isLoading&&e.isFetching&&!t,Pt=(e,t)=>e?.suspense&&t.isPending,Ft=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function It({queries:e,...t},n){let r=A(n),i=Tt(),a=Ot(),o=k.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{Mt(e);let t=r.getQueryCache().get(e.queryHash);kt(e,a,t)}),At(a);let[s]=k.useState(()=>new bt(r,o,t)),[c,l,u]=s.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;k.useSyncExternalStore(k.useCallback(e=>d?s.subscribe(O.batchCalls(e)):S,[s,d]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),k.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let f=c.some((e,t)=>Pt(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&Pt(n,e)?Ft(n,new st(r,n),a):[]}):[];if(f.length>0)throw Promise.all(f);let p=c.find((e,t)=>{let n=o[t];return n&&jt({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(p?.error)throw p.error;return l(u())}function Lt(e,t,n){let r=Tt(),i=Ot(),a=A(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Mt(o),kt(o,i,s),At(i);let l=!a.getQueryCache().get(o.queryHash),[u]=k.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(k.useSyncExternalStore(k.useCallback(e=>{let t=f?u.subscribe(O.batchCalls(e)):S;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),k.useEffect(()=>{u.setOptions(o)},[o,u]),Pt(o,d))throw Ft(o,u,i);if(jt({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!D.isServer()&&Nt(d,r)&&(l?Ft(o,u,i):s?.promise)?.catch(S).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function j(e,t){return Lt(e,st,t)}function M(e,t){let n=A(t),[r]=k.useState(()=>new _t(n,e));k.useEffect(()=>{r.setOptions(e)},[r,e]);let i=k.useSyncExternalStore(k.useCallback(e=>r.subscribe(O.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=k.useCallback((e,t)=>{r.mutate(e,t).catch(S)},[r]);if(i.error&&Ve(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function N(e,t){return Lt(e,mt,t)}var Rt={projectId:null,apiBase:h},zt=(0,k.createContext)(Rt);function Bt(){return(0,k.useContext)(zt)}function Vt({projectId:e,children:t}){_()!==e&&p(e),(0,k.useLayoutEffect)(()=>{p(e)},[e]),(0,k.useLayoutEffect)(()=>()=>p(null),[]);let n=(0,k.useMemo)(()=>e===null?Rt:{projectId:e,apiBase:`${h}/p/${encodeURIComponent(e)}`},[e]);return(0,xt.jsx)(zt.Provider,{value:n,children:t})}var Ht={claude:0,codex:1,junie:2,opencode:3,cursor:4,pi:5,copilot:6,omp:7,antigravity:8,gemini:9,kimi:10},P=[...a].sort((e,t)=>Ht[e]-Ht[t]),Ut=new Set([`connected`,`disconnected`,`not-installed`,`unknown`]);function Wt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Gt(e,t){if(!Wt(e))return null;let{provider:n,status:r,enabled:i,hint:a,authFailureId:o}=e;return typeof n!=`string`||!P.includes(n)||typeof r!=`string`||!Ut.has(r)||t&&typeof i!=`boolean`||!t&&i!==void 0&&typeof i!=`boolean`||a!==void 0&&typeof a!=`string`||o!==void 0&&(typeof o!=`string`||o.length<1||o.length>128||r!==`disconnected`)?null:{provider:n,status:r,...typeof i==`boolean`?{enabled:i}:{},...a===void 0?{}:{hint:a},...o===void 0?{}:{authFailureId:o}}}function Kt(e){return Gt(e,!1)}function qt(e,t){if(!Wt(e)||!Array.isArray(e.providers))return null;let n=[],r=new Set;for(let i of e.providers){let e=Gt(i,t);if(e===null||r.has(e.provider))return null;r.add(e.provider),n.push(e)}return n}function F(e){let t=qt(e,!0);if(t===null||t.length===0)return null;let n=new Map(t.map(e=>[e.provider,e]));return P.flatMap(e=>{let t=n.get(e);return t?[t]:[]})}function I(e){let t=F(e);if(t===null)throw Error(`Invalid provider status response`);return{providers:t}}function Jt(e,t){let n=F(e);if(n!==null)return{providers:n.map(e=>e.provider===t.provider?{provider:t.provider,status:t.status,enabled:t.enabled??e.enabled,...t.hint===void 0?{}:{hint:t.hint},...t.authFailureId===void 0?{}:{authFailureId:t.authFailureId}}:e)}}function Yt(e,t,n,r){let i=F(e),a=F(t),o=F(n);if(o===null||a===null)return n;if(i===null)return{providers:a};let s=new Map(i.map(e=>[e.provider,e])),c=new Map(a.map(e=>[e.provider,e]));return{providers:o.map(e=>{let t=s.get(e.provider),n=c.get(e.provider);if(t===void 0||n===void 0)return n??e;let i=r!==void 0&&n.authFailureId===r&&e.authFailureId===void 0;return r!==void 0&&n.authFailureId!==void 0&&n.authFailureId!==r&&e.authFailureId===void 0?n:Xt(t,n)?e:i?{...e,enabled:n.enabled}:n})}}function Xt(e,t){return e.provider===t.provider&&e.status===t.status&&e.enabled===t.enabled&&e.hint===t.hint&&e.authFailureId===t.authFailureId}var Zt=new Set([`junie`,`antigravity`,`omp`]);function Qt(e){return e.status===`connected`||e.status===`unknown`&&Zt.has(e.provider)}function $t(e){let t=F(e);if(t===null)return[];let n=new Set(t.filter(e=>e.enabled&&Qt(e)).map(e=>e.provider));return P.filter(e=>n.has(e))}function en(e,t){return F(e)?.find(e=>e.provider===t)}var tn=`cezar:sid`,nn;function rn(e=Date.now()){let t=crypto.getRandomValues(new Uint8Array(16));for(let n=0;n<6;n++)t[n]=Math.floor(e/2**(8*(5-n)))&255;t[6]=t[6]&15|112,t[8]=t[8]&63|128;let n=[...t].map(e=>e.toString(16).padStart(2,`0`)).join(``);return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function an(){try{let e=localStorage.getItem(tn);if(e)return e;let t=rn();return localStorage.setItem(tn,t),t}catch{return nn??=rn()}}var on=`x-cezar-sid`;function sn(){nn=void 0;try{localStorage.removeItem(tn)}catch{}}function cn(e){if(typeof e!=`object`||!e)return;let{name:t,message:n}=e;return{name:typeof t==`string`?t:`unknown`,message:typeof n==`string`?n:``}}var ln=/\/(?:providers|agent-profiles)(?:\/|$)/;function un(e,t){if(!ln.test(e))return;let n=e.split(`/`),r=n[n.indexOf(`providers`)+1];if(n.includes(`providers`)&&l.safeParse(r).success)return r;if(typeof t==`string`)try{let e=JSON.parse(t).provider;return l.safeParse(e).success?e:void 0}catch{return}}var dn=null;function fn(e,t,n,r,i){try{let a=new URL(e,window.location.origin).pathname,o=un(a,r),s=cn(i);dn={method:(t??`GET`).toUpperCase(),path:a,status:n,at:Date.now(),...o?{provider:o}:{},...s?{cause:s}:{}}}catch{}}function pn(e=3e3,t=Date.now()){return dn&&t-dn.at<=e?dn:null}var L=class extends Error{status;manual;command;runIds;exists;constructor(e,t,n={}){super(t,n.cause===void 0?void 0:{cause:n.cause}),this.name=`ApiError`,this.status=e,this.manual=n.manual,this.command=n.command,this.exists=n.exists,this.runIds=n.runIds}};function R(e){try{return JSON.parse(e)}catch{return}}function mn(e){return typeof e==`string`?e:void 0}var hn=`the request was too large for the server, or for a proxy in front of it — attach fewer or smaller files, or raise the proxy body limit (nginx: client_max_body_size 32m)`;function z(e,t,n){let r=R(n),i=r&&typeof r==`object`?r:{},a=mn(i.error)??(e===413?hn:`${e} ${t||`request failed`}`.trim()),o=e===409?m.safeParse(r):void 0;return new L(e,a,{...o?.success?{runIds:o.data.runIds}:{},manual:mn(i.manual),command:mn(i.command),exists:typeof i.exists==`boolean`?i.exists:void 0})}var B=_e({fetch:(e,t)=>yn(gn(String(e)),t)});function gn(e){let t=vn(e.endsWith(`?`)?e.slice(0,-1):e);return t.startsWith(`/`)?`${ne()}${t}`:t}var _n=`${h}/p/default`;function vn(e){if(_()!==null||!e.startsWith(_n))return e;let t=e.slice(_n.length);return t===``||t.startsWith(`/`)||t.startsWith(`?`)?`${h}${t}`:e}var V=e=>({init:{signal:e?.signal}});async function H(e){try{return await e.text()}catch(t){throw t instanceof DOMException&&t.name===`AbortError`?t:(fn(e.url,void 0,0,void 0,t),new L(0,`cannot reach the cezar server (${e.url})`,{cause:t}))}}async function U(e,t){let n=await H(e);if(!e.ok)throw z(e.status,e.statusText,n);let r=R(n);if(r===void 0)throw new L(e.status,`the cezar server answered ${t} with a non-JSON body`);return r}async function W(e,t,n){let r=e.status,i=await U(e,t),a=n.safeParse(i);if(!a.success)throw new L(r,`the cezar server answered ${t} with an unexpected body`);return a.data}async function yn(e,t){try{let n=new Headers(t?.headers);n.set(on,an());let r=await fetch(e,{...t,headers:n,credentials:`include`});return r.ok||fn(e,t?.method,r.status,t?.body),r}catch(n){throw n instanceof DOMException&&n.name===`AbortError`?n:(fn(e,t?.method,0,t?.body,n),new L(0,`cannot reach the cezar server (${e})`,{cause:n}))}}async function bn(e,t){return yn(d(e),t)}async function xn(e,t={}){let n=new Headers(t.headers);n.set(`accept`,`text/plain`);let r=await bn(e,{...t,headers:n}),i=await H(r);if(!r.ok)throw z(r.status,r.statusText,i);return i}var G=(e,t=``)=>`/runs/${encodeURIComponent(e)}${t}`;async function Sn(e){return U(await B.api.v1.health.$get({},V(e)),`/health`)}async function Cn(e){return U(await B.api.v1[`star-count`].$get({},V(e)),`/star-count`)}async function wn(e){return U(await B.api.v1.preview[`design-proxy`].$post({json:e}),`/preview/design-proxy`)}async function Tn(e){return U(await B.api.v1.telemetry.consent.$get({},V(e)),`/telemetry/consent`)}async function En(e){return U(await B.api.v1.telemetry.consent.$put({json:e}),`/telemetry/consent`)}async function Dn(e,t){return U(await B.api.v1.models.$get({query:{runner:e}},V(t)),`/models`)}async function On(e=!1,t){return I(await U(await B.api.v1.providers.status.$get({query:e?{refresh:`1`}:{}},V(t)),`/providers/status`))}async function kn(e){return U(await B.api.v1.p[`:projectId`][`launch-key`].$get({param:{projectId:f()}},V(e)),`/launch-key`)}async function An(e){return U(await B.api.v1.projects.$get({},V(e)),`/projects`)}async function jn(e,t){return U(await B.api.v1.fs.browse.$get({query:{path:e===``?void 0:e,...t?.showHidden?{showHidden:`1`}:{}}},V(t)),`/fs/browse`)}async function Mn(e){return U(await B.api.v1.fs.repos.$get({},V(e)),`/fs/repos`)}async function Nn(e){return U(await B.api.v1.projects[`:projectId`][`git-init`].$post({param:{projectId:encodeURIComponent(e)}}),`/projects/${encodeURIComponent(e)}/git-init`)}async function Pn(e,t){return U(await B.api.v1.projects[`:projectId`][`publish-github`].$post({param:{projectId:encodeURIComponent(e)},json:t}),`/projects/${encodeURIComponent(e)}/publish-github`)}async function Fn(){return U(await B.api.v1.github.login.$post(),`/github/login`)}async function In(e){return U(await B.api.v1.github.login.$get({},V(e)),`/github/login`)}async function Ln(){return U(await B.api.v1.github.login.$delete(),`/github/login`)}async function Rn(e){return U(await B.api.v1.providers.setup.$get({},V(e)),`/providers/setup`)}async function zn(e,t){return U(await B.api.v1.providers.setup.sessions.$post({json:{provider:e,action:t}}),`/providers/setup/sessions`)}async function Bn(e,t){return U(await B.api.v1.providers.setup.sessions[`:sessionId`].output.$get({param:{sessionId:e},query:{cursor:String(t)}}),`/providers/setup/sessions/${e}/output`)}async function Vn(e,t){await U(await B.api.v1.providers.setup.sessions[`:sessionId`].input.$post({param:{sessionId:e},json:{data:t}}),`/providers/setup/sessions/${e}/input`)}async function Hn(e,t,n){await U(await B.api.v1.providers.setup.sessions[`:sessionId`].resize.$post({param:{sessionId:e},json:{cols:t,rows:n}}),`/providers/setup/sessions/${e}/resize`)}async function Un(e){await U(await B.api.v1.providers.setup.sessions[`:sessionId`].$delete({param:{sessionId:e}}),`/providers/setup/sessions/${e}`)}async function Wn(e){return U(await B.api.v1.p[`:projectId`].runs.$get({param:{projectId:f()},query:{}},V(e)),`/runs`)}async function Gn(e,t){return U(await B.api.v1.p[`:projectId`].runs.$get({param:{projectId:e},query:{}},V(t)),`/runs`)}async function Kn(e){return U(await B.api.v1.workspace[`runs-index`].$get({},V(e)),`/workspace/runs-index`)}async function qn(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].$get({param:{projectId:f(),id:encodeURIComponent(e)}},V(t)),G(e))}async function Jn(e,t,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`].$get({param:{projectId:e,id:encodeURIComponent(t)}},V(n)),G(t))}async function Yn(e,t,n){return W(await B.api.v1.p[`:projectId`].runs[`:id`].history.$get({param:{projectId:f(),id:encodeURIComponent(e)},query:{...t===void 0?{}:{cursor:t}}},V(n)),`${G(e)}/history`,ie)}async function Xn(e,t){return W(await B.api.v1.p[`:projectId`].runs[`:id`][`history-context`].$get({param:{projectId:f(),id:encodeURIComponent(e)}},V(t)),`${G(e)}/history-context`,c)}async function Zn(e){return U(await B.api.v1.p[`:projectId`][`ui-state`].$get({param:{projectId:f()}},V(e)),`/ui-state`)}async function Qn(e){return U(await B.api.v1.p[`:projectId`].workflows.$get({param:{projectId:f()}},V(e)),`/workflows`)}async function $n(e){return U(await B.api.v1.p[`:projectId`].skills.$get({param:{projectId:f()},query:{}},V(e)),`/skills`)}async function er(e){return U(await B.api.v1.p[`:projectId`].skills.$get({param:{projectId:f()},query:{wait:`1`}},V(e)),`/skills`)}async function tr(){return U(await B.api.v1.p[`:projectId`].skills.refresh.$post({param:{projectId:f()}}),`/skills/refresh`)}async function nr(e){return U(await B.api.v1.p[`:projectId`].skills.importable.$get({param:{projectId:f()},query:{}},V(e)),`/skills/importable`)}async function rr(e){return U(await B.api.v1.p[`:projectId`].skills.importable.$get({param:{projectId:f()},query:{wait:`1`}},V(e)),`/skills/importable`)}async function ir(e){return U(await B.api.v1.p[`:projectId`].todos.$get({param:{projectId:f()}},V(e)),`/todos`)}async function ar(e){return U(await B.api.v1.p[`:projectId`].repo.$get({param:{projectId:f()}},V(e)),`/repo`)}async function or(e){return U(await B.api.v1.p[`:projectId`].config.$get({param:{projectId:f()}},V(e)),`/config`)}async function sr(e={}){return U(await B.api.v1.p[`:projectId`][`agent-config`].$get({param:{projectId:f()}},V(e)),`/agent-config`)}async function cr(e,t={}){return U(await B.api.v1.p[`:projectId`][`agent-config`][`:id`].$get({param:{projectId:f(),id:encodeURIComponent(e)}},V(t)),`/agent-config/${encodeURIComponent(e)}`)}async function lr(e,t){return U(await B.api.v1.p[`:projectId`][`agent-config`][`:id`].$put({param:{projectId:f(),id:encodeURIComponent(e)},json:t}),`/agent-config/${encodeURIComponent(e)}`)}async function ur(e){return U(await B.api.v1.p[`:projectId`].repo.changes.$get({param:{projectId:f()}},V(e)),`/repo/changes`)}async function dr(e){return U(await B.api.v1.p[`:projectId`].repo.tree.$get({param:{projectId:f()}},V(e)),`/repo/tree`)}async function fr(e,t){return U(await B.api.v1.p[`:projectId`].repo.files.$get({param:{projectId:f()},query:{path:e}},V(t)),`/repo/files`)}function pr(e){return d(`/repo/files?path=${encodeURIComponent(e)}&raw=1`)}async function mr(e,t){return U(await B.api.v1.p[`:projectId`].repo.commit[`:sha`].$get({param:{projectId:f(),sha:encodeURIComponent(e)},query:{structured:`1`}},V(t)),`/repo/commit/:sha`)}async function hr(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].tree.$get({param:{projectId:f(),id:encodeURIComponent(e)}},V(t)),G(e,`/tree`))}async function gr(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].commits.$get({param:{projectId:f(),id:encodeURIComponent(e)}},V(t)),G(e,`/commits`))}async function _r(e,t,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`].commit[`:sha`].$get({param:{projectId:f(),id:encodeURIComponent(e),sha:encodeURIComponent(t)}},V(n)),G(e,`/commit/${encodeURIComponent(t)}`))}async function vr(e={},t){return U(await B.api.v1.p[`:projectId`].github.$get({param:{projectId:f()},query:{limit:e.limit===void 0?void 0:String(e.limit),refresh:e.refresh?`1`:void 0,issuesCursor:e.issuesCursor,prsCursor:e.prsCursor,issuesDone:e.issuesDone?`1`:void 0,prsDone:e.prsDone?`1`:void 0}},V(t)),`/github`)}async function yr(e={},t){return U(await B.api.v1.p[`:projectId`].tracker[`automation-options`].$get({param:{projectId:f()},query:e},V(t)),`/tracker/automation-options`)}async function br(e){return U(await B.api.v1.p[`:projectId`].tracker.connection.$get({param:{projectId:f()}},V(e)),`/tracker/connection`)}async function xr(e){return U(await B.api.v1.p[`:projectId`].tracker.connection.$put({param:{projectId:f()},json:e}),`/tracker/connection`)}async function Sr(){return U(await B.api.v1.p[`:projectId`].tracker.connection.$delete({param:{projectId:f()}}),`/tracker/connection`)}async function Cr(e){return U(await B.api.v1.p[`:projectId`].secrets.$get({param:{projectId:f()}},V(e)),`/secrets`)}async function wr(e){return U(await B.api.v1.workspace.secrets.$get({},V(e)),`/workspace/secrets`)}async function Tr(e){if(!e.ok)throw z(e.status,e.statusText,await H(e))}async function Er(e,t){await Tr(await B.api.v1.p[`:projectId`].secrets[`:name`].$put({param:{projectId:f(),name:e},json:t}))}async function Dr(e){await Tr(await B.api.v1.p[`:projectId`].secrets[`:name`].$delete({param:{projectId:f(),name:e}}))}async function Or(e,t){await Tr(await B.api.v1.workspace.secrets[`:name`].$put({param:{name:e},json:t}))}async function kr(e){await Tr(await B.api.v1.workspace.secrets[`:name`].$delete({param:{name:e}}))}async function Ar(e){return U(await B.api.v1.p[`:projectId`].e2e.$get({param:{projectId:f()}},V(e)),`/e2e`)}async function jr(e){return U(await B.api.v1.p[`:projectId`].e2e.setup.$post({param:{projectId:f()},json:e}),`/e2e/setup`)}async function Mr(e){return U(await B.api.v1.p[`:projectId`].tracker.association.$get({param:{projectId:f()}},V(e)),`/tracker/association`)}async function Nr(e,t={},n){return U(await B.api.v1.p[`:projectId`].tracker.candidates.$get({param:{projectId:f()},query:{kind:e,q:t.q,cursor:t.cursor,limit:t.limit===void 0?void 0:String(t.limit)}},V(n)),`/tracker/candidates`)}async function Pr(e){return U(await B.api.v1.p[`:projectId`].tracker.association.$put({param:{projectId:f()},json:e}),`/tracker/association`)}async function Fr(){return U(await B.api.v1.p[`:projectId`].tracker.association.$delete({param:{projectId:f()}}),`/tracker/association`)}function Ir(e){return{expectedScope:e.association?i(e.association):void 0,cursor:e.cursor,limit:e.limit===void 0?void 0:String(e.limit),refresh:e.refresh?`1`:void 0,state:e.state,labels:e.labels?.length?JSON.stringify(e.labels):void 0}}async function Lr(e={},t){return U(await B.api.v1.p[`:projectId`].tracker.$get({param:{projectId:f()},query:Ir(e)},V(t)),`/tracker`)}async function Rr(e,t={},n){return U(await B.api.v1.p[`:projectId`].tracker.search.$get({param:{projectId:f()},query:{...Ir(t),q:e}},V(n)),`/tracker/search`)}async function zr(e,t){return U(await B.api.v1.p[`:projectId`].tracker[`:id`].$get({param:{projectId:f(),id:encodeURIComponent(e)},query:{expectedScope:t?.association?i(t.association):void 0}},V(t)),`/tracker/${encodeURIComponent(e)}`)}async function Br(e,t){return U(await B.api.v1.p[`:projectId`].github.checks.$get({param:{projectId:f()},query:{prs:e.join(`,`)}},V(t)),`/github/checks`)}async function Vr(e,t,n={},r){return U(await B.api.v1.p[`:projectId`].github.search.$get({param:{projectId:f()},query:{kind:e,q:t,limit:n.limit}},V(r)),`/github/search`)}async function Hr(e,t,n){return U(await B.api.v1.p[`:projectId`].github[`ref-status`].$get({param:{projectId:e},query:{...t.prs?.length?{prs:t.prs.join(`,`)}:{},...t.issues?.length?{issues:t.issues.join(`,`)}:{}}},V(n)),`/github/ref-status`)}async function Ur(e,t,n={},r){return U(await B.api.v1.p[`:projectId`].github.comments[`:kind`][`:number`].$get({param:{projectId:f(),kind:e,number:String(t)},query:{refresh:n.refresh?`1`:void 0}},V(r)),`/github/comments/${e}/${t}`)}async function Wr(e,t={},n){return U(await B.api.v1.p[`:projectId`].github.prs[`:number`][`merge-state`].$get({param:{projectId:f(),number:String(e)},query:{refresh:t.refresh?`1`:void 0}},V(n)),`/github/prs/${e}/merge-state`)}async function Gr(e,t){return U(await B.api.v1.p[`:projectId`].github.prs[`:number`].merge.$post({param:{projectId:f(),number:String(e)},json:t}),`/github/prs/:number/merge`)}async function Kr(e,t={},n){return U(await B.api.v1.p[`:projectId`].github.prs[`:number`].changes.$get({param:{projectId:f(),number:String(e)},query:{refresh:t.refresh?`1`:void 0}},V(n)),`/github/prs/${e}/changes`)}function qr(e,t){return xn(G(e,`/diff`),{method:`GET`,signal:t?.signal})}function Jr(e,t){return xn(G(e,`/handoff`),{method:`GET`,signal:t?.signal})}async function Yr(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].changes.$get({param:{projectId:f(),id:encodeURIComponent(e)}},V(t)),G(e,`/changes`))}async function Xr(e,t,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`].files.$get({param:{projectId:f(),id:encodeURIComponent(e)},query:{path:t}},V(n)),`/runs/:id/files`)}function Zr(e,t,n){let r=n?`&rev=${encodeURIComponent(n)}`:``;return d(G(e,`/files?path=${encodeURIComponent(t)}&raw=1${r}`))}async function Qr(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].artifacts.$get({param:{projectId:f(),id:encodeURIComponent(e)}},V(t)),G(e,`/artifacts`))}function $r(e){return e.split(`/`).map(encodeURIComponent).join(`/`)}function ei(e,t,n){return xn(G(e,`/artifacts/${$r(t)}`),{method:`GET`,signal:n?.signal})}function ti(e,t,n){let r=n===void 0?``:`?v=${n}`;return d(G(e,`/artifacts/${$r(t)}${r}`))}function ni(e){return e.kind===`pr`?`pr:${e.number}`:`spec:${e.path}`}async function ri(e){return U(await B.api.v1.p[`:projectId`].impact.$post({param:{projectId:f()},json:e}),`/impact`)}async function ii(e,t){let n=ni(e);return W(await B.api.v1.p[`:projectId`].artifacts.$get({param:{projectId:f()},query:{subject:n}},V(t)),`/artifacts?subject=${encodeURIComponent(n)}`,re)}async function ai(e){return W(await B.api.v1.p[`:projectId`].assets.$get({param:{projectId:f()}},V(e)),`/assets`,u)}async function oi(e,t){return U(await B.api.v1.p[`:projectId`].groups[`:groupId`].$get({param:{projectId:f(),groupId:encodeURIComponent(e)}},V(t)),`/groups/${encodeURIComponent(e)}`)}async function si(e,t){return U(await B.api.v1.providers.connect.$post({json:{provider:e,...t?{profileId:t}:{}}}),`/providers/connect`)}async function ci(e){return U(await B.api.v1.providers[`:provider`].update.$post({param:{provider:e}}),`/providers/${encodeURIComponent(e)}/update`)}async function li(e,t){return I(await U(await B.api.v1.providers[`:provider`].enabled.$put({param:{provider:e},json:{enabled:t}}),`/providers/${encodeURIComponent(e)}/enabled`))}async function ui(e,t){return I(await U(await B.api.v1.providers[`:provider`].retry.$post({param:{provider:e},json:{authFailureId:t}}),`/providers/${encodeURIComponent(e)}/retry`))}async function di(e){let t=`/projects`,n=await bn(t,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({root:e})}),r=await H(n),i=R(r),a=i?.project;if((n.ok||n.status===409)&&a!=null)return i;throw n.ok?new L(n.status,`the cezar server answered ${t} without a project`):z(n.status,n.statusText,r)}async function fi(e){return U(await B.api.v1.projects.checkout.$post({json:e}),`/projects/checkout`)}async function pi(e){return U(await B.api.v1.projects.create.$post({json:e}),`/projects/create`)}async function mi(e){return W(await B.api.v1.projects[`github-owners`].$get({},V(e)),`/projects/github-owners`,v)}async function hi(e){return U(await B.api.v1.projects[`:projectId`].$delete({param:{projectId:encodeURIComponent(e)}}),`/projects/${encodeURIComponent(e)}`)}async function gi(e,t){return U(await B.api.v1.projects[`:projectId`].$patch({param:{projectId:encodeURIComponent(e)},json:t}),`/projects/${encodeURIComponent(e)}`)}async function _i(e){return U(await B.api.v1.p[`:projectId`].runs.$post({param:{projectId:f()},json:e}),`/runs`)}async function vi(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].cancel.$post({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e,`/cancel`))}async function yi(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].promote.$post({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e,`/promote`))}async function bi(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`][`start-now`].$post({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e,`/start-now`))}async function xi(e,t=!0,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`].archive.$post({param:{projectId:f(),id:encodeURIComponent(e)},json:{archived:t,...n?{surface:n}:{}}}),G(e,`/archive`))}async function Si(e,t=!0,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`].pin.$post({param:{projectId:f(),id:encodeURIComponent(e)},json:{pinned:t,...n?{surface:n}:{}}}),G(e,`/pin`))}async function Ci(e,t,n=!0,r){return U(await B.api.v1.p[`:projectId`].runs[`:id`].pin.$post({param:{projectId:e,id:encodeURIComponent(t)},json:{pinned:n,...r?{surface:r}:{}}}),G(t,`/pin`))}async function wi(e,t,n=!0,r){return U(await B.api.v1.p[`:projectId`].runs[`:id`].archive.$post({param:{projectId:e,id:encodeURIComponent(t)},json:{archived:n,...r?{surface:r}:{}}}),G(t,`/archive`))}async function Ti(e,t,n){let r=n?`read`:`unread`;return U(await(n?B.api.v1.p[`:projectId`].runs[`:id`].read.$post({param:{projectId:e,id:encodeURIComponent(t)}}):B.api.v1.p[`:projectId`].runs[`:id`].unread.$post({param:{projectId:e,id:encodeURIComponent(t)}})),G(t,`/${r}`))}async function Ei(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`][`auto-resume`].$delete({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e,`/auto-resume`))}async function Di(){return U(await B.api.v1.p[`:projectId`].runs[`archive-finished`].$post({param:{projectId:f()}}),`/runs/archive-finished`)}async function Oi(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].read.$post({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e,`/read`))}async function ki(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].unread.$post({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e,`/unread`))}async function Ai(){return U(await B.api.v1.p[`:projectId`].runs[`read-all`].$post({param:{projectId:f()}}),`/runs/read-all`)}async function ji(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].land.$post({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e,`/land`))}async function Mi(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].finish.$post({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e,`/finish`))}async function Ni(e,t={}){let n={...t.text===void 0?{}:{text:t.text},...t.images===void 0?{}:{images:t.images},...t.runner===void 0?{}:{runner:t.runner},...t.model===void 0?{}:{model:t.model},...t.reasoningEffort===void 0?{}:{reasoningEffort:t.reasoningEffort},...t.agentProfile===void 0?{}:{agentProfile:t.agentProfile},...t.idempotencyKey===void 0?{}:{idempotencyKey:t.idempotencyKey}};return U(await B.api.v1.p[`:projectId`].runs[`:id`].continue.$post({param:{projectId:f(),id:encodeURIComponent(e)},json:n}),G(e,`/continue`))}async function Pi(e,t,n={}){return U(await B.api.v1.p[`:projectId`].runs[`:id`].continue.$post({param:{projectId:e,id:encodeURIComponent(t)},json:{...n.text===void 0?{}:{text:n.text},...n.images===void 0?{}:{images:n.images},...n.runner===void 0?{}:{runner:n.runner},...n.model===void 0?{}:{model:n.model},...n.agentProfile===void 0?{}:{agentProfile:n.agentProfile},...n.idempotencyKey===void 0?{}:{idempotencyKey:n.idempotencyKey}}}),G(t,`/continue`))}var Fi=1e3;async function Ii(e,t={}){let n=f(),r=async()=>U(await B.api.v1.p[`:projectId`].runs[`:id`].pr.$post({param:{projectId:n,id:encodeURIComponent(e)},json:t}),G(e,`/pr`));try{return await r()}catch(e){if(!(e instanceof L)||e.status!==0)throw e;await new Promise(e=>setTimeout(e,Fi));try{return await r()}catch(t){throw t instanceof L&&t.status===0?e:t}}}async function Li(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].pr.adopt.$post({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e,`/pr/adopt`))}async function Ri(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].$patch({param:{projectId:f(),id:encodeURIComponent(e)},json:t}),G(e))}async function zi(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].$delete({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e))}async function Bi(e){return U(await B.api.v1.p[`:projectId`].todos[`:id`].$delete({param:{projectId:f(),id:encodeURIComponent(e)}}),`/todos/${encodeURIComponent(e)}`)}async function Vi(e,t={}){let n={...t.runner===void 0?{}:{runner:t.runner},...t.model===void 0?{}:{model:t.model},...t.reasoningEffort===void 0?{}:{reasoningEffort:t.reasoningEffort},...t.prompt===void 0?{}:{prompt:t.prompt}};return U(await B.api.v1.p[`:projectId`].todos[`:id`].start.$post({param:{projectId:f(),id:encodeURIComponent(e)},json:Object.keys(n).length>0?n:void 0}),`/todos/${encodeURIComponent(e)}/start`)}async function Hi(e,t){return U(await B.api.v1.p[`:projectId`].groups[`:groupId`].pick.$post({param:{projectId:f(),groupId:encodeURIComponent(e)},json:{runId:t}}),`/groups/${encodeURIComponent(e)}/pick`)}async function Ui(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`][`open-in-cli`].$post({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e,`/open-in-cli`))}async function Wi(e){return U(await B.api.v1.p[`:projectId`][`open-targets`].$get({param:{projectId:f()}},V(e)),`/open-targets`)}async function Gi(e){return U(await B.api.v1.p[`:projectId`][`open-in`].$post({param:{projectId:f()},json:{target:e}}),`/open-in`)}async function Ki(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`][`open-in`].$post({param:{projectId:f(),id:encodeURIComponent(e)},json:{target:t}}),G(e,`/open-in`))}async function qi(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`][`open-in`].$post({param:{projectId:f(),id:encodeURIComponent(e)},json:{target:`default`,path:t}}),G(e,`/open-in`))}async function Ji(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].git.commit.$post({param:{projectId:f(),id:encodeURIComponent(e)},json:{message:t}}),G(e,`/git/commit`))}async function Yi(e,t,n=f()){return U(await B.api.v1.p[`:projectId`].runs[`:id`].git.status.$get({param:{projectId:n,id:encodeURIComponent(e)}},V(t)),G(e,`/git/status`))}async function Xi(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].git.push.$post({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e,`/git/push`))}var Zi=[250,750,1500],Qi=e=>new Promise(t=>setTimeout(t,e));async function $i(e,t,n=Qi){let r={text:t.text??``,images:t.images??[],idempotencyKey:t.idempotencyKey??rn()};for(let t=0;;t+=1)try{return await e(r)}catch(e){let r=Zi[t];if(!(e instanceof L)||e.status!==0||r===void 0)throw e;await n(r)}}async function ea(e,t){return $i(async t=>U(await B.api.v1.p[`:projectId`].runs[`:id`].messages.$post({param:{projectId:f(),id:encodeURIComponent(e)},json:t}),G(e,`/messages`)),t)}async function ta(e,t,n){return $i(async n=>U(await B.api.v1.p[`:projectId`].runs[`:id`].messages.$post({param:{projectId:e,id:encodeURIComponent(t)},json:n}),G(t,`/messages`)),n)}async function na(e,t,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`][`queued-messages`][`:msgId`].$patch({param:{projectId:f(),id:encodeURIComponent(e),msgId:encodeURIComponent(t)},json:n}),G(e,`/queued-messages/${encodeURIComponent(t)}`))}async function ra(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`][`queued-messages`][`:msgId`].$delete({param:{projectId:f(),id:encodeURIComponent(e),msgId:encodeURIComponent(t)}}),G(e,`/queued-messages/${encodeURIComponent(t)}`))}async function ia(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].drafts.$get({param:{projectId:f(),id:encodeURIComponent(e)}},V(t)),G(e,`/drafts`))}var aa=56*1024;async function oa(e,t,n,r){let i=r?.keepalive===!0&&new TextEncoder().encode(JSON.stringify(n)).length<=aa;return U(await B.api.v1.p[`:projectId`].runs[`:id`].drafts[`:surface`].$put({param:{projectId:f(),id:encodeURIComponent(e),surface:t},json:n},{init:{keepalive:i}}),G(e,`/drafts/${t}`))}async function sa(e,t,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`].drafts[`:surface`].images.$post({param:{projectId:f(),id:encodeURIComponent(e),surface:t},json:n}),G(e,`/drafts/${t}/images`))}async function ca(e){return U(await B.api.v1.workspace.uploads.$post({json:e}),`/workspace/uploads`)}async function la(e){return U(await B.api.v1.workspace.uploads[`:uploadId`].$delete({param:{uploadId:e}}),`/workspace/uploads/${e}`)}async function ua(e,t,n,r){return U(await B.api.v1.p[`:projectId`].runs[`:id`].drafts[`:surface`].images[`:imageId`].$get({param:{projectId:f(),id:encodeURIComponent(e),surface:t,imageId:n}},V(r)),G(e,`/drafts/${t}/images/${n}`))}async function da(e,t,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`].drafts[`:surface`].images[`:imageId`].$delete({param:{projectId:f(),id:encodeURIComponent(e),surface:t,imageId:n}}),G(e,`/drafts/${t}/images/${n}`))}async function fa(e){return U(await B.api.v1.p[`:projectId`].repo.branch.$post({param:{projectId:f()},json:e}),`/repo/branch`)}async function pa(e){return U(await B.api.v1.p[`:projectId`].repo.sync.$get({param:{projectId:f()}},V(e)),`/repo/sync`)}async function ma(e){let t={param:{projectId:f()}},n=B.api.v1.p[`:projectId`].repo;return U(e===`fetch`?await n.fetch.$post(t):e===`pull`?await n.pull.$post(t):e===`push`?await n.push.$post(t):await n.sync.$post(t),`/repo/${e}`)}async function ha(e){return U(await B.api.v1.p[`:projectId`].plan.$post({param:{projectId:f()},json:{task:e}}),`/plan`)}async function ga(e){return U(await B.api.v1.p[`:projectId`].automations.$get({param:{projectId:f()}},V(e)),`/automations`)}async function _a(e){return U(await B.api.v1.p[`:projectId`].automations.$post({param:{projectId:f()},json:e}),`/automations`)}async function va(e,t){return U(await B.api.v1.p[`:projectId`].automations[`:id`].$put({param:{projectId:f(),id:encodeURIComponent(e)},json:t}),`/automations/${encodeURIComponent(e)}`)}async function ya(e,t){let n={projectId:f(),id:encodeURIComponent(e)},r=`/automations/${encodeURIComponent(e)}/${t?`enable`:`pause`}`;return U(t?await B.api.v1.p[`:projectId`].automations[`:id`].enable.$post({param:n}):await B.api.v1.p[`:projectId`].automations[`:id`].pause.$post({param:n}),r)}async function ba(e){let t=`/automations/${encodeURIComponent(e)}/work`;return U(await B.api.v1.p[`:projectId`].automations[`:id`].work.$get({param:{projectId:f(),id:encodeURIComponent(e)}}),t)}async function xa(e){let t=`/automations/${encodeURIComponent(e)}/cancel-queued`;return U(await B.api.v1.p[`:projectId`].automations[`:id`][`cancel-queued`].$post({param:{projectId:f(),id:encodeURIComponent(e)}}),t)}async function Sa(e,t){return U(await B.api.v1.p[`:projectId`].automations[`:id`].check.$post({param:{projectId:f(),id:encodeURIComponent(e)},json:{mode:t}}),`/automations/${encodeURIComponent(e)}/check`)}async function Ca(e,t){return U(await B.api.v1.p[`:projectId`][`automation-log`].$get({param:{projectId:f()},query:{automationId:e}},V(t)),`/automation-log?automationId=${encodeURIComponent(e)}`)}async function wa(e){return U(await B.api.v1.p[`:projectId`][`automation-log`][`:receiptId`].retry.$post({param:{projectId:f(),receiptId:encodeURIComponent(e)}}),`/automation-log/${encodeURIComponent(e)}/retry`)}async function Ta(e,t){return U(await B.api.v1.p[`:projectId`].automations[`:id`].run.$post({param:{projectId:f(),id:encodeURIComponent(e)},query:t?{expectedRevision:String(t)}:{}}),`/automations/${encodeURIComponent(e)}/run`)}async function Ea(e,t){let n=await B.api.v1.p[`:projectId`].automations[`:id`].$delete({param:{projectId:f(),id:encodeURIComponent(e)},query:t?{expectedRevision:String(t)}:{}});if(!n.ok)throw z(n.status,n.statusText,await H(n))}async function Da(e){return U(await B.api.v1.p[`:projectId`].automations.export.$get({param:{projectId:f()},query:e?.length?{ids:e.join(`,`)}:{}}),`/automations/export`)}async function Oa(e){return U(await B.api.v1.p[`:projectId`].automations.import.preview.$post({param:{projectId:f()},json:e}),`/automations/import/preview`)}async function ka(e){return U(await B.api.v1.p[`:projectId`].automations.import.$post({param:{projectId:f()},json:e}),`/automations/import`)}async function Aa(e,t){return U(await B.api.v1.workspace[`automation-templates`].$get({query:e?{exclude:e}:{}},V(t)),`/workspace/automation-templates`)}async function ja(e){return U(await B.api.v1.p[`:projectId`].workflows.$post({param:{projectId:f()},json:e}),`/workflows`)}async function Ma(e){return U(await B.api.v1.p[`:projectId`].workflows.nodes.$get({param:{projectId:f()}},V(e)),`/workflows/nodes`)}async function Na(e){return U(await B.api.v1.p[`:projectId`].workflows.validate.$post({param:{projectId:f()},json:{graph:e}}),`/workflows/validate`)}async function Pa(e){return U(await B.api.v1.p[`:projectId`].workflows.graph.$post({param:{projectId:f()},json:e}),`/workflows/graph`)}async function Fa(e){return U(await B.api.v1.p[`:projectId`].workflows.parse.$post({param:{projectId:f()},json:{yaml:e}}),`/workflows/parse`)}async function Ia(e){return U(await B.api.v1.p[`:projectId`].workflows[`:name`].$delete({param:{projectId:f(),name:encodeURIComponent(e)}}),`/workflows/${encodeURIComponent(e)}`)}async function La(e,t=f()){return U(await B.api.v1.p[`:projectId`][`ui-state`].$put({param:{projectId:t},json:e}),`/ui-state`)}async function Ra(e){return U(await B.api.v1.workspace[`ui-state`].$get({},V(e)),`/workspace/ui-state`)}async function za(e,t={}){return U(await B.api.v1.workspace[`ui-state`].$put({json:e},{init:{keepalive:t.keepalive}}),`/workspace/ui-state`)}async function Ba(e){let t=await U(await B.api.v1.workspace.config.$get({},V(e)),`/workspace/config`);return{...t,branding:t.branding?{...t.branding,logoUrl:t.branding.logoUrl?g(t.branding.logoUrl):null}:{name:`cezar`,logoUrl:null},agentDefaults:t.agentDefaults??{},orgSkillsRepos:t.orgSkillsRepos??[],resources:{...t.resources,idleTimeoutMinutes:t.resources.idleTimeoutMinutes===void 0?15:t.resources.idleTimeoutMinutes}}}async function Va(e){let t=new FormData;t.set(`file`,e);let n=await bn(`/workspace/branding-logo`,{method:`POST`,body:t}),i=await H(n);if(!n.ok)throw z(n.status,n.statusText,i);let a=R(i),o=r.safeParse(a);if(!o.success)throw new L(n.status,`the cezar server answered /workspace/branding-logo with an unexpected body`);return o.data.logoUrl?g(o.data.logoUrl):null}async function Ha(){let e=await bn(`/workspace/branding-logo`,{method:`DELETE`}),t=await H(e);if(!e.ok)throw z(e.status,e.statusText,t);let n=r.safeParse(R(t));if(!n.success)throw new L(e.status,`the cezar server answered /workspace/branding-logo with an unexpected body`);return n.data.logoUrl?g(n.data.logoUrl):null}async function Ua(e){return U(await B.api.v1.workspace[`host-usage`].$get({},V(e)),`/workspace/host-usage`)}async function Wa(e){let t=await U(await B.api.v1.workspace[`agent-profiles`].$get({},V(e)),`/workspace/agent-profiles`);return{...t,profileCapableProviders:t.profileCapableProviders??[],selections:t.selections??{},defaults:t.defaults??{},profiles:(t.profiles??[]).map(e=>({...e,files:e.files??[]}))}}async function Ga(e,t){return U(await B.api.v1.workspace[`agent-profiles`][`fallback-policy`].$get({query:e},V(t)),`/workspace/agent-profiles/fallback-policy`)}async function Ka(e,t){return U(await B.api.v1.workspace[`agent-profiles`][`fallback-policy`].$put({json:e},V(t)),`/workspace/agent-profiles/fallback-policy`)}async function qa(e){return U(await B.api.v1.workspace[`agent-profiles`].$post({json:e}),`/workspace/agent-profiles`)}async function Ja(e,t){return U(await B.api.v1.workspace[`agent-profiles`][`:id`].status.$get({param:{id:encodeURIComponent(e)},query:{...t?.refresh||t?.recheck?{refresh:`1`}:{},...t?.recheck?{recheck:`1`}:{}}},V(t)),`/workspace/agent-profiles/${encodeURIComponent(e)}/status`)}async function Ya(e,t){return U(await B.api.v1.workspace[`agent-profiles`][`:id`].details.$get({param:{id:encodeURIComponent(e)}},V(t)),`/workspace/agent-profiles/${encodeURIComponent(e)}/details`)}async function Xa(e,t){return U(await B.api.v1.workspace[`agent-profiles`][`:id`].open.$post({param:{id:encodeURIComponent(e)},json:t}),`/workspace/agent-profiles/${encodeURIComponent(e)}/open`)}async function Za(e){return U(await B.api.v1.workspace[`agent-profiles`].selection.$put({json:e}),`/workspace/agent-profiles/selection`)}async function Qa(e,t){return U(await B.api.v1.workspace[`agent-profiles`][`:id`].$patch({param:{id:encodeURIComponent(e)},json:t}),`/workspace/agent-profiles/${encodeURIComponent(e)}`)}async function $a(e){return U(await B.api.v1.workspace[`agent-profiles`][`:id`].$delete({param:{id:encodeURIComponent(e)}}),`/workspace/agent-profiles/${encodeURIComponent(e)}`)}async function eo(e,t){return U(await B.api.v1.workspace[`skills-update`].$get({query:{projectId:e}},V(t)),`/workspace/skills-update?projectId=${encodeURIComponent(e)}`)}async function to(e){return U(await B.api.v1.workspace[`skills-update`].check.$post({json:{projectId:e}}),`/workspace/skills-update/check`)}async function no(e){return U(await B.api.v1.workspace[`skills-update`].apply.$post({json:{projectId:e}}),`/workspace/skills-update/apply`)}async function ro(e){return U(await B.api.v1.workspace[`self-update`].$get({},V(e)),`/workspace/self-update`)}async function io(){return U(await B.api.v1.workspace[`self-update`].refresh.$post({}),`/workspace/self-update/refresh`)}async function ao(e){return U(await B.api.v1.workspace[`self-update`].development.$get({query:e?.refresh?{refresh:`1`}:{}},V(e)),`/workspace/self-update/development`)}async function oo(e){return U(await B.api.v1.workspace[`self-update`].channel.$put({json:{channel:e}}),`/workspace/self-update/channel`)}async function so(e){return U(await B.api.v1.workspace[`self-update`].apply.$post({json:{version:e}}),`/workspace/self-update/apply`)}async function co(e){return U(await B.api.v1.workspace[`self-update`].apply.$post({json:{version:e,whenIdle:!0}}),`/workspace/self-update/apply`)}async function lo(){return U(await B.api.v1.workspace[`self-update`].scheduled.$delete({}),`/workspace/self-update/scheduled`)}async function uo(e){let t=await U(await B.api.v1.workspace.config.$put({json:e}),`/workspace/config`);return{...t,orgSkillsRepos:t.orgSkillsRepos??[]}}async function fo(e){return U(await B.api.v1.p[`:projectId`].config.$put({param:{projectId:f()},json:e}),`/config`)}async function po(e){return U(await B.api.v1.p[`:projectId`].worktrees.$get({param:{projectId:f()}},V(e)),`/worktrees`)}async function mo(){return U(await B.api.v1.p[`:projectId`].worktrees.reclaim.$post({param:{projectId:f()},json:{}}),`/worktrees/reclaim`)}async function ho(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`][`remove-worktree`].$post({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e,`/remove-worktree`))}async function go(e,t,n){return ee.parse(await U(await B.api.v1.p[`:projectId`].tracker.watch.$post({param:{projectId:e},json:t},{init:{signal:n}}),`/tracker/watch`))}async function _o(e,t,n,r){return o.parse(await U(await B.api.v1.p[`:projectId`].tracker.watch[`:watchId`].$get({param:{projectId:e,watchId:t},query:{after:r===void 0?void 0:String(r)}},{init:{signal:n}}),`/tracker/watch`))}async function vo(e,t,n){return o.parse(await U(await B.api.v1.p[`:projectId`].tracker.watch[`:watchId`].$post({param:{projectId:e,watchId:t}},{init:{signal:n}}),`/tracker/watch`))}var yo={list:async(e,t)=>U(await B.api.v1.p[`:projectId`].webhooks.$get({param:{projectId:e}},{init:{signal:t}}),`/webhooks`),create:async(e,t)=>U(await B.api.v1.p[`:projectId`].webhooks.$post({param:{projectId:e},json:t}),`/webhooks`),update:async(e,t,n)=>U(await B.api.v1.p[`:projectId`].webhooks[`:id`].$patch({param:{projectId:e,id:t},json:n}),`/webhooks`),remove:async(e,t,n)=>U(await B.api.v1.p[`:projectId`].webhooks[`:id`].$delete({param:{projectId:e,id:t},json:{expectedRevision:n}}),`/webhooks`),activate:async(e,t,n)=>U(await B.api.v1.p[`:projectId`].webhooks[`:id`].activate.$post({param:{projectId:e,id:t},json:{expectedRevision:n,confirmed:!0}}),`/webhooks`),pause:async(e,t,n)=>U(await B.api.v1.p[`:projectId`].webhooks[`:id`].pause.$post({param:{projectId:e,id:t},json:{expectedRevision:n}}),`/webhooks`),resume:async(e,t,n)=>U(await B.api.v1.p[`:projectId`].webhooks[`:id`].resume.$post({param:{projectId:e,id:t},json:{expectedRevision:n,confirmed:!0}}),`/webhooks`),rotate:async(e,t,n,r)=>U(await B.api.v1.p[`:projectId`].webhooks[`:id`][`rotate-secret`].$post({param:{projectId:e,id:t},json:{expectedRevision:n,mode:r}}),`/webhooks`),test:async(e,t,n)=>U(await B.api.v1.p[`:projectId`].webhooks[`:id`].test.$post({param:{projectId:e,id:t},json:n}),`/webhooks`),retry:async(e,t,n)=>U(await B.api.v1.p[`:projectId`].webhooks.deliveries[`:deliveryId`].retry.$post({param:{projectId:e,deliveryId:t},json:n}),`/webhooks`),replay:async(e,t,n)=>U(await B.api.v1.p[`:projectId`].webhooks.deliveries[`:deliveryId`].replay.$post({param:{projectId:e,deliveryId:t},json:{...n,confirmed:!0}}),`/webhooks`),acknowledge:async(e,t)=>U(await B.api.v1.p[`:projectId`].webhooks.notice.acknowledge.$post({param:{projectId:e},json:{expectedChangeSequence:t}}),`/webhooks`),history:async(e,t)=>U(await B.api.v1.p[`:projectId`].webhooks.history.$get({param:{projectId:e},query:{limit:`100`,...t?{cursor:t}:{}}}),`/webhooks/history`),deliveries:async(e,t,n,r)=>U(await B.api.v1.p[`:projectId`].webhooks[`:id`].deliveries.$get({param:{projectId:e,id:t},query:{limit:`100`,...n?{cursor:n}:{},...r?{taskId:r}:{}}}),`/webhooks/deliveries`),activity:async(e,t)=>U(await B.api.v1.p[`:projectId`].webhooks[`:id`].activity.$get({param:{projectId:e,id:t}}),`/webhooks/activity`)};async function bo(e={limit:50},t){return U(await B.api.v1.p[`:projectId`][`worktree-lifecycle`].$get({param:{projectId:f()},query:{cursor:e.cursor,limit:e.limit,attentionOnly:e.attentionOnly===void 0?void 0:e.attentionOnly?`true`:`false`}},V(t)),`/worktree-lifecycle`)}async function xo(e,t){return U(await B.api.v1.p[`:projectId`][`worktree-lifecycle`][`:worktreeId`].$get({param:{projectId:f(),worktreeId:e}},V(t)),`/worktree-lifecycle`)}async function So(e,t){return U(await B.api.v1.p[`:projectId`][`worktree-lifecycle`].operations[`:operationId`].$get({param:{projectId:f(),operationId:e}},V(t)),`/worktree-lifecycle/operations`)}async function Co(e,t=0,n){return U(await B.api.v1.p[`:projectId`][`worktree-lifecycle`].operations[`:operationId`].output.$get({param:{projectId:f(),operationId:e},query:{afterSeq:t,limit:100}},V(n)),`/worktree-lifecycle/operations/output`)}async function wo(e,t=f()){return U(await B.api.v1.p[`:projectId`][`worktree-lifecycle`].operations.$post({param:{projectId:t},json:e}),`/worktree-lifecycle/operations`)}async function To(e,t){return U(await B.api.v1.p[`:projectId`][`worktree-lifecycle`].operations[`:operationId`].actions.$post({param:{projectId:f(),operationId:e},json:t}),`/worktree-lifecycle/operations/actions`)}async function Eo(e){return U(await B.api.v1.p[`:projectId`][`worktree-lifecycle`].preview.$post({param:{projectId:f()},json:e}),`/worktree-lifecycle/preview`)}async function Do(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].terminal.$get({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e,`/terminal`))}async function Oo(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].terminal.$post({param:{projectId:f(),id:encodeURIComponent(e)},json:t}),G(e,`/terminal`))}async function ko(e,t,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`].terminal[`:sessionId`].output.$get({param:{projectId:f(),id:encodeURIComponent(e),sessionId:t},query:{cursor:String(n)}}),G(e,`/terminal/${t}/output`))}async function Ao(e,t,n){await U(await B.api.v1.p[`:projectId`].runs[`:id`].terminal[`:sessionId`].input.$post({param:{projectId:f(),id:encodeURIComponent(e),sessionId:t},json:{data:n}}),G(e,`/terminal/${t}/input`))}async function jo(e,t,n,r){await U(await B.api.v1.p[`:projectId`].runs[`:id`].terminal[`:sessionId`].resize.$post({param:{projectId:f(),id:encodeURIComponent(e),sessionId:t},json:{cols:n,rows:r}}),G(e,`/terminal/${t}/resize`))}async function Mo(e,t){await U(await B.api.v1.p[`:projectId`].runs[`:id`].terminal[`:sessionId`].$delete({param:{projectId:f(),id:encodeURIComponent(e),sessionId:t}}),G(e,`/terminal/${t}`))}async function No(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].terminal.urls.$get({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e,`/terminal/urls`))}async function Po(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].terminal.commands.$get({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e,`/terminal/commands`))}async function Fo(){return U(await B.api.v1.p[`:projectId`][`start-app`].$get({param:{projectId:f()}}),`/start-app`)}async function Io(e){return U(await B.api.v1.p[`:projectId`][`start-app`].$put({param:{projectId:f()},json:e}),`/start-app`)}async function Lo(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].layouts.$get({param:{projectId:f(),id:encodeURIComponent(e)}}),G(e,`/layouts`))}async function Ro(e,t,n){let r=n?.keepalive===!0&&new TextEncoder().encode(JSON.stringify(t)).length<=aa;return U(await B.api.v1.p[`:projectId`].runs[`:id`].layouts.$put({param:{projectId:f(),id:encodeURIComponent(e)},json:t},{init:{keepalive:r}}),G(e,`/layouts`))}async function zo(e){return U(await B.api.v1.p[`:projectId`][`deferred-start`].preview.$post({param:{projectId:f()},json:e}),`/deferred-start/preview`)}async function Bo(e){return U(await B.api.v1.p[`:projectId`][`deferred-start`].$post({param:{projectId:f()},json:e}),`/deferred-start`)}async function Vo(e){return U(await B.api.v1.p[`:projectId`][`deferred-start`].options.$post({param:{projectId:f()},json:e}),`/deferred-start/options`)}async function Ho(e,t,n=f()){return U(await B.api.v1.p[`:projectId`].github.asset.$post({param:{projectId:n},json:{url:e}},V(t)),`/github/asset`)}function Uo(e,t){if(e===`ping`)return{project:null,event:{type:`ping`}};let n;try{n=JSON.parse(t)}catch{return null}if(!Wo(n))return null;let r=n.project;if(typeof r!=`string`||r===``)return null;switch(e){case`run`:{let{project:e,...t}=n;return Go(t)?{project:r,event:{type:`run`,run:t}}:null}case`run-deleted`:{let e=n.id;return typeof e==`string`&&e?{project:r,event:{type:`run-deleted`,id:e}}:null}case`todos`:return Array.isArray(n.items)?{project:r,event:{type:`todos`,items:n.items}}:null;case`usage`:return Wo(n.usage)?{project:r,event:{type:`usage`,usage:n.usage}}:null;default:return null}}function Wo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Go(e){return Wo(e)&&typeof e.id==`string`&&e.id!==``}function Ko(e){return typeof e.task==`string`&&Array.isArray(e.steps)}function qo(e,t){if(!e)return;let n=e.findIndex(e=>e.id===t.id),r=n<0?void 0:e[n];if(r!==void 0){let i=[...e];return i[n]=Yo(r,t),i}if(!Ko(t))return e;let i=t.createdAt??``,a=e.findIndex(e=>(e.createdAt??``).localeCompare(i)<0),o=[...e];return o.splice(a<0?e.length:a,0,t),o}function Jo(e,t){if(!e)return;let n=e.filter(e=>e.id!==t);return n.length===e.length?e:n}function Yo(e,t){let n={...t};if(!Ko(t)){let t=n;for(let n of te)n in e&&(t[n]=e[n])}let r=e=>e===`user`?2:+(e===`marker`);return r(e.titleOrigin)>r(t.titleOrigin)&&(n.title=e.title,n.titleSummary=e.titleSummary,n.titleOrigin=e.titleOrigin),e.usage&&(n.usage=e.usage),n}var Xo=Object.freeze({});function Zo(){let e=Xo,t=new Set;return{subscribe(e){return t.add(e),()=>t.delete(e)},get:()=>e,set(n){e=n;for(let e of t)e()}}}var Qo={draft:{label:`Draft`,hint:`the author has not marked it ready for review`,tone:`neutral`},"review-required":{label:`Waiting for review`,hint:`checks are fine, no one has reviewed it yet`,tone:`info`},"changes-requested":{label:`Changes requested`,hint:`a reviewer asked for edits before this can merge`,tone:`danger`},"checks-pending":{label:`Checks running`,hint:`CI has not finished on the latest commit`,tone:`pending`},"checks-failing":{label:`Checks failing`,hint:`CI is red on the latest commit`,tone:`danger`},ready:{label:`Ready to merge`,hint:`open, checks pass, nothing is waiting on a reviewer`,tone:`success`},merged:{label:`Merged`,hint:`this landed on its base branch`,tone:`violet`},closed:{label:`Closed`,hint:`closed without merging — the work did not land`,tone:`danger`},open:{label:`Open`,hint:`still open on the tracker`,tone:`success`},completed:{label:`Closed as completed`,hint:`the issue was resolved`,tone:`violet`},"not-planned":{label:`Closed as not planned`,hint:`the issue was declined — nothing shipped for it`,tone:`neutral`}},$o={label:`Merge conflicts`,hint:`this branch no longer merges cleanly into its base — rebase or merge the base in`,tone:`conflict`};function es(e){return typeof e==`string`&&Object.hasOwn(Qo,e)}function ts(e){return e!==void 0&&es(e)?Qo[e]:void 0}var ns={permission:0,error:1,waiting:2,running:3,unseen:4,none:5};function rs(e){return!1}function is(e){return!1}function as(e){let t=e.dispatch?.overBudget?e.dispatch.budgetUsd:void 0;if(!(e.status!==`waiting`||t===void 0))return{spent:e.costUsd??0,ceiling:t}}function K(e){return e.status===`failed`&&e.awaitingAnswerSince!==void 0}function os(e){return e.status===`failed`&&e.idleClosedAt!==void 0&&!K(e)}function ss(e){return!!e.worktreeLifecycle?.needsAttention||e.status===`waiting`||e.status===`review`||K(e)}function cs(e){let t=e.worktreeLifecycle;return t?.needsAttention?{bucket:`waiting`,tone:`pending`,pulse:!1,label:t.phase===`setup`?`setup needs attention`:`cleanup needs attention`}:t?.activeOperationId?{bucket:`running`,tone:`pending`,pulse:!0,label:t.phase===`setup`?`preparing worktree`:`cleaning up worktree`}:rs(e)?{bucket:`permission`,tone:`violet`,pulse:!0,label:`needs permission`}:e.status===`failed`&&e.autoResumeAt?{bucket:`none`,tone:`pending`,pulse:!1,label:`scheduled`}:K(e)?{bucket:`waiting`,tone:`pending`,pulse:!0,label:`needs you`}:os(e)?{bucket:`none`,tone:`idle`,pulse:!1,label:`closed · idle`}:e.status===`failed`?{bucket:`error`,tone:`danger`,pulse:!1,label:`failed`}:e.status===`waiting`?{bucket:`waiting`,tone:`pending`,pulse:!0,label:as(e)?.ceiling===void 0?`needs you`:`budget reached`}:e.status===`review`?{bucket:`waiting`,tone:`violet`,pulse:!0,label:`needs review`}:e.status===`running`&&e.activity===`monitoring`?{bucket:`running`,tone:`violet`,pulse:!0,label:`monitoring`}:e.status===`running`?{bucket:`running`,tone:`violet`,pulse:!0,label:`running`}:is(e)?{bucket:`unseen`,tone:`violet`,pulse:!1,label:`unseen`}:e.status===`queued`&&e.fallbackEpisode?.pending?{bucket:`running`,tone:`violet`,pulse:!0,label:`switching agent`}:e.status===`queued`?{bucket:`none`,tone:`neutral`,pulse:!1,label:`queued`}:e.status===`done`?{bucket:`none`,tone:`success`,pulse:!1,label:`done`}:{bucket:`none`,tone:`neutral`,pulse:!1,label:`cancelled`}}function ls(e){return ns[cs(e).bucket]<=ns.waiting}var us=[`Pinned`,`Needs you`,`Working`,`Recent`,`Archived`],ds={waiting:0,review:1,running:2,queued:4,done:5,failed:5,cancelled:5},fs=3,ps=e=>e.status===`failed`&&e.autoResumeAt!==void 0?fs:K(e)?ds.waiting??0:ds[e.status]??9;function ms(e,t){return t===`archived`?`Archived`:e.pinned?`Pinned`:ss(e)?`Needs you`:e.status===`running`||e.status===`queued`||e.status===`failed`&&e.autoResumeAt?`Working`:`Recent`}function hs(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function gs(e){let t=/^(\d{1,9}): (.+)$/.exec(e),n=t?.[1],r=t?.[2];return n===void 0||r===void 0?{ref:null,rest:e}:{ref:Number(n),rest:r}}function _s(e,t){return t!==void 0&&gs(e).ref===t}function vs(e){return e.title.replace(/ \([A-C]\)$/,``)}function ys(e,t){if(e.promotedAt||t.promotedAt){if(!e.promotedAt)return 1;if(!t.promotedAt)return-1;let n=t.promotedAt.localeCompare(e.promotedAt);if(n!==0)return n}return e.createdAt.localeCompare(t.createdAt)}function bs(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort(ys);return new Map(t.map((e,t)=>[e.id,t+1]))}var xs=[{value:`recent`,label:`Recent`},{value:`created`,label:`Created`}];function Ss(e,t){let n=Date.parse(e),r=Date.parse(t);return Number.isNaN(n)||Number.isNaN(r)?t.localeCompare(e):r-n}function Cs(e){if(e.lastActivityAt!==void 0)return e.lastActivityAt;let t=e.finishedAt??e.startedAt??e.createdAt;for(let n of e.steps??[]){let e=n.finishedAt??n.startedAt;e!==void 0&&Ss(e,t)<0&&(t=e)}return t}function ws(e,t){return t===`created`?e.createdAt:Cs(e)}function Ts(e){return e===`created`?`Created`:`Updated`}function Es(e,t){if(t===`archived`)return[{key:`rest`,label:null,runs:[...e]}];let n=new Map(e.map(e=>[e.id,e])),r=e=>{let t=new Set;for(let r=e;r&&!t.has(r.id);r=n.get(r.dispatch?.parentRunId??``)){if(r.pinned)return!0;t.add(r.id)}return!1},i=e.filter(r);if(i.length===0)return[{key:`rest`,label:null,runs:[...e]}];let a=e.filter(e=>!r(e));return[{key:`pinned`,label:`Pinned`,runs:i},...a.length>0?[{key:`rest`,label:`All tasks`,runs:a}]:[]]}function Ds(e,t){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,n)=>{if(t!==`archived`){let t=Number(!!n.pinned)-Number(!!e.pinned);if(t!==0)return t}let r=ps(e)-ps(n);if(r!==0)return r;if(ps(e)===fs&&e.autoResumeAt&&n.autoResumeAt){let t=e.autoResumeAt.localeCompare(n.autoResumeAt);if(t!==0)return t}return e.status===`queued`&&n.status===`queued`?ys(e,n):Ss(Cs(e),Cs(n))})}function Os(e,t,n){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,r)=>{if(t!==`archived`){let t=Number(!!r.pinned)-Number(!!e.pinned);if(t!==0)return t}return Ss(ws(e,n),ws(r,n))})}function ks(e,t){let n=bs(e),r=Ds(e,t),i=new Map,a=(e,t)=>{let n=i.get(e);n?n.push(t):i.set(e,[t])},o=new Set;for(let e of r){if(e.groupId){if(o.has(e.groupId))continue;o.add(e.groupId);let n=r.filter(t=>t.groupId===e.groupId).sort((e,t)=>(e.variant??``).localeCompare(t.variant??``));if(n.length>1){a(ms(e,t),{kind:`group`,groupId:e.groupId,title:vs(e),members:n});continue}}a(ms(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null})}return us.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function As(e,t){let n=[],r=t;for(let t of e){if(t.label===`Pinned`){n.push({label:t.label,rows:[...t.rows]});continue}if(r<=0)continue;let e=t.rows.slice(0,r);r-=e.length,n.push({label:t.label,rows:e})}return n}function js(e){let t=0,n=0,r=0;for(let i of e){if(i.archived){n+=1;continue}t+=1,ss(i)&&(r+=1)}return{active:t,archived:n,waiting:r}}var Ms=new Set([`running`,`waiting`]),Ns=new Set([`done`,`failed`,`review`,`cancelled`]),Ps=new Set([`done`,`failed`,`cancelled`]);function Fs(e){return e?e>=1024**3?`${(e/1024**3).toFixed(1)} GB`:e>=1024**2?`${Math.round(e/1024**2)} MB`:`${Math.round(e/1024)} kB`:``}function Is(e){return e?`$${e>=10?e.toFixed(0):e.toFixed(2)}`:``}function Ls(e,t=new Date){if(e.status!==`failed`||!e.autoResumeAt)return;let n=new Date(e.autoResumeAt);if(!Number.isFinite(n.getTime()))return;let r=n.toDateString()===t.toDateString(),i=new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(n);return{label:r?i:`${new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(n)} ${i}`,title:`Resumes automatically at ${new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(n)}`}}function Rs(e){if(e.workflow===`(planned)`||e.workflow===`(inbox)`){let t=e.steps.find(e=>e.kind===`agent`);if(t?.name)return t.name}return e.workflow}function zs(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>[hs(e),e.branch??``,e.workflow,Rs(e)].some(e=>e.toLowerCase().includes(n))):[...e]}function Bs(e){return e.filter(e=>!e.archived&&Ps.has(e.status)&&!K(e)).length}function Vs(e,t=!1){if(!e)return;let n=e.trim().replace(/\/+$/,``),r=/^(?:https?|ssh|git|git\+ssh):\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/(.+)$/.exec(n),i=r?null:/^(?:[^@/:]+@)?([^:/]+):(.+)$/.exec(n),a=r??i;if(!a)return;let[,o,s]=a;if(!s||!o||!t&&o.toLowerCase()!==`github.com`)return;let c=s.replace(/\.git$/i,``).split(`/`).filter(Boolean),l=c[c.length-2],u=c[c.length-1];return l&&u?`https://${o.toLowerCase()}/${l}/${u}`:void 0}function Hs(e){if(e.pullRequestUrl){let t=Number(q(e.pullRequestUrl));return{url:e.pullRequestUrl,...t>0?{number:t}:{}}}let t=e.prRefs?.find(e=>e.origin===`created`||e.origin===`marker`);if(t)return{number:t.number,...t.url?{url:t.url}:{}};let n=e.markerRefs?.pr;return n===void 0?void 0:{number:n}}function Us(e){return Ws(e)[0]?.url??Gs(e)[0]}function Ws(e,t){if(!e.prRefs?.length)return Gs(e).map(e=>({number:Number(q(e)),url:e,origin:`legacy`})).filter(e=>Number.isInteger(e.number)&&e.number>0);let n={created:0,marker:1,legacy:2,derived:3};return[...e.prRefs].sort((e,t)=>n[e.origin]-n[t.origin]).map(e=>({number:e.number,url:e.url??Qs(`PR`,e.number,t),origin:e.origin}))}function Gs(e){let t=[];return e.pullRequestUrl&&t.push(e.pullRequestUrl),!(e.markerRefs?.issue!==void 0&&e.markerRefs?.pr===void 0)&&e.referencedPullRequestUrl&&t.push(e.referencedPullRequestUrl),t}function Ks(e,t){if(e.referencedIssueUrl)return e.referencedIssueUrl;let n=e.markerRefs?.issue??e.issueNumber;if(!(!n||!t)&&!qs(e.referencedIssueCandidates,n,t))return`${t}/issues/${n}`}function qs(e,t,n){let r=`${n.toLowerCase()}/`;return(e??[]).some(e=>e.endsWith(`/${t}`)&&!e.toLowerCase().startsWith(r))}function Js(e,t){return e.map((e,t)=>({reference:e,index:t})).sort((e,n)=>{let r=e.reference.kind===`PR`&&t(e.reference)===`closed`,i=n.reference.kind===`PR`&&t(n.reference)===`closed`;return Number(r)-Number(i)||e.index-n.index}).map(({reference:e})=>e)}function Ys(e,t){let n=e.prRefs?.length?Ws(e,t).map(e=>({number:e.number,url:e.url})):Gs(e).map(e=>({url:e,number:Number(q(e))||void 0})),r=e.markerRefs?.pr,i=[...r===void 0||n.some(e=>e.number===r)?[]:[{kind:`PR`,number:r}],...n.map(e=>({kind:`PR`,url:e.url,number:e.number})),{kind:`PR`,number:Zs(e,t)},{kind:`Issue`,url:Ks(e,t)},{kind:`Issue`,number:Xs(e,t)}],a=new Set,o=[];for(let e of i){let n=e.url?Number(q(e.url)):e.number;if(!n||!Number.isInteger(n))continue;let r=e.url??Qs(e.kind,n,t),i=o.findIndex(t=>t.kind===e.kind&&t.number===n&&(!t.url||!r||t.url===r));if(i>=0){!o[i].url&&r&&(o[i]={...o[i],url:r});continue}let s=`${e.kind}#${n}#${r??``}`;a.has(s)||(a.add(s),o.push({kind:e.kind,number:n,...r?{url:r}:{}}))}return o}function Xs(e,t){let n=e.issueNumber;return n===void 0||!t?n:qs(e.referencedIssueCandidates,n,t)?void 0:n}function Zs(e,t){let n=e.prNumber;return n===void 0||!t?n:qs(e.referencedPrCandidates,n,t)?void 0:n}function Qs(e,t,n){if(n)return`${n}/${e===`PR`?`pull`:`issues`}/${t}`}function $s(e,t){return Ys(e,t)[0]}function q(e){let t=e.split(`/`).pop()??``;return/^\d+$/.test(t)?t:null}function ec(e,t){let n=Ms.has(e.status)?t:void 0;if(n)return{cpu:{text:`${n.cpuPct.toFixed(0)}%`,kind:`live`},mem:{text:Fs(n.rssBytes),kind:`live`}};let r=Fs(e.peakRssBytes);return{cpu:{text:``,kind:`none`},mem:r?{text:`peak ${r}`,kind:`peak`,title:`peak — run finished${e.peakProcCount?` · ${e.peakProcCount} procs`:``}`}:{text:``,kind:`none`}}}function tc(e,t){let n=e.filter(e=>t===`archived`?e.archived:!e.archived),r=new Map;for(let e of n){if(!e.groupId)continue;let t=r.get(e.groupId);t?t.push(e):r.set(e.groupId,[e])}return[...r.entries()].flatMap(([e,t])=>{let n=t[0];return!n||t.length<2||!t.every(e=>Ns.has(e.status))?[]:[{groupId:e,title:vs(n),count:t.length}]})}function nc(e){return 220+Math.max(0,e)*14}function rc(e){let t=new Map;for(let n of e)for(let e of n.tags??[]){let n=e.toLowerCase();t.has(n)||t.set(n,e)}return[...t.values()].sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`}))}function ic(e,t,n,r=8){let i=n.trim().toLowerCase(),a=new Set(t.map(e=>e.toLowerCase())),o=e.filter(e=>{let t=e.toLowerCase();return a.has(t)?!1:i===``||t.includes(i)&&t!==i});return i===``?o.slice(0,r):o.sort((e,t)=>Number(t.toLowerCase().startsWith(i))-Number(e.toLowerCase().startsWith(i))||e.localeCompare(t,void 0,{sensitivity:`base`})).slice(0,r)}function ac(e){let t=new Map;for(let n of e){let e=n.trim();if(!e)continue;let r=e.toLowerCase();t.has(r)||t.set(r,e)}return[...t.values()].sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`}))}var oc=`/api/v1/ws`,sc=3e3,cc=1e3,lc=7e4,uc=0,dc=1;function fc(e){let t=new Map,n=new Map,r=null,i,a,o,s=()=>{clearTimeout(o),o=setTimeout(()=>{o=void 0,r?.close()},lc)},c=()=>e??`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}${oc}`,l=e=>{r?.readyState===dc&&r.send(JSON.stringify(e))},u=()=>{let e=globalThis.WebSocket;if(typeof e!=`function`||r&&(r.readyState===uc||r.readyState===dc))return;let a=new e(c());r=a,a.addEventListener(`open`,()=>{if(a===r){s();for(let e of t.keys())l({type:`subscribe`,topic:e})}}),a.addEventListener(`message`,e=>{if(a!==r)return;s();let i;try{i=JSON.parse(e.data)}catch{return}if(typeof i!=`object`||!i)return;let{type:o,topic:c,data:l}=i;if(typeof c!=`string`)return;if(o===`error`){for(let e of[...n.get(c)??[]])e();return}if(o!==`event`)return;let u=t.get(c);if(u)for(let e of[...u])e(l)}),a.addEventListener(`close`,()=>{a===r&&(r=null,clearTimeout(o),o=void 0,t.size>0&&i===void 0&&(i=setTimeout(()=>{i=void 0,t.size>0&&u()},sc)))}),a.addEventListener(`error`,()=>void 0)};return{subscribe(e,s,c){let d=()=>c?.();c&&(n.has(e)||n.set(e,new Set),n.get(e).add(d));let f=t.get(e);f||(f=new Set,t.set(e,f));let p=f.size===0;f.add(s),clearTimeout(a),a=void 0,r?p&&l({type:`subscribe`,topic:e}):(clearTimeout(i),i=void 0,u());let m=!0;return()=>{m&&(m=!1,n.get(e)?.delete(d),n.get(e)?.size||n.delete(e),f.delete(s),!(f.size>0)&&(t.delete(e),l({type:`unsubscribe`,topic:e}),t.size===0&&a===void 0&&(a=setTimeout(()=>{a=void 0,!(t.size>0)&&(clearTimeout(i),i=void 0,clearTimeout(o),o=void 0,r?.close(),r=null)},cc))))}}}}var pc=null;function mc(e,t,n){return pc??=fc(),pc.subscribe(e,t,n)}var J={secrets:{allFor:e=>[`secrets`,e],list:()=>[`secrets`,f()]},e2e:{allFor:e=>[`e2e`,e],status:()=>[`e2e`,f()]},tracker:{allFor:e=>[`tracker`,e],all:()=>[`tracker`,f()],associationFor:e=>[`tracker`,e,`association`],association:()=>[`tracker`,f(),`association`],candidates:(e,t=``)=>[`tracker`,f(),`candidates`,e,t],connection:()=>[`tracker`,f(),`connection`],items:(e,t)=>[`tracker`,f(),`items`,e.kind,e.source.id,e.source.webUrl,e.externalId,e.connectionId??null,t.state,[...t.labels],t.query??``],detail:(e,t)=>[`tracker`,f(),`detail`,e.kind,e.source.id,e.source.webUrl,e.externalId,e.connectionId??null,t]},get health(){return[f(),`health`]},runs:{get all(){return[f(),`runs`]},list:()=>[f(),`runs`,`list`],detail:e=>[f(),`runs`,`detail`,e],diff:e=>[f(),`runs`,`diff`,e],changes:e=>[f(),`runs`,`changes`,e],gitStatus:e=>[f(),`runs`,`git-status`,e],file:(e,t)=>[f(),`runs`,`files`,e,t],artifacts:e=>[f(),`runs`,`artifacts`,e],impactSubject:e=>[f(),`runs`,`impact-subject`,e],get impactSubjects(){return[f(),`runs`,`impact-subject`]},get projectAssets(){return[f(),`runs`,`project-assets`]},artifactText:(e,t,n)=>[f(),`runs`,`artifact-text`,e,t,n],handoff:e=>[f(),`runs`,`handoff`,e],drafts:e=>[f(),`runs`,`drafts`,e],commits:e=>[f(),`runs`,`commits`,e],tree:e=>[f(),`runs`,`tree`,e],commit:(e,t)=>[f(),`runs`,`commit`,e,t]},groups:{detail:e=>[f(),`groups`,e]},get todos(){return[f(),`todos`]},get workflows(){return[f(),`workflows`]},get workflowNodes(){return[f(),`workflow-nodes`]},get skills(){return[f(),`skills`]},get skillsReady(){return[f(),`skills`,`ready`]},get importableSkills(){return[f(),`skills`,`importable`]},get importableSkillsReady(){return[f(),`skills`,`importable`,`ready`]},get launchKey(){return[f(),`launch-key`]},get repo(){return[f(),`repo`]},get repoChanges(){return[f(),`repo`,`changes`]},repoCommit:e=>[f(),`repo`,`commit`,e],get repoSync(){return[f(),`repo`,`sync`]},get repoTree(){return[f(),`repo`,`tree`]},repoFile:e=>[f(),`repo`,`file`,e],get uiState(){return[f(),`ui-state`]},get config(){return[f(),`config`]},get agentConfig(){return[f(),`agent-config`]},agentConfigFile:e=>[f(),`agent-config`,`file`,e],get worktrees(){return[f(),`worktrees`]},github:(e={})=>[f(),`github`,e.limit??null],githubPages:(e=50)=>[f(),`github`,`pages`,e],githubChecks:e=>[f(),`github`,`checks`,[...e].sort((e,t)=>e-t).join(`,`)],githubSearch:(e,t)=>[f(),`github`,`search`,e,t],githubRefStatus:(e,t,n)=>[e,`github`,`ref-status`,[...t].sort((e,t)=>e-t).join(`,`),[...n].sort((e,t)=>e-t).join(`,`)],githubComments:(e,t)=>[f(),`github`,`comments`,e,t],githubMergeState:e=>[f(),`github`,`merge-state`,e],get openTargets(){return[f(),`open-targets`]}},hc=6e4;function gc(){return j({queryKey:J.secrets.list(),queryFn:({signal:e})=>Cr({signal:e})})}function _c(){return j({queryKey:Y.secrets,queryFn:({signal:e})=>wr({signal:e})})}function vc(){return j({queryKey:J.e2e.status(),queryFn:({signal:e})=>Ar({signal:e})})}function yc(){return j({queryKey:J.tracker.connection(),queryFn:({signal:e})=>br({signal:e})})}function bc(){return j({queryKey:J.tracker.association(),queryFn:({signal:e})=>Mr({signal:e})})}function xc(e,t,n){return N({queryKey:J.tracker.candidates(e,t),staleTime:hc,queryFn:({pageParam:n,signal:r})=>Nr(e,{q:t.trim()||void 0,cursor:n,limit:50},{signal:r}),initialPageParam:void 0,getNextPageParam:e=>e.available&&e.truncated?e.nextCursor:void 0,enabled:n})}var Sc=class extends Error{failure;constructor(e){super(e.reason),this.failure=e,this.name=`TrackerRefreshError`}};function Cc(e,t,n=!0){let r=t.query.trim(),i=A(),a=e?J.tracker.items(e,{...t,query:r}):[`tracker`,f(),`items`,`unassociated`];return{...N({queryKey:a,staleTime:1/0,queryFn:({pageParam:n,signal:i})=>r?Rr(r,{association:e??void 0,cursor:n,limit:50,state:t.state,labels:t.labels,refresh:!0},{signal:i}):Lr({association:e??void 0,cursor:n,limit:50,state:t.state,labels:t.labels,refresh:!1},{signal:i}),initialPageParam:void 0,getNextPageParam:e=>e.available&&e.truncated?e.nextCursor:void 0,enabled:e!=null&&n}),queryKey:a,restart:async()=>{await i.cancelQueries({queryKey:a,exact:!0});try{await i.fetchInfiniteQuery({queryKey:a,initialPageParam:void 0,pages:1,getNextPageParam:e=>e.available&&e.truncated?e.nextCursor:void 0,staleTime:0,retry:!1,queryFn:async({signal:n})=>{let i={association:e??void 0,limit:50,state:t.state,labels:t.labels,refresh:!0},a=r?await Rr(r,i,{signal:n}):await Lr(i,{signal:n});if(!a.available)throw new Sc(a);return a}})}catch{}}}}function wc(e,t){return j({staleTime:hc,queryKey:e&&t?J.tracker.detail(e,t):[`tracker`,f(),`detail`,`disabled`],queryFn:({signal:n})=>zr(t,{signal:n,association:e??void 0}),enabled:e!=null&&t!=null&&t!==``})}var Y={dashboard:[`workspace`,`dashboard`],models:e=>[`workspace`,`models`,e],providerStatus:[`workspace`,`providers`,`status`],agentSetup:[`workspace`,`providers`,`setup`],projects:[`workspace`,`projects`],githubOwners:[`workspace`,`github-owners`],githubLogin:[`workspace`,`github-login`],repoSuggestions:[`workspace`,`repo-suggestions`],runsIndex:[`workspace`,`runs-index`],secrets:[`workspace`,`secrets`],uiState:[`workspace`,`ui-state`],config:[`workspace`,`config`],hostUsage:[`workspace`,`host-usage`],agentProfiles:[`workspace`,`agent-profiles`],agentFallbackPolicy:e=>[`workspace`,`agent-profiles`,`fallback-policy`,e],agentAccountDetails:e=>[`workspace`,`agent-profiles`,`details`,e],agentAccountStatus:e=>[`workspace`,`agent-profiles`,`status`,e],skillsUpdateAll:[`workspace`,`skills-update`],skillsUpdate:e=>[`workspace`,`skills-update`,e],selfUpdate:[`workspace`,`self-update`],selfUpdateDevelopment:[`workspace`,`self-update`,`development`],starCount:[`workspace`,`star-count`],telemetryConsent:[`workspace`,`telemetry-consent`],fsBrowseRoot:[`workspace`,`fs-browse`],fsBrowse:(e,t=!1)=>[...Y.fsBrowseRoot,e,t]};function X(e,t=!0){return j({queryKey:Y.models(e),queryFn:({signal:t})=>s(e)?Dn(e,{signal:t}):Promise.reject(Error(`${e} has no host model catalog`)),staleTime:300*1e3,enabled:t&&s(e)})}function Tc(e=!0){let t=X(`claude`,e),n=X(`codex`,e),r=X(`opencode`,e),i=X(`cursor`,e),a=X(`pi`,e);return{claude:t,codex:n,junie:X(`junie`,e),opencode:r,cursor:i,pi:a,copilot:X(`copilot`,e),omp:X(`omp`,e),antigravity:X(`antigravity`,e),gemini:X(`gemini`,e),kimi:X(`kimi`,e)}}function Ec(){let e=A();return j({queryKey:Y.providerStatus,queryFn:async({signal:t})=>{let n=e.getQueryData(Y.providerStatus),r=await On(!1,{signal:t});return Yt(n,e.getQueryData(Y.providerStatus),r)},staleTime:5*6e4,refetchInterval:!1,refetchOnWindowFocus:!0})}function Dc(){let e=A();return M({mutationFn:()=>On(!0),onMutate:()=>e.getQueryData(Y.providerStatus),onSuccess:(t,n,r)=>e.setQueryData(Y.providerStatus,e=>Yt(r,e,t))})}function Oc(){return j({queryKey:Y.agentSetup,queryFn:({signal:e})=>Rn({signal:e}),retry:!1,gcTime:0,refetchInterval:e=>{let t=e.state.data;return t?.available&&t.session?.exitCode===null?kc:!1},refetchIntervalInBackground:!0})}var kc=1e3;function Ac(){let e=A();return(0,k.useCallback)(()=>void e.invalidateQueries({queryKey:J.health}),[e])}function jc(){let e=A();return M({mutationFn:({provider:e,action:t})=>zn(e,t),retry:!1,onSuccess:t=>e.setQueryData(Y.agentSetup,e=>e?.available?{...e,session:t}:e),onSettled:()=>e.invalidateQueries({queryKey:Y.agentSetup})})}function Mc(){let e=A();return M({mutationFn:e=>Un(e),retry:!1,onSettled:()=>e.invalidateQueries({queryKey:Y.agentSetup})})}function Nc(){let e=A();return M({mutationFn:({provider:e,authFailureId:t})=>ui(e,t),onMutate:()=>e.getQueryData(Y.providerStatus),onSuccess:(t,n,r)=>{e.setQueryData(Y.providerStatus,e=>Yt(r,e,t,n.authFailureId))}})}function Pc(){return j({queryKey:Y.projects,queryFn:({signal:e})=>An({signal:e})})}function Fc(e,t=!1){return j({queryKey:Y.fsBrowse(e,t),queryFn:({signal:n})=>jn(e??void 0,{signal:n,showHidden:t}),retry:!1})}function Ic(){let e=A();return M({mutationFn:e=>di(e),onSuccess:()=>e.invalidateQueries({queryKey:Y.projects})})}function Lc(){let e=A();return M({mutationFn:e=>hi(e),retry:!1,onSuccess:()=>{e.invalidateQueries({queryKey:Y.projects})}})}function Rc(){let e=A();return M({mutationFn:e=>{let{id:t,...n}=e;return gi(t,n)},retry:!1,onMutate:async({id:t,...n})=>{await e.cancelQueries({queryKey:Y.projects});let r=e.getQueryData(Y.projects);return e.setQueryData(Y.projects,e=>e===void 0?e:{...e,projects:e.projects.map(e=>e.id===t?zc(e,n):e)}),{previous:r}},onError:(t,n,r)=>{r?.previous&&e.setQueryData(Y.projects,r.previous)},onSuccess:({project:t})=>{e.setQueryData(Y.projects,e=>e===void 0?e:{...e,projects:e.projects.map(e=>e.id===t.id?t:e)})},onSettled:()=>e.invalidateQueries({queryKey:Y.projects})})}function zc(e,t){let{maxParallel:n,tags:r,...i}=e,a={...i},o=`maxParallel`in t?t.maxParallel:e.maxParallel;o!=null&&(a.maxParallel=o);let s=`tags`in t&&t.tags!==void 0?t.tags:e.tags,c=s==null?[]:ac(s);return c.length>0&&(a.tags=c),a}function Bc(e){let t=A();return M({mutationFn:e,retry:!1,onSuccess:async()=>{await Promise.all([t.invalidateQueries({queryKey:Y.agentProfiles}),t.invalidateQueries({queryKey:Y.projects})])}})}function Vc(){return Bc(e=>qa(e))}function Hc(){return Bc(e=>{let{id:t,...n}=e;return Qa(t,n)})}function Uc(){return Bc(e=>$a(e))}function Wc(){return Bc(e=>Za(e))}function Gc(e,t){return j({queryKey:Y.agentAccountDetails(e),queryFn:({signal:t})=>Ya(e,{signal:t}),enabled:t,staleTime:0,retry:!1})}function Kc(e,t){return j({queryKey:Y.agentAccountStatus(e),queryFn:({signal:t})=>Ja(e,{signal:t}),enabled:t,staleTime:6e4,retry:!1})}function qc(){let e=A();return M({mutationFn:({provider:e,profileId:t})=>si(e,t),retry:!1,onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:Y.agentProfiles}),e.invalidateQueries({queryKey:Y.providerStatus})])}})}function Jc(){let e=A();return M({mutationFn:e=>Ja(e,{recheck:!0}),retry:!1,onSuccess:(t,n)=>{e.setQueryData(Y.agentAccountStatus(n),t),e.invalidateQueries({queryKey:Y.agentProfiles})}})}function Yc(){return M({mutationFn:e=>{let{routeId:t,...n}=e;return Xa(t,n)},retry:!1})}function Xc(){let e=A();return M({mutationFn:e=>fi(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:Y.projects})})}function Zc(){let e=A();return M({mutationFn:e=>pi(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:Y.projects})})}function Qc(e=!0){return j({queryKey:Y.repoSuggestions,queryFn:({signal:e})=>Mn({signal:e}),enabled:e,staleTime:6e4,retry:!1})}function $c(){let e=A();return M({mutationFn:e=>Nn(e),retry:!1,onSuccess:()=>Promise.all([e.invalidateQueries({queryKey:Y.projects}),e.invalidateQueries({queryKey:J.repo}),e.invalidateQueries({queryKey:J.health})])})}function el(){let e=A();return M({mutationFn:({projectId:e,owner:t,name:n})=>Pn(e,{owner:t,name:n}),retry:!1,onSuccess:()=>Promise.all([e.invalidateQueries({queryKey:Y.projects}),e.invalidateQueries({queryKey:J.repo}),e.invalidateQueries({queryKey:J.health})])})}function tl(e){let t=A(),n=(0,k.useRef)(e);n.current=e;let r=(0,k.useRef)(!1),i=M({mutationFn:Fn,retry:!1,onMutate:()=>{r.current=!0,t.setQueryData(Y.githubLogin,{status:`starting`})},onSuccess:e=>t.setQueryData(Y.githubLogin,e)}),a=M({mutationFn:Ln,retry:!1,onMutate:()=>{r.current=!1},onSuccess:e=>t.setQueryData(Y.githubLogin,e)}),o=j({queryKey:Y.githubLogin,queryFn:({signal:e})=>In({signal:e}),enabled:i.isSuccess,refetchInterval:e=>{let t=e.state.data?.status;return t===`pending`||t===`starting`?2e3:!1},staleTime:0,retry:!1}),s=r.current||i.isPending||i.isSuccess?o.data:void 0,c=s?.status,l=s?.status===`done`?s.login:void 0;return(0,k.useEffect)(()=>{c!==`done`||!r.current||(r.current=!1,Promise.all([t.invalidateQueries({queryKey:Y.githubOwners}),t.invalidateQueries({queryKey:Y.projects}),t.invalidateQueries({queryKey:[f(),`github`]}),t.invalidateQueries({queryKey:J.repo}),t.invalidateQueries({queryKey:J.health})]),n.current?.(l))},[c,l,t]),{state:s,start:i,cancel:a}}function nl(){return j({queryKey:Y.githubOwners,queryFn:({signal:e})=>mi({signal:e}),staleTime:5*6e4,retry:!1})}function rl(){let e=A();(0,k.useEffect)(()=>{let t,n=()=>{let n=e.getQueryData(J.health)?.capabilities?.localHandoff===!0;n&&t===void 0?t=mc(`health`,t=>{e.setQueryData(J.health,t)}):!n&&t!==void 0&&(t(),t=void 0)};n();let r=e.getQueryCache().subscribe(n);return()=>{r(),t?.()}},[e])}function il(){return j({queryKey:J.health,queryFn:({signal:e})=>Sn({signal:e}),refetchInterval:e=>ol(e.state.data)})}var al=3e4;function ol(e){return e?.capabilities?.localHandoff===!1&&e.forge!=null&&e.forge.available!==!0&&al}function sl(){let e=il().data,t=Pc().data?.projects,{projectId:n}=Bt(),r=n??e?.bootProject,i=r===void 0?void 0:t?.find(e=>e.id===r);return i?.repoUrl?i.repoUrl:n===null||n===e?.bootProject?Vs(e?.repo?.remote,e?.forge?.kind===`github`):void 0}function cl(){return j({queryKey:J.openTargets,queryFn:({signal:e})=>Wi({signal:e}),staleTime:5*6e4})}function ll(e){return j({queryKey:J.runs.list(),queryFn:({signal:e})=>Wn({signal:e}),select:e})}function ul(e=!0,t){return j({queryKey:Y.runsIndex,queryFn:({signal:e})=>Kn({signal:e}),enabled:e,staleTime:3e4,...t===void 0?{}:{refetchInterval:typeof t==`function`?e=>t(e.state.data):t}})}function dl(e,t=!0,n=!1,r){return j({queryKey:[n?`default`:e,`runs`,`list`],queryFn:({signal:t})=>Gn(e,{signal:t}),enabled:t,select:r})}function fl(e,t,n){let r=e==="default"?null:e,i=r===null||t!=null&&r===t;return dl(i?`default`:r??`default`,!0,i,n)}function pl(e){return{queryKey:J.runs.detail(e),queryFn:({signal:t})=>qn(e,{signal:t})}}function ml(e){return j({...pl(e??``),enabled:!!e})}function hl(e,t,n=!0){return j({queryKey:[e??`default`,`runs`,`detail`,t??``],queryFn:({signal:n})=>Jn(e,t,{signal:n}),enabled:n&&!!e&&!!t})}function gl(e){return j({queryKey:J.runs.diff(e??``),queryFn:({signal:t})=>qr(e,{signal:t}),enabled:!!e})}function _l(e,t=!1){return j({queryKey:J.runs.changes(e??``),queryFn:({signal:t})=>Yr(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?4e3:!1,refetchOnWindowFocus:!0,staleTime:0})}function vl(e,t,n=!1){return j({queryKey:J.runs.gitStatus(e),queryFn:({signal:t})=>Yi(e,{signal:t}),enabled:t,retry:!1,refetchInterval:n?1e4:!1,refetchOnWindowFocus:!0,staleTime:0})}function yl(e,t=!0){return j({queryKey:J.runs.tree(e??``),queryFn:({signal:t})=>hr(e,{signal:t}),enabled:t&&!!e,retry:!1,staleTime:0})}function bl(e,t){return j({queryKey:J.runs.file(e??``,t??``),queryFn:({signal:n})=>Xr(e,t,{signal:n}),enabled:!!e&&t!==void 0,retry:!1})}function xl(e){return j({queryKey:J.runs.artifacts(e??``),queryFn:({signal:t})=>Qr(e,{signal:t}),enabled:!!e,retry:!1})}function Sl(e,t,n){return j({queryKey:J.runs.artifactText(e,t??``,n??``),queryFn:({signal:n})=>ei(e,t,{signal:n}),enabled:t!==void 0&&n!==void 0,retry:!1,staleTime:1/0})}function Cl(e){return j({queryKey:J.runs.impactSubject(e?ni(e):``),queryFn:({signal:t})=>ii(e,{signal:t}),enabled:e!==null,retry:!1})}function wl(){return j({queryKey:J.runs.projectAssets,queryFn:({signal:e})=>ai({signal:e}),retry:!1})}function Tl(){let e=A();return M({mutationFn:e=>ri(e),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:J.runs.impactSubject(ni(n.subject))}),e.invalidateQueries({queryKey:J.runs.list()})}})}function El(e){return j({queryKey:J.groups.detail(e??``),queryFn:({signal:t})=>oi(e,{signal:t}),enabled:!!e})}function Dl(e,t=!1){return j({queryKey:J.runs.commits(e??``),queryFn:({signal:t})=>gr(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?5e3:!1})}function Ol(e,t){return j({queryKey:J.runs.commit(e??``,t??``),queryFn:({signal:n})=>_r(e,t,{signal:n}),enabled:!!e&&!!t,retry:!1})}function kl(e,t=!0){return j({queryKey:J.runs.handoff(e??``),queryFn:({signal:t})=>Jr(e,{signal:t}),enabled:!!e&&t})}function Al(e){return j({queryKey:J.runs.drafts(e??``),queryFn:({signal:t})=>ia(e,{signal:t}),enabled:!!e,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1})}function jl(e=!0){return j({queryKey:J.todos,queryFn:({signal:e})=>ir({signal:e}),enabled:e})}function Ml(){return j({queryKey:J.workflowNodes,queryFn:({signal:e})=>Ma({signal:e}),staleTime:1/0})}function Nl(e={}){return j({queryKey:J.workflows,enabled:e.enabled??!0,queryFn:({signal:e})=>Qn({signal:e})})}function Pl(e=!0){let t=A(),n=J.skills,r=n[0],i=j({queryKey:n,queryFn:({signal:e})=>$n({signal:e}),enabled:e}),a=j({queryKey:J.skillsReady,queryFn:({signal:e})=>er({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,k.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`],a.data)},[t,a.data,r]),i}function Fl(e=!0){let t=A(),n=J.importableSkills,r=n[0],i=j({queryKey:n,queryFn:({signal:e})=>nr({signal:e}),enabled:e}),a=j({queryKey:J.importableSkillsReady,queryFn:({signal:e})=>rr({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,k.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`,`importable`],a.data)},[t,a.data,r]),i}function Il(){return j({queryKey:J.launchKey,queryFn:({signal:e})=>kn({signal:e}),staleTime:1/0})}function Ll(){return j({queryKey:J.repo,queryFn:({signal:e})=>ar({signal:e})})}function Rl(){return j({queryKey:J.repoSync,queryFn:({signal:e})=>pa({signal:e}),refetchOnWindowFocus:!0})}function zl(){let e=A();return M({mutationFn:e=>ma(e),onSuccess:t=>{e.setQueryData(J.repoSync,t.sync),e.invalidateQueries({queryKey:J.repo,predicate:e=>e.queryKey[2]!==`sync`})}})}function Bl(){return j({queryKey:J.repoChanges,queryFn:({signal:e})=>ur({signal:e}),retry:!1})}function Vl(){return j({queryKey:J.repoTree,queryFn:({signal:e})=>dr({signal:e}),retry:!1,refetchOnWindowFocus:!0,staleTime:0})}function Hl(e){return j({queryKey:J.repoFile(e??``),queryFn:({signal:t})=>fr(e,{signal:t}),enabled:e!==void 0&&e!==``,retry:!1,refetchOnWindowFocus:!0,staleTime:0})}function Ul(e){return j({queryKey:J.repoCommit(e??``),queryFn:({signal:t})=>mr(e,{signal:t}),enabled:!!e,retry:!1})}function Wl(){return j({queryKey:J.config,queryFn:({signal:e})=>or({signal:e})})}function Gl(){return j({queryKey:J.worktrees,queryFn:({signal:e})=>po({signal:e})})}function Kl(){return j({queryKey:J.uiState,queryFn:({signal:e})=>Zn({signal:e})})}function ql(){return j({queryKey:J.agentConfig,queryFn:({signal:e})=>sr({signal:e})})}function Jl(e){return j({queryKey:J.agentConfigFile(e??``),queryFn:({signal:t})=>cr(e,{signal:t}),enabled:e!==null})}function Yl(e){let t=A(),n=J.agentConfig,r=J.agentConfigFile(e);return M({mutationFn:t=>lr(e,t),onSuccess:e=>{t.setQueryData(r,e),t.invalidateQueries({queryKey:n})}})}function Xl(){return j({queryKey:Y.uiState,queryFn:({signal:e})=>Ra({signal:e})})}function Zl(){return j({queryKey:Y.config,queryFn:({signal:e})=>Ba({signal:e})})}function Ql(){return j({queryKey:Y.agentProfiles,queryFn:({signal:e})=>Wa({signal:e})})}function $l(e){return j({queryKey:Y.agentFallbackPolicy(e??`default`),queryFn:({signal:t})=>Ga({projectId:e??`default`},{signal:t}),enabled:e!==null,retry:!1})}function eu(e){let t=A();return M({mutationFn:t=>Ka({projectId:e??`default`,...t}),retry:!1,onSuccess:n=>t.setQueryData(Y.agentFallbackPolicy(e??`default`),n)})}var tu=15*6e4;function nu(e=!0){let t=A();return(0,k.useEffect)(()=>{if(e)return t.getQueryCache().subscribe(e=>{e.type!==`updated`||e.action.type!==`success`||e.action.manual||e.query.queryHash!==iu&&t.prefetchQuery(ru)})},[e,t]),j({...ru,enabled:e,refetchOnMount:!1})}var ru={queryKey:Y.starCount,queryFn:({signal:e})=>Cn({signal:e}),staleTime:tu,retry:!1},iu=T(Y.starCount);function au(){return j({queryKey:Y.telemetryConsent,queryFn:({signal:e})=>Tn({signal:e}),staleTime:1/0,retry:!1})}var ou=6;function su(e,t=!0){return j({queryKey:Y.skillsUpdate(e),queryFn:({signal:t})=>eo(e,{signal:t}),enabled:t,refetchInterval:e=>{let t=e.state.data?.status;return(t===void 0||t===`checking`||t===`updating`||t===`idle`&&e.state.dataUpdateCount<ou)&&6e4}})}function cu(e=!0){return j({queryKey:Y.selfUpdate,queryFn:({signal:e})=>ro({signal:e}),enabled:e,refetchInterval:e=>e.state.data?.job?.status===`running`?1e3:e.state.data?.scheduled?5e3:!1})}function lu(e=!0){return j({queryKey:Y.selfUpdateDevelopment,queryFn:({signal:e})=>ao({signal:e}),enabled:e,staleTime:3e4})}function uu(){let e=A();return M({mutationFn:()=>ao({refresh:!0}),onSuccess:t=>e.setQueryData(Y.selfUpdateDevelopment,t)})}function du(){let e=A();return M({mutationFn:()=>io(),onSuccess:t=>e.setQueryData(Y.selfUpdate,t)})}function fu(){let e=A();return M({mutationFn:e=>oo(e),onSuccess:t=>e.setQueryData(Y.selfUpdate,t)})}function pu(){let e=A();return M({mutationFn:e=>so(e),onSuccess:t=>e.setQueryData(Y.selfUpdate,t)})}function mu(){let e=A();return M({mutationFn:e=>co(e),onSuccess:t=>e.setQueryData(Y.selfUpdate,t)})}function hu(){let e=A();return M({mutationFn:()=>lo(),onSuccess:t=>e.setQueryData(Y.selfUpdate,t)})}function gu(e){let t=A();return M({mutationFn:t=>Ri(e,t),onSuccess:e=>{_u(t,e),t.invalidateQueries({queryKey:J.runs.all})}})}function _u(e,t){e.setQueryData(J.runs.list(),e=>e?.map(e=>e.id===t.id?Yo(e,t):e)),e.setQueryData(J.runs.detail(t.id),e=>e?Yo(e,t):t),vu(e)}function vu(e){e.invalidateQueries({queryKey:Y.runsIndex})}function yu(){let e=A();return M({mutationFn:e=>Oi(e),onMutate:async t=>{await e.cancelQueries({queryKey:J.runs.list()}),await e.cancelQueries({queryKey:J.runs.detail(t)});let n=e.getQueryData(J.runs.list()),r=e.getQueryData(J.runs.detail(t)),i=new Date().toISOString();return e.setQueryData(J.runs.list(),e=>e?.map(e=>e.id===t?{...e,seenAt:i}:e)),e.setQueryData(J.runs.detail(t),e=>e&&{...e,seenAt:i}),{prevList:n,prevDetail:r,id:t}},onError:(t,n,r)=>{r?.prevList&&e.setQueryData(J.runs.list(),r.prevList),r?.prevDetail&&e.setQueryData(J.runs.detail(n),r.prevDetail)},onSuccess:t=>{let n=e=>e.id===t.id?{...e,seenAt:t.seenAt}:e;e.setQueryData(J.runs.list(),e=>e?.map(n)),e.setQueryData(J.runs.detail(t.id),e=>e?n(e):t),vu(e)}})}function bu(){let e=A();return M({mutationFn:e=>ki(e),onMutate:async t=>{await e.cancelQueries({queryKey:J.runs.list()}),await e.cancelQueries({queryKey:J.runs.detail(t)});let n=e.getQueryData(J.runs.list()),r=e.getQueryData(J.runs.detail(t));return e.setQueryData(J.runs.list(),e=>e?.map(e=>e.id===t?xu(e):e)),e.setQueryData(J.runs.detail(t),e=>e&&xu(e)),{prevList:n,prevDetail:r,id:t}},onError:(t,n,r)=>{r?.prevList&&e.setQueryData(J.runs.list(),r.prevList),r?.prevDetail&&e.setQueryData(J.runs.detail(n),r.prevDetail)},onSuccess:t=>{let n=e=>e.id===t.id?xu(e):e;e.setQueryData(J.runs.list(),e=>e?.map(n)),e.setQueryData(J.runs.detail(t.id),e=>e?n(e):t),vu(e)}})}function xu(e){let{seenAt:t,...n}=e;return n}function Su(e,t,n){let r=A();return M({mutationFn:({id:n,pinned:r,surface:i})=>t===void 0?Si(n,r,i??e):Ci(t,n,r,i??e),onSuccess:()=>r.invalidateQueries({queryKey:n===void 0?J.runs.all:[n,`runs`]})})}function Cu(e,t,n){let r=A();return M({mutationFn:({id:n,archived:r})=>t===void 0?xi(n,r,e):wi(t,n,r,e),onSuccess:()=>r.invalidateQueries({queryKey:n===void 0?J.runs.all:[n,`runs`]})})}function wu(e,t){let n=A();return M({mutationFn:n=>t===void 0?ea(e,n):ta(t,e,n),onSuccess:()=>n.invalidateQueries({queryKey:J.runs.all}),onError:e=>{e instanceof L&&e.status===409&&n.invalidateQueries({queryKey:J.runs.all})}})}function Tu(e,t){let n=A();return M({mutationFn:(n={})=>t===void 0?Ni(e,n):Pi(t,e,n),onSuccess:()=>n.invalidateQueries({queryKey:J.runs.all})})}function Eu(e){let t=A();return M({mutationFn:({msgId:t,message:n})=>na(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:J.runs.all})})}function Du(e){let t=A();return M({mutationFn:t=>ra(e,t),onSuccess:()=>t.invalidateQueries({queryKey:J.runs.all})})}function Ou(e={},t=!0){return j({queryKey:J.github(e),queryFn:({signal:t})=>vr({limit:e.limit},{signal:t}),enabled:t})}function ku(e=50,t=!0){return N({queryKey:J.githubPages(e),queryFn:({pageParam:t,signal:n})=>vr({limit:e,...t},{signal:n}),initialPageParam:{issuesCursor:void 0,prsCursor:void 0,issuesDone:!1,prsDone:!1},getNextPageParam:e=>{let t=e.issuesNextCursor??void 0,n=e.prsNextCursor??void 0;return t||n?{issuesCursor:t,prsCursor:n,issuesDone:!t,prsDone:!n}:void 0},enabled:t,staleTime:6e4})}function Au(e,t=!0){return j({queryKey:J.githubChecks(e),queryFn:({signal:t})=>Br(e,{signal:t}),enabled:t&&e.length>0,staleTime:6e4})}function ju(e,t,n=!0){return j({queryKey:J.githubSearch(e,t),queryFn:({signal:n})=>Vr(e,t,{},{signal:n}),enabled:n&&t.trim()!==``,staleTime:6e4})}var Mu=100;function Nu(e){return[...e].sort((e,t)=>t-e).slice(0,Mu).sort((e,t)=>e-t)}var Z=new Map(zu()),Pu=1e3;function Fu(e,t){if(Z.get(e)!==t){for(Z.delete(e),Z.set(e,t);Z.size>Pu;){let e=Z.keys().next().value;if(e===void 0)break;Z.delete(e)}Hu()}}var Q=new Set(Bu());function Iu(e,t){if(Q.has(e)!==t){if(t)for(Q.add(e);Q.size>Pu;){let e=Q.values().next().value;if(e===void 0)break;Q.delete(e)}else Q.delete(e);Hu()}}var Lu=`cez.reference-statuses.v1`,Ru=`cez.reference-conflicts.v1`;function zu(){try{let e=globalThis.sessionStorage?.getItem(Lu);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>Array.isArray(e)&&e.length===2&&typeof e[0]==`string`&&es(e[1])):[]}catch{return[]}}function Bu(){try{let e=globalThis.sessionStorage?.getItem(Ru);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}var Vu;function Hu(){Vu===void 0&&(Vu=setTimeout(()=>{Vu=void 0;try{globalThis.sessionStorage?.setItem(Lu,JSON.stringify([...Z])),globalThis.sessionStorage?.setItem(Ru,JSON.stringify([...Q]))}catch{}},250))}function Uu(){let e=Bt(),t=il();return e.projectId??t.data?.bootProject}function Wu(e){for(let[t,n]of Object.entries(e)){for(let[e,r]of Object.entries(n.prs))Fu($({projectId:t,kind:`PR`,number:Number(e)}),r);for(let[e,r]of Object.entries(n.issues))Fu($({projectId:t,kind:`Issue`,number:Number(e)}),r)}}var Gu=5*6e4;function Ku(e){return e?e.recheckAfterMs:Gu}var $=e=>`${e.projectId}\u0000${e.kind}#${e.number}`;function qu(e,t=!0){let n=(0,k.useMemo)(()=>{let t=new Map;for(let n of e){let e=t.get(n.projectId)??{prs:new Set,issues:new Set};e[n.kind===`PR`?`prs`:`issues`].add(n.number),t.set(n.projectId,e)}return[...t.entries()].map(([e,t])=>({projectId:e,prs:Nu(t.prs),issues:Nu(t.issues)}))},[e.map($).sort().join(`|`)]),r=It({queries:n.map(e=>({queryKey:J.githubRefStatus(e.projectId,e.prs,e.issues),queryFn:({signal:t})=>Hr(e.projectId,{prs:e.prs,issues:e.issues},{signal:t}),enabled:t&&e.prs.length+e.issues.length>0,staleTime:e=>Ku(e.state.data)??1/0,refetchInterval:e=>Ku(e.state.data)??!1,refetchOnWindowFocus:!0}))}),{byRef:i,learned:a}=(0,k.useMemo)(()=>{let e=new Map,t=[];return r.forEach((r,i)=>{let a=n[i];if(!a)return;let o=[...a.prs.map(e=>({projectId:a.projectId,kind:`PR`,number:e})),...a.issues.map(e=>({projectId:a.projectId,kind:`Issue`,number:e}))],s=r.data;for(let n of o){let i=$(n),a=Z.get(i),o=Q.has(i)?!0:void 0;if(s?.available){let r=s.prs[n.number]??s.issues[n.number];if(r){let a=s.conflicts?s.conflicts.includes(n.number):void 0;t.push({key:i,status:r,conflicting:a}),e.set(i,{state:`ready`,status:r,...a??o?{conflicting:!0}:{}})}else e.set(i,{state:`unknown`,...a?{status:a}:{}})}else s?e.set(i,{state:`unavailable`,reason:s.reason,...a?{status:a}:{},...o?{conflicting:!0}:{}}):r.isError?e.set(i,{state:`unavailable`,reason:r.error instanceof Error?r.error.message:void 0,...a?{status:a}:{},...o?{conflicting:!0}:{}}):e.set(i,{state:`loading`,...a?{status:a}:{},...o?{conflicting:!0}:{}})}}),{byRef:e,learned:t}},[n,r.map(e=>`${e.dataUpdatedAt}:${e.status}`).join(`,`)]);return(0,k.useEffect)(()=>{for(let{key:e,status:t,conflicting:n}of a)Fu(e,t),n!==void 0&&Iu(e,n)},[a]),(0,k.useCallback)(e=>{let t=$(e),n=i.get(t);if(n)return n;let r=Z.get(t);return{state:`idle`,...r?{status:r}:{},...Q.has(t)?{conflicting:!0}:{}}},[i])}function Ju(e,t,n=!0){return j({queryKey:J.githubComments(e,t),queryFn:({signal:n})=>Ur(e,t,{},{signal:n}),enabled:n,staleTime:6e4})}function Yu(e){return j({queryKey:[`github`,`pr-changes`,e??0],queryFn:({signal:t})=>Kr(e,{},{signal:t}),enabled:e!==void 0,staleTime:6e4,retry:!1})}export{Pc as $,Kt as $a,oa as $i,cs as $n,or as $r,bc as $t,tl as A,li as Aa,xo as Ai,Us as An,si as Ar,bl as At,Ac as B,ci as Ba,Ui as Bi,Cs as Bn,zi as Br,mu as Bt,vc as C,Er as Ca,Fo as Ci,Fs as Cn,C as Co,xa as Cr,Sl as Ct,Au as D,Or as Da,Ua as Di,Ls as Dn,to as Dr,Dl as Dt,Ou as E,Pa as Ea,Lr as Ei,Js as En,b as Eo,Sa as Er,Ol as Et,il as F,bi as Fa,Gr as Fi,xs as Fn,_i as Fr,X as Ft,cl as G,Ao as Ga,ha as Gi,Ds as Gn,Da as Gr,fu as Gt,yu as H,Na as Ha,Fa as Hi,bs as Hn,la as Hr,cu as Ht,rl as I,Vi as Ia,wn as Ii,As as In,Ii as Ir,ll as It,wl as J,sn as Ja,zo as Ji,ws as Jn,Ja as Jr,nu as Jt,gu as K,pn as Ka,sa as Ki,Os as Kn,Mi as Kr,Pl as Kt,Cl as L,Mo as La,Gi as Li,Ss as Ln,Oo as Lr,fl as Lt,Yu as M,ca as Ma,ka as Mi,Ys as Mn,_a as Mr,kl as Mt,ju as N,jr as Na,ji as Ni,ec as Nn,Bo as Nr,yl as Nt,Ju as O,ya as Oa,Ra as Oi,nc as On,Fr as Or,gl as Ot,El as P,wo as Pa,Ai as Pi,Rs as Pn,fa as Pr,Tc as Pt,gc as Q,Jt as Qa,fo as Qi,as as Qn,ga as Qr,jl as Qt,Fl as R,U as Ra,qi as Ri,ks as Rn,ja as Rr,ul as Rt,Zc as S,Zr as Sa,eo as Si,Is as Sn,Oe as So,Ei as Sr,ml as St,Fc as T,xr as Ta,zr as Ti,q as Tn,ve as To,B as Tr,_l as Tt,bu as U,yo as Ua,Ri as Ui,_s as Un,Ia as Ur,lu as Ut,Il as V,Va,go as Vi,js as Vn,da as Vr,Wc as Vt,Yc as W,Vn as Wa,Hi as Wi,hs as Wn,Ha as Wr,wu as Wt,hl as X,rn as Xa,yi as Xi,Es as Xn,Aa as Xr,Tl as Xt,sl as Y,an as Ya,Eo as Yi,gs as Yn,Ca as Yr,jc as Yt,dl as Z,P as Za,Xi as Zi,ns as Zn,ba as Zr,au as Zt,Xc as _,Hn as _a,Lo as _i,ic as _n,De as _o,no as _r,Qc as _t,pl as a,Bn as aa,Wr as ai,Hc as an,Bt as ao,ts as ar,qu as at,Tu as b,ti as ba,No as bi,zs as bn,Te as bo,xi as br,Vl as bt,ql as c,mo as ca,So as ci,Nl as cn,j as co,qo as cr,uu as ct,Ql as d,Dr as da,ua as di,Xl as dn,ht as do,Yo as dr,Lc as dt,Ro as ea,Vo as ei,xc as en,I as eo,K as er,Ec as et,Oc as f,ho as fa,ia as fi,Gl as fn,rt as fo,Uo as fr,Du as ft,hu as g,pr as ga,Xn as gi,rc as gn,T as go,Li as gr,Hl as gt,Mc as h,kr as ha,Yn as hi,mc as hn,Se as ho,To as hr,Ul as ht,Wu as i,za as ia,Kr as ii,Kl as in,Vt as io,$o as ir,Uu as it,nl as j,Io as ja,ni as ji,$s as jn,Ni as jr,vl as jt,ku as k,Ti as ka,bo as ki,Ks as kn,Ji as kr,Al as kt,Jl as l,tr as la,Co as li,Zl as ln,Ct as lo,Zo as lr,Ic as lt,Cu as m,Sr as ma,Yi as mi,_u as mn,O as mo,Zi as mr,Bl as mt,Sc as n,La as na,Ho as ni,wc as nn,en as no,ss as nr,Yl as nt,Gc as o,ko as oa,Sn as oi,Rc as on,N as oo,Xo as or,Dc as ot,pu as p,Bi as pa,Xr as pi,Y as pn,Ke as po,L as pr,Ll as pt,Su as q,on as qa,Oa as qi,Ts as qn,Ya as qr,su as qt,J as r,uo as ra,Ur as ri,Cc as rn,$t as ro,ls as rr,Jc as rt,Kc as s,_o as sa,kn as si,Ml as sn,M as so,Jo as sr,du as st,hc as t,En as ta,vr as ti,yc as tn,Qt as to,os as tr,el as tt,$l as u,vo as ua,Jn as ui,_c as un,A as uo,Ko as ur,Uc as ut,Wl as v,jo as va,Do as vi,Ns as vn,Ie as vo,Di as vr,Rl as vt,Eu as w,Pr as wa,yr as wi,Hs as wn,ze as wo,vi as wr,xl as wt,Vc as x,Ta as xa,ro as xi,Bs as xn,S as xo,Un as xr,Nc as xt,qc as y,wa as ya,Po as yi,tc as yn,Ee as yo,wi as yr,zl as yt,$c as z,va as za,Ki as zi,vs as zn,Ea as zr,eu as zt};
@@ -0,0 +1 @@
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{Pt as t}from"./utils-Br_dqwn-.js";import{i as n}from"./new-task-form-BgMiEphZ.js";import{t as r}from"./picker-pill-BO6YUs1F.js";var i=e();function a({runner:e,model:a,value:o,options:s,onPick:c,disabled:l=!1,modelsLocked:u=!1}){if(!t(e)||a===``||s.length===0)return null;let d=n(e),f=u?``:o,p=s.find(e=>e.id===f);return(0,i.jsx)(r,{slot:`effort-pill`,ariaLabel:`Effort`,label:f===``?`Effort: ${d} default`:`Effort: ${p?.id??f}`,value:f,disabled:l,readOnly:u,disabledHint:u?`Reasoning effort is locked to native ${d} settings.`:`How much reasoning the selected ${d} model uses for this task.`,onPick:c,options:[{value:``,label:`${d} default`,desc:`Use the selected model’s native reasoning setting`},...s.map(e=>({value:e.id,label:e.id,desc:e.description}))]})}export{a 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{ar as r,at as i,ir as a}from"./queries-ba5qZ3kd.js";import{n as o,t as s}from"./utils-Br_dqwn-.js";import{N as c}from"./button-BqkA8Ovk.js";import{t as l}from"./circle-check-LWKCYKhA.js";import{n as u,t as d}from"./git-pull-request-CURFMFaU.js";import{t as f}from"./git-pull-request-draft-BZgJrUou.js";import{t as p}from"./triangle-alert-C1mTIqxM.js";import{i as m,n as h,r as g}from"./use-now-DD2atNhs.js";import{t as _}from"./status-dot-Dxb9pPsK.js";var v=c(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),y=c(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),b=c(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),x=c(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),S=c(`git-pull-request-closed`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 9v12`,key:`1sc30k`}],[`path`,{d:`m21 3-6 6`,key:`16nqsk`}],[`path`,{d:`m21 9-6-6`,key:`9j17rh`}],[`path`,{d:`M18 11.5V15`,key:`65xf6f`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}]]),C=c(`message-square-warning`,[[`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`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),w=e(t(),1),T=n(),E=(0,w.createContext)(null);function D({children:e}){let[t,n]=(0,w.useState)(()=>new Map),r=(0,w.useCallback)((e,t)=>{n(n=>{let r=new Map(n);return r.set(e,t),r})},[]),a=(0,w.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),o=i((0,w.useMemo)(()=>[...t.values()].flat(),[t])),s=(0,w.useMemo)(()=>({publish:r,retract:a,lookup:o}),[r,a,o]);return(0,T.jsx)(E.Provider,{value:s,children:e})}var O=(0,w.createContext)(null);function k({projectId:e,requests:t,children:n}){let r=(0,w.useContext)(E),a=(0,w.useId)(),o=t.map(e=>`${e.projectId} ${e.kind}#${e.number}`).sort().join(`|`),s=r?.publish,c=r?.retract;(0,w.useEffect)(()=>{if(!(!s||!c))return s(a,t),()=>c(a)},[s,c,a,o]);let l=i(r?A:t),u=r?.lookup??l,d=(0,w.useMemo)(()=>({lookup:u,projectId:e}),[u,e]);return(0,T.jsx)(O.Provider,{value:d,children:n})}var A=[];function j(e,t,n){let r=(0,w.useContext)(O),i=n??r?.projectId;return!r||!i||t===void 0?N:r.lookup({projectId:i,kind:e,number:t})}function M(){let e=(0,w.useContext)(O);return{lookup:e?.lookup??(()=>N),projectId:e?.projectId}}var N=Object.freeze({state:`idle`}),P={success:`border-success/40 text-success`,danger:`border-danger/40 text-danger`,violet:`border-violet/35 text-violet`,info:`border-info/40 text-info`,neutral:`border-border text-muted-foreground`,pending:`border-pending-strong/45 text-pending-strong`,conflict:`border-conflict/45 text-conflict`},F={success:`hover:bg-success/10`,danger:`hover:bg-danger/10`,violet:`hover:bg-violet/10`,info:`hover:bg-info/10`,neutral:`hover:bg-muted`,pending:`hover:bg-pending-strong/10`,conflict:`hover:bg-conflict/10`},I={draft:f,"review-required":d,"changes-requested":C,"checks-pending":null,"checks-failing":x,ready:l,merged:u,closed:S,open:y,completed:l,"not-planned":b};function L({reference:e,taskTitle:t,status:n,conflicting:i,conflictAction:c,projectId:l,className:u,compact:d=!1}){let{kind:f,number:m,url:h}=e,g=j(f,m,l),_=n??g.status,y=r(_),b=f===`PR`&&(i??g.conflicting)===!0,x=b?a:y,S=s(`inline-flex h-[22px] items-center gap-1 rounded-full border px-2 font-mono text-meta font-semibold`,P[x?.tone??`violet`],u),C=U(g,x,b?y:void 0),w=m?`${!d&&f===`Issue`?`Issue `:``}#${m}`:f,E=f===`PR`?`pull request`:`issue`,D=`Open the ${E} for ${t}${x?` — ${x.label}`:``}`,O=(0,T.jsxs)(T.Fragment,{children:[b?(0,T.jsx)(p,{className:`size-2.5 shrink-0`,"aria-hidden":`true`}):(0,T.jsx)(G,{status:x?_:void 0}),w]}),k=!h||!o(h)?(0,T.jsx)(`span`,{"data-slot":f===`PR`?`pr-chip`:`issue-chip`,"data-status":_,...b?{"data-conflicting":`true`}:{},"aria-label":x?`${E} ${w} — ${x.label}`:void 0,className:S,children:O}):(0,T.jsxs)(`a`,{"data-slot":f===`PR`?`pr-chip`:`issue-chip`,"data-status":_,...b?{"data-conflicting":`true`}:{},href:h,target:`_blank`,rel:`noopener noreferrer`,title:C?void 0:h,"aria-label":D,className:s(S,F[x?.tone??`violet`]),children:[O,(0,T.jsx)(v,{className:`size-2.5`,"aria-hidden":`true`})]});if(!C)return k;let A=(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`span`,{className:`block font-medium`,children:[f===`PR`?`Pull request`:`Issue`,m?` #${m}`:``,` · `,C.headline]}),(0,T.jsx)(`span`,{className:`block`,children:C.detail}),C.also?(0,T.jsx)(`span`,{className:`block opacity-70`,children:C.also}):null,h&&o(h)?(0,T.jsx)(`span`,{className:`block opacity-70`,children:h.replace(/^https?:\/\//,``)}):null]});return(0,T.jsx)(H,{chip:k,action:b?c:void 0,state:g.state,children:A})}var R=(0,w.createContext)(()=>{});function z(){return(0,w.useContext)(R)}var B=150,V=120;function H({chip:e,action:t,state:n,children:r}){let[i,a]=(0,w.useState)(!1),o=(0,w.useRef)(null),s=(0,w.useRef)(null),c=(0,w.useRef)(void 0),l=(0,w.useCallback)((e,t)=>{clearTimeout(c.current),c.current=setTimeout(()=>a(e),t)},[]),u=(0,w.useCallback)(()=>{clearTimeout(c.current),a(!1)},[]);(0,w.useEffect)(()=>()=>clearTimeout(c.current),[]);let d=e=>e instanceof Node&&(s.current?.contains(e)||o.current?.contains(e));return(0,T.jsxs)(h,{open:i,onOpenChange:e=>e?a(!0):u(),children:[(0,T.jsx)(g,{asChild:!0,ref:o,onPointerEnter:e=>{e.pointerType!==`touch`&&l(!0,B)},onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,V)},onFocus:()=>a(!0),onBlur:e=>{d(e.relatedTarget)||u()},onKeyDown:e=>{if(e.key===`Escape`)return u();if(e.key!==`Tab`||e.shiftKey||!t)return;let n=s.current?.querySelector(`button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`);n&&(e.preventDefault(),n.focus())},...t?{"aria-haspopup":`dialog`,"aria-expanded":i}:{},children:e}),(0,T.jsxs)(m,{ref:s,side:`top`,role:t?`dialog`:`tooltip`,"data-slot":`reference-status-card`,"data-tooltip-state":n,className:`w-64 space-y-2 p-3 text-xs`,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>{e.preventDefault(),d(document.activeElement)&&o.current?.focus()},onPointerEnter:()=>clearTimeout(c.current),onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,V)},children:[(0,T.jsx)(`div`,{className:`space-y-0.5`,children:r}),t?(0,T.jsx)(R.Provider,{value:u,children:t}):null]})]})}function U(e,t,n){if(t){let{label:r,hint:i}=t,a=n?`also ${W(n.label)} — ${n.hint}`:void 0;return e.state===`unavailable`?{headline:r,detail:`last known — GitHub is unreachable${e.reason?` (${e.reason})`:``}`,...a?{also:a}:{}}:{headline:r,detail:i,...a?{also:a}:{}}}switch(e.state){case`loading`:return{headline:`Checking GitHub…`,detail:`the status of this reference is on its way`};case`unavailable`:return{headline:`Status unavailable`,detail:e.reason??`GitHub could not be reached — the chip says nothing rather than guessing`};case`unknown`:return{headline:`Not found on this repository`,detail:`GitHub has no such number here — the reference may point at another repo`};default:return null}}function W(e){return e.charAt(0).toLowerCase()+e.slice(1)}function G({status:e}){if(!e)return null;if(e===`checks-pending`)return(0,T.jsx)(_,{tone:`pending`,pulse:!0,className:`size-[6px]`,"aria-hidden":`true`});let t=I[e];return t?(0,T.jsx)(t,{className:`size-2.5 shrink-0`,"aria-hidden":`true`}):null}export{j as a,b as c,D as i,y as l,z as n,M as o,k as r,x as s,L as t,v as u};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{En as r,Mn as i,Wn as a,X as o}from"./queries-ba5qZ3kd.js";import{N as s,t as c}from"./button-BqkA8Ovk.js";import{n as l,o as u,t as d}from"./reference-chip-C9pVQk05.js";import{f}from"./run-actions-CLIUiXwS.js";import{a as p,i as m,n as h}from"./use-now-DD2atNhs.js";import{r as g}from"./toaster-5ad4wwJ9.js";import{t as _}from"./ask-answer-Co3javaA.js";var v=s(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),y=e(t(),1),b=n(),x=220;function S({references:e,taskTitle:t,hidden:n,projectId:r,conflictActionFor:i}){let[a,o]=y.useState(!1),s=y.useRef(!1),c=y.useRef(void 0);y.useEffect(()=>()=>clearTimeout(c.current),[]);let l=e=>e.pointerType!==`touch`,u=()=>clearTimeout(c.current),f=e=>{l(e)&&(u(),s.current=!0,o(!0))},g=e=>{l(e)&&(u(),c.current=setTimeout(()=>o(!1),x))};return(0,b.jsxs)(h,{open:a,onOpenChange:o,children:[(0,b.jsx)(p,{asChild:!0,children:(0,b.jsxs)(`button`,{type:`button`,"data-slot":`reference-overflow`,"aria-label":`Show all ${e.length} references for ${t}`,onPointerEnter:f,onPointerLeave:g,onPointerDown:()=>{s.current=!1},onClick:()=>{s.current=!1},className:`shrink-0 rounded-full px-1 text-meta font-medium text-soft-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:[`+`,n]})}),(0,b.jsxs)(m,{align:`start`,className:`w-auto min-w-40 p-1.5`,"data-slot":`reference-overflow-list`,onPointerEnter:f,onPointerLeave:g,onOpenAutoFocus:e=>{s.current&&e.preventDefault()},onCloseAutoFocus:e=>{s.current&&e.preventDefault()},children:[(0,b.jsx)(`p`,{className:`px-1 pb-1.5 text-micro text-soft-foreground`,children:`References`}),(0,b.jsx)(`span`,{className:`flex flex-col items-start gap-1`,children:e.map(e=>(0,b.jsx)(d,{reference:e,taskTitle:t,projectId:r,conflictAction:i?.(e)},`${e.kind}#${e.number??``}#${e.url??``}`))})]})]})}function C({run:e,projectId:t,prNumber:n}){let r=_(e,t),i=l(),[a,o]=(0,y.useState)(!1),s=a||r.isPending,u=!!r.blockedBy,d=async()=>{if(s||u)return;let e=r.mode===`resume`;o(!0);try{let t=await r.send(f(n));t?g(t,{tone:`danger`}):(g(`${e?`Task reopened`:`Sent to the task`} — resolving conflicts${n?` in PR #${n}`:``}`),i())}finally{o(!1)}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(c,{type:`button`,size:`sm`,"data-slot":`reference-conflict-action`,disabled:u||s,onClick:()=>void d(),className:`h-7 w-full text-xs`,children:s?`Sending…`:`Resolve conflicts`}),u&&r.reason?(0,b.jsx)(`span`,{className:`block opacity-70`,children:r.reason}):null]})}function w({projectId:e,runId:t,prNumber:n}){let r=o(e,t);return r.data?(0,b.jsx)(C,{run:r.data,projectId:e,prNumber:n}):(0,b.jsx)(c,{type:`button`,size:`sm`,disabled:!0,className:`h-7 w-full text-xs`,children:r.isError?`Unavailable`:`Loading…`})}function T({run:e,reference:t,className:n,compact:o=!1,projectId:s}){let c=u(),{lookup:l}=c,f=s??c.projectId,p=t.kind===`PR`?i(e).filter(e=>e.kind===`PR`&&(e.number!==t.number||!!e.url&&!!t.url&&e.url!==t.url)):[],m=t.number===void 0?[t,...p]:r([{...t,number:t.number},...p],e=>f?l({projectId:f,kind:e.kind,number:e.number}).status:void 0),h=e=>e.kind===`PR`&&e.number!==void 0&&!!f&&l({projectId:f,kind:`PR`,number:e.number}).conflicting===!0,g=[...m.filter(h),...m.filter(e=>!h(e))],[_]=g;if(!_)return null;let v=t=>s===void 0?(0,b.jsx)(C,{run:e,prNumber:t.number}):(0,b.jsx)(w,{projectId:s,runId:e.id,prNumber:t.number}),y=(0,b.jsx)(d,{reference:_,taskTitle:a(e),projectId:s,conflictAction:v(_),className:n,compact:o});return g.length===1?y:(0,b.jsxs)(`span`,{"data-slot":`task-reference-chips`,className:`flex shrink-0 flex-nowrap items-center gap-1`,children:[y,(0,b.jsx)(S,{references:g,taskTitle:a(e),hidden:g.length-1,projectId:s,conflictActionFor:v})]})}export{v as a,S as i,w as n,T as r,C 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{E as r,Pr as i,Qi as a,bt as o,ht as s,mt as c,pr as l,pt as u,r as d,so as f,uo as p,vt as m,yt as h}from"./queries-ba5qZ3kd.js";import{n as g,t as _}from"./utils-Br_dqwn-.js";import{f as v}from"./chunk-KS7C4IRE-DtL2Gzw3.js";import{t as y}from"./use-desktop-BNN3U2y9.js";import{N as b,t as x}from"./button-BqkA8Ovk.js";import{t as S}from"./arrow-down-DACdHKjc.js";import{t as C}from"./arrow-left-BtT8zuL0.js";import{t as w}from"./arrow-up-BAPSgozC.js";import{t as ee}from"./check-B1z-_MCO.js";import{t as te}from"./chevron-right-DPaV033p.js";import{a as ne,f as T,g as E,m as D,p as O,s as k,v as A}from"./impact-model-Dj6tIycu.js";import{i as j,n as re}from"./file-preview-DQ7iQhe0.js";import{t as ie}from"./file-rCLi_p-R.js";import{a as ae,c as M,i as oe,n as se,o as ce,r as le,s as ue,t as de}from"./file-tree-Bm38qEZP.js";import{t as fe}from"./folder-leteY9jH.js";import{n as N,t as pe}from"./active-forge-DO2AaQ-s.js";import{n as P}from"./upload-C2gxSnMR.js";import{t as me}from"./git-pull-request-CURFMFaU.js";import{t as F}from"./plus-Bdmhj8CR.js";import{t as I}from"./search-x-BxcYdvqm.js";import{t as L}from"./triangle-alert-C1mTIqxM.js";import{t as R}from"./input-BO795Un9.js";import{r as z}from"./toaster-5ad4wwJ9.js";import{c as he,t as ge}from"./project-router-xmadY-N9.js";import{t as _e}from"./diff-stat-CxDTnfya.js";import{t as B}from"./centered-state-CquGIOsq.js";import{s as ve}from"./index-DuW72uFI.js";import{t as ye}from"./markdown-CP2EQDsL.js";import{t as V}from"./diff-BQScRHXz.js";import{t as be}from"./impact-control-Deh1F44q.js";import{t as H}from"./commit-list-D5Nuv2HC.js";var xe=b(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),U=e(t(),1),W=n();function Se(){let e=m(),t=h();if(!e.data)return null;let n=e.data,r=e=>t.mutate(e,{onSuccess:e=>z(e.message),onError:e=>z(e.message,{tone:`danger`,expected:e instanceof l&&e.status===409})}),i=t.isPending,a=t.variables;return(0,W.jsxs)(`div`,{"data-slot":`repo-sync`,className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-meta`,children:[n.upstream?(0,W.jsxs)(`span`,{"data-slot":`repo-upstream`,className:`truncate font-mono text-soft-foreground`,title:`Upstream`,children:[`→ `,n.upstream]}):n.branch?(0,W.jsx)(`span`,{"data-slot":`repo-upstream`,className:`text-soft-foreground`,children:`not published`}):(0,W.jsx)(`span`,{"data-slot":`repo-upstream`,className:`text-soft-foreground`,children:`detached HEAD`}),n.upstream?(0,W.jsx)(K,{ahead:n.ahead,behind:n.behind}):n.outgoing.length>0?(0,W.jsx)(K,{ahead:n.outgoing.length,behind:null}):null,(0,W.jsx)(`span`,{"data-slot":`repo-fetched`,className:`hidden text-soft-foreground sm:inline`,children:n.lastFetchedAt?`fetched ${we(n.lastFetchedAt)}`:`never fetched`}),(0,W.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,W.jsx)(G,{which:`fetch`,label:`Fetch`,busy:i,pending:a,onClick:r,disabled:!n.pushRemote,children:(0,W.jsx)(E,{"aria-hidden":`true`,className:_(i&&a===`fetch`&&`animate-spin`)})}),n.upstream?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(G,{which:`pull`,label:`Pull`,busy:i,pending:a,onClick:r,disabled:!n.behind,children:(0,W.jsx)(S,{"aria-hidden":`true`})}),(0,W.jsx)(G,{which:`push`,label:`Push`,busy:i,pending:a,onClick:r,disabled:!n.ahead,children:(0,W.jsx)(w,{"aria-hidden":`true`})}),(0,W.jsx)(G,{which:`sync`,label:`Sync`,busy:i,pending:a,onClick:r,disabled:!n.ahead&&!n.behind,variant:`outline`,children:(0,W.jsx)(E,{"aria-hidden":`true`,className:_(i&&a===`sync`&&`animate-spin`)})})]}):n.branch&&n.pushRemote?(0,W.jsx)(G,{which:`push`,label:`Publish branch`,busy:i,pending:a,onClick:r,variant:`outline`,children:(0,W.jsx)(xe,{"aria-hidden":`true`})}):null]})]})}function G({which:e,label:t,busy:n,pending:r,onClick:i,disabled:a,variant:o=`ghost`,children:s}){return(0,W.jsxs)(x,{variant:o,size:`sm`,"data-action":`repo-${e}`,"aria-busy":n&&r===e,disabled:n||a,onClick:()=>i(e),children:[s,t]})}function K({ahead:e,behind:t}){return e===null&&t===null?null:!e&&!t?(0,W.jsx)(`span`,{"data-slot":`sync-counts`,className:`text-soft-foreground`,children:`in sync`}):(0,W.jsxs)(`span`,{"data-slot":`sync-counts`,className:`flex items-center gap-1 font-mono`,children:[e?(0,W.jsxs)(`span`,{"data-sync":`ahead`,title:`${e} to push`,className:`text-primary`,children:[`↑`,e]}):null,t?(0,W.jsxs)(`span`,{"data-sync":`behind`,title:`${t} to pull`,className:`text-warning`,children:[`↓`,t]}):null]})}function Ce({name:e,sync:t}){if(!t)return null;let n=t.branches.find(t=>t.name===e),r=n?n.gone?`upstream gone`:n.upstream?null:`local only`:`remote only`;return(0,W.jsx)(`span`,{"data-slot":`branch-tracking`,className:`flex shrink-0 items-center gap-1 text-meta`,children:r?(0,W.jsx)(`span`,{className:`text-soft-foreground`,children:r}):(0,W.jsx)(K,{ahead:n.ahead,behind:n.behind})})}function we(e){let t=Math.max(0,Math.round((Date.now()-Date.parse(e))/1e3));if(t<60)return`just now`;let n=Math.round(t/60);if(n<60)return`${n} min ago`;let r=Math.round(n/60);return r<24?`${r} h ago`:`${Math.round(r/24)} d ago`}function Te({repo:e,info:t}){let n=pe(),r=m(),o=p(),s=e=>z(e.message,{tone:`danger`}),c=f({mutationFn:e=>i({name:e}),onSuccess:async e=>{z(e.created?`Created and switched to ${e.branch}`:`Switched to ${e.branch}`),await Promise.all([o.invalidateQueries({queryKey:d.repo}),o.invalidateQueries({queryKey:d.health})]),o.setQueryData(d.repo,t=>t?.info?{...t,info:{...t.info,branch:e.branch}}:t),o.setQueryData(d.health,n=>n?.repo?.root===t.root?{...n,repo:{...n.repo,branch:e.branch}}:n)},onError:s}),l=f({mutationFn:e=>a({baseBranch:e}),onSuccess:e=>{z(e.baseBranch?`Agents now branch from ${e.baseBranch}`:`Agents now fork from the checked-out branch`),o.invalidateQueries({queryKey:d.repo})},onError:s}),[u,h]=(0,U.useState)(``),[g,v]=(0,U.useState)(``),y=g.trim().toLowerCase(),b=y?e.branches.filter(e=>e.toLowerCase().includes(y)):e.branches;return(0,W.jsxs)(`section`,{"data-slot":`repo-branches`,className:`flex flex-col gap-6 px-4 py-4 md:px-6`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h2`,{className:`eyebrow text-soft-foreground`,children:`Branches`}),(0,W.jsx)(R,{"aria-label":`Filter branches`,placeholder:`Filter branches…`,value:g,onChange:e=>v(e.target.value),className:`mt-2 max-w-xl`}),(0,W.jsxs)(`ul`,{"data-slot":`repo-branch-list`,className:`mt-2 flex max-w-xl flex-col divide-y divide-border`,children:[b.map(n=>{let i=n===t.branch,a=e.checkedOutElsewhere?.[n];return(0,W.jsxs)(`li`,{"data-slot":`branch-row`,"data-branch":n,className:`flex min-h-9 items-center gap-2 py-1`,children:[(0,W.jsx)(N,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,W.jsx)(`span`,{className:_(`min-w-0 truncate font-mono text-xs`,i&&`font-semibold`),children:n}),(0,W.jsx)(Ce,{name:n,sync:r.data}),i?(0,W.jsxs)(`span`,{"data-slot":`branch-current`,className:`flex shrink-0 items-center gap-1 rounded-sm bg-muted px-1.5 py-px text-micro font-medium text-muted-foreground`,children:[(0,W.jsx)(ee,{"aria-hidden":`true`,className:`size-3`}),`current`]}):a?(0,W.jsx)(`span`,{"data-slot":`branch-elsewhere`,title:`Checked out in ${a}`,className:`ml-auto shrink-0 text-meta text-soft-foreground`,children:`in another worktree`}):(0,W.jsx)(x,{variant:`ghost`,size:`sm`,"data-action":`switch-branch`,className:`ml-auto`,disabled:c.isPending,onClick:()=>c.mutate(n),children:`Switch`})]},n)}),b.length===0?(0,W.jsxs)(`li`,{"data-slot":`branch-empty`,className:`py-3 text-xs text-soft-foreground`,children:[`No branches match “`,g.trim(),`”.`]}):null]}),(0,W.jsxs)(`form`,{"data-slot":`branch-create`,className:`mt-3 flex max-w-md items-center gap-2`,onSubmit:e=>{e.preventDefault();let t=u.trim();t&&c.mutate(t,{onSuccess:()=>h(``)})},children:[(0,W.jsx)(R,{"aria-label":`New branch name`,placeholder:`new-branch-name`,value:u,onChange:e=>h(e.target.value)}),(0,W.jsxs)(x,{type:`submit`,variant:`outline`,size:`sm`,"data-action":`create-branch`,disabled:!u.trim()||c.isPending,children:[(0,W.jsx)(F,{"aria-hidden":`true`}),`Create`]})]})]}),(0,W.jsxs)(`div`,{className:`max-w-md`,children:[(0,W.jsx)(`label`,{htmlFor:`base-branch-picker`,className:`eyebrow text-soft-foreground`,children:`Agents’ base branch`}),(0,W.jsxs)(`select`,{id:`base-branch-picker`,"data-slot":`base-branch-picker`,value:e.baseBranch??``,disabled:l.isPending,onChange:e=>l.mutate(e.target.value===``?null:e.target.value),className:`mt-1.5 block w-full rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[(0,W.jsx)(`option`,{value:``,children:`follow checked-out branch (default)`}),e.branches.map(e=>(0,W.jsx)(`option`,{value:e,children:e},e))]}),(0,W.jsx)(`p`,{className:`mt-1 text-meta text-soft-foreground`,children:`New task worktrees branch from this.`})]}),n?.available?(0,W.jsx)(Ee,{}):null]})}function Ee(){let e=r({limit:20});return(0,W.jsxs)(`div`,{"data-slot":`repo-prs`,className:`max-w-xl`,children:[(0,W.jsx)(`h2`,{className:`eyebrow text-soft-foreground`,children:`Open pull requests`}),e.isPending?(0,W.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`Loading pull requests…`}):e.isError?(0,W.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:e.error.message}):e.data.available?e.data.prs.length===0?(0,W.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`No open pull requests.`}):(0,W.jsx)(`ul`,{className:`mt-2 flex flex-col divide-y divide-border`,children:e.data.prs.map(e=>(0,W.jsx)(De,{pr:e},e.number))}):(0,W.jsx)(`p`,{"data-slot":`repo-prs-unavailable`,className:`mt-2 text-xs text-soft-foreground`,children:e.data.reason??`The forge is unreachable right now.`})]})}function De({pr:e}){let t=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(me,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,W.jsxs)(`span`,{className:`shrink-0 font-mono text-meta text-muted-foreground`,children:[`#`,e.number]}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ui`,children:e.title}),e.checks?(0,W.jsx)(Oe,{checks:e.checks}):null]}),n=`flex min-w-0 items-center gap-2 rounded-sm px-1.5 py-2`;return(0,W.jsx)(`li`,{"data-slot":`pr-row`,"data-number":e.number,children:g(e.url)?(0,W.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:_(n,`hover:bg-muted`),children:t}):(0,W.jsx)(`span`,{className:n,children:t})})}function Oe({checks:e}){return(0,W.jsx)(`span`,{"data-slot":`pr-checks`,"data-checks":e,className:_(`shrink-0 text-micro font-medium`,e===`passing`&&`text-success`,e===`failing`&&`text-danger`,e===`pending`&&`text-muted-foreground`),children:e})}function ke(){let e=c(),t=y(),[n,r]=(0,U.useState)(`unified`),[i,a]=(0,U.useState)(!1),[o,s]=(0,U.useState)(!1),[u,d]=(0,U.useState)(null),f=(0,U.useRef)(null),p=(0,U.useRef)(null),[m,h]=ae(),g=oe(m),v=e.isError&&e.error instanceof l&&e.error.status===409,b=e.data?.files??[],x=(0,U.useMemo)(()=>de(b),[b]),S=(0,U.useMemo)(()=>b.some(ye),[b]),C=t?n:`unified`,w=!t||i;return(0,W.jsxs)(`section`,{"data-slot":`repo-changes`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,W.jsxs)(`div`,{"data-slot":`repo-changes-toolbar`,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,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Uncommitted changes`}),e.data?(0,W.jsx)(k,{stat:e.data.stat}):null,(0,W.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,W.jsx)(O,{mode:n,wrap:i,preview:o,onModeChange:r,onWrapChange:a,onPreviewChange:S?s:void 0})})]}),e.isPending?(0,W.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading changes…`}):e.isError?(0,W.jsx)(B,{icon:v?(0,W.jsx)(A,{}):(0,W.jsx)(L,{}),tone:v?`neutral`:`danger`,heading:`h2`,title:v?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):b.length===0?(0,W.jsx)(B,{icon:(0,W.jsx)(A,{}),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,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-5 px-4 py-4 max-md:[--diff-sticky-top:7rem] md:px-6 md:py-0`,children:[(0,W.jsx)(`aside`,{ref:p,"data-slot":`changes-tree-pane`,style:g.style,className:_(`hidden w-60 max-w-[60%] shrink-0 overflow-y-auto overscroll-contain py-4 md:block lg:w-72`,g.className),children:(0,W.jsx)(ce,{root:x,selected:u,onSelect:e=>{d(e),f.current?.scrollToPath(e)}})}),(0,W.jsx)(le,{paneRef:p,width:m,onWidthChange:h,className:`hidden md:block`}),(0,W.jsx)(`div`,{"data-slot":`diff-pane`,"data-diff-scroller":t?``:void 0,className:`min-w-0 flex-1 md:overflow-y-auto md:overscroll-contain`,children:(0,W.jsx)(V,{files:b,viewRef:f,mode:C,wrap:w,preview:t&&S&&o,className:`min-w-0 md:py-4`})})]})]})}function Ae({log:e}){let{sha:t}=v(),n=m().data;if(t)return(0,W.jsx)(je,{sha:t});let r=new Set(n?.outgoing??[]),i=n?.incoming??[],a=(e,t)=>({sha:e.hash,shaLabel:e.hash,subject:e.subject,author:e.author,when:e.when,href:`/git/commits/${e.hash}`,...t?{sync:t}:{}}),o=i.length>0?(0,W.jsxs)(`section`,{"data-slot":`repo-incoming`,className:`border-b border-border`,children:[(0,W.jsxs)(`h2`,{className:`px-4 pt-3 text-meta font-medium text-muted-foreground md:px-6`,children:[`Incoming from `,n?.upstream,` · `,i.length]}),(0,W.jsx)(H,{slot:`repo-incoming-commits`,commits:i.map(e=>a(e,`incoming`))})]}):null;return e.length===0?(0,W.jsx)(B,{icon:(0,W.jsx)(P,{}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`The log is empty — this repository has no commits to show.`}):(0,W.jsxs)(W.Fragment,{children:[o,(0,W.jsx)(H,{slot:`repo-commits`,commits:e.map(e=>a(e,r.has(e.hash)?`outgoing`:void 0))})]})}function je({sha:e}){let t=s(e),n=y(),[r,i]=(0,U.useState)(`unified`),[a,o]=(0,U.useState)(!1),c=t.isError&&t.error instanceof l&&t.error.status===409,u=n?r:`unified`,d=!n||a;return(0,W.jsxs)(`section`,{"data-slot":`repo-commit`,"data-sha":e,className:`flex min-h-0 flex-1 flex-col`,children:[(0,W.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,W.jsx)(x,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,W.jsxs)(ge,{to:`/git/commits`,children:[(0,W.jsx)(C,{"aria-hidden":`true`}),`All commits`]})}),t.data?(0,W.jsx)(_e,{stat:t.data.stat}):null,(0,W.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,W.jsx)(O,{mode:r,wrap:a,onModeChange:i,onWrapChange:o})})]}),t.isPending?(0,W.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,W.jsx)(B,{icon:c?(0,W.jsx)(I,{}):(0,W.jsx)(L,{}),tone:c?`neutral`:`danger`,heading:`h2`,title:c?`Commit not found`:`Could not load the commit`,subtitle:t.error.message}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,W.jsx)(`h2`,{className:`text-sm font-semibold`,children:t.data.subject}),(0,W.jsxs)(`p`,{className:`mt-0.5 text-meta text-soft-foreground`,children:[t.data.author,` · `,t.data.when,` ·`,` `,(0,W.jsx)(`span`,{className:`font-mono select-all`,children:t.data.sha})]})]}),t.data.files.length===0?(0,W.jsx)(B,{icon:(0,W.jsx)(P,{}),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,W.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:7rem] md:px-6`,children:(0,W.jsx)(V,{files:t.data.files,mode:u,wrap:d,className:`min-w-0`})})]})]})}function q(e,t){let n=0;for(let r of t){if(n=e.indexOf(r,n),n===-1)return!1;n+=r.length}return!0}function Me(e,t,n){let r=t.trim().toLowerCase();if(r===``)return{results:[...e],total:e.length};let i=[];for(let t of e){let e=t.toLowerCase();if(!q(e,r))continue;let n=e.slice(e.lastIndexOf(`/`)+1);i.push({path:t,basenameMatch:q(n,r)})}return i.sort((e,t)=>e.basenameMatch===t.basenameMatch?e.path.length===t.path.length?e.path.localeCompare(t.path):e.path.length-t.path.length:e.basenameMatch?-1:1),{results:i.slice(0,n).map(e=>e.path),total:i.length}}var J=200;function Ne({selected:e,onSelect:t}){let n=o(),r=n.isError&&n.error instanceof l&&n.error.status===409,i=n.data?.paths??[];return n.isPending?(0,W.jsx)(Y,{children:(0,W.jsx)(`p`,{"data-slot":`repo-files-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading files…`})}):n.isError?(0,W.jsx)(Y,{children:(0,W.jsx)(B,{icon:r?(0,W.jsx)(M,{}):(0,W.jsx)(L,{}),tone:r?`neutral`:`danger`,heading:`h2`,title:r?`No files to browse`:`Could not load the files`,subtitle:n.error.message})}):i.length===0?(0,W.jsx)(Y,{children:(0,W.jsx)(B,{icon:(0,W.jsx)(M,{}),tone:`neutral`,heading:`h2`,title:`No files yet`,subtitle:`Nothing is tracked in this repository. Files show up here once git knows about them.`})}):(0,W.jsxs)(Y,{children:[n.data.truncated?(0,W.jsxs)(`p`,{"data-slot":`repo-files-truncated`,role:`status`,className:`border-b border-border bg-muted/40 px-4 py-2 text-xs text-muted-foreground md:px-6`,children:[`Showing the first `,i.length.toLocaleString(),` files; this repository has more. The tree and the filter cover only what is loaded.`]}):null,(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-5 px-4 py-4 [--diff-sticky-top:7rem] md:flex-row md:items-start md:px-6`,children:[(0,W.jsx)(`aside`,{"data-slot":`repo-files-tree-pane`,className:_(`w-full shrink-0 md:sticky md:top-[var(--diff-sticky-top)] md:block md:max-h-[calc(100dvh_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain lg:w-72`,e!==null&&`hidden`),children:(0,W.jsx)(Pe,{paths:i,selected:e,onSelect:t})}),(0,W.jsxs)(`div`,{className:_(`min-w-0 flex-1`,e===null&&`hidden md:block`),children:[e===null?null:(0,W.jsxs)(`button`,{type:`button`,"data-slot":`repo-files-back`,onClick:()=>t(null),className:`mb-2 flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground md:hidden`,children:[(0,W.jsx)(C,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the file tree`]}),(0,W.jsx)(re,{source:{kind:`repo`},path:e,headerActions:ne(e)?(0,W.jsx)(be,{subject:{kind:`spec`,path:e}}):void 0})]})]})]})}function Y({children:e}){return(0,W.jsx)(`section`,{"data-slot":`repo-files`,className:`flex min-h-0 flex-1 flex-col`,children:e})}function X(e){if(e===null)return[];let t=e.split(`/`);return t.slice(0,-1).map((e,n)=>t.slice(0,n+1).join(`/`))}function Z(e,t,n){let r=[];for(let i of e.dirs){let e=t.has(i.path);r.push({kind:`dir`,path:i.path,name:i.name,level:n,open:e}),e&&r.push(...Z(i,t,n+1))}for(let t of e.files)r.push({kind:`file`,path:t.path,name:t.name,level:n,label:t.name});return r}function Pe({paths:e,selected:t,onSelect:n}){let[r,i]=(0,U.useState)(``),[a,o]=(0,U.useState)(()=>new Set(X(t))),[s,c]=(0,U.useState)(t),l=(0,U.useRef)(null);(0,U.useEffect)(()=>{let e=X(t);e.length!==0&&o(t=>{if(e.every(e=>t.has(e)))return t;let n=new Set(t);for(let t of e)n.add(t);return n})},[t]);let u=r.trim()!==``,d=(0,U.useMemo)(()=>Me(e,r,J),[e,r]),f=(0,U.useMemo)(()=>se(e,(e,t)=>({kind:`file`,name:t,path:e})),[e]),p=(0,U.useMemo)(()=>u?d.results.map(e=>({kind:`file`,path:e,name:e.slice(e.lastIndexOf(`/`)+1),level:0,label:e})):Z(f,a,0),[u,d.results,f,a]),m=p.find(e=>e.path===s)??p[0],h=e=>o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,W.jsxs)(`div`,{"data-slot":`repo-files-browser`,className:`flex min-w-0 flex-col gap-2`,onKeyDown:e=>{e.key!==`/`||e.target===l.current||(e.preventDefault(),l.current?.focus())},children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`label`,{htmlFor:`repo-files-filter`,className:`sr-only`,children:`Filter repository files`}),(0,W.jsx)(`input`,{id:`repo-files-filter`,ref:l,"data-slot":`repo-files-filter`,type:`search`,value:r,placeholder:`Filter files… (/)`,"aria-controls":`repo-files-tree`,autoComplete:`off`,spellCheck:!1,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),i(``))},className:`w-full rounded-sm border border-border bg-background px-2 py-1 text-xs placeholder:text-soft-foreground focus:border-foreground focus:outline-none`}),(0,W.jsx)(`p`,{"data-slot":`repo-files-count`,role:`status`,"aria-live":`polite`,className:`sr-only`,children:u?`${d.total} files match ${r.trim()}`:`${e.length} files`})]}),u&&d.total===0?(0,W.jsxs)(`p`,{"data-slot":`repo-files-no-match`,className:`px-1.5 py-1 text-xs text-soft-foreground`,children:[`No file matches `,(0,W.jsx)(`span`,{className:`font-mono`,children:r.trim()}),`.`]}):(0,W.jsx)(`div`,{id:`repo-files-tree`,"data-slot":`repo-files-tree`,"data-filtering":u?`true`:void 0,role:`tree`,"aria-label":`Repository files`,"aria-activedescendant":m?Q(m.path):void 0,onKeyDown:e=>{let t=p.findIndex(e=>e.path===m?.path),r=e=>{let t=p[Math.max(0,Math.min(p.length-1,e))];t&&c(t.path)},i=p[t];if(e.key===`ArrowDown`)e.preventDefault(),r(t+1);else if(e.key===`ArrowUp`)e.preventDefault(),r(t-1);else if(e.key===`ArrowRight`&&i?.kind===`dir`)e.preventDefault(),i.open?r(t+1):h(i.path);else if(e.key===`ArrowLeft`&&i!==void 0)if(e.preventDefault(),i.kind===`dir`&&i.open)h(i.path);else for(let e=t-1;e>=0;--e){let t=p[e];if(t.level<i.level){c(t.path);break}}else(e.key===`Enter`||e.key===` `)&&i!==void 0&&(e.preventDefault(),i.kind===`file`?n(i.path):h(i.path))},className:`min-w-0 text-ui`,children:p.map(e=>e.kind===`dir`?(0,W.jsx)(Fe,{row:e,focused:e.path===m?.path,onToggle:()=>{c(e.path),h(e.path)}},e.path):(0,W.jsx)(Ie,{row:e,active:e.path===t,focused:e.path===m?.path,onSelect:()=>{c(e.path),n(e.path)}},e.path))}),u&&d.total>d.results.length?(0,W.jsxs)(`p`,{"data-slot":`repo-files-more`,className:`px-1.5 py-1 text-xs text-soft-foreground`,children:[(d.total-d.results.length).toLocaleString(),` more — refine the filter.`]}):null]})}var Q=e=>`repo-file-row-${e}`,$=(e,t)=>({paddingLeft:`${t+e*14}px`});function Fe({row:e,focused:t,onToggle:n}){return(0,W.jsxs)(`div`,{id:Q(e.path),role:`treeitem`,"aria-expanded":e.open,"aria-level":e.level+1,"data-slot":`repo-files-dir`,"data-path":e.path,"data-state":e.open?`open`:`closed`,tabIndex:t?0:-1,onClick:n,className:`flex w-full min-w-0 cursor-pointer items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground focus:bg-muted focus:outline-none`,style:$(e.level,6),children:[(0,W.jsx)(te,{"aria-hidden":`true`,className:_(`size-3.5 shrink-0 transition-transform`,e.open&&`rotate-90`)}),(0,W.jsx)(fe,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,W.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name})]})}function Ie({row:e,active:t,focused:n,onSelect:r}){let i=j(e.path)?ue:ie;return(0,W.jsxs)(`div`,{id:Q(e.path),role:`treeitem`,"aria-level":e.level+1,"aria-selected":t,"aria-current":t?`true`:void 0,"data-slot":`repo-files-file`,"data-path":e.path,tabIndex:n?0:-1,onClick:r,className:_(`flex w-full min-w-0 cursor-pointer items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted focus:outline-none`,t?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:$(e.level,24),children:[(0,W.jsx)(i,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,W.jsx)(`span`,{className:`min-w-0 truncate`,title:e.label,children:e.label})]})}function Le({tab:e}){let t=u();if(t.isPending)return(0,W.jsx)(ve,{});if(t.isError)return(0,W.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,W.jsx)(B,{icon:(0,W.jsx)(L,{}),tone:`danger`,title:`Could not load the repository`,subtitle:t.error.message})});let n=t.data.info;return n?(0,W.jsx)(Re,{repo:t.data,info:n,tab:e}):(0,W.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,W.jsx)(B,{icon:(0,W.jsx)(N,{}),tone:`neutral`,title:`Not a git repository`,subtitle:`The cockpit is running outside a git repository — start it inside one to browse changes, commits and branches.`})})}function Re({repo:e,info:t,tab:n}){return(0,W.jsxs)(`div`,{"data-route":`repo-git`,className:_(`flex min-h-full flex-col`,n===`changes`&&`md:h-full`),children:[(0,W.jsxs)(`header`,{"data-slot":`repo-header`,className:`sticky top-0 z-20 border-b border-border bg-background/95 px-4 pt-3 backdrop-blur md:px-6`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,W.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Git`}),(0,W.jsx)(T,{branch:t.branch}),t.remote?(0,W.jsx)(`span`,{"data-slot":`repo-remote`,className:`hidden min-w-0 truncate text-meta text-soft-foreground md:inline`,children:t.remote}):null]}),(0,W.jsx)(`div`,{className:`mt-1.5`,children:(0,W.jsx)(Se,{})}),(0,W.jsxs)(`div`,{"data-slot":`repo-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,W.jsx)(D,{to:`/git`,active:n===`changes`,children:`Changes`}),(0,W.jsx)(D,{to:`/git/commits`,active:n===`commits`,children:`Commits`}),(0,W.jsx)(D,{to:`/git/branches`,active:n===`branches`,children:`Branches`}),(0,W.jsx)(D,{to:`/git/files`,active:n===`files`,children:`Files`})]})]}),n===`changes`?(0,W.jsx)(ke,{}):n===`commits`?(0,W.jsx)(Ae,{log:e.log}):n===`files`?(0,W.jsx)(ze,{}):(0,W.jsx)(Te,{repo:e,info:t})]})}function ze(){let e=v(),t=he();return(0,W.jsx)(Ne,{selected:e[`*`]!==void 0&&e[`*`]!==``?e[`*`]:null,onSelect:e=>t(e===null?`/git/files`:`/git/files/${Be(e)}`,{replace:!0})})}function Be(e){return e.split(`/`).map(encodeURIComponent).join(`/`)}export{Le as RepoGitRoute};
@@ -0,0 +1 @@
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{Hn as t,et as n,no as r,to as i}from"./queries-ba5qZ3kd.js";import{It as a}from"./utils-Br_dqwn-.js";import{N as o,t as ee}from"./button-BqkA8Ovk.js";import{t as s}from"./bot-Cm-PLA1M.js";import{l as c,n as l,r as u,s as te,t as ne}from"./dropdown-menu-CDv5Teql.js";import{t as d}from"./external-link-Bclznsu3.js";import{t as f}from"./folder-leteY9jH.js";var p=o(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),m=o(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),h=o(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),g=o(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),_=o(`diamond`,[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]),v=o(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),y=o(`gem`,[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),b=o(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),x=o(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),S=o(`hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]),re=o(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),C=o(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),ie=o(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),w=o(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),T=o(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),E=o(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),ae=o(`waves-horizontal`,[[`path`,{d:`M2 12q2.5 2 5 0t5 0 5 0 5 0`,key:`8ddzzs`}],[`path`,{d:`M2 19q2.5 2 5 0t5 0 5 0 5 0`,key:`1wj4st`}],[`path`,{d:`M2 5q2.5 2 5 0t5 0 5 0 5 0`,key:`69x50u`}]]),D=o(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),O={claude:`Claude Code`,codex:`Codex`,junie:`Junie`,opencode:`OpenCode`,cursor:`Cursor`,pi:`pi`,copilot:`GitHub Copilot CLI`,omp:`OMP`,antigravity:`Antigravity`,gemini:`Gemini CLI`,kimi:`Kimi Code`};function k(e){let t=e.currentStepId?e.steps.find(t=>t.id===e.currentStepId):void 0;if(t?.backend)return t.backend;if(e.runner)return e.runner;for(let t=e.steps.length-1;t>=0;--t){let n=e.steps[t]?.backend;if(n)return n}return`claude`}function A(e){return e.runner??`claude`}function j(e,t){let n=r(t,e);return n?.enabled===!1?{provider:e,usable:!1,reason:`${O[e]} is disabled. Enable it in Settings → Agents → Providers.`}:!n||!i(n)?{provider:e,usable:!1,reason:`${O[e]} credentials are unavailable. Authorize it in Settings → Agents → Providers.`}:{provider:e,usable:!0}}function M(e,t){return j(k(e),t)}function N(e,t){return j(A(e),t)}function P(e){let t=n(),r=k(e);return t.isSuccess&&t.data?M(e,t.data):{provider:r,usable:!0}}function F(e){let t=n(),r=A(e);return t.isSuccess&&t.data?N(e,t.data):t.isError?{provider:r,usable:!1,reason:`Provider authentication could not be verified.`}:{provider:r,usable:!0}}var I=e(),L={folder:f,terminal:E,vscode:h,cursor:re,zed:D,windsurf:ae,sublime:v,idea:_,pycharm:S,webstorm:b,goland:ie,rubymine:y,phpstorm:m,clion:g,rider:p,"android-studio":w,xcode:x,warp:C,claude:s,codex:T,junie:s,opencode:s,pi:s,copilot:s,omp:s,antigravity:s,gemini:s,kimi:s};function R(e){return e.icon&&L[e.icon]||d}var z=RegExp(`^cli:(${a.options.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)})$`);function B(e){let t=z.exec(e);return t?t[1]:void 0}function V({choices:e,onPick:t,label:n=`Open in…`,title:r,triggerVariant:i=`ghost`,disabled:a=!1,leading:o,trailing:s,slot:f}){return(0,I.jsxs)(ne,{children:[(0,I.jsx)(c,{asChild:!0,children:(0,I.jsxs)(ee,{variant:i,size:`sm`,title:r,disabled:a,"data-slot":f,children:[(0,I.jsx)(d,{"aria-hidden":`true`}),n]})}),(0,I.jsxs)(l,{align:`end`,children:[o,o&&e.length>0?(0,I.jsx)(te,{}):null,e.map(({target:e,suffix:n,title:r})=>{let i=R(e);return(0,I.jsxs)(u,{"data-target":e.id,title:r,onSelect:()=>t(e.id),children:[(0,I.jsx)(i,{"aria-hidden":`true`}),e.label,n??``]},e.id)}),s]})]})}var H=[`done`,`failed`,`cancelled`],U=[`done`,`failed`];function W(e){return e.status===`failed`&&e.autoResumeAt!==void 0}function G(e){return e.status===`failed`&&e.awaitingAnswerSince!==void 0}function K(e){return H.includes(e)}function q(e){return e.archived||W(e)||G(e)||!U.includes(e.status)?!1:e.finishedAt!==void 0}function J(e){let t=e.finishedAt;return t===void 0||!q(e)?!1:e.seenAt===void 0||e.seenAt<t}function oe(e){return W(e)||G(e)?!1:K(e.status)&&!J(e)}function se(e){return e.reduce((e,t)=>J(t)?e+1:e,0)}function Y(e){return e===`running`||e===`queued`||e===`waiting`}function ce(e){return!Y(e.status)&&e.worktree!==!1&&!!e.worktreePath&&!e.worktreeReclaimedAt&&!e.worktreeLifecycle?.activeOperationId}function X(e){return[...e.steps].reverse().find(e=>e.sessionId)?.sessionId}var le=/^[A-Za-z0-9._][A-Za-z0-9._-]{0,199}$/,Z={claude:`claude --resume`,codex:`codex resume`,opencode:`opencode --session`,cursor:`agent --resume`,junie:`junie --resume`,pi:`pi --session`,copilot:`copilot --resume`,omp:`omp --resume`,antigravity:`agy --conversation`,gemini:`gemini --resume`,kimi:`kimi --session`};function ue(e,t){if(le.test(t))return e===`junie`?`${Z.junie} --session-id=${t}`:`${Z[e??`claude`]} ${t}`}function de(e){if(Y(e.status)||e.worktreeLifecycle?.activeOperationId)return;let t=X(e);if(t===void 0)return;let n=ue(e.runner,t);if(n!==void 0)return e.worktreePath?`cd ${e.worktreePath} && ${n}`:n}function fe(e,t){let n=B(t);return!n||Y(e.status)||e.worktreeLifecycle?.activeOperationId?!1:n===(e.runner??`claude`)&&X(e)!==void 0}function pe(e){let t=Y(e.status),n=X(e)!==void 0,r=!!e.worktreeLifecycle?.activeOperationId;return{finish:!r&&(e.status===`waiting`||e.status===`review`),continueRun:!r&&!t&&n,terminal:!r&&!t&&n,notes:!0,archive:!t,pin:!e.archived,markUnread:q(e)&&!J(e),markRead:q(e)&&J(e),promote:e.status===`queued`&&!e.archived,cancel:!r&&t,deleteRun:!r&&!t}}function me(e){return e?`Resolve conflicts in PR ${e}`:`Resolve conflicts`}function Q(e){return e?`Fix failing checks in PR ${e}`:`Fix failing checks`}function he(e){return e?`Commit and push`:`Commit`}function ge(){return`Push`}function $(e){let t=e?.replace(/^origin\//,``);return t&&!/^[0-9a-f]{7,40}$/i.test(t)?t:void 0}function _e(e,t){let n=$(t);return`${e?`Create draft PR`:`Create PR`}${n?` against ${n}`:``}`}function ve(e){let t=$(e);return t?`Update branch from ${t}`:`Update branch`}function ye(e,t){return`${e?`Create draft PR`:`Create PR`} against ${t} instead of landing: move these changes to a new branch, commit and push it, open the PR, then switch the checkout back to ${t}`}function be(e){return`Update branch: pull the latest ${e} into the checkout (rebase, keeping these uncommitted changes)`}function xe(e){return e===`review`?`Accept the changes without a PR`:`Close the session`}function Se(e,n){return t(e).get(n)}export{w as A,B as C,D,F as E,g as M,E as O,V as S,P as T,q as _,xe as a,J as b,be as c,Se as d,me as f,Y as g,ve as h,_e as i,b as j,T as k,X as l,pe as m,fe as n,Q as o,de as p,he as r,ye as s,ce as t,ge as u,K as v,R as w,se as x,oe as y};
@@ -1,3 +1,3 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ya as r,r as i,wt as a}from"./queries-DOHu2y2B.js";import{t as o}from"./utils-Df_1kJEk.js";import{t as s}from"./button-BrxohNcK.js";import{t as c}from"./chevron-right-C3fLn_fF.js";import{n as l,r as u,t as d}from"./collapsible-BJ0sxcz9.js";import{a as f,o as p}from"./markdown-rDA5iFAU.js";var m=e(t(),1),h=/^diff --git /;function g(e){let t=e.replace(h,``),n=t.lastIndexOf(` b/`);return _(n>=0?t.slice(n+3):t)}function _(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)&&t.length>=2?t.slice(1,-1).replace(/\\(.)/g,`$1`):t}function v(e){let t=_(e.slice(4));if(t!==`/dev/null`)return t.replace(/^[ab]\//,``)}function y(e){let t=[],n=null,r=!1;for(let i of e.split(`
2
- `)){if(h.test(i)){n={path:g(i),status:`modified`,binary:!1,additions:0,deletions:0,lines:[]},t.push(n),r=!1;continue}if(n){if(!r){if(i.startsWith(`@@`))r=!0,n.lines.push(i);else if(i.startsWith(`rename from `))n.status=`renamed`,n.oldPath=_(i.slice(12));else if(i.startsWith(`rename to `))n.status=`renamed`,n.path=_(i.slice(10));else if(i.startsWith(`new file mode`))n.status=`added`;else if(i.startsWith(`deleted file mode`))n.status=`deleted`;else if(i.startsWith(`Binary files `)||i===`GIT binary patch`)n.binary=!0;else if(i.startsWith(`+++ `)){let e=v(i);e!==void 0&&(n.path=e)}else if(i.startsWith(`--- `)){let e=v(i);e!==void 0&&n.status===`deleted`&&(n.path=e)}continue}n.lines.push(i),i.startsWith(`+`)?n.additions+=1:i.startsWith(`-`)&&(n.deletions+=1)}}let i=t.at(-1);return i&&i.lines.at(-1)===``&&i.lines.pop(),t}function b(e){return{files:e.length,additions:e.reduce((e,t)=>e+t.additions,0),deletions:e.reduce((e,t)=>e+t.deletions,0)}}var x=n(),S=20,C=300;function w({runId:e}){let t=r(),n=a(e);(0,m.useEffect)(()=>{t.invalidateQueries({queryKey:i.runs.diff(e)})},[t,e]);let o=(0,m.useMemo)(()=>y(n.data??``),[n.data]),[c,l]=(0,m.useState)(!1);if(n.isPending)return(0,x.jsx)(`p`,{className:`px-1 text-xs text-soft-foreground`,children:`Loading diff…`});if(n.isError)return(0,x.jsx)(`p`,{className:`px-1 text-xs text-danger`,children:n.error.message});if(o.length===0)return(0,x.jsx)(`p`,{"data-slot":`run-diff-empty`,className:`px-1 font-mono text-xs text-soft-foreground`,children:n.data.trim()||`(no changes)`});let u=b(o),d=c?o:o.slice(0,S);return(0,x.jsxs)(`div`,{"data-slot":`run-diff`,className:`flex min-w-0 flex-col gap-2`,children:[(0,x.jsxs)(`p`,{className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,x.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,x.jsxs)(`span`,{className:`font-mono font-semibold tabular-nums`,children:[(0,x.jsxs)(`span`,{className:`text-success`,children:[`+`,u.additions]}),` `,(0,x.jsxs)(`span`,{className:`text-danger`,children:[`−`,u.deletions]})]})]}),d.map(e=>(0,x.jsx)(E,{file:e},`${e.oldPath??``}→${e.path}`)),o.length>d.length?(0,x.jsxs)(s,{variant:`ghost`,size:`sm`,className:`self-start`,onClick:()=>l(!0),children:[`Show `,o.length-d.length,` more files`]}):null]})}var T={added:`added`,deleted:`deleted`,renamed:`renamed`};function E({file:e}){let[t,n]=(0,m.useState)(!0),r=T[e.status];return(0,x.jsxs)(d,{open:t,onOpenChange:n,"data-slot":`diff-file`,className:`min-w-0 overflow-hidden rounded-md border border-border bg-card`,children:[(0,x.jsxs)(u,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted/50`,children:[(0,x.jsx)(c,{className:o(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),(0,x.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`text-soft-foreground`,children:[e.oldPath,` → `]}),e.path]}):e.path}),r?(0,x.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-micro font-medium text-muted-foreground`,children:r}):null,e.binary?(0,x.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-micro font-medium text-muted-foreground`,children:`binary`}):null,(0,x.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-meta font-semibold tabular-nums`,children:[(0,x.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,x.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})]}),(0,x.jsx)(l,{children:(0,x.jsx)(`div`,{className:`border-t border-border/50`,children:e.binary?(0,x.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.lines.length===0?(0,x.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,x.jsx)(D,{lines:e.lines})})})]})}function D({lines:e}){let[t,n]=(0,m.useState)(!1),r=t?e:e.slice(0,C),i=r.join(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ot as r,r as i,uo as a}from"./queries-ba5qZ3kd.js";import{t as o}from"./utils-Br_dqwn-.js";import{t as s}from"./button-BqkA8Ovk.js";import{t as c}from"./chevron-right-DPaV033p.js";import{n as l,r as u,t as d}from"./collapsible-BuSDxSYs.js";import{a as f,o as p}from"./markdown-YWy3FUHK.js";var m=e(t(),1),h=/^diff --git /;function g(e){let t=e.replace(h,``),n=t.lastIndexOf(` b/`);return _(n>=0?t.slice(n+3):t)}function _(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)&&t.length>=2?t.slice(1,-1).replace(/\\(.)/g,`$1`):t}function v(e){let t=_(e.slice(4));if(t!==`/dev/null`)return t.replace(/^[ab]\//,``)}function y(e){let t=[],n=null,r=!1;for(let i of e.split(`
2
+ `)){if(h.test(i)){n={path:g(i),status:`modified`,binary:!1,additions:0,deletions:0,lines:[]},t.push(n),r=!1;continue}if(n){if(!r){if(i.startsWith(`@@`))r=!0,n.lines.push(i);else if(i.startsWith(`rename from `))n.status=`renamed`,n.oldPath=_(i.slice(12));else if(i.startsWith(`rename to `))n.status=`renamed`,n.path=_(i.slice(10));else if(i.startsWith(`new file mode`))n.status=`added`;else if(i.startsWith(`deleted file mode`))n.status=`deleted`;else if(i.startsWith(`Binary files `)||i===`GIT binary patch`)n.binary=!0;else if(i.startsWith(`+++ `)){let e=v(i);e!==void 0&&(n.path=e)}else if(i.startsWith(`--- `)){let e=v(i);e!==void 0&&n.status===`deleted`&&(n.path=e)}continue}n.lines.push(i),i.startsWith(`+`)?n.additions+=1:i.startsWith(`-`)&&(n.deletions+=1)}}let i=t.at(-1);return i&&i.lines.at(-1)===``&&i.lines.pop(),t}function b(e){return{files:e.length,additions:e.reduce((e,t)=>e+t.additions,0),deletions:e.reduce((e,t)=>e+t.deletions,0)}}var x=n(),S=20,C=300;function w({runId:e}){let t=a(),n=r(e);(0,m.useEffect)(()=>{t.invalidateQueries({queryKey:i.runs.diff(e)})},[t,e]);let o=(0,m.useMemo)(()=>y(n.data??``),[n.data]),[c,l]=(0,m.useState)(!1);if(n.isPending)return(0,x.jsx)(`p`,{className:`px-1 text-xs text-soft-foreground`,children:`Loading diff…`});if(n.isError)return(0,x.jsx)(`p`,{className:`px-1 text-xs text-danger`,children:n.error.message});if(o.length===0)return(0,x.jsx)(`p`,{"data-slot":`run-diff-empty`,className:`px-1 font-mono text-xs text-soft-foreground`,children:n.data.trim()||`(no changes)`});let u=b(o),d=c?o:o.slice(0,S);return(0,x.jsxs)(`div`,{"data-slot":`run-diff`,className:`flex min-w-0 flex-col gap-2`,children:[(0,x.jsxs)(`p`,{className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,x.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,x.jsxs)(`span`,{className:`font-mono font-semibold tabular-nums`,children:[(0,x.jsxs)(`span`,{className:`text-success`,children:[`+`,u.additions]}),` `,(0,x.jsxs)(`span`,{className:`text-danger`,children:[`−`,u.deletions]})]})]}),d.map(e=>(0,x.jsx)(E,{file:e},`${e.oldPath??``}→${e.path}`)),o.length>d.length?(0,x.jsxs)(s,{variant:`ghost`,size:`sm`,className:`self-start`,onClick:()=>l(!0),children:[`Show `,o.length-d.length,` more files`]}):null]})}var T={added:`added`,deleted:`deleted`,renamed:`renamed`};function E({file:e}){let[t,n]=(0,m.useState)(!0),r=T[e.status];return(0,x.jsxs)(d,{open:t,onOpenChange:n,"data-slot":`diff-file`,className:`min-w-0 overflow-hidden rounded-md border border-border bg-card`,children:[(0,x.jsxs)(u,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted/50`,children:[(0,x.jsx)(c,{className:o(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),(0,x.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`text-soft-foreground`,children:[e.oldPath,` → `]}),e.path]}):e.path}),r?(0,x.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-micro font-medium text-muted-foreground`,children:r}):null,e.binary?(0,x.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-micro font-medium text-muted-foreground`,children:`binary`}):null,(0,x.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-meta font-semibold tabular-nums`,children:[(0,x.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,x.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})]}),(0,x.jsx)(l,{children:(0,x.jsx)(`div`,{className:`border-t border-border/50`,children:e.binary?(0,x.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.lines.length===0?(0,x.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,x.jsx)(D,{lines:e.lines})})})]})}function D({lines:e}){let[t,n]=(0,m.useState)(!1),r=t?e:e.slice(0,C),i=r.join(`
3
3
  `),[a,s]=(0,m.useState)(null);(0,m.useEffect)(()=>{let e=!1;return f(i,`diff`).then(t=>{e||s({text:i,tokens:t.tokens})}),()=>{e=!0}},[i]);let c=a?.text===i?a.tokens:p(i,`diff`)?.tokens??null;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`pre`,{"data-slot":`diff-file-body`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7] whitespace-pre`,children:r.map((e,t)=>(0,x.jsxs)(`span`,{className:o(`block px-4`,e.startsWith(`+`)&&`bg-diff-add`,e.startsWith(`-`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[c?.[t]===void 0?e:c[t].map((e,t)=>(0,x.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t)),e===``?` `:``]},t))}),e.length>C?(0,x.jsx)(`button`,{type:`button`,"data-slot":`diff-file-toggle`,onClick:()=>n(e=>!e),className:`block w-full border-t border-border/50 px-4 py-1.5 text-left text-meta font-medium text-soft-foreground hover:text-foreground`,children:t?`Show less`:`Show all ${e.length} lines`}):null]})}export{w as t};
@@ -1 +1 @@
1
- import{N as e}from"./button-BrxohNcK.js";var t=e(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]);export{t};
1
+ import{N as e}from"./button-BqkA8Ovk.js";var t=e(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]);export{t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./zoomable-image-CW-pQ6ZO.js";var i=e(t(),1),a=n();function o(e){return e.image===!0&&(e.binary===!0||e.patch===``)}function s({file:e,imageSrc:t,oldImageSrc:n,onOpenInApp:r}){let i=e.oldPath??e.path;return e.status===`deleted`?n?(0,a.jsx)(`div`,{"data-slot":`diff-image-preview`,className:`flex flex-col items-center gap-2 p-4`,children:(0,a.jsx)(c,{src:n(i),alt:i,side:`old`})}):(0,a.jsx)(l,{children:`Image deleted — only the new side can be previewed.`}):t?(0,a.jsxs)(`div`,{"data-slot":`diff-image-preview`,className:`flex flex-col items-center gap-2 p-4`,children:[n!==void 0&&e.status!==`added`?(0,a.jsxs)(`div`,{className:`grid w-full grid-cols-1 items-start gap-4 sm:grid-cols-2`,children:[(0,a.jsx)(c,{label:`Before`,src:n(i),alt:i,side:`old`}),(0,a.jsx)(c,{label:`After`,src:t(e.path),alt:e.path,side:`new`})]}):(0,a.jsx)(c,{src:t(e.path),alt:e.path,side:`new`}),r?(0,a.jsx)(`button`,{type:`button`,"data-slot":`diff-image-open`,onClick:()=>r(e.path),className:`text-meta font-medium text-soft-foreground hover:text-foreground hover:underline`,children:`Open in default app`}):null]}):(0,a.jsx)(l,{children:`Binary file — no text diff.`})}function c({label:e,src:t,alt:n,side:o}){let[s,c]=(0,i.useState)(null);return(0,a.jsxs)(`figure`,{"data-slot":`diff-image-side`,"data-side":o,className:`flex min-w-0 flex-col items-center gap-1.5`,children:[e?(0,a.jsx)(`figcaption`,{className:`text-meta font-medium text-soft-foreground`,children:e}):null,s===t?(0,a.jsx)(l,{children:`Image can’t be previewed (too large or unavailable).`}):(0,a.jsx)(r,{src:t,alt:n,onError:()=>c(t),className:`max-h-[60vh] max-w-full rounded-sm`})]})}function l({children:e}){return(0,a.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:e})}function u(e){return e.closest(`[data-diff-scroller], [data-slot="main"]`)}function d(e,t,n){let r=t.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop-n;e.scrollTop=Math.max(0,r)}export{o as i,d as n,s as r,u as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./zoomable-image-DCITEnK-.js";var i=e(t(),1),a=n();function o(e){return e.image===!0&&(e.binary===!0||e.patch===``)}function s({file:e,imageSrc:t,oldImageSrc:n,onOpenInApp:r}){let i=e.oldPath??e.path;return e.status===`deleted`?n?(0,a.jsx)(`div`,{"data-slot":`diff-image-preview`,className:`flex flex-col items-center gap-2 p-4`,children:(0,a.jsx)(c,{src:n(i),alt:i,side:`old`})}):(0,a.jsx)(l,{children:`Image deleted — only the new side can be previewed.`}):t?(0,a.jsxs)(`div`,{"data-slot":`diff-image-preview`,className:`flex flex-col items-center gap-2 p-4`,children:[n!==void 0&&e.status!==`added`?(0,a.jsxs)(`div`,{className:`grid w-full grid-cols-1 items-start gap-4 sm:grid-cols-2`,children:[(0,a.jsx)(c,{label:`Before`,src:n(i),alt:i,side:`old`}),(0,a.jsx)(c,{label:`After`,src:t(e.path),alt:e.path,side:`new`})]}):(0,a.jsx)(c,{src:t(e.path),alt:e.path,side:`new`}),r?(0,a.jsx)(`button`,{type:`button`,"data-slot":`diff-image-open`,onClick:()=>r(e.path),className:`text-meta font-medium text-soft-foreground hover:text-foreground hover:underline`,children:`Open in default app`}):null]}):(0,a.jsx)(l,{children:`Binary file — no text diff.`})}function c({label:e,src:t,alt:n,side:o}){let[s,c]=(0,i.useState)(null);return(0,a.jsxs)(`figure`,{"data-slot":`diff-image-side`,"data-side":o,className:`flex min-w-0 flex-col items-center gap-1.5`,children:[e?(0,a.jsx)(`figcaption`,{className:`text-meta font-medium text-soft-foreground`,children:e}):null,s===t?(0,a.jsx)(l,{children:`Image can’t be previewed (too large or unavailable).`}):(0,a.jsx)(r,{src:t,alt:n,onError:()=>c(t),className:`max-h-[60vh] max-w-full rounded-sm`})]})}function l({children:e}){return(0,a.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:e})}function u(e){return e.closest(`[data-diff-scroller], [data-slot="main"]`)}function d(e,t,n){let r=t.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop-n;e.scrollTop=Math.max(0,r)}export{o as i,d as n,s as r,u as t};
@@ -0,0 +1 @@
1
+ import{N as e}from"./button-BqkA8Ovk.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);export{t};
@@ -1 +1 @@
1
- import{N as e}from"./button-BrxohNcK.js";var t=e(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]);export{t};
1
+ import{N as e}from"./button-BqkA8Ovk.js";var t=e(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]);export{t};
@@ -1 +1 @@
1
- import{N as e}from"./button-BrxohNcK.js";var t=e(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),n=e(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]);export{t as n,n as t};
1
+ import{N as e}from"./button-BqkA8Ovk.js";var t=e(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),n=e(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]);export{t as n,n 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{Lt as r,a as i,s as a,t as o}from"./utils-Br_dqwn-.js";import{a as s,c,i as l,l as u,o as d,r as f,s as p,u as m}from"./button-BqkA8Ovk.js";import{t as h}from"./x-CZSnHsZ4.js";var g=e(t(),1),_=[`run-event`,`ui-event`],v=1e3,y=6e4,b=1e4;function x(e,t){if(e.add(t),e.size<=b)return;let n=e.values().next().value;typeof n==`number`&&e.delete(n)}function S(e,t){return typeof e==`string`?`${e}:${t}`:t}function C(e){let t=e.type===`item.delta`?e.itemId:typeof e.item==`object`&&e.item!==null&&!Array.isArray(e.item)?e.item.id:void 0;return typeof t==`string`&&t!==``?S(e.stepId,t):void 0}function w(e){let t=[],n=new Map;for(let r of e){let e=C(r);if(e!==void 0&&r.type!==`item.delta`)for(let t of[`text`,`reasoning`,`output`])n.delete(`${e}:${t}`);if(r.type===`item.delta`&&e!==void 0&&(r.field===`text`||r.field===`reasoning`||r.field===`output`)&&typeof r.delta==`string`){let i=`${e}:${r.field}`,a=n.get(i);if(a!==void 0){let e=t[a],o={...e,seq:r.seq,ts:r.ts,delta:`${e.delta}${r.delta}`};if(a===t.length-1)t[a]=o;else{t.splice(a,1);for(let[e,t]of n)t>a&&n.set(e,t-1);n.set(i,t.length),t.push(o)}continue}n.set(i,t.length)}t.push(r)}return t}function T(e){let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t||Array.isArray(t))return null;let{id:n,steps:r}=t;return typeof n==`string`&&n!==``&&Array.isArray(r)?t:null}var E=3e4;function D(e){let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t||Array.isArray(t))return null;let{seq:n,type:r}=t;return typeof n!=`number`||typeof r!=`string`||r===``?null:t}function O(e,t={}){let[n,o]=(0,g.useState)([]),s=a(),c=(0,g.useRef)(t);c.current=t;let l=(0,g.useRef)(0),u=(0,g.useRef)(0),d=(0,g.useRef)(0),f=(0,g.useRef)(!1),p=(0,g.useRef)(new Set),m=(0,g.useRef)(void 0);(0,g.useEffect)(()=>{let{afterSeq:t=0}=c.current;if(l.current=0,u.current=t,d.current=t,f.current=!1,p.current.clear(),o([]),!e)return;let n=globalThis.EventSource;if(typeof n!=`function`)return;let a=null,s=0,h,g=!1,b=0,S=0,C=0,O=[],k,A,j=Date.now(),M,N=()=>{b=Math.min(b+1,6),S=Date.now()+Math.min(y,v*2**(b-1))},P=e=>{let t=c.current;if(t.onCompact===void 0||(t.compactAt===void 0||C<t.compactAt)&&(t.compactWhenOver===void 0||e.length<=t.compactWhenOver)||Date.now()<S)return;let n=C;Promise.resolve().then(()=>{if(!g)return c.current.onCompact?.(e)}).then(e=>{if(g)return;if(!Array.isArray(e)||e.length===0){N();return}b=0,S=0,C=Math.max(0,C-n);let t=new Set(e);t.size!==0&&o(e=>e.filter(({seq:e})=>!t.has(e)))},()=>{g||N()})},F=()=>{if(A=void 0,k!==void 0){let e=k;k=void 0,g||c.current.onRun?.(e)}if(O.length===0)return;let e=O;O=[],o(t=>{let n=c.current;return n.compactAt!==void 0||n.onCompact!==void 0?w([...t,...e]):[...t,...e]})},I=()=>{A===void 0&&(A=setTimeout(F,50))},L=()=>{s+=1;let e=a;e&&(e.close(),a=null)},R=(e,t)=>{if(g||t!==s)return;j=Date.now();let n=D(e.data);!n||p.current.has(n.seq)||n.seq<=l.current&&(!f.current||n.seq<=d.current)||(x(p.current,n.seq),l.current=Math.max(l.current,n.seq),C+=1,O.push(n),I())},z=e=>{g||e!==s||(j=Date.now())},B=()=>{g||h!==void 0||(h=setTimeout(()=>{h=void 0,g||V()},1500))},V=()=>{L();let t=s,{cursor:o,afterSeq:d=0}=c.current;j=Date.now(),u.current=Math.max(u.current,d);let f=new URLSearchParams;o!==void 0&&f.set(`cursor`,o);let p=Math.max(u.current,l.current);(o!==void 0||p>0)&&f.set(`afterSeq`,String(p));let m=f.size>0?`?${f.toString()}`:``,h=new n(i(`/runs/${encodeURIComponent(e)}/events${m}`),{withCredentials:!0});a=h;let v=e=>R(e,t);for(let e of _)h.addEventListener(e,v);h.addEventListener(`ping`,()=>z(t)),h.addEventListener(`run`,e=>{if(g||t!==s)return;j=Date.now();let n=T(e.data);n&&(k=n,I())}),h.addEventListener(`history-truncated`,e=>{if(g||t!==s)return;j=Date.now();let n;try{n=JSON.parse(e.data)}catch{return}let i=r.safeParse(n);i.success&&c.current.onTruncated?.(i.data)}),h.addEventListener(`error`,()=>{g||t!==s||h.readyState===2&&B()})},H,U=()=>{document.visibilityState===`hidden`&&(H??=setTimeout(()=>{H=void 0,!(g||document.visibilityState!==`hidden`)&&(clearTimeout(h),h=void 0,L())},E))},W=()=>{if(document.visibilityState===`hidden`){U();return}clearTimeout(H),H=void 0,(!a||a.readyState===2)&&(clearTimeout(h),h=void 0,V())},G=()=>{clearTimeout(h),h=void 0,L()},K=e=>{e.persisted&&(V(),U())};return M=setInterval(()=>{g||document.visibilityState!==`visible`||Date.now()-j<=4e4||(clearTimeout(h),h=void 0,V())},1e4),document.addEventListener(`visibilitychange`,W),window.addEventListener(`pagehide`,G),window.addEventListener(`pageshow`,K),m.current=P,V(),U(),()=>{g=!0,clearTimeout(h),clearTimeout(A),A=void 0,O=[],k=void 0,clearInterval(M),clearTimeout(H),document.removeEventListener(`visibilitychange`,W),window.removeEventListener(`pagehide`,G),window.removeEventListener(`pageshow`,K),m.current===P&&(m.current=void 0),L()}},[e,s]),(0,g.useEffect)(()=>{n.length!==0&&m.current?.(n)},[n]);let h=t.afterSeq??0;return(0,g.useEffect)(()=>{e&&(h>u.current&&(f.current=!0),u.current=Math.max(u.current,h))},[h,e]),n}var k=n();function A({...e}){return(0,k.jsx)(f,{"data-slot":`sheet`,...e})}function j({...e}){return(0,k.jsx)(m,{"data-slot":`sheet-trigger`,...e})}function M({...e}){return(0,k.jsx)(l,{"data-slot":`sheet-close`,...e})}function N({...e}){return(0,k.jsx)(c,{"data-slot":`sheet-portal`,...e})}function P({className:e,...t}){return(0,k.jsx)(p,{"data-slot":`sheet-overlay`,className:o(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function F({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,k.jsxs)(N,{children:[(0,k.jsx)(P,{}),(0,k.jsxs)(s,{"data-slot":`sheet-content`,className:o(`fixed z-50 flex flex-col gap-4 bg-background shadow-modal transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500`,r&&`[&_[data-slot=sheet-header]]:pr-16`,n===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`,n===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,n===`top`&&`inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,n===`bottom`&&`inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,e),...i,children:[t,r&&(0,k.jsxs)(l,{className:`absolute top-4 right-4 grid size-11 place-items-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,k.jsx)(h,{className:`size-4`}),(0,k.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function I({className:e,...t}){return(0,k.jsx)(`div`,{"data-slot":`sheet-header`,className:o(`flex flex-col gap-1.5 p-4`,e),...t})}function L({className:e,...t}){return(0,k.jsx)(u,{"data-slot":`sheet-title`,className:o(`font-semibold text-foreground`,e),...t})}function R({className:e,...t}){return(0,k.jsx)(d,{"data-slot":`sheet-description`,className:o(`text-sm text-muted-foreground`,e),...t})}export{I as a,E as c,O as d,R as i,C as l,M as n,L as o,F as r,j as s,A as t,S as u};