@ai-development-environment/server 0.0.137 → 0.0.138

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 (369) hide show
  1. package/package.json +1 -1
  2. package/standalone/.next/BUILD_ID +1 -1
  3. package/standalone/.next/build-manifest.json +3 -3
  4. package/standalone/.next/prerender-manifest.json +3 -3
  5. package/standalone/.next/server/app/[locale]/(auth)/register/page.js.nft.json +1 -1
  6. package/standalone/.next/server/app/[locale]/(auth)/register/page_client-reference-manifest.js +1 -1
  7. package/standalone/.next/server/app/[locale]/(auth)/sign-in/page.js.nft.json +1 -1
  8. package/standalone/.next/server/app/[locale]/(auth)/sign-in/page_client-reference-manifest.js +1 -1
  9. package/standalone/.next/server/app/[locale]/(dashboard)/ai/costs/page.js.nft.json +1 -1
  10. package/standalone/.next/server/app/[locale]/(dashboard)/ai/costs/page_client-reference-manifest.js +1 -1
  11. package/standalone/.next/server/app/[locale]/(dashboard)/ai/drafts/new/page.js.nft.json +1 -1
  12. package/standalone/.next/server/app/[locale]/(dashboard)/ai/drafts/new/page_client-reference-manifest.js +1 -1
  13. package/standalone/.next/server/app/[locale]/(dashboard)/ai/drafts/page.js.nft.json +1 -1
  14. package/standalone/.next/server/app/[locale]/(dashboard)/ai/drafts/page_client-reference-manifest.js +1 -1
  15. package/standalone/.next/server/app/[locale]/(dashboard)/ai/plans/[runId]/page.js.nft.json +1 -1
  16. package/standalone/.next/server/app/[locale]/(dashboard)/ai/plans/[runId]/page_client-reference-manifest.js +1 -1
  17. package/standalone/.next/server/app/[locale]/(dashboard)/ai/plans/page.js.nft.json +1 -1
  18. package/standalone/.next/server/app/[locale]/(dashboard)/ai/plans/page_client-reference-manifest.js +1 -1
  19. package/standalone/.next/server/app/[locale]/(dashboard)/ai/sessions/[runId]/page.js.nft.json +1 -1
  20. package/standalone/.next/server/app/[locale]/(dashboard)/ai/sessions/[runId]/page_client-reference-manifest.js +1 -1
  21. package/standalone/.next/server/app/[locale]/(dashboard)/ai/sessions/page.js.nft.json +1 -1
  22. package/standalone/.next/server/app/[locale]/(dashboard)/ai/sessions/page_client-reference-manifest.js +1 -1
  23. package/standalone/.next/server/app/[locale]/(dashboard)/ai/skills/[skillId]/page.js.nft.json +1 -1
  24. package/standalone/.next/server/app/[locale]/(dashboard)/ai/skills/[skillId]/page_client-reference-manifest.js +1 -1
  25. package/standalone/.next/server/app/[locale]/(dashboard)/ai/skills/groups/[groupId]/page.js.nft.json +1 -1
  26. package/standalone/.next/server/app/[locale]/(dashboard)/ai/skills/groups/[groupId]/page_client-reference-manifest.js +1 -1
  27. package/standalone/.next/server/app/[locale]/(dashboard)/ai/skills/groups/page.js.nft.json +1 -1
  28. package/standalone/.next/server/app/[locale]/(dashboard)/ai/skills/groups/page_client-reference-manifest.js +1 -1
  29. package/standalone/.next/server/app/[locale]/(dashboard)/ai/skills/page.js.nft.json +1 -1
  30. package/standalone/.next/server/app/[locale]/(dashboard)/ai/skills/page_client-reference-manifest.js +1 -1
  31. package/standalone/.next/server/app/[locale]/(dashboard)/ai/skills/sync/[runId]/page.js.nft.json +1 -1
  32. package/standalone/.next/server/app/[locale]/(dashboard)/ai/skills/sync/[runId]/page_client-reference-manifest.js +1 -1
  33. package/standalone/.next/server/app/[locale]/(dashboard)/ai/usage/page.js.nft.json +1 -1
  34. package/standalone/.next/server/app/[locale]/(dashboard)/ai/usage/page_client-reference-manifest.js +1 -1
  35. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/action-center/page.js.nft.json +1 -1
  36. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/action-center/page_client-reference-manifest.js +1 -1
  37. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/agents/[id]/page.js.nft.json +1 -1
  38. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/agents/[id]/page_client-reference-manifest.js +1 -1
  39. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/agents/page.js.nft.json +1 -1
  40. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/agents/page_client-reference-manifest.js +1 -1
  41. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/apps/[appId]/page.js.nft.json +1 -1
  42. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/apps/[appId]/page_client-reference-manifest.js +1 -1
  43. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/apps/page.js.nft.json +1 -1
  44. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/apps/page_client-reference-manifest.js +1 -1
  45. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/builds/[buildId]/coverage/page.js.nft.json +1 -1
  46. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/builds/[buildId]/coverage/page_client-reference-manifest.js +1 -1
  47. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/builds/[buildId]/output/route.js.nft.json +1 -1
  48. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/builds/[buildId]/page.js.nft.json +1 -1
  49. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/builds/[buildId]/page_client-reference-manifest.js +1 -1
  50. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/builds/configurations/[configurationId]/page.js.nft.json +1 -1
  51. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/builds/configurations/[configurationId]/page_client-reference-manifest.js +1 -1
  52. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/builds/page.js.nft.json +1 -1
  53. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/builds/page_client-reference-manifest.js +1 -1
  54. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/changes/page.js.nft.json +1 -1
  55. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/changes/page_client-reference-manifest.js +1 -1
  56. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/codebases/[codebaseId]/page.js.nft.json +1 -1
  57. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/codebases/[codebaseId]/page_client-reference-manifest.js +1 -1
  58. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/codebases/page.js.nft.json +1 -1
  59. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/codebases/page_client-reference-manifest.js +1 -1
  60. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/codebases/repositories/[repositoryId]/page.js.nft.json +1 -1
  61. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/codebases/repositories/[repositoryId]/page_client-reference-manifest.js +1 -1
  62. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/commands/[commandId]/edit/page.js.nft.json +1 -1
  63. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/commands/[commandId]/edit/page_client-reference-manifest.js +1 -1
  64. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/commands/new/page.js.nft.json +1 -1
  65. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/commands/new/page_client-reference-manifest.js +1 -1
  66. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/commands/page.js.nft.json +1 -1
  67. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/commands/page_client-reference-manifest.js +1 -1
  68. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/commands/runs/[runId]/output/route.js.nft.json +1 -1
  69. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/commands/runs/[runId]/page.js.nft.json +1 -1
  70. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/commands/runs/[runId]/page_client-reference-manifest.js +1 -1
  71. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/jobs/[jobId]/page.js.nft.json +1 -1
  72. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/jobs/[jobId]/page_client-reference-manifest.js +1 -1
  73. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/notifications/page.js.nft.json +1 -1
  74. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/notifications/page_client-reference-manifest.js +1 -1
  75. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/workflows/[workflowId]/edit/page.js.nft.json +1 -1
  76. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/workflows/[workflowId]/edit/page_client-reference-manifest.js +1 -1
  77. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/workflows/[workflowId]/page.js.nft.json +1 -1
  78. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/workflows/[workflowId]/page_client-reference-manifest.js +1 -1
  79. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/workflows/new/page.js.nft.json +1 -1
  80. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/workflows/new/page_client-reference-manifest.js +1 -1
  81. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/workflows/page.js.nft.json +1 -1
  82. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/workflows/page_client-reference-manifest.js +1 -1
  83. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/workflows/runs/[runId]/page.js.nft.json +1 -1
  84. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/workflows/runs/[runId]/page_client-reference-manifest.js +1 -1
  85. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/worktrees/[worktreeId]/page.js.nft.json +1 -1
  86. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/worktrees/[worktreeId]/page_client-reference-manifest.js +1 -1
  87. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/worktrees/page.js.nft.json +1 -1
  88. package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/worktrees/page_client-reference-manifest.js +1 -1
  89. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/analytics-events/page.js.nft.json +1 -1
  90. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/analytics-events/page_client-reference-manifest.js +1 -1
  91. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/console-logs/page.js.nft.json +1 -1
  92. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/console-logs/page_client-reference-manifest.js +1 -1
  93. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/crashes/[crashId]/page.js.nft.json +1 -1
  94. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/crashes/[crashId]/page_client-reference-manifest.js +1 -1
  95. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/crashes/dsyms/[dsymId]/page.js.nft.json +1 -1
  96. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/crashes/dsyms/[dsymId]/page_client-reference-manifest.js +1 -1
  97. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/crashes/dsyms/page.js.nft.json +1 -1
  98. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/crashes/dsyms/page_client-reference-manifest.js +1 -1
  99. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/crashes/page.js.nft.json +1 -1
  100. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/crashes/page_client-reference-manifest.js +1 -1
  101. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/push-notifications/page.js.nft.json +1 -1
  102. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/push-notifications/page_client-reference-manifest.js +1 -1
  103. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/[endpointId]/mocks/page.js.nft.json +1 -1
  104. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/[endpointId]/mocks/page_client-reference-manifest.js +1 -1
  105. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/[endpointId]/page.js.nft.json +1 -1
  106. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/[endpointId]/page_client-reference-manifest.js +1 -1
  107. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/breakpoints/page.js.nft.json +1 -1
  108. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/breakpoints/page_client-reference-manifest.js +1 -1
  109. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/history/[requestId]/page.js.nft.json +1 -1
  110. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/history/[requestId]/page_client-reference-manifest.js +1 -1
  111. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/history/page.js.nft.json +1 -1
  112. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/history/page_client-reference-manifest.js +1 -1
  113. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/new/page.js.nft.json +1 -1
  114. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/new/page_client-reference-manifest.js +1 -1
  115. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/page.js.nft.json +1 -1
  116. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/page_client-reference-manifest.js +1 -1
  117. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/storage/page.js.nft.json +1 -1
  118. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/storage/page_client-reference-manifest.js +1 -1
  119. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/unified-events/page.js.nft.json +1 -1
  120. package/standalone/.next/server/app/[locale]/(dashboard)/debugging/unified-events/page_client-reference-manifest.js +1 -1
  121. package/standalone/.next/server/app/[locale]/(dashboard)/github/actions/page.js.nft.json +1 -1
  122. package/standalone/.next/server/app/[locale]/(dashboard)/github/actions/page_client-reference-manifest.js +1 -1
  123. package/standalone/.next/server/app/[locale]/(dashboard)/github/actions-cache/page.js.nft.json +1 -1
  124. package/standalone/.next/server/app/[locale]/(dashboard)/github/actions-cache/page_client-reference-manifest.js +1 -1
  125. package/standalone/.next/server/app/[locale]/(dashboard)/github/cache/entries/[id]/page.js.nft.json +1 -1
  126. package/standalone/.next/server/app/[locale]/(dashboard)/github/cache/entries/[id]/page_client-reference-manifest.js +1 -1
  127. package/standalone/.next/server/app/[locale]/(dashboard)/github/cache/page.js.nft.json +1 -1
  128. package/standalone/.next/server/app/[locale]/(dashboard)/github/cache/page_client-reference-manifest.js +1 -1
  129. package/standalone/.next/server/app/[locale]/(dashboard)/github/comments/page.js.nft.json +1 -1
  130. package/standalone/.next/server/app/[locale]/(dashboard)/github/comments/page_client-reference-manifest.js +1 -1
  131. package/standalone/.next/server/app/[locale]/(dashboard)/github/pull-requests/[owner]/[repository]/[number]/page.js.nft.json +1 -1
  132. package/standalone/.next/server/app/[locale]/(dashboard)/github/pull-requests/[owner]/[repository]/[number]/page_client-reference-manifest.js +1 -1
  133. package/standalone/.next/server/app/[locale]/(dashboard)/github/pull-requests/page.js.nft.json +1 -1
  134. package/standalone/.next/server/app/[locale]/(dashboard)/github/pull-requests/page_client-reference-manifest.js +1 -1
  135. package/standalone/.next/server/app/[locale]/(dashboard)/github/webhooks/page.js.nft.json +1 -1
  136. package/standalone/.next/server/app/[locale]/(dashboard)/github/webhooks/page_client-reference-manifest.js +1 -1
  137. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/cache/page.js.nft.json +1 -1
  138. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/cache/page_client-reference-manifest.js +1 -1
  139. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/comments/page.js.nft.json +1 -1
  140. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/comments/page_client-reference-manifest.js +1 -1
  141. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/merge-requests/[projectId]/[iid]/page.js.nft.json +1 -1
  142. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/merge-requests/[projectId]/[iid]/page_client-reference-manifest.js +1 -1
  143. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/merge-requests/page.js.nft.json +1 -1
  144. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/merge-requests/page_client-reference-manifest.js +1 -1
  145. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/pipelines/page.js.nft.json +1 -1
  146. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/pipelines/page_client-reference-manifest.js +1 -1
  147. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/webhooks/page.js.nft.json +1 -1
  148. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/webhooks/page_client-reference-manifest.js +1 -1
  149. package/standalone/.next/server/app/[locale]/(dashboard)/jira/cache/page.js.nft.json +1 -1
  150. package/standalone/.next/server/app/[locale]/(dashboard)/jira/cache/page_client-reference-manifest.js +1 -1
  151. package/standalone/.next/server/app/[locale]/(dashboard)/jira/cache/tickets/[issueKey]/page.js.nft.json +1 -1
  152. package/standalone/.next/server/app/[locale]/(dashboard)/jira/cache/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
  153. package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/[issueKey]/page.js.nft.json +1 -1
  154. package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
  155. package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/page.js.nft.json +1 -1
  156. package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/page_client-reference-manifest.js +1 -1
  157. package/standalone/.next/server/app/[locale]/(dashboard)/jira/webhooks/page.js.nft.json +1 -1
  158. package/standalone/.next/server/app/[locale]/(dashboard)/jira/webhooks/page_client-reference-manifest.js +1 -1
  159. package/standalone/.next/server/app/[locale]/(dashboard)/system/api-keys/page.js.nft.json +1 -1
  160. package/standalone/.next/server/app/[locale]/(dashboard)/system/api-keys/page_client-reference-manifest.js +1 -1
  161. package/standalone/.next/server/app/[locale]/(dashboard)/system/build-data/page.js.nft.json +1 -1
  162. package/standalone/.next/server/app/[locale]/(dashboard)/system/build-data/page_client-reference-manifest.js +1 -1
  163. package/standalone/.next/server/app/[locale]/(dashboard)/system/connected-applications/page.js.nft.json +1 -1
  164. package/standalone/.next/server/app/[locale]/(dashboard)/system/connected-applications/page_client-reference-manifest.js +1 -1
  165. package/standalone/.next/server/app/[locale]/(dashboard)/system/credentials/page.js.nft.json +1 -1
  166. package/standalone/.next/server/app/[locale]/(dashboard)/system/credentials/page_client-reference-manifest.js +1 -1
  167. package/standalone/.next/server/app/[locale]/(dashboard)/system/devices/[id]/page.js.nft.json +1 -1
  168. package/standalone/.next/server/app/[locale]/(dashboard)/system/devices/[id]/page_client-reference-manifest.js +1 -1
  169. package/standalone/.next/server/app/[locale]/(dashboard)/system/devices/enroll/page.js.nft.json +1 -1
  170. package/standalone/.next/server/app/[locale]/(dashboard)/system/devices/enroll/page_client-reference-manifest.js +1 -1
  171. package/standalone/.next/server/app/[locale]/(dashboard)/system/devices/page.js.nft.json +1 -1
  172. package/standalone/.next/server/app/[locale]/(dashboard)/system/devices/page_client-reference-manifest.js +1 -1
  173. package/standalone/.next/server/app/[locale]/(dashboard)/system/polling/page.js.nft.json +1 -1
  174. package/standalone/.next/server/app/[locale]/(dashboard)/system/polling/page_client-reference-manifest.js +1 -1
  175. package/standalone/.next/server/app/[locale]/(dashboard)/system/prepare/page.js.nft.json +1 -1
  176. package/standalone/.next/server/app/[locale]/(dashboard)/system/prepare/page_client-reference-manifest.js +1 -1
  177. package/standalone/.next/server/app/[locale]/(dashboard)/system/provisioning-profiles/[profileId]/page.js.nft.json +1 -1
  178. package/standalone/.next/server/app/[locale]/(dashboard)/system/provisioning-profiles/[profileId]/page_client-reference-manifest.js +1 -1
  179. package/standalone/.next/server/app/[locale]/(dashboard)/system/provisioning-profiles/page.js.nft.json +1 -1
  180. package/standalone/.next/server/app/[locale]/(dashboard)/system/provisioning-profiles/page_client-reference-manifest.js +1 -1
  181. package/standalone/.next/server/app/[locale]/(dashboard)/system/settings/page.js.nft.json +1 -1
  182. package/standalone/.next/server/app/[locale]/(dashboard)/system/settings/page_client-reference-manifest.js +1 -1
  183. package/standalone/.next/server/app/[locale]/(dashboard)/system/status/page.js.nft.json +1 -1
  184. package/standalone/.next/server/app/[locale]/(dashboard)/system/status/page_client-reference-manifest.js +1 -1
  185. package/standalone/.next/server/app/[locale]/(dashboard)/system/tailscale/page.js.nft.json +1 -1
  186. package/standalone/.next/server/app/[locale]/(dashboard)/system/tailscale/page_client-reference-manifest.js +1 -1
  187. package/standalone/.next/server/app/[locale]/(dashboard)/system/tools/page.js.nft.json +1 -1
  188. package/standalone/.next/server/app/[locale]/(dashboard)/system/tools/page_client-reference-manifest.js +1 -1
  189. package/standalone/.next/server/app/[locale]/(dashboard)/system/users/page.js.nft.json +1 -1
  190. package/standalone/.next/server/app/[locale]/(dashboard)/system/users/page_client-reference-manifest.js +1 -1
  191. package/standalone/.next/server/app/[locale]/(mcp)/mcp/consent/page.js.nft.json +1 -1
  192. package/standalone/.next/server/app/[locale]/(mcp)/mcp/consent/page_client-reference-manifest.js +1 -1
  193. package/standalone/.next/server/app/[locale]/(mcp)/mcp/sign-in/page.js.nft.json +1 -1
  194. package/standalone/.next/server/app/[locale]/(mcp)/mcp/sign-in/page_client-reference-manifest.js +1 -1
  195. package/standalone/.next/server/app/[locale]/page.js.nft.json +1 -1
  196. package/standalone/.next/server/app/[locale]/page_client-reference-manifest.js +1 -1
  197. package/standalone/.next/server/app/_global-error.html +1 -1
  198. package/standalone/.next/server/app/_global-error.rsc +1 -1
  199. package/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  200. package/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  201. package/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  202. package/standalone/.next/server/app/_not-found.html +1 -1
  203. package/standalone/.next/server/app/_not-found.rsc +1 -1
  204. package/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  205. package/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  206. package/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  207. package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/complete/route.js +1 -1
  208. package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/complete/route.js.nft.json +1 -1
  209. package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/download/route.js +1 -1
  210. package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/download/route.js.nft.json +1 -1
  211. package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/route.js +1 -1
  212. package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/route.js.nft.json +1 -1
  213. package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/upload/route.js +1 -1
  214. package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/upload/route.js.nft.json +1 -1
  215. package/standalone/.next/server/app/api/agent/dsyms/[dsymId]/dwarf/route.js.nft.json +1 -1
  216. package/standalone/.next/server/app/api/agent/run-attachments/[attachmentId]/route.js +1 -1
  217. package/standalone/.next/server/app/api/agent/run-attachments/[attachmentId]/route.js.nft.json +1 -1
  218. package/standalone/.next/server/app/api/build-artifact-uploads/[uploadId]/route.js +1 -1
  219. package/standalone/.next/server/app/api/build-artifact-uploads/[uploadId]/route.js.nft.json +1 -1
  220. package/standalone/.next/server/app/api/codebases/by-path/route.js.nft.json +1 -1
  221. package/standalone/.next/server/app/api/codebases/route.js.nft.json +1 -1
  222. package/standalone/.next/server/app/api/crash-files/dsyms/[dsymId]/route.js.nft.json +1 -1
  223. package/standalone/.next/server/app/api/crash-files/reports/[crashId]/route.js.nft.json +1 -1
  224. package/standalone/.next/server/app/api/dsyms/route.js.nft.json +1 -1
  225. package/standalone/.next/server/app/api/dsyms/uploads/[uploadId]/complete/route.js.nft.json +1 -1
  226. package/standalone/.next/server/app/api/dsyms/uploads/[uploadId]/route.js.nft.json +1 -1
  227. package/standalone/.next/server/app/api/dsyms/uploads/route.js.nft.json +1 -1
  228. package/standalone/.next/server/app/api/graphql/route.js +1 -1
  229. package/standalone/.next/server/app/api/graphql/route.js.nft.json +1 -1
  230. package/standalone/.next/server/app/api/ios/apns-devices/route.js +2 -2
  231. package/standalone/.next/server/app/api/ios/apns-devices/route.js.nft.json +1 -1
  232. package/standalone/.next/server/app/api/ios/devices/export.tsv/route.js.nft.json +1 -1
  233. package/standalone/.next/server/app/api/ios/enrollment/start/route.js.nft.json +1 -1
  234. package/standalone/.next/server/app/api/ios/notification-devices/route.js +2 -2
  235. package/standalone/.next/server/app/api/ios/notification-devices/route.js.nft.json +1 -1
  236. package/standalone/.next/server/app/api/mcp/route.js.nft.json +1 -1
  237. package/standalone/.next/server/app/api/openapi.json/route.js.nft.json +1 -1
  238. package/standalone/.next/server/app/api/public/builds/[buildId]/artifacts/[artifactId]/manifest.plist/route.js.nft.json +1 -1
  239. package/standalone/.next/server/app/api/public/builds/[buildId]/artifacts/[artifactId]/route.js.nft.json +1 -1
  240. package/standalone/.next/server/app/api/public/crashes/route.js.nft.json +1 -1
  241. package/standalone/.next/server/app/api/public/github/webhook/route.js.nft.json +1 -1
  242. package/standalone/.next/server/app/api/public/gitlab/webhook/route.js.nft.json +1 -1
  243. package/standalone/.next/server/app/api/public/ios/enrollment-profile/route.js.nft.json +1 -1
  244. package/standalone/.next/server/app/api/public/ios/profile-response/route.js.nft.json +1 -1
  245. package/standalone/.next/server/app/api/public/jira/webhook/route.js.nft.json +1 -1
  246. package/standalone/.next/server/app/api/public/sse/[token]/route.js.nft.json +1 -1
  247. package/standalone/.next/server/app/api/run-attachments/[attachmentId]/route.js.nft.json +1 -1
  248. package/standalone/.next/server/app/api/run-attachments/route.js.nft.json +1 -1
  249. package/standalone/.next/server/app/api/sse/history/export/route.js.nft.json +1 -1
  250. package/standalone/.next/server/app/api/telemetry/analytics-events/route.js.nft.json +1 -1
  251. package/standalone/.next/server/app/api/telemetry/console-logs/route.js.nft.json +1 -1
  252. package/standalone/.next/server/app/api/telemetry/export/route.js.nft.json +1 -1
  253. package/standalone/.next/server/app/api/tools/call/route.js.nft.json +1 -1
  254. package/standalone/.next/server/app/api/tools/catalog/route.js.nft.json +1 -1
  255. package/standalone/.next/server/app/api/worktrees/[worktreeId]/diff-image/route.js.nft.json +1 -1
  256. package/standalone/.next/server/chunks/{[root-of-the-server]__013jjy8_tp5xo._.js → [root-of-the-server]__00iwkfurpc0x0._.js} +1 -1
  257. package/standalone/.next/server/chunks/{[root-of-the-server]__06f1gskg4t5ra._.js → [root-of-the-server]__085kh_xzq74pi._.js} +1 -1
  258. package/standalone/.next/server/chunks/{[root-of-the-server]__0ls_xfg-o69ws._.js → [root-of-the-server]__0b95wr93hpccm._.js} +1 -1
  259. package/standalone/.next/server/chunks/{[root-of-the-server]__0dy3_w5i5avqu._.js → [root-of-the-server]__0dqcl3ne9jy6j._.js} +1 -1
  260. package/standalone/.next/server/chunks/{[root-of-the-server]__0ihief9wd15j-._.js → [root-of-the-server]__0ernvc_drsyur._.js} +1 -1
  261. package/standalone/.next/server/chunks/{[root-of-the-server]__0nazqxkz69cb-._.js → [root-of-the-server]__0gdpss1ozbpj6._.js} +1 -1
  262. package/standalone/.next/server/chunks/{[root-of-the-server]__0fdv7ezffrnb8._.js → [root-of-the-server]__0n0aoxk6qal2q._.js} +1 -1
  263. package/standalone/.next/server/chunks/{[root-of-the-server]__103-o8iatm04o._.js → [root-of-the-server]__0pb0of35lhv4r._.js} +2 -2
  264. package/standalone/.next/server/chunks/{[root-of-the-server]__0jo85vtp06p8k._.js → [root-of-the-server]__0pb4bln2irwf1._.js} +1 -1
  265. package/standalone/.next/server/chunks/{[root-of-the-server]__0mf1u6efc98j1._.js → [root-of-the-server]__0q_f0b_y6m06s._.js} +1 -1
  266. package/standalone/.next/server/chunks/{[root-of-the-server]__0867t3wdit4oo._.js → [root-of-the-server]__0r5hav-f6hg4y._.js} +2 -2
  267. package/standalone/.next/server/chunks/{[root-of-the-server]__0te36hr8zjt5a._.js → [root-of-the-server]__0rfsymbgl5zmz._.js} +2 -2
  268. package/standalone/.next/server/chunks/{[root-of-the-server]__0mjmd0-g6img6._.js → [root-of-the-server]__0twikyj29lh-8._.js} +1 -1
  269. package/standalone/.next/server/chunks/{[root-of-the-server]__0jqrn7hnkezim._.js → [root-of-the-server]__0uj03p6vvvoox._.js} +1 -1
  270. package/standalone/.next/server/chunks/{[root-of-the-server]__02w866s8cv03o._.js → [root-of-the-server]__0vqqb799ovs3f._.js} +2 -2
  271. package/standalone/.next/server/chunks/{[root-of-the-server]__0o0xdssylq9hn._.js → [root-of-the-server]__0wpet49k-mtfs._.js} +2 -2
  272. package/standalone/.next/server/chunks/[root-of-the-server]__0zdbzx4i-waj1._.js +3 -0
  273. package/standalone/.next/server/chunks/{[root-of-the-server]__064yhuqdlomcc._.js → [root-of-the-server]__0zo4-ogstcigk._.js} +1 -1
  274. package/standalone/.next/server/chunks/{[root-of-the-server]__02inw6-w863p6._.js → [root-of-the-server]__1-80xb-l8bnx8._.js} +1 -1
  275. package/standalone/.next/server/chunks/[root-of-the-server]__10hjc82wl2rrg._.js +3 -0
  276. package/standalone/.next/server/chunks/[root-of-the-server]__13a6nglsddnmp._.js +3 -0
  277. package/standalone/.next/server/chunks/{[root-of-the-server]__016k_dvgtq4np._.js → [root-of-the-server]__15rnf_muhindu._.js} +2 -2
  278. package/standalone/.next/server/chunks/{[root-of-the-server]__01uprimny6xf6._.js → [root-of-the-server]__17e3j_fplgxlt._.js} +1 -1
  279. package/standalone/.next/server/chunks/{[root-of-the-server]__0lfp2twrecdmg._.js → [root-of-the-server]__18549u75hk0zc._.js} +1 -1
  280. package/standalone/.next/server/chunks/{[root-of-the-server]__0q00u15k45x_y._.js → [root-of-the-server]__1aktlm6bxadr9._.js} +1 -1
  281. package/standalone/.next/server/chunks/[root-of-the-server]__1cdu86kwjpucp._.js +3 -0
  282. package/standalone/.next/server/chunks/[root-of-the-server]__1fyo1xks_hnke._.js +3 -0
  283. package/standalone/.next/server/chunks/[root-of-the-server]__1h19tyu2_us3g._.js +3 -0
  284. package/standalone/.next/server/chunks/[root-of-the-server]__1jv6n33tz33mq._.js +3 -0
  285. package/standalone/.next/server/chunks/[root-of-the-server]__1nz79np-vsmai._.js +3 -0
  286. package/standalone/.next/server/chunks/[root-of-the-server]__1p7-v5i6_c02i._.js +3 -0
  287. package/standalone/.next/server/chunks/[root-of-the-server]__1qkmdb5cuuvm2._.js +3 -0
  288. package/standalone/.next/server/chunks/[root-of-the-server]__1w7ym0rrtb0i-._.js +3 -0
  289. package/standalone/.next/server/chunks/[root-of-the-server]__1ymepgwm4cf20._.js +3 -0
  290. package/standalone/.next/server/chunks/[root-of-the-server]__20in07t-hzagn._.js +3 -0
  291. package/standalone/.next/server/chunks/_00m3rl49dioc5._.js +2 -2
  292. package/standalone/.next/server/chunks/_01xc_0zvoyeyx._.js +34 -6
  293. package/standalone/.next/server/chunks/_02hp9azf0wdup._.js +1 -1
  294. package/standalone/.next/server/chunks/_093bw72t0qhum._.js +1 -1
  295. package/standalone/.next/server/chunks/_0d-5v8n_htaud._.js +1 -1
  296. package/standalone/.next/server/chunks/_0d7kp9zewgzo1._.js +2 -2
  297. package/standalone/.next/server/chunks/_0dudkod891pw5._.js +3 -3
  298. package/standalone/.next/server/chunks/_0j7luifqpmd6_._.js +2 -2
  299. package/standalone/.next/server/chunks/_0locehugaxjku._.js +2 -2
  300. package/standalone/.next/server/chunks/_0w3t6yq0vzl4e._.js +1 -1
  301. package/standalone/.next/server/chunks/_0y5_6jpmf7x6s._.js +29 -1
  302. package/standalone/.next/server/chunks/_0zco7_ov6mcxo._.js +2 -2
  303. package/standalone/.next/server/chunks/_115xin0kz2fip._.js +3 -3
  304. package/standalone/.next/server/chunks/_12hy44_5ttvdf._.js +1 -1
  305. package/standalone/.next/server/chunks/_16ok4m6i7ixom._.js +1 -1
  306. package/standalone/.next/server/chunks/_19p9fduxrv2k5._.js +1 -1
  307. package/standalone/.next/server/chunks/_1_s18hw5f5luk._.js +1 -1
  308. package/standalone/.next/server/chunks/_1f-fkpn7r9h91._.js +3 -3
  309. package/standalone/.next/server/chunks/_1l_e477qf2_nl._.js +2 -2
  310. package/standalone/.next/server/chunks/_1m_66q0249ksj._.js +34 -6
  311. package/standalone/.next/server/chunks/_1tf-vrjf16ebm._.js +1 -1
  312. package/standalone/.next/server/chunks/_1uio0t8zcf1gc._.js +1 -1
  313. package/standalone/.next/server/chunks/_1wrauglm0po8g._.js +2 -2
  314. package/standalone/.next/server/chunks/_20mbq9d_-vcjz._.js +1 -1
  315. package/standalone/.next/server/chunks/src_services_0shipcub2yhy6._.js +1 -1
  316. package/standalone/.next/server/chunks/ssr/_0-efhkzh6ytuc._.js +4 -1
  317. package/standalone/.next/server/chunks/ssr/_01tmqlwi5urdh._.js +4 -1
  318. package/standalone/.next/server/chunks/ssr/_05hrnr_dqieci._.js +4 -1
  319. package/standalone/.next/server/chunks/ssr/_09frr_x9sj064._.js +5 -5
  320. package/standalone/.next/server/chunks/ssr/_0b_41u6xr2bpb._.js +4 -1
  321. package/standalone/.next/server/chunks/ssr/_0wpoapzcyfgyq._.js +5 -5
  322. package/standalone/.next/server/chunks/ssr/_0x-yk4-j0jzr_._.js +5 -5
  323. package/standalone/.next/server/chunks/ssr/_10ljfb0azxzug._.js +4 -1
  324. package/standalone/.next/server/chunks/ssr/_18-1310mrai6k._.js +1 -1
  325. package/standalone/.next/server/chunks/ssr/messages_de_json_[json]_cjs_1uig1ud36h5oz._.js +1 -1
  326. package/standalone/.next/server/chunks/ssr/messages_en_json_[json]_cjs_206072-e4clp3._.js +1 -1
  327. package/standalone/.next/server/chunks/ssr/messages_es_json_[json]_cjs_082yukd_h99n8._.js +1 -1
  328. package/standalone/.next/server/chunks/ssr/messages_fr_json_[json]_cjs_0j6-w0ix_w_ac._.js +1 -1
  329. package/standalone/.next/server/chunks/ssr/src_components_github_merge-pull-request-button_tsx_0ie9278wjani8._.js +4 -4
  330. package/standalone/.next/server/chunks/ssr/src_components_runs_run-detail-page_tsx_0eje87-gx_hru._.js +1 -1
  331. package/standalone/.next/server/chunks/ssr/src_components_telemetry_telemetry-page_tsx_0yzdpy67zpdxv._.js +12 -12
  332. package/standalone/.next/server/middleware-build-manifest.js +3 -3
  333. package/standalone/.next/server/pages/404.html +1 -1
  334. package/standalone/.next/server/pages/500.html +1 -1
  335. package/standalone/.next/server/preview-props.json +3 -3
  336. package/standalone/.next/server/server-reference-manifest.js +1 -1
  337. package/standalone/.next/server/server-reference-manifest.json +1 -1
  338. package/standalone/.next/static/chunks/0ntk3pefienee.js +74 -0
  339. package/standalone/.next/static/chunks/{3_jy_qgwcgmn3.js → 14kti20ptdk3_.js} +1 -1
  340. package/standalone/.next/static/chunks/19qk_mg79rhyl.css +1 -0
  341. package/standalone/.next/static/chunks/{3_zfruxk01zuz.js → 1e332a5q9nxel.js} +5 -2
  342. package/standalone/.next/static/chunks/28saicmp1_h9d.js +6 -0
  343. package/standalone/.next/static/chunks/{0-5ysfaxu6aan.js → 2d07_4-p-edmw.js} +8 -5
  344. package/standalone/.next/static/chunks/{32mx1gp4arbt_.js → 2efwkyl82sglw.js} +5 -5
  345. package/standalone/.next/static/chunks/{42k7pln5sl3oz.js → 2yh26beqzug_m.js} +4 -1
  346. package/standalone/.next/static/chunks/{2r8eetg_rh89t.js → 2za-zornp6w1i.js} +7 -4
  347. package/standalone/.next/static/chunks/{0uyjb26ic9ght.js → 3_q7pq1wb2d40.js} +8 -5
  348. package/standalone/.next/static/chunks/{0j0ja7mw0m3um.js → 3kdlr1xpqonpk.js} +4 -4
  349. package/standalone/packages/agent-contract/src/runs.test.ts +85 -1
  350. package/standalone/packages/agent-contract/src/runs.ts +71 -0
  351. package/standalone/.next/server/chunks/[root-of-the-server]__0yel_6ygv-b1q._.js +0 -3
  352. package/standalone/.next/server/chunks/[root-of-the-server]__11maut7kzgbir._.js +0 -3
  353. package/standalone/.next/server/chunks/[root-of-the-server]__13gc7j8v7vuh0._.js +0 -3
  354. package/standalone/.next/server/chunks/[root-of-the-server]__1a8-wn63eojbf._.js +0 -3
  355. package/standalone/.next/server/chunks/[root-of-the-server]__1ezzodrqye_k8._.js +0 -3
  356. package/standalone/.next/server/chunks/[root-of-the-server]__1iz-2u-1z1_wl._.js +0 -3
  357. package/standalone/.next/server/chunks/[root-of-the-server]__1j1n2lzndr33r._.js +0 -3
  358. package/standalone/.next/server/chunks/[root-of-the-server]__1muq_0k53s3ch._.js +0 -3
  359. package/standalone/.next/server/chunks/[root-of-the-server]__1p4d5mk5s-hn3._.js +0 -3
  360. package/standalone/.next/server/chunks/[root-of-the-server]__1qlb8l11-wp5b._.js +0 -3
  361. package/standalone/.next/server/chunks/[root-of-the-server]__1qpqa-yffw6l1._.js +0 -3
  362. package/standalone/.next/server/chunks/[root-of-the-server]__1r8sh0sbv66af._.js +0 -3
  363. package/standalone/.next/server/chunks/[root-of-the-server]__1rvzmcinwhc9f._.js +0 -3
  364. package/standalone/.next/static/chunks/0nab6cwtymfd9.js +0 -6
  365. package/standalone/.next/static/chunks/2sxkr-ertr4d-.js +0 -74
  366. package/standalone/.next/static/chunks/3x93y46q6oe51.css +0 -1
  367. /package/standalone/.next/static/{QCl5bKQ9cBiF-g9fxs6IK → _Jso-9p3y6xgFDkMzfmcW}/_buildManifest.js +0 -0
  368. /package/standalone/.next/static/{QCl5bKQ9cBiF-g9fxs6IK → _Jso-9p3y6xgFDkMzfmcW}/_clientMiddlewareManifest.js +0 -0
  369. /package/standalone/.next/static/{QCl5bKQ9cBiF-g9fxs6IK → _Jso-9p3y6xgFDkMzfmcW}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- module.exports=[205956,a=>{"use strict";var b=a.i(187924),c=a.i(105606),d=a.i(519783),e=a.i(415925),f=a.i(572131),g=a.i(555027),h=a.i(129965),i=a.i(124348),j=a.i(699570),k=a.i(795225),l=a.i(866718),m=a.i(870430),n=a.i(580701),o=a.i(668684),p=a.i(429246),q=a.i(460280),r=a.i(16603);let s="__github_account_default__";a.s(["f",0,function({pullRequest:a,onMerged:t,size:u="sm",variant:v="outline",open:w,onOpenChange:x,showTrigger:y=!0,requestSource:z,worktreeId:A}){let B=(0,e.f)("pullRequests"),[C,D]=(0,f.useState)(!1),[E,F]=(0,f.useState)(null),[G,H]=(0,f.useState)(""),[I,J]=(0,f.useState)(""),[K,L]=(0,f.useState)(""),[M,N]=(0,f.useState)(s),[O,P]=(0,f.useState)([]),[Q,R]=(0,f.useState)(!1),[S,T]=(0,f.useState)(!1),[U,V]=(0,f.useState)(null),[W,X]=(0,f.useState)(!1),[Y,Z]=(0,f.useState)(!1),[$,_]=(0,f.useState)(null),[aa,ab]=(0,f.useState)(!1),[ac,ad]=(0,f.useState)(0),[ae="",af=""]=a.repositoryNameWithOwner.split("/",2),ag=w??C,ah=a=>{a||(U&&(V(null),t?.(U)),X(!1),F(null),_(null)),void 0===w&&D(a),x?.(a)};(0,f.useEffect)(()=>{if(!ag)return;let b=!0,c=window.setTimeout(()=>{X(!0),F(null),_(null),(0,q.W)(`query GitHubPullRequestMergeOptions(
1
+ module.exports=[205956,a=>{"use strict";var b=a.i(187924),c=a.i(105606),d=a.i(519783),e=a.i(415925),f=a.i(572131),g=a.i(555027),h=a.i(129965),i=a.i(124348),j=a.i(699570),k=a.i(795225),l=a.i(866718),m=a.i(870430),n=a.i(580701),o=a.i(668684),p=a.i(429246),q=a.i(460280),r=a.i(16603);let s="__github_account_default__";a.s(["f",0,function({pullRequest:a,onMerged:t,size:u="sm",variant:v="outline",className:w,open:x,onOpenChange:y,showTrigger:z=!0,requestSource:A,worktreeId:B}){let C=(0,e.f)("pullRequests"),[D,E]=(0,f.useState)(!1),[F,G]=(0,f.useState)(null),[H,I]=(0,f.useState)(""),[J,K]=(0,f.useState)(""),[L,M]=(0,f.useState)(""),[N,O]=(0,f.useState)(s),[P,Q]=(0,f.useState)([]),[R,S]=(0,f.useState)(!1),[T,U]=(0,f.useState)(!1),[V,W]=(0,f.useState)(null),[X,Y]=(0,f.useState)(!1),[Z,$]=(0,f.useState)(!1),[_,aa]=(0,f.useState)(null),[ab,ac]=(0,f.useState)(!1),[ad,ae]=(0,f.useState)(0),[af="",ag=""]=a.repositoryNameWithOwner.split("/",2),ah=x??D,ai=a=>{a||(V&&(W(null),t?.(V)),Y(!1),G(null),aa(null)),void 0===x&&E(a),y?.(a)};(0,f.useEffect)(()=>{if(!ah)return;let b=!0,c=window.setTimeout(()=>{Y(!0),G(null),aa(null),(0,q.W)(`query GitHubPullRequestMergeOptions(
2
2
  $owner: String!
3
3
  $name: String!
4
4
  $number: Int!
@@ -23,15 +23,15 @@ module.exports=[205956,a=>{"use strict";var b=a.i(187924),c=a.i(105606),d=a.i(51
23
23
  autoMergeOperation { autoSync state lastError }
24
24
  blockedReason
25
25
  }
26
- }`,{owner:ae,name:af,number:a.number,source:z,worktreeId:A}).then(a=>{if(!b)return;let c=a.githubPullRequestMergeOptions;F(c),ab(c.defaultAutoSync??!1),P(c.baseBranchUpdateOptions?.selectedWorktreeIds??[]),H(c.defaultMethod??c.availableMethods[0]??""),R(!!(c.canDeleteWorktree&&c.defaultDeleteWorktree)),T(!!(c.ticketKey&&c.defaultMoveTicketToDone)),J(c.defaultCommitHeadline),L(c.defaultCommitBody),N(c.defaultCommitEmail??s)}).catch(a=>{b&&_(a instanceof Error?a.message:String(a))}).finally(()=>{b&&X(!1)})},0);return()=>{b=!1,window.clearTimeout(c)}},[af,ag,ae,a.number,z,A,ac]);let ai=E?.autoMergeOperation,aj=!!(ai?.autoSync&&["SYNCING","WAITING_CI","WAITING_REQUIREMENTS","MERGING"].includes(ai.state)),ak=async()=>{if(E&&G&&(aa?E?.canAutoMergeWithSync:E?.canMerge)&&I.trim()&&!U&&(!S||E.ticketDoneStatusConfigured)){Z(!0),_(null);try{if(aa&&E?.worktreeId){await (0,q.W)(`mutation ConfigureWorktreeAutoMerge($input: ConfigureWorktreeAutoMergeInput!) {
26
+ }`,{owner:af,name:ag,number:a.number,source:A,worktreeId:B}).then(a=>{if(!b)return;let c=a.githubPullRequestMergeOptions;G(c),ac(c.defaultAutoSync??!1),Q(c.baseBranchUpdateOptions?.selectedWorktreeIds??[]),I(c.defaultMethod??c.availableMethods[0]??""),S(!!(c.canDeleteWorktree&&c.defaultDeleteWorktree)),U(!!(c.ticketKey&&c.defaultMoveTicketToDone)),K(c.defaultCommitHeadline),M(c.defaultCommitBody),O(c.defaultCommitEmail??s)}).catch(a=>{b&&aa(a instanceof Error?a.message:String(a))}).finally(()=>{b&&Y(!1)})},0);return()=>{b=!1,window.clearTimeout(c)}},[ag,ah,af,a.number,A,B,ad]);let aj=F?.autoMergeOperation,ak=!!(aj?.autoSync&&["SYNCING","WAITING_CI","WAITING_REQUIREMENTS","MERGING"].includes(aj.state)),al=async()=>{if(F&&H&&(ab?F?.canAutoMergeWithSync:F?.canMerge)&&J.trim()&&!V&&(!T||F.ticketDoneStatusConfigured)){$(!0),aa(null);try{if(ab&&F?.worktreeId){await (0,q.W)(`mutation ConfigureWorktreeAutoMerge($input: ConfigureWorktreeAutoMergeInput!) {
27
27
  configureWorktreeAutoMerge(input: $input) { worktreeId state autoSync }
28
- }`,{input:{worktreeId:E.worktreeId,repositoryNameWithOwner:a.repositoryNameWithOwner,pullRequestNumber:a.number,autoSync:!0,expectedHeadSha:E.headRefOid,method:G,commitHeadline:I,commitBody:K,authorEmail:M===s?null:M,deleteWorktree:Q,moveTicketToDone:S,...O.length&&E.baseBranchUpdateOptions?.destinationBaseBranch?{baseBranchUpdate:{worktreeIds:O,destinationBaseBranch:E.baseBranchUpdateOptions.destinationBaseBranch}}:{}}}),ah(!1);return}let b=await (0,q.W)(`mutation MergeGitHubPullRequest(
28
+ }`,{input:{worktreeId:F.worktreeId,repositoryNameWithOwner:a.repositoryNameWithOwner,pullRequestNumber:a.number,autoSync:!0,expectedHeadSha:F.headRefOid,method:H,commitHeadline:J,commitBody:L,authorEmail:N===s?null:N,deleteWorktree:R,moveTicketToDone:T,...P.length&&F.baseBranchUpdateOptions?.destinationBaseBranch?{baseBranchUpdate:{worktreeIds:P,destinationBaseBranch:F.baseBranchUpdateOptions.destinationBaseBranch}}:{}}}),ai(!1);return}let b=await (0,q.W)(`mutation MergeGitHubPullRequest(
29
29
  $input: MergeGitHubPullRequestInput!
30
30
  $source: GitHubRequestSource!
31
31
  ) {
32
32
  mergeGitHubPullRequest(input: $input, source: $source) {
33
33
  id state url mergedAt postMergeError ticketKey
34
34
  }
35
- }`,{input:{owner:ae,name:af,number:a.number,method:G,commitHeadline:I,commitBody:K,authorEmail:M===s?null:M,worktreeId:A??E.worktreeId,...O.length&&E?.baseBranchUpdateOptions?.destinationBaseBranch?{baseBranchUpdate:{worktreeIds:O,destinationBaseBranch:E.baseBranchUpdateOptions.destinationBaseBranch}}:{},deleteWorktree:Q,moveTicketToDone:S},source:z});b.mergeGitHubPullRequest.postMergeError?V(b.mergeGitHubPullRequest):(ah(!1),await t?.(b.mergeGitHubPullRequest))}catch(a){_(a instanceof Error?a.message:String(a))}finally{Z(!1)}}},al=async()=>{if(E?.worktreeId&&!Y){Z(!0),_(null);try{await (0,q.W)("mutation CancelWorktreeAutoMerge($worktreeId: ID!) { cancelWorktreeAutoMerge(worktreeId: $worktreeId) }",{worktreeId:E.worktreeId}),ad(a=>a+1)}catch(a){_(a instanceof Error?a.message:String(a))}finally{Z(!1)}}},am=ai?.lastError??(aa?E?.autoSyncBlockedReason:E?.blockedReason)??null;return(0,b.jsxs)(b.Fragment,{children:[y&&(0,b.jsxs)(j.K,{onClick:a=>{a.stopPropagation(),ah(!0)},size:u,type:"button",variant:v,children:[(0,b.jsx)(c.f,{}),B("merge")]}),(0,b.jsx)(k.N,{onOpenChange:a=>{Y||ah(a)},open:ag,children:(0,b.jsxs)(k.d,{className:"sm:max-w-xl",children:[(0,b.jsxs)(k.s,{children:[(0,b.jsx)(k.F,{children:B("mergePullRequest")}),(0,b.jsx)(k.C,{children:B("mergePullRequestDescription",{repository:a.repositoryNameWithOwner,number:a.number})})]}),U?(0,b.jsx)(i.J,{children:(0,b.jsxs)(i.p,{children:[(0,b.jsx)("p",{children:B("mergedFollowUpFailed")}),(0,b.jsx)("p",{children:U.postMergeError}),U.ticketKey&&(0,b.jsx)(g.L,{className:"underline",href:`/jira/tickets/${encodeURIComponent(U.ticketKey)}`,children:U.ticketKey})]})}):!W&&(E||$)?(0,b.jsxs)("div",{className:"space-y-4",children:[($||am)&&(0,b.jsx)(i.J,{variant:"destructive",children:(0,b.jsx)(i.p,{children:$||am})}),ai?.autoSync&&(0,b.jsx)(r.r,{state:ai.state}),E&&!aj&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(r.y,{checked:aa,onChange:ab,disabled:Y,unavailableReason:E.autoSyncBlockedReason}),(0,b.jsxs)("div",{children:[(0,b.jsx)(m.f,{className:"mb-1.5 block",htmlFor:"merge-method",children:B("mergeType")}),(0,b.jsxs)(n.d,{disabled:Y||0===E.availableMethods.length,onValueChange:a=>H(a),value:G,children:[(0,b.jsx)(n.P,{id:"merge-method",children:(0,b.jsx)(n.U,{placeholder:B("selectMergeType")})}),(0,b.jsx)(n.r,{children:E.availableMethods.map(a=>(0,b.jsx)(n.T,{value:a,children:B(`mergeTypes.${a}`)},a))})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(m.f,{className:"mb-1.5 block",htmlFor:"merge-commit-headline",children:B("commitMessage")}),(0,b.jsx)(l.f,{disabled:Y,id:"merge-commit-headline",onChange:a=>J(a.target.value),value:I})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(m.f,{className:"mb-1.5 block",htmlFor:"merge-commit-body",children:B("commitDescription")}),(0,b.jsx)(p.f,{className:"min-h-28",disabled:Y,id:"merge-commit-body",onChange:a=>L(a.target.value),value:K})]}),(0,b.jsx)(h.y,{options:E,selectedWorktreeIds:O,onSelectedWorktreeIdsChange:P,disabled:Y,deleteWorktree:Q,moveTicketToDone:S,onDeleteWorktreeChange:R,onMoveTicketToDoneChange:T}),(0,b.jsxs)("div",{children:[(0,b.jsx)(m.f,{className:"mb-1.5 block",htmlFor:"merge-email",children:B("commitEmail")}),(0,b.jsxs)(n.d,{disabled:Y,onValueChange:N,value:M,children:[(0,b.jsx)(n.P,{id:"merge-email",children:(0,b.jsx)(n.U,{})}),(0,b.jsxs)(n.r,{children:[(0,b.jsx)(n.T,{value:s,children:B("githubDefaultEmail")}),E.commitEmails.map(a=>(0,b.jsx)(n.T,{value:a,children:a},a))]})]})]})]})]}):(0,b.jsxs)("div",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,b.jsx)(o.f,{})," ",B("loadingMergeOptions")]}),(0,b.jsxs)(k.c,{children:[ai?.autoSync&&(0,b.jsx)(j.K,{variant:"outline",size:"icon","aria-label":B("refreshMergeOptions"),disabled:Y||W,onClick:()=>ad(a=>a+1),children:(0,b.jsx)(d.f,{})}),ai?.autoSync&&"ACTION_REQUIRED"===ai.state&&(0,b.jsx)(j.K,{variant:"destructive",disabled:Y,onClick:()=>void al(),children:B("cancelAutoMerge")}),(0,b.jsx)(j.K,{disabled:Y,onClick:()=>ah(!1),type:"button",variant:"outline",children:U?B("closeMergeResult"):B("cancelMerge")}),(0,b.jsxs)(j.K,{disabled:W||Y||!aj&&(!!U||S&&!E?.ticketDoneStatusConfigured||!(aa?E?.canAutoMergeWithSync:E?.canMerge)||!G||!I.trim()),onClick:()=>void(aj?al():ak()),type:"button",children:[Y?(0,b.jsx)(o.f,{}):(0,b.jsx)(c.f,{}),aj?B("cancelAutoMerge"):aa?B(ai?.state==="ACTION_REQUIRED"?"resumeAutoMerge":"enableAutoMerge"):Y?B("merging"):B("mergePullRequest")]})]})]})})]})}])}];
35
+ }`,{input:{owner:af,name:ag,number:a.number,method:H,commitHeadline:J,commitBody:L,authorEmail:N===s?null:N,worktreeId:B??F.worktreeId,...P.length&&F?.baseBranchUpdateOptions?.destinationBaseBranch?{baseBranchUpdate:{worktreeIds:P,destinationBaseBranch:F.baseBranchUpdateOptions.destinationBaseBranch}}:{},deleteWorktree:R,moveTicketToDone:T},source:A});b.mergeGitHubPullRequest.postMergeError?W(b.mergeGitHubPullRequest):(ai(!1),await t?.(b.mergeGitHubPullRequest))}catch(a){aa(a instanceof Error?a.message:String(a))}finally{$(!1)}}},am=async()=>{if(F?.worktreeId&&!Z){$(!0),aa(null);try{await (0,q.W)("mutation CancelWorktreeAutoMerge($worktreeId: ID!) { cancelWorktreeAutoMerge(worktreeId: $worktreeId) }",{worktreeId:F.worktreeId}),ae(a=>a+1)}catch(a){aa(a instanceof Error?a.message:String(a))}finally{$(!1)}}},an=aj?.lastError??(ab?F?.autoSyncBlockedReason:F?.blockedReason)??null;return(0,b.jsxs)(b.Fragment,{children:[z&&(0,b.jsxs)(j.K,{className:w,onClick:a=>{a.stopPropagation(),ai(!0)},size:u,type:"button",variant:v,children:[(0,b.jsx)(c.f,{}),C("merge")]}),(0,b.jsx)(k.N,{onOpenChange:a=>{Z||ai(a)},open:ah,children:(0,b.jsxs)(k.d,{className:"sm:max-w-xl",children:[(0,b.jsxs)(k.s,{children:[(0,b.jsx)(k.F,{children:C("mergePullRequest")}),(0,b.jsx)(k.C,{children:C("mergePullRequestDescription",{repository:a.repositoryNameWithOwner,number:a.number})})]}),V?(0,b.jsx)(i.J,{children:(0,b.jsxs)(i.p,{children:[(0,b.jsx)("p",{children:C("mergedFollowUpFailed")}),(0,b.jsx)("p",{children:V.postMergeError}),V.ticketKey&&(0,b.jsx)(g.L,{className:"underline",href:`/jira/tickets/${encodeURIComponent(V.ticketKey)}`,children:V.ticketKey})]})}):!X&&(F||_)?(0,b.jsxs)("div",{className:"space-y-4",children:[(_||an)&&(0,b.jsx)(i.J,{variant:"destructive",children:(0,b.jsx)(i.p,{children:_||an})}),aj?.autoSync&&(0,b.jsx)(r.r,{state:aj.state}),F&&!ak&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(r.y,{checked:ab,onChange:ac,disabled:Z,unavailableReason:F.autoSyncBlockedReason}),(0,b.jsxs)("div",{children:[(0,b.jsx)(m.f,{className:"mb-1.5 block",htmlFor:"merge-method",children:C("mergeType")}),(0,b.jsxs)(n.d,{disabled:Z||0===F.availableMethods.length,onValueChange:a=>I(a),value:H,children:[(0,b.jsx)(n.P,{id:"merge-method",children:(0,b.jsx)(n.U,{placeholder:C("selectMergeType")})}),(0,b.jsx)(n.r,{children:F.availableMethods.map(a=>(0,b.jsx)(n.T,{value:a,children:C(`mergeTypes.${a}`)},a))})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(m.f,{className:"mb-1.5 block",htmlFor:"merge-commit-headline",children:C("commitMessage")}),(0,b.jsx)(l.f,{disabled:Z,id:"merge-commit-headline",onChange:a=>K(a.target.value),value:J})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(m.f,{className:"mb-1.5 block",htmlFor:"merge-commit-body",children:C("commitDescription")}),(0,b.jsx)(p.f,{className:"min-h-28",disabled:Z,id:"merge-commit-body",onChange:a=>M(a.target.value),value:L})]}),(0,b.jsx)(h.y,{options:F,selectedWorktreeIds:P,onSelectedWorktreeIdsChange:Q,disabled:Z,deleteWorktree:R,moveTicketToDone:T,onDeleteWorktreeChange:S,onMoveTicketToDoneChange:U}),(0,b.jsxs)("div",{children:[(0,b.jsx)(m.f,{className:"mb-1.5 block",htmlFor:"merge-email",children:C("commitEmail")}),(0,b.jsxs)(n.d,{disabled:Z,onValueChange:O,value:N,children:[(0,b.jsx)(n.P,{id:"merge-email",children:(0,b.jsx)(n.U,{})}),(0,b.jsxs)(n.r,{children:[(0,b.jsx)(n.T,{value:s,children:C("githubDefaultEmail")}),F.commitEmails.map(a=>(0,b.jsx)(n.T,{value:a,children:a},a))]})]})]})]})]}):(0,b.jsxs)("div",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,b.jsx)(o.f,{})," ",C("loadingMergeOptions")]}),(0,b.jsxs)(k.c,{children:[aj?.autoSync&&(0,b.jsx)(j.K,{variant:"outline",size:"icon","aria-label":C("refreshMergeOptions"),disabled:Z||X,onClick:()=>ae(a=>a+1),children:(0,b.jsx)(d.f,{})}),aj?.autoSync&&"ACTION_REQUIRED"===aj.state&&(0,b.jsx)(j.K,{variant:"destructive",disabled:Z,onClick:()=>void am(),children:C("cancelAutoMerge")}),(0,b.jsx)(j.K,{disabled:Z,onClick:()=>ai(!1),type:"button",variant:"outline",children:V?C("closeMergeResult"):C("cancelMerge")}),(0,b.jsxs)(j.K,{disabled:X||Z||!ak&&(!!V||T&&!F?.ticketDoneStatusConfigured||!(ab?F?.canAutoMergeWithSync:F?.canMerge)||!H||!J.trim()),onClick:()=>void(ak?am():al()),type:"button",children:[Z?(0,b.jsx)(o.f,{}):(0,b.jsx)(c.f,{}),ak?C("cancelAutoMerge"):ab?C(aj?.state==="ACTION_REQUIRED"?"resumeAutoMerge":"enableAutoMerge"):Z?C("merging"):C("mergePullRequest")]})]})]})})]})}])}];
36
36
 
37
37
  //# sourceMappingURL=src_components_github_merge-pull-request-button_tsx_0ie9278wjani8._.js.map
@@ -3,6 +3,6 @@ module.exports=[11598,a=>{"use strict";var b=a.i(187924);class c extends Error{c
3
3
  items { ${bo.f} }
4
4
  nextCursor
5
5
  }
6
- }`,{worktreeId:a,after:k},{signal:b.signal});if(b.signal.aborted)return;j(a=>{let b=new Set(a.map(a=>a.id)),d=[...a,...c.builds.items.filter(a=>!b.has(a.id))];return u.current=Math.max(50,d.length),d}),l(c.builds.nextCursor),t(null)}catch(a){if(b.signal.aborted)return;t(a instanceof Error?a.message:String(a))}finally{v.current===b&&(v.current=null),b.signal.aborted||r(!1)}},[k,a]);(0,o.useEffect)(()=>{u.current=50;let a=(0,n.f)(y);w.current=a;let b=(0,T.g)(()=>void a.refresh());return()=>{a.dispose(),b(),v.current?.abort(),v.current=null,w.current===a&&(w.current=null)}},[y]),(0,o.useEffect)(()=>{let b=window.setTimeout(()=>void x(),0),c=window.setInterval(()=>void x(),3e4),d=(0,T.p)(),e=d.subscribe({query:"subscription RunWorktreeChanged { worktreeOverviewChanged { worktreeId } }"},{next:b=>{let c=b.data?.worktreeOverviewChanged;c&&c.worktreeId&&c.worktreeId!==a||x()},error:()=>void 0,complete:()=>void 0}),f=d.subscribe({query:"subscription RunWorktreeBuildsChanged($worktreeId: ID!) { buildsChanged(worktreeId: $worktreeId) { id } }",variables:{worktreeId:a}},{next:()=>void x(),error:()=>void 0,complete:()=>void 0});return()=>{window.clearTimeout(b),window.clearInterval(c),e(),f()}},[x,a]);let A=(0,o.useMemo)(()=>g?(0,bt.j)(g,a):null,[g,a]);if(m&&!A)return null;if(!A)return s?(0,b.jsx)(I.J,{children:(0,b.jsx)(I.p,{children:c("worktreeDataUnavailable")})}):null;let{agentGroup:B,group:C,worktree:D}=A,E=!D.hasStagedChanges&&!D.hasUnstagedChanges,F=async()=>void await x();return(0,b.jsxs)(b.Fragment,{children:[s&&(0,b.jsx)(I.J,{children:(0,b.jsx)(I.p,{children:s})}),(0,b.jsxs)(L.N,{children:[(0,b.jsx)(L.Y,{children:(0,b.jsx)(L.v,{children:e("actions")})}),(0,b.jsxs)(L.O,{className:"space-y-3",children:[(0,b.jsx)(bu.E,{group:C,onCompleted:F,overview:g,worktree:D}),(0,b.jsx)(br.f,{sessionData:{worktree:{id:D.id,path:D.folder,branch:D.branch,baseBranch:D.baseBranch,headSha:D.headSha},codebase:{id:C.codebase.id,folder:C.codebase.folder},repo:{id:C.repository.id,name:C.repository.name,url:C.repository.displayOrigin,displayOrigin:C.repository.displayOrigin}},workflows:C.quickActions??[],worktreeId:D.id}),(0,b.jsx)(bp.f,{agentCapabilities:B.agent.capabilities,worktreeId:D.id})]})]}),(0,b.jsxs)(L.N,{children:[(0,b.jsxs)(L.Y,{className:"flex-row items-center justify-between gap-3",children:[(0,b.jsx)(L.v,{children:c("worktreeStatus")}),(0,b.jsx)(K.K,{asChild:!0,size:"sm",variant:"outline",children:(0,b.jsxs)(S.L,{href:(0,bt.P)(D.id),children:[(0,b.jsx)(bn.f,{})," ",c("openWorktree")]})})]}),(0,b.jsxs)(L.O,{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)(J.f,{variant:E?"secondary":"destructive",children:d(E?"clean":"dirty")}),(0,b.jsx)(bu._,{worktree:D}),(0,b.jsx)(J.f,{variant:"AVAILABLE"===D.availability?"outline":"destructive",children:D.availability})]}),(0,b.jsxs)(bq.X,{className:"grid-cols-1 md:grid-cols-2 xl:grid-cols-3",children:[(0,b.jsx)(bq.v,{label:d("branch"),mono:!0,children:D.branch??d("detached")}),(0,b.jsx)(bq.v,{label:d("baseBranch"),mono:!0,children:D.baseBranchOverride??D.baseBranch??"—"}),(0,b.jsx)(bq.v,{label:d("path"),mono:!0,children:(0,bv.f)(D.folder,B.agent.baseRepoDirectory)}),(0,b.jsx)(bq.v,{label:e("upstream"),mono:!0,children:D.upstream??"—"}),(0,b.jsx)(bq.v,{label:e("head"),mono:!0,children:D.headSha??"—"}),(0,b.jsxs)(bq.v,{label:e("agent"),children:[B.agent.name," · ",B.agent.hostname]}),(0,b.jsx)(bq.v,{label:e("baseStatus"),children:(0,b.jsx)(bu.s,{worktree:D})}),(0,b.jsx)(bq.v,{className:"md:col-span-2",label:d("pullRequest"),children:(0,b.jsx)("span",{className:"flex flex-wrap items-center gap-2",children:(0,b.jsx)(bu.f,{onPipelinesChanged:F,worktree:D})})})]})]})]}),(0,b.jsx)(bs.WorktreeBuildTable,{builds:i,loadingMore:q,nextCursor:k,onError:t,onLoadMore:z,onReload:F})]})}var bx=a.i(462787);let by=["CLAUDE","CODEX","OPENCODE"],bz=["CLAUDE","CODEX"];function bA(a,b){let c=URL.createObjectURL(a),d=document.createElement("a");d.href=c,d.download=b,document.body.appendChild(d),d.click(),d.remove(),URL.revokeObjectURL(c)}function bB({value:a}){let c=(0,ba.f)(),d=`/ai/${"PLAN"===a.kind?"plans":"sessions"}/${a.id}`;return(0,b.jsxs)(S.L,{className:"flex items-center gap-2 rounded-lg border p-3 hover:bg-muted/50",href:d,children:[(0,b.jsx)(v.f,{className:"size-4"}),(0,b.jsxs)("span",{className:"font-mono",children:["PLAN"===a.kind?"Plan":"Session"," #",a.displayNumber]}),a.followUpMode&&(0,b.jsx)(J.f,{variant:"outline",children:c.followUpMode(a.followUpMode)}),(0,b.jsx)(J.f,{className:"ml-auto",variant:"secondary",children:c.status(a.status)})]})}function bC(a){return!a||"object"!=typeof a||Array.isArray(a)?{}:Object.fromEntries(Object.entries(a).map(([a,b])=>{let c=b&&"object"==typeof b&&!Array.isArray(b)?b:{};return[a,Array.isArray(c.answers)?c.answers.map(String):"string"==typeof c.answer?[c.answer]:[]]}))}function bD(a,b=[]){return!a||"object"!=typeof a||Array.isArray(a)?{}:Object.fromEntries([...b.map(a=>[a.key,void 0]),...Object.entries(a).flatMap(([a,b])=>b&&"object"==typeof b&&"value"in b?[[a,b.value]]:[])])}function bE({batch:a,editable:i,onAnswered:j}){let m=(0,f.f)("runs"),n=(0,H.F)(),q=(0,S.U)(),[r,s]=(0,o.useState)({}),[t,u]=(0,o.useState)(()=>bD(a.answerRevisions.at(-1)?.answers,a.questions.flatMap(a=>a.field?[a.field]:[]))),[v,w]=(0,o.useState)({}),[y,A]=(0,o.useState)(!1),[C,D]=(0,o.useState)(null),[E,N]=(0,o.useState)(!1),[P,R]=(0,o.useState)(!1),[U,V]=(0,o.useState)(!1),[W,X]=(0,o.useState)(!0),Y=a.questions.flatMap(a=>a.field?[a.field]:[]),Z=()=>{let a=Object.fromEntries(Object.entries(k(Y,t)).map(([a,b])=>[a,{value:b}]));return Object.fromEntries(Object.entries(function(a,b){let f=d(b),g=new Set(a.map(a=>a.key));if(g.size!==a.length)throw Error("Duplicate form field key");for(let a of Object.keys(f))if(!g.has(a))throw new c("unknown",a);let h=Object.create(null),i=new Set;for(let b of a){if("external"!==b.type){for(let a of b.when??[])if(!i.has(a.key))throw Error("Form conditions must reference an earlier field")}let a=Object.hasOwn(f,b.key),g=a?d(f[b.key]).value:void 0;if(e(b,h))!function(a,b){let d=b=>{throw new c(b,a.key)};if("external"===a.type){!0!==b&&d("external");return}if(void 0===b){a.required&&d("required");return}if("string"===a.type){if("string"!=typeof b)return d("type");if(a.required&&!b.length&&d("required"),void 0!==a.minLength&&b.length<a.minLength&&d("minLength"),void 0!==a.maxLength&&b.length>a.maxLength&&d("maxLength"),void 0!==a.pattern){let c=!1;try{c=new RegExp(a.pattern).test(b)}catch{}c||d("pattern")}"email"!==a.format||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(b)||d("format"),"uri"!==a.format||URL.canParse(b)||d("format"),"date"===a.format&&(!/^\d{4}-\d{2}-\d{2}$/.test(b)||Number.isNaN(Date.parse(b))||new Date(b).toISOString().slice(0,10)!==b)&&d("format"),"date-time"===a.format&&Number.isNaN(Date.parse(b))&&d("format"),!a.options||a.custom||a.options.some(a=>a.value===b)||d("option")}else if("number"===a.type||"integer"===a.type){if("number"!=typeof b||!Number.isFinite(b)||"integer"===a.type&&!Number.isInteger(b))return d("type");void 0!==a.minimum&&b<a.minimum&&d("minimum"),void 0!==a.maximum&&b>a.maximum&&d("maximum")}else if("boolean"===a.type)"boolean"!=typeof b&&d("type");else if("multiselect"===a.type){if(!Array.isArray(b)||!b.every(a=>"string"==typeof a))return d("type");a.required&&!b.length&&d("required"),void 0!==a.minItems&&b.length<a.minItems&&d("minItems"),void 0!==a.maxItems&&b.length>a.maxItems&&d("maxItems"),!a.custom&&b.some(b=>!a.options.some(a=>a.value===b))&&d("option")}}(b,g),void 0!==g&&(h[b.key]=g);else if(a)throw new c("inactive",b.key);i.add(b.key)}return h}(Y,a)).map(([a,b])=>[a,{value:b}]))},$=a=>a instanceof c?m("form.invalidAnswer",{field:Y.find(b=>b.key===a.fieldKey)?.title??a.fieldKey,reason:m(`form.errors.${a.code}`)}):a instanceof Error?a.message:String(a),_=async()=>{A(!0),D(null);try{await (0,T.W)("mutation CancelForm($batchId: ID!) { cancelRunQuestion(batchId: $batchId) { id } }",{batchId:a.id}),await j()}catch(a){D($(a))}finally{A(!1)}},aa=async()=>{A(!0),D(null);try{let b=Y.length?Z():Object.fromEntries(a.questions.map(a=>{let b=[...r[a.id]??[]];return v[a.id]?.trim()&&b.push(v[a.id].trim()),[a.id,{answers:b}]}));await (0,T.W)("mutation AnswerQuestion($batchId: ID!, $answers: JSON!) { answerRunQuestion(batchId: $batchId, answers: $answers) { id } }",{batchId:a.id,answers:b}),await j()}catch(a){D($(a))}finally{A(!1)}},ab=a.answerRevisions.at(-1);(0,o.useEffect)(()=>{if(!E)return;if(a.revisionPreparedAt){let b=window.setTimeout(()=>{let b=bC(ab?.answers),c={},d={};for(let e of a.questions){let a=new Set(e.options.map(({label:a})=>a));c[e.id]=(b[e.id]??[]).filter(b=>a.has(b)),d[e.id]=(b[e.id]??[]).filter(b=>!a.has(b)).join("\n")}s(c),w(d),u(bD(ab?.answers,a.questions.flatMap(a=>a.field?[a.field]:[]))),N(!1),R(!0)},0);return()=>window.clearTimeout(b)}let b=window.setInterval(()=>void j(),1e3);return()=>window.clearInterval(b)},[a.questions,a.revisionPreparedAt,ab?.answers,j,E]);let ac=async()=>{N(!0),D(null);try{await (0,T.W)("mutation PrepareAnswerRevision($batchId: ID!) { prepareRunAnswerRevision(batchId: $batchId) { id } }",{batchId:a.id}),await j()}catch(a){N(!1),D(a instanceof Error?a.message:String(a))}},ad=async()=>{A(!0),D(null);try{let b=Y.length?Z():Object.fromEntries(a.questions.map(a=>{let b=[...r[a.id]??[]];return v[a.id]?.trim()&&b.push(v[a.id].trim()),[a.id,{answers:b}]})),c=await (0,T.W)("mutation ReviseAnswer($batchId: ID!, $answers: JSON!, $stash: Boolean!, $rollback: Boolean!) { reviseRunAnswer(batchId: $batchId, answers: $answers, stash: $stash, rollback: $rollback) { id kind } }",{batchId:a.id,answers:b,stash:W&&U,rollback:W});R(!1),q.push(`/ai/${"PLAN"===c.reviseRunAnswer.kind?"plans":"sessions"}/${c.reviseRunAnswer.id}`)}catch(a){D($(a))}finally{A(!1)}},ae=Y.length?(0,b.jsx)(l,{fields:Y,draft:t,onChange:u}):a.questions.map(a=>(0,b.jsxs)("div",{className:"space-y-3",children:[a.header&&(0,b.jsx)(J.f,{variant:"outline",children:a.header}),(0,b.jsx)("p",{className:"font-medium",children:a.prompt}),(0,b.jsx)("div",{className:"space-y-2",children:a.options.map(c=>{let d=r[a.id]?.includes(c.label)??!1;return(0,b.jsxs)("label",{className:"flex items-start gap-3 rounded-lg border p-3",children:[(0,b.jsx)(g.f,{checked:d,onCheckedChange:b=>s(d=>{let e=new Set(d[a.id]??[]);return a.multiSelect||e.clear(),b?e.add(c.label):e.delete(c.label),{...d,[a.id]:[...e]}})}),(0,b.jsxs)("span",{children:[(0,b.jsx)("span",{className:"block font-medium",children:c.label}),c.description&&(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:c.description})]})]},c.id)})}),a.allowCustom&&(0,b.jsx)(h.f,{"aria-label":m("customAnswer"),onChange:b=>w(c=>({...c,[a.id]:b.target.value})),placeholder:m("customAnswer"),value:v[a.id]??""})]},a.id)),af=bC(ab?.answers);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(L.N,{className:"PENDING"===a.status?"border-primary/50":void 0,children:[(0,b.jsx)(L.Y,{children:(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.v,{className:"flex items-center gap-2 text-base",children:"CANCELLED"===a.status?m("form.cancelled"):"PENDING"===a.status?m("answerNeeded"):m("answeredQuestions")}),(0,b.jsx)(L.u,{children:(0,b.jsx)(F.f,{value:a.createdAt})})]}),"ANSWERED"===a.status&&i&&(0,b.jsxs)(K.K,{disabled:E,onClick:()=>void ac(),size:"sm",variant:"outline",children:[E?(0,b.jsx)(Q.f,{}):(0,b.jsx)(x.f,{})," ",E?m("prepareRevision"):m("editAnswer")]})]})}),(0,b.jsxs)(L.O,{className:"space-y-5",children:[(C||a.error)&&(0,b.jsx)(I.J,{variant:"destructive",children:(0,b.jsx)(I.p,{children:C||a.error})}),"PENDING"===a.status?ae:Y.length?(0,b.jsx)(l,{fields:Y,draft:bD(ab?.answers,Y),onChange:()=>void 0,readOnly:!0}):(0,b.jsx)("div",{className:"divide-y rounded-lg border",children:a.questions.map(a=>(0,b.jsxs)("div",{className:"space-y-2 p-3",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a.header&&(0,b.jsx)(J.f,{variant:"outline",children:a.header}),(0,b.jsx)("p",{className:"font-medium",children:a.prompt})]}),(0,b.jsx)("div",{className:"space-y-1.5",children:(af[a.id]??[]).length?af[a.id].map(c=>{let d=a.options.find(a=>a.label===c)?.description;return(0,b.jsxs)("p",{className:"text-sm",children:[(0,b.jsx)("span",{className:"mr-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:m("answer")}),(0,b.jsx)("span",{className:"font-semibold",children:c}),d&&(0,b.jsxs)("span",{className:"text-muted-foreground",children:[" — ",d]})]},c)}):(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"—"})})]},a.id))}),"PENDING"===a.status&&(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(K.K,{disabled:y,onClick:()=>void aa(),children:[y?(0,b.jsx)(Q.f,{}):(0,b.jsx)(B.f,{})," ",m("submitAnswers")]}),!!Y.length&&(0,b.jsx)(K.K,{disabled:y,variant:"outline",onClick:()=>void _(),children:m("form.cancel")})]})]})]}),(0,b.jsx)(M.N,{onOpenChange:R,open:P,children:(0,b.jsxs)(M.d,{className:"sm:max-w-3xl",children:[(0,b.jsxs)(M.s,{children:[(0,b.jsx)(M.F,{children:m("editAnswer")}),(0,b.jsx)(M.C,{children:W?m("revisionDescription"):m("revisionDescriptionNoRollback")})]}),W&&a.pushedCommitWarning&&(0,b.jsxs)(I.J,{variant:"destructive",children:[(0,b.jsx)(p.f,{}),(0,b.jsx)(I.p,{children:a.pushedCommitWarning})]}),(0,b.jsxs)("label",{className:"flex items-start gap-3 rounded-lg border p-3",children:[(0,b.jsx)(g.f,{checked:W,className:"mt-0.5",onCheckedChange:a=>X(!!a)}),(0,b.jsxs)("span",{children:[(0,b.jsx)("span",{className:"block font-medium",children:m("rollbackChanges")}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:m("rollbackChangesHint")})]})]}),W&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(O.f,{children:m("rollbackDiff")}),a.rollbackPatch?(0,b.jsx)(G.f,{className:"max-h-64 overflow-y-auto",labels:n,patch:a.rollbackPatch}):(0,b.jsx)("p",{className:"rounded-lg border p-3 text-sm text-muted-foreground",children:m("noRollbackChanges")})]}),(0,b.jsx)("div",{className:"space-y-5",children:ae}),W&&(0,b.jsxs)("label",{className:"flex items-center gap-3 rounded-lg border p-3",children:[(0,b.jsx)(g.f,{checked:U,onCheckedChange:a=>V(!!a)}),(0,b.jsx)("span",{children:m("stashBeforeRollback")})]}),(0,b.jsx)(M.c,{showCloseButton:!0,children:(0,b.jsxs)(K.K,{disabled:y,onClick:()=>void ad(),variant:W?"destructive":"default",children:[y?(0,b.jsx)(Q.f,{}):W?(0,b.jsx)(z.f,{}):(0,b.jsx)(B.f,{})," ",m("confirmRevision")]})})]})})]})}a.s(["RunDetailPage",0,function({children:a,runId:c}){let d=(0,f.f)("runs"),e=(0,f.f)("common"),k=(0,ba.f)(),l=(0,H.F)(),x=(0,D.X)(),Z=(0,S.U)(),[$,_]=(0,o.useState)(null);(0,m.S)(["ai",$?.kind==="PLAN"?"plans":"sessions",$?.id],$?`${"PLAN"===$.kind?d("plan"):d("session")} #${$.displayNumber}`:void 0);let[aa,ab]=(0,o.useState)([]),[ac,ad]=(0,o.useState)(""),ae=(0,o.useRef)(ac);(0,o.useEffect)(()=>{ae.current=ac},[ac]);let af=(0,o.useRef)([]),ag=(0,o.useRef)(new Map),ah=(0,o.useRef)(null),ai=(0,o.useRef)(null),aj=(0,o.useRef)(null),ak=(0,o.useRef)(null),[al,am]=(0,o.useState)(!1),[an,ao]=(0,o.useState)(!1),ap=(0,o.useRef)(0),aq=(0,o.useRef)(-1),ar=(0,o.useRef)(0),[as,at]=(0,o.useState)(!1),[au,av]=(0,o.useState)(!1),[aw,ax]=(0,o.useState)(null),[ay,az]=(0,o.useState)(!0);(0,m.F)(["ai","plans",c],!!aw||!ay&&!$),(0,m.F)(["ai","sessions",c],!!aw||!ay&&!$);let[aA,aB]=(0,o.useState)(null),[aC,aD]=(0,o.useState)(""),[aE,aF]=(0,o.useState)([]),[aG,aH]=(0,o.useState)("RESUME"),[aI,aJ]=(0,o.useState)(""),[aK,aL]=(0,o.useState)(""),aM=(0,o.useRef)(null),[aN,aO]=(0,o.useState)(""),[aP,aQ]=(0,o.useState)("auto"),[aR,aS]=(0,o.useState)(!1),[aT,aU]=(0,o.useState)([]),[aV,aW]=(0,o.useState)([]),[aX,aY]=(0,o.useState)([]),[aZ,a$]=(0,o.useState)("NORMALIZED"),[a_,a0]=(0,o.useState)(!1),[a1,a2]=(0,o.useState)(!1),[a3,a4]=(0,o.useState)(!1),[a5,a6]=(0,o.useState)([]),a7=(0,o.useRef)(null),bb=(0,o.useRef)(!0),bc=(0,o.useCallback)(()=>{let a=a7.current;a&&(bb.current=a.scrollHeight-a.scrollTop-a.clientHeight<=24)},[]);(0,o.useEffect)(()=>{let a=a7.current;a&&bb.current&&(a.scrollTop=a.scrollHeight)},[aa]);let bd=(0,o.useCallback)(async a=>{let b,d,e,f=[],g=-1;for(;;){let a=(await (0,T.W)(`query RunActivityExport($runId: ID!, $afterSequence: Int!) { runEvents(runId: $runId, afterSequence: $afterSequence, first: 500, includeSuperseded: true) { ${Y.q} } }`,{runId:c,afterSequence:g})).runEvents;if(f.push(...a),a.length<500)break;g=a[a.length-1].sequence}let h=new Date().toISOString().replace(/[:.]/g,"-"),i=`run-${c}-activity-${h}`;"json"===a?(b=JSON.stringify(f.map(a=>({id:a.id,sequence:a.sequence,type:a.type,summary:a.summary,detailMarkdown:a.detailMarkdown,raw:a.raw,createdAt:a.createdAt,supersededAt:a.supersededAt})),null,2),d="application/json",e=`${i}.json`):"jsonl"===a?(b=f.filter(a=>null!==a.raw&&void 0!==a.raw).map(a=>JSON.stringify(a.raw)).join("\n"),d="application/x-ndjson",e=`run-${c}-session-${h}.jsonl`):(b=f.map(a=>{let b=[`## ${a.summary}`,"",`- **Type:** ${a.type}`,`- **Time:** ${a.createdAt}`];return a.supersededAt&&b.push(`- **Superseded:** ${a.supersededAt}`),a.detailMarkdown&&b.push("",a.detailMarkdown),null!==a.raw&&void 0!==a.raw&&b.push("","```json",JSON.stringify(a.raw,null,2),"```"),b.join("\n")}).join("\n\n---\n\n"),d="text/markdown",e=`${i}.md`),bA(new Blob([b],{type:d}),e)},[c]),be=(0,o.useCallback)(async()=>{let{filename:a,contentBase64:b}=(await (0,T.W)("query RunNativeSessionFile($runId: ID!) { runNativeSessionFile(runId: $runId) { filename contentBase64 } }",{runId:c})).runNativeSessionFile,d=atob(b),e=new Uint8Array(d.length);for(let a=0;a<d.length;a+=1)e[a]=d.charCodeAt(a);bA(new Blob([e],{type:"application/x-ndjson"}),a)},[c]),bf=(0,o.useCallback)(()=>ai.current?.refresh()??Promise.resolve(),[]),bg=(0,o.useCallback)(()=>ah.current?.refresh()??Promise.resolve(),[]),bi=(0,o.useCallback)(async a=>{let b=ar.current,d=ap.current,e=aq.current!==d;try{let f=await (0,T.W)(`query AgentRunDetail($id: ID!, $includeCatalog: Boolean!) { agentRun(id: $id) { ${Y.b} } runProviderCatalog(runId: $id) @include(if: $includeCatalog) { key label available supportsWebSearch supportsPause supportsSteering supportsResume supportsNativeDelete models { id label efforts group } } }`,{id:c,includeCatalog:e},{signal:a});if(a.aborted)return;b===ar.current&&_(f.agentRun),e&&(aY(f.runProviderCatalog),aq.current=d),f.agentRun&&aM.current!==c&&(aM.current=c,aL(f.agentRun.provider),aO(f.agentRun.model),aQ(f.agentRun.effort??"auto"),aS(f.agentRun.webSearchEnabled)),ax(null)}catch(b){a.aborted||ax(b instanceof Error?b.message:String(b))}finally{a.aborted||az(!1)}},[c]),bj=(0,o.useCallback)(a=>{af.current=[...new Map(a.map(a=>[a.id,a])).values()].sort((a,b)=>a.sequence-b.sequence),ab(af.current)},[]),bm=(0,o.useCallback)(async a=>{let b=JSON.stringify([c,ac.trim()]),d=aj.current!==b;d&&(af.current=[],ag.current.clear());let e=[],f=d?-1:(af.current[0]?.sequence??0)-1,g=af.current[0]?.sequence;ag.current.clear();try{for(;;){let b=await (0,T.W)(`query RunActivity($runId: ID!, $search: String, $afterSequence: Int!, $first: Int!, $latest: Boolean!) { runEvents(runId: $runId, search: $search, afterSequence: $afterSequence, first: $first, latest: $latest) { ${Y.q} } }`,{runId:c,search:ac.trim()||null,afterSequence:f,first:d?200:500,latest:d},{signal:a});if(a.aborted)return;let g=b.runEvents;if(e.push(...g),d||g.length<500)break;let h=g.at(-1).sequence;if(h<=f)break;f=h}if(!d&&void 0!==g&&(af.current[0]?.sequence??g)<g)return void bg();d&&am(200===e.length&&e[0].sequence>0),aj.current=b,bj([...e,...ag.current.values()])}catch(b){a.aborted||ax(b instanceof Error?b.message:String(b))}},[bj,bg,c,ac]),bn=async()=>{if(ak.current||!af.current.length)return;let a=new AbortController;ak.current=a,ao(!0);try{let b=await (0,T.W)(`query RunActivityOlder($runId: ID!, $search: String, $before: Int!) { runEvents(runId: $runId, search: $search, beforeSequence: $before, first: 200) { ${Y.q} } }`,{runId:c,search:ac.trim()||null,before:af.current[0].sequence},{signal:a.signal});if(a.signal.aborted)return;bb.current=!1,bj([...af.current,...b.runEvents]),am(200===b.runEvents.length&&b.runEvents[0].sequence>0)}catch(b){a.signal.aborted||ax(b instanceof Error?b.message:String(b))}finally{ak.current===a&&(ak.current=null),a.signal.aborted||ao(!1)}};(0,o.useEffect)(()=>{aq.current=-1;let a=(0,n.f)(bi);ai.current=a;let b=window.setTimeout(()=>void a.refresh(),0),c=(0,T.g)(()=>{++ap.current,a.refresh()});return()=>{window.clearTimeout(b),a.dispose(),c(),ai.current===a&&(ai.current=null)}},[bi]),(0,o.useEffect)(()=>{let a=(0,n.f)(bm);ah.current=a;let b=window.setTimeout(()=>void a.refresh(),150),c=()=>{"hidden"!==document.visibilityState&&a.refresh()},d=(0,T.g)(c);return window.addEventListener("focus",c),document.addEventListener("visibilitychange",c),()=>{window.clearTimeout(b),a.dispose(),d(),ak.current?.abort(),ak.current=null,window.removeEventListener("focus",c),document.removeEventListener("visibilitychange",c),ah.current===a&&(ah.current=null)}},[bm]),(0,o.useEffect)(()=>{let a=(0,T.p)(),b=a.subscribe({query:`subscription RunChanged($runId: ID!) { agentRunChanged(runId: $runId) { ${Y.b} } }`,variables:{runId:c}},{next:a=>{let b=a.data?.agentRunChanged;b&&(++ar.current,_(b))},error:()=>void 0,complete:()=>void 0}),d=a.subscribe({query:`subscription RunEvent($runId: ID!) { runEventAdded(runId: $runId) { ${Y.q} } }`,variables:{runId:c}},{next:a=>{let b=a.data?.runEventAdded;b&&(ae.current.trim()?bg():(ag.current.set(b.id,b),bj([...(aj.current===JSON.stringify([c,""])?af.current:[]).filter(a=>a.id!==b.id),b])))},error:()=>void 0,complete:()=>void 0}),e=a.subscribe({query:"subscription RunQuestion($runId: ID!) { runQuestionChanged(runId: $runId) { id } }",variables:{runId:c}},{next:()=>void bf(),error:()=>void 0,complete:()=>void 0});return()=>{b(),d(),e()}},[bj,bf,bg,c]);let bo=async a=>{aB(a);try{let b="play"===a?"mutation Play($id: ID!, $mcpPresetIds: [ID!]!) { playPlan(planId: $id, mcpPresetIds: $mcpPresetIds) { id } }":`mutation Lifecycle($id: ID!) { ${a}AgentRun(id: $id) { id } }`;await (0,T.W)(b,{id:c,..."play"===a?{mcpPresetIds:a5}:{}}),await bf(),"play"===a&&(a4(!1),a6([]))}catch(a){ax(a instanceof Error?a.message:String(a))}finally{aB(null)}},bp=async(a,b)=>{if(a.length){aB("upload");try{let c=[];for(let b of a){let a=await fetch("/api/run-attachments",{method:"POST",headers:{"content-type":b.type||"application/octet-stream","x-attachment-filename":encodeURIComponent(b.name)},body:b}),e=await a.json();if(!a.ok)throw Error(e.error||d("uploadFailed"));c.push({...e,downloadPath:`/api/run-attachments/${e.id}`,createdAt:new Date().toISOString()})}b(a=>[...a,...c])}catch(a){ax(a instanceof Error?a.message:String(a))}finally{aB(null)}}},bq=async()=>{aB("steer");try{await (0,T.W)("mutation Steer($id: ID!, $prompt: String!, $attachments: [ID!]!) { steerAgentRun(id: $id, prompt: $prompt, attachmentIds: $attachments) { id } }",{id:c,prompt:aC,attachments:aE.map(({id:a})=>a)}),aD(""),aF([]),await bf()}catch(a){ax(a instanceof Error?a.message:String(a))}finally{aB(null)}},br=async()=>{if($?.worktreeId){aB("follow");try{let a="RESEND"!==aG||aI.trim()?aI:$.initialPrompt,b=await (0,T.W)("mutation FollowUp($sourceId: ID!, $input: RunConfigurationInput!) { createRunFollowUp(sourceId: $sourceId, input: $input) { id kind } }",{sourceId:$.id,input:{kind:$.kind,worktreeId:$.worktreeId,jiraIssueKey:$.jiraIssueKey,provider:aK,model:aN,effort:"auto"===aP?null:aP,webSearchEnabled:aR,prompt:a,attachmentIds:aV.map(({id:a})=>a),mcpPresetIds:aT,followUpMode:aG,contextMode:aK===$.provider?"NATIVE":aZ}});Z.push(`/ai/${"PLAN"===b.createRunFollowUp.kind?"plans":"sessions"}/${b.createRunFollowUp.id}`)}catch(a){ax(a instanceof Error?a.message:String(a))}finally{aB(null),a2(!1)}}},bs=async()=>{try{await (0,T.W)("mutation DeleteRun($id: ID!) { deleteAgentRuns(ids: [$id]) }",{id:c}),Z.push($?.kind==="PLAN"?"/ai/plans":"/ai/sessions")}catch(a){ax(a instanceof Error?a.message:String(a))}},bt=(0,o.useMemo)(()=>$?[$.sourcePlan,$.parentRun,$.playedSession,...$.followUps].filter(a=>!!a&&a.id!==$.id):[],[$]);if(ay)return(0,b.jsxs)("p",{className:"flex gap-2 text-muted-foreground",children:[(0,b.jsx)(Q.f,{})," ",d("loading")]});if(!$)return(0,b.jsx)(I.J,{variant:"destructive",children:(0,b.jsx)(I.p,{children:aw??d("runNotFound")})});let bu=$.worktree?.highlightColor,bv=new Intl.NumberFormat(x,{style:"currency",currency:"USD",maximumFractionDigits:4}),bC=["COMPLETED","CANCELLED","FAILED"].includes($.status),bD=[!$.sourcePlan&&null!==$.sourcePlanNumber?`${d("plan")} #${$.sourcePlanNumber}`:null,!$.parentRun&&null!==$.parentRunNumber?`${d("parentRun")} #${$.parentRunNumber}`:null,"PLAN"===$.kind&&!$.playedSession&&null!==$.playedSessionNumber?`${d("session")} #${$.playedSessionNumber}`:null].filter(a=>!!a),bF=[...$.checkpoints].reverse().find(({diffPatch:a})=>a)?.diffPatch,bG=aX.find(({key:a})=>a===aK),bH=aX.find(({key:a})=>a===$.provider),bI=a=>null===a?"—":`≈${bv.format(a)}`,bJ=[!1,!0].map(a=>$.modelUsage.filter(b=>b.superseded===a).reduce((b,c)=>({input:b.input+c.inputTokens,output:b.output+c.outputTokens,cacheRead:b.cacheRead+c.cacheReadTokens,cacheWrite:b.cacheWrite+c.cacheWriteTokens,reported:b.reported+(c.estimatedCost??0),catalog:b.catalog+(c.catalogCost??0),hasReported:b.hasReported||null!==c.estimatedCost,hasCatalog:b.hasCatalog||null!==c.catalogCost,superseded:a}),{input:0,output:0,cacheRead:0,cacheWrite:0,reported:0,catalog:0,hasReported:!1,hasCatalog:!1,superseded:a}));return(0,b.jsxs)("div",{className:"min-w-0 space-y-5",children:[(0,b.jsxs)("div",{className:(0,W.f)("space-y-4",bu&&"rounded-lg border-l-4 p-4",bu&&X.x[bu],bu&&X._[bu]),children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsxs)("h1",{className:"text-2xl font-semibold",children:["PLAN"===$.kind?d("plan"):d("session")," ",(0,b.jsxs)("span",{className:"font-mono",children:["#",$.displayNumber]})]}),(0,b.jsx)(J.f,{children:k.status($.status)}),(0,b.jsx)(J.f,{variant:"outline",children:k.phase($.phase)}),(0,b.jsx)(J.f,{variant:"secondary",children:(0,U.G)($.provider)}),"IMPORTED"===$.origin&&(0,b.jsx)(J.f,{variant:"outline",children:d("imported")})]}),(0,b.jsxs)("p",{className:"mt-1 text-sm text-muted-foreground",children:[$.repositoryName," · ",$.branch??d("detached")," ·"," ",(0,b.jsx)(F.f,{value:$.createdAt})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:["MANAGED"===$.origin&&"IN_PROGRESS"===$.status&&bH?.supportsPause&&(0,b.jsxs)(K.K,{disabled:!!aA,onClick:()=>void bo("pause"),variant:"outline",children:["pause"===aA?(0,b.jsx)(Q.f,{}):(0,b.jsx)(w.f,{})," ",d("pause")]}),"MANAGED"===$.origin&&"PAUSED"===$.status&&(0,b.jsxs)(K.K,{disabled:!!aA,onClick:()=>void bo("continue"),children:[(0,b.jsx)(z.f,{})," ",d("continue")]}),"MANAGED"===$.origin&&!bC&&(0,b.jsxs)(K.K,{disabled:!!aA,onClick:()=>void bo("cancel"),variant:"destructive",children:[(0,b.jsx)(r.f,{})," ",d("cancel")]}),"PLAN"===$.kind&&"COMPLETED"===$.status&&!$.playedAt&&(0,b.jsxs)(K.K,{disabled:!!aA||!$.finalOutput,onClick:()=>{a6([]),a4(!0)},children:[(0,b.jsx)(y.f,{})," ",d("play")]}),(0,b.jsxs)(K.K,{onClick:()=>void(0,T.W)("mutation Archive($id: ID!, $archived: Boolean!) { archiveAgentRuns(ids: [$id], archived: $archived) }",{id:$.id,archived:!$.archivedAt}).then(bf),variant:"outline",children:[(0,b.jsx)(q.f,{})," ",$.archivedAt?d("restore"):d("archive")]}),(0,b.jsxs)(K.K,{disabled:!bH?.supportsNativeDelete,onClick:()=>a0(!0),variant:"destructive",children:[(0,b.jsx)(C.f,{})," ",d("delete")]})]})]}),aw&&(0,b.jsx)(I.J,{variant:"destructive",children:(0,b.jsx)(I.p,{children:aw})}),$.error&&(0,b.jsxs)(I.J,{variant:"destructive",children:[(0,b.jsx)(p.f,{}),(0,b.jsx)(I.p,{children:$.error})]}),"IMPORTED_ACTIVE_COLLISION"===$.phase&&(0,b.jsxs)(I.J,{variant:"destructive",children:[(0,b.jsx)(p.f,{}),(0,b.jsx)(I.p,{children:d("importedCollisionWarning")})]})]}),a,(bt.length>0||bD.length>0)&&(0,b.jsxs)(L.N,{children:[(0,b.jsxs)(L.Y,{children:[(0,b.jsx)(L.v,{children:d("linkedItems")}),(0,b.jsx)(L.u,{children:d("linkedItemsDescription")})]}),(0,b.jsxs)(L.O,{className:"grid gap-2 md:grid-cols-2",children:[bt.map(a=>(0,b.jsx)(bB,{value:a},a.id)),bD.map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-dashed p-3 text-muted-foreground",children:[(0,b.jsx)(v.f,{className:"size-4"}),(0,b.jsx)("span",{className:"font-mono",children:a}),(0,b.jsx)(J.f,{className:"ml-auto",variant:"outline",children:d("deleted")})]},a))]})]}),(0,b.jsxs)(L.N,{children:[(0,b.jsx)(L.Y,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)(L.v,{children:d("prompt")}),(0,b.jsx)(a9,{copy:!0,onRawChange:at,raw:as,value:$.initialPrompt})]})}),(0,b.jsxs)(L.O,{className:"space-y-4",children:[(0,b.jsx)(a8,{onRawChange:at,raw:as,showActions:!1,value:$.initialPrompt}),$.inputs[0]?.attachments.length?(0,b.jsx)("div",{className:"flex flex-wrap gap-2",children:$.inputs[0].attachments.map(a=>(0,b.jsx)(K.K,{asChild:!0,size:"sm",variant:"outline",children:(0,b.jsxs)("a",{download:!0,href:a.downloadPath,children:[(0,b.jsx)(u.f,{})," ",a.filename]})},a.id))}):null]})]}),(0,b.jsxs)(L.N,{className:"min-w-0",children:[(0,b.jsxs)(L.Y,{children:[(0,b.jsx)(L.v,{children:d("usageCost")}),(0,b.jsx)(L.u,{children:d("estimatedCost")})]}),(0,b.jsxs)(L.O,{className:"min-w-0 space-y-4",children:[(0,b.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[[d("reportedCost"),bI($.estimatedCost)],[d("catalogCost"),bI($.catalogCost)],[d("inputTokens"),$.inputTokens.toLocaleString(x)],[d("outputTokens"),$.outputTokens.toLocaleString(x)],[d("cacheReadTokens"),$.cacheReadTokens.toLocaleString(x)],[d("cacheWriteTokens"),$.cacheWriteTokens.toLocaleString(x)],[d("reasoningTokens"),$.reasoningTokens.toLocaleString(x)],[d("toolCalls"),$.toolCallCount.toLocaleString(x)]].map(([a,c])=>(0,b.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a}),(0,b.jsx)("p",{className:"mt-1 text-xl font-semibold tabular-nums",children:c})]},a))}),$.modelUsage.some(({superseded:a})=>a)&&(0,b.jsxs)(R.s,{children:[(0,b.jsx)(R.E,{children:(0,b.jsxs)(R.N,{children:[(0,b.jsx)(R.V,{children:d("usageState")}),(0,b.jsx)(R.V,{children:d("inputTokens")}),(0,b.jsx)(R.V,{children:d("outputTokens")}),(0,b.jsx)(R.V,{children:d("cacheReadTokens")}),(0,b.jsx)(R.V,{children:d("cacheWriteTokens")}),(0,b.jsx)(R.V,{children:d("reportedCost")}),(0,b.jsx)(R.V,{children:d("catalogCost")})]})}),(0,b.jsx)(R.z,{children:bJ.map(a=>(0,b.jsxs)(R.N,{children:[(0,b.jsx)(R.d,{children:a.superseded?d("superseded"):d("activeUsage")}),(0,b.jsx)(R.d,{children:a.input.toLocaleString(x)}),(0,b.jsx)(R.d,{children:a.output.toLocaleString(x)}),(0,b.jsx)(R.d,{children:a.cacheRead.toLocaleString(x)}),(0,b.jsx)(R.d,{children:a.cacheWrite.toLocaleString(x)}),(0,b.jsx)(R.d,{children:bI(a.hasReported?a.reported:null)}),(0,b.jsx)(R.d,{children:bI(a.hasCatalog?a.catalog:null)})]},String(a.superseded)))})]}),$.modelUsage.length>0&&(0,b.jsxs)(R.s,{children:[(0,b.jsx)(R.E,{children:(0,b.jsxs)(R.N,{children:[(0,b.jsx)(R.V,{children:d("model")}),(0,b.jsx)(R.V,{children:d("inputTokens")}),(0,b.jsx)(R.V,{children:d("outputTokens")}),(0,b.jsx)(R.V,{children:d("cacheReadTokens")}),(0,b.jsx)(R.V,{children:d("cacheWriteTokens")}),(0,b.jsx)(R.V,{children:d("reportedCost")}),(0,b.jsx)(R.V,{children:d("catalogCost")})]})}),(0,b.jsx)(R.z,{children:$.modelUsage.map(a=>(0,b.jsxs)(R.N,{children:[(0,b.jsxs)(R.d,{children:[a.model,a.superseded&&(0,b.jsx)(J.f,{className:"ml-2",variant:"outline",children:d("superseded")})]}),(0,b.jsx)(R.d,{children:a.inputTokens.toLocaleString(x)}),(0,b.jsx)(R.d,{children:a.outputTokens.toLocaleString(x)}),(0,b.jsx)(R.d,{children:a.cacheReadTokens.toLocaleString(x)}),(0,b.jsx)(R.d,{children:a.cacheWriteTokens.toLocaleString(x)}),(0,b.jsx)(R.d,{children:bI(a.estimatedCost)}),(0,b.jsx)(R.d,{children:bI(a.catalogCost)})]},a.id))})]}),$.toolCalls.length>0&&(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h3",{className:"mb-2 font-medium",children:d("toolCalls")}),(0,b.jsx)(bk,{calls:$.toolCalls})]})]})]}),(0,b.jsxs)(L.N,{className:"gap-0 overflow-hidden py-0",children:[(0,b.jsx)(L.Y,{className:"border-b py-3",children:(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.v,{children:d("activity")}),(0,b.jsx)(L.u,{children:d("activityDescription")})]}),(0,b.jsxs)("div",{className:"flex w-full items-center gap-2 sm:w-auto",children:[(0,b.jsxs)("div",{className:"relative w-full sm:w-64",children:[(0,b.jsx)(A.f,{className:"absolute top-1.5 left-2.5 size-4 text-muted-foreground"}),(0,b.jsx)(h.f,{"aria-label":d("searchActivity"),className:"h-7 pl-8 text-xs",onChange:a=>ad(a.target.value),placeholder:d("searchActivity"),value:ac})]}),(0,b.jsxs)(N.G,{children:[(0,b.jsx)(N.X,{asChild:!0,children:(0,b.jsxs)(K.K,{className:"shrink-0",size:"xs",variant:"outline",children:[(0,b.jsx)(t.f,{})," ",d("export")]})}),(0,b.jsxs)(N.L,{align:"end",className:"w-72",children:[(0,b.jsx)(N.r,{onClick:()=>void bd("json").catch(a=>ax(a instanceof Error?a.message:String(a))),children:d("exportJson")}),(0,b.jsx)(N.r,{onClick:()=>void bd("markdown").catch(a=>ax(a instanceof Error?a.message:String(a))),children:d("exportMarkdown")}),$&&by.includes($.provider)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(N.U,{}),(0,b.jsx)(N.r,{onClick:()=>void bd("jsonl").catch(a=>ax(a instanceof Error?a.message:String(a))),children:d("exportSession",{tool:(0,U.G)($.provider)})}),bz.includes($.provider)&&$.agentId&&(0,b.jsx)(N.r,{onClick:()=>void be().catch(a=>ax(a instanceof Error?a.message:String(a))),children:d("exportSessionFile",{tool:(0,U.G)($.provider)})})]})]})]})]})]})}),al&&(0,b.jsxs)(K.K,{disabled:an,onClick:()=>void bn(),size:"sm",variant:"ghost",children:[an&&(0,b.jsx)(Q.f,{}),e("loadMore")]}),(0,b.jsx)("div",{className:"h-[24rem] overflow-y-auto",onScroll:bc,ref:a7,children:(0,b.jsxs)(R.s,{className:"table-fixed",children:[(0,b.jsx)(R.E,{className:"sticky top-0 z-10 bg-card",children:(0,b.jsxs)(R.N,{children:[(0,b.jsx)(R.V,{className:"h-7 w-10"}),(0,b.jsx)(R.V,{className:"h-7",children:d("activity")}),(0,b.jsx)(R.V,{className:"h-7 w-40",children:d("status")}),(0,b.jsx)(R.V,{className:"h-7 w-24",children:d("age")})]})}),(0,b.jsx)(R.z,{children:(0,b.jsx)(bh,{events:aa})})]})})]}),$.finalOutput&&bC&&(0,b.jsxs)(L.N,{children:[(0,b.jsx)(L.Y,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)(L.v,{children:"PLAN"===$.kind?d("plan"):d("summary")}),(0,b.jsx)(a9,{copy:!0,onRawChange:av,raw:au,value:$.finalOutput})]})}),(0,b.jsx)(L.O,{children:(0,b.jsx)(a8,{onRawChange:av,raw:au,showActions:!1,value:$.finalOutput})})]}),"MANAGED"===$.origin&&"IN_PROGRESS"===$.status&&bH?.supportsSteering&&(0,b.jsxs)(L.N,{children:[(0,b.jsxs)(L.Y,{children:[(0,b.jsx)(L.v,{children:d("steer")}),(0,b.jsx)(L.u,{children:d("steerDescription")})]}),(0,b.jsxs)(L.O,{className:"space-y-3",children:[(0,b.jsx)(i.f,{onChange:a=>aD(a.target.value),placeholder:d("steerPlaceholder"),value:aC}),(0,b.jsx)(bl.f,{attachments:aE,compact:!0,onFiles:a=>bp(a,aF),onRemove:a=>aF(b=>b.filter(b=>b.id!==a)),uploading:"upload"===aA}),(0,b.jsx)("div",{className:"flex justify-end",children:(0,b.jsxs)(K.K,{disabled:!aC.trim()||!!aA,onClick:()=>void bq(),children:["steer"===aA?(0,b.jsx)(Q.f,{}):(0,b.jsx)(B.f,{})," ",d("send")]})})]})]}),$.questionBatches.map(a=>(0,b.jsx)(bE,{batch:a,editable:"MANAGED"===$.origin&&!a.supersededAt&&!!a.checkpoint,onAnswered:bf},a.id)),(0,b.jsxs)(L.N,{children:[(0,b.jsxs)(L.Y,{children:[(0,b.jsx)(L.v,{children:d("followUp")}),(0,b.jsx)(L.u,{children:d("followUpDescription")})]}),(0,b.jsxs)(L.O,{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,b.jsx)(P.i,{onValueChange:a=>{let b=a??"RESUME";aH(b),"RESEND"===b&&aJ($.initialPrompt)},value:aG,children:(0,b.jsxs)(P.U,{"aria-label":d("followUp"),children:[(0,b.jsx)(P.k,{disabled:aK===$.provider&&!bG?.supportsResume,value:"RESUME",children:d("resume")}),(0,b.jsx)(P.k,{value:"FRESH",children:d("fresh")}),(0,b.jsx)(P.k,{value:"RESEND",children:d("resend")})]})}),(0,b.jsx)("div",{className:"min-w-0 flex-1",children:(0,b.jsx)(bx.f,{catalog:aX,effort:aP,model:aN,onEffortChange:aQ,onModelChange:aO,onProviderChange:a=>{let b=aX.find(({key:b})=>b===a);aL(a),aO(""),aQ("auto"),aS(!!b?.supportsWebSearch)},provider:aK})})]}),"RESUME"===aG&&aK!==$.provider&&(0,b.jsx)(I.J,{children:(0,b.jsxs)(I.p,{className:"flex flex-wrap items-center gap-3",children:[(0,b.jsxs)(j.d,{onValueChange:a=>a$(a??"NORMALIZED"),value:aZ,children:[(0,b.jsx)(j.P,{className:"w-56 shrink-0",children:(0,b.jsx)(j.U,{})}),(0,b.jsxs)(j.r,{children:[(0,b.jsx)(j.T,{value:"NORMALIZED",children:d("normalizedContext")}),(0,b.jsx)(j.T,{value:"SUMMARY",children:d("summaryOnly")})]})]}),(0,b.jsx)("span",{className:"min-w-0 flex-1",children:d("crossProviderWarning")})]})}),(0,b.jsx)(i.f,{className:"min-h-28",onChange:a=>aJ(a.target.value),placeholder:"RESEND"===aG?d("resendPrompt"):d("followUpPrompt"),value:aI}),(0,b.jsx)(bl.f,{attachments:aV,compact:!0,onFiles:a=>bp(a,aW),onRemove:a=>aW(b=>b.filter(b=>b.id!==a)),uploading:"upload"===aA}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(O.f,{children:d("mcpPresets")}),(0,b.jsx)(V.S,{kind:$.kind,onChange:aU,selectedIds:aT})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-4",children:[(0,b.jsxs)("label",{className:"flex items-center gap-2",children:[(0,b.jsx)(g.f,{checked:aR,disabled:!bG?.supportsWebSearch,onCheckedChange:a=>aS(!!a)}),d("webSearch")]}),(0,b.jsxs)(K.K,{disabled:!aI.trim()||!!aA||!aN||!bG?.available,onClick:()=>"PAUSED"===$.status&&"SESSION"===$.kind?a2(!0):void br(),children:["follow"===aA?(0,b.jsx)(Q.f,{}):(0,b.jsx)(v.f,{})," ",d("startFollowUp")]})]})]})]}),$.worktreeId&&(0,b.jsx)(bw,{worktreeId:$.worktreeId}),$.checkpoints.length>0&&(0,b.jsxs)(L.N,{children:[(0,b.jsxs)(L.Y,{children:[(0,b.jsx)(L.v,{children:d("changesSnapshots")}),(0,b.jsx)(L.u,{children:d("changesSnapshotsDescription")})]}),(0,b.jsxs)(L.O,{className:"space-y-3",children:["PLAN"===$.kind&&bF&&(0,b.jsxs)(I.J,{variant:"destructive",children:[(0,b.jsx)(p.f,{}),(0,b.jsx)(I.p,{children:d("planMutationWarning")})]}),bF&&(0,b.jsx)(G.f,{labels:l,patch:bF}),$.checkpoints.map(a=>(0,b.jsxs)("details",{className:"rounded-lg border p-3",children:[(0,b.jsxs)("summary",{className:"cursor-pointer",children:[(0,b.jsx)(s.f,{className:"mr-2 inline size-4"}),k.checkpointKind(a.kind)," ·"," ",(0,b.jsx)(F.f,{value:a.createdAt}),a.branch&&(0,b.jsx)(J.f,{className:"ml-2",variant:"outline",children:a.branch})]}),(0,b.jsxs)("div",{className:"mt-3 space-y-2 text-sm",children:[(0,b.jsxs)("p",{className:"font-mono text-xs",children:["HEAD ",a.headSha??"—"]}),a.diffPatch?(0,b.jsx)(G.f,{labels:l,patch:a.diffPatch}):a.diffSummary?(0,b.jsx)("pre",{className:"overflow-auto rounded bg-muted p-3 text-xs whitespace-pre-wrap",children:a.diffSummary}):(0,b.jsx)("p",{className:"text-muted-foreground",children:d("noChanges")}),a.stashRef&&(0,b.jsxs)("p",{className:"font-mono text-xs",children:[d("stashCreated"),": ",a.stashRef]}),a.refName&&(0,b.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:a.refName})]})]},a.id))]})]}),(0,b.jsx)(E.f,{actionLabel:d("delete"),cancelLabel:d("cancel"),description:d("deleteDescription"),onConfirm:bs,onOpenChange:a0,open:a_,title:d("deleteTitle")}),(0,b.jsx)(M.N,{onOpenChange:a=>{a4(a),a||a6([])},open:a3,children:(0,b.jsxs)(M.d,{className:"sm:max-w-2xl",children:[(0,b.jsxs)(M.s,{children:[(0,b.jsx)(M.F,{children:d("playPlan")}),(0,b.jsx)(M.C,{children:d("playPlanDescription")})]}),(0,b.jsx)(V.S,{kind:"SESSION",onChange:a6,selectedIds:a5}),(0,b.jsxs)(M.c,{children:[(0,b.jsx)(K.K,{onClick:()=>a4(!1),variant:"outline",children:d("cancel")}),(0,b.jsxs)(K.K,{disabled:!!aA,onClick:()=>void bo("play"),children:["play"===aA?(0,b.jsx)(Q.f,{}):(0,b.jsx)(y.f,{})," ",d("play")]})]})]})}),(0,b.jsx)(E.f,{actionLabel:d("cancelAndTransfer"),cancelLabel:d("cancel"),description:d("pausedFollowUpDescription"),onConfirm:br,onOpenChange:a2,open:a1,title:d("pausedFollowUpTitle")})]})}],11598)}];
6
+ }`,{worktreeId:a,after:k},{signal:b.signal});if(b.signal.aborted)return;j(a=>{let b=new Set(a.map(a=>a.id)),d=[...a,...c.builds.items.filter(a=>!b.has(a.id))];return u.current=Math.max(50,d.length),d}),l(c.builds.nextCursor),t(null)}catch(a){if(b.signal.aborted)return;t(a instanceof Error?a.message:String(a))}finally{v.current===b&&(v.current=null),b.signal.aborted||r(!1)}},[k,a]);(0,o.useEffect)(()=>{u.current=50;let a=(0,n.f)(y);w.current=a;let b=(0,T.g)(()=>void a.refresh());return()=>{a.dispose(),b(),v.current?.abort(),v.current=null,w.current===a&&(w.current=null)}},[y]),(0,o.useEffect)(()=>{let b=window.setTimeout(()=>void x(),0),c=window.setInterval(()=>void x(),3e4),d=(0,T.p)(),e=d.subscribe({query:"subscription RunWorktreeChanged { worktreeOverviewChanged { worktreeId } }"},{next:b=>{let c=b.data?.worktreeOverviewChanged;c&&c.worktreeId&&c.worktreeId!==a||x()},error:()=>void 0,complete:()=>void 0}),f=d.subscribe({query:"subscription RunWorktreeBuildsChanged($worktreeId: ID!) { buildsChanged(worktreeId: $worktreeId) { id } }",variables:{worktreeId:a}},{next:()=>void x(),error:()=>void 0,complete:()=>void 0});return()=>{window.clearTimeout(b),window.clearInterval(c),e(),f()}},[x,a]);let A=(0,o.useMemo)(()=>g?(0,bt.j)(g,a):null,[g,a]);if(m&&!A)return null;if(!A)return s?(0,b.jsx)(I.J,{children:(0,b.jsx)(I.p,{children:c("worktreeDataUnavailable")})}):null;let{agentGroup:B,group:C,worktree:D}=A,E=!D.hasStagedChanges&&!D.hasUnstagedChanges,F=async()=>void await x();return(0,b.jsxs)(b.Fragment,{children:[s&&(0,b.jsx)(I.J,{children:(0,b.jsx)(I.p,{children:s})}),(0,b.jsxs)(L.N,{children:[(0,b.jsx)(L.Y,{children:(0,b.jsx)(L.v,{children:e("actions")})}),(0,b.jsxs)(L.O,{className:"space-y-3",children:[(0,b.jsx)(bu.E,{group:C,onCompleted:F,overview:g,worktree:D}),(0,b.jsx)(br.f,{sessionData:{worktree:{id:D.id,path:D.folder,branch:D.branch,baseBranch:D.baseBranch,headSha:D.headSha},codebase:{id:C.codebase.id,folder:C.codebase.folder},repo:{id:C.repository.id,name:C.repository.name,url:C.repository.displayOrigin,displayOrigin:C.repository.displayOrigin}},workflows:C.quickActions??[],worktreeId:D.id}),(0,b.jsx)(bp.f,{agentCapabilities:B.agent.capabilities,worktreeId:D.id})]})]}),(0,b.jsxs)(L.N,{children:[(0,b.jsxs)(L.Y,{className:"flex-row items-center justify-between gap-3",children:[(0,b.jsx)(L.v,{children:c("worktreeStatus")}),(0,b.jsx)(K.K,{asChild:!0,size:"sm",variant:"outline",children:(0,b.jsxs)(S.L,{href:(0,bt.P)(D.id),children:[(0,b.jsx)(bn.f,{})," ",c("openWorktree")]})})]}),(0,b.jsxs)(L.O,{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)(J.f,{variant:E?"secondary":"destructive",children:d(E?"clean":"dirty")}),(0,b.jsx)(bu._,{worktree:D}),(0,b.jsx)(J.f,{variant:"AVAILABLE"===D.availability?"outline":"destructive",children:D.availability})]}),(0,b.jsxs)(bq.X,{className:"grid-cols-1 md:grid-cols-2 xl:grid-cols-3",children:[(0,b.jsx)(bq.v,{label:d("branch"),mono:!0,children:D.branch??d("detached")}),(0,b.jsx)(bq.v,{label:d("baseBranch"),mono:!0,children:D.baseBranchOverride??D.baseBranch??"—"}),(0,b.jsx)(bq.v,{label:d("path"),mono:!0,children:(0,bv.f)(D.folder,B.agent.baseRepoDirectory)}),(0,b.jsx)(bq.v,{label:e("upstream"),mono:!0,children:D.upstream??"—"}),(0,b.jsx)(bq.v,{label:e("head"),mono:!0,children:D.headSha??"—"}),(0,b.jsxs)(bq.v,{label:e("agent"),children:[B.agent.name," · ",B.agent.hostname]}),(0,b.jsx)(bq.v,{label:e("baseStatus"),children:(0,b.jsx)(bu.s,{worktree:D})}),(0,b.jsx)(bq.v,{className:"md:col-span-2",label:d("pullRequest"),children:(0,b.jsx)("span",{className:"flex flex-wrap items-center gap-2",children:(0,b.jsx)(bu.f,{onPipelinesChanged:F,worktree:D})})})]})]})]}),(0,b.jsx)(bs.WorktreeBuildTable,{builds:i,loadingMore:q,nextCursor:k,onError:t,onLoadMore:z,onReload:F})]})}function bx({label:a,value:c,copy:d=!1,children:e}){let g=(0,f.f)("runs.info"),[h,i]=(0,o.useState)(null),[j,k]=(0,o.useState)(!1),l=!!(c&&h===c);return(0,b.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,b.jsx)("dt",{className:"text-xs text-muted-foreground",children:a}),(0,b.jsxs)("dd",{className:"flex min-w-0 items-start gap-2 text-sm",children:[(0,b.jsx)("span",{className:d&&c?"min-w-0 font-mono text-xs wrap-anywhere":"min-w-0 wrap-anywhere",children:e??c??g("unavailable")}),d&&c&&(0,b.jsx)(K.K,{"aria-label":g("copyValue",{label:a}),className:"size-6 shrink-0",onClick:async()=>{try{await navigator.clipboard.writeText(c),i(c),k(!1)}catch{i(null),k(!0)}},size:"icon",type:"button",variant:"ghost",children:l?(0,b.jsx)(Z.f,{className:"size-3"}):(0,b.jsx)(aa.f,{className:"size-3"})})]}),(0,b.jsx)("div",{"aria-live":"polite",className:"text-xs text-muted-foreground",children:j?g("copyFailed"):l?g("copied"):null})]})}function by({run:a}){let c=(0,f.f)("runs"),d=(0,f.f)("runs.info"),e=a.attempts.filter(({supersededAt:a})=>!a).reduce((a,b)=>!a||b.generation>a.generation?b:a,null),g=e?.sessionInfo,h=[["createdAt",a.createdAt],["startedAt",a.startedAt],["finishedAt",a.finishedAt],["updatedAt",a.updatedAt]];return(0,b.jsxs)(L.N,{className:"min-w-0",children:[(0,b.jsxs)(L.Y,{children:[(0,b.jsx)(L.v,{children:d("PLAN"===a.kind?"planTitle":"sessionTitle")}),(0,b.jsx)(L.u,{children:d("description")})]}),(0,b.jsx)(L.O,{children:(0,b.jsxs)("dl",{className:"grid min-w-0 gap-x-6 gap-y-4 sm:grid-cols-2",children:[(0,b.jsx)(bx,{label:c("provider"),value:(0,U.G)(a.provider)}),(0,b.jsx)(bx,{label:d("providerVersion"),value:a.providerVersion}),(0,b.jsx)(bx,{label:c("origin"),value:c("IMPORTED"===a.origin?"imported":"managed")}),(0,b.jsx)(bx,{label:d("nativeSessionId"),value:e?.nativeId,copy:!0}),(0,b.jsx)(bx,{label:d("nativeTranscriptPath"),value:"OPENCODE"===a.provider?null:g?.nativeTranscriptPath,copy:!0,children:"OPENCODE"===a.provider?d("noStandaloneFile"):void 0}),(0,b.jsx)(bx,{label:d("activityLogPath"),value:"IMPORTED"===a.origin?null:g?.activityLogPath,copy:!0,children:"IMPORTED"===a.origin?d("noImportedActivityLog"):void 0}),(0,b.jsx)(bx,{label:d("workingDirectory"),value:g?.workingDirectory,copy:!0}),(0,b.jsx)(bx,{label:d("agentId"),value:a.agentId,copy:!0}),(0,b.jsx)(bx,{label:d("repository"),value:a.repositoryName}),(0,b.jsx)(bx,{label:d("branch"),value:a.branch}),(0,b.jsx)(bx,{label:c("model"),value:a.model}),(0,b.jsx)(bx,{label:c("effort"),value:a.effort}),h.map(([a,c])=>(0,b.jsx)(bx,{label:d(a),children:(0,b.jsx)(F.f,{value:c,fallback:d("unavailable")})},a))]})})]})}var bz=a.i(462787);let bA=["CLAUDE","CODEX","OPENCODE"],bB=["CLAUDE","CODEX"];function bC(a,b){let c=URL.createObjectURL(a),d=document.createElement("a");d.href=c,d.download=b,document.body.appendChild(d),d.click(),d.remove(),URL.revokeObjectURL(c)}function bD({value:a}){let c=(0,ba.f)(),d=`/ai/${"PLAN"===a.kind?"plans":"sessions"}/${a.id}`;return(0,b.jsxs)(S.L,{className:"flex items-center gap-2 rounded-lg border p-3 hover:bg-muted/50",href:d,children:[(0,b.jsx)(v.f,{className:"size-4"}),(0,b.jsxs)("span",{className:"font-mono",children:["PLAN"===a.kind?"Plan":"Session"," #",a.displayNumber]}),a.followUpMode&&(0,b.jsx)(J.f,{variant:"outline",children:c.followUpMode(a.followUpMode)}),(0,b.jsx)(J.f,{className:"ml-auto",variant:"secondary",children:c.status(a.status)})]})}function bE(a){return!a||"object"!=typeof a||Array.isArray(a)?{}:Object.fromEntries(Object.entries(a).map(([a,b])=>{let c=b&&"object"==typeof b&&!Array.isArray(b)?b:{};return[a,Array.isArray(c.answers)?c.answers.map(String):"string"==typeof c.answer?[c.answer]:[]]}))}function bF(a,b=[]){return!a||"object"!=typeof a||Array.isArray(a)?{}:Object.fromEntries([...b.map(a=>[a.key,void 0]),...Object.entries(a).flatMap(([a,b])=>b&&"object"==typeof b&&"value"in b?[[a,b.value]]:[])])}function bG({batch:a,editable:i,onAnswered:j}){let m=(0,f.f)("runs"),n=(0,H.F)(),q=(0,S.U)(),[r,s]=(0,o.useState)({}),[t,u]=(0,o.useState)(()=>bF(a.answerRevisions.at(-1)?.answers,a.questions.flatMap(a=>a.field?[a.field]:[]))),[v,w]=(0,o.useState)({}),[y,A]=(0,o.useState)(!1),[C,D]=(0,o.useState)(null),[E,N]=(0,o.useState)(!1),[P,R]=(0,o.useState)(!1),[U,V]=(0,o.useState)(!1),[W,X]=(0,o.useState)(!0),Y=a.questions.flatMap(a=>a.field?[a.field]:[]),Z=()=>{let a=Object.fromEntries(Object.entries(k(Y,t)).map(([a,b])=>[a,{value:b}]));return Object.fromEntries(Object.entries(function(a,b){let f=d(b),g=new Set(a.map(a=>a.key));if(g.size!==a.length)throw Error("Duplicate form field key");for(let a of Object.keys(f))if(!g.has(a))throw new c("unknown",a);let h=Object.create(null),i=new Set;for(let b of a){if("external"!==b.type){for(let a of b.when??[])if(!i.has(a.key))throw Error("Form conditions must reference an earlier field")}let a=Object.hasOwn(f,b.key),g=a?d(f[b.key]).value:void 0;if(e(b,h))!function(a,b){let d=b=>{throw new c(b,a.key)};if("external"===a.type){!0!==b&&d("external");return}if(void 0===b){a.required&&d("required");return}if("string"===a.type){if("string"!=typeof b)return d("type");if(a.required&&!b.length&&d("required"),void 0!==a.minLength&&b.length<a.minLength&&d("minLength"),void 0!==a.maxLength&&b.length>a.maxLength&&d("maxLength"),void 0!==a.pattern){let c=!1;try{c=new RegExp(a.pattern).test(b)}catch{}c||d("pattern")}"email"!==a.format||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(b)||d("format"),"uri"!==a.format||URL.canParse(b)||d("format"),"date"===a.format&&(!/^\d{4}-\d{2}-\d{2}$/.test(b)||Number.isNaN(Date.parse(b))||new Date(b).toISOString().slice(0,10)!==b)&&d("format"),"date-time"===a.format&&Number.isNaN(Date.parse(b))&&d("format"),!a.options||a.custom||a.options.some(a=>a.value===b)||d("option")}else if("number"===a.type||"integer"===a.type){if("number"!=typeof b||!Number.isFinite(b)||"integer"===a.type&&!Number.isInteger(b))return d("type");void 0!==a.minimum&&b<a.minimum&&d("minimum"),void 0!==a.maximum&&b>a.maximum&&d("maximum")}else if("boolean"===a.type)"boolean"!=typeof b&&d("type");else if("multiselect"===a.type){if(!Array.isArray(b)||!b.every(a=>"string"==typeof a))return d("type");a.required&&!b.length&&d("required"),void 0!==a.minItems&&b.length<a.minItems&&d("minItems"),void 0!==a.maxItems&&b.length>a.maxItems&&d("maxItems"),!a.custom&&b.some(b=>!a.options.some(a=>a.value===b))&&d("option")}}(b,g),void 0!==g&&(h[b.key]=g);else if(a)throw new c("inactive",b.key);i.add(b.key)}return h}(Y,a)).map(([a,b])=>[a,{value:b}]))},$=a=>a instanceof c?m("form.invalidAnswer",{field:Y.find(b=>b.key===a.fieldKey)?.title??a.fieldKey,reason:m(`form.errors.${a.code}`)}):a instanceof Error?a.message:String(a),_=async()=>{A(!0),D(null);try{await (0,T.W)("mutation CancelForm($batchId: ID!) { cancelRunQuestion(batchId: $batchId) { id } }",{batchId:a.id}),await j()}catch(a){D($(a))}finally{A(!1)}},aa=async()=>{A(!0),D(null);try{let b=Y.length?Z():Object.fromEntries(a.questions.map(a=>{let b=[...r[a.id]??[]];return v[a.id]?.trim()&&b.push(v[a.id].trim()),[a.id,{answers:b}]}));await (0,T.W)("mutation AnswerQuestion($batchId: ID!, $answers: JSON!) { answerRunQuestion(batchId: $batchId, answers: $answers) { id } }",{batchId:a.id,answers:b}),await j()}catch(a){D($(a))}finally{A(!1)}},ab=a.answerRevisions.at(-1);(0,o.useEffect)(()=>{if(!E)return;if(a.revisionPreparedAt){let b=window.setTimeout(()=>{let b=bE(ab?.answers),c={},d={};for(let e of a.questions){let a=new Set(e.options.map(({label:a})=>a));c[e.id]=(b[e.id]??[]).filter(b=>a.has(b)),d[e.id]=(b[e.id]??[]).filter(b=>!a.has(b)).join("\n")}s(c),w(d),u(bF(ab?.answers,a.questions.flatMap(a=>a.field?[a.field]:[]))),N(!1),R(!0)},0);return()=>window.clearTimeout(b)}let b=window.setInterval(()=>void j(),1e3);return()=>window.clearInterval(b)},[a.questions,a.revisionPreparedAt,ab?.answers,j,E]);let ac=async()=>{N(!0),D(null);try{await (0,T.W)("mutation PrepareAnswerRevision($batchId: ID!) { prepareRunAnswerRevision(batchId: $batchId) { id } }",{batchId:a.id}),await j()}catch(a){N(!1),D(a instanceof Error?a.message:String(a))}},ad=async()=>{A(!0),D(null);try{let b=Y.length?Z():Object.fromEntries(a.questions.map(a=>{let b=[...r[a.id]??[]];return v[a.id]?.trim()&&b.push(v[a.id].trim()),[a.id,{answers:b}]})),c=await (0,T.W)("mutation ReviseAnswer($batchId: ID!, $answers: JSON!, $stash: Boolean!, $rollback: Boolean!) { reviseRunAnswer(batchId: $batchId, answers: $answers, stash: $stash, rollback: $rollback) { id kind } }",{batchId:a.id,answers:b,stash:W&&U,rollback:W});R(!1),q.push(`/ai/${"PLAN"===c.reviseRunAnswer.kind?"plans":"sessions"}/${c.reviseRunAnswer.id}`)}catch(a){D($(a))}finally{A(!1)}},ae=Y.length?(0,b.jsx)(l,{fields:Y,draft:t,onChange:u}):a.questions.map(a=>(0,b.jsxs)("div",{className:"space-y-3",children:[a.header&&(0,b.jsx)(J.f,{variant:"outline",children:a.header}),(0,b.jsx)("p",{className:"font-medium",children:a.prompt}),(0,b.jsx)("div",{className:"space-y-2",children:a.options.map(c=>{let d=r[a.id]?.includes(c.label)??!1;return(0,b.jsxs)("label",{className:"flex items-start gap-3 rounded-lg border p-3",children:[(0,b.jsx)(g.f,{checked:d,onCheckedChange:b=>s(d=>{let e=new Set(d[a.id]??[]);return a.multiSelect||e.clear(),b?e.add(c.label):e.delete(c.label),{...d,[a.id]:[...e]}})}),(0,b.jsxs)("span",{children:[(0,b.jsx)("span",{className:"block font-medium",children:c.label}),c.description&&(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:c.description})]})]},c.id)})}),a.allowCustom&&(0,b.jsx)(h.f,{"aria-label":m("customAnswer"),onChange:b=>w(c=>({...c,[a.id]:b.target.value})),placeholder:m("customAnswer"),value:v[a.id]??""})]},a.id)),af=bE(ab?.answers);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(L.N,{className:"PENDING"===a.status?"border-primary/50":void 0,children:[(0,b.jsx)(L.Y,{children:(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.v,{className:"flex items-center gap-2 text-base",children:"CANCELLED"===a.status?m("form.cancelled"):"PENDING"===a.status?m("answerNeeded"):m("answeredQuestions")}),(0,b.jsx)(L.u,{children:(0,b.jsx)(F.f,{value:a.createdAt})})]}),"ANSWERED"===a.status&&i&&(0,b.jsxs)(K.K,{disabled:E,onClick:()=>void ac(),size:"sm",variant:"outline",children:[E?(0,b.jsx)(Q.f,{}):(0,b.jsx)(x.f,{})," ",E?m("prepareRevision"):m("editAnswer")]})]})}),(0,b.jsxs)(L.O,{className:"space-y-5",children:[(C||a.error)&&(0,b.jsx)(I.J,{variant:"destructive",children:(0,b.jsx)(I.p,{children:C||a.error})}),"PENDING"===a.status?ae:Y.length?(0,b.jsx)(l,{fields:Y,draft:bF(ab?.answers,Y),onChange:()=>void 0,readOnly:!0}):(0,b.jsx)("div",{className:"divide-y rounded-lg border",children:a.questions.map(a=>(0,b.jsxs)("div",{className:"space-y-2 p-3",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a.header&&(0,b.jsx)(J.f,{variant:"outline",children:a.header}),(0,b.jsx)("p",{className:"font-medium",children:a.prompt})]}),(0,b.jsx)("div",{className:"space-y-1.5",children:(af[a.id]??[]).length?af[a.id].map(c=>{let d=a.options.find(a=>a.label===c)?.description;return(0,b.jsxs)("p",{className:"text-sm",children:[(0,b.jsx)("span",{className:"mr-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:m("answer")}),(0,b.jsx)("span",{className:"font-semibold",children:c}),d&&(0,b.jsxs)("span",{className:"text-muted-foreground",children:[" — ",d]})]},c)}):(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"—"})})]},a.id))}),"PENDING"===a.status&&(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(K.K,{disabled:y,onClick:()=>void aa(),children:[y?(0,b.jsx)(Q.f,{}):(0,b.jsx)(B.f,{})," ",m("submitAnswers")]}),!!Y.length&&(0,b.jsx)(K.K,{disabled:y,variant:"outline",onClick:()=>void _(),children:m("form.cancel")})]})]})]}),(0,b.jsx)(M.N,{onOpenChange:R,open:P,children:(0,b.jsxs)(M.d,{className:"sm:max-w-3xl",children:[(0,b.jsxs)(M.s,{children:[(0,b.jsx)(M.F,{children:m("editAnswer")}),(0,b.jsx)(M.C,{children:W?m("revisionDescription"):m("revisionDescriptionNoRollback")})]}),W&&a.pushedCommitWarning&&(0,b.jsxs)(I.J,{variant:"destructive",children:[(0,b.jsx)(p.f,{}),(0,b.jsx)(I.p,{children:a.pushedCommitWarning})]}),(0,b.jsxs)("label",{className:"flex items-start gap-3 rounded-lg border p-3",children:[(0,b.jsx)(g.f,{checked:W,className:"mt-0.5",onCheckedChange:a=>X(!!a)}),(0,b.jsxs)("span",{children:[(0,b.jsx)("span",{className:"block font-medium",children:m("rollbackChanges")}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:m("rollbackChangesHint")})]})]}),W&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(O.f,{children:m("rollbackDiff")}),a.rollbackPatch?(0,b.jsx)(G.f,{className:"max-h-64 overflow-y-auto",labels:n,patch:a.rollbackPatch}):(0,b.jsx)("p",{className:"rounded-lg border p-3 text-sm text-muted-foreground",children:m("noRollbackChanges")})]}),(0,b.jsx)("div",{className:"space-y-5",children:ae}),W&&(0,b.jsxs)("label",{className:"flex items-center gap-3 rounded-lg border p-3",children:[(0,b.jsx)(g.f,{checked:U,onCheckedChange:a=>V(!!a)}),(0,b.jsx)("span",{children:m("stashBeforeRollback")})]}),(0,b.jsx)(M.c,{showCloseButton:!0,children:(0,b.jsxs)(K.K,{disabled:y,onClick:()=>void ad(),variant:W?"destructive":"default",children:[y?(0,b.jsx)(Q.f,{}):W?(0,b.jsx)(z.f,{}):(0,b.jsx)(B.f,{})," ",m("confirmRevision")]})})]})})]})}a.s(["RunDetailPage",0,function({children:a,runId:c}){let d=(0,f.f)("runs"),e=(0,f.f)("common"),k=(0,ba.f)(),l=(0,H.F)(),x=(0,D.X)(),Z=(0,S.U)(),[$,_]=(0,o.useState)(null);(0,m.S)(["ai",$?.kind==="PLAN"?"plans":"sessions",$?.id],$?`${"PLAN"===$.kind?d("plan"):d("session")} #${$.displayNumber}`:void 0);let[aa,ab]=(0,o.useState)([]),[ac,ad]=(0,o.useState)(""),ae=(0,o.useRef)(ac);(0,o.useEffect)(()=>{ae.current=ac},[ac]);let af=(0,o.useRef)([]),ag=(0,o.useRef)(new Map),ah=(0,o.useRef)(null),ai=(0,o.useRef)(null),aj=(0,o.useRef)(null),ak=(0,o.useRef)(null),[al,am]=(0,o.useState)(!1),[an,ao]=(0,o.useState)(!1),ap=(0,o.useRef)(0),aq=(0,o.useRef)(-1),ar=(0,o.useRef)(0),[as,at]=(0,o.useState)(!1),[au,av]=(0,o.useState)(!1),[aw,ax]=(0,o.useState)(null),[ay,az]=(0,o.useState)(!0);(0,m.F)(["ai","plans",c],!!aw||!ay&&!$),(0,m.F)(["ai","sessions",c],!!aw||!ay&&!$);let[aA,aB]=(0,o.useState)(null),[aC,aD]=(0,o.useState)(""),[aE,aF]=(0,o.useState)([]),[aG,aH]=(0,o.useState)("RESUME"),[aI,aJ]=(0,o.useState)(""),[aK,aL]=(0,o.useState)(""),aM=(0,o.useRef)(null),[aN,aO]=(0,o.useState)(""),[aP,aQ]=(0,o.useState)("auto"),[aR,aS]=(0,o.useState)(!1),[aT,aU]=(0,o.useState)([]),[aV,aW]=(0,o.useState)([]),[aX,aY]=(0,o.useState)([]),[aZ,a$]=(0,o.useState)("NORMALIZED"),[a_,a0]=(0,o.useState)(!1),[a1,a2]=(0,o.useState)(!1),[a3,a4]=(0,o.useState)(!1),[a5,a6]=(0,o.useState)([]),a7=(0,o.useRef)(null),bb=(0,o.useRef)(!0),bc=(0,o.useCallback)(()=>{let a=a7.current;a&&(bb.current=a.scrollHeight-a.scrollTop-a.clientHeight<=24)},[]);(0,o.useEffect)(()=>{let a=a7.current;a&&bb.current&&(a.scrollTop=a.scrollHeight)},[aa]);let bd=(0,o.useCallback)(async a=>{let b,d,e,f=[],g=-1;for(;;){let a=(await (0,T.W)(`query RunActivityExport($runId: ID!, $afterSequence: Int!) { runEvents(runId: $runId, afterSequence: $afterSequence, first: 500, includeSuperseded: true) { ${Y.q} } }`,{runId:c,afterSequence:g})).runEvents;if(f.push(...a),a.length<500)break;g=a[a.length-1].sequence}let h=new Date().toISOString().replace(/[:.]/g,"-"),i=`run-${c}-activity-${h}`;"json"===a?(b=JSON.stringify(f.map(a=>({id:a.id,sequence:a.sequence,type:a.type,summary:a.summary,detailMarkdown:a.detailMarkdown,raw:a.raw,createdAt:a.createdAt,supersededAt:a.supersededAt})),null,2),d="application/json",e=`${i}.json`):"jsonl"===a?(b=f.filter(a=>null!==a.raw&&void 0!==a.raw).map(a=>JSON.stringify(a.raw)).join("\n"),d="application/x-ndjson",e=`run-${c}-session-${h}.jsonl`):(b=f.map(a=>{let b=[`## ${a.summary}`,"",`- **Type:** ${a.type}`,`- **Time:** ${a.createdAt}`];return a.supersededAt&&b.push(`- **Superseded:** ${a.supersededAt}`),a.detailMarkdown&&b.push("",a.detailMarkdown),null!==a.raw&&void 0!==a.raw&&b.push("","```json",JSON.stringify(a.raw,null,2),"```"),b.join("\n")}).join("\n\n---\n\n"),d="text/markdown",e=`${i}.md`),bC(new Blob([b],{type:d}),e)},[c]),be=(0,o.useCallback)(async()=>{let{filename:a,contentBase64:b}=(await (0,T.W)("query RunNativeSessionFile($runId: ID!) { runNativeSessionFile(runId: $runId) { filename contentBase64 } }",{runId:c})).runNativeSessionFile,d=atob(b),e=new Uint8Array(d.length);for(let a=0;a<d.length;a+=1)e[a]=d.charCodeAt(a);bC(new Blob([e],{type:"application/x-ndjson"}),a)},[c]),bf=(0,o.useCallback)(()=>ai.current?.refresh()??Promise.resolve(),[]),bg=(0,o.useCallback)(()=>ah.current?.refresh()??Promise.resolve(),[]),bi=(0,o.useCallback)(async a=>{let b=ar.current,d=ap.current,e=aq.current!==d;try{let f=await (0,T.W)(`query AgentRunDetail($id: ID!, $includeCatalog: Boolean!) { agentRun(id: $id) { ${Y.b} } runProviderCatalog(runId: $id) @include(if: $includeCatalog) { key label available supportsWebSearch supportsPause supportsSteering supportsResume supportsNativeDelete models { id label efforts group } } }`,{id:c,includeCatalog:e},{signal:a});if(a.aborted)return;b===ar.current&&_(f.agentRun),e&&(aY(f.runProviderCatalog),aq.current=d),f.agentRun&&aM.current!==c&&(aM.current=c,aL(f.agentRun.provider),aO(f.agentRun.model),aQ(f.agentRun.effort??"auto"),aS(f.agentRun.webSearchEnabled)),ax(null)}catch(b){a.aborted||ax(b instanceof Error?b.message:String(b))}finally{a.aborted||az(!1)}},[c]),bj=(0,o.useCallback)(a=>{af.current=[...new Map(a.map(a=>[a.id,a])).values()].sort((a,b)=>a.sequence-b.sequence),ab(af.current)},[]),bm=(0,o.useCallback)(async a=>{let b=JSON.stringify([c,ac.trim()]),d=aj.current!==b;d&&(af.current=[],ag.current.clear());let e=[],f=d?-1:(af.current[0]?.sequence??0)-1,g=af.current[0]?.sequence;ag.current.clear();try{for(;;){let b=await (0,T.W)(`query RunActivity($runId: ID!, $search: String, $afterSequence: Int!, $first: Int!, $latest: Boolean!) { runEvents(runId: $runId, search: $search, afterSequence: $afterSequence, first: $first, latest: $latest) { ${Y.q} } }`,{runId:c,search:ac.trim()||null,afterSequence:f,first:d?200:500,latest:d},{signal:a});if(a.aborted)return;let g=b.runEvents;if(e.push(...g),d||g.length<500)break;let h=g.at(-1).sequence;if(h<=f)break;f=h}if(!d&&void 0!==g&&(af.current[0]?.sequence??g)<g)return void bg();d&&am(200===e.length&&e[0].sequence>0),aj.current=b,bj([...e,...ag.current.values()])}catch(b){a.aborted||ax(b instanceof Error?b.message:String(b))}},[bj,bg,c,ac]),bn=async()=>{if(ak.current||!af.current.length)return;let a=new AbortController;ak.current=a,ao(!0);try{let b=await (0,T.W)(`query RunActivityOlder($runId: ID!, $search: String, $before: Int!) { runEvents(runId: $runId, search: $search, beforeSequence: $before, first: 200) { ${Y.q} } }`,{runId:c,search:ac.trim()||null,before:af.current[0].sequence},{signal:a.signal});if(a.signal.aborted)return;bb.current=!1,bj([...af.current,...b.runEvents]),am(200===b.runEvents.length&&b.runEvents[0].sequence>0)}catch(b){a.signal.aborted||ax(b instanceof Error?b.message:String(b))}finally{ak.current===a&&(ak.current=null),a.signal.aborted||ao(!1)}};(0,o.useEffect)(()=>{aq.current=-1;let a=(0,n.f)(bi);ai.current=a;let b=window.setTimeout(()=>void a.refresh(),0),c=(0,T.g)(()=>{++ap.current,a.refresh()});return()=>{window.clearTimeout(b),a.dispose(),c(),ai.current===a&&(ai.current=null)}},[bi]),(0,o.useEffect)(()=>{let a=(0,n.f)(bm);ah.current=a;let b=window.setTimeout(()=>void a.refresh(),150),c=()=>{"hidden"!==document.visibilityState&&a.refresh()},d=(0,T.g)(c);return window.addEventListener("focus",c),document.addEventListener("visibilitychange",c),()=>{window.clearTimeout(b),a.dispose(),d(),ak.current?.abort(),ak.current=null,window.removeEventListener("focus",c),document.removeEventListener("visibilitychange",c),ah.current===a&&(ah.current=null)}},[bm]),(0,o.useEffect)(()=>{let a=(0,T.p)(),b=a.subscribe({query:`subscription RunChanged($runId: ID!) { agentRunChanged(runId: $runId) { ${Y.b} } }`,variables:{runId:c}},{next:a=>{let b=a.data?.agentRunChanged;b&&(++ar.current,_(b))},error:()=>void 0,complete:()=>void 0}),d=a.subscribe({query:`subscription RunEvent($runId: ID!) { runEventAdded(runId: $runId) { ${Y.q} } }`,variables:{runId:c}},{next:a=>{let b=a.data?.runEventAdded;b&&(ae.current.trim()?bg():(ag.current.set(b.id,b),bj([...(aj.current===JSON.stringify([c,""])?af.current:[]).filter(a=>a.id!==b.id),b])))},error:()=>void 0,complete:()=>void 0}),e=a.subscribe({query:"subscription RunQuestion($runId: ID!) { runQuestionChanged(runId: $runId) { id } }",variables:{runId:c}},{next:()=>void bf(),error:()=>void 0,complete:()=>void 0});return()=>{b(),d(),e()}},[bj,bf,bg,c]);let bo=async a=>{aB(a);try{let b="play"===a?"mutation Play($id: ID!, $mcpPresetIds: [ID!]!) { playPlan(planId: $id, mcpPresetIds: $mcpPresetIds) { id } }":`mutation Lifecycle($id: ID!) { ${a}AgentRun(id: $id) { id } }`;await (0,T.W)(b,{id:c,..."play"===a?{mcpPresetIds:a5}:{}}),await bf(),"play"===a&&(a4(!1),a6([]))}catch(a){ax(a instanceof Error?a.message:String(a))}finally{aB(null)}},bp=async(a,b)=>{if(a.length){aB("upload");try{let c=[];for(let b of a){let a=await fetch("/api/run-attachments",{method:"POST",headers:{"content-type":b.type||"application/octet-stream","x-attachment-filename":encodeURIComponent(b.name)},body:b}),e=await a.json();if(!a.ok)throw Error(e.error||d("uploadFailed"));c.push({...e,downloadPath:`/api/run-attachments/${e.id}`,createdAt:new Date().toISOString()})}b(a=>[...a,...c])}catch(a){ax(a instanceof Error?a.message:String(a))}finally{aB(null)}}},bq=async()=>{aB("steer");try{await (0,T.W)("mutation Steer($id: ID!, $prompt: String!, $attachments: [ID!]!) { steerAgentRun(id: $id, prompt: $prompt, attachmentIds: $attachments) { id } }",{id:c,prompt:aC,attachments:aE.map(({id:a})=>a)}),aD(""),aF([]),await bf()}catch(a){ax(a instanceof Error?a.message:String(a))}finally{aB(null)}},br=async()=>{if($?.worktreeId){aB("follow");try{let a="RESEND"!==aG||aI.trim()?aI:$.initialPrompt,b=await (0,T.W)("mutation FollowUp($sourceId: ID!, $input: RunConfigurationInput!) { createRunFollowUp(sourceId: $sourceId, input: $input) { id kind } }",{sourceId:$.id,input:{kind:$.kind,worktreeId:$.worktreeId,jiraIssueKey:$.jiraIssueKey,provider:aK,model:aN,effort:"auto"===aP?null:aP,webSearchEnabled:aR,prompt:a,attachmentIds:aV.map(({id:a})=>a),mcpPresetIds:aT,followUpMode:aG,contextMode:aK===$.provider?"NATIVE":aZ}});Z.push(`/ai/${"PLAN"===b.createRunFollowUp.kind?"plans":"sessions"}/${b.createRunFollowUp.id}`)}catch(a){ax(a instanceof Error?a.message:String(a))}finally{aB(null),a2(!1)}}},bs=async()=>{try{await (0,T.W)("mutation DeleteRun($id: ID!) { deleteAgentRuns(ids: [$id]) }",{id:c}),Z.push($?.kind==="PLAN"?"/ai/plans":"/ai/sessions")}catch(a){ax(a instanceof Error?a.message:String(a))}},bt=(0,o.useMemo)(()=>$?[$.sourcePlan,$.parentRun,$.playedSession,...$.followUps].filter(a=>!!a&&a.id!==$.id):[],[$]);if(ay)return(0,b.jsxs)("p",{className:"flex gap-2 text-muted-foreground",children:[(0,b.jsx)(Q.f,{})," ",d("loading")]});if(!$)return(0,b.jsx)(I.J,{variant:"destructive",children:(0,b.jsx)(I.p,{children:aw??d("runNotFound")})});let bu=$.worktree?.highlightColor,bv=new Intl.NumberFormat(x,{style:"currency",currency:"USD",maximumFractionDigits:4}),bx=["COMPLETED","CANCELLED","FAILED"].includes($.status),bE=[!$.sourcePlan&&null!==$.sourcePlanNumber?`${d("plan")} #${$.sourcePlanNumber}`:null,!$.parentRun&&null!==$.parentRunNumber?`${d("parentRun")} #${$.parentRunNumber}`:null,"PLAN"===$.kind&&!$.playedSession&&null!==$.playedSessionNumber?`${d("session")} #${$.playedSessionNumber}`:null].filter(a=>!!a),bF=function(a){for(let b=a.length-1;b>=0;b-=1){let c=a[b];if("FINAL"===c.kind)return c}return null}($.checkpoints),bH=bF?.diffPatch,bI=aX.find(({key:a})=>a===aK),bJ=aX.find(({key:a})=>a===$.provider),bK=a=>null===a?"—":`≈${bv.format(a)}`,bL=[!1,!0].map(a=>$.modelUsage.filter(b=>b.superseded===a).reduce((b,c)=>({input:b.input+c.inputTokens,output:b.output+c.outputTokens,cacheRead:b.cacheRead+c.cacheReadTokens,cacheWrite:b.cacheWrite+c.cacheWriteTokens,reported:b.reported+(c.estimatedCost??0),catalog:b.catalog+(c.catalogCost??0),hasReported:b.hasReported||null!==c.estimatedCost,hasCatalog:b.hasCatalog||null!==c.catalogCost,superseded:a}),{input:0,output:0,cacheRead:0,cacheWrite:0,reported:0,catalog:0,hasReported:!1,hasCatalog:!1,superseded:a}));return(0,b.jsxs)("div",{className:"min-w-0 space-y-5",children:[(0,b.jsxs)("div",{className:(0,W.f)("space-y-4",bu&&"rounded-lg border-l-4 p-4",bu&&X.x[bu],bu&&X._[bu]),children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsxs)("h1",{className:"text-2xl font-semibold",children:["PLAN"===$.kind?d("plan"):d("session")," ",(0,b.jsxs)("span",{className:"font-mono",children:["#",$.displayNumber]})]}),(0,b.jsx)(J.f,{children:k.status($.status)}),(0,b.jsx)(J.f,{variant:"outline",children:k.phase($.phase)}),(0,b.jsx)(J.f,{variant:"secondary",children:(0,U.G)($.provider)}),"IMPORTED"===$.origin&&(0,b.jsx)(J.f,{variant:"outline",children:d("imported")})]}),(0,b.jsxs)("p",{className:"mt-1 text-sm text-muted-foreground",children:[$.repositoryName," · ",$.branch??d("detached")," ·"," ",(0,b.jsx)(F.f,{value:$.createdAt})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:["MANAGED"===$.origin&&"IN_PROGRESS"===$.status&&bJ?.supportsPause&&(0,b.jsxs)(K.K,{disabled:!!aA,onClick:()=>void bo("pause"),variant:"outline",children:["pause"===aA?(0,b.jsx)(Q.f,{}):(0,b.jsx)(w.f,{})," ",d("pause")]}),"MANAGED"===$.origin&&"PAUSED"===$.status&&(0,b.jsxs)(K.K,{disabled:!!aA,onClick:()=>void bo("continue"),children:[(0,b.jsx)(z.f,{})," ",d("continue")]}),"MANAGED"===$.origin&&!bx&&(0,b.jsxs)(K.K,{disabled:!!aA,onClick:()=>void bo("cancel"),variant:"destructive",children:[(0,b.jsx)(r.f,{})," ",d("cancel")]}),"PLAN"===$.kind&&"COMPLETED"===$.status&&!$.playedAt&&(0,b.jsxs)(K.K,{disabled:!!aA||!$.finalOutput,onClick:()=>{a6([]),a4(!0)},children:[(0,b.jsx)(y.f,{})," ",d("play")]}),(0,b.jsxs)(K.K,{onClick:()=>void(0,T.W)("mutation Archive($id: ID!, $archived: Boolean!) { archiveAgentRuns(ids: [$id], archived: $archived) }",{id:$.id,archived:!$.archivedAt}).then(bf),variant:"outline",children:[(0,b.jsx)(q.f,{})," ",$.archivedAt?d("restore"):d("archive")]}),(0,b.jsxs)(K.K,{disabled:!bJ?.supportsNativeDelete,onClick:()=>a0(!0),variant:"destructive",children:[(0,b.jsx)(C.f,{})," ",d("delete")]})]})]}),aw&&(0,b.jsx)(I.J,{variant:"destructive",children:(0,b.jsx)(I.p,{children:aw})}),$.error&&(0,b.jsxs)(I.J,{variant:"destructive",children:[(0,b.jsx)(p.f,{}),(0,b.jsx)(I.p,{children:$.error})]}),"IMPORTED_ACTIVE_COLLISION"===$.phase&&(0,b.jsxs)(I.J,{variant:"destructive",children:[(0,b.jsx)(p.f,{}),(0,b.jsx)(I.p,{children:d("importedCollisionWarning")})]})]}),a,(bt.length>0||bE.length>0)&&(0,b.jsxs)(L.N,{children:[(0,b.jsxs)(L.Y,{children:[(0,b.jsx)(L.v,{children:d("linkedItems")}),(0,b.jsx)(L.u,{children:d("linkedItemsDescription")})]}),(0,b.jsxs)(L.O,{className:"grid gap-2 md:grid-cols-2",children:[bt.map(a=>(0,b.jsx)(bD,{value:a},a.id)),bE.map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-dashed p-3 text-muted-foreground",children:[(0,b.jsx)(v.f,{className:"size-4"}),(0,b.jsx)("span",{className:"font-mono",children:a}),(0,b.jsx)(J.f,{className:"ml-auto",variant:"outline",children:d("deleted")})]},a))]})]}),(0,b.jsxs)(L.N,{children:[(0,b.jsx)(L.Y,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)(L.v,{children:d("prompt")}),(0,b.jsx)(a9,{copy:!0,onRawChange:at,raw:as,value:$.initialPrompt})]})}),(0,b.jsxs)(L.O,{className:"space-y-4",children:[(0,b.jsx)(a8,{onRawChange:at,raw:as,showActions:!1,value:$.initialPrompt}),$.inputs[0]?.attachments.length?(0,b.jsx)("div",{className:"flex flex-wrap gap-2",children:$.inputs[0].attachments.map(a=>(0,b.jsx)(K.K,{asChild:!0,size:"sm",variant:"outline",children:(0,b.jsxs)("a",{download:!0,href:a.downloadPath,children:[(0,b.jsx)(u.f,{})," ",a.filename]})},a.id))}):null]})]}),(0,b.jsxs)(L.N,{className:"min-w-0",children:[(0,b.jsxs)(L.Y,{children:[(0,b.jsx)(L.v,{children:d("usageCost")}),(0,b.jsx)(L.u,{children:d("estimatedCost")})]}),(0,b.jsxs)(L.O,{className:"min-w-0 space-y-4",children:[(0,b.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[[d("reportedCost"),bK($.estimatedCost)],[d("catalogCost"),bK($.catalogCost)],[d("inputTokens"),$.inputTokens.toLocaleString(x)],[d("outputTokens"),$.outputTokens.toLocaleString(x)],[d("cacheReadTokens"),$.cacheReadTokens.toLocaleString(x)],[d("cacheWriteTokens"),$.cacheWriteTokens.toLocaleString(x)],[d("reasoningTokens"),$.reasoningTokens.toLocaleString(x)],[d("toolCalls"),$.toolCallCount.toLocaleString(x)]].map(([a,c])=>(0,b.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a}),(0,b.jsx)("p",{className:"mt-1 text-xl font-semibold tabular-nums",children:c})]},a))}),$.modelUsage.some(({superseded:a})=>a)&&(0,b.jsxs)(R.s,{children:[(0,b.jsx)(R.E,{children:(0,b.jsxs)(R.N,{children:[(0,b.jsx)(R.V,{children:d("usageState")}),(0,b.jsx)(R.V,{children:d("inputTokens")}),(0,b.jsx)(R.V,{children:d("outputTokens")}),(0,b.jsx)(R.V,{children:d("cacheReadTokens")}),(0,b.jsx)(R.V,{children:d("cacheWriteTokens")}),(0,b.jsx)(R.V,{children:d("reportedCost")}),(0,b.jsx)(R.V,{children:d("catalogCost")})]})}),(0,b.jsx)(R.z,{children:bL.map(a=>(0,b.jsxs)(R.N,{children:[(0,b.jsx)(R.d,{children:a.superseded?d("superseded"):d("activeUsage")}),(0,b.jsx)(R.d,{children:a.input.toLocaleString(x)}),(0,b.jsx)(R.d,{children:a.output.toLocaleString(x)}),(0,b.jsx)(R.d,{children:a.cacheRead.toLocaleString(x)}),(0,b.jsx)(R.d,{children:a.cacheWrite.toLocaleString(x)}),(0,b.jsx)(R.d,{children:bK(a.hasReported?a.reported:null)}),(0,b.jsx)(R.d,{children:bK(a.hasCatalog?a.catalog:null)})]},String(a.superseded)))})]}),$.modelUsage.length>0&&(0,b.jsxs)(R.s,{children:[(0,b.jsx)(R.E,{children:(0,b.jsxs)(R.N,{children:[(0,b.jsx)(R.V,{children:d("model")}),(0,b.jsx)(R.V,{children:d("inputTokens")}),(0,b.jsx)(R.V,{children:d("outputTokens")}),(0,b.jsx)(R.V,{children:d("cacheReadTokens")}),(0,b.jsx)(R.V,{children:d("cacheWriteTokens")}),(0,b.jsx)(R.V,{children:d("reportedCost")}),(0,b.jsx)(R.V,{children:d("catalogCost")})]})}),(0,b.jsx)(R.z,{children:$.modelUsage.map(a=>(0,b.jsxs)(R.N,{children:[(0,b.jsxs)(R.d,{children:[a.model,a.superseded&&(0,b.jsx)(J.f,{className:"ml-2",variant:"outline",children:d("superseded")})]}),(0,b.jsx)(R.d,{children:a.inputTokens.toLocaleString(x)}),(0,b.jsx)(R.d,{children:a.outputTokens.toLocaleString(x)}),(0,b.jsx)(R.d,{children:a.cacheReadTokens.toLocaleString(x)}),(0,b.jsx)(R.d,{children:a.cacheWriteTokens.toLocaleString(x)}),(0,b.jsx)(R.d,{children:bK(a.estimatedCost)}),(0,b.jsx)(R.d,{children:bK(a.catalogCost)})]},a.id))})]}),$.toolCalls.length>0&&(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h3",{className:"mb-2 font-medium",children:d("toolCalls")}),(0,b.jsx)(bk,{calls:$.toolCalls})]})]})]}),(0,b.jsxs)(L.N,{className:"gap-0 overflow-hidden py-0",children:[(0,b.jsx)(L.Y,{className:"border-b py-3",children:(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.v,{children:d("activity")}),(0,b.jsx)(L.u,{children:d("activityDescription")})]}),(0,b.jsxs)("div",{className:"flex w-full items-center gap-2 sm:w-auto",children:[(0,b.jsxs)("div",{className:"relative w-full sm:w-64",children:[(0,b.jsx)(A.f,{className:"absolute top-1.5 left-2.5 size-4 text-muted-foreground"}),(0,b.jsx)(h.f,{"aria-label":d("searchActivity"),className:"h-7 pl-8 text-xs",onChange:a=>ad(a.target.value),placeholder:d("searchActivity"),value:ac})]}),(0,b.jsxs)(N.G,{children:[(0,b.jsx)(N.X,{asChild:!0,children:(0,b.jsxs)(K.K,{className:"shrink-0",size:"xs",variant:"outline",children:[(0,b.jsx)(t.f,{})," ",d("export")]})}),(0,b.jsxs)(N.L,{align:"end",className:"w-72",children:[(0,b.jsx)(N.r,{onClick:()=>void bd("json").catch(a=>ax(a instanceof Error?a.message:String(a))),children:d("exportJson")}),(0,b.jsx)(N.r,{onClick:()=>void bd("markdown").catch(a=>ax(a instanceof Error?a.message:String(a))),children:d("exportMarkdown")}),$&&bA.includes($.provider)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(N.U,{}),(0,b.jsx)(N.r,{onClick:()=>void bd("jsonl").catch(a=>ax(a instanceof Error?a.message:String(a))),children:d("exportSession",{tool:(0,U.G)($.provider)})}),bB.includes($.provider)&&$.agentId&&(0,b.jsx)(N.r,{onClick:()=>void be().catch(a=>ax(a instanceof Error?a.message:String(a))),children:d("exportSessionFile",{tool:(0,U.G)($.provider)})})]})]})]})]})]})}),al&&(0,b.jsxs)(K.K,{disabled:an,onClick:()=>void bn(),size:"sm",variant:"ghost",children:[an&&(0,b.jsx)(Q.f,{}),e("loadMore")]}),(0,b.jsx)("div",{className:"h-[24rem] overflow-y-auto",onScroll:bc,ref:a7,children:(0,b.jsxs)(R.s,{className:"table-fixed",children:[(0,b.jsx)(R.E,{className:"sticky top-0 z-10 bg-card",children:(0,b.jsxs)(R.N,{children:[(0,b.jsx)(R.V,{className:"h-7 w-10"}),(0,b.jsx)(R.V,{className:"h-7",children:d("activity")}),(0,b.jsx)(R.V,{className:"h-7 w-40",children:d("status")}),(0,b.jsx)(R.V,{className:"h-7 w-24",children:d("age")})]})}),(0,b.jsx)(R.z,{children:(0,b.jsx)(bh,{events:aa})})]})})]}),$.finalOutput&&bx&&(0,b.jsxs)(L.N,{children:[(0,b.jsx)(L.Y,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)(L.v,{children:"PLAN"===$.kind?d("plan"):d("summary")}),(0,b.jsx)(a9,{copy:!0,onRawChange:av,raw:au,value:$.finalOutput})]})}),(0,b.jsx)(L.O,{children:(0,b.jsx)(a8,{onRawChange:av,raw:au,showActions:!1,value:$.finalOutput})})]}),"MANAGED"===$.origin&&"IN_PROGRESS"===$.status&&bJ?.supportsSteering&&(0,b.jsxs)(L.N,{children:[(0,b.jsxs)(L.Y,{children:[(0,b.jsx)(L.v,{children:d("steer")}),(0,b.jsx)(L.u,{children:d("steerDescription")})]}),(0,b.jsxs)(L.O,{className:"space-y-3",children:[(0,b.jsx)(i.f,{onChange:a=>aD(a.target.value),placeholder:d("steerPlaceholder"),value:aC}),(0,b.jsx)(bl.f,{attachments:aE,compact:!0,onFiles:a=>bp(a,aF),onRemove:a=>aF(b=>b.filter(b=>b.id!==a)),uploading:"upload"===aA}),(0,b.jsx)("div",{className:"flex justify-end",children:(0,b.jsxs)(K.K,{disabled:!aC.trim()||!!aA,onClick:()=>void bq(),children:["steer"===aA?(0,b.jsx)(Q.f,{}):(0,b.jsx)(B.f,{})," ",d("send")]})})]})]}),$.questionBatches.map(a=>(0,b.jsx)(bG,{batch:a,editable:"MANAGED"===$.origin&&!a.supersededAt&&!!a.checkpoint,onAnswered:bf},a.id)),(0,b.jsxs)(L.N,{children:[(0,b.jsxs)(L.Y,{children:[(0,b.jsx)(L.v,{children:d("followUp")}),(0,b.jsx)(L.u,{children:d("followUpDescription")})]}),(0,b.jsxs)(L.O,{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,b.jsx)(P.i,{onValueChange:a=>{let b=a??"RESUME";aH(b),"RESEND"===b&&aJ($.initialPrompt)},value:aG,children:(0,b.jsxs)(P.U,{"aria-label":d("followUp"),children:[(0,b.jsx)(P.k,{disabled:aK===$.provider&&!bI?.supportsResume,value:"RESUME",children:d("resume")}),(0,b.jsx)(P.k,{value:"FRESH",children:d("fresh")}),(0,b.jsx)(P.k,{value:"RESEND",children:d("resend")})]})}),(0,b.jsx)("div",{className:"min-w-0 flex-1",children:(0,b.jsx)(bz.f,{catalog:aX,effort:aP,model:aN,onEffortChange:aQ,onModelChange:aO,onProviderChange:a=>{let b=aX.find(({key:b})=>b===a);aL(a),aO(""),aQ("auto"),aS(!!b?.supportsWebSearch)},provider:aK})})]}),"RESUME"===aG&&aK!==$.provider&&(0,b.jsx)(I.J,{children:(0,b.jsxs)(I.p,{className:"flex flex-wrap items-center gap-3",children:[(0,b.jsxs)(j.d,{onValueChange:a=>a$(a??"NORMALIZED"),value:aZ,children:[(0,b.jsx)(j.P,{className:"w-56 shrink-0",children:(0,b.jsx)(j.U,{})}),(0,b.jsxs)(j.r,{children:[(0,b.jsx)(j.T,{value:"NORMALIZED",children:d("normalizedContext")}),(0,b.jsx)(j.T,{value:"SUMMARY",children:d("summaryOnly")})]})]}),(0,b.jsx)("span",{className:"min-w-0 flex-1",children:d("crossProviderWarning")})]})}),(0,b.jsx)(i.f,{className:"min-h-28",onChange:a=>aJ(a.target.value),placeholder:"RESEND"===aG?d("resendPrompt"):d("followUpPrompt"),value:aI}),(0,b.jsx)(bl.f,{attachments:aV,compact:!0,onFiles:a=>bp(a,aW),onRemove:a=>aW(b=>b.filter(b=>b.id!==a)),uploading:"upload"===aA}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(O.f,{children:d("mcpPresets")}),(0,b.jsx)(V.S,{kind:$.kind,onChange:aU,selectedIds:aT})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-4",children:[(0,b.jsxs)("label",{className:"flex items-center gap-2",children:[(0,b.jsx)(g.f,{checked:aR,disabled:!bI?.supportsWebSearch,onCheckedChange:a=>aS(!!a)}),d("webSearch")]}),(0,b.jsxs)(K.K,{disabled:!aI.trim()||!!aA||!aN||!bI?.available,onClick:()=>"PAUSED"===$.status&&"SESSION"===$.kind?a2(!0):void br(),children:["follow"===aA?(0,b.jsx)(Q.f,{}):(0,b.jsx)(v.f,{})," ",d("startFollowUp")]})]})]})]}),$.worktreeId&&(0,b.jsx)(bw,{worktreeId:$.worktreeId}),$.checkpoints.length>0&&(0,b.jsxs)(L.N,{children:[(0,b.jsxs)(L.Y,{children:[(0,b.jsx)(L.v,{children:d("changesSnapshots")}),(0,b.jsx)(L.u,{children:d("changesSnapshotsDescription")})]}),(0,b.jsxs)(L.O,{className:"space-y-3",children:["PLAN"===$.kind&&bH&&(0,b.jsxs)(I.J,{variant:"destructive",children:[(0,b.jsx)(p.f,{}),(0,b.jsx)(I.p,{children:d("planMutationWarning")})]}),bH&&(0,b.jsx)(G.f,{labels:l,patch:bH}),bF&&!bH&&(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:d("noFinalChanges")}),$.checkpoints.map(a=>(0,b.jsxs)("details",{className:"rounded-lg border p-3",children:[(0,b.jsxs)("summary",{className:"cursor-pointer",children:[(0,b.jsx)(s.f,{className:"mr-2 inline size-4"}),k.checkpointKind(a.kind)," ·"," ",(0,b.jsx)(F.f,{value:a.createdAt}),a.branch&&(0,b.jsx)(J.f,{className:"ml-2",variant:"outline",children:a.branch})]}),(0,b.jsxs)("div",{className:"mt-3 space-y-2 text-sm",children:[(0,b.jsxs)("p",{className:"font-mono text-xs",children:["HEAD ",a.headSha??"—"]}),a.diffPatch?(0,b.jsx)(G.f,{labels:l,patch:a.diffPatch}):a.diffSummary?(0,b.jsx)("pre",{className:"overflow-auto rounded bg-muted p-3 text-xs whitespace-pre-wrap",children:a.diffSummary}):(0,b.jsx)("p",{className:"text-muted-foreground",children:d("noFinalChanges")}),a.stashRef&&(0,b.jsxs)("p",{className:"font-mono text-xs",children:[d("stashCreated"),": ",a.stashRef]}),a.refName&&(0,b.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:a.refName})]})]},a.id))]})]}),(0,b.jsx)(by,{run:$}),(0,b.jsx)(E.f,{actionLabel:d("delete"),cancelLabel:d("cancel"),description:d("deleteDescription"),onConfirm:bs,onOpenChange:a0,open:a_,title:d("deleteTitle")}),(0,b.jsx)(M.N,{onOpenChange:a=>{a4(a),a||a6([])},open:a3,children:(0,b.jsxs)(M.d,{className:"sm:max-w-2xl",children:[(0,b.jsxs)(M.s,{children:[(0,b.jsx)(M.F,{children:d("playPlan")}),(0,b.jsx)(M.C,{children:d("playPlanDescription")})]}),(0,b.jsx)(V.S,{kind:"SESSION",onChange:a6,selectedIds:a5}),(0,b.jsxs)(M.c,{children:[(0,b.jsx)(K.K,{onClick:()=>a4(!1),variant:"outline",children:d("cancel")}),(0,b.jsxs)(K.K,{disabled:!!aA,onClick:()=>void bo("play"),children:["play"===aA?(0,b.jsx)(Q.f,{}):(0,b.jsx)(y.f,{})," ",d("play")]})]})]})}),(0,b.jsx)(E.f,{actionLabel:d("cancelAndTransfer"),cancelLabel:d("cancel"),description:d("pausedFollowUpDescription"),onConfirm:br,onOpenChange:a2,open:a1,title:d("pausedFollowUpTitle")})]})}],11598)}];
7
7
 
8
8
  //# sourceMappingURL=src_components_runs_run-detail-page_tsx_0eje87-gx_hru._.js.map