specrails-desktop 2.26.2 → 2.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. package/client/dist/assets/{ActivityFeedPage-bDe4VitF.js → ActivityFeedPage-BlkNVXCv.js} +1 -1
  2. package/client/dist/assets/AgentBrowserCapture-76Ri2QR1.js +1 -0
  3. package/client/dist/assets/AgentIntegrationsModal-D9hVgaBR.js +1 -0
  4. package/client/dist/assets/{AgentModeCodePane-Ci39DcOo.js → AgentModeCodePane-BUR_QxqR.js} +2 -2
  5. package/client/dist/assets/AgentModeJobsPane-CnRXelns.js +1 -0
  6. package/client/dist/assets/AgentsPage-DEt9vpzh.js +86 -0
  7. package/client/dist/assets/{AnalyticsPage-Da21wWWw.js → AnalyticsPage-C_eT3I3i.js} +1 -1
  8. package/client/dist/assets/{BarChart-BiLTq3uC.js → BarChart-DuzYxiJ6.js} +1 -1
  9. package/client/dist/assets/CodePage-72-FLBNw.js +2 -0
  10. package/client/dist/assets/{DesktopAnalyticsPage-COkzgMmd.js → DesktopAnalyticsPage-BSeBkF2n.js} +1 -1
  11. package/client/dist/assets/{DocsDialog-PZHMN18B.js → DocsDialog-CGzqDyN3.js} +2 -2
  12. package/client/dist/assets/DocsPage-BB3VGFM9.js +11 -0
  13. package/client/dist/assets/{ExportDropdown-DDhJH-Jr.js → ExportDropdown-IehskH-7.js} +1 -1
  14. package/client/dist/assets/IntegrationsPage-X8bLyuDk.js +3 -0
  15. package/client/dist/assets/InteractiveJobComposer-D1HUALME.js +19 -0
  16. package/client/dist/assets/JobDetailModal-CMg6aKSO.js +1 -0
  17. package/client/dist/assets/JobDetailPage-Bg01rzeu.js +1 -0
  18. package/client/dist/assets/JobsPage-Cwkm9yYc.js +1 -0
  19. package/client/dist/assets/{LoopBuilderPage-DsLLrtHa.js → LoopBuilderPage-4uPNN8Xn.js} +2 -2
  20. package/client/dist/assets/{LoopPreviewModal-C-fDEgnu.js → LoopPreviewModal-BNUQ9iL8.js} +1 -1
  21. package/client/dist/assets/LoopsPage-DLXESZxq.js +1 -0
  22. package/client/dist/assets/ProjectSettingsDialog-DP6hAug-.js +1 -0
  23. package/client/dist/assets/{TemplatePreviewModal-DcHFbLA8.js → TemplatePreviewModal-C6mndL8D.js} +1 -1
  24. package/client/dist/assets/{agent-Bwkyg2oX2.js → agent-B0Rg_eLw2.js} +1 -1
  25. package/client/dist/assets/{agent-DJ0EBUuP.js → agent-B8f79myL.js} +1 -1
  26. package/client/dist/assets/{agent-Bph_-xt7.js → agent-BCH7a3z-.js} +1 -1
  27. package/client/dist/assets/{agent-BI6vr-To.js → agent-BELAd4RF.js} +1 -1
  28. package/client/dist/assets/{agent-Cqs14QMr2.js → agent-BrCnHlvX2.js} +1 -1
  29. package/client/dist/assets/{agent-BUGXI3Ok2.js → agent-CrcIj6WE2.js} +1 -1
  30. package/client/dist/assets/{agent-CLCyDaZh.js → agent-CtwLUmjl.js} +1 -1
  31. package/client/dist/assets/{agent-Bvy2Csyd.js → agent-xG4qLg4R.js} +1 -1
  32. package/client/dist/assets/{brain-BBNUUrUI.js → brain-Dia32foa.js} +1 -1
  33. package/client/dist/assets/dashboard-5C2FOZQX.js +1 -0
  34. package/client/dist/assets/{dashboard-C6w0rICe.js → dashboard-B6iQ-IL_.js} +1 -1
  35. package/client/dist/assets/dashboard-BFfnCtq52.js +1 -0
  36. package/client/dist/assets/dashboard-BIC8KtRf2.js +1 -0
  37. package/client/dist/assets/dashboard-BawQCyrV.js +1 -0
  38. package/client/dist/assets/dashboard-CEgg9NAr.js +1 -0
  39. package/client/dist/assets/dashboard-CiOyDh9L.js +1 -0
  40. package/client/dist/assets/dashboard-D6x5OnNj2.js +1 -0
  41. package/client/dist/assets/{dist-js-DdP_Gl3p.js → dist-js-DN7Pxudf.js} +1 -1
  42. package/client/dist/assets/{dist-js-BxjTIvdT.js → dist-js-D_4k5prK.js} +1 -1
  43. package/client/dist/assets/index-BbVOi-dY.js +158 -0
  44. package/client/dist/assets/{index-C695aPdV.css → index-o3Q2Lii5.css} +1 -1
  45. package/client/dist/assets/{lib-BviHZ_gK.js → lib-BxSZPd0W.js} +1 -1
  46. package/client/dist/assets/settings-BFv6UbKV.js +1 -0
  47. package/client/dist/assets/{settings-BHdPchJP.js → settings-B_v3zgJf.js} +1 -1
  48. package/client/dist/assets/{settings-BeCczBFS2.js → settings-BemR_e3F.js} +1 -1
  49. package/client/dist/assets/{settings-D54_cgl12.js → settings-Bp24JHlv2.js} +1 -1
  50. package/client/dist/assets/{settings-C_nY14Yz.js → settings-BvIwQ3A1.js} +1 -1
  51. package/client/dist/assets/{settings-BlLi719f.js → settings-Bx2ObkTR2.js} +1 -1
  52. package/client/dist/assets/{settings-CaZ26a0S.js → settings-C_T0-j9d.js} +1 -1
  53. package/client/dist/assets/{settings-cn0tbve62.js → settings-DhaFKpcw2.js} +1 -1
  54. package/client/dist/assets/{upload-CRuuzzvp.js → upload-4u055Eea.js} +1 -1
  55. package/client/dist/assets/{value-CIr5hDMt.js → value-C3Qe3VXm.js} +1 -1
  56. package/client/dist/index.html +5 -5
  57. package/package.json +1 -1
  58. package/server/dist/agent-operator-prompt.js +10 -1
  59. package/server/dist/db.js +51 -2
  60. package/server/dist/dev-ports.js +35 -0
  61. package/server/dist/index.js +2 -6
  62. package/server/dist/mcp/tools/catalog.js +2 -0
  63. package/server/dist/mcp/tools/env.js +72 -0
  64. package/server/dist/mcp/tools/jobs.js +66 -1
  65. package/server/dist/path-resolver.js +74 -15
  66. package/server/dist/project-env.js +30 -0
  67. package/server/dist/project-registry.js +4 -2
  68. package/server/dist/project-router-jobs.js +76 -0
  69. package/server/dist/project-router-settings.js +10 -1
  70. package/server/dist/queue-manager.js +9 -1
  71. package/server/dist/rail-isolated-launch.js +5 -4
  72. package/server/dist/rail-pr-decision.js +27 -17
  73. package/server/dist/rail-pr-store.js +36 -0
  74. package/server/dist/rails-router.js +7 -1
  75. package/server/dist/transient-children.js +126 -8
  76. package/server/dist/workspace-resolution.js +3 -3
  77. package/server/dist/worktree-env-discovery.js +172 -0
  78. package/client/dist/assets/AgentBrowserCapture-DQyeEm2V.js +0 -1
  79. package/client/dist/assets/AgentModeJobsPane-C-g1WNVG.js +0 -1
  80. package/client/dist/assets/AgentsPage-BWgglK7V.js +0 -86
  81. package/client/dist/assets/CodePage-BUcAp7SC.js +0 -2
  82. package/client/dist/assets/DocsPage-D3fChfkj.js +0 -11
  83. package/client/dist/assets/IntegrationsPage-F87uxxVH.js +0 -3
  84. package/client/dist/assets/InteractiveJobComposer-DqDCiCa0.js +0 -19
  85. package/client/dist/assets/JobDetailModal-BWJR60fi.js +0 -1
  86. package/client/dist/assets/JobDetailPage-CjWE_jyd.js +0 -1
  87. package/client/dist/assets/JobsPage-LmnXkyCa.js +0 -1
  88. package/client/dist/assets/LoopsPage-DDNO9h9T.js +0 -1
  89. package/client/dist/assets/ProjectSettingsDialog-CX854C8e.js +0 -1
  90. package/client/dist/assets/dashboard-BjjS1OrL.js +0 -1
  91. package/client/dist/assets/dashboard-Bk6oSk1H2.js +0 -1
  92. package/client/dist/assets/dashboard-BrH-GdOg2.js +0 -1
  93. package/client/dist/assets/dashboard-BurhUI8_.js +0 -1
  94. package/client/dist/assets/dashboard-CAUnfDQL2.js +0 -1
  95. package/client/dist/assets/dashboard-C_ljpeYO.js +0 -1
  96. package/client/dist/assets/dashboard-D6OqDdj6.js +0 -1
  97. package/client/dist/assets/index-Dw1N2-ci.js +0 -156
  98. package/client/dist/assets/settings-D9bDDe2O.js +0 -1
  99. /package/client/dist/assets/{activity-BZNfOdiS.js → activity-BZZlEG3a.js} +0 -0
  100. /package/client/dist/assets/{activity--iN4Ad2R2.js → activity-BbWiDfn-2.js} +0 -0
  101. /package/client/dist/assets/{activity-CIOLxGvh.js → activity-D3Ic-HTS.js} +0 -0
  102. /package/client/dist/assets/{activity-DtxrAUMo2.js → activity-DFbvNqhE2.js} +0 -0
  103. /package/client/dist/assets/{activity-BuVo5sPB.js → activity-DtzRy92x.js} +0 -0
  104. /package/client/dist/assets/{activity-6hM_ZSg9.js → activity-DvECTYGt.js} +0 -0
  105. /package/client/dist/assets/{activity-D2r2h3SE2.js → activity-FleOlK0l2.js} +0 -0
  106. /package/client/dist/assets/{addspec-D-JLDsUV.js → addspec-BKrH2Ucz.js} +0 -0
  107. /package/client/dist/assets/{addspec-DfhDbg5c.js → addspec-B_LQMHW3.js} +0 -0
  108. /package/client/dist/assets/{addspec-bsNDdqRm2.js → addspec-Bw_YQwo62.js} +0 -0
  109. /package/client/dist/assets/{addspec-BMtLZLW62.js → addspec-CFxGvmJR2.js} +0 -0
  110. /package/client/dist/assets/{addspec-mgPOt5q02.js → addspec-CR8MB5Fr2.js} +0 -0
  111. /package/client/dist/assets/{addspec-CP0HRuxY.js → addspec-DaA-CbTt.js} +0 -0
  112. /package/client/dist/assets/{addspec-CRuvWn8d.js → addspec-NBbcTbLc.js} +0 -0
  113. /package/client/dist/assets/{agents-BpoUaoW92.js → agents-B9pFSJQI2.js} +0 -0
  114. /package/client/dist/assets/{agents-78bTZGZh.js → agents-BHgn--3j.js} +0 -0
  115. /package/client/dist/assets/{agents-BUdEi3-N.js → agents-B_qGaB0F.js} +0 -0
  116. /package/client/dist/assets/{agents-bvyRLczL.js → agents-CP8_ezYG.js} +0 -0
  117. /package/client/dist/assets/{agents-BLhWCmDS2.js → agents-CV-_xBvX2.js} +0 -0
  118. /package/client/dist/assets/{agents-CWo-KyAB.js → agents-HFCqQH0Z.js} +0 -0
  119. /package/client/dist/assets/{agents-DDtCJ5M02.js → agents-VsyFhGOS2.js} +0 -0
  120. /package/client/dist/assets/{agentstudio-BMQxc_bz.js → agentstudio-BEp7Sb46.js} +0 -0
  121. /package/client/dist/assets/{agentstudio-Dtq3dGYk.js → agentstudio-BOjG6tgJ.js} +0 -0
  122. /package/client/dist/assets/{agentstudio-C_Jq8Tl4.js → agentstudio-Br3WD7Xs.js} +0 -0
  123. /package/client/dist/assets/{agentstudio-sI27TpBu2.js → agentstudio-CuTt3ZGe2.js} +0 -0
  124. /package/client/dist/assets/{agentstudio-CWgXG5W52.js → agentstudio-D2A5peWV2.js} +0 -0
  125. /package/client/dist/assets/{agentstudio-COZriimI2.js → agentstudio-RfZavULt2.js} +0 -0
  126. /package/client/dist/assets/{agentstudio-jKMTdT70.js → agentstudio-RsxnZtUA.js} +0 -0
  127. /package/client/dist/assets/{aiedit-igmw-ZoZ2.js → aiedit-26p5A_HY2.js} +0 -0
  128. /package/client/dist/assets/{aiedit-6CHdb_iv2.js → aiedit-CV520D4W2.js} +0 -0
  129. /package/client/dist/assets/{aiedit-pc5JDUq1.js → aiedit-CcugGPbS.js} +0 -0
  130. /package/client/dist/assets/{aiedit-eMN4eQPF.js → aiedit-D0Syl-mC.js} +0 -0
  131. /package/client/dist/assets/{aiedit-hknZlly82.js → aiedit-DnBzjlVz2.js} +0 -0
  132. /package/client/dist/assets/{aiedit-B03pD_Na.js → aiedit-DrIjSojo.js} +0 -0
  133. /package/client/dist/assets/{aiedit-BtRqRxML.js → aiedit-a-Z-g5iC.js} +0 -0
  134. /package/client/dist/assets/{analytics-C5dpiS0o.js → analytics-4-eskbtX.js} +0 -0
  135. /package/client/dist/assets/{analytics-CR1TJqUi2.js → analytics-4HvXb0Vn2.js} +0 -0
  136. /package/client/dist/assets/{analytics-rmHuJv0V.js → analytics-Bd9rHGjV.js} +0 -0
  137. /package/client/dist/assets/{analytics-BWMUZ2Pq2.js → analytics-Bpe41fnX2.js} +0 -0
  138. /package/client/dist/assets/{analytics-Bj-SmKHa.js → analytics-CpSTNfui.js} +0 -0
  139. /package/client/dist/assets/{analytics-CCprAqk3.js → analytics-DEe5BMz8.js} +0 -0
  140. /package/client/dist/assets/{analytics-DfNdXR0y2.js → analytics-DcOITHla2.js} +0 -0
  141. /package/client/dist/assets/{attachments-BjyMmrwE.js → attachments-CA2f3qL3.js} +0 -0
  142. /package/client/dist/assets/{attachments-DCZOL1RU.js → attachments-CHDbhKeH.js} +0 -0
  143. /package/client/dist/assets/{attachments-rNn1ekRy2.js → attachments-CKAY5aYG2.js} +0 -0
  144. /package/client/dist/assets/{attachments-BgBNSqQd.js → attachments-CgOQ9K-6.js} +0 -0
  145. /package/client/dist/assets/{attachments-DPCmkFZu2.js → attachments-D2jwJXQ42.js} +0 -0
  146. /package/client/dist/assets/{attachments-C9GTTJsx2.js → attachments-DlEQu56g2.js} +0 -0
  147. /package/client/dist/assets/{attachments-DL-bPy9E.js → attachments-jVdKzAXn.js} +0 -0
  148. /package/client/dist/assets/{browser-Cvg-QHvd2.js → browser-BQFDxrRq.js} +0 -0
  149. /package/client/dist/assets/{browser-rWKj-RR_2.js → browser-BbJ_q_OT2.js} +0 -0
  150. /package/client/dist/assets/{browser-Cc0iDqUi.js → browser-C4VJ5CW12.js} +0 -0
  151. /package/client/dist/assets/{browser-BPkhILSJ.js → browser-Cl-FwPXs.js} +0 -0
  152. /package/client/dist/assets/{browser-FRv8P02E.js → browser-Do2jf8_N.js} +0 -0
  153. /package/client/dist/assets/{browser-BqLqJVVT.js → browser-JsiohNmW.js} +0 -0
  154. /package/client/dist/assets/{browser-BijVYG0Y2.js → browser-kA31eYhu2.js} +0 -0
  155. /package/client/dist/assets/{chat-DdwZjT8K2.js → chat-BMWD_Rx12.js} +0 -0
  156. /package/client/dist/assets/{chat-Bom6bqK3.js → chat-BalviUAD.js} +0 -0
  157. /package/client/dist/assets/{chat-DsbwJhus.js → chat-CJddjN3D2.js} +0 -0
  158. /package/client/dist/assets/{chat-Dnwg-NpQ.js → chat-D5xEtsf3.js} +0 -0
  159. /package/client/dist/assets/{chat-vylxqR0P2.js → chat-Ds8GvCnv.js} +0 -0
  160. /package/client/dist/assets/{chat-BgL3zv6x2.js → chat-SaG-ng1x2.js} +0 -0
  161. /package/client/dist/assets/{chat-Bh3NdgJs.js → chat-n43nZGvn.js} +0 -0
  162. /package/client/dist/assets/{code-DzC1rMk12.js → code-Bit_z2Xd2.js} +0 -0
  163. /package/client/dist/assets/{code-BRcDlze52.js → code-BotxM43N2.js} +0 -0
  164. /package/client/dist/assets/{code-UPVvmAKM2.js → code-C9U6M5-e2.js} +0 -0
  165. /package/client/dist/assets/{code-BdMy3Ffq.js → code-CIPmDEd0.js} +0 -0
  166. /package/client/dist/assets/{code-DgeHz9CB.js → code-DUe1Bouz.js} +0 -0
  167. /package/client/dist/assets/{code-CwnBPPyA.js → code-F_KjccGf.js} +0 -0
  168. /package/client/dist/assets/{code-CeQ0FZpC.js → code-HDK4P6Rx.js} +0 -0
  169. /package/client/dist/assets/{commands-DkU0qliq.js → commands-BFQZc9AG.js} +0 -0
  170. /package/client/dist/assets/{commands-u-4eEHCN.js → commands-BMkC5-ki.js} +0 -0
  171. /package/client/dist/assets/{commands-CSDs9q_2.js → commands-BllkJauO.js} +0 -0
  172. /package/client/dist/assets/{commands-xHDDGfcP2.js → commands-CWX9WmDX2.js} +0 -0
  173. /package/client/dist/assets/{commands-C4Y3C-PF2.js → commands-CzFSoIiq2.js} +0 -0
  174. /package/client/dist/assets/{commands-JWMfGDmr.js → commands-KBbhsnw8.js} +0 -0
  175. /package/client/dist/assets/{commands-RHOchN4n2.js → commands-cKTaLwwV2.js} +0 -0
  176. /package/client/dist/assets/{common-DmqBPwZG.js → common-BfQD173j.js} +0 -0
  177. /package/client/dist/assets/{common-DhWTkocg.js → common-CF8iGXrG.js} +0 -0
  178. /package/client/dist/assets/{common-Bwafujnc2.js → common-Cfmwcrl52.js} +0 -0
  179. /package/client/dist/assets/{common-C-vU-j-I.js → common-D2cimsul.js} +0 -0
  180. /package/client/dist/assets/{common-C5HKSbbz.js → common-DH7fjyL1.js} +0 -0
  181. /package/client/dist/assets/{common-BM3LFLCE2.js → common-DZbXlmq72.js} +0 -0
  182. /package/client/dist/assets/{common-DiPTT7V_2.js → common-DtXmzX2o2.js} +0 -0
  183. /package/client/dist/assets/{explore-UvW1jEMa.js → explore-BEpIs343.js} +0 -0
  184. /package/client/dist/assets/{explore-CNBzrEPS.js → explore-BO_OinBD.js} +0 -0
  185. /package/client/dist/assets/{explore-C0k8HrkN.js → explore-Bhy7WWXv.js} +0 -0
  186. /package/client/dist/assets/{explore-B7fblXBb2.js → explore-CAc8Qzu32.js} +0 -0
  187. /package/client/dist/assets/{explore-D_mWBYCS2.js → explore-DCZL9gRN2.js} +0 -0
  188. /package/client/dist/assets/{explore-Dahc1lOx.js → explore-DW_YTkQh.js} +0 -0
  189. /package/client/dist/assets/{explore-BHtEpoNN2.js → explore-ELbrSZyQ2.js} +0 -0
  190. /package/client/dist/assets/{format-command-CuWuRvka.js → format-command-Db1viey1.js} +0 -0
  191. /package/client/dist/assets/{integrations-BNuauK3o.js → integrations-BQNkrfr7.js} +0 -0
  192. /package/client/dist/assets/{integrations-Cl_wD5AI.js → integrations-BdN2f6bP.js} +0 -0
  193. /package/client/dist/assets/{integrations-CHy8tnpV.js → integrations-BrIUJmVf.js} +0 -0
  194. /package/client/dist/assets/{integrations-Cy8nZ_dv2.js → integrations-Cyp7cSYv2.js} +0 -0
  195. /package/client/dist/assets/{integrations-4KZnYECp.js → integrations-DDR3OHdq.js} +0 -0
  196. /package/client/dist/assets/{integrations-7W266oqF2.js → integrations-DVxi8b0j2.js} +0 -0
  197. /package/client/dist/assets/{integrations-zMqY4VU12.js → integrations-RuNEX3La2.js} +0 -0
  198. /package/client/dist/assets/{jira-uNH1gETL2.js → jira-B5wszJ1-2.js} +0 -0
  199. /package/client/dist/assets/{jira-BHAKtc4B.js → jira-C5UjxHE4.js} +0 -0
  200. /package/client/dist/assets/{jira-D5efgwp_.js → jira-CQ7mrZde.js} +0 -0
  201. /package/client/dist/assets/{jira-bDs7Im2C.js → jira-DIRkZk9U.js} +0 -0
  202. /package/client/dist/assets/{jira-CPpgA-5z2.js → jira-DTYu3hJi2.js} +0 -0
  203. /package/client/dist/assets/{jira-DS7ownDy.js → jira-DtZpokjJ.js} +0 -0
  204. /package/client/dist/assets/{jira-Be369RIR2.js → jira-ZdKb-50F2.js} +0 -0
  205. /package/client/dist/assets/{jobs-CE8qeIYj.js → jobs-BFIdeDTw.js} +0 -0
  206. /package/client/dist/assets/{jobs-BgQzB0Sx2.js → jobs-BJ-Gcao22.js} +0 -0
  207. /package/client/dist/assets/{jobs-1GV2-4zd2.js → jobs-DAGiPVIS2.js} +0 -0
  208. /package/client/dist/assets/{jobs-26F9gGcE.js → jobs-DAU8C_tZ.js} +0 -0
  209. /package/client/dist/assets/{jobs-BqWui9_f.js → jobs-Da0GaaSc.js} +0 -0
  210. /package/client/dist/assets/{jobs-Wh7dn28q2.js → jobs-P3unxtxo2.js} +0 -0
  211. /package/client/dist/assets/{jobs-DzeuASRf.js → jobs-p360zdf1.js} +0 -0
  212. /package/client/dist/assets/{loops-CvOWsi5r.js → loops-Bi4ywYGn.js} +0 -0
  213. /package/client/dist/assets/{loops-BvqQ-bHR2.js → loops-BjK8lmoZ2.js} +0 -0
  214. /package/client/dist/assets/{loops-K5_HXfJa.js → loops-D3wdUkZV.js} +0 -0
  215. /package/client/dist/assets/{loops-D6D3XHjj.js → loops-DDs4KPu_.js} +0 -0
  216. /package/client/dist/assets/{loops-LIgO_-eM.js → loops-DKzYFcq6.js} +0 -0
  217. /package/client/dist/assets/{loops-DJNhp17p2.js → loops-Du-bNVpc2.js} +0 -0
  218. /package/client/dist/assets/{loops-vhJdbcz92.js → loops-DvGbSfxw2.js} +0 -0
  219. /package/client/dist/assets/{mcp-XJNRfxVp2.js → mcp-BG-OCJca2.js} +0 -0
  220. /package/client/dist/assets/{mcp-DtbxuH3V2.js → mcp-CbJ04oFS2.js} +0 -0
  221. /package/client/dist/assets/{mcp-sRmWE8WJ.js → mcp-CrWdq5db.js} +0 -0
  222. /package/client/dist/assets/{mcp-H-gnQUdN.js → mcp-Dd844F5_.js} +0 -0
  223. /package/client/dist/assets/{mcp-Dcl-XxkR.js → mcp-DfmzoT5t.js} +0 -0
  224. /package/client/dist/assets/{mcp-CjVKXAhD2.js → mcp-DyULurYS2.js} +0 -0
  225. /package/client/dist/assets/{mcp-N1nzp8oL.js → mcp-zSJ2TsJj.js} +0 -0
  226. /package/client/dist/assets/{nav-EI_OhEAo.js → nav-BFCUtHUQ2.js} +0 -0
  227. /package/client/dist/assets/{nav-CGy4yx3C.js → nav-BouzorQ5.js} +0 -0
  228. /package/client/dist/assets/{nav-40HzpIFb.js → nav-Bpr-K0tD.js} +0 -0
  229. /package/client/dist/assets/{nav-B6PkGfTk2.js → nav-CpFrRDXd2.js} +0 -0
  230. /package/client/dist/assets/{nav-CXEDcRdv2.js → nav-Dkv4Vlr_2.js} +0 -0
  231. /package/client/dist/assets/{nav-8yPhBn00.js → nav-GG6azCbh.js} +0 -0
  232. /package/client/dist/assets/{nav-BHqMLrS72.js → nav-prHkMqcr.js} +0 -0
  233. /package/client/dist/assets/{setup-BuQNKztt2.js → setup-1vN48B-m2.js} +0 -0
  234. /package/client/dist/assets/{setup-BwMovM9z2.js → setup-BmJ0Kx16.js} +0 -0
  235. /package/client/dist/assets/{setup-BXpw07r-.js → setup-DQWsu2TR.js} +0 -0
  236. /package/client/dist/assets/{setup-D84y3wx-.js → setup-JeBwoXoM.js} +0 -0
  237. /package/client/dist/assets/{setup-DU0ULX8q2.js → setup-T_ApeQDV2.js} +0 -0
  238. /package/client/dist/assets/{setup-BiduSX9d.js → setup-mXnzww4f.js} +0 -0
  239. /package/client/dist/assets/{setup-7J8TjG4O.js → setup-q0wRHUp1.js} +0 -0
  240. /package/client/dist/assets/{specs-CWtKcVDC.js → specs-BGRKhM8t.js} +0 -0
  241. /package/client/dist/assets/{specs-CBDvEYKv.js → specs-C6J2zrLM.js} +0 -0
  242. /package/client/dist/assets/{specs-D2clrt2c2.js → specs-CT8exGOy2.js} +0 -0
  243. /package/client/dist/assets/{specs-C9Sd7BhH2.js → specs-Ce5y2iFc2.js} +0 -0
  244. /package/client/dist/assets/{specs-CIPr9reA2.js → specs-DZDoZsDq.js} +0 -0
  245. /package/client/dist/assets/{specs-PozUNhqb.js → specs-DbtIzV8a.js} +0 -0
  246. /package/client/dist/assets/{specs-DTplt2XM.js → specs-GkiL-snY.js} +0 -0
  247. /package/client/dist/assets/{terminal-xGbCZJHg.js → terminal-BNSg2lR7.js} +0 -0
  248. /package/client/dist/assets/{terminal-De2Brd23.js → terminal-BTpE7iki.js} +0 -0
  249. /package/client/dist/assets/{terminal-BRm03iFA2.js → terminal-Cvabyzm42.js} +0 -0
  250. /package/client/dist/assets/{terminal-DxQWCqSD2.js → terminal-D0z12_sJ2.js} +0 -0
  251. /package/client/dist/assets/{terminal-Z7KsDM_n.js → terminal-DDk_bTw0.js} +0 -0
  252. /package/client/dist/assets/{terminal-cqfd3EDV.js → terminal-DEyt0prF.js} +0 -0
  253. /package/client/dist/assets/{terminal-WSAvHXoU.js → terminal-a6Uq8B0p.js} +0 -0
  254. /package/client/dist/assets/{tickets-C3b8cHhd2.js → tickets-BIxU86j12.js} +0 -0
  255. /package/client/dist/assets/{tickets-SuX_HkK4.js → tickets-C2BhwzwR.js} +0 -0
  256. /package/client/dist/assets/{tickets-DTHo9c3C.js → tickets-D1IeX2EW.js} +0 -0
  257. /package/client/dist/assets/{tickets-BoXom7l8.js → tickets-DZut8Ryt.js} +0 -0
  258. /package/client/dist/assets/{tickets-CWYFvx1W2.js → tickets-LfK6LzKl2.js} +0 -0
  259. /package/client/dist/assets/{tickets-CFXnJsYF.js → tickets-dQfsc7Ph.js} +0 -0
  260. /package/client/dist/assets/{tickets-B7zT4IRf.js → tickets-sVun0I6v.js} +0 -0
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-BNv3lrIs.js";import{a as t,n}from"./auth-Cvsb7-Ek.js";import{a as r,i,n as a,o,r as s,t as c}from"./InteractiveJobComposer-D1HUALME.js";import{$ as l,B as u,Ft as d,H as f,Kn as p,L as ee,Q as m,Rn as h,Tn as g,U as _,V as v,nt as y,ot as b,qn as x,rt as S,wn as C,x as w,xn as T,zn as te}from"./index-BbVOi-dY.js";var ne=e(p(),1),E=e(x(),1),D=[1e3,2e3,4e3,8e3,16e3];function O(e,t){let[r,i]=(0,E.useState)(`connecting`),a=(0,E.useRef)(null),o=(0,E.useRef)(0),s=(0,E.useRef)(null),c=(0,E.useRef)(t);c.current=t;let l=(0,E.useCallback)(()=>{let t=n(),r=t?new WebSocket(e,[`specrails-desktop`,t]):new WebSocket(e);a.current=r,i(`connecting`),r.onopen=()=>{o.current=0,i(`connected`)},r.onmessage=e=>{try{let t=JSON.parse(e.data);c.current(t)}catch{}},r.onclose=()=>{a.current=null;let e=o.current;if(e>=D.length){i(`disconnected`);return}let t=D[e];o.current+=1,s.current=setTimeout(l,t)}},[e]);return(0,E.useEffect)(()=>(l(),()=>{s.current&&clearTimeout(s.current);let e=a.current;e&&(e.onopen=null,e.onmessage=null,e.onclose=null,e.onerror=null,e.close()),a.current=null}),[l]),{connectionStatus:r}}var k=C();function A(e,t){let n=new Date(t).getTime()-new Date(e).getTime();if(n<0)return`—`;let r=Math.round(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60),a=r%60;return i<60?`${i}m ${a}s`:`${Math.floor(i/60)}h ${i%60}m`}var j={running:{variant:`running`,labelKey:`statusLabel.running`,tooltipKey:`statusTooltip.running`},completed:{variant:`success`,labelKey:`statusLabel.completed`,tooltipKey:`statusTooltip.completed`},failed:{variant:`failed`,labelKey:`statusLabel.failed`,tooltipKey:`statusTooltip.failed`},canceled:{variant:`canceled`,labelKey:`statusLabel.canceled`,tooltipKey:`statusTooltip.canceled`},queued:{variant:`queued`,labelKey:`statusLabel.queued`,tooltipKey:`statusTooltip.queued`},zombie_terminated:{variant:`failed`,labelKey:`statusLabel.zombie`,tooltipKey:`statusTooltip.zombie`}};function M({jobId:e,onClose:n,projectId:p}){let{t:x}=te(`jobs`),C=(0,E.useCallback)(()=>p?`${t}/api/projects/${p}`:g(),[p]),[D,M]=(0,E.useState)(null),[N,P]=(0,E.useState)([]),[F,I]=(0,E.useState)([]),[L,R]=(0,E.useState)({}),[z,B]=(0,E.useState)(!0),[V,H]=(0,E.useState)(!1),[U,W]=(0,E.useState)(!1),[G,K]=(0,E.useState)(!1);(0,E.useEffect)(()=>{async function t(){try{let t=await fetch(`${C()}/jobs/${e}`);if(t.status===404){H(!0);return}if(!t.ok)throw Error(`Failed to fetch job`);let n=await t.json();if(M(n.job),P(n.events),n.phaseDefinitions){I(n.phaseDefinitions);let e={};for(let t of n.phaseDefinitions)e[t.key]=`idle`;R(e)}}catch{H(!0)}finally{B(!1)}}t()},[e,C]);let q=(0,E.useCallback)(()=>{fetch(`${C()}/jobs/${e}`).then(e=>e.ok?e.json():null).then(e=>{e?.job&&M(e.job)}).catch(()=>{})},[e,C]),J=(0,E.useRef)([]),Y=(0,E.useRef)(null),X=(0,E.useCallback)(()=>{Y.current=null;let e=J.current;e.length!==0&&(J.current=[],P(t=>{let n=[...t,...e];return n.length>1e4?n.slice(n.length-8e3):n}))},[]);(0,E.useEffect)(()=>()=>{Y.current&&cancelAnimationFrame(Y.current)},[]),O(ee,(0,E.useCallback)(t=>{let n=t;if(n.type===`event`&&n.jobId===e){let t={id:Date.now(),job_id:e,seq:0,event_type:n.event_type,source:n.source,payload:n.payload,timestamp:n.timestamp};J.current.push(t),Y.current||=requestAnimationFrame(X)}else if(n.type===`log`&&n.processId===e){let t={id:Date.now(),job_id:e,seq:0,event_type:`log`,source:n.source,payload:JSON.stringify({line:n.line}),timestamp:n.timestamp};J.current.push(t),Y.current||=requestAnimationFrame(X)}else if(n.type===`job.finalized`&&n.jobId===e)q();else if(n.type===`phase`){let e=n.phase,t=n.state;R(n=>({...n,[e]:t}))}else if(n.type===`queue`){let t=n.jobs?.find(t=>t.id===e);t&&D&&M(e=>e&&{...e,status:t.status})}},[e,D,X,q])),(0,E.useEffect)(()=>{function e(e){if(e.key===`Escape`){if(U){W(!1);return}n()}}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,U]);let Z=D?o(D):`job`,Q=Z===`loop-run`;async function re(){K(!0);try{let t=await r({projectId:p??null,jobId:e,kind:Z});t.ok?(h.success(x(Q?`modal.toast.stopSignalSent`:`modal.toast.cancelSignalSent`),{description:x(Q?`modal.toast.stopSignalSentDescription`:`modal.toast.cancelSignalSentDescription`)}),q()):h.error(x(`modal.toast.cancelFailed`),{description:t.error})}finally{K(!1)}}let $=D?j[D.status]??j.queued:j.queued,ie=D?.status===`running`,{panelRef:ae,panelStyle:oe,headerHandleProps:se,resizeHandles:ce,isFloating:le,guardBackdrop:ue}=l();return(0,ne.createPortal)((0,k.jsx)(f,{delayDuration:400,children:(0,k.jsxs)(`div`,{className:`fixed inset-0 z-[65] flex items-stretch justify-center`,children:[(0,k.jsx)(`div`,{className:`absolute inset-0 bg-black/50 backdrop-blur-sm`,onClick:ue(n)}),(0,k.jsxs)(`div`,{ref:ae,className:`relative w-full m-3 rounded-xl glass-card border border-border/30 flex flex-col animate-in fade-in zoom-in-95 duration-200 overflow-hidden`,style:oe,children:[(0,k.jsxs)(`div`,{...se,className:`flex items-center justify-between px-4 py-3 border-b border-border/30${le?` cursor-grab active:cursor-grabbing`:``}`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[D&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(u,{children:[(0,k.jsx)(_,{asChild:!0,children:(0,k.jsx)(`div`,{children:(0,k.jsx)(y,{variant:$.variant,children:x($.labelKey)})})}),(0,k.jsx)(v,{children:x($.tooltipKey)})]}),(0,k.jsx)(`code`,{className:`text-xs font-mono text-foreground/80 truncate`,children:D.command}),(0,k.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:w(new Date(D.started_at),{addSuffix:!0,locale:T()})}),D.total_cost_usd!=null&&D.total_cost_usd>0&&(0,k.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[`$`,D.total_cost_usd.toFixed(4)]}),D.finished_at&&(0,k.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:A(D.started_at,D.finished_at)})]}),z&&(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:x(`common:states.loading`)})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[F.length>0&&(0,k.jsx)(`div`,{className:`mr-3`,children:(0,k.jsx)(i,{phases:L,phaseDefinitions:F})}),ie&&(0,k.jsxs)(S,{variant:`ghost`,size:`sm`,onClick:()=>W(!0),disabled:G,className:`h-7 text-destructive hover:text-destructive hover:bg-destructive/10`,children:[G&&(0,k.jsx)(d,{className:`w-3.5 h-3.5 mr-1.5 animate-spin`,"aria-hidden":!0}),x(Q?`dashboard:railControls.stop`:Z===`interactive`?`common:actions.discard`:`common:actions.cancel`)]}),(0,k.jsx)(`button`,{onClick:n,className:`h-7 w-7 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-surface/50 transition-colors cursor-pointer`,children:(0,k.jsx)(b,{className:`w-4 h-4`})})]})]}),(0,k.jsx)(`div`,{className:`flex-1 overflow-hidden relative`,children:V?(0,k.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:x(`modal.notFound`)})}):D?.command.startsWith(`loop:`)?(0,k.jsx)(a,{events:N,jobStatus:D.status,isLoading:z,variant:`glass`,projectId:p}):(0,k.jsx)(s,{events:N,isLoading:z,projectId:p})}),!!D?.interactive&&D.status===`running`&&(0,k.jsx)(c,{jobId:e,projectId:p,settleMode:D.interactiveSettleMode,initialAcceptingTurns:D.interactiveAcceptingTurns,kind:D.command.startsWith(`loop:`)?`loop-step`:`job`,variant:`glass`,onFinalized:q})]}),(0,k.jsx)(m,{handles:ce}),U&&(0,k.jsxs)(`div`,{"data-testid":`job-cancel-confirm`,className:`absolute inset-0 z-10 flex items-center justify-center p-4`,children:[(0,k.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-sm`,onClick:()=>W(!1)}),(0,k.jsxs)(`div`,{className:`relative w-full max-w-sm rounded-xl glass-card border border-border/30 p-5 shadow-xl animate-in fade-in zoom-in-95 duration-150`,children:[(0,k.jsx)(`h3`,{className:`text-base font-semibold text-foreground`,children:x(Q?`modal.stopRunConfirmTitle`:`modal.cancelConfirmTitle`)}),(0,k.jsx)(`p`,{className:`mt-1.5 text-sm text-muted-foreground`,children:x(Q?`modal.stopRunConfirmDescription`:`modal.cancelConfirmDescription`)}),(0,k.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,k.jsx)(S,{variant:`ghost`,size:`sm`,onClick:()=>W(!1),children:x(`modal.keepRunning`)}),(0,k.jsx)(S,{variant:`destructive`,size:`sm`,onClick:()=>{W(!1),re()},children:x(Q?`modal.stopRun`:Z===`interactive`?`common:actions.discard`:`modal.cancelJob`)})]})]})]})]})}),document.body)}export{M as JobDetailModal};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-BNv3lrIs.js";import{a as t,i as n,n as r,r as i,t as a}from"./InteractiveJobComposer-D1HUALME.js";import{$t as o,B as s,C as c,Cn as ee,Ft as l,Hn as u,Rn as d,Rt as f,St as p,Tn as m,U as h,Un as g,V as _,Wn as v,Zt as y,an as b,b as x,it as S,nn as C,nt as w,on as te,qn as T,rn as E,rt as D,sn as O,w as k,wn as A,x as j,xn as M,yn as ne,zn as N}from"./index-BbVOi-dY.js";import{t as P}from"./format-command-Db1viey1.js";var F=e(T(),1),I=A();function L(e,t){let n=(typeof t==`number`?t:new Date(t).getTime())-new Date(e).getTime();if(!Number.isFinite(n)||n<0)return`—`;let r=Math.round(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60),a=r%60;return i<60?`${i}m ${a}s`:`${Math.floor(i/60)}h ${i%60}m`}function R(e){let t=new Set;for(let n of e)if(n.event_type===`log`)try{let e=(JSON.parse(n.payload).line??``).match(/(?:Writing|Editing|Created?|Updated?)\s+(?:file:\s*)?([\w./\-]+\.\w+)/i);e&&t.add(e[1])}catch{}return Array.from(t).slice(0,20)}var z={steps:0,actionKey:``,actionArg:``,lastSeenIdx:0};function B(e,t){if(t.type===`reset`)return z;if(t.type===`consume`){let{events:n}=t,r=e.lastSeenIdx>n.length?n.length:e.lastSeenIdx;if(n.length<=r)return r===e.lastSeenIdx?e:{...e,lastSeenIdx:r};let{steps:i,actionKey:a,actionArg:o}=e;for(let e=r;e<n.length;e++){let t=k(n[e]);t.step&&(i+=t.stepCount??1),t.actionKey&&(a=t.actionKey,o=t.actionArg??``)}return{steps:i,actionKey:a,actionArg:o,lastSeenIdx:n.length}}return e}function V({job:e,events:t,defaultOpen:n=!0,pipelineTotals:r,phases:i,phaseDefinitions:a}){let{t:o}=N(`jobs`),[s,ee]=(0,F.useState)(n),u=(0,F.useMemo)(()=>R(t),[t]),d=e.status===`running`,f=e.status===`completed`,[p,m]=(0,F.useState)(()=>Date.now());(0,F.useEffect)(()=>{if(!d)return;let e=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(e)},[d]);let[h,g]=(0,F.useReducer)(B,z),_=(0,F.useRef)(e.id);(0,F.useEffect)(()=>{_.current!==e.id&&(_.current=e.id,g({type:`reset`})),g({type:`consume`,events:t})},[e.id,t]);let[v,y]=(0,F.useState)(!0);(0,F.useEffect)(()=>{if(!d)return;y(!0);let e=window.setTimeout(()=>y(!1),8e3);return()=>window.clearTimeout(e)},[d,e.id]);let b=e.finished_at?L(e.started_at,e.finished_at):d?L(e.started_at,p):`—`,x=!!e.total_cost_usd_estimated,w=e.total_cost_usd==null?null:`${x?`~`:``}$${e.total_cost_usd.toFixed(4)}`,te=e.num_turns==null?null:String(e.num_turns),T=e.tokens_in==null?null:(e.tokens_in??0)+(e.tokens_out??0)+(e.tokens_cache_read??0)+(e.tokens_cache_create??0),D=T==null?null:`${(T/1e3).toFixed(1)}k`,k=(0,F.useMemo)(()=>!i||!a?null:a.find(e=>i[e.key]===`running`)?.label??null,[i,a]),A=d&&h.steps===0?`connecting`:h.actionKey||`thinking`,j=c.has(A)&&h.actionArg!==``,M=c.has(A)&&!j?`working`:A,ne=j?o(`statusPanel.activity.${M}`,{arg:h.actionArg}):o(`statusPanel.activity.${M}`),P=k??(d&&h.steps===0?o(`statusPanel.activity.starting`):null),V=h.steps>0?o(`statusPanel.steps`,{count:h.steps}):null,G=o(d?`statusPanel.inProgress`:f?`statusPanel.completed`:`statusPanel.failed`),re=d?`border-accent-info/20 bg-accent-info/5`:f?`border-emerald-500/20 aurora-light:border-accent-success/30 bg-emerald-500/5 aurora-light:bg-accent-success/5`:`border-red-500/20 aurora-light:border-destructive/30 bg-red-500/5 aurora-light:bg-destructive/5`,K=d?l:f?E:C,q=d?`w-4 h-4 text-accent-info shrink-0 animate-spin`:f?`w-4 h-4 text-emerald-400 aurora-light:text-accent-success shrink-0`:`w-4 h-4 text-red-400 aurora-light:text-destructive shrink-0`;return(0,I.jsxs)(`div`,{className:S(`mx-4 my-2 rounded-xl border transition-colors duration-500`,re),children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>ee(!s),className:`w-full flex items-center gap-3 px-4 py-3`,children:[(0,I.jsx)(K,{className:q,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`text-sm font-semibold flex-1 text-left`,children:G}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-[11px] text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`tabular-nums`,children:b}),d?V&&(0,I.jsx)(`span`,{className:`tabular-nums`,children:V}):(0,I.jsxs)(I.Fragment,{children:[w&&(0,I.jsx)(`span`,{className:`tabular-nums text-yellow-400 aurora-light:text-accent-warning`,children:w}),u.length>0&&(0,I.jsx)(`span`,{children:o(`statusPanel.filesCount`,{count:u.length})})]})]}),(0,I.jsx)(O,{className:S(`w-4 h-4 text-muted-foreground/40 transition-transform duration-150 shrink-0`,s&&`rotate-180`)})]}),s&&(0,I.jsx)(`div`,{className:`px-4 pb-4 space-y-3 border-t border-border/20`,children:d?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`p`,{className:`pt-3 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:o(`statusPanel.zoneInProgress`)}),(0,I.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-3 sm:items-stretch`,children:[(0,I.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2 sm:w-44 shrink-0`,children:[(0,I.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:[o(`statusPanel.duration`),(0,I.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-accent-info animate-pulse`,title:o(`statusPanel.liveTooltip`),"aria-label":o(`statusPanel.liveTooltip`)})]}),(0,I.jsx)(`p`,{className:`text-sm font-semibold tabular-nums mt-0.5 text-accent-info`,children:b})]}),(0,I.jsxs)(`div`,{className:`flex-1 flex items-center gap-2 bg-muted/10 rounded-lg px-3 py-2 min-w-0`,children:[(0,I.jsx)(l,{className:`w-3.5 h-3.5 text-accent-info shrink-0 animate-spin`,"aria-hidden":`true`}),P&&(0,I.jsx)(`span`,{className:`text-[11px] font-medium px-1.5 py-0.5 rounded bg-accent-info/15 text-accent-info shrink-0`,children:P}),(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground truncate flex-1 min-w-0`,children:ne}),V&&(0,I.jsxs)(`span`,{className:`text-[11px] text-muted-foreground/60 tabular-nums shrink-0`,children:[`· `,V]})]})]}),v&&(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground/40 leading-snug`,children:o(`statusPanel.explainer`)}),(0,I.jsx)(`p`,{className:`pt-1 text-[10px] text-muted-foreground/50 uppercase tracking-wider border-t border-accent-info/10 mt-1`,children:o(`statusPanel.zoneFinalPending`)}),(0,I.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,I.jsx)(W,{label:o(`statusPanel.cost`),caption:o(`statusPanel.pendingCaption`),tooltip:o(`statusPanel.costTooltip`)}),(0,I.jsx)(W,{label:o(`statusPanel.turns`),caption:o(`statusPanel.pendingCaption`),tooltip:o(`statusPanel.pendingTooltip`)}),(0,I.jsx)(W,{label:o(`statusPanel.tokens`),caption:o(`statusPanel.pendingCaption`),tooltip:o(`statusPanel.pendingTooltip`)})]})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`p`,{className:`pt-3 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:o(`statusPanel.zoneFinal`)}),(0,I.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-2`,children:[(0,I.jsx)(H,{label:o(`statusPanel.duration`),value:b}),(0,I.jsx)(U,{label:o(`statusPanel.cost`),value:w,valueClass:`text-yellow-400 aurora-light:text-accent-warning`,naCaption:o(`statusPanel.notAvailable`)}),(0,I.jsx)(U,{label:o(`statusPanel.turns`),value:te,naCaption:o(`statusPanel.notAvailable`)}),(0,I.jsx)(U,{label:o(`statusPanel.tokens`),value:D,naCaption:o(`statusPanel.notAvailable`)})]}),r&&(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider mb-1.5`,children:o(`statusPanel.pipelineTotal`,{count:r.jobCount})}),(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,I.jsx)(H,{label:o(`statusPanel.totalCost`),value:`${r.costEstimated?`~`:``}${r.hasNullCost?`≥`:``}$${r.totalCostUsd.toFixed(4)}`,valueClass:`text-yellow-400 aurora-light:text-accent-warning`}),(0,I.jsx)(H,{label:o(`statusPanel.totalTokens`),value:`${((r.totalTokensIn+r.totalTokensOut+r.totalTokensCacheRead+r.totalTokensCacheCreate)/1e3).toFixed(1)}k`})]}),r.hasNullCost&&(0,I.jsx)(`p`,{"data-testid":`pipeline-partial-hint`,className:`text-[10px] text-muted-foreground/70 mt-1.5`,title:o(`statusPanel.pipelinePartialTooltip`),children:o(`statusPanel.pipelinePartial`,{count:r.nullCostCount??0})})]}),u.length>0&&(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider mb-1.5`,children:o(`statusPanel.filesModified`)}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:u.map(e=>(0,I.jsx)(`code`,{className:`text-[10px] font-mono bg-muted/30 px-2 py-0.5 rounded text-cyan-400/80 aurora-light:text-accent-info`,children:e},e))})]})]})})]})}function H({label:e,value:t,valueClass:n}){return(0,I.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2`,children:[(0,I.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:e}),(0,I.jsx)(`p`,{className:S(`text-sm font-semibold tabular-nums mt-0.5`,n),children:t})]})}function U({label:e,value:t,valueClass:n,naCaption:r}){return(0,I.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2`,children:[(0,I.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:e}),(0,I.jsx)(`p`,{className:S(`text-sm font-semibold tabular-nums mt-0.5`,t==null?`text-muted-foreground`:n),children:t??`—`}),t==null&&(0,I.jsx)(`p`,{className:`text-[10px] text-muted-foreground/30 mt-0.5`,children:r})]})}function W({label:e,caption:t,tooltip:n}){return(0,I.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2 ring-1 ring-accent-info/10`,title:n,children:[(0,I.jsxs)(`p`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:[e,(0,I.jsx)(o,{className:`w-2.5 h-2.5 text-muted-foreground/30`,"aria-hidden":`true`})]}),(0,I.jsx)(`p`,{className:`text-sm font-semibold tabular-nums mt-0.5 text-muted-foreground/40`,children:`—`}),(0,I.jsx)(`p`,{className:`text-[10px] text-muted-foreground/30 mt-0.5`,children:t})]})}var G=4;function re({tickets:e,onTicketClick:t}){let{t:n}=N(`jobs`),[r,i]=(0,F.useState)(!1);if(e.length===0)return null;let a=e.length>=G&&!r?e.slice(0,1):e,o=e.length-a.length;return(0,I.jsxs)(`div`,{className:`rounded-xl border border-border/40 bg-card/40 px-4 py-3 space-y-1.5`,children:[a.map(e=>(0,I.jsx)(K,{ticket:e,onClick:()=>t(e.id)},e.id)),o>0&&(0,I.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[n(`ticketHeader.showMore`,{count:o}),(0,I.jsx)(O,{className:`w-3 h-3`})]}),r&&e.length>=G&&(0,I.jsxs)(`button`,{type:`button`,onClick:()=>i(!1),className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[n(`ticketHeader.showLess`),(0,I.jsx)(b,{className:`w-3 h-3`})]})]})}function K({ticket:e,onClick:t}){let{t:n}=N(`jobs`),r=e.title==null,i=`inline-flex items-center px-1.5 py-0.5 rounded-md text-[11px] font-mono tabular-nums shrink-0`;return r?(0,I.jsx)(`div`,{className:`flex items-center gap-2 min-w-0`,children:(0,I.jsx)(`span`,{className:S(i,`text-muted-foreground bg-muted/20 select-none`),title:n(`ticketHeader.deletedTooltip`),children:n(`ticketHeader.deletedTicket`,{id:e.id})})}):(0,I.jsxs)(`button`,{type:`button`,onClick:t,className:`flex items-center gap-2 min-w-0 w-full text-left group`,title:e.title??void 0,children:[(0,I.jsxs)(`span`,{className:S(i,`text-accent-primary bg-accent-primary/10 group-hover:bg-accent-primary/20 transition-colors`),children:[`#`,e.id]}),(0,I.jsx)(`span`,{className:`text-lg font-semibold text-foreground truncate group-hover:text-accent-primary transition-colors`,children:e.title})]})}var q={running:{variant:`running`,labelKey:`statusLabel.running`,tooltipKey:`statusTooltip.running`},completed:{variant:`success`,labelKey:`statusLabel.completed`,tooltipKey:`statusTooltip.completed`},failed:{variant:`failed`,labelKey:`statusLabel.failed`,tooltipKey:`statusTooltip.failed`},canceled:{variant:`canceled`,labelKey:`statusLabel.canceled`,tooltipKey:`statusTooltip.canceled`},queued:{variant:`queued`,labelKey:`statusLabel.queued`,tooltipKey:`statusTooltip.queued`}};function J(){let{t:e}=N(`jobs`),{id:o}=v(),{activeProjectId:c,projects:l}=ne(),b=l.find(e=>e.id===c)?.provider,C=g(),{openTicketDetail:T}=x(),[E,O]=(0,F.useState)(null),[k,A]=(0,F.useState)([]),[L,R]=(0,F.useState)([]),[z,B]=(0,F.useState)({}),[H,U]=(0,F.useState)([]),[W,G]=(0,F.useState)(!0),[K,J]=(0,F.useState)(!1);(0,F.useEffect)(()=>{if(!o)return;let e=new AbortController;O(null),A([]),R([]),B({}),G(!0),J(!1);async function t(){try{let t=await fetch(`${m()}/jobs/${o}`,{signal:e.signal});if(t.status===404){J(!0);return}if(!t.ok)throw Error(`Failed to fetch job`);let n=await t.json();O(n.job),A(n.events)}catch(e){if(e.name===`AbortError`)return;J(!0)}finally{e.signal.aborted||G(!1)}}return t(),()=>e.abort()},[o,c]),(0,F.useEffect)(()=>{if(!E?.pipeline_id){U([]);return}let e=E.pipeline_id;fetch(`${m()}/pipelines/${e}`).then(e=>e.ok?e.json():null).then(e=>{e?.jobs&&U(e.jobs)}).catch(()=>{})},[E?.pipeline_id,E?.status]);let Y=(0,F.useRef)(c);Y.current=c;let ie=(0,F.useRef)(null);ie.current=E?.status??null;let X=(0,F.useRef)([]),Z=(0,F.useRef)(null),ae=(0,F.useCallback)(()=>{Z.current=null;let e=X.current;e.length!==0&&(X.current=[],A(t=>{let n=[...t,...e];return n.length>1e4?n.slice(n.length-8e3):n}))},[]),Q=(0,F.useCallback)(e=>{let t=X.current;t.push(e),t.length>1e4&&(X.current=t.slice(-8e3)),Z.current||=requestAnimationFrame(ae)},[ae]);(0,F.useEffect)(()=>()=>{Z.current&&cancelAnimationFrame(Z.current)},[]);let oe=(0,F.useCallback)(e=>{let t=e;if(!(Y.current&&t.projectId&&t.projectId!==Y.current)){if(t.type===`init`){let e=t.phaseDefinitions??[];R(e);let n={};for(let r of e)n[r.key]=t.phases?.[r.key]??`idle`;B(n)}else if(t.type===`event`&&t.jobId===o)Q({id:Date.now(),job_id:o??``,seq:t.seq??0,event_type:t.event_type,source:t.source,payload:t.payload,timestamp:t.timestamp});else if(t.type===`log`&&t.processId===o)Q({id:Date.now(),job_id:o??``,seq:0,event_type:`log`,source:t.source,payload:JSON.stringify({line:t.line}),timestamp:t.timestamp});else if(t.type===`job.finalized`&&t.jobId===o)fetch(`${m()}/jobs/${o}`).then(e=>e.json()).then(e=>O(e.job)).catch(()=>{});else if(t.type===`phase`){let e=t.phase,n=t.state;B(t=>({...t,[e]:n}))}else if(t.type===`queue`){let e=t.jobs?.find(e=>e.id===o);if(e){let t=e.status,n=ie.current;O(e=>e&&{...e,status:t}),(t===`completed`||t===`failed`||t===`canceled`||t===`running`&&n!==`running`)&&fetch(`${m()}/jobs/${o}`).then(e=>e.json()).then(e=>O(e.job)).catch(()=>{})}}}},[o,Q]),{registerHandler:se,unregisterHandler:ce}=ee();(0,F.useEffect)(()=>(se(`job-detail-${o}`,oe),()=>ce(`job-detail-${o}`)),[o,oe,se,ce]),(0,F.useEffect)(()=>{if(!o||!E||E.status!==`running`||E.hasTelemetry)return;let e=setInterval(()=>{fetch(`${m()}/jobs/${o}`).then(e=>e.ok?e.json():null).then(e=>{e?.job?.hasTelemetry&&O(e=>e&&{...e,hasTelemetry:!0})}).catch(()=>{})},8e3);return()=>clearInterval(e)},[o,E?.status,E?.hasTelemetry]);async function le(){if(!o)return;let n=await t({projectId:null,jobId:o});n.ok?n.status===`deleted`?(d.success(e(`detail.toast.jobDeleted`)),C(`/jobs`)):d.success(e(`detail.toast.cancelSignalSent`),{description:e(`detail.toast.cancelSignalSentDescription`)}):n.httpStatus===null?d.error(e(`detail.toast.networkError`)):d.error(e(`detail.toast.failed`),{description:n.error})}async function ue(){if(E)try{let t=await fetch(`${m()}/jobs/${E.id}/diagnostic`);if(!t.ok){let n=await t.json().catch(()=>({}));throw Error(n.error??e(`detail.toast.exportFailedHttp`,{status:t.status}))}let n=await t.blob(),r=URL.createObjectURL(n),i=new Date().toISOString().slice(0,10),a=document.createElement(`a`);a.href=r,a.download=`specrails-diagnostic-${E.id}-${i}.zip`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(r)}catch(t){d.error(e(`detail.toast.exportFailed`),{description:t.message})}}async function de(){if(E)try{let t=await fetch(`${m()}/spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({command:E.command})}),n=await t.json();if(!t.ok)throw Error(n.error??e(`detail.toast.spawnFailed`));d.success(e(`detail.toast.jobRequeued`)),C(`/jobs/${n.jobId}`)}catch(e){d.error(e.message)}}if(W)return(0,I.jsx)(`div`,{className:`max-w-5xl mx-auto px-4 py-6`,children:(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsx)(`div`,{className:`h-4 w-48 bg-muted/30 rounded animate-pulse`}),(0,I.jsx)(`div`,{className:`h-20 bg-muted/30 rounded-lg animate-pulse`}),(0,I.jsx)(`div`,{className:`h-64 bg-muted/30 rounded-lg animate-pulse`})]})});if(K||!E)return(0,I.jsxs)(`div`,{className:`max-w-5xl mx-auto px-4 py-6 flex flex-col items-center gap-3 mt-12`,children:[(0,I.jsx)(`p`,{className:`text-lg font-semibold`,children:e(`detail.notFound`)}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`detail.notFoundDescription`,{id:o})}),(0,I.jsx)(D,{asChild:!0,variant:`outline`,size:`sm`,children:(0,I.jsxs)(u,{to:`/`,children:[(0,I.jsx)(f,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.backToDashboard`)]})})]});let $=q[E.status]??q.queued,fe=E.status===`running`,pe=E.status===`completed`||E.status===`failed`,me=!!E.interactive,he=me&&fe,ge=(E.tickets?.length??0)>0,_e=E.command.startsWith(`loop:`),ve=H.length>1?{totalCostUsd:H.reduce((e,t)=>e+(t.total_cost_usd??0),0),hasNullCost:H.some(e=>e.total_cost_usd==null),costEstimated:H.some(e=>!!e.total_cost_usd_estimated),nullCostCount:H.filter(e=>e.total_cost_usd==null).length,totalTokensIn:H.reduce((e,t)=>e+(t.tokens_in??0),0),totalTokensOut:H.reduce((e,t)=>e+(t.tokens_out??0),0),totalTokensCacheRead:H.reduce((e,t)=>e+(t.tokens_cache_read??0),0),totalTokensCacheCreate:H.reduce((e,t)=>e+(t.tokens_cache_create??0),0),jobCount:H.length}:null;return(0,I.jsxs)(`div`,{"data-job-detail-surface":!0,className:`flex flex-col h-full max-w-5xl mx-auto w-full`,children:[(0,I.jsxs)(`div`,{className:`px-4 py-4 border-b border-border space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,I.jsxs)(u,{to:`/`,className:`hover:text-foreground transition-colors flex items-center gap-1`,children:[(0,I.jsx)(f,{className:`w-3 h-3`}),e(`detail.breadcrumbDashboard`)]}),(0,I.jsx)(te,{className:`w-3 h-3`}),(0,I.jsx)(`span`,{className:`text-foreground font-mono`,children:e(`detail.breadcrumbJob`,{id:o?.slice(0,8)})})]}),ge&&(0,I.jsx)(re,{tickets:E.tickets??[],onTicketClick:T}),(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-1 min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsxs)(s,{children:[(0,I.jsx)(h,{asChild:!0,children:(0,I.jsx)(`div`,{children:(0,I.jsx)(w,{variant:$.variant,children:e($.labelKey)})})}),(0,I.jsx)(_,{children:e($.tooltipKey)})]}),(0,I.jsx)(`code`,{className:S(`font-mono text-foreground/90 truncate`,ge?`text-xs text-muted-foreground`:`text-sm`),children:P(E.command,b)})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground flex-wrap`,children:[(0,I.jsx)(`span`,{children:E.started_at?e(`detail.startedAgo`,{timeAgo:j(new Date(E.started_at),{addSuffix:!0,locale:M()})}):e(`detail.queuedWaiting`)}),E.model&&(0,I.jsx)(`span`,{className:`text-muted-foreground/40`,children:E.model})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[E.hasTelemetry&&(0,I.jsxs)(s,{children:[(0,I.jsx)(h,{asChild:!0,children:(0,I.jsxs)(D,{variant:`outline`,size:`sm`,className:`h-7`,onClick:ue,"aria-label":e(`detail.exportDiagnosticAria`),children:[(0,I.jsx)(y,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.exportDiagnostic`)]})}),(0,I.jsx)(_,{children:e(`detail.exportDiagnosticTooltip`)})]}),pe&&(0,I.jsxs)(s,{children:[(0,I.jsx)(h,{asChild:!0,children:(0,I.jsxs)(D,{variant:`outline`,size:`sm`,onClick:de,className:`h-7`,children:[(0,I.jsx)(p,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.reExecute`)]})}),(0,I.jsx)(_,{children:e(`detail.reExecuteTooltip`)})]}),fe&&(0,I.jsxs)(s,{children:[(0,I.jsx)(h,{asChild:!0,children:(0,I.jsx)(D,{variant:`outline`,size:`sm`,onClick:le,className:`h-7 border-destructive/30 text-destructive hover:bg-destructive/10`,children:e(me?`detail.cancelInteractive`:`detail.cancelJob`)})}),(0,I.jsx)(_,{children:e(`detail.cancelJobTooltip`)})]})]})]}),(0,I.jsx)(n,{phases:z,phaseDefinitions:L})]}),(E.status===`running`||E.status===`completed`||E.status===`failed`)&&(0,I.jsx)(V,{job:E,events:k,defaultOpen:E.status===`completed`||E.status===`running`,pipelineTotals:ve??void 0,phases:z,phaseDefinitions:L}),(0,I.jsx)(`div`,{className:`flex-1 overflow-hidden relative`,children:_e?(0,I.jsx)(r,{events:k,jobStatus:E.status,variant:`page`}):(0,I.jsx)(i,{events:k})}),he&&(0,I.jsx)(a,{jobId:E.id,settleMode:E.interactiveSettleMode,initialAcceptingTurns:E.interactiveAcceptingTurns,kind:E.command.startsWith(`loop:`)?`loop-step`:`job`,variant:`page`})]})}export{J as default};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-BNv3lrIs.js";import{$ as t,B as n,It as r,J as i,K as a,M as o,Q as s,Rn as c,Tn as l,U as u,Un as d,V as f,X as p,Y as m,Z as h,_n as g,bn as _,en as v,j as ee,nn as y,nt as te,ot as b,q as x,qn as S,rn as ne,rt as C,t as re,ut as w,wn as T,x as E,xn as D,yn as ie,zn as O}from"./index-BbVOi-dY.js";import{t as ae}from"./format-command-Db1viey1.js";import{t as k}from"./ExportDropdown-IehskH-7.js";var oe=g(`git-compare-arrows`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]),A=e(S(),1),j=T();function M(e){if(e==null)return`—`;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function N(e){return e==null?`—`:e===0?`$0`:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function P(e){return e==null?`—`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function F({label:e,a:t,b:n,highlight:r}){return(0,j.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 py-2 border-b border-border/20 last:border-0 text-xs`,children:[(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,j.jsx)(`span`,{className:`font-mono text-right ${r===`a`?`text-emerald-400 aurora-light:text-accent-success font-semibold`:``}`,children:t}),(0,j.jsx)(`span`,{className:`font-mono text-right ${r===`b`?`text-emerald-400 aurora-light:text-accent-success font-semibold`:``}`,children:n})]})}function I(e,t,n=!0){return e==null||t==null||e===t?null:n?e<t?`a`:`b`:e>t?`a`:`b`}function se({jobIds:e,onClose:n}){let{t:r}=O(`jobs`),[i,a]=(0,A.useState)(null),[o,c]=(0,A.useState)(!0),[u,d]=(0,A.useState)(null),{panelRef:f,panelStyle:p,headerHandleProps:m,resizeHandles:h,isFloating:g,guardBackdrop:_}=t();(0,A.useEffect)(()=>{let t=new AbortController;return fetch(`${l()}/jobs/compare?jobIds=${e.join(`,`)}`,{signal:t.signal}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{a(e),c(!1)}).catch(e=>{e.name!==`AbortError`&&(d(e.message),c(!1))}),()=>t.abort()},[e]);function v(e,t){return(0,j.jsxs)(`div`,{className:`text-center space-y-1`,children:[(0,j.jsx)(`p`,{className:`text-[10px] text-muted-foreground font-medium uppercase tracking-wider`,children:r(`comparison.jobN`,{n:t+1})}),(0,j.jsx)(`code`,{className:`text-[10px] text-foreground/70 block truncate max-w-[160px] mx-auto`,children:e.command}),(0,j.jsxs)(`div`,{className:`flex items-center justify-center gap-1 text-[10px]`,children:[e.status===`completed`?(0,j.jsx)(ne,{className:`w-3 h-3 text-emerald-400 aurora-light:text-accent-success`}):(0,j.jsx)(y,{className:`w-3 h-3 text-rose-400 aurora-light:text-destructive`}),(0,j.jsx)(`span`,{className:`capitalize text-muted-foreground`,children:r(`statusLabel.${e.status}`,{defaultValue:e.status})})]}),(0,j.jsx)(`p`,{className:`text-[10px] text-muted-foreground font-mono`,children:e.id.slice(0,8)})]})}return(0,j.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:_(n),children:[(0,j.jsxs)(`div`,{ref:f,className:`w-full max-w-lg rounded-xl border border-border/30 bg-popover p-5 shadow-xl space-y-4 mx-4`,onClick:e=>e.stopPropagation(),style:p,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between ${g?`cursor-grab active:cursor-grabbing`:``}`,...m,children:[(0,j.jsx)(`h2`,{className:`text-sm font-semibold`,children:r(`comparison.title`)}),(0,j.jsx)(`button`,{type:`button`,onClick:n,className:`text-muted-foreground hover:text-foreground transition-colors`,children:(0,j.jsx)(b,{className:`w-4 h-4`})})]}),o&&(0,j.jsx)(`div`,{className:`space-y-2`,children:[0,1,2,3].map(e=>(0,j.jsx)(`div`,{className:`h-8 bg-muted/20 rounded animate-pulse`},e))}),u&&(0,j.jsx)(`p`,{className:`text-xs text-red-400 aurora-light:text-destructive`,children:r(`comparison.loadFailed`,{error:u})}),i&&(()=>{let[e,t]=i.jobs,n=I(e.durationMs,t.durationMs,!0),a=I(e.totalCostUsd,t.totalCostUsd,!0),o=I(e.tokensOut==null?null:e.tokensOut,t.tokensOut==null?null:t.tokensOut,!0);return(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 pb-3 border-b border-border/30 mb-1`,children:[(0,j.jsx)(`div`,{}),v(e,0),v(t,1)]}),(0,j.jsx)(F,{label:r(`comparison.duration`),a:M(e.durationMs),b:M(t.durationMs),highlight:n}),(0,j.jsx)(F,{label:r(`comparison.cost`),a:N(e.totalCostUsd),b:N(t.totalCostUsd),highlight:a}),(0,j.jsx)(F,{label:r(`comparison.tokensOut`),a:P(e.tokensOut),b:P(t.tokensOut),highlight:o}),(0,j.jsx)(F,{label:r(`comparison.tokensIn`),a:P(e.tokensIn),b:P(t.tokensIn),highlight:null}),(0,j.jsx)(F,{label:r(`comparison.cacheRead`),a:P(e.tokensCacheRead),b:P(t.tokensCacheRead),highlight:null}),(0,j.jsx)(F,{label:r(`comparison.model`),a:e.model??`—`,b:t.model??`—`,highlight:null}),(0,j.jsx)(F,{label:r(`comparison.phasesDone`),a:e.phasesCompleted.length>0?e.phasesCompleted.join(`, `):`—`,b:t.phasesCompleted.length>0?t.phasesCompleted.join(`, `):`—`,highlight:null})]})})(),i&&(0,j.jsx)(`p`,{className:`text-[10px] text-muted-foreground/60 text-center`,children:r(`comparison.betterValueHint`)})]}),(0,j.jsx)(s,{handles:h})]})}var ce={running:{variant:`running`,labelKey:`statusLabel.running`,tooltipKey:`statusTooltip.running`},completed:{variant:`success`,labelKey:`statusLabel.done`,tooltipKey:`statusTooltip.completed`},failed:{variant:`failed`,labelKey:`statusLabel.failed`,tooltipKey:`statusTooltip.failed`},canceled:{variant:`canceled`,labelKey:`statusLabel.canceled`,tooltipKey:`statusTooltip.canceled`},queued:{variant:`queued`,labelKey:`statusLabel.queued`,tooltipKey:`statusTooltip.queuedToRun`},zombie_terminated:{variant:`failed`,labelKey:`statusLabel.zombie`,tooltipKey:`statusTooltip.zombie`},skipped:{variant:`warning`,labelKey:`statusLabel.skipped`,tooltipKey:`statusTooltip.skipped`}},le=[`running`,`completed`,`failed`,`canceled`,`zombie_terminated`,`queued`,`skipped`],L={critical:{className:`bg-red-500/15 aurora-light:bg-destructive/10 text-red-400 aurora-light:text-destructive border-red-500/30 aurora-light:border-destructive/30`,labelKey:`recent.priority.critical`},high:{className:`bg-orange-500/15 aurora-light:bg-accent-warning/10 text-orange-400 aurora-light:text-accent-warning border-orange-500/30 aurora-light:border-accent-warning/30`,labelKey:`recent.priority.high`},normal:{className:``,labelKey:`recent.priority.normal`},low:{className:`bg-gray-500/15 aurora-light:bg-muted text-gray-400 aurora-light:text-muted-foreground border-gray-500/30 aurora-light:border-border`,labelKey:`recent.priority.low`}};function ue(e){return e==null||e===0?null:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function de(e,t){if(!t)return null;let n=new Date(t).getTime()-new Date(e).getTime();if(n<0)return null;let r=Math.round(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60),a=r%60;return i<60?`${i}m ${a}s`:`${Math.floor(i/60)}h ${i%60}m`}function fe(e){return e==null||e===0?null:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function pe(e){try{return E(new Date(e),{addSuffix:!0,locale:D()})}catch{return e}}function R(e){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r).getTime()}function z(e){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r+1).getTime()-1}function B(e,t,n){if(!t&&!n)return!0;let r=new Date(e).getTime();return Number.isNaN(r)?!0:!(t&&r<R(t)||n&&r>z(n))}var V=10;function H({jobs:e,isLoading:o,onJobsCleared:g,onProposalClick:_,onProposalDelete:ee}){let{t:y}=O(`jobs`),b=d(),{activeProjectId:S,projects:ne}=ie(),re=ne.find(e=>e.id===S)?.provider,[T,E]=(0,A.useState)(null),[D,k]=(0,A.useState)(``),[M,N]=(0,A.useState)(``),[P,F]=(0,A.useState)(!1),[I,H]=(0,A.useState)(``),[U,W]=(0,A.useState)(``),[me,he]=(0,A.useState)(!1),[G,K]=(0,A.useState)(null),[q,ge]=(0,A.useState)(V),[J,_e]=(0,A.useState)(!1),[Y,X]=(0,A.useState)([]),[ve,Z]=(0,A.useState)(null),{panelRef:ye,panelStyle:be,headerHandleProps:xe,resizeHandles:Se,isFloating:Ce,guardBackdrop:we}=t();(0,A.useEffect)(()=>{ge(V)},[e.length]);function Te(){_e(e=>!e),X([])}function Ee(e){X(t=>{if(t.includes(e))return t.filter(t=>t!==e);if(t.length>=2)return t;let n=[...t,e];return n.length===2&&Z(n),n})}let Q=e.filter(e=>T&&e.status!==T?!1:B(e.started_at,D,M)),De=e.filter(e=>B(e.started_at,I,U)).length;async function $(e){he(!0);try{let t={};e===`range`&&(I&&(t.from=new Date(R(I)).toISOString()),U&&(t.to=new Date(z(U)).toISOString()));let n=await fetch(`${l()}/jobs`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(n.ok){let e=await n.json();c.success(y(`recent.toast.cleared`,{count:e.deleted})),F(!1),H(``),W(``),g?.()}else c.error(y(`recent.toast.clearFailed`))}catch{c.error(y(`recent.toast.networkError`))}finally{he(!1)}}return o?(0,j.jsx)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4 space-y-1`,children:[0,1,2].map(e=>(0,j.jsx)(`div`,{className:`h-9 bg-muted/30 rounded-md animate-pulse`},e))}):e.length===0?(0,j.jsxs)(`div`,{className:`rounded-lg border border-dashed border-border/40 bg-card/50 p-8 text-center space-y-2`,children:[(0,j.jsx)(v,{className:`w-8 h-8 text-muted-foreground/30 mx-auto`}),(0,j.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:y(`recent.emptyTitle`)}),(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground/60`,children:y(`recent.emptyDescription`)})]}):(0,j.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4 space-y-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,j.jsx)(`button`,{type:`button`,onClick:()=>E(null),className:`px-2 py-0.5 rounded text-[10px] font-medium transition-colors ${T===null?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`}`,children:y(`recent.filterAll`,{count:e.length})}),le.map(t=>{let n=e.filter(e=>e.status===t).length;return n===0?null:(0,j.jsx)(`button`,{type:`button`,onClick:()=>E(T===t?null:t),className:`px-2 py-0.5 rounded text-[10px] font-medium capitalize transition-colors ${T===t?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`}`,children:y(`recent.filterStatus`,{status:y(`statusName.${t}`),count:n})},t)})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`input`,{type:`date`,value:D,onChange:e=>k(e.target.value),className:`h-6 rounded border border-border bg-input px-1.5 text-[10px] text-foreground`,title:y(`recent.fromDate`)}),(0,j.jsx)(`input`,{type:`date`,value:M,onChange:e=>N(e.target.value),className:`h-6 rounded border border-border bg-input px-1.5 text-[10px] text-foreground`,title:y(`recent.toDate`)}),(D||M)&&(0,j.jsx)(`button`,{type:`button`,onClick:()=>{k(``),N(``)},className:`text-[10px] text-muted-foreground hover:text-foreground transition-colors`,children:y(`recent.clear`)}),(0,j.jsxs)(n,{children:[(0,j.jsx)(u,{asChild:!0,children:(0,j.jsx)(C,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 transition-colors ${J?`text-foreground bg-accent`:`text-muted-foreground hover:text-foreground`}`,onClick:Te,children:(0,j.jsx)(oe,{className:`w-3.5 h-3.5`})})}),(0,j.jsx)(f,{children:y(J?`recent.exitCompareMode`:`recent.compareTwoJobs`)})]}),(0,j.jsxs)(n,{children:[(0,j.jsx)(u,{asChild:!0,children:(0,j.jsx)(C,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 text-muted-foreground hover:text-destructive`,onClick:()=>F(!0),children:(0,j.jsx)(w,{className:`w-3.5 h-3.5`})})}),(0,j.jsx)(f,{children:y(`recent.clearJobs`)})]})]})]}),J&&(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-md bg-accent/40 px-3 py-1.5 text-[10px] text-muted-foreground`,children:[(0,j.jsxs)(`span`,{children:[Y.length===0&&y(`recent.selectTwoToCompare`),Y.length===1&&y(`recent.selectOneMore`),Y.length===2&&y(`recent.readyToCompare`)]}),Y.length===2&&(0,j.jsx)(`button`,{type:`button`,className:`text-[10px] font-medium text-foreground hover:underline`,onClick:()=>Z(Y),children:y(`recent.compareAction`)})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1 text-[10px] font-medium text-muted-foreground uppercase tracking-wider`,children:[(0,j.jsx)(`span`,{className:`w-14`,children:y(`recent.colStatus`)}),(0,j.jsx)(`span`,{className:`flex-1 min-w-0`,children:y(`recent.colCommand`)}),(0,j.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,j.jsx)(`span`,{className:`w-14 text-right`,children:y(`recent.colDuration`)}),(0,j.jsx)(`span`,{className:`w-12 text-right`,children:y(`recent.colTokens`)}),(0,j.jsx)(`span`,{className:`w-12 text-right`,children:y(`recent.colCost`)}),(0,j.jsx)(`span`,{className:`w-20 text-right`,children:y(`recent.colStarted`)})]})]}),(0,j.jsx)(`div`,{className:`space-y-0.5`,children:Q.slice(0,q).map(e=>{let t=ce[e.status]??ce.queued,i=ue(e.total_cost_usd),a=de(e.started_at,e.finished_at),o=fe((e.tokens_in??0)+(e.tokens_out??0)+(e.tokens_cache_read??0)+(e.tokens_cache_create??0)||null),s=e.id.startsWith(`proposal:`),c=s?e.id.replace(`proposal:`,``):null,l=Y.includes(e.id),d=J&&!s&&Y.length===2&&!l;return(0,j.jsxs)(`div`,{role:`button`,tabIndex:0,className:`flex items-center gap-3 px-3 py-2 rounded-md transition-colors cursor-pointer group ${l?`bg-accent/70 ring-1 ring-border`:d?`opacity-40 cursor-not-allowed`:`hover:bg-accent/50`}`,onClick:()=>{if(J&&!s){Ee(e.id);return}s&&c?_?.(c):b(`/jobs/${e.id}`)},children:[(0,j.jsxs)(n,{children:[(0,j.jsx)(u,{asChild:!0,children:(0,j.jsx)(`div`,{children:(0,j.jsx)(te,{variant:t.variant,children:y(t.labelKey)})})}),(0,j.jsx)(f,{children:y(t.tooltipKey)})]}),e.priority&&e.priority!==`normal`&&(0,j.jsx)(`span`,{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium border ${L[e.priority].className}`,children:y(L[e.priority].labelKey)}),e.profile_name&&(0,j.jsxs)(n,{children:[(0,j.jsx)(u,{asChild:!0,children:(0,j.jsx)(`span`,{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium border border-accent-primary/40 bg-accent-primary/10 text-accent-primary/90`,children:e.profile_name})}),(0,j.jsx)(f,{children:y(`recent.profileTooltip`,{name:e.profile_name})})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-1 flex-1 min-w-0`,children:[e.pipeline_id&&(0,j.jsxs)(n,{children:[(0,j.jsx)(u,{asChild:!0,children:(0,j.jsx)(r,{className:`w-3 h-3 text-accent-primary/60 shrink-0`})}),(0,j.jsxs)(f,{children:[y(`recent.pipelinePart`),e.depends_on_job_id&&` ${y(`recent.pipelineDependsOn`)}`,e.skip_reason&&` — ${e.skip_reason}`]})]}),(0,j.jsx)(`code`,{className:`text-xs text-foreground/80 truncate`,children:ae(e.command,re)})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] text-muted-foreground shrink-0`,children:[(0,j.jsx)(`span`,{className:`w-14 text-right`,children:a??`—`}),(0,j.jsx)(`span`,{className:`w-12 text-right`,children:o?`${o}`:`—`}),(0,j.jsx)(`span`,{className:`w-12 text-right`,children:i??`—`}),(0,j.jsx)(`span`,{className:`w-20 text-right`,children:pe(e.started_at)}),s&&c&&(0,j.jsx)(`button`,{type:`button`,className:`w-4 h-4 md:opacity-0 md:group-hover:opacity-100 text-muted-foreground hover:text-destructive transition-all`,onClick:e=>{e.stopPropagation(),K(c)},title:y(`recent.deleteProposal`),children:(0,j.jsx)(w,{className:`w-3 h-3`})})]})]},e.id)})}),Q.length>q&&(0,j.jsx)(`div`,{className:`pt-1 text-center`,children:(0,j.jsx)(`button`,{type:`button`,onClick:()=>ge(e=>e+V),className:`text-[10px] text-muted-foreground hover:text-foreground transition-colors px-3 py-1 rounded hover:bg-accent/50`,children:y(`recent.loadMore`,{count:Q.length-q})})}),P&&(0,j.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:we(()=>F(!1)),children:[(0,j.jsxs)(`div`,{ref:ye,className:`w-80 rounded-xl border border-border/30 bg-popover p-4 shadow-lg space-y-4`,onClick:e=>e.stopPropagation(),style:be,children:[(0,j.jsxs)(`div`,{...xe,className:Ce?`cursor-grab active:cursor-grabbing`:void 0,children:[(0,j.jsx)(`h3`,{className:`text-sm font-semibold`,children:y(`recent.clearModal.title`)}),(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:y(`recent.clearModal.jobsInHistory`,{count:e.length})})]}),(0,j.jsx)(C,{variant:`destructive`,size:`sm`,className:`w-full`,disabled:me,onClick:()=>$(`all`),children:y(`recent.clearModal.clearAll`,{count:e.length})}),(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:y(`recent.clearModal.orByRange`)}),(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(`input`,{type:`date`,value:I,onChange:e=>H(e.target.value),className:`flex-1 h-7 rounded-md border border-border bg-input px-2 text-xs text-foreground`,placeholder:y(`recent.clearModal.fromPlaceholder`)}),(0,j.jsx)(`input`,{type:`date`,value:U,onChange:e=>W(e.target.value),className:`flex-1 h-7 rounded-md border border-border bg-input px-2 text-xs text-foreground`,placeholder:y(`recent.clearModal.toPlaceholder`)})]}),(0,j.jsx)(C,{variant:`outline`,size:`sm`,className:`w-full`,disabled:me||!I&&!U,onClick:()=>$(`range`),children:I||U?y(`recent.clearModal.clearInRange`,{count:De}):y(`recent.clearModal.clearRange`)})]}),(0,j.jsx)(C,{variant:`ghost`,size:`sm`,className:`w-full`,onClick:()=>F(!1),children:y(`common:actions.cancel`)})]}),(0,j.jsx)(s,{handles:Se})]}),(0,j.jsx)(a,{open:G!==null,onOpenChange:e=>!e&&K(null),children:(0,j.jsxs)(x,{className:`max-w-sm`,children:[(0,j.jsxs)(p,{children:[(0,j.jsx)(h,{children:y(`recent.deleteProposalConfirm.title`)}),(0,j.jsx)(i,{children:y(`recent.deleteProposalConfirm.description`)})]}),(0,j.jsxs)(m,{children:[(0,j.jsx)(C,{variant:`ghost`,size:`sm`,onClick:()=>K(null),children:y(`common:actions.cancel`)}),(0,j.jsx)(C,{variant:`destructive`,size:`sm`,onClick:()=>{G&&ee?.(G),K(null)},children:y(`common:actions.delete`)})]})]})}),ve&&(0,j.jsx)(se,{jobIds:ve,onClose:()=>{Z(null),X([]),_e(!1)}})]})}function U(){let{t:e}=O(`jobs`),{activeProjectId:t}=ie(),{recentJobs:n}=re(t),{data:r,isFirstLoad:i,refresh:s}=_({namespace:`jobs`,projectId:t,initialValue:n,fetcher:async()=>{let e=await fetch(`${l()}/jobs?limit=10`);return e.ok?(await e.json()).jobs:[]},pollInterval:1e4}),{data:u}=_({namespace:`proposals`,projectId:t,initialValue:[],fetcher:async()=>{let e=await fetch(`${l()}/propose?limit=10`);return e.ok?(await e.json()).proposals:[]},pollInterval:1e4}),d={input:`queued`,exploring:`running`,review:`running`,refining:`running`,creating_issue:`running`,created:`completed`,cancelled:`canceled`},f=u.map(e=>({id:`proposal:${e.id}`,command:`/specrails:propose-feature ${e.idea.length>60?e.idea.slice(0,57)+`...`:e.idea}`,started_at:e.created_at,status:d[e.status]??`queued`})),g=[...r,...f].sort((e,t)=>new Date(t.started_at).getTime()-new Date(e.started_at).getTime()),[v,y]=(0,A.useState)(null),b=(0,A.useCallback)(async e=>{try{let t=await fetch(`${l()}/propose/${e}`);if(!t.ok)return;y((await t.json()).proposal)}catch{}},[]),S=(0,A.useCallback)(async t=>{try{(await fetch(`${l()}/propose/${t}`,{method:`DELETE`})).ok&&(c.success(e(`page.proposalDeleted`)),s())}catch{}},[s,e]);return(0,j.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 py-6`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,j.jsx)(`h1`,{className:`text-sm font-semibold`,children:e(`page.title`)}),(0,j.jsx)(k,{baseUrl:`${l()}/jobs/export`,label:e(`page.exportJobs`)})]}),(0,j.jsx)(H,{jobs:g,isLoading:i,onJobsCleared:s,onProposalClick:b,onProposalDelete:S}),(0,j.jsx)(a,{open:v!==null,onOpenChange:e=>!e&&y(null),children:(0,j.jsx)(x,{className:`max-w-3xl glass-card`,children:v&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(p,{children:(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(h,{className:`flex-1 min-w-0`,children:e(`page.proposal.title`)}),(0,j.jsx)(te,{variant:v.status===`created`?`success`:v.status===`cancelled`?`destructive`:`secondary`,children:v.status})]})}),(0,j.jsx)(`div`,{className:`text-xs text-muted-foreground bg-muted/20 rounded px-2 py-1 italic`,children:v.idea}),v.result_markdown?(0,j.jsx)(`div`,{className:`max-h-[400px] overflow-y-auto rounded-lg px-3 py-2 text-xs bg-muted/40`,children:(0,j.jsx)(`div`,{className:`prose prose-invert prose-xs max-w-none prose-p:my-1 prose-headings:mt-2 prose-headings:mb-1 prose-headings:text-sm prose-headings:font-semibold prose-ul:my-1 prose-ol:my-1 prose-li:my-0 prose-code:text-cyan-300 prose-code:text-[10px] prose-code:bg-muted/40 prose-code:px-1 prose-code:py-0.5 prose-code:rounded text-foreground/80`,children:(0,j.jsx)(o,{remarkPlugins:[ee],children:v.result_markdown})})}):(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground py-4 text-center`,children:e(`page.proposal.noContent`)}),v.issue_url&&(0,j.jsxs)(`div`,{className:`text-xs`,children:[e(`page.proposal.githubIssue`),` `,(0,j.jsx)(`a`,{href:v.issue_url,target:`_blank`,rel:`noopener noreferrer`,className:`text-accent-primary hover:underline`,children:v.issue_url})]}),(0,j.jsxs)(m,{children:[(0,j.jsx)(C,{variant:`destructive`,size:`sm`,onClick:()=>{S(v.id),y(null)},children:e(`common:actions.delete`)}),(0,j.jsx)(C,{variant:`ghost`,size:`sm`,onClick:()=>y(null),children:e(`common:actions.close`)})]})]})})})]})}export{U as default};