@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
@@ -1 +0,0 @@
1
- import{N as e}from"./button-BrxohNcK.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-Df_1kJEk.js";import{C as i,N as a,O as o,T as s,_ as c,a as l,b as u,c as d,f,g as ee,h as p,i as m,j as h,l as g,m as te,o as ne,p as re,r as ie,s as ae,t as oe,w as se,x as ce,y as le}from"./button-BrxohNcK.js";import{a as _,c as ue,l as v,o as y,s as b}from"./tooltip-p6YPEpXC.js";import{t as x}from"./x-sQR-jRBj.js";var de=a(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),S=e(t(),1),C=n(),w=`Popover`,[T,fe]=se(w,[v]),E=v(),[pe,D]=T(w),O=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=E(t),c=S.useRef(null),[l,u]=S.useState(!1),[d,f]=ce({prop:r,defaultProp:i??!1,onChange:a,caller:w});return(0,C.jsx)(ue,{...s,children:(0,C.jsx)(pe,{scope:t,contentId:le(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:S.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:S.useCallback(()=>u(!0),[]),onCustomAnchorRemove:S.useCallback(()=>u(!1),[]),modal:o,children:n})})};O.displayName=w;var k=`PopoverAnchor`,A=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=D(k,n),a=E(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return S.useEffect(()=>(o(),()=>s()),[o,s]),(0,C.jsx)(_,{...a,...r,ref:t})});A.displayName=k;var j=`PopoverTrigger`,M=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,a=D(j,n),o=E(n),c=h(t,a.triggerRef),l=(0,C.jsx)(s.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":U(a.open),...r,ref:c,onClick:i(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:(0,C.jsx)(_,{asChild:!0,...o,children:l})});M.displayName=j;var N=`PopoverPortal`,[P,F]=T(N,{forceMount:void 0}),I=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=D(N,t);return(0,C.jsx)(P,{scope:t,forceMount:n,children:(0,C.jsx)(u,{present:n||a.open,children:(0,C.jsx)(p,{asChild:!0,container:i,children:r})})})};I.displayName=N;var L=`PopoverContent`,R=S.forwardRef((e,t)=>{let n=F(L,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=D(L,e.__scopePopover);return(0,C.jsx)(u,{present:r||a.open,children:a.modal?(0,C.jsx)(B,{...i,ref:t}):(0,C.jsx)(me,{...i,ref:t})})});R.displayName=L;var z=o(`PopoverContent.RemoveScroll`),B=S.forwardRef((e,t)=>{let n=D(L,e.__scopePopover),r=S.useRef(null),a=h(t,r),o=S.useRef(!1);return S.useEffect(()=>{let e=r.current;if(e)return f(e)},[]),(0,C.jsx)(re,{as:z,allowPinchZoom:!0,children:(0,C.jsx)(V,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:i(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:i(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;o.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:i(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),me=S.forwardRef((e,t)=>{let n=D(L,e.__scopePopover),r=S.useRef(!1),i=S.useRef(!1);return(0,C.jsx)(V,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),V=S.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,p=D(L,n),m=E(n);return te(),(0,C.jsx)(ee,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,C.jsx)(c,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,C.jsx)(b,{"data-state":U(p.open),role:`dialog`,id:p.contentId,...m,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),H=`PopoverClose`,he=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,a=D(H,n);return(0,C.jsx)(s.button,{type:`button`,...r,ref:t,onClick:i(e.onClick,()=>a.onOpenChange(!1))})});he.displayName=H;var ge=`PopoverArrow`,_e=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=E(n);return(0,C.jsx)(y,{...i,...r,ref:t})});_e.displayName=ge;function U(e){return e?`open`:`closed`}var ve=O,ye=A,be=M,xe=I,Se=R;function Ce({...e}){return(0,C.jsx)(ie,{"data-slot":`dialog`,...e})}function we({...e}){return(0,C.jsx)(d,{"data-slot":`dialog-portal`,...e})}function Te({className:e,...t}){return(0,C.jsx)(ae,{"data-slot":`dialog-overlay`,className:r(`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 Ee({className:e,children:t,showCloseButton:n=!0,...i}){return(0,C.jsxs)(we,{"data-slot":`dialog-portal`,children:[(0,C.jsx)(Te,{}),(0,C.jsxs)(l,{"data-slot":`dialog-content`,className:r(`fixed top-[50%] left-[50%] z-50 grid w-full grid-cols-1 max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...i,children:[t,n&&(0,C.jsxs)(m,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 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-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,C.jsx)(x,{}),(0,C.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function De({className:e,...t}){return(0,C.jsx)(`div`,{"data-slot":`dialog-header`,className:r(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function Oe({className:e,showCloseButton:t=!1,children:n,...i}){return(0,C.jsxs)(`div`,{"data-slot":`dialog-footer`,className:r(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...i,children:[n,t&&(0,C.jsx)(m,{asChild:!0,children:(0,C.jsx)(oe,{variant:`outline`,children:`Close`})})]})}function ke({className:e,...t}){return(0,C.jsx)(g,{"data-slot":`dialog-title`,className:r(`text-lg leading-none font-semibold`,e),...t})}function Ae({className:e,...t}){return(0,C.jsx)(ne,{"data-slot":`dialog-description`,className:r(`text-sm text-muted-foreground`,e),...t})}function W(e=typeof navigator>`u`?``:navigator.platform){return/mac|iphone|ipad|ipod/i.test(e)}var G={Slash:`/`,Backslash:`\\`,Period:`.`,Comma:`,`,Semicolon:`;`,Quote:`'`,BracketLeft:`[`,BracketRight:`]`,Minus:`-`,Equal:`=`,Backquote:"`",Enter:`Enter`,Space:`Space`,Backspace:`Backspace`,Delete:`Delete`,Tab:`Tab`,Escape:`Escape`,ArrowUp:`Up`,ArrowDown:`Down`,ArrowLeft:`Left`,ArrowRight:`Right`};function je(e){let t=e.code??``;if(/^Key[A-Z]$/.test(t))return t.slice(3);if(/^Digit[0-9]$/.test(t))return t.slice(5);if(/^Numpad[0-9]$/.test(t))return t.slice(6);if(/^F([1-9]|1[0-2])$/.test(t))return t;if(t in G)return G[t];let n=e.key??``;return n.length===1&&n!==` `?n.toUpperCase():null}function Me(e,t=W()){if([`Meta`,`Control`,`Alt`,`Shift`,`OS`,`AltGraph`].includes(e.key)||!t&&e.getModifierState?.(`AltGraph`))return null;let n=je(e);if(!n)return null;let r=[];return(t?e.metaKey:e.ctrlKey)&&r.push(`Mod`),t&&e.ctrlKey&&r.push(`Ctrl`),e.altKey&&r.push(`Alt`),e.shiftKey&&r.push(`Shift`),r.push(n),r.join(`+`)}function K(e,t=W()){let n=e.split(`+`),r=n.at(-1)||`+`,i=n.slice(0,-1);if(t){let e={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Mod:`⌘`};return[`Ctrl`,`Alt`,`Shift`,`Mod`].filter(e=>i.includes(e)).map(t=>e[t]).join(``)+r}let a={Mod:`Ctrl`,Alt:`Alt`,Shift:`Shift`};return[...i.map(e=>a[e]??e),r].join(`+`)}function Ne(e=document){return e.querySelector(`[role="dialog"], [role="alertdialog"], [role="menu"]`)!==null}function Pe(e,t=W()){if(!e)return;let n=/^Mod\+([1-9])$/.exec(e);return n?n[1]:K(e,t)}var q=new Set("Mod+K.Mod+P.Mod+N.Mod+Enter.Mod+B.Alt+D.Mod+Shift+`.Alt+Up.Alt+Down.Alt+Shift+Up.Alt+Shift+Down.Mod+A.Mod+C.Mod+V.Mod+X.Mod+Z.Mod+Shift+Z.Mod+F.Mod+L.Mod+R.Mod+T.Mod+W.Mod+Q.Mod+Shift+T.Mod+Shift+N.Mod+Shift+W".split(`.`));function Fe(e,t=W()){if(!(t||[`Control`,`Alt`,`AltGraph`].includes(e.key))&&(e.getModifierState?.(`AltGraph`)||e.ctrlKey&&e.altKey))return`Ctrl+Alt — types characters on many layouts`}function Ie(e,t=W()){let n=e.split(`+`).slice(0,-1);if(!n.some(e=>e===`Mod`||e===`Ctrl`||e===`Alt`))return`Use ⌘/Ctrl, ⌃ or ⌥ with the key`;if(!t&&n.includes(`Mod`)&&n.includes(`Alt`))return`Ctrl+Alt types characters on many layouts`;if(q.has(e))return`That shortcut is taken by the browser or cezar`}var J={...Object.fromEntries(Array.from({length:9},(e,t)=>[`tab:${t+1}`,`Mod+${t+1}`])),"terminal-column":`Mod+/`},Le=200;function Re(e){if(typeof e!=`object`||!e||Array.isArray(e))return{};let t={};for(let[n,r]of Object.entries(e)){if(Object.keys(t).length>=Le)break;n.length<1||n.length>120||typeof r==`string`&&q.has(r)||(r===null||typeof r==`string`&&r.length>=1&&r.length<=40)&&(t[n]=r)}return t}function Y(e={}){let t=new Map;for(let[n,r]of Object.entries(J))n in e||t.set(n,r);for(let[n,r]of Object.entries(e))r&&t.set(n,r);let n=new Map;for(let[r,i]of t){let t=n.get(i);(t===void 0||r in e&&!(t in e))&&n.set(i,r)}return new Map([...t].filter(([e,t])=>n.get(t)===e))}function X(e,t,n){let r={...e};if(n)for(let[i,a]of Y(e))i!==t&&a===n&&(J[i]?r[i]=null:delete r[i]);return n===(J[t]??null)?delete r[t]:r[t]=n,r}function ze(e,t){return X(e,t,J[t]??null)}var Be=[{id:`reply`,label:`Write to the agent`,group:`Actions`},{id:`toggle-read`,label:`Mark read / unread`,group:`Actions`},{id:`pin`,label:`Pin / Unpin`,group:`Actions`},{id:`archive`,label:`Archive / Unarchive`,group:`Actions`},{id:`rename`,label:`Rename`,group:`Actions`},{id:`end-session`,label:`End session`,group:`Actions`},{id:`accept`,label:`Accept changes without a PR`,group:`Actions`},{id:`stop`,label:`Stop`,group:`Actions`},{id:`delete`,label:`Delete`,group:`Actions`},{id:`git:commit`,label:`Commit`,group:`Git`},{id:`git:commit-push`,label:`Commit and push`,group:`Git`},{id:`git:push`,label:`Push`,group:`Git`},{id:`git:create-pr`,label:`Create PR`,group:`Git`},{id:`git:create-draft-pr`,label:`Create draft PR`,group:`Git`},{id:`git:update-branch`,label:`Update branch`,group:`Git`},{id:`git:resolve-conflicts`,label:`Resolve conflicts`,group:`Git`},{id:`git:fix-checks`,label:`Fix errors`,group:`Git`},{id:`open-pr`,label:`Open pull request`,group:`Git`},...Array.from({length:9},(e,t)=>({id:`tab:${t+1}`,label:`Tab ${t+1}`,group:`Go to view`})),{id:`view:session`,label:`Chat`,group:`Go to view`},{id:`view:changes`,label:`Changes`,group:`Go to view`},{id:`view:commits`,label:`Commits`,group:`Go to view`},{id:`view:files`,label:`Files`,group:`Go to view`},{id:`view:graph`,label:`Graph`,group:`Go to view`},{id:`view:notes`,label:`Notes`,group:`Go to view`},{id:`view:browser`,label:`Preview`,group:`Go to view`},{id:`view:terminal`,label:`Terminal`,group:`Go to view`},{id:`full-view`,label:`Full view`,group:`Layout`},{id:`split`,label:`Split view`,group:`Layout`},{id:`terminal`,label:`Show / hide terminal`,group:`Layout`},{id:`terminal-column`,label:`Terminal in a column`,group:`Layout`},{id:`open:terminal-resume`,label:`Terminal (resume session)`,group:`Open in`},{id:`copy:link`,label:`Copy task link`,group:`Copy`},{id:`copy:branch`,label:`Copy branch name`,group:`Copy`},{id:`copy:path`,label:`Copy worktree path`,group:`Copy`},{id:`copy:resume`,label:`Copy resume command`,group:`Copy`},{id:`copy:pr`,label:`Copy pull request link`,group:`Copy`},{id:`copy:id`,label:`Copy task id`,group:`Copy`}];function Z(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable?!0:e.closest(`[contenteditable=""], [contenteditable="true"]`)!==null}function Ve(e){return e instanceof HTMLElement&&e.closest(`[cmdk-input]`)!==null}function He(e,t,{inEditable:n=!1}={}){if(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey||e.repeat)return!1;if(Z(e.target)&&!Ve(e.target)){if(!n)return!1;let t=W();if(e.target instanceof HTMLElement&&e.target.closest(`.xterm`))return t&&e.metaKey;if(t?!e.metaKey:!e.ctrlKey)return!1}return!0}function Ue(e,t,n={}){let r=S.useRef(t);S.useLayoutEffect(()=>{r.current=t});let i=n.inEditable===!0;S.useEffect(()=>{let t=t=>{He(t,e,{inEditable:i})&&(t.preventDefault(),r.current(t))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,i])}function We(e,t){return!(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.repeat||Z(e.target))}function Ge(e,t=typeof navigator>`u`?``:navigator.platform){let n=e.toUpperCase();return/mac|iphone|ipad|ipod/i.test(t)?`⌘${n}`:`Ctrl+${n}`}function Ke(e,t){let n=S.useRef(t);S.useLayoutEffect(()=>{n.current=t}),S.useEffect(()=>{let t=t=>{We(t,e)&&n.current(t)};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function Q(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function qe(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=Q(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(Q(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function Je(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:Q(e)}:{top:0,bottom:0}}function $(e,t=0){let n=typeof t==`number`?{top:t,right:t,bottom:t,left:t}:t;return{top:(n.top??0)+e.top,right:n.right??0,bottom:(n.bottom??0)+e.bottom,left:n.left??0}}function Ye(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(Je(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function Xe(){let[e,t]=(0,S.useState)({top:0,bottom:0});return(0,S.useEffect)(()=>Ye(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function Ze(e){let t=(0,S.useRef)(e);t.current=e,(0,S.useEffect)(()=>{let e=document.documentElement;return qe(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}var Qe=120;function $e(e,t,n){let r=new Map,i=()=>{let i=Math.max(r.get(e.innerWidth)??0,e.innerHeight);r.set(e.innerWidth,i);let a=e.visualViewport?e.innerHeight-e.visualViewport.height:0;n(Math.max(a,i-e.innerHeight)>=Qe&&Z(t.activeElement)&&(e.matchMedia?.(`(pointer: coarse)`).matches??!1))};i();let a=e.visualViewport;return e.addEventListener(`resize`,i),a?.addEventListener(`resize`,i),a?.addEventListener(`scroll`,i),t.addEventListener(`focusin`,i),t.addEventListener(`focusout`,i),()=>{e.removeEventListener(`resize`,i),a?.removeEventListener(`resize`,i),a?.removeEventListener(`scroll`,i),t.removeEventListener(`focusin`,i),t.removeEventListener(`focusout`,i)}}function et(){let[e,t]=(0,S.useState)(!1);return(0,S.useEffect)(()=>$e(window,document,t),[]),e}function tt({...e}){return(0,C.jsx)(ve,{"data-slot":`popover`,...e})}function nt({...e}){return(0,C.jsx)(be,{"data-slot":`popover-trigger`,...e})}function rt({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:i,...a}){let o=Xe();return(0,C.jsx)(xe,{children:(0,C.jsx)(Se,{"data-slot":`popover-content`,align:t,sideOffset:n,collisionPadding:$(o,i),className:r(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...a})})}function it({...e}){return(0,C.jsx)(ye,{"data-slot":`popover-anchor`,...e})}export{de as A,Pe as C,Oe as D,Ae as E,De as O,Ne as S,Ee as T,Y as _,Ze as a,ze as b,Z as c,Be as d,J as f,Ie as g,Me as h,nt as i,ke as k,Ue as l,X as m,it as n,et as o,Fe as p,rt as r,Ge as s,tt as t,Ke as u,K as v,Ce as w,Re as x,W as y};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Wa as r}from"./queries-DOHu2y2B.js";import{a as i,d as a,f as o,o as s,p as c,s as l}from"./toaster-DrFdGtNN.js";var u=e(t(),1),d=n(),f=/^\/p\/([^/]+)(?=\/|$)/;function p(e){let t=f.exec(e)?.[1];return t===void 0?null:decodeURIComponent(t)}function m(e){let t=f.exec(e);if(!t)return e;let n=e.slice(t[0].length);return n===``?`/`:n}function h(e,t){return!t.startsWith(`/`)||t===`/p`||t.startsWith(`/p/`)?t:`/p/${encodeURIComponent(e)}${t}`}function g(e,t){return e===null?t:typeof t==`string`?h(e,t):t.pathname===void 0?t:{...t,pathname:h(e,t.pathname)}}function _(){let{projectId:e}=r(),{pathname:t}=o();return e??p(t)}function v(){let e=_();return(0,u.useCallback)(t=>g(e,t),[e])}function y(e){let{pathname:t}=o();return(0,u.useMemo)(()=>a(e,m(t)),[e,t])}function b({to:e,...t}){let n=v();return(0,d.jsx)(i,{...t,to:n(e)})}function x({to:e,...t}){let n=v();return(0,d.jsx)(s,{...t,to:n(e)})}function S({to:e,...t}){let n=v();return(0,d.jsx)(l,{...t,to:n(e)})}function C(){let e=c(),t=v();return(0,u.useMemo)(()=>((n,r)=>typeof n==`number`?e(n):e(t(n),r)),[e,t])}export{g as a,C as c,p as i,y as l,x as n,m as o,S as r,_ as s,b as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Dt as r,Et as i,J as a,K as o,St as s,a as c,c as l,ct as u,d,f,i as p,it as m,l as h,o as g,q as _,s as v,wt as y,xt as b}from"./utils-Df_1kJEk.js";var x=/^[\w!#$%&'*.^`|~+-]+$/,ee=(e,t,n={})=>{if(!x.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},te=(e,t,n)=>(t=encodeURIComponent(t),ee(e,t,n)),ne=(e,t)=>(e=e.replace(/\/+$/,``),e+=`/`,t=t.replace(/^\/+/,``),e+t),re=(e,t)=>{for(let[n,r]of Object.entries(t)){let t=RegExp(`/:`+n+`(?:{[^/]+})?\\??`);e=e.replace(t,r?`/${r}`:``)}return e},ie=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},ae=(e,t)=>{switch(t){case`ws`:return e.replace(/^http/,`ws`);case`http`:return e.replace(/^ws/,`http`)}},oe=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,`/`):e.replace(/\/index(?=\?|$)/,``);function se(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ce(e,t){if(!se(e)&&!se(t))return t;let n={...e};for(let e in t){let r=t[e];se(n[e])&&se(r)?n[e]=ce(n[e],r):n[e]=r}return n}var le=(e,t)=>new Proxy(()=>{},{get(n,r){if(!(typeof r!=`string`||r===`then`))return le(e,[...t,r])},apply(n,r,i){return e({path:t,args:i})}}),ue=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(te(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=oe(a),a=re(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})}},de=(e,t)=>le(function n(r){let i=t?.buildSearchParams??ie,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=ne(e,a.join(`/`));if(s===`url`||s===`path`){let t=c;return r.args[0]&&(r.args[0].param&&(t=re(c,r.args[0].param)),r.args[0].query&&(t=t+`?`+i(r.args[0].query).toString())),t=oe(t),s===`url`?new URL(t):t.slice(e.replace(/\/+$/,``).length).replace(/^\/?/,`/`)}if(s===`ws`){let e=ae(r.args[0]&&r.args[0].param?re(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 ue(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=ce(t,e);return l.fetch(r.args[0],a)}return l},[]);function fe(e={}){let{baseUrl:t=``,token:n,headers:r,fetch:i}=e;return de(t,{headers:{...n?{Authorization:`Bearer ${n}`}:{},...r},...i?{fetch:i}:{}})}var S=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(){}},pe=new class extends S{#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`}},me={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},C=new class{#e=me;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 he(e){setTimeout(e,0)}var ge=typeof window>`u`||`Deno`in globalThis;function w(){}function _e(e,t){return typeof e==`function`?e(t):e}function ve(e){return typeof e==`number`&&e>=0&&e!==1/0}function ye(e,t){return Math.max(e+(t||0)-Date.now(),0)}function T(e,t){return typeof e==`function`?e(t):e}function E(e,t){return typeof e==`function`?e(t):e}function be(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Se(o,t.options))return!1}else if(!Ce(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 xe(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(D(t.options.mutationKey)!==D(a))return!1}else if(!Ce(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Se(e,t){return(t?.queryKeyHashFn||D)(e)}function D(e){return JSON.stringify(e,(e,t)=>De(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Ce(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Ce(e[n],t[n])):!1}var we=Object.prototype.hasOwnProperty;function Te(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Ee(e)&&Ee(t);if(!r&&!(De(e)&&De(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:we.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Te(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function O(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 Ee(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function De(e){if(!Oe(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Oe(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Oe(e){return Object.prototype.toString.call(e)===`[object Object]`}function ke(e){return new Promise(t=>{C.setTimeout(t,e)})}function Ae(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Te(e,t)}function je(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Me(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ne=Symbol();function Pe(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Ne?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Fe(e,t){return typeof e==`function`?e(...t):!!e}function Ie(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 k=(()=>{let e=()=>ge;return{isServer(){return e()},setIsServer(t){e=t}}})();function Le(){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 Re=he;function ze(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Re,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 A=ze(),Be=new class extends S{#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 Ve(e){return Math.min(1e3*2**e,3e4)}function He(e){return(e??`online`)!==`online`||Be.isOnline()}var Ue=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function We(e){let t=!1,n=0,r,i=Le(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Ue(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>pe.isFocused()&&(e.networkMode===`always`||Be.isOnline())&&e.canRun(),u=()=>He(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??(k.isServer()?0:3),o=e.retryDelay??Ve,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),ke(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 Ge=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ve(this.gcTime)&&(this.#e=C.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(k.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(C.clearTimeout(this.#e),this.#e=void 0)}};function Ke(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=>{Ie(e,()=>t.signal,()=>n=!0)},u=Pe(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?Me:je;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Je:qe,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:qe(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 qe(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 Je(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Ye(e,t){return t?qe(e,t)!=null:!1}function Xe(e,t){return!t||!e.getPreviousPageParam?!1:Je(e,t)!=null}var Ze=class extends Ge{#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=et(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=et(this.options);e.data!==void 0&&(this.setState($e(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Ae(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(w).catch(w):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=>E(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ne||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>T(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:!ye(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=Pe(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`?Ke(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=We({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ue&&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 Ue){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,...Qe(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...$e(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),A.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Qe(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:He(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function $e(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function et(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 j=class extends S{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=Le(),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),nt(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return rt(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return rt(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 E(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&&!O(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&it(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||E(this.options.enabled,this.#t)!==E(t.enabled,this.#t)||T(this.options.staleTime,this.#t)!==T(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||E(this.options.enabled,this.#t)!==E(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 ot(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(w)),t}#g(){this.#b();let e=T(this.options.staleTime,this.#t);if(k.isServer()||this.#r.isStale||!ve(e))return;let t=ye(this.#r.dataUpdatedAt,e)+1;this.#d=C.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,!(k.isServer()||E(this.options.enabled,this.#t)===!1||!ve(this.#p)||this.#p===0)&&(this.#f=C.setInterval(()=>{(this.options.refetchIntervalInBackground||pe.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(C.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(C.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&&nt(e,t),o=i&&it(e,n,t,r);(a||o)&&(l={...l,...Qe(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=Ae(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=Ae(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 g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,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:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:at(e,t),refetch:this.refetch,promise:this.#o,isEnabled:E(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=Le();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}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),!O(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){A.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function tt(e,t){return E(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&E(t.retryOnMount,e)===!1)}function nt(e,t){return tt(e,t)||e.state.data!==void 0&&rt(e,t,t.refetchOnMount)}function rt(e,t,n){if(E(t.enabled,e)!==!1&&T(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&at(e,t)}return!1}function it(e,t,n,r){return(e!==t||E(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&at(e,n)}function at(e,t){return E(t.enabled,e)!==!1&&e.isStaleByTime(T(t.staleTime,e))}function ot(e,t){return!O(e.getCurrentResult(),t)}var st=class extends j{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:Ye(t,n.data),hasPreviousPage:Xe(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},ct=class extends Ge{#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||lt(),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=We({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),A.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function lt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ut=class extends S{#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),O(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&D(t.mutationKey)!==D(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??lt();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){A.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 dt(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function ft(e,t,n){let r=e.slice(0);return r[t]=n,r}var pt=class extends S{#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,A.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||!O(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(dt(e,n).forEach(e=>{e.destroy()}),dt(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=Te(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 j(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=ft(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)&&A.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},M=e(t(),1),mt=n(),ht=M.createContext(void 0),N=e=>{let t=M.useContext(ht);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},gt=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,mt.jsx)(ht.Provider,{value:e,children:t})),_t=M.createContext(!1),vt=()=>M.useContext(_t);_t.Provider;function yt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var bt=M.createContext(yt()),xt=()=>M.useContext(bt),St=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Fe(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ct=e=>{M.useEffect(()=>{e.clearReset()},[e])},wt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Fe(n,[e.error,r])),Tt=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))}},Et=(e,t)=>e.isLoading&&e.isFetching&&!t,Dt=(e,t)=>e?.suspense&&t.isPending,Ot=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function kt({queries:e,...t},n){let r=N(n),i=vt(),a=xt(),o=M.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{Tt(e);let t=r.getQueryCache().get(e.queryHash);St(e,a,t)}),Ct(a);let[s]=M.useState(()=>new pt(r,o,t)),[c,l,u]=s.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;M.useSyncExternalStore(M.useCallback(e=>d?s.subscribe(A.batchCalls(e)):w,[s,d]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),M.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let f=c.some((e,t)=>Dt(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&Dt(n,e)?Ot(n,new j(r,n),a):[]}):[];if(f.length>0)throw Promise.all(f);let p=c.find((e,t)=>{let n=o[t];return n&&wt({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 At(e,t,n){let r=vt(),i=xt(),a=N(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,Tt(o),St(o,i,s),Ct(i);let l=!a.getQueryCache().get(o.queryHash),[u]=M.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(M.useSyncExternalStore(M.useCallback(e=>{let t=f?u.subscribe(A.batchCalls(e)):w;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),M.useEffect(()=>{u.setOptions(o)},[o,u]),Dt(o,d))throw Ot(o,u,i);if(wt({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&&!k.isServer()&&Et(d,r)&&(l?Ot(o,u,i):s?.promise)?.catch(w).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function P(e,t){return At(e,j,t)}function F(e,t){let n=N(t),[r]=M.useState(()=>new ut(n,e));M.useEffect(()=>{r.setOptions(e)},[r,e]);let i=M.useSyncExternalStore(M.useCallback(e=>r.subscribe(A.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=M.useCallback((e,t)=>{r.mutate(e,t).catch(w)},[r]);if(i.error&&Fe(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function jt(e,t){return At(e,st,t)}var Mt={projectId:null,apiBase:p},Nt=(0,M.createContext)(Mt);function Pt(){return(0,M.useContext)(Nt)}function Ft({projectId:e,children:t}){v()!==e&&d(e),(0,M.useLayoutEffect)(()=>{d(e)},[e]),(0,M.useLayoutEffect)(()=>()=>d(null),[]);let n=(0,M.useMemo)(()=>e===null?Mt:{projectId:e,apiBase:`${p}/p/${encodeURIComponent(e)}`},[e]);return(0,mt.jsx)(Nt.Provider,{value:n,children:t})}var It=[`claude`,`codex`,`junie`,`opencode`,`cursor`,`pi`,`copilot`,`antigravity`],Lt=new Set([`connected`,`disconnected`,`not-installed`,`unknown`]);function Rt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function zt(e,t){if(!Rt(e))return null;let{provider:n,status:r,enabled:i,hint:a,authFailureId:o}=e;return typeof n!=`string`||!It.includes(n)||typeof r!=`string`||!Lt.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 Bt(e){return zt(e,!1)}function Vt(e,t){if(!Rt(e)||!Array.isArray(e.providers))return null;let n=[],r=new Set;for(let i of e.providers){let e=zt(i,t);if(e===null||r.has(e.provider))return null;r.add(e.provider),n.push(e)}return n}function I(e){let t=Vt(e,!0);if(t===null||t.length===0)return null;let n=new Map(t.map(e=>[e.provider,e]));return It.flatMap(e=>{let t=n.get(e);return t?[t]:[]})}function Ht(e){let t=I(e);if(t===null)throw Error(`Invalid provider status response`);return{providers:t}}function Ut(e,t){let n=I(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 Wt(e,t,n,r){let i=I(e),a=I(t),o=I(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:Gt(t,n)?e:i?{...e,enabled:n.enabled}:n})}}function Gt(e,t){return e.provider===t.provider&&e.status===t.status&&e.enabled===t.enabled&&e.hint===t.hint&&e.authFailureId===t.authFailureId}var Kt=new Set([`junie`,`antigravity`]);function qt(e){return e.status===`connected`||e.status===`unknown`&&Kt.has(e.provider)}function Jt(e){let t=I(e);if(t===null)return[];let n=new Set(t.filter(e=>e.enabled&&qt(e)).map(e=>e.provider));return It.filter(e=>n.has(e))}function Yt(e,t){return I(e)?.find(e=>e.provider===t)}var Xt=`cezar:sid`,Zt;function Qt(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 $t(){try{let e=localStorage.getItem(Xt);if(e)return e;let t=Qt();return localStorage.setItem(Xt,t),t}catch{return Zt??=Qt()}}var en=`x-cezar-sid`;function tn(){Zt=void 0;try{localStorage.removeItem(Xt)}catch{}}function nn(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 rn=/\/(?:providers|agent-profiles)(?:\/|$)/;function an(e,t){if(!rn.test(e))return;let n=e.split(`/`),r=n[n.indexOf(`providers`)+1];if(n.includes(`providers`)&&o.safeParse(r).success)return r;if(typeof t==`string`)try{let e=JSON.parse(t).provider;return o.safeParse(e).success?e:void 0}catch{return}}var on=null;function sn(e,t,n,r,i){try{let a=new URL(e,window.location.origin).pathname,o=an(a,r),s=nn(i);on={method:(t??`GET`).toUpperCase(),path:a,status:n,at:Date.now(),...o?{provider:o}:{},...s?{cause:s}:{}}}catch{}}function cn(e=3e3,t=Date.now()){return on&&t-on.at<=e?on: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 ln(e){return typeof e==`string`?e:void 0}var un=`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=ln(i.error)??(e===413?un:`${e} ${t||`request failed`}`.trim()),o=e===409?f.safeParse(r):void 0;return new L(e,a,{...o?.success?{runIds:o.data.runIds}:{},manual:ln(i.manual),command:ln(i.command),exists:typeof i.exists==`boolean`?i.exists:void 0})}var B=fe({fetch:(e,t)=>hn(dn(String(e)),t)});function dn(e){let t=pn(e.endsWith(`?`)?e.slice(0,-1):e);return t.startsWith(`/`)?`${g()}${t}`:t}var fn=`${p}/p/default`;function pn(e){if(v()!==null||!e.startsWith(fn))return e;let t=e.slice(fn.length);return t===``||t.startsWith(`/`)||t.startsWith(`?`)?`${p}${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:(sn(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 mn(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 hn(e,t){try{let n=new Headers(t?.headers);n.set(en,$t());let r=await fetch(e,{...t,headers:n,credentials:`include`});return r.ok||sn(e,t?.method,r.status,t?.body),r}catch(n){throw n instanceof DOMException&&n.name===`AbortError`?n:(sn(e,t?.method,0,t?.body,n),new L(0,`cannot reach the cezar server (${e})`,{cause:n}))}}async function gn(e,t){return hn(c(e),t)}async function _n(e,t={}){let n=new Headers(t.headers);n.set(`accept`,`text/plain`);let r=await gn(e,{...t,headers:n}),i=await H(r);if(!r.ok)throw z(r.status,r.statusText,i);return i}var W=(e,t=``)=>`/runs/${encodeURIComponent(e)}${t}`;async function vn(e){return U(await B.api.v1.health.$get({},V(e)),`/health`)}async function yn(e){return U(await B.api.v1[`star-count`].$get({},V(e)),`/star-count`)}async function bn(e){return U(await B.api.v1.preview[`design-proxy`].$post({json:e}),`/preview/design-proxy`)}async function xn(e){return U(await B.api.v1.telemetry.consent.$get({},V(e)),`/telemetry/consent`)}async function Sn(e){return U(await B.api.v1.telemetry.consent.$put({json:e}),`/telemetry/consent`)}async function Cn(e,t){return U(await B.api.v1.models.$get({query:{runner:e}},V(t)),`/models`)}async function wn(e=!1,t){return Ht(await U(await B.api.v1.providers.status.$get({query:e?{refresh:`1`}:{}},V(t)),`/providers/status`))}async function Tn(e){return U(await B.api.v1.p[`:projectId`][`launch-key`].$get({param:{projectId:l()}},V(e)),`/launch-key`)}async function En(e){return U(await B.api.v1.projects.$get({},V(e)),`/projects`)}async function Dn(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 On(e){return U(await B.api.v1.fs.repos.$get({},V(e)),`/fs/repos`)}async function kn(e){return U(await B.api.v1.projects[`:projectId`][`git-init`].$post({param:{projectId:encodeURIComponent(e)}}),`/projects/${encodeURIComponent(e)}/git-init`)}async function An(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 jn(){return U(await B.api.v1.github.login.$post(),`/github/login`)}async function Mn(e){return U(await B.api.v1.github.login.$get({},V(e)),`/github/login`)}async function Nn(){return U(await B.api.v1.github.login.$delete(),`/github/login`)}async function Pn(e){return U(await B.api.v1.providers.setup.$get({},V(e)),`/providers/setup`)}async function Fn(e,t){return U(await B.api.v1.providers.setup.sessions.$post({json:{provider:e,action:t}}),`/providers/setup/sessions`)}async function In(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 Ln(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 Rn(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 zn(e){await U(await B.api.v1.providers.setup.sessions[`:sessionId`].$delete({param:{sessionId:e}}),`/providers/setup/sessions/${e}`)}async function Bn(e){return U(await B.api.v1.p[`:projectId`].runs.$get({param:{projectId:l()},query:{}},V(e)),`/runs`)}async function Vn(e,t){return U(await B.api.v1.p[`:projectId`].runs.$get({param:{projectId:e},query:{}},V(t)),`/runs`)}async function Hn(e){return U(await B.api.v1.workspace[`runs-index`].$get({},V(e)),`/workspace/runs-index`)}async function Un(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].$get({param:{projectId:l(),id:encodeURIComponent(e)}},V(t)),W(e))}async function Wn(e,t,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`].$get({param:{projectId:e,id:encodeURIComponent(t)}},V(n)),W(t))}async function Gn(e,t,n){return mn(await B.api.v1.p[`:projectId`].runs[`:id`].history.$get({param:{projectId:l(),id:encodeURIComponent(e)},query:{...t===void 0?{}:{cursor:t}}},V(n)),`${W(e)}/history`,r)}async function Kn(e,t){return mn(await B.api.v1.p[`:projectId`].runs[`:id`][`history-context`].$get({param:{projectId:l(),id:encodeURIComponent(e)}},V(t)),`${W(e)}/history-context`,i)}async function qn(e){return U(await B.api.v1.p[`:projectId`][`ui-state`].$get({param:{projectId:l()}},V(e)),`/ui-state`)}async function Jn(e){return U(await B.api.v1.p[`:projectId`].workflows.$get({param:{projectId:l()}},V(e)),`/workflows`)}async function Yn(e){return U(await B.api.v1.p[`:projectId`].skills.$get({param:{projectId:l()},query:{}},V(e)),`/skills`)}async function Xn(e){return U(await B.api.v1.p[`:projectId`].skills.$get({param:{projectId:l()},query:{wait:`1`}},V(e)),`/skills`)}async function Zn(){return U(await B.api.v1.p[`:projectId`].skills.refresh.$post({param:{projectId:l()}}),`/skills/refresh`)}async function Qn(e){return U(await B.api.v1.p[`:projectId`].skills.importable.$get({param:{projectId:l()},query:{}},V(e)),`/skills/importable`)}async function $n(e){return U(await B.api.v1.p[`:projectId`].skills.importable.$get({param:{projectId:l()},query:{wait:`1`}},V(e)),`/skills/importable`)}async function er(e){return U(await B.api.v1.p[`:projectId`].todos.$get({param:{projectId:l()}},V(e)),`/todos`)}async function tr(e){return U(await B.api.v1.p[`:projectId`].repo.$get({param:{projectId:l()}},V(e)),`/repo`)}async function nr(e){return U(await B.api.v1.p[`:projectId`].config.$get({param:{projectId:l()}},V(e)),`/config`)}async function rr(e={}){return U(await B.api.v1.p[`:projectId`][`agent-config`].$get({param:{projectId:l()}},V(e)),`/agent-config`)}async function ir(e,t={}){return U(await B.api.v1.p[`:projectId`][`agent-config`][`:id`].$get({param:{projectId:l(),id:encodeURIComponent(e)}},V(t)),`/agent-config/${encodeURIComponent(e)}`)}async function ar(e,t){return U(await B.api.v1.p[`:projectId`][`agent-config`][`:id`].$put({param:{projectId:l(),id:encodeURIComponent(e)},json:t}),`/agent-config/${encodeURIComponent(e)}`)}async function or(e){return U(await B.api.v1.p[`:projectId`].repo.changes.$get({param:{projectId:l()}},V(e)),`/repo/changes`)}async function sr(e){return U(await B.api.v1.p[`:projectId`].repo.tree.$get({param:{projectId:l()}},V(e)),`/repo/tree`)}async function cr(e,t){return U(await B.api.v1.p[`:projectId`].repo.files.$get({param:{projectId:l()},query:{path:e}},V(t)),`/repo/files`)}function lr(e){return c(`/repo/files?path=${encodeURIComponent(e)}&raw=1`)}async function ur(e,t){return U(await B.api.v1.p[`:projectId`].repo.commit[`:sha`].$get({param:{projectId:l(),sha:encodeURIComponent(e)},query:{structured:`1`}},V(t)),`/repo/commit/:sha`)}async function dr(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].tree.$get({param:{projectId:l(),id:encodeURIComponent(e)}},V(t)),W(e,`/tree`))}async function fr(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].commits.$get({param:{projectId:l(),id:encodeURIComponent(e)}},V(t)),W(e,`/commits`))}async function pr(e,t,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`].commit[`:sha`].$get({param:{projectId:l(),id:encodeURIComponent(e),sha:encodeURIComponent(t)}},V(n)),W(e,`/commit/${encodeURIComponent(t)}`))}async function mr(e={},t){return U(await B.api.v1.p[`:projectId`].github.$get({param:{projectId:l()},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 hr(e={},t){return U(await B.api.v1.p[`:projectId`].tracker[`automation-options`].$get({param:{projectId:l()},query:e},V(t)),`/tracker/automation-options`)}async function gr(e){return U(await B.api.v1.p[`:projectId`].tracker.connection.$get({param:{projectId:l()}},V(e)),`/tracker/connection`)}async function _r(e){return U(await B.api.v1.p[`:projectId`].tracker.connection.$put({param:{projectId:l()},json:e}),`/tracker/connection`)}async function vr(){return U(await B.api.v1.p[`:projectId`].tracker.connection.$delete({param:{projectId:l()}}),`/tracker/connection`)}async function yr(e){return U(await B.api.v1.p[`:projectId`].secrets.$get({param:{projectId:l()}},V(e)),`/secrets`)}async function br(e){return U(await B.api.v1.workspace.secrets.$get({},V(e)),`/workspace/secrets`)}async function G(e){if(!e.ok)throw z(e.status,e.statusText,await H(e))}async function xr(e,t){await G(await B.api.v1.p[`:projectId`].secrets[`:name`].$put({param:{projectId:l(),name:e},json:t}))}async function Sr(e){await G(await B.api.v1.p[`:projectId`].secrets[`:name`].$delete({param:{projectId:l(),name:e}}))}async function Cr(e,t){await G(await B.api.v1.workspace.secrets[`:name`].$put({param:{name:e},json:t}))}async function wr(e){await G(await B.api.v1.workspace.secrets[`:name`].$delete({param:{name:e}}))}async function Tr(e){return U(await B.api.v1.p[`:projectId`].e2e.$get({param:{projectId:l()}},V(e)),`/e2e`)}async function Er(e){return U(await B.api.v1.p[`:projectId`].e2e.setup.$post({param:{projectId:l()},json:e}),`/e2e/setup`)}async function Dr(e){return U(await B.api.v1.p[`:projectId`].tracker.association.$get({param:{projectId:l()}},V(e)),`/tracker/association`)}async function Or(e,t={},n){return U(await B.api.v1.p[`:projectId`].tracker.candidates.$get({param:{projectId:l()},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 kr(e){return U(await B.api.v1.p[`:projectId`].tracker.association.$put({param:{projectId:l()},json:e}),`/tracker/association`)}async function Ar(){return U(await B.api.v1.p[`:projectId`].tracker.association.$delete({param:{projectId:l()}}),`/tracker/association`)}function jr(e){return{expectedScope:e.association?b(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 Mr(e={},t){return U(await B.api.v1.p[`:projectId`].tracker.$get({param:{projectId:l()},query:jr(e)},V(t)),`/tracker`)}async function Nr(e,t={},n){return U(await B.api.v1.p[`:projectId`].tracker.search.$get({param:{projectId:l()},query:{...jr(t),q:e}},V(n)),`/tracker/search`)}async function Pr(e,t){return U(await B.api.v1.p[`:projectId`].tracker[`:id`].$get({param:{projectId:l(),id:encodeURIComponent(e)},query:{expectedScope:t?.association?b(t.association):void 0}},V(t)),`/tracker/${encodeURIComponent(e)}`)}async function Fr(e,t){return U(await B.api.v1.p[`:projectId`].github.checks.$get({param:{projectId:l()},query:{prs:e.join(`,`)}},V(t)),`/github/checks`)}async function Ir(e,t,n={},r){return U(await B.api.v1.p[`:projectId`].github.search.$get({param:{projectId:l()},query:{kind:e,q:t,limit:n.limit}},V(r)),`/github/search`)}async function Lr(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 Rr(e,t,n={},r){return U(await B.api.v1.p[`:projectId`].github.comments[`:kind`][`:number`].$get({param:{projectId:l(),kind:e,number:String(t)},query:{refresh:n.refresh?`1`:void 0}},V(r)),`/github/comments/${e}/${t}`)}async function zr(e,t={},n){return U(await B.api.v1.p[`:projectId`].github.prs[`:number`][`merge-state`].$get({param:{projectId:l(),number:String(e)},query:{refresh:t.refresh?`1`:void 0}},V(n)),`/github/prs/${e}/merge-state`)}async function Br(e,t){return U(await B.api.v1.p[`:projectId`].github.prs[`:number`].merge.$post({param:{projectId:l(),number:String(e)},json:t}),`/github/prs/:number/merge`)}async function Vr(e,t={},n){return U(await B.api.v1.p[`:projectId`].github.prs[`:number`].changes.$get({param:{projectId:l(),number:String(e)},query:{refresh:t.refresh?`1`:void 0}},V(n)),`/github/prs/${e}/changes`)}function Hr(e,t){return _n(W(e,`/diff`),{method:`GET`,signal:t?.signal})}function Ur(e,t){return _n(W(e,`/handoff`),{method:`GET`,signal:t?.signal})}async function Wr(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].changes.$get({param:{projectId:l(),id:encodeURIComponent(e)}},V(t)),W(e,`/changes`))}async function Gr(e,t,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`].files.$get({param:{projectId:l(),id:encodeURIComponent(e)},query:{path:t}},V(n)),`/runs/:id/files`)}function Kr(e,t,n){let r=n?`&rev=${encodeURIComponent(n)}`:``;return c(W(e,`/files?path=${encodeURIComponent(t)}&raw=1${r}`))}async function qr(e,t){return U(await B.api.v1.p[`:projectId`].groups[`:groupId`].$get({param:{projectId:l(),groupId:encodeURIComponent(e)}},V(t)),`/groups/${encodeURIComponent(e)}`)}async function Jr(e,t){return U(await B.api.v1.providers.connect.$post({json:{provider:e,...t?{profileId:t}:{}}}),`/providers/connect`)}async function Yr(e){return U(await B.api.v1.providers[`:provider`].update.$post({param:{provider:e}}),`/providers/${encodeURIComponent(e)}/update`)}async function Xr(e,t){return Ht(await U(await B.api.v1.providers[`:provider`].enabled.$put({param:{provider:e},json:{enabled:t}}),`/providers/${encodeURIComponent(e)}/enabled`))}async function Zr(e,t){return Ht(await U(await B.api.v1.providers[`:provider`].retry.$post({param:{provider:e},json:{authFailureId:t}}),`/providers/${encodeURIComponent(e)}/retry`))}async function Qr(e){let t=`/projects`,n=await gn(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 $r(e){return U(await B.api.v1.projects.checkout.$post({json:e}),`/projects/checkout`)}async function ei(e){return U(await B.api.v1.projects.create.$post({json:e}),`/projects/create`)}async function ti(e){return mn(await B.api.v1.projects[`github-owners`].$get({},V(e)),`/projects/github-owners`,m)}async function ni(e){return U(await B.api.v1.projects[`:projectId`].$delete({param:{projectId:encodeURIComponent(e)}}),`/projects/${encodeURIComponent(e)}`)}async function ri(e,t){return U(await B.api.v1.projects[`:projectId`].$patch({param:{projectId:encodeURIComponent(e)},json:t}),`/projects/${encodeURIComponent(e)}`)}async function ii(e){return U(await B.api.v1.p[`:projectId`].runs.$post({param:{projectId:l()},json:e}),`/runs`)}async function ai(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].cancel.$post({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e,`/cancel`))}async function oi(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].promote.$post({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e,`/promote`))}async function si(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`][`start-now`].$post({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e,`/start-now`))}async function ci(e,t=!0,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`].archive.$post({param:{projectId:l(),id:encodeURIComponent(e)},json:{archived:t,...n?{surface:n}:{}}}),W(e,`/archive`))}async function li(e,t=!0,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`].pin.$post({param:{projectId:l(),id:encodeURIComponent(e)},json:{pinned:t,...n?{surface:n}:{}}}),W(e,`/pin`))}async function ui(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}:{}}}),W(t,`/pin`))}async function di(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}:{}}}),W(t,`/archive`))}async function fi(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)}})),W(t,`/${r}`))}async function pi(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`][`auto-resume`].$delete({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e,`/auto-resume`))}async function mi(){return U(await B.api.v1.p[`:projectId`].runs[`archive-finished`].$post({param:{projectId:l()}}),`/runs/archive-finished`)}async function hi(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].read.$post({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e,`/read`))}async function gi(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].unread.$post({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e,`/unread`))}async function _i(){return U(await B.api.v1.p[`:projectId`].runs[`read-all`].$post({param:{projectId:l()}}),`/runs/read-all`)}async function vi(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].land.$post({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e,`/land`))}async function yi(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].finish.$post({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e,`/finish`))}async function bi(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.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:l(),id:encodeURIComponent(e)},json:n}),W(e,`/continue`))}async function xi(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}}}),W(t,`/continue`))}var Si=1e3;async function Ci(e,t={}){let n=l(),r=async()=>U(await B.api.v1.p[`:projectId`].runs[`:id`].pr.$post({param:{projectId:n,id:encodeURIComponent(e)},json:t}),W(e,`/pr`));try{return await r()}catch(e){if(!(e instanceof L)||e.status!==0)throw e;await new Promise(e=>setTimeout(e,Si));try{return await r()}catch(t){throw t instanceof L&&t.status===0?e:t}}}async function wi(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].pr.adopt.$post({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e,`/pr/adopt`))}async function Ti(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].$patch({param:{projectId:l(),id:encodeURIComponent(e)},json:t}),W(e))}async function Ei(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].$delete({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e))}async function Di(e){return U(await B.api.v1.p[`:projectId`].todos[`:id`].$delete({param:{projectId:l(),id:encodeURIComponent(e)}}),`/todos/${encodeURIComponent(e)}`)}async function Oi(e,t={}){let n={...t.runner===void 0?{}:{runner:t.runner},...t.model===void 0?{}:{model:t.model},...t.prompt===void 0?{}:{prompt:t.prompt}};return U(await B.api.v1.p[`:projectId`].todos[`:id`].start.$post({param:{projectId:l(),id:encodeURIComponent(e)},json:Object.keys(n).length>0?n:void 0}),`/todos/${encodeURIComponent(e)}/start`)}async function ki(e,t){return U(await B.api.v1.p[`:projectId`].groups[`:groupId`].pick.$post({param:{projectId:l(),groupId:encodeURIComponent(e)},json:{runId:t}}),`/groups/${encodeURIComponent(e)}/pick`)}async function Ai(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`][`open-in-cli`].$post({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e,`/open-in-cli`))}async function ji(e){return U(await B.api.v1.p[`:projectId`][`open-targets`].$get({param:{projectId:l()}},V(e)),`/open-targets`)}async function Mi(e){return U(await B.api.v1.p[`:projectId`][`open-in`].$post({param:{projectId:l()},json:{target:e}}),`/open-in`)}async function Ni(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`][`open-in`].$post({param:{projectId:l(),id:encodeURIComponent(e)},json:{target:t}}),W(e,`/open-in`))}async function Pi(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`][`open-in`].$post({param:{projectId:l(),id:encodeURIComponent(e)},json:{target:`default`,path:t}}),W(e,`/open-in`))}async function Fi(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].git.commit.$post({param:{projectId:l(),id:encodeURIComponent(e)},json:{message:t}}),W(e,`/git/commit`))}async function Ii(e,t,n=l()){return U(await B.api.v1.p[`:projectId`].runs[`:id`].git.status.$get({param:{projectId:n,id:encodeURIComponent(e)}},V(t)),W(e,`/git/status`))}async function Li(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].git.push.$post({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e,`/git/push`))}var Ri=[250,750,1500],zi=e=>new Promise(t=>setTimeout(t,e));async function Bi(e,t,n=zi){let r={text:t.text??``,images:t.images??[],idempotencyKey:t.idempotencyKey??Qt()};for(let t=0;;t+=1)try{return await e(r)}catch(e){let r=Ri[t];if(!(e instanceof L)||e.status!==0||r===void 0)throw e;await n(r)}}async function Vi(e,t){return Bi(async t=>U(await B.api.v1.p[`:projectId`].runs[`:id`].messages.$post({param:{projectId:l(),id:encodeURIComponent(e)},json:t}),W(e,`/messages`)),t)}async function Hi(e,t,n){return Bi(async n=>U(await B.api.v1.p[`:projectId`].runs[`:id`].messages.$post({param:{projectId:e,id:encodeURIComponent(t)},json:n}),W(t,`/messages`)),n)}async function Ui(e,t,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`][`queued-messages`][`:msgId`].$patch({param:{projectId:l(),id:encodeURIComponent(e),msgId:encodeURIComponent(t)},json:n}),W(e,`/queued-messages/${encodeURIComponent(t)}`))}async function Wi(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`][`queued-messages`][`:msgId`].$delete({param:{projectId:l(),id:encodeURIComponent(e),msgId:encodeURIComponent(t)}}),W(e,`/queued-messages/${encodeURIComponent(t)}`))}async function Gi(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].drafts.$get({param:{projectId:l(),id:encodeURIComponent(e)}},V(t)),W(e,`/drafts`))}var Ki=56*1024;async function qi(e,t,n,r){let i=r?.keepalive===!0&&new TextEncoder().encode(JSON.stringify(n)).length<=Ki;return U(await B.api.v1.p[`:projectId`].runs[`:id`].drafts[`:surface`].$put({param:{projectId:l(),id:encodeURIComponent(e),surface:t},json:n},{init:{keepalive:i}}),W(e,`/drafts/${t}`))}async function Ji(e,t,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`].drafts[`:surface`].images.$post({param:{projectId:l(),id:encodeURIComponent(e),surface:t},json:n}),W(e,`/drafts/${t}/images`))}async function Yi(e){return U(await B.api.v1.workspace.uploads.$post({json:e}),`/workspace/uploads`)}async function Xi(e){return U(await B.api.v1.workspace.uploads[`:uploadId`].$delete({param:{uploadId:e}}),`/workspace/uploads/${e}`)}async function Zi(e,t,n,r){return U(await B.api.v1.p[`:projectId`].runs[`:id`].drafts[`:surface`].images[`:imageId`].$get({param:{projectId:l(),id:encodeURIComponent(e),surface:t,imageId:n}},V(r)),W(e,`/drafts/${t}/images/${n}`))}async function Qi(e,t,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`].drafts[`:surface`].images[`:imageId`].$delete({param:{projectId:l(),id:encodeURIComponent(e),surface:t,imageId:n}}),W(e,`/drafts/${t}/images/${n}`))}async function $i(e){return U(await B.api.v1.p[`:projectId`].repo.branch.$post({param:{projectId:l()},json:e}),`/repo/branch`)}async function ea(e){return U(await B.api.v1.p[`:projectId`].repo.sync.$get({param:{projectId:l()}},V(e)),`/repo/sync`)}async function ta(e){let t={param:{projectId:l()}},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 na(e){return U(await B.api.v1.p[`:projectId`].plan.$post({param:{projectId:l()},json:{task:e}}),`/plan`)}async function ra(e){return U(await B.api.v1.p[`:projectId`].automations.$get({param:{projectId:l()}},V(e)),`/automations`)}async function ia(e){return U(await B.api.v1.p[`:projectId`].automations.$post({param:{projectId:l()},json:e}),`/automations`)}async function aa(e,t){return U(await B.api.v1.p[`:projectId`].automations[`:id`].$put({param:{projectId:l(),id:encodeURIComponent(e)},json:t}),`/automations/${encodeURIComponent(e)}`)}async function oa(e,t){let n={projectId:l(),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 sa(e,t){return U(await B.api.v1.p[`:projectId`].automations[`:id`].check.$post({param:{projectId:l(),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:l()},query:{automationId:e}},V(t)),`/automation-log?automationId=${encodeURIComponent(e)}`)}async function la(e){return U(await B.api.v1.p[`:projectId`][`automation-log`][`:receiptId`].retry.$post({param:{projectId:l(),receiptId:encodeURIComponent(e)}}),`/automation-log/${encodeURIComponent(e)}/retry`)}async function ua(e,t){return U(await B.api.v1.p[`:projectId`].automations[`:id`].run.$post({param:{projectId:l(),id:encodeURIComponent(e)},query:t?{expectedRevision:String(t)}:{}}),`/automations/${encodeURIComponent(e)}/run`)}async function da(e,t){let n=await B.api.v1.p[`:projectId`].automations[`:id`].$delete({param:{projectId:l(),id:encodeURIComponent(e)},query:t?{expectedRevision:String(t)}:{}});if(!n.ok)throw z(n.status,n.statusText,await H(n))}async function fa(e,t){return U(await B.api.v1.workspace[`automation-templates`].$get({query:e?{exclude:e}:{}},V(t)),`/workspace/automation-templates`)}async function pa(e){return U(await B.api.v1.p[`:projectId`].workflows.$post({param:{projectId:l()},json:e}),`/workflows`)}async function ma(e){return U(await B.api.v1.p[`:projectId`].workflows.nodes.$get({param:{projectId:l()}},V(e)),`/workflows/nodes`)}async function ha(e){return U(await B.api.v1.p[`:projectId`].workflows.validate.$post({param:{projectId:l()},json:{graph:e}}),`/workflows/validate`)}async function ga(e){return U(await B.api.v1.p[`:projectId`].workflows.graph.$post({param:{projectId:l()},json:e}),`/workflows/graph`)}async function _a(e){return U(await B.api.v1.p[`:projectId`].workflows.parse.$post({param:{projectId:l()},json:{yaml:e}}),`/workflows/parse`)}async function va(e){return U(await B.api.v1.p[`:projectId`].workflows[`:name`].$delete({param:{projectId:l(),name:encodeURIComponent(e)}}),`/workflows/${encodeURIComponent(e)}`)}async function ya(e,t=l()){return U(await B.api.v1.p[`:projectId`][`ui-state`].$put({param:{projectId:t},json:e}),`/ui-state`)}async function ba(e){return U(await B.api.v1.workspace[`ui-state`].$get({},V(e)),`/workspace/ui-state`)}async function xa(e,t={}){return U(await B.api.v1.workspace[`ui-state`].$put({json:e},{init:{keepalive:t.keepalive}}),`/workspace/ui-state`)}async function Sa(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?h(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 Ca(e){let t=new FormData;t.set(`file`,e);let n=await gn(`/workspace/branding-logo`,{method:`POST`,body:t}),r=await H(n);if(!n.ok)throw z(n.status,n.statusText,r);let i=R(r),o=a.safeParse(i);if(!o.success)throw new L(n.status,`the cezar server answered /workspace/branding-logo with an unexpected body`);return o.data.logoUrl?h(o.data.logoUrl):null}async function wa(){let e=await gn(`/workspace/branding-logo`,{method:`DELETE`}),t=await H(e);if(!e.ok)throw z(e.status,e.statusText,t);let n=a.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?h(n.data.logoUrl):null}async function Ta(e){return U(await B.api.v1.workspace[`host-usage`].$get({},V(e)),`/workspace/host-usage`)}async function Ea(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 Da(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 Oa(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 ka(e){return U(await B.api.v1.workspace[`agent-profiles`].$post({json:e}),`/workspace/agent-profiles`)}async function Aa(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 ja(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 Ma(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 Na(e){return U(await B.api.v1.workspace[`agent-profiles`].selection.$put({json:e}),`/workspace/agent-profiles/selection`)}async function Pa(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 Fa(e){return U(await B.api.v1.workspace[`agent-profiles`][`:id`].$delete({param:{id:encodeURIComponent(e)}}),`/workspace/agent-profiles/${encodeURIComponent(e)}`)}async function Ia(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 La(e){return U(await B.api.v1.workspace[`skills-update`].check.$post({json:{projectId:e}}),`/workspace/skills-update/check`)}async function Ra(e){return U(await B.api.v1.workspace[`skills-update`].apply.$post({json:{projectId:e}}),`/workspace/skills-update/apply`)}async function za(e){return U(await B.api.v1.workspace[`self-update`].$get({},V(e)),`/workspace/self-update`)}async function Ba(){return U(await B.api.v1.workspace[`self-update`].refresh.$post({}),`/workspace/self-update/refresh`)}async function Va(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 Ha(e){return U(await B.api.v1.workspace[`self-update`].channel.$put({json:{channel:e}}),`/workspace/self-update/channel`)}async function Ua(e){return U(await B.api.v1.workspace[`self-update`].apply.$post({json:{version:e}}),`/workspace/self-update/apply`)}async function Wa(e){return U(await B.api.v1.workspace[`self-update`].apply.$post({json:{version:e,whenIdle:!0}}),`/workspace/self-update/apply`)}async function Ga(){return U(await B.api.v1.workspace[`self-update`].scheduled.$delete({}),`/workspace/self-update/scheduled`)}async function Ka(e){let t=await U(await B.api.v1.workspace.config.$put({json:e}),`/workspace/config`);return{...t,orgSkillsRepos:t.orgSkillsRepos??[]}}async function qa(e){return U(await B.api.v1.p[`:projectId`].config.$put({param:{projectId:l()},json:e}),`/config`)}async function Ja(e){return U(await B.api.v1.p[`:projectId`].worktrees.$get({param:{projectId:l()}},V(e)),`/worktrees`)}async function Ya(){return U(await B.api.v1.p[`:projectId`].worktrees.reclaim.$post({param:{projectId:l()},json:{}}),`/worktrees/reclaim`)}async function Xa(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`][`remove-worktree`].$post({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e,`/remove-worktree`))}async function Za(e,t,n){return s.parse(await U(await B.api.v1.p[`:projectId`].tracker.watch.$post({param:{projectId:e},json:t},{init:{signal:n}}),`/tracker/watch`))}async function Qa(e,t,n,r){return y.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 $a(e,t,n){return y.parse(await U(await B.api.v1.p[`:projectId`].tracker.watch[`:watchId`].$post({param:{projectId:e,watchId:t}},{init:{signal:n}}),`/tracker/watch`))}var eo={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 to(e={limit:50},t){return U(await B.api.v1.p[`:projectId`][`worktree-lifecycle`].$get({param:{projectId:l()},query:{cursor:e.cursor,limit:e.limit,attentionOnly:e.attentionOnly===void 0?void 0:e.attentionOnly?`true`:`false`}},V(t)),`/worktree-lifecycle`)}async function no(e,t){return U(await B.api.v1.p[`:projectId`][`worktree-lifecycle`][`:worktreeId`].$get({param:{projectId:l(),worktreeId:e}},V(t)),`/worktree-lifecycle`)}async function ro(e,t){return U(await B.api.v1.p[`:projectId`][`worktree-lifecycle`].operations[`:operationId`].$get({param:{projectId:l(),operationId:e}},V(t)),`/worktree-lifecycle/operations`)}async function io(e,t=0,n){return U(await B.api.v1.p[`:projectId`][`worktree-lifecycle`].operations[`:operationId`].output.$get({param:{projectId:l(),operationId:e},query:{afterSeq:t,limit:100}},V(n)),`/worktree-lifecycle/operations/output`)}async function ao(e,t=l()){return U(await B.api.v1.p[`:projectId`][`worktree-lifecycle`].operations.$post({param:{projectId:t},json:e}),`/worktree-lifecycle/operations`)}async function oo(e,t){return U(await B.api.v1.p[`:projectId`][`worktree-lifecycle`].operations[`:operationId`].actions.$post({param:{projectId:l(),operationId:e},json:t}),`/worktree-lifecycle/operations/actions`)}async function so(e){return U(await B.api.v1.p[`:projectId`][`worktree-lifecycle`].preview.$post({param:{projectId:l()},json:e}),`/worktree-lifecycle/preview`)}async function co(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].terminal.$get({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e,`/terminal`))}async function lo(e,t){return U(await B.api.v1.p[`:projectId`].runs[`:id`].terminal.$post({param:{projectId:l(),id:encodeURIComponent(e)},json:t}),W(e,`/terminal`))}async function uo(e,t,n){return U(await B.api.v1.p[`:projectId`].runs[`:id`].terminal[`:sessionId`].output.$get({param:{projectId:l(),id:encodeURIComponent(e),sessionId:t},query:{cursor:String(n)}}),W(e,`/terminal/${t}/output`))}async function fo(e,t,n){await U(await B.api.v1.p[`:projectId`].runs[`:id`].terminal[`:sessionId`].input.$post({param:{projectId:l(),id:encodeURIComponent(e),sessionId:t},json:{data:n}}),W(e,`/terminal/${t}/input`))}async function po(e,t,n,r){await U(await B.api.v1.p[`:projectId`].runs[`:id`].terminal[`:sessionId`].resize.$post({param:{projectId:l(),id:encodeURIComponent(e),sessionId:t},json:{cols:n,rows:r}}),W(e,`/terminal/${t}/resize`))}async function mo(e,t){await U(await B.api.v1.p[`:projectId`].runs[`:id`].terminal[`:sessionId`].$delete({param:{projectId:l(),id:encodeURIComponent(e),sessionId:t}}),W(e,`/terminal/${t}`))}async function ho(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].terminal.urls.$get({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e,`/terminal/urls`))}async function go(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].terminal.commands.$get({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e,`/terminal/commands`))}async function _o(){return U(await B.api.v1.p[`:projectId`][`start-app`].$get({param:{projectId:l()}}),`/start-app`)}async function vo(e){return U(await B.api.v1.p[`:projectId`][`start-app`].$put({param:{projectId:l()},json:e}),`/start-app`)}async function yo(e){return U(await B.api.v1.p[`:projectId`].runs[`:id`].layouts.$get({param:{projectId:l(),id:encodeURIComponent(e)}}),W(e,`/layouts`))}async function bo(e,t,n){let r=n?.keepalive===!0&&new TextEncoder().encode(JSON.stringify(t)).length<=Ki;return U(await B.api.v1.p[`:projectId`].runs[`:id`].layouts.$put({param:{projectId:l(),id:encodeURIComponent(e)},json:t},{init:{keepalive:r}}),W(e,`/layouts`))}async function xo(e){return U(await B.api.v1.p[`:projectId`][`deferred-start`].preview.$post({param:{projectId:l()},json:e}),`/deferred-start/preview`)}async function So(e){return U(await B.api.v1.p[`:projectId`][`deferred-start`].$post({param:{projectId:l()},json:e}),`/deferred-start`)}async function Co(e){return U(await B.api.v1.p[`:projectId`][`deferred-start`].options.$post({param:{projectId:l()},json:e}),`/deferred-start/options`)}function wo(e,t){if(e===`ping`)return{project:null,event:{type:`ping`}};let n;try{n=JSON.parse(t)}catch{return null}if(!To(n))return null;let r=n.project;if(typeof r!=`string`||r===``)return null;switch(e){case`run`:{let{project:e,...t}=n;return Eo(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 To(n.usage)?{project:r,event:{type:`usage`,usage:n.usage}}:null;default:return null}}function To(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Eo(e){return To(e)&&typeof e.id==`string`&&e.id!==``}function Do(e){return typeof e.task==`string`&&Array.isArray(e.steps)}function Oo(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]=Ao(r,t),i}if(!Do(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 ko(e,t){if(!e)return;let n=e.filter(e=>e.id!==t);return n.length===e.length?e:n}function Ao(e,t){let n={...t};if(!Do(t)){let t=n;for(let n of u)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 jo=Object.freeze({});function Mo(){let e=jo,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 No={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`}},Po={label:`Merge conflicts`,hint:`this branch no longer merges cleanly into its base — rebase or merge the base in`,tone:`conflict`};function Fo(e){return typeof e==`string`&&Object.hasOwn(No,e)}function Io(e){return e!==void 0&&Fo(e)?No[e]:void 0}var Lo={permission:0,error:1,waiting:2,running:3,unseen:4,none:5};function Ro(e){return!1}function zo(e){return!1}function Bo(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 Vo(e){return!!e.worktreeLifecycle?.needsAttention||e.status===`waiting`||e.status===`review`||K(e)}function Ho(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`}:Ro(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`}:e.status===`failed`?{bucket:`error`,tone:`danger`,pulse:!1,label:`failed`}:e.status===`waiting`?{bucket:`waiting`,tone:`pending`,pulse:!0,label:Bo(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`}:zo(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 Uo(e){return Lo[Ho(e).bucket]<=Lo.waiting}var Wo=[`Pinned`,`Needs you`,`Working`,`Recent`,`Archived`],Go={waiting:0,review:1,running:2,queued:4,done:5,failed:5,cancelled:5},Ko=3,qo=e=>e.status===`failed`&&e.autoResumeAt!==void 0?Ko:K(e)?Go.waiting??0:Go[e.status]??9;function Jo(e,t){return t===`archived`?`Archived`:e.pinned?`Pinned`:Vo(e)?`Needs you`:e.status===`running`||e.status===`queued`||e.status===`failed`&&e.autoResumeAt?`Working`:`Recent`}function Yo(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function Xo(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 Zo(e,t){return t!==void 0&&Xo(e).ref===t}function Qo(e){return e.title.replace(/ \([A-C]\)$/,``)}function $o(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 es(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort($o);return new Map(t.map((e,t)=>[e.id,t+1]))}var ts=[{value:`recent`,label:`Recent`},{value:`created`,label:`Created`}];function ns(e,t){let n=Date.parse(e),r=Date.parse(t);return Number.isNaN(n)||Number.isNaN(r)?t.localeCompare(e):r-n}function rs(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&&ns(e,t)<0&&(t=e)}return t}function is(e,t){return t===`created`?e.createdAt:rs(e)}function as(e){return e===`created`?`Created`:`Updated`}function os(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 ss(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=qo(e)-qo(n);if(r!==0)return r;if(qo(e)===Ko&&e.autoResumeAt&&n.autoResumeAt){let t=e.autoResumeAt.localeCompare(n.autoResumeAt);if(t!==0)return t}return e.status===`queued`&&n.status===`queued`?$o(e,n):ns(rs(e),rs(n))})}function cs(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 ns(is(e,n),is(r,n))})}function ls(e,t){let n=es(e),r=ss(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(Jo(e,t),{kind:`group`,groupId:e.groupId,title:Qo(e),members:n});continue}}a(Jo(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null})}return Wo.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function us(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 ds(e){let t=0,n=0,r=0;for(let i of e){if(i.archived){n+=1;continue}t+=1,Vo(i)&&(r+=1)}return{active:t,archived:n,waiting:r}}var fs=new Set([`running`,`waiting`]),ps=new Set([`done`,`failed`,`review`,`cancelled`]),ms=new Set([`done`,`failed`,`cancelled`]);function hs(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 gs(e){return e?`$${e>=10?e.toFixed(0):e.toFixed(2)}`:``}function _s(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 vs(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 ys(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>[Yo(e),e.branch??``,e.workflow,vs(e)].some(e=>e.toLowerCase().includes(n))):[...e]}function bs(e){return e.filter(e=>!e.archived&&ms.has(e.status)&&!K(e)).length}function xs(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 Ss(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 Cs(e){return ws(e)[0]?.url??Ts(e)[0]}function ws(e,t){if(!e.prRefs?.length)return Ts(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??Ms(`PR`,e.number,t),origin:e.origin}))}function Ts(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 Es(e,t){if(e.referencedIssueUrl)return e.referencedIssueUrl;let n=e.markerRefs?.issue??e.issueNumber;if(!(!n||!t)&&!Ds(e.referencedIssueCandidates,n,t))return`${t}/issues/${n}`}function Ds(e,t,n){let r=`${n.toLowerCase()}/`;return(e??[]).some(e=>e.endsWith(`/${t}`)&&!e.toLowerCase().startsWith(r))}function Os(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 ks(e,t){let n=e.prRefs?.length?ws(e,t).map(e=>({number:e.number,url:e.url})):Ts(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:js(e,t)},{kind:`Issue`,url:Es(e,t)},{kind:`Issue`,number:As(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??Ms(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 As(e,t){let n=e.issueNumber;return n===void 0||!t?n:Ds(e.referencedIssueCandidates,n,t)?void 0:n}function js(e,t){let n=e.prNumber;return n===void 0||!t?n:Ds(e.referencedPrCandidates,n,t)?void 0:n}function Ms(e,t,n){if(n)return`${n}/${e===`PR`?`pull`:`issues`}/${t}`}function Ns(e,t){return ks(e,t)[0]}function q(e){let t=e.split(`/`).pop()??``;return/^\d+$/.test(t)?t:null}function Ps(e,t){let n=fs.has(e.status)?t:void 0;if(n)return{cpu:{text:`${n.cpuPct.toFixed(0)}%`,kind:`live`},mem:{text:hs(n.rssBytes),kind:`live`}};let r=hs(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 Fs(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=>ps.has(e.status))?[]:[{groupId:e,title:Qo(n),count:t.length}]})}function Is(e){return 220+Math.max(0,e)*14}function Ls(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 Rs(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 zs(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 Bs=`/api/v1/ws`,Vs=3e3,Hs=1e3,Us=7e4,Ws=0,Gs=1;function Ks(e){let t=new Map,n=new Map,r=null,i,a,o,s=()=>{clearTimeout(o),o=setTimeout(()=>{o=void 0,r?.close()},Us)},c=()=>e??`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}${Bs}`,l=e=>{r?.readyState===Gs&&r.send(JSON.stringify(e))},u=()=>{let e=globalThis.WebSocket;if(typeof e!=`function`||r&&(r.readyState===Ws||r.readyState===Gs))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()},Vs)))}),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)},Hs))))}}}}var qs=null;function Js(e,t,n){return qs??=Ks(),qs.subscribe(e,t,n)}var J={secrets:{allFor:e=>[`secrets`,e],list:()=>[`secrets`,l()]},e2e:{allFor:e=>[`e2e`,e],status:()=>[`e2e`,l()]},tracker:{allFor:e=>[`tracker`,e],all:()=>[`tracker`,l()],associationFor:e=>[`tracker`,e,`association`],association:()=>[`tracker`,l(),`association`],candidates:(e,t=``)=>[`tracker`,l(),`candidates`,e,t],connection:()=>[`tracker`,l(),`connection`],items:(e,t)=>[`tracker`,l(),`items`,e.kind,e.source.id,e.source.webUrl,e.externalId,e.connectionId??null,t.state,[...t.labels],t.query??``],detail:(e,t)=>[`tracker`,l(),`detail`,e.kind,e.source.id,e.source.webUrl,e.externalId,e.connectionId??null,t]},get health(){return[l(),`health`]},runs:{get all(){return[l(),`runs`]},list:()=>[l(),`runs`,`list`],detail:e=>[l(),`runs`,`detail`,e],diff:e=>[l(),`runs`,`diff`,e],changes:e=>[l(),`runs`,`changes`,e],gitStatus:e=>[l(),`runs`,`git-status`,e],file:(e,t)=>[l(),`runs`,`files`,e,t],handoff:e=>[l(),`runs`,`handoff`,e],drafts:e=>[l(),`runs`,`drafts`,e],commits:e=>[l(),`runs`,`commits`,e],tree:e=>[l(),`runs`,`tree`,e],commit:(e,t)=>[l(),`runs`,`commit`,e,t]},groups:{detail:e=>[l(),`groups`,e]},get todos(){return[l(),`todos`]},get workflows(){return[l(),`workflows`]},get workflowNodes(){return[l(),`workflow-nodes`]},get skills(){return[l(),`skills`]},get skillsReady(){return[l(),`skills`,`ready`]},get importableSkills(){return[l(),`skills`,`importable`]},get importableSkillsReady(){return[l(),`skills`,`importable`,`ready`]},get launchKey(){return[l(),`launch-key`]},get repo(){return[l(),`repo`]},get repoChanges(){return[l(),`repo`,`changes`]},repoCommit:e=>[l(),`repo`,`commit`,e],get repoSync(){return[l(),`repo`,`sync`]},get repoTree(){return[l(),`repo`,`tree`]},repoFile:e=>[l(),`repo`,`file`,e],get uiState(){return[l(),`ui-state`]},get config(){return[l(),`config`]},get agentConfig(){return[l(),`agent-config`]},agentConfigFile:e=>[l(),`agent-config`,`file`,e],get worktrees(){return[l(),`worktrees`]},github:(e={})=>[l(),`github`,e.limit??null],githubPages:(e=50)=>[l(),`github`,`pages`,e],githubChecks:e=>[l(),`github`,`checks`,[...e].sort((e,t)=>e-t).join(`,`)],githubSearch:(e,t)=>[l(),`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)=>[l(),`github`,`comments`,e,t],githubMergeState:e=>[l(),`github`,`merge-state`,e],get openTargets(){return[l(),`open-targets`]}},Ys=6e4;function Xs(){return P({queryKey:J.secrets.list(),queryFn:({signal:e})=>yr({signal:e})})}function Zs(){return P({queryKey:Y.secrets,queryFn:({signal:e})=>br({signal:e})})}function Qs(){return P({queryKey:J.e2e.status(),queryFn:({signal:e})=>Tr({signal:e})})}function $s(){return P({queryKey:J.tracker.connection(),queryFn:({signal:e})=>gr({signal:e})})}function ec(){return P({queryKey:J.tracker.association(),queryFn:({signal:e})=>Dr({signal:e})})}function tc(e,t,n){return jt({queryKey:J.tracker.candidates(e,t),staleTime:Ys,queryFn:({pageParam:n,signal:r})=>Or(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 nc=class extends Error{failure;constructor(e){super(e.reason),this.failure=e,this.name=`TrackerRefreshError`}};function rc(e,t,n=!0){let r=t.query.trim(),i=N(),a=e?J.tracker.items(e,{...t,query:r}):[`tracker`,l(),`items`,`unassociated`];return{...jt({queryKey:a,staleTime:1/0,queryFn:({pageParam:n,signal:i})=>r?Nr(r,{association:e??void 0,cursor:n,limit:50,state:t.state,labels:t.labels,refresh:!0},{signal:i}):Mr({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 Nr(r,i,{signal:n}):await Mr(i,{signal:n});if(!a.available)throw new nc(a);return a}})}catch{}}}}function ic(e,t){return P({staleTime:Ys,queryKey:e&&t?J.tracker.detail(e,t):[`tracker`,l(),`detail`,`disabled`],queryFn:({signal:n})=>Pr(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 P({queryKey:Y.models(e),queryFn:({signal:t})=>_(e)?Cn(e,{signal:t}):Promise.reject(Error(`${e} has no host model catalog`)),staleTime:300*1e3,enabled:t&&_(e)})}function ac(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),antigravity:X(`antigravity`,e)}}function oc(){let e=N();return P({queryKey:Y.providerStatus,queryFn:async({signal:t})=>{let n=e.getQueryData(Y.providerStatus),r=await wn(!1,{signal:t});return Wt(n,e.getQueryData(Y.providerStatus),r)},staleTime:5*6e4,refetchInterval:!1,refetchOnWindowFocus:!0})}function sc(){let e=N();return F({mutationFn:()=>wn(!0),onMutate:()=>e.getQueryData(Y.providerStatus),onSuccess:(t,n,r)=>e.setQueryData(Y.providerStatus,e=>Wt(r,e,t))})}function cc(){return P({queryKey:Y.agentSetup,queryFn:({signal:e})=>Pn({signal:e}),retry:!1,gcTime:0,refetchInterval:e=>{let t=e.state.data;return t?.available&&t.session?.exitCode===null?lc:!1},refetchIntervalInBackground:!0})}var lc=1e3;function uc(){let e=N();return(0,M.useCallback)(()=>void e.invalidateQueries({queryKey:J.health}),[e])}function dc(){let e=N();return F({mutationFn:({provider:e,action:t})=>Fn(e,t),retry:!1,onSuccess:t=>e.setQueryData(Y.agentSetup,e=>e?.available?{...e,session:t}:e),onSettled:()=>e.invalidateQueries({queryKey:Y.agentSetup})})}function fc(){let e=N();return F({mutationFn:e=>zn(e),retry:!1,onSettled:()=>e.invalidateQueries({queryKey:Y.agentSetup})})}function pc(){let e=N();return F({mutationFn:({provider:e,authFailureId:t})=>Zr(e,t),onMutate:()=>e.getQueryData(Y.providerStatus),onSuccess:(t,n,r)=>{e.setQueryData(Y.providerStatus,e=>Wt(r,e,t,n.authFailureId))}})}function mc(){return P({queryKey:Y.projects,queryFn:({signal:e})=>En({signal:e})})}function hc(e,t=!1){return P({queryKey:Y.fsBrowse(e,t),queryFn:({signal:n})=>Dn(e??void 0,{signal:n,showHidden:t}),retry:!1})}function gc(){let e=N();return F({mutationFn:e=>Qr(e),onSuccess:()=>e.invalidateQueries({queryKey:Y.projects})})}function _c(){let e=N();return F({mutationFn:e=>ni(e),retry:!1,onSuccess:()=>{e.invalidateQueries({queryKey:Y.projects})}})}function vc(){let e=N();return F({mutationFn:e=>{let{id:t,...n}=e;return ri(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?yc(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 yc(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?[]:zs(s);return c.length>0&&(a.tags=c),a}function bc(e){let t=N();return F({mutationFn:e,retry:!1,onSuccess:async()=>{await Promise.all([t.invalidateQueries({queryKey:Y.agentProfiles}),t.invalidateQueries({queryKey:Y.projects})])}})}function xc(){return bc(e=>ka(e))}function Sc(){return bc(e=>{let{id:t,...n}=e;return Pa(t,n)})}function Cc(){return bc(e=>Fa(e))}function wc(){return bc(e=>Na(e))}function Tc(e,t){return P({queryKey:Y.agentAccountDetails(e),queryFn:({signal:t})=>ja(e,{signal:t}),enabled:t,staleTime:0,retry:!1})}function Ec(e,t){return P({queryKey:Y.agentAccountStatus(e),queryFn:({signal:t})=>Aa(e,{signal:t}),enabled:t,staleTime:6e4,retry:!1})}function Dc(){let e=N();return F({mutationFn:({provider:e,profileId:t})=>Jr(e,t),retry:!1,onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:Y.agentProfiles}),e.invalidateQueries({queryKey:Y.providerStatus})])}})}function Oc(){let e=N();return F({mutationFn:e=>Aa(e,{recheck:!0}),retry:!1,onSuccess:(t,n)=>{e.setQueryData(Y.agentAccountStatus(n),t),e.invalidateQueries({queryKey:Y.agentProfiles})}})}function kc(){return F({mutationFn:e=>{let{routeId:t,...n}=e;return Ma(t,n)},retry:!1})}function Ac(){let e=N();return F({mutationFn:e=>$r(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:Y.projects})})}function jc(){let e=N();return F({mutationFn:e=>ei(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:Y.projects})})}function Mc(e=!0){return P({queryKey:Y.repoSuggestions,queryFn:({signal:e})=>On({signal:e}),enabled:e,staleTime:6e4,retry:!1})}function Nc(){let e=N();return F({mutationFn:e=>kn(e),retry:!1,onSuccess:()=>Promise.all([e.invalidateQueries({queryKey:Y.projects}),e.invalidateQueries({queryKey:J.repo}),e.invalidateQueries({queryKey:J.health})])})}function Pc(){let e=N();return F({mutationFn:({projectId:e,owner:t,name:n})=>An(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 Fc(e){let t=N(),n=(0,M.useRef)(e);n.current=e;let r=(0,M.useRef)(!1),i=F({mutationFn:jn,retry:!1,onMutate:()=>{r.current=!0,t.setQueryData(Y.githubLogin,{status:`starting`})},onSuccess:e=>t.setQueryData(Y.githubLogin,e)}),a=F({mutationFn:Nn,retry:!1,onMutate:()=>{r.current=!1},onSuccess:e=>t.setQueryData(Y.githubLogin,e)}),o=P({queryKey:Y.githubLogin,queryFn:({signal:e})=>Mn({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,u=s?.status===`done`?s.login:void 0;return(0,M.useEffect)(()=>{c!==`done`||!r.current||(r.current=!1,Promise.all([t.invalidateQueries({queryKey:Y.githubOwners}),t.invalidateQueries({queryKey:Y.projects}),t.invalidateQueries({queryKey:[l(),`github`]}),t.invalidateQueries({queryKey:J.repo}),t.invalidateQueries({queryKey:J.health})]),n.current?.(u))},[c,u,t]),{state:s,start:i,cancel:a}}function Ic(){return P({queryKey:Y.githubOwners,queryFn:({signal:e})=>ti({signal:e}),staleTime:5*6e4,retry:!1})}function Lc(){let e=N();(0,M.useEffect)(()=>{let t,n=()=>{let n=e.getQueryData(J.health)?.capabilities?.localHandoff===!0;n&&t===void 0?t=Js(`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 Rc(){return P({queryKey:J.health,queryFn:({signal:e})=>vn({signal:e}),refetchInterval:e=>Bc(e.state.data)})}var zc=3e4;function Bc(e){return e?.capabilities?.localHandoff===!1&&e.forge!=null&&e.forge.available!==!0&&zc}function Vc(){let e=Rc().data,t=mc().data?.projects,{projectId:n}=Pt(),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?xs(e?.repo?.remote,e?.forge?.kind===`github`):void 0}function Hc(){return P({queryKey:J.openTargets,queryFn:({signal:e})=>ji({signal:e}),staleTime:5*6e4})}function Uc(e){return P({queryKey:J.runs.list(),queryFn:({signal:e})=>Bn({signal:e}),select:e})}function Wc(e=!0,t){return P({queryKey:Y.runsIndex,queryFn:({signal:e})=>Hn({signal:e}),enabled:e,staleTime:3e4,...t===void 0?{}:{refetchInterval:typeof t==`function`?e=>t(e.state.data):t}})}function Gc(e,t=!0,n=!1,r){return P({queryKey:[n?`default`:e,`runs`,`list`],queryFn:({signal:t})=>Vn(e,{signal:t}),enabled:t,select:r})}function Kc(e,t,n){let r=e==="default"?null:e,i=r===null||t!=null&&r===t;return Gc(i?`default`:r??`default`,!0,i,n)}function qc(e){return{queryKey:J.runs.detail(e),queryFn:({signal:t})=>Un(e,{signal:t})}}function Jc(e){return P({...qc(e??``),enabled:!!e})}function Yc(e,t,n=!0){return P({queryKey:[e??`default`,`runs`,`detail`,t??``],queryFn:({signal:n})=>Wn(e,t,{signal:n}),enabled:n&&!!e&&!!t})}function Xc(e){return P({queryKey:J.runs.diff(e??``),queryFn:({signal:t})=>Hr(e,{signal:t}),enabled:!!e})}function Zc(e,t=!1){return P({queryKey:J.runs.changes(e??``),queryFn:({signal:t})=>Wr(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?4e3:!1,refetchOnWindowFocus:!0,staleTime:0})}function Qc(e,t,n=!1){return P({queryKey:J.runs.gitStatus(e),queryFn:({signal:t})=>Ii(e,{signal:t}),enabled:t,retry:!1,refetchInterval:n?1e4:!1,refetchOnWindowFocus:!0,staleTime:0})}function $c(e,t=!0){return P({queryKey:J.runs.tree(e??``),queryFn:({signal:t})=>dr(e,{signal:t}),enabled:t&&!!e,retry:!1,staleTime:0})}function el(e,t){return P({queryKey:J.runs.file(e??``,t??``),queryFn:({signal:n})=>Gr(e,t,{signal:n}),enabled:!!e&&t!==void 0,retry:!1})}function tl(e){return P({queryKey:J.groups.detail(e??``),queryFn:({signal:t})=>qr(e,{signal:t}),enabled:!!e})}function nl(e,t=!1){return P({queryKey:J.runs.commits(e??``),queryFn:({signal:t})=>fr(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?5e3:!1})}function rl(e,t){return P({queryKey:J.runs.commit(e??``,t??``),queryFn:({signal:n})=>pr(e,t,{signal:n}),enabled:!!e&&!!t,retry:!1})}function il(e,t=!0){return P({queryKey:J.runs.handoff(e??``),queryFn:({signal:t})=>Ur(e,{signal:t}),enabled:!!e&&t})}function al(e){return P({queryKey:J.runs.drafts(e??``),queryFn:({signal:t})=>Gi(e,{signal:t}),enabled:!!e,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1})}function ol(e=!0){return P({queryKey:J.todos,queryFn:({signal:e})=>er({signal:e}),enabled:e})}function sl(){return P({queryKey:J.workflowNodes,queryFn:({signal:e})=>ma({signal:e}),staleTime:1/0})}function cl(e={}){return P({queryKey:J.workflows,enabled:e.enabled??!0,queryFn:({signal:e})=>Jn({signal:e})})}function ll(e=!0){let t=N(),n=J.skills,r=n[0],i=P({queryKey:n,queryFn:({signal:e})=>Yn({signal:e}),enabled:e}),a=P({queryKey:J.skillsReady,queryFn:({signal:e})=>Xn({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,M.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`],a.data)},[t,a.data,r]),i}function ul(e=!0){let t=N(),n=J.importableSkills,r=n[0],i=P({queryKey:n,queryFn:({signal:e})=>Qn({signal:e}),enabled:e}),a=P({queryKey:J.importableSkillsReady,queryFn:({signal:e})=>$n({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,M.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`,`importable`],a.data)},[t,a.data,r]),i}function dl(){return P({queryKey:J.launchKey,queryFn:({signal:e})=>Tn({signal:e}),staleTime:1/0})}function fl(){return P({queryKey:J.repo,queryFn:({signal:e})=>tr({signal:e})})}function pl(){return P({queryKey:J.repoSync,queryFn:({signal:e})=>ea({signal:e}),refetchOnWindowFocus:!0})}function ml(){let e=N();return F({mutationFn:e=>ta(e),onSuccess:t=>{e.setQueryData(J.repoSync,t.sync),e.invalidateQueries({queryKey:J.repo,predicate:e=>e.queryKey[2]!==`sync`})}})}function hl(){return P({queryKey:J.repoChanges,queryFn:({signal:e})=>or({signal:e}),retry:!1})}function gl(){return P({queryKey:J.repoTree,queryFn:({signal:e})=>sr({signal:e}),retry:!1,refetchOnWindowFocus:!0,staleTime:0})}function _l(e){return P({queryKey:J.repoFile(e??``),queryFn:({signal:t})=>cr(e,{signal:t}),enabled:e!==void 0&&e!==``,retry:!1,refetchOnWindowFocus:!0,staleTime:0})}function vl(e){return P({queryKey:J.repoCommit(e??``),queryFn:({signal:t})=>ur(e,{signal:t}),enabled:!!e,retry:!1})}function yl(){return P({queryKey:J.config,queryFn:({signal:e})=>nr({signal:e})})}function bl(){return P({queryKey:J.worktrees,queryFn:({signal:e})=>Ja({signal:e})})}function xl(){return P({queryKey:J.uiState,queryFn:({signal:e})=>qn({signal:e})})}function Sl(){return P({queryKey:J.agentConfig,queryFn:({signal:e})=>rr({signal:e})})}function Cl(e){return P({queryKey:J.agentConfigFile(e??``),queryFn:({signal:t})=>ir(e,{signal:t}),enabled:e!==null})}function wl(e){let t=N(),n=J.agentConfig,r=J.agentConfigFile(e);return F({mutationFn:t=>ar(e,t),onSuccess:e=>{t.setQueryData(r,e),t.invalidateQueries({queryKey:n})}})}function Tl(){return P({queryKey:Y.uiState,queryFn:({signal:e})=>ba({signal:e})})}function El(){return P({queryKey:Y.config,queryFn:({signal:e})=>Sa({signal:e})})}function Dl(){return P({queryKey:Y.agentProfiles,queryFn:({signal:e})=>Ea({signal:e})})}function Ol(e){return P({queryKey:Y.agentFallbackPolicy(e??`default`),queryFn:({signal:t})=>Da({projectId:e??`default`},{signal:t}),enabled:e!==null,retry:!1})}function kl(e){let t=N();return F({mutationFn:t=>Oa({projectId:e??`default`,...t}),retry:!1,onSuccess:n=>t.setQueryData(Y.agentFallbackPolicy(e??`default`),n)})}var Al=1e4;function jl(e=!0){return P({queryKey:Y.starCount,queryFn:({signal:e})=>yn({signal:e}),enabled:e,staleTime:Al,refetchInterval:Al,retry:!1,refetchOnMount:!1})}function Ml(){return P({queryKey:Y.telemetryConsent,queryFn:({signal:e})=>xn({signal:e}),staleTime:1/0,retry:!1})}var Nl=6;function Pl(e,t=!0){return P({queryKey:Y.skillsUpdate(e),queryFn:({signal:t})=>Ia(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<Nl)&&6e4}})}function Fl(e=!0){return P({queryKey:Y.selfUpdate,queryFn:({signal:e})=>za({signal:e}),enabled:e,refetchInterval:e=>e.state.data?.job?.status===`running`?1e3:e.state.data?.scheduled?5e3:!1})}function Il(e=!0){return P({queryKey:Y.selfUpdateDevelopment,queryFn:({signal:e})=>Va({signal:e}),enabled:e,staleTime:3e4})}function Ll(){let e=N();return F({mutationFn:()=>Va({refresh:!0}),onSuccess:t=>e.setQueryData(Y.selfUpdateDevelopment,t)})}function Rl(){let e=N();return F({mutationFn:()=>Ba(),onSuccess:t=>e.setQueryData(Y.selfUpdate,t)})}function zl(){let e=N();return F({mutationFn:e=>Ha(e),onSuccess:t=>e.setQueryData(Y.selfUpdate,t)})}function Bl(){let e=N();return F({mutationFn:e=>Ua(e),onSuccess:t=>e.setQueryData(Y.selfUpdate,t)})}function Vl(){let e=N();return F({mutationFn:e=>Wa(e),onSuccess:t=>e.setQueryData(Y.selfUpdate,t)})}function Hl(){let e=N();return F({mutationFn:()=>Ga(),onSuccess:t=>e.setQueryData(Y.selfUpdate,t)})}function Ul(e){let t=N();return F({mutationFn:t=>Ti(e,t),onSuccess:e=>{Wl(t,e),t.invalidateQueries({queryKey:J.runs.all})}})}function Wl(e,t){e.setQueryData(J.runs.list(),e=>e?.map(e=>e.id===t.id?Ao(e,t):e)),e.setQueryData(J.runs.detail(t.id),e=>e?Ao(e,t):t),Gl(e)}function Gl(e){e.invalidateQueries({queryKey:Y.runsIndex})}function Kl(){let e=N();return F({mutationFn:e=>hi(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),Gl(e)}})}function ql(){let e=N();return F({mutationFn:e=>gi(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?Jl(e):e)),e.setQueryData(J.runs.detail(t),e=>e&&Jl(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?Jl(e):e;e.setQueryData(J.runs.list(),e=>e?.map(n)),e.setQueryData(J.runs.detail(t.id),e=>e?n(e):t),Gl(e)}})}function Jl(e){let{seenAt:t,...n}=e;return n}function Yl(e,t,n){let r=N();return F({mutationFn:({id:n,pinned:r,surface:i})=>t===void 0?li(n,r,i??e):ui(t,n,r,i??e),onSuccess:()=>r.invalidateQueries({queryKey:n===void 0?J.runs.all:[n,`runs`]})})}function Xl(e,t,n){let r=N();return F({mutationFn:({id:n,archived:r})=>t===void 0?ci(n,r,e):di(t,n,r,e),onSuccess:()=>r.invalidateQueries({queryKey:n===void 0?J.runs.all:[n,`runs`]})})}function Zl(e,t){let n=N();return F({mutationFn:n=>t===void 0?Vi(e,n):Hi(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 Ql(e,t){let n=N();return F({mutationFn:(n={})=>t===void 0?bi(e,n):xi(t,e,n),onSuccess:()=>n.invalidateQueries({queryKey:J.runs.all})})}function $l(e){let t=N();return F({mutationFn:({msgId:t,message:n})=>Ui(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:J.runs.all})})}function eu(e){let t=N();return F({mutationFn:t=>Wi(e,t),onSuccess:()=>t.invalidateQueries({queryKey:J.runs.all})})}function tu(e={},t=!0){return P({queryKey:J.github(e),queryFn:({signal:t})=>mr({limit:e.limit},{signal:t}),enabled:t})}function nu(e=50,t=!0){return jt({queryKey:J.githubPages(e),queryFn:({pageParam:t,signal:n})=>mr({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 ru(e,t=!0){return P({queryKey:J.githubChecks(e),queryFn:({signal:t})=>Fr(e,{signal:t}),enabled:t&&e.length>0,staleTime:6e4})}function iu(e,t,n=!0){return P({queryKey:J.githubSearch(e,t),queryFn:({signal:n})=>Ir(e,t,{},{signal:n}),enabled:n&&t.trim()!==``,staleTime:6e4})}var au=100;function ou(e){return[...e].sort((e,t)=>t-e).slice(0,au).sort((e,t)=>e-t)}var Z=new Map(fu()),su=1e3;function cu(e,t){if(Z.get(e)!==t){for(Z.delete(e),Z.set(e,t);Z.size>su;){let e=Z.keys().next().value;if(e===void 0)break;Z.delete(e)}hu()}}var Q=new Set(pu());function lu(e,t){if(Q.has(e)!==t){if(t)for(Q.add(e);Q.size>su;){let e=Q.values().next().value;if(e===void 0)break;Q.delete(e)}else Q.delete(e);hu()}}var uu=`cez.reference-statuses.v1`,du=`cez.reference-conflicts.v1`;function fu(){try{let e=globalThis.sessionStorage?.getItem(uu);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`&&Fo(e[1])):[]}catch{return[]}}function pu(){try{let e=globalThis.sessionStorage?.getItem(du);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}var mu;function hu(){mu===void 0&&(mu=setTimeout(()=>{mu=void 0;try{globalThis.sessionStorage?.setItem(uu,JSON.stringify([...Z])),globalThis.sessionStorage?.setItem(du,JSON.stringify([...Q]))}catch{}},250))}function gu(){let e=Pt(),t=Rc();return e.projectId??t.data?.bootProject}function _u(e){for(let[t,n]of Object.entries(e)){for(let[e,r]of Object.entries(n.prs))cu($({projectId:t,kind:`PR`,number:Number(e)}),r);for(let[e,r]of Object.entries(n.issues))cu($({projectId:t,kind:`Issue`,number:Number(e)}),r)}}var vu=5*6e4;function yu(e){return e?e.recheckAfterMs:vu}var $=e=>`${e.projectId}\u0000${e.kind}#${e.number}`;function bu(e,t=!0){let n=(0,M.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:ou(t.prs),issues:ou(t.issues)}))},[e.map($).sort().join(`|`)]),r=kt({queries:n.map(e=>({queryKey:J.githubRefStatus(e.projectId,e.prs,e.issues),queryFn:({signal:t})=>Lr(e.projectId,{prs:e.prs,issues:e.issues},{signal:t}),enabled:t&&e.prs.length+e.issues.length>0,staleTime:e=>yu(e.state.data)??1/0,refetchInterval:e=>yu(e.state.data)??!1,refetchOnWindowFocus:!0}))}),{byRef:i,learned:a}=(0,M.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,M.useEffect)(()=>{for(let{key:e,status:t,conflicting:n}of a)cu(e,t),n!==void 0&&lu(e,n)},[a]),(0,M.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 xu(e,t,n=!0){return P({queryKey:J.githubComments(e,t),queryFn:({signal:n})=>Rr(e,t,{},{signal:n}),enabled:n,staleTime:6e4})}function Su(e){return P({queryKey:[`github`,`pr-changes`,e??0],queryFn:({signal:t})=>Vr(e,{},{signal:t}),enabled:e!==void 0,staleTime:6e4,retry:!1})}export{Pc as $,A as $a,Di as $i,Io as $n,Wn as $r,xl as $t,Fc as A,fo as Aa,Ti as Ai,ts as An,lo as Ar,ac as At,dl as B,qt as Ba,bo as Bi,ss as Bn,ca as Br,Zl as Bt,Qs as C,U as Ca,bn as Ci,Is as Cn,Jr as Cr,nl as Ct,ru as D,ha as Da,Ai as Di,ks as Dn,$i as Dr,Qc as Dt,tu as E,Ca as Ea,Ni as Ei,Ns as En,So as Er,el as Et,Rc as F,Qt as Fa,so as Fi,rs as Fn,Xi as Fr,kl as Ft,Ul as G,jt as Ga,In as Gi,os as Gn,mr as Gr,dc as Gt,ql as H,Jt as Ha,ya as Hi,as as Hn,ra as Hr,ll as Ht,Lc as I,It as Ia,oi as Ii,ds as In,va as Ir,Vl as It,Yc as J,gt as Ja,Ya as Ji,Ho as Jn,zr as Jr,ec as Jt,Yl as K,F as Ka,uo as Ki,Lo as Kn,Rr as Kr,Ml as Kt,ul as L,Ut as La,Li,es as Ln,wa as Lr,wc as Lt,Su as M,en as Ma,na as Mi,ns as Mn,da as Mr,Uc as Mt,iu as N,tn as Na,Ji as Ni,ls as Nn,Ei as Nr,Kc as Nt,xu as O,eo as Oa,Za as Oi,Ps as On,ii as Or,il as Ot,tl as P,$t as Pa,xo as Pi,Qo as Pn,Qi as Pr,Wc as Pt,oc as Q,Be as Qa,Xa as Qi,Po as Qn,io as Qr,rc as Qt,Nc as R,Bt as Ra,qa as Ri,Zo as Rn,yi as Rr,Fl as Rt,jc as S,mo as Sa,Br as Si,_s as Sn,Fi as Sr,rl as St,hc as T,Yr as Ta,Pi as Ti,Cs as Tn,ia as Tr,al as Tt,kc as U,Ft as Ua,Ka as Ui,is as Un,nr as Ur,Pl as Ut,Kl as V,Yt as Va,Sn as Vi,cs as Vn,fa as Vr,zl as Vt,Hc as W,Pt as Wa,xa as Wi,Xo as Wn,Co as Wr,jl as Wt,Xs as X,ct as Xa,$a as Xi,Vo as Xn,Tn as Xr,$s as Xt,Gc as Y,N as Ya,Zn as Yi,K as Yn,vn as Yr,tc as Yt,mc as Z,Ze as Za,Sr as Zi,Uo as Zn,ro as Zr,ic as Zt,Ac as _,Yi as _a,ba as _i,gs as _n,ai as _r,ml as _t,qc as a,la as aa,Kn as ai,Zs as an,w as ao,Ao as ar,Rl as at,Ql as b,si as ba,vi as bi,q as bn,La as br,Jc as bt,Sl as c,xr as ca,go as ci,Y as cn,Ne as co,Ri as cr,Cc as ct,Dl as d,ga as da,Ia as di,Ls as dn,Ra as dr,fl as dt,vr as ea,Zi as ei,Sc as en,_e as eo,jo as er,wl as et,cc as f,Cr as fa,_o as fi,Rs as fn,mi as fr,hl as ft,Hl as g,vo as ga,Ta as gi,bs as gn,pi as gr,pl as gt,fc as h,Xr as ha,Mr as hi,ys as hn,zn as hr,Mc as ht,_u as i,po as ia,Gn as ii,El as in,be as io,Do as ir,sc as it,Ic as j,cn as ja,ki as ji,us as jn,pa as jr,X as jt,nu as k,Ln as ka,_a as ki,vs as kn,Ci as kr,$c as kt,Cl as l,kr as la,ho as li,Wl as ln,pe as lo,oo as lr,_c as lt,Xl as m,fi as ma,Pr as mi,Fs as mn,ci as mr,_l as mt,nc as n,lr as na,Gr as ni,sl as nn,Se as no,Oo as nr,gu as nt,Tc as o,ua as oa,yo as oi,Tl as on,Ce as oo,wo as or,Ll as ot,Bl as p,oa as pa,hr as pi,ps as pn,di as pr,vl as pt,Vc as q,P as qa,Qa as qi,Bo as qn,Vr as qr,ol as qt,J as r,Rn as ra,Ii as ri,cl as rn,xe as ro,Mo as rr,bu as rt,Ec as s,Kr as sa,co as si,bl as sn,T as so,L as sr,gc as st,Ys as t,wr as ta,Gi as ti,vc as tn,D as to,ko as tr,Oc as tt,Ol as u,_r as ua,za as ui,Js as un,S as uo,wi as ur,eu as ut,yl as v,Er as va,to as vi,hs as vn,B as vr,gl as vt,$l as w,aa as wa,Mi as wi,Es as wn,bi as wr,Xc as wt,xc as x,Oi as xa,_i as xi,Os as xn,Ar as xr,Zc as xt,Dc as y,ao as ya,no as yi,Ss as yn,sa as yr,pc as yt,uc as z,Ht as za,qi as zi,Yo as zn,Aa as zr,Il as zt};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$n as r,Qn as i,rt as a}from"./queries-DOHu2y2B.js";import{n as o,t as s}from"./utils-Df_1kJEk.js";import{N as c}from"./button-BrxohNcK.js";import{t as l}from"./circle-check-j6r9xbE5.js";import{n as u,r as d,t as f}from"./triangle-alert-Crbc2knA.js";import{t as p}from"./git-pull-request-draft-DL1VMp1L.js";import{n as m,r as h,t as g}from"./popover-DzdYqnHw.js";import{t as _}from"./status-dot-C_5ryAFi.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})},[]),i=(0,w.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),o=a((0,w.useMemo)(()=>[...t.values()].flat(),[t])),s=(0,w.useMemo)(()=>({publish:r,retract:i,lookup:o}),[r,i,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),i=(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(i,t),()=>c(i)},[s,c,i,o]);let l=a(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:p,"review-required":u,"changes-requested":C,"checks-pending":null,"checks-failing":x,ready:l,merged:d,closed:S,open:y,completed:l,"not-planned":b};function L({reference:e,taskTitle:t,status:n,conflicting:a,conflictAction:c,projectId:l,className:u,compact:d=!1}){let{kind:p,number:m,url:h}=e,g=j(p,m,l),_=n??g.status,y=r(_),b=p===`PR`&&(a??g.conflicting)===!0,x=b?i: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&&p===`Issue`?`Issue `:``}#${m}`:p,E=p===`PR`?`pull request`:`issue`,D=`Open the ${E} for ${t}${x?` — ${x.label}`:``}`,O=(0,T.jsxs)(T.Fragment,{children:[b?(0,T.jsx)(f,{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":p===`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":p===`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:[p===`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)(g,{open:i,onOpenChange:e=>e?a(!0):u(),children:[(0,T.jsx)(m,{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)(h,{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};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Dn as r,J as i,xn as a,zn as o}from"./queries-DOHu2y2B.js";import{r as s}from"./toaster-DrFdGtNN.js";import{N as c,t as l}from"./button-BrxohNcK.js";import{n as u,o as d,t as f}from"./reference-chip-ty5g_OLC.js";import{p,t as m}from"./ask-answer-Cfb0vEFv.js";var h=c(`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`}]]),g=e(t(),1),_=n();function v({run:e,projectId:t,prNumber:n}){let r=m(e,t),i=u(),[a,o]=(0,g.useState)(!1),c=a||r.isPending,d=!!r.blockedBy,f=async()=>{if(c||d)return;let e=r.mode===`resume`;o(!0);try{let t=await r.send(p(n));t?s(t,{tone:`danger`}):(s(`${e?`Task reopened`:`Sent to the task`} — resolving conflicts${n?` in PR #${n}`:``}`),i())}finally{o(!1)}};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(l,{type:`button`,size:`sm`,"data-slot":`reference-conflict-action`,disabled:d||c,onClick:()=>void f(),className:`h-7 w-full text-xs`,children:c?`Sending…`:`Resolve conflicts`}),d&&r.reason?(0,_.jsx)(`span`,{className:`block opacity-70`,children:r.reason}):null]})}function y({projectId:e,runId:t,prNumber:n}){let r=i(e,t);return r.data?(0,_.jsx)(v,{run:r.data,projectId:e,prNumber:n}):(0,_.jsx)(l,{type:`button`,size:`sm`,disabled:!0,className:`h-7 w-full text-xs`,children:r.isError?`Unavailable`:`Loading…`})}function b({run:e,reference:t,className:n,compact:i=!1,projectId:s}){let c=d(),{lookup:l}=c,u=s??c.projectId,p=t.kind===`PR`?r(e).filter(e=>e.kind===`PR`&&(e.number!==t.number||!!e.url&&!!t.url&&e.url!==t.url)):[];return(0,_.jsx)(_.Fragment,{children:(t.number===void 0?[t,...p]:a([{...t,number:t.number},...p],e=>u?l({projectId:u,kind:e.kind,number:e.number}).status:void 0)).map((t,r)=>(0,_.jsx)(g.Fragment,{children:(0,_.jsx)(f,{reference:t,taskTitle:o(e),projectId:s,conflictAction:s===void 0?(0,_.jsx)(v,{run:e,prNumber:t.number}):(0,_.jsx)(y,{projectId:s,runId:e.id,prNumber:t.number}),className:n,compact:i})},`${t.kind}-${t.number??`unknown`}-${t.url??r}`))})}export{h as i,y as n,b as r,v as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Dr as r,E as i,Ka as a,Ri as o,Ya as s,_t as c,dt as l,ft as u,gt as d,pt as f,r as p,sr as m,vt as h}from"./queries-DOHu2y2B.js";import{n as g,t as _}from"./utils-Df_1kJEk.js";import{h as v,r as y}from"./toaster-DrFdGtNN.js";import{t as b}from"./use-desktop-BNN3U2y9.js";import{N as x,t as S}from"./button-BrxohNcK.js";import{t as C}from"./arrow-down-cBTb_EjO.js";import{t as w}from"./arrow-left-BvR1Oqhc.js";import{t as T}from"./arrow-up-Cn0IS81u.js";import{t as ee}from"./check-B5omShEO.js";import{t as te}from"./chevron-right-C3fLn_fF.js";import{c as E,d as D,o as ne,s as O,t as re,u as k}from"./git-toolbar-Bk-3i42V.js";import{a as ie,c as ae,d as oe,f as A,i as se,l as j,o as ce,r as le,s as ue,t as de}from"./file-preview-DOSEbcqV.js";import{t as fe}from"./file-DYpKJvYs.js";import{t as pe}from"./folder-CeFUSrsO.js";import{n as M,t as me}from"./active-forge-DEmP_h4r.js";import{n as N}from"./upload-D_kW6AjR.js";import{n as P,t as F}from"./triangle-alert-Crbc2knA.js";import{t as I}from"./plus-BPopgSYQ.js";import{t as L}from"./search-x-BkezzsKh.js";import{t as R}from"./input-BxjGaO_P.js";import{c as z,t as he}from"./project-router-CmpQcVZp.js";import{n as ge}from"./lib-D2__YoPr.js";import{t as B}from"./centered-state-CSW_o4N7.js";import{s as _e}from"./index-CDhEdFaZ.js";import{t as ve}from"./markdown-Di8pirEb.js";import{t as V}from"./diff-RPASOQVF.js";import{t as H}from"./commit-list-HXZj01RO.js";var U=x(`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`}]]),W=e(t(),1),G=n();function ye(){let e=d(),t=c();if(!e.data)return null;let n=e.data,r=e=>t.mutate(e,{onSuccess:e=>y(e.message),onError:e=>y(e.message,{tone:`danger`,expected:e instanceof m&&e.status===409})}),i=t.isPending,a=t.variables;return(0,G.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,G.jsxs)(`span`,{"data-slot":`repo-upstream`,className:`truncate font-mono text-soft-foreground`,title:`Upstream`,children:[`→ `,n.upstream]}):n.branch?(0,G.jsx)(`span`,{"data-slot":`repo-upstream`,className:`text-soft-foreground`,children:`not published`}):(0,G.jsx)(`span`,{"data-slot":`repo-upstream`,className:`text-soft-foreground`,children:`detached HEAD`}),n.upstream?(0,G.jsx)(q,{ahead:n.ahead,behind:n.behind}):n.outgoing.length>0?(0,G.jsx)(q,{ahead:n.outgoing.length,behind:null}):null,(0,G.jsx)(`span`,{"data-slot":`repo-fetched`,className:`hidden text-soft-foreground sm:inline`,children:n.lastFetchedAt?`fetched ${xe(n.lastFetchedAt)}`:`never fetched`}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,G.jsx)(K,{which:`fetch`,label:`Fetch`,busy:i,pending:a,onClick:r,disabled:!n.pushRemote,children:(0,G.jsx)(k,{"aria-hidden":`true`,className:_(i&&a===`fetch`&&`animate-spin`)})}),n.upstream?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(K,{which:`pull`,label:`Pull`,busy:i,pending:a,onClick:r,disabled:!n.behind,children:(0,G.jsx)(C,{"aria-hidden":`true`})}),(0,G.jsx)(K,{which:`push`,label:`Push`,busy:i,pending:a,onClick:r,disabled:!n.ahead,children:(0,G.jsx)(T,{"aria-hidden":`true`})}),(0,G.jsx)(K,{which:`sync`,label:`Sync`,busy:i,pending:a,onClick:r,disabled:!n.ahead&&!n.behind,variant:`outline`,children:(0,G.jsx)(k,{"aria-hidden":`true`,className:_(i&&a===`sync`&&`animate-spin`)})})]}):n.branch&&n.pushRemote?(0,G.jsx)(K,{which:`push`,label:`Publish branch`,busy:i,pending:a,onClick:r,variant:`outline`,children:(0,G.jsx)(U,{"aria-hidden":`true`})}):null]})]})}function K({which:e,label:t,busy:n,pending:r,onClick:i,disabled:a,variant:o=`ghost`,children:s}){return(0,G.jsxs)(S,{variant:o,size:`sm`,"data-action":`repo-${e}`,"aria-busy":n&&r===e,disabled:n||a,onClick:()=>i(e),children:[s,t]})}function q({ahead:e,behind:t}){return e===null&&t===null?null:!e&&!t?(0,G.jsx)(`span`,{"data-slot":`sync-counts`,className:`text-soft-foreground`,children:`in sync`}):(0,G.jsxs)(`span`,{"data-slot":`sync-counts`,className:`flex items-center gap-1 font-mono`,children:[e?(0,G.jsxs)(`span`,{"data-sync":`ahead`,title:`${e} to push`,className:`text-primary`,children:[`↑`,e]}):null,t?(0,G.jsxs)(`span`,{"data-sync":`behind`,title:`${t} to pull`,className:`text-warning`,children:[`↓`,t]}):null]})}function be({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,G.jsx)(`span`,{"data-slot":`branch-tracking`,className:`flex shrink-0 items-center gap-1 text-meta`,children:r?(0,G.jsx)(`span`,{className:`text-soft-foreground`,children:r}):(0,G.jsx)(q,{ahead:n.ahead,behind:n.behind})})}function xe(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 Se({repo:e,info:t}){let n=me(),i=d(),c=s(),l=e=>y(e.message,{tone:`danger`}),u=a({mutationFn:e=>r({name:e}),onSuccess:async e=>{y(e.created?`Created and switched to ${e.branch}`:`Switched to ${e.branch}`),await Promise.all([c.invalidateQueries({queryKey:p.repo}),c.invalidateQueries({queryKey:p.health})]),c.setQueryData(p.repo,t=>t?.info?{...t,info:{...t.info,branch:e.branch}}:t),c.setQueryData(p.health,n=>n?.repo?.root===t.root?{...n,repo:{...n.repo,branch:e.branch}}:n)},onError:l}),f=a({mutationFn:e=>o({baseBranch:e}),onSuccess:e=>{y(e.baseBranch?`Agents now branch from ${e.baseBranch}`:`Agents now fork from the checked-out branch`),c.invalidateQueries({queryKey:p.repo})},onError:l}),[m,h]=(0,W.useState)(``),[g,v]=(0,W.useState)(``),b=g.trim().toLowerCase(),x=b?e.branches.filter(e=>e.toLowerCase().includes(b)):e.branches;return(0,G.jsxs)(`section`,{"data-slot":`repo-branches`,className:`flex flex-col gap-6 px-4 py-4 md:px-6`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{className:`eyebrow text-soft-foreground`,children:`Branches`}),(0,G.jsx)(R,{"aria-label":`Filter branches`,placeholder:`Filter branches…`,value:g,onChange:e=>v(e.target.value),className:`mt-2 max-w-xl`}),(0,G.jsxs)(`ul`,{"data-slot":`repo-branch-list`,className:`mt-2 flex max-w-xl flex-col divide-y divide-border`,children:[x.map(n=>{let r=n===t.branch,a=e.checkedOutElsewhere?.[n];return(0,G.jsxs)(`li`,{"data-slot":`branch-row`,"data-branch":n,className:`flex min-h-9 items-center gap-2 py-1`,children:[(0,G.jsx)(M,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:_(`min-w-0 truncate font-mono text-xs`,r&&`font-semibold`),children:n}),(0,G.jsx)(be,{name:n,sync:i.data}),r?(0,G.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,G.jsx)(ee,{"aria-hidden":`true`,className:`size-3`}),`current`]}):a?(0,G.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,G.jsx)(S,{variant:`ghost`,size:`sm`,"data-action":`switch-branch`,className:`ml-auto`,disabled:u.isPending,onClick:()=>u.mutate(n),children:`Switch`})]},n)}),x.length===0?(0,G.jsxs)(`li`,{"data-slot":`branch-empty`,className:`py-3 text-xs text-soft-foreground`,children:[`No branches match “`,g.trim(),`”.`]}):null]}),(0,G.jsxs)(`form`,{"data-slot":`branch-create`,className:`mt-3 flex max-w-md items-center gap-2`,onSubmit:e=>{e.preventDefault();let t=m.trim();t&&u.mutate(t,{onSuccess:()=>h(``)})},children:[(0,G.jsx)(R,{"aria-label":`New branch name`,placeholder:`new-branch-name`,value:m,onChange:e=>h(e.target.value)}),(0,G.jsxs)(S,{type:`submit`,variant:`outline`,size:`sm`,"data-action":`create-branch`,disabled:!m.trim()||u.isPending,children:[(0,G.jsx)(I,{"aria-hidden":`true`}),`Create`]})]})]}),(0,G.jsxs)(`div`,{className:`max-w-md`,children:[(0,G.jsx)(`label`,{htmlFor:`base-branch-picker`,className:`eyebrow text-soft-foreground`,children:`Agents’ base branch`}),(0,G.jsxs)(`select`,{id:`base-branch-picker`,"data-slot":`base-branch-picker`,value:e.baseBranch??``,disabled:f.isPending,onChange:e=>f.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,G.jsx)(`option`,{value:``,children:`follow checked-out branch (default)`}),e.branches.map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))]}),(0,G.jsx)(`p`,{className:`mt-1 text-meta text-soft-foreground`,children:`New task worktrees branch from this.`})]}),n?.available?(0,G.jsx)(Ce,{}):null]})}function Ce(){let e=i({limit:20});return(0,G.jsxs)(`div`,{"data-slot":`repo-prs`,className:`max-w-xl`,children:[(0,G.jsx)(`h2`,{className:`eyebrow text-soft-foreground`,children:`Open pull requests`}),e.isPending?(0,G.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`Loading pull requests…`}):e.isError?(0,G.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:e.error.message}):e.data.available?e.data.prs.length===0?(0,G.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`No open pull requests.`}):(0,G.jsx)(`ul`,{className:`mt-2 flex flex-col divide-y divide-border`,children:e.data.prs.map(e=>(0,G.jsx)(we,{pr:e},e.number))}):(0,G.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 we({pr:e}){let t=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(P,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,G.jsxs)(`span`,{className:`shrink-0 font-mono text-meta text-muted-foreground`,children:[`#`,e.number]}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ui`,children:e.title}),e.checks?(0,G.jsx)(Te,{checks:e.checks}):null]}),n=`flex min-w-0 items-center gap-2 rounded-sm px-1.5 py-2`;return(0,G.jsx)(`li`,{"data-slot":`pr-row`,"data-number":e.number,children:g(e.url)?(0,G.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:_(n,`hover:bg-muted`),children:t}):(0,G.jsx)(`span`,{className:n,children:t})})}function Te({checks:e}){return(0,G.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 Ee(){let e=u(),t=b(),[n,r]=(0,W.useState)(`unified`),[i,a]=(0,W.useState)(!1),[o,s]=(0,W.useState)(!1),[c,l]=(0,W.useState)(null),d=(0,W.useRef)(null),f=(0,W.useRef)(null),[p,h]=ae(),g=ue(p),v=e.isError&&e.error instanceof m&&e.error.status===409,y=e.data?.files??[],x=(0,W.useMemo)(()=>se(y),[y]),S=(0,W.useMemo)(()=>y.some(ve),[y]),C=t?n:`unified`,w=!t||i;return(0,G.jsxs)(`section`,{"data-slot":`repo-changes`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,G.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,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Uncommitted changes`}),e.data?(0,G.jsx)(re,{stat:e.data.stat}):null,(0,G.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,G.jsx)(O,{mode:n,wrap:i,preview:o,onModeChange:r,onWrapChange:a,onPreviewChange:S?s:void 0})})]}),e.isPending?(0,G.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,G.jsx)(B,{icon:v?(0,G.jsx)(D,{}):(0,G.jsx)(F,{}),tone:v?`neutral`:`danger`,heading:`h2`,title:v?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):y.length===0?(0,G.jsx)(B,{icon:(0,G.jsx)(D,{}),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,G.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,G.jsx)(`aside`,{ref:f,"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,G.jsx)(j,{root:x,selected:c,onSelect:e=>{l(e),d.current?.scrollToPath(e)}})}),(0,G.jsx)(ce,{paneRef:f,width:p,onWidthChange:h,className:`hidden md:block`}),(0,G.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,G.jsx)(V,{files:y,viewRef:d,mode:C,wrap:w,preview:t&&S&&o,className:`min-w-0 md:py-4`})})]})]})}function De({log:e}){let{sha:t}=v(),n=d().data;if(t)return(0,G.jsx)(Oe,{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,G.jsxs)(`section`,{"data-slot":`repo-incoming`,className:`border-b border-border`,children:[(0,G.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,G.jsx)(H,{slot:`repo-incoming-commits`,commits:i.map(e=>a(e,`incoming`))})]}):null;return e.length===0?(0,G.jsx)(B,{icon:(0,G.jsx)(N,{}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`The log is empty — this repository has no commits to show.`}):(0,G.jsxs)(G.Fragment,{children:[o,(0,G.jsx)(H,{slot:`repo-commits`,commits:e.map(e=>a(e,r.has(e.hash)?`outgoing`:void 0))})]})}function Oe({sha:e}){let t=f(e),n=b(),[r,i]=(0,W.useState)(`unified`),[a,o]=(0,W.useState)(!1),s=t.isError&&t.error instanceof m&&t.error.status===409,c=n?r:`unified`,l=!n||a;return(0,G.jsxs)(`section`,{"data-slot":`repo-commit`,"data-sha":e,className:`flex min-h-0 flex-1 flex-col`,children:[(0,G.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,G.jsx)(S,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,G.jsxs)(he,{to:`/git/commits`,children:[(0,G.jsx)(w,{"aria-hidden":`true`}),`All commits`]})}),t.data?(0,G.jsx)(ge,{stat:t.data.stat}):null,(0,G.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,G.jsx)(O,{mode:r,wrap:a,onModeChange:i,onWrapChange:o})})]}),t.isPending?(0,G.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,G.jsx)(B,{icon:s?(0,G.jsx)(L,{}):(0,G.jsx)(F,{}),tone:s?`neutral`:`danger`,heading:`h2`,title:s?`Commit not found`:`Could not load the commit`,subtitle:t.error.message}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-semibold`,children:t.data.subject}),(0,G.jsxs)(`p`,{className:`mt-0.5 text-meta text-soft-foreground`,children:[t.data.author,` · `,t.data.when,` ·`,` `,(0,G.jsx)(`span`,{className:`font-mono select-all`,children:t.data.sha})]})]}),t.data.files.length===0?(0,G.jsx)(B,{icon:(0,G.jsx)(N,{}),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,G.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:7rem] md:px-6`,children:(0,G.jsx)(V,{files:t.data.files,mode:c,wrap:l,className:`min-w-0`})})]})]})}function J(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 ke(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(!J(e,r))continue;let n=e.slice(e.lastIndexOf(`/`)+1);i.push({path:t,basenameMatch:J(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 Ae=200;function je({selected:e,onSelect:t}){let n=h(),r=n.isError&&n.error instanceof m&&n.error.status===409,i=n.data?.paths??[];return n.isPending?(0,G.jsx)(Y,{children:(0,G.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,G.jsx)(Y,{children:(0,G.jsx)(B,{icon:r?(0,G.jsx)(A,{}):(0,G.jsx)(F,{}),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,G.jsx)(Y,{children:(0,G.jsx)(B,{icon:(0,G.jsx)(A,{}),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,G.jsxs)(Y,{children:[n.data.truncated?(0,G.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,G.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,G.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,G.jsx)(Me,{paths:i,selected:e,onSelect:t})}),(0,G.jsxs)(`div`,{className:_(`min-w-0 flex-1`,e===null&&`hidden md:block`),children:[e===null?null:(0,G.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,G.jsx)(w,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the file tree`]}),(0,G.jsx)(de,{source:{kind:`repo`},path:e})]})]})]})}function Y({children:e}){return(0,G.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 Me({paths:e,selected:t,onSelect:n}){let[r,i]=(0,W.useState)(``),[a,o]=(0,W.useState)(()=>new Set(X(t))),[s,c]=(0,W.useState)(t),l=(0,W.useRef)(null);(0,W.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,W.useMemo)(()=>ke(e,r,Ae),[e,r]),f=(0,W.useMemo)(()=>ie(e,(e,t)=>({kind:`file`,name:t,path:e})),[e]),p=(0,W.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,G.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,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`label`,{htmlFor:`repo-files-filter`,className:`sr-only`,children:`Filter repository files`}),(0,G.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,G.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,G.jsxs)(`p`,{"data-slot":`repo-files-no-match`,className:`px-1.5 py-1 text-xs text-soft-foreground`,children:[`No file matches `,(0,G.jsx)(`span`,{className:`font-mono`,children:r.trim()}),`.`]}):(0,G.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,G.jsx)(Ne,{row:e,focused:e.path===m?.path,onToggle:()=>{c(e.path),h(e.path)}},e.path):(0,G.jsx)(Pe,{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,G.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 Ne({row:e,focused:t,onToggle:n}){return(0,G.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,G.jsx)(te,{"aria-hidden":`true`,className:_(`size-3.5 shrink-0 transition-transform`,e.open&&`rotate-90`)}),(0,G.jsx)(pe,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name})]})}function Pe({row:e,active:t,focused:n,onSelect:r}){let i=le(e.path)?oe:fe;return(0,G.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,G.jsx)(i,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 truncate`,title:e.label,children:e.label})]})}function Fe({tab:e}){let t=l();if(t.isPending)return(0,G.jsx)(_e,{});if(t.isError)return(0,G.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,G.jsx)(B,{icon:(0,G.jsx)(F,{}),tone:`danger`,title:`Could not load the repository`,subtitle:t.error.message})});let n=t.data.info;return n?(0,G.jsx)(Ie,{repo:t.data,info:n,tab:e}):(0,G.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,G.jsx)(B,{icon:(0,G.jsx)(M,{}),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 Ie({repo:e,info:t,tab:n}){return(0,G.jsxs)(`div`,{"data-route":`repo-git`,className:_(`flex min-h-full flex-col`,n===`changes`&&`md:h-full`),children:[(0,G.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,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,G.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Git`}),(0,G.jsx)(ne,{branch:t.branch}),t.remote?(0,G.jsx)(`span`,{"data-slot":`repo-remote`,className:`hidden min-w-0 truncate text-meta text-soft-foreground md:inline`,children:t.remote}):null]}),(0,G.jsx)(`div`,{className:`mt-1.5`,children:(0,G.jsx)(ye,{})}),(0,G.jsxs)(`div`,{"data-slot":`repo-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,G.jsx)(E,{to:`/git`,active:n===`changes`,children:`Changes`}),(0,G.jsx)(E,{to:`/git/commits`,active:n===`commits`,children:`Commits`}),(0,G.jsx)(E,{to:`/git/branches`,active:n===`branches`,children:`Branches`}),(0,G.jsx)(E,{to:`/git/files`,active:n===`files`,children:`Files`})]})]}),n===`changes`?(0,G.jsx)(Ee,{}):n===`commits`?(0,G.jsx)(De,{log:e.log}):n===`files`?(0,G.jsx)(Le,{}):(0,G.jsx)(Se,{repo:e,info:t})]})}function Le(){let e=v(),t=z();return(0,G.jsx)(je,{selected:e[`*`]!==void 0&&e[`*`]!==``?e[`*`]:null,onSelect:e=>t(e===null?`/git/files`:`/git/files/${Re(e)}`,{replace:!0})})}function Re(e){return e.split(`/`).map(encodeURIComponent).join(`/`)}export{Fe as RepoGitRoute};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,s as i,t as a}from"./utils-Df_1kJEk.js";import{a as o,c as s,i as c,l,o as u,r as d,s as f,u as p}from"./button-BrxohNcK.js";import{t as m}from"./x-sQR-jRBj.js";var h=e(t(),1),g=[`run-event`,`ui-event`],_=1e3,v=6e4,y=1e4;function b(e,t){if(e.add(t),e.size<=y)return;let n=e.values().next().value;typeof n==`number`&&e.delete(n)}function x(e,t){return typeof e==`string`?`${e}:${t}`:t}function S(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!==``?x(e.stepId,t):void 0}function C(e){let t=[],n=new Map;for(let r of e){let e=S(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 w(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 T=3e4;function E(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 D(e,t={}){let[n,a]=(0,h.useState)([]),o=i(),s=(0,h.useRef)(t);s.current=t;let c=(0,h.useRef)(0),l=(0,h.useRef)(0),u=(0,h.useRef)(0),d=(0,h.useRef)(!1),f=(0,h.useRef)(new Set),p=(0,h.useRef)(void 0);(0,h.useEffect)(()=>{let{afterSeq:t=0}=s.current;if(c.current=0,l.current=t,u.current=t,d.current=!1,f.current.clear(),a([]),!e)return;let n=globalThis.EventSource;if(typeof n!=`function`)return;let i=null,o=0,m,h=!1,y=0,x=0,S=0,D=[],O,k,A=Date.now(),j,M=()=>{y=Math.min(y+1,6),x=Date.now()+Math.min(v,_*2**(y-1))},N=e=>{let t=s.current;if(t.onCompact===void 0||(t.compactAt===void 0||S<t.compactAt)&&(t.compactWhenOver===void 0||e.length<=t.compactWhenOver)||Date.now()<x)return;let n=S;Promise.resolve().then(()=>{if(!h)return s.current.onCompact?.(e)}).then(e=>{if(h)return;if(!Array.isArray(e)||e.length===0){M();return}y=0,x=0,S=Math.max(0,S-n);let t=new Set(e);t.size!==0&&a(e=>e.filter(({seq:e})=>!t.has(e)))},()=>{h||M()})},P=()=>{if(k=void 0,O!==void 0){let e=O;O=void 0,h||s.current.onRun?.(e)}if(D.length===0)return;let e=D;D=[],a(t=>{let n=s.current;return n.compactAt!==void 0||n.onCompact!==void 0?C([...t,...e]):[...t,...e]})},F=()=>{k===void 0&&(k=setTimeout(P,50))},I=()=>{o+=1;let e=i;e&&(e.close(),i=null)},L=(e,t)=>{if(h||t!==o)return;A=Date.now();let n=E(e.data);!n||f.current.has(n.seq)||n.seq<=c.current&&(!d.current||n.seq<=u.current)||(b(f.current,n.seq),c.current=Math.max(c.current,n.seq),S+=1,D.push(n),F())},R=e=>{h||e!==o||(A=Date.now())},z=()=>{h||m!==void 0||(m=setTimeout(()=>{m=void 0,h||B()},1500))},B=()=>{I();let t=o,{cursor:a,afterSeq:u=0}=s.current;A=Date.now(),l.current=Math.max(l.current,u);let d=new URLSearchParams;a!==void 0&&d.set(`cursor`,a);let f=Math.max(l.current,c.current);(a!==void 0||f>0)&&d.set(`afterSeq`,String(f));let p=d.size>0?`?${d.toString()}`:``,m=new n(r(`/runs/${encodeURIComponent(e)}/events${p}`),{withCredentials:!0});i=m;let _=e=>L(e,t);for(let e of g)m.addEventListener(e,_);m.addEventListener(`ping`,()=>R(t)),m.addEventListener(`run`,e=>{if(h||t!==o)return;A=Date.now();let n=w(e.data);n&&(O=n,F())}),m.addEventListener(`error`,()=>{h||t!==o||m.readyState===2&&z()})},V,H=()=>{document.visibilityState===`hidden`&&(V??=setTimeout(()=>{V=void 0,!(h||document.visibilityState!==`hidden`)&&(clearTimeout(m),m=void 0,I())},T))},U=()=>{if(document.visibilityState===`hidden`){H();return}clearTimeout(V),V=void 0,(!i||i.readyState===2)&&(clearTimeout(m),m=void 0,B())},W=()=>{clearTimeout(m),m=void 0,I()},G=e=>{e.persisted&&(B(),H())};return j=setInterval(()=>{h||document.visibilityState!==`visible`||Date.now()-A<=4e4||(clearTimeout(m),m=void 0,B())},1e4),document.addEventListener(`visibilitychange`,U),window.addEventListener(`pagehide`,W),window.addEventListener(`pageshow`,G),p.current=N,B(),H(),()=>{h=!0,clearTimeout(m),clearTimeout(k),k=void 0,D=[],O=void 0,clearInterval(j),clearTimeout(V),document.removeEventListener(`visibilitychange`,U),window.removeEventListener(`pagehide`,W),window.removeEventListener(`pageshow`,G),p.current===N&&(p.current=void 0),I()}},[e,o]),(0,h.useEffect)(()=>{n.length!==0&&p.current?.(n)},[n]);let m=t.afterSeq??0;return(0,h.useEffect)(()=>{e&&(m>l.current&&(d.current=!0),l.current=Math.max(l.current,m))},[m,e]),n}var O=n();function k({...e}){return(0,O.jsx)(d,{"data-slot":`sheet`,...e})}function A({...e}){return(0,O.jsx)(p,{"data-slot":`sheet-trigger`,...e})}function j({...e}){return(0,O.jsx)(c,{"data-slot":`sheet-close`,...e})}function M({...e}){return(0,O.jsx)(s,{"data-slot":`sheet-portal`,...e})}function N({className:e,...t}){return(0,O.jsx)(f,{"data-slot":`sheet-overlay`,className:a(`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 P({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,O.jsxs)(M,{children:[(0,O.jsx)(N,{}),(0,O.jsxs)(o,{"data-slot":`sheet-content`,className:a(`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,O.jsxs)(c,{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,O.jsx)(m,{className:`size-4`}),(0,O.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function F({className:e,...t}){return(0,O.jsx)(`div`,{"data-slot":`sheet-header`,className:a(`flex flex-col gap-1.5 p-4`,e),...t})}function I({className:e,...t}){return(0,O.jsx)(l,{"data-slot":`sheet-title`,className:a(`font-semibold text-foreground`,e),...t})}function L({className:e,...t}){return(0,O.jsx)(u,{"data-slot":`sheet-description`,className:a(`text-sm text-muted-foreground`,e),...t})}export{F as a,T as c,D as d,L as i,S as l,j as n,I as o,P as r,A as s,k as t,x as u};
@@ -1 +0,0 @@
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,Hi as i,Ht as a,Ka as o,L as s,Or as c,Ut as l,Ya as u,Yi as d,br as f,cn as p,di as m,dr as h,r as g,rn as _,sr as v}from"./queries-DOHu2y2B.js";import{t as y}from"./utils-Df_1kJEk.js";import{g as b,r as x}from"./toaster-DrFdGtNN.js";import{t as S}from"./button-BrxohNcK.js";import{t as C}from"./arrow-left-BvR1Oqhc.js";import{k as w}from"./ask-answer-Cfb0vEFv.js";import{t as T}from"./circle-check-j6r9xbE5.js";import{u as ee}from"./git-toolbar-Bk-3i42V.js";import{t as E}from"./triangle-alert-Crbc2knA.js";import{S as D,b as O,k,v as A,y as j}from"./composer-GntpkeQD.js";import{D as M,E as N,O as P,T as F,k as I,w as L}from"./popover-DzdYqnHw.js";import{t as R}from"./input-BxjGaO_P.js";import{st as z,tt as B,x as V}from"./composer-attachments-Xa-qW8Eq.js";import{c as H,s as te,t as U}from"./project-router-CmpQcVZp.js";import{t as W}from"./centered-state-CSW_o4N7.js";import{d as G,l as ne,nt as K}from"./index-CDhEdFaZ.js";var q=e(t(),1),J=n(),Y=[`.ai/cezar/skills/`,`.ai/skills/`,`.agents/skills/`];function X({children:e}){return(0,J.jsx)(`span`,{className:`font-mono`,children:e})}function re(){return(0,J.jsx)(J.Fragment,{children:Y.map((e,t)=>(0,J.jsxs)(`span`,{children:[t>0?t===Y.length-1?`, or `:`, `:``,(0,J.jsx)(X,{children:e})]},e))})}function ie(){return(0,J.jsxs)(J.Fragment,{children:[`No skills yet. Drop Markdown files into `,(0,J.jsx)(re,{}),` (agent mirrors like`,` `,(0,J.jsx)(X,{children:`.claude/skills/`}),` work too) — optional frontmatter: `,(0,J.jsx)(X,{children:`name`}),`,`,` `,(0,J.jsx)(X,{children:`description`}),`. Global (`,(0,J.jsx)(X,{children:`~/.agents/skills`}),`) and team-repo skills appear here too — try Refresh.`]})}var ae=2e3,Z=5*6e4;async function oe(e,t,n={}){let{apply:r=h,read:i=m,wait:a=e=>new Promise(t=>setTimeout(t,e)),now:o=Date.now,onDropped:s=z}=n;try{return await r(e)}catch(n){if(!(n instanceof v)||n.status!==0&&n.status!==409)throw n;let r=e=>{n.status===0&&s(e)},c=o()+Z;for(;;){let s;try{s=await i(e)}catch{throw r(`unreachable`),n}if(s.status!==`updating`){if(s.updatedAt&&s.updatedAt!==t)return r(`recovered`),s;throw r(`not_applied`),n}if(o()>=c)throw r(`timed_out`),n;await a(ae)}}}function Q(e){return e===`project`?`Project installation`:`Global installation`}function se({projectId:e,state:t,loadError:n}){let r=u(),i=H(),a=(0,q.useRef)(0),[s,l]=(0,q.useState)(!1),d=o({mutationFn:()=>c({task:`Apply the upgrade notes after updating the installed Open Mercato skills.`,steps:[{id:`apply-upgrade-notes`,name:`Apply upgrade notes`,skill:`om-apply-upgrade-notes`,prompt:`{{task}}`}]}),onSuccess:e=>{B(`skills_import`),l(!1),i(V(e))},onError:e=>x(e.message,{tone:`danger`})}),m=(t,n)=>{n.seq===a.current&&(r.setQueryData(p.skillsUpdate(e),t),n.action===`apply`&&t.updatedAt&&t.updatedAt!==n.previousUpdatedAt&&(r.invalidateQueries({queryKey:g.skills}),x(t.status===`error`?`Some skill updates failed.`:`Open Mercato skills updated.`),l(!0)))},h=(e,t)=>{t.seq===a.current&&x(e.message,{tone:`danger`})},_=o({mutationFn:t=>f(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>h(e,t)}),v=o({mutationFn:t=>oe(e,t.previousUpdatedAt).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>h(e,t)}),b=e=>{let n=++a.current;e===`apply`?v.mutate({action:e,seq:n,previousUpdatedAt:t?.updatedAt??null}):_.mutate({action:e,seq:n})},C=t?.scopes??[],w=C.filter(e=>e.skills.length>0),E=w.length>0,D=t?.status===`error`,O=E&&(t?.available||D),k=v.isPending||t?.status===`updating`,A=C.filter(e=>e.status===`error`||e.status===`unavailable`),j=C.filter(e=>e.updatedAt&&!A.includes(e)),R=`Checking installed Open Mercato skills…`;return n?R=`Update status is unavailable right now.`:t?.status===`available`?R=`An update is available for your installed Open Mercato skills.`:t?.status===`updating`?R=`Updating installed Open Mercato skills…`:t?.status===`current`&&!E?R=t.needsUpgradeNotes?`Skill files were updated.`:`No installed Open Mercato skills are tracked for updates.`:t?.status===`current`?R=`Installed Open Mercato skills are up to date.`:t?.status===`unavailable`?R=t.scopes.find(e=>e.reason)?.reason??`Automatic updates are unavailable.`:t?.status===`error`&&(R=`The update did not finish for every installation.`),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`section`,{"data-slot":`skills-update-card`,"aria-live":`polite`,className:`rounded-lg border border-border bg-muted/30 p-3`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`p`,{className:`text-ui font-medium text-foreground`,children:R}),t?.checkedAt?(0,J.jsxs)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:[`Last checked `,new Date(t.checkedAt).toLocaleString(),`.`]}):null,w.length>0?(0,J.jsx)(`ul`,{className:`mt-1 text-xs text-soft-foreground`,children:w.map(e=>(0,J.jsxs)(`li`,{children:[Q(e.scope),` · `,e.skills.length,` tracked`]},e.scope))}):null,A.length>0?(0,J.jsxs)(`p`,{className:`mt-1 text-xs text-destructive`,children:[`Failed: `,A.map(e=>Q(e.scope)).join(`, `),j.length?`; updated: `+j.map(e=>Q(e.scope)).join(`, `):``,`.`]}):null]}),O?(0,J.jsxs)(S,{"data-action":`skills-update-apply`,size:`sm`,disabled:k,onClick:()=>b(`apply`),children:[(0,J.jsx)(ee,{"aria-hidden":`true`,className:y(`size-3.5`,k&&`motion-safe:animate-spin`)}),k?`Updating…`:D?`Retry`:`Update now`]}):t?.status===`current`?(0,J.jsx)(S,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:_.isPending,onClick:()=>b(`check`),children:`Check again`}):t?.status===`unavailable`||n?(0,J.jsx)(S,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:_.isPending,onClick:()=>b(`check`),children:`Retry check`}):null]}),t?.status===`unavailable`||n?(0,J.jsxs)(`div`,{className:`mt-2 text-xs text-soft-foreground`,children:[`Manual examples: `,(0,J.jsx)(`code`,{children:`npx skills update -p`}),` · `,(0,J.jsx)(`code`,{children:`npx skills update -g`}),`. These broad commands may update other tracked sources.`]}):null,t?.needsUpgradeNotes?(0,J.jsxs)(`div`,{"data-slot":`skills-upgrade-notes`,className:`mt-3 flex gap-2 rounded-md border border-primary/30 bg-background p-2.5 text-xs text-foreground`,children:[(0,J.jsx)(T,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-primary`}),(0,J.jsxs)(`span`,{children:[`Skill files were updated. Run `,(0,J.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` in each configured repository to apply descriptor migrations while preserving local edits.`]})]}):null]}),(0,J.jsx)(L,{open:s,onOpenChange:e=>d.isPending?void 0:l(e),children:(0,J.jsxs)(F,{"data-slot":`skills-upgrade-notes-dialog`,showCloseButton:!1,children:[(0,J.jsxs)(P,{children:[(0,J.jsx)(I,{children:`Apply the upgrade notes now?`}),(0,J.jsxs)(N,{children:[`The skill files were updated successfully. Start a new session with`,` `,(0,J.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` to sync repository descriptors while preserving local edits?`]})]}),(0,J.jsxs)(M,{children:[(0,J.jsx)(S,{type:`button`,variant:`outline`,disabled:d.isPending,onClick:()=>l(!1),children:`No`}),(0,J.jsx)(S,{type:`button`,disabled:d.isPending,onClick:()=>d.mutate(),children:d.isPending?`Starting…`:`Yes, start session`})]})]})})]})}function ce(e,t){let n=e?.importedSkills;return Array.isArray(n)?n.filter(e=>typeof e==`string`&&!!e):[...t]}function le(e,t,n,r,i=!1){let a=e.source===`ai`||e.source===`cezar`||e.source===`agents`||e.source===`global`,o=e.source===`team`&&(t.has(e.name)||i);if(!(!a&&!o))return{ariaLabel:a?`${e.name} is always enabled`:`${e.enabled?`Disable`:`Enable`} ${e.name}`,checked:a||e.enabled,disabled:a||n||i,onCheckedChange:()=>r(e.name)}}function $(){return(0,J.jsxs)(`div`,{"data-route":`skills`,className:`flex min-h-full flex-col`,children:[(0,J.jsxs)(`header`,{className:`sticky top-0 z-10 hidden h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-5 md:flex`,children:[(0,J.jsx)(`h1`,{className:`text-base font-semibold`,children:`Skills`}),(0,J.jsx)(`p`,{className:`text-ui text-muted-foreground`,children:`Markdown playbooks agents can follow.`})]}),(0,J.jsx)(ue,{})]})}function ue(){let e=te()??``,t=l(e,!!e),n=a(),c=_(),f=s(),[p]=b(),[m,h]=(0,q.useState)(``),[v,T]=(0,q.useState)(null),O=u(),M=r(),N=f.data??[],P=(0,q.useMemo)(()=>N.map(e=>e.name),[N]),F=(0,q.useMemo)(()=>new Set(P),[P]),I=(0,q.useMemo)(()=>new Set(ce(M.data,P)),[M.data,P]),L=(0,q.useRef)(Promise.resolve()),z=(0,q.useRef)(0),B=(0,q.useCallback)(t=>{let n=g.uiState,r=g.skills,a=O.getQueryData(n),o=ce(a,P),s=o.includes(t)?o.filter(e=>e!==t):[...o,t];O.setQueryData(n,{...a,importedSkills:s});let c=++z.current;L.current=L.current.then(async()=>{try{let t=await i({importedSkills:s},e);if(c!==z.current)return;O.setQueryData(n,t),O.invalidateQueries({queryKey:r})}catch(e){if(c!==z.current)return;x(e instanceof Error?e.message:String(e),{tone:`danger`}),O.invalidateQueries({queryKey:n})}})},[P,e,O]),V=o({mutationFn:()=>d(),onSuccess:e=>{O.setQueryData(g.skills,e),x(`Team skills refreshed.`)},onError:e=>x(e.message,{tone:`danger`})});if(n.isError)return(0,J.jsx)(W,{icon:(0,J.jsx)(E,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:n.error.message});let H=D(n.data??[]),G=new Set(H.map(e=>e.name)),K=D([...H.map(e=>({...e,enabled:e.source===`team`&&F.has(e.name)?I.has(e.name):!0})),...N.filter(e=>!G.has(e.name)).map(e=>({...e,enabled:I.has(e.name)}))].sort((e,t)=>e.name.localeCompare(t.name))),Y=p.get(`skill`),X=K.find(e=>e.name===Y)??(Y===null?K.find(e=>e.enabled):null)??null,re=X?.name??null,ae=X?le(X,F,M.isPending,B,f.isError):void 0,Z=j(K),oe=Z.map(e=>e.key),Q=v!==null&&oe.includes(v)?v:null,$=j(A(Q===null?K:K.filter(e=>(e.team?.repo??``)===Q),m)),ue=$.flatMap(e=>e.skills);return(0,J.jsxs)(`div`,{"data-slot":`skills-section`,className:`flex min-h-full flex-1 items-stretch`,children:[(0,J.jsxs)(`section`,{"data-slot":`skills-list`,className:y(`w-full flex-col border-border md:flex md:w-96 md:shrink-0 md:border-r`,`md:sticky md:top-14 md:max-h-[calc(100dvh-(var(--spacing)*14))]`,Y===null||!X?`flex`:`hidden md:flex`),children:[(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 p-3 pb-2`,children:[(0,J.jsx)(R,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:m,onChange:e=>h(e.target.value),className:`h-8 text-ui`}),(0,J.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,title:`git fetch the team skills repos`,disabled:V.isPending,onClick:()=>V.mutate(),className:`flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[(0,J.jsx)(ee,{"aria-hidden":`true`,className:y(`size-3`,V.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),Z.length>1?(0,J.jsx)(`div`,{className:`shrink-0 px-3 pb-2`,children:(0,J.jsxs)(`select`,{"data-slot":`skills-repo-filter`,"aria-label":`Filter by repository`,value:Q??`__all__`,onChange:e=>T(e.target.value===`__all__`?null:e.target.value),className:`h-8 w-full rounded-md border border-border bg-card px-2 text-ui text-foreground outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:[(0,J.jsx)(`option`,{value:`__all__`,children:`All repositories`}),Z.map(e=>(0,J.jsxs)(`option`,{value:e.key,children:[e.label,` (`,e.skills.length,`)`]},e.key))]})}):null,e?(0,J.jsx)(`div`,{className:`shrink-0 px-3 pb-2`,children:(0,J.jsx)(se,{projectId:e,state:t.data,loadError:t.error})}):null,f.isError?(0,J.jsxs)(`div`,{"data-slot":`skills-importable-error`,role:`alert`,className:`mx-3 mb-2 flex shrink-0 items-center justify-between gap-3 rounded-md border border-danger/20 bg-danger/10 px-3 py-2 text-xs text-danger`,children:[(0,J.jsxs)(`p`,{className:`min-w-0`,children:[`Could not load the Open Mercato skills catalog. Team skills may be missing until it loads.`,` `,f.error.message]}),(0,J.jsx)(S,{type:`button`,"data-action":`skills-importable-retry`,variant:`ghost`,size:`sm`,disabled:f.isFetching,onClick:()=>void f.refetch(),children:`Retry`})]}):null,(0,J.jsx)(`ul`,{"data-slot":`skill-rows`,className:`min-h-0 flex-1 space-y-1 overflow-y-auto px-2 pb-2`,children:n.isPending?(0,J.jsx)(`li`,{className:`px-2.5 py-2 text-ui text-soft-foreground`,children:`Loading…`}):ue.length>0?$.map(e=>(0,J.jsxs)(`li`,{"data-slot":`skill-group`,"data-group":e.key||`local`,className:`list-none`,children:[Z.length>1?(0,J.jsx)(`h3`,{className:`px-2.5 pt-2 pb-1 eyebrow text-soft-foreground`,children:e.label}):null,(0,J.jsx)(`ul`,{className:`space-y-1`,children:e.skills.map(e=>(0,J.jsx)(de,{skill:e,active:re===e.name,activation:le(e,F,M.isPending,B,f.isError)},e.name))})]},e.key)):(0,J.jsx)(`li`,{className:`px-2.5 py-2 text-xs leading-relaxed text-soft-foreground`,children:K.length>0?`(no skills match)`:(0,J.jsx)(ie,{})})})]}),(0,J.jsx)(`section`,{"data-slot":`skills-detail`,className:y(`min-w-0 flex-1 flex-col`,Y===null||!X?`hidden md:flex`:`flex`),children:(0,J.jsx)(`div`,{className:`min-w-0 flex-1 px-4 py-4 md:px-7 md:py-5`,children:X?(0,J.jsxs)(J.Fragment,{children:[Y===null?null:(0,J.jsxs)(U,{to:`/skills`,"data-slot":`skills-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,J.jsx)(C,{"aria-hidden":`true`,className:`size-3.5`}),`Back to skills`]}),(0,J.jsx)(ne,{skill:X,enabled:X.enabled,activation:ae,usedBy:k(c.data?.workflows??[],X.name)})]}):n.isPending?null:(0,J.jsx)(W,{icon:(0,J.jsx)(w,{}),tone:`neutral`,heading:`h2`,title:`No skill selected`,subtitle:`Pick a skill from the catalog.`})})})]})}function de({skill:e,active:t,activation:n}){let r=O(e),i=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(`span`,{className:y(`min-w-0 truncate font-mono text-ui`,e.enabled?`font-semibold text-foreground`:`font-medium text-muted-foreground`),children:e.name}),(0,J.jsx)(G,{source:e.source,teamRepo:e.team?.repo,className:`ml-auto`})]}),e.description?(0,J.jsx)(`span`,{className:`line-clamp-2 text-xs text-soft-foreground`,children:e.description}):null]});return(0,J.jsxs)(`li`,{className:y(`flex min-w-0 items-start gap-0 rounded-md transition-colors hover:bg-muted`,t&&`bg-muted`),children:[n?(0,J.jsx)(K,{"data-slot":`skill-activation`,"aria-label":n.ariaLabel,checked:n.checked,disabled:n.disabled,onCheckedChange:n.onCheckedChange,size:`sm`,className:`mt-2.5 ml-2 shrink-0`}):null,(0,J.jsx)(U,{to:`/skills?skill=${encodeURIComponent(e.name)}`,"data-slot":`skill-row`,"data-skill":e.name,"data-project":r?`true`:void 0,"data-enabled":e.enabled?`true`:`false`,"aria-current":t?`page`:void 0,className:`flex min-w-0 flex-1 flex-col gap-0.5 px-2.5 py-2`,children:i})]})}export{$ as SkillsRoute};