specrails-desktop 2.29.0 → 2.29.1

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 (236) hide show
  1. package/client/dist/assets/{ActivityFeedPage-Be-6L0Ld.js → ActivityFeedPage-D8RKRRoM.js} +1 -1
  2. package/client/dist/assets/AgentBrowserCapture-BUHPHNSN.js +1 -0
  3. package/client/dist/assets/{AgentModeCodePane-DLltTOqp.js → AgentModeCodePane-GZc8bNGT.js} +2 -2
  4. package/client/dist/assets/AgentModeJobsPane-DWtQqj3k.js +1 -0
  5. package/client/dist/assets/AgentsPage-CKPtHkRP.js +86 -0
  6. package/client/dist/assets/{AnalyticsPage-C4Ik95FX.js → AnalyticsPage-CZW8c77k.js} +1 -1
  7. package/client/dist/assets/{BarChart-DVZgrhJd.js → BarChart-DugEoe2q.js} +2 -2
  8. package/client/dist/assets/CodePage-CQ-uKETG.js +2 -0
  9. package/client/dist/assets/{DesktopAnalyticsPage-2Xf-52x2.js → DesktopAnalyticsPage-Bgo4SyCH.js} +1 -1
  10. package/client/dist/assets/{DocsDialog-CHihLjWd.js → DocsDialog-DxpWw_La.js} +2 -2
  11. package/client/dist/assets/DocsPage-CmcOkK19.js +11 -0
  12. package/client/dist/assets/{ExportDropdown-DLHFQxVn.js → ExportDropdown-DvTS2wc7.js} +1 -1
  13. package/client/dist/assets/IntegrationsPage-B72WxJ3Z.js +1 -0
  14. package/client/dist/assets/InteractiveJobComposer-B5gh4Qoy.js +19 -0
  15. package/client/dist/assets/JobDetailModal-D-BeqsJ6.js +1 -0
  16. package/client/dist/assets/JobDetailPage-DwdozwLO.js +1 -0
  17. package/client/dist/assets/JobsPage-BDkinklt.js +1 -0
  18. package/client/dist/assets/{LoopBuilderPage-CpBaW59t.js → LoopBuilderPage-CclJ3VZA.js} +2 -2
  19. package/client/dist/assets/{LoopPreviewModal-CwpKcv0Y.js → LoopPreviewModal-Dw4UgoLu.js} +1 -1
  20. package/client/dist/assets/LoopsPage-D7ac4M24.js +1 -0
  21. package/client/dist/assets/PluginsPage-wdC-qa40.js +2 -0
  22. package/client/dist/assets/ProjectSettingsDialog-BlTlRtGI.js +1 -0
  23. package/client/dist/assets/TemplatePreviewModal-CeMx2Red.js +1 -0
  24. package/client/dist/assets/{brain-DecvjjPU.js → brain-C92rjjYP.js} +1 -1
  25. package/client/dist/assets/{dist-js-UjXbEWhN.js → dist-js-CgpP6tKI.js} +1 -1
  26. package/client/dist/assets/{dist-js-BTAcxhPb.js → dist-js-DHiN-A_E.js} +1 -1
  27. package/client/dist/assets/{index-OBDI7bHm.js → index-DyY1QyIn.js} +10 -10
  28. package/client/dist/assets/{lib-C5ZxrPSR.js → lib-0PFDyMxJ.js} +1 -1
  29. package/client/dist/assets/{settings-Bp24JHlv2.js → settings-1w1O5Og82.js} +1 -1
  30. package/client/dist/assets/{settings-C_T0-j9d.js → settings-BSihkr0e.js} +1 -1
  31. package/client/dist/assets/{settings-DhaFKpcw2.js → settings-BiDOB3hV2.js} +1 -1
  32. package/client/dist/assets/{settings-BemR_e3F.js → settings-BoubJhDP2.js} +1 -1
  33. package/client/dist/assets/{settings-BvIwQ3A1.js → settings-CB-EZ_W8.js} +1 -1
  34. package/client/dist/assets/{settings-B_v3zgJf.js → settings-DNL68KTE.js} +1 -1
  35. package/client/dist/assets/{settings-Bx2ObkTR2.js → settings-Jc46vUhd.js} +1 -1
  36. package/client/dist/assets/{settings-BYCMtxOz.js → settings-cJNynGIZ.js} +1 -1
  37. package/client/dist/assets/{upload-lgjKJgrl.js → upload-CmR4h9H1.js} +1 -1
  38. package/client/dist/assets/{value-Bc0_jlJA.js → value-JA3bf47v.js} +1 -1
  39. package/client/dist/index.html +2 -2
  40. package/package.json +1 -1
  41. package/server/dist/rail-isolated-launch.js +23 -9
  42. package/server/dist/rail-pr-decision.js +18 -6
  43. package/server/dist/rail-worktree-release.js +12 -6
  44. package/server/dist/rails-router.js +8 -1
  45. package/server/dist/worktree-manager.js +64 -16
  46. package/client/dist/assets/AgentBrowserCapture-CpZ-dd8O.js +0 -1
  47. package/client/dist/assets/AgentIntegrationsModal-DO1pN_Ez.js +0 -1
  48. package/client/dist/assets/AgentModeJobsPane-Dp5YvmW0.js +0 -1
  49. package/client/dist/assets/AgentsPage-ehHuVUds.js +0 -86
  50. package/client/dist/assets/CodePage-D4OCMfxL.js +0 -2
  51. package/client/dist/assets/DocsPage-1vEk7XbH.js +0 -11
  52. package/client/dist/assets/IntegrationsPage-CCb2YuyJ.js +0 -1
  53. package/client/dist/assets/InteractiveJobComposer-CxJJEnjw.js +0 -19
  54. package/client/dist/assets/JobDetailModal-CJI7qRkm.js +0 -1
  55. package/client/dist/assets/JobDetailPage-DwA9bbwx.js +0 -1
  56. package/client/dist/assets/JobsPage-BDIyFfd5.js +0 -1
  57. package/client/dist/assets/LoopsPage-BO0Pa8oz.js +0 -1
  58. package/client/dist/assets/PluginsPage-BBGTBpGh.js +0 -2
  59. package/client/dist/assets/ProjectSettingsDialog-M9zGQo0l.js +0 -1
  60. package/client/dist/assets/TemplatePreviewModal-eBI0zL5P.js +0 -1
  61. /package/client/dist/assets/{activity-BbWiDfn-2.js → activity--iN4Ad2R2.js} +0 -0
  62. /package/client/dist/assets/{activity-DvECTYGt.js → activity-6hM_ZSg9.js} +0 -0
  63. /package/client/dist/assets/{activity-BZZlEG3a.js → activity-BZNfOdiS.js} +0 -0
  64. /package/client/dist/assets/{activity-DtzRy92x.js → activity-BuVo5sPB.js} +0 -0
  65. /package/client/dist/assets/{activity-D3Ic-HTS.js → activity-CIOLxGvh.js} +0 -0
  66. /package/client/dist/assets/{activity-FleOlK0l2.js → activity-D2r2h3SE2.js} +0 -0
  67. /package/client/dist/assets/{activity-DFbvNqhE2.js → activity-DtxrAUMo2.js} +0 -0
  68. /package/client/dist/assets/{addspec-CFxGvmJR2.js → addspec-BMtLZLW62.js} +0 -0
  69. /package/client/dist/assets/{addspec-DaA-CbTt.js → addspec-CP0HRuxY.js} +0 -0
  70. /package/client/dist/assets/{addspec-NBbcTbLc.js → addspec-CRuvWn8d.js} +0 -0
  71. /package/client/dist/assets/{addspec-BKrH2Ucz.js → addspec-D-JLDsUV.js} +0 -0
  72. /package/client/dist/assets/{addspec-B_LQMHW3.js → addspec-DfhDbg5c.js} +0 -0
  73. /package/client/dist/assets/{addspec-Bw_YQwo62.js → addspec-bsNDdqRm2.js} +0 -0
  74. /package/client/dist/assets/{addspec-CR8MB5Fr2.js → addspec-mgPOt5q02.js} +0 -0
  75. /package/client/dist/assets/{agent-BoXSzaBk2.js → agent-B8BXmlUQ2.js} +0 -0
  76. /package/client/dist/assets/{agent-CeRTdGT12.js → agent-BYc3-6Ln2.js} +0 -0
  77. /package/client/dist/assets/{agent-fQI_6tsA.js → agent-BbJorPdT.js} +0 -0
  78. /package/client/dist/assets/{agent-DZ8zTrQT.js → agent-CewFImgL.js} +0 -0
  79. /package/client/dist/assets/{agent-tJdAobaM.js → agent-DfhYoUmp.js} +0 -0
  80. /package/client/dist/assets/{agent-DqyzT33X.js → agent-TK_rrK4d.js} +0 -0
  81. /package/client/dist/assets/{agent-C2-rROL52.js → agent-bHjA9R_j2.js} +0 -0
  82. /package/client/dist/assets/{agents-BHgn--3j.js → agents-78bTZGZh.js} +0 -0
  83. /package/client/dist/assets/{agents-CV-_xBvX2.js → agents-BLhWCmDS2.js} +0 -0
  84. /package/client/dist/assets/{agents-B_qGaB0F.js → agents-BUdEi3-N.js} +0 -0
  85. /package/client/dist/assets/{agents-B9pFSJQI2.js → agents-BpoUaoW92.js} +0 -0
  86. /package/client/dist/assets/{agents-HFCqQH0Z.js → agents-CWo-KyAB.js} +0 -0
  87. /package/client/dist/assets/{agents-VsyFhGOS2.js → agents-DDtCJ5M02.js} +0 -0
  88. /package/client/dist/assets/{agents-CP8_ezYG.js → agents-bvyRLczL.js} +0 -0
  89. /package/client/dist/assets/{agentstudio-BEp7Sb46.js → agentstudio-BMQxc_bz.js} +0 -0
  90. /package/client/dist/assets/{agentstudio-RfZavULt2.js → agentstudio-COZriimI2.js} +0 -0
  91. /package/client/dist/assets/{agentstudio-D2A5peWV2.js → agentstudio-CWgXG5W52.js} +0 -0
  92. /package/client/dist/assets/{agentstudio-Br3WD7Xs.js → agentstudio-C_Jq8Tl4.js} +0 -0
  93. /package/client/dist/assets/{agentstudio-BOjG6tgJ.js → agentstudio-Dtq3dGYk.js} +0 -0
  94. /package/client/dist/assets/{agentstudio-RsxnZtUA.js → agentstudio-jKMTdT70.js} +0 -0
  95. /package/client/dist/assets/{agentstudio-CuTt3ZGe2.js → agentstudio-sI27TpBu2.js} +0 -0
  96. /package/client/dist/assets/{aiedit-CV520D4W2.js → aiedit-6CHdb_iv2.js} +0 -0
  97. /package/client/dist/assets/{aiedit-DrIjSojo.js → aiedit-B03pD_Na.js} +0 -0
  98. /package/client/dist/assets/{aiedit-a-Z-g5iC.js → aiedit-BtRqRxML.js} +0 -0
  99. /package/client/dist/assets/{aiedit-D0Syl-mC.js → aiedit-eMN4eQPF.js} +0 -0
  100. /package/client/dist/assets/{aiedit-DnBzjlVz2.js → aiedit-hknZlly82.js} +0 -0
  101. /package/client/dist/assets/{aiedit-26p5A_HY2.js → aiedit-igmw-ZoZ2.js} +0 -0
  102. /package/client/dist/assets/{aiedit-CcugGPbS.js → aiedit-pc5JDUq1.js} +0 -0
  103. /package/client/dist/assets/{analytics-Bpe41fnX2.js → analytics-BWMUZ2Pq2.js} +0 -0
  104. /package/client/dist/assets/{analytics-CpSTNfui.js → analytics-Bj-SmKHa.js} +0 -0
  105. /package/client/dist/assets/{analytics-4-eskbtX.js → analytics-C5dpiS0o.js} +0 -0
  106. /package/client/dist/assets/{analytics-DEe5BMz8.js → analytics-CCprAqk3.js} +0 -0
  107. /package/client/dist/assets/{analytics-4HvXb0Vn2.js → analytics-CR1TJqUi2.js} +0 -0
  108. /package/client/dist/assets/{analytics-DcOITHla2.js → analytics-DfNdXR0y2.js} +0 -0
  109. /package/client/dist/assets/{analytics-Bd9rHGjV.js → analytics-rmHuJv0V.js} +0 -0
  110. /package/client/dist/assets/{attachments-CgOQ9K-6.js → attachments-BgBNSqQd.js} +0 -0
  111. /package/client/dist/assets/{attachments-CA2f3qL3.js → attachments-BjyMmrwE.js} +0 -0
  112. /package/client/dist/assets/{attachments-DlEQu56g2.js → attachments-C9GTTJsx2.js} +0 -0
  113. /package/client/dist/assets/{attachments-CHDbhKeH.js → attachments-DCZOL1RU.js} +0 -0
  114. /package/client/dist/assets/{attachments-jVdKzAXn.js → attachments-DL-bPy9E.js} +0 -0
  115. /package/client/dist/assets/{attachments-D2jwJXQ42.js → attachments-DPCmkFZu2.js} +0 -0
  116. /package/client/dist/assets/{attachments-CKAY5aYG2.js → attachments-rNn1ekRy2.js} +0 -0
  117. /package/client/dist/assets/{browser-Cl-FwPXs.js → browser-BPkhILSJ.js} +0 -0
  118. /package/client/dist/assets/{browser-kA31eYhu2.js → browser-BijVYG0Y2.js} +0 -0
  119. /package/client/dist/assets/{browser-JsiohNmW.js → browser-BqLqJVVT.js} +0 -0
  120. /package/client/dist/assets/{browser-C4VJ5CW12.js → browser-Cc0iDqUi.js} +0 -0
  121. /package/client/dist/assets/{browser-BQFDxrRq.js → browser-Cvg-QHvd2.js} +0 -0
  122. /package/client/dist/assets/{browser-Do2jf8_N.js → browser-FRv8P02E.js} +0 -0
  123. /package/client/dist/assets/{browser-BbJ_q_OT2.js → browser-rWKj-RR_2.js} +0 -0
  124. /package/client/dist/assets/{chat-SaG-ng1x2.js → chat-BgL3zv6x2.js} +0 -0
  125. /package/client/dist/assets/{chat-n43nZGvn.js → chat-Bh3NdgJs.js} +0 -0
  126. /package/client/dist/assets/{chat-BalviUAD.js → chat-Bom6bqK3.js} +0 -0
  127. /package/client/dist/assets/{chat-BMWD_Rx12.js → chat-DdwZjT8K2.js} +0 -0
  128. /package/client/dist/assets/{chat-D5xEtsf3.js → chat-Dnwg-NpQ.js} +0 -0
  129. /package/client/dist/assets/{chat-CJddjN3D2.js → chat-DsbwJhus.js} +0 -0
  130. /package/client/dist/assets/{chat-Ds8GvCnv.js → chat-vylxqR0P2.js} +0 -0
  131. /package/client/dist/assets/{code-BotxM43N2.js → code-BRcDlze52.js} +0 -0
  132. /package/client/dist/assets/{code-CIPmDEd0.js → code-BdMy3Ffq.js} +0 -0
  133. /package/client/dist/assets/{code-HDK4P6Rx.js → code-CeQ0FZpC.js} +0 -0
  134. /package/client/dist/assets/{code-F_KjccGf.js → code-CwnBPPyA.js} +0 -0
  135. /package/client/dist/assets/{code-DUe1Bouz.js → code-DgeHz9CB.js} +0 -0
  136. /package/client/dist/assets/{code-Bit_z2Xd2.js → code-DzC1rMk12.js} +0 -0
  137. /package/client/dist/assets/{code-C9U6M5-e2.js → code-UPVvmAKM2.js} +0 -0
  138. /package/client/dist/assets/{commands-CzFSoIiq2.js → commands-C4Y3C-PF2.js} +0 -0
  139. /package/client/dist/assets/{commands-BllkJauO.js → commands-CSDs9q_2.js} +0 -0
  140. /package/client/dist/assets/{commands-BFQZc9AG.js → commands-DkU0qliq.js} +0 -0
  141. /package/client/dist/assets/{commands-KBbhsnw8.js → commands-JWMfGDmr.js} +0 -0
  142. /package/client/dist/assets/{commands-cKTaLwwV2.js → commands-RHOchN4n2.js} +0 -0
  143. /package/client/dist/assets/{commands-BMkC5-ki.js → commands-u-4eEHCN.js} +0 -0
  144. /package/client/dist/assets/{commands-CWX9WmDX2.js → commands-xHDDGfcP2.js} +0 -0
  145. /package/client/dist/assets/{common-DZbXlmq72.js → common-BM3LFLCE2.js} +0 -0
  146. /package/client/dist/assets/{common-Cfmwcrl52.js → common-Bwafujnc2.js} +0 -0
  147. /package/client/dist/assets/{common-D2cimsul.js → common-C-vU-j-I.js} +0 -0
  148. /package/client/dist/assets/{common-DH7fjyL1.js → common-C5HKSbbz.js} +0 -0
  149. /package/client/dist/assets/{common-CF8iGXrG.js → common-DhWTkocg.js} +0 -0
  150. /package/client/dist/assets/{common-DtXmzX2o2.js → common-DiPTT7V_2.js} +0 -0
  151. /package/client/dist/assets/{common-BfQD173j.js → common-DmqBPwZG.js} +0 -0
  152. /package/client/dist/assets/{dashboard-CiOyDh9L.js → dashboard-B5ang-ZS.js} +0 -0
  153. /package/client/dist/assets/{dashboard-BFfnCtq52.js → dashboard-CHHcOWVL2.js} +0 -0
  154. /package/client/dist/assets/{dashboard-BIC8KtRf2.js → dashboard-DBD4wPGY2.js} +0 -0
  155. /package/client/dist/assets/{dashboard-5C2FOZQX.js → dashboard-DSnztwWH.js} +0 -0
  156. /package/client/dist/assets/{dashboard-CEgg9NAr.js → dashboard-D_aP_InU.js} +0 -0
  157. /package/client/dist/assets/{dashboard-B6iQ-IL_.js → dashboard-DmBcdl1B.js} +0 -0
  158. /package/client/dist/assets/{dashboard-D6x5OnNj2.js → dashboard-RIcUKY1Y2.js} +0 -0
  159. /package/client/dist/assets/{explore-CAc8Qzu32.js → explore-B7fblXBb2.js} +0 -0
  160. /package/client/dist/assets/{explore-ELbrSZyQ2.js → explore-BHtEpoNN2.js} +0 -0
  161. /package/client/dist/assets/{explore-Bhy7WWXv.js → explore-C0k8HrkN.js} +0 -0
  162. /package/client/dist/assets/{explore-BO_OinBD.js → explore-CNBzrEPS.js} +0 -0
  163. /package/client/dist/assets/{explore-DCZL9gRN2.js → explore-D_mWBYCS2.js} +0 -0
  164. /package/client/dist/assets/{explore-DW_YTkQh.js → explore-Dahc1lOx.js} +0 -0
  165. /package/client/dist/assets/{explore-BEpIs343.js → explore-UvW1jEMa.js} +0 -0
  166. /package/client/dist/assets/{format-command-Db1viey1.js → format-command-CuWuRvka.js} +0 -0
  167. /package/client/dist/assets/{integrations-CWjh5VRk.js → integrations-2YcNyAl3.js} +0 -0
  168. /package/client/dist/assets/{integrations-RJfzXkPx2.js → integrations-BXCvXUlG2.js} +0 -0
  169. /package/client/dist/assets/{integrations-CUNe3t9l2.js → integrations-C1ThkTC52.js} +0 -0
  170. /package/client/dist/assets/{integrations-CAjq5tdW2.js → integrations-Crk2rFhL2.js} +0 -0
  171. /package/client/dist/assets/{integrations-CP_aiV_8.js → integrations-D9YrJ_Ep.js} +0 -0
  172. /package/client/dist/assets/{integrations-JOHSCvB3.js → integrations-Dn4JiGtW.js} +0 -0
  173. /package/client/dist/assets/{integrations-CG2dp3Kd.js → integrations-TAcYNh0b.js} +0 -0
  174. /package/client/dist/assets/{jira-C5UjxHE4.js → jira-BHAKtc4B.js} +0 -0
  175. /package/client/dist/assets/{jira-ZdKb-50F2.js → jira-Be369RIR2.js} +0 -0
  176. /package/client/dist/assets/{jira-DTYu3hJi2.js → jira-CPpgA-5z2.js} +0 -0
  177. /package/client/dist/assets/{jira-CQ7mrZde.js → jira-D5efgwp_.js} +0 -0
  178. /package/client/dist/assets/{jira-DtZpokjJ.js → jira-DS7ownDy.js} +0 -0
  179. /package/client/dist/assets/{jira-DIRkZk9U.js → jira-bDs7Im2C.js} +0 -0
  180. /package/client/dist/assets/{jira-B5wszJ1-2.js → jira-uNH1gETL2.js} +0 -0
  181. /package/client/dist/assets/{jobs-DAGiPVIS2.js → jobs-1GV2-4zd2.js} +0 -0
  182. /package/client/dist/assets/{jobs-DAU8C_tZ.js → jobs-26F9gGcE.js} +0 -0
  183. /package/client/dist/assets/{jobs-BJ-Gcao22.js → jobs-BgQzB0Sx2.js} +0 -0
  184. /package/client/dist/assets/{jobs-Da0GaaSc.js → jobs-BqWui9_f.js} +0 -0
  185. /package/client/dist/assets/{jobs-BFIdeDTw.js → jobs-CE8qeIYj.js} +0 -0
  186. /package/client/dist/assets/{jobs-p360zdf1.js → jobs-DzeuASRf.js} +0 -0
  187. /package/client/dist/assets/{jobs-P3unxtxo2.js → jobs-Wh7dn28q2.js} +0 -0
  188. /package/client/dist/assets/{loops-BjK8lmoZ2.js → loops-BvqQ-bHR2.js} +0 -0
  189. /package/client/dist/assets/{loops-Bi4ywYGn.js → loops-CvOWsi5r.js} +0 -0
  190. /package/client/dist/assets/{loops-DDs4KPu_.js → loops-D6D3XHjj.js} +0 -0
  191. /package/client/dist/assets/{loops-Du-bNVpc2.js → loops-DJNhp17p2.js} +0 -0
  192. /package/client/dist/assets/{loops-D3wdUkZV.js → loops-K5_HXfJa.js} +0 -0
  193. /package/client/dist/assets/{loops-DKzYFcq6.js → loops-LIgO_-eM.js} +0 -0
  194. /package/client/dist/assets/{loops-DvGbSfxw2.js → loops-vhJdbcz92.js} +0 -0
  195. /package/client/dist/assets/{mcp-DyULurYS2.js → mcp-CjVKXAhD2.js} +0 -0
  196. /package/client/dist/assets/{mcp-DfmzoT5t.js → mcp-Dcl-XxkR.js} +0 -0
  197. /package/client/dist/assets/{mcp-CbJ04oFS2.js → mcp-DtbxuH3V2.js} +0 -0
  198. /package/client/dist/assets/{mcp-Dd844F5_.js → mcp-H-gnQUdN.js} +0 -0
  199. /package/client/dist/assets/{mcp-zSJ2TsJj.js → mcp-N1nzp8oL.js} +0 -0
  200. /package/client/dist/assets/{mcp-BG-OCJca2.js → mcp-XJNRfxVp2.js} +0 -0
  201. /package/client/dist/assets/{mcp-CrWdq5db.js → mcp-sRmWE8WJ.js} +0 -0
  202. /package/client/dist/assets/{nav-DUuw9VIU2.js → nav-BElxljIF2.js} +0 -0
  203. /package/client/dist/assets/{nav-BY_4EWRv.js → nav-BXO7PJJG2.js} +0 -0
  204. /package/client/dist/assets/{nav-BAMkVEId.js → nav-C8kOuGh8.js} +0 -0
  205. /package/client/dist/assets/{nav-D0Erv9ZJ2.js → nav-COu2E_-L.js} +0 -0
  206. /package/client/dist/assets/{nav-CVXtv0wX2.js → nav-CW9pxWfC2.js} +0 -0
  207. /package/client/dist/assets/{nav-B2_ToNqS.js → nav-CXHUA4uf.js} +0 -0
  208. /package/client/dist/assets/{nav-S4HM94vW.js → nav-DdHF5VWJ.js} +0 -0
  209. /package/client/dist/assets/{setup-q0wRHUp1.js → setup-7J8TjG4O.js} +0 -0
  210. /package/client/dist/assets/{setup-DQWsu2TR.js → setup-BXpw07r-.js} +0 -0
  211. /package/client/dist/assets/{setup-mXnzww4f.js → setup-BiduSX9d.js} +0 -0
  212. /package/client/dist/assets/{setup-1vN48B-m2.js → setup-BuQNKztt2.js} +0 -0
  213. /package/client/dist/assets/{setup-BmJ0Kx16.js → setup-BwMovM9z2.js} +0 -0
  214. /package/client/dist/assets/{setup-JeBwoXoM.js → setup-D84y3wx-.js} +0 -0
  215. /package/client/dist/assets/{setup-T_ApeQDV2.js → setup-DU0ULX8q2.js} +0 -0
  216. /package/client/dist/assets/{specs-Ce5y2iFc2.js → specs-C9Sd7BhH2.js} +0 -0
  217. /package/client/dist/assets/{specs-C6J2zrLM.js → specs-CBDvEYKv.js} +0 -0
  218. /package/client/dist/assets/{specs-DZDoZsDq.js → specs-CIPr9reA2.js} +0 -0
  219. /package/client/dist/assets/{specs-BGRKhM8t.js → specs-CWtKcVDC.js} +0 -0
  220. /package/client/dist/assets/{specs-CT8exGOy2.js → specs-D2clrt2c2.js} +0 -0
  221. /package/client/dist/assets/{specs-GkiL-snY.js → specs-DTplt2XM.js} +0 -0
  222. /package/client/dist/assets/{specs-DbtIzV8a.js → specs-PozUNhqb.js} +0 -0
  223. /package/client/dist/assets/{terminal-Cvabyzm42.js → terminal-BRm03iFA2.js} +0 -0
  224. /package/client/dist/assets/{terminal-BTpE7iki.js → terminal-De2Brd23.js} +0 -0
  225. /package/client/dist/assets/{terminal-D0z12_sJ2.js → terminal-DxQWCqSD2.js} +0 -0
  226. /package/client/dist/assets/{terminal-a6Uq8B0p.js → terminal-WSAvHXoU.js} +0 -0
  227. /package/client/dist/assets/{terminal-DDk_bTw0.js → terminal-Z7KsDM_n.js} +0 -0
  228. /package/client/dist/assets/{terminal-DEyt0prF.js → terminal-cqfd3EDV.js} +0 -0
  229. /package/client/dist/assets/{terminal-BNSg2lR7.js → terminal-xGbCZJHg.js} +0 -0
  230. /package/client/dist/assets/{tickets-sVun0I6v.js → tickets-B7zT4IRf.js} +0 -0
  231. /package/client/dist/assets/{tickets-DZut8Ryt.js → tickets-BoXom7l8.js} +0 -0
  232. /package/client/dist/assets/{tickets-BIxU86j12.js → tickets-C3b8cHhd2.js} +0 -0
  233. /package/client/dist/assets/{tickets-dQfsc7Ph.js → tickets-CFXnJsYF.js} +0 -0
  234. /package/client/dist/assets/{tickets-LfK6LzKl2.js → tickets-CWYFvx1W2.js} +0 -0
  235. /package/client/dist/assets/{tickets-D1IeX2EW.js → tickets-DTHo9c3C.js} +0 -0
  236. /package/client/dist/assets/{tickets-C2BhwzwR.js → tickets-SuX_HkK4.js} +0 -0
@@ -1 +1 @@
1
- import{a as e}from"./chunk-BNv3lrIs.js";import{t}from"./brain-DecvjjPU.js";import{Hn as n,Nt as r,Xn as i,Zn as a,Zt as o,dt as s,it as c,qn as l,rt as u,tn as d}from"./index-OBDI7bHm.js";import{r as f,t as p}from"./TemplatePreviewModal-eBI0zL5P.js";var m=e(a(),1),h=e(i(),1),g=s();function _({loop:e,onClose:i}){let{t:a}=n(`loops`),s=l();return(0,m.useEffect)(()=>{let e=e=>{e.key===`Escape`&&i()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i]),(0,h.createPortal)((0,g.jsxs)(`div`,{"data-testid":`loop-preview-modal`,className:`fixed inset-0 z-[65] flex items-center justify-center p-4`,children:[(0,g.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-sm`,onClick:i,"aria-hidden":!0}),(0,g.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":e.name,className:`relative flex max-h-[80vh] w-full max-w-lg flex-col gap-4 overflow-hidden rounded-xl border border-border/30 bg-popover p-6 shadow-xl backdrop-blur-md`,children:[(0,g.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2 pr-6`,children:[(0,g.jsx)(t,{className:`h-4 w-4 shrink-0 text-accent-highlight`}),(0,g.jsx)(`span`,{className:`min-w-0 truncate text-base font-semibold text-foreground`,children:e.name}),(0,g.jsxs)(`span`,{className:c(`inline-flex shrink-0 items-center gap-1 rounded-full border px-1.5 py-px text-[10px] font-medium uppercase tracking-wide`,e.locked?`border-accent-info/40 bg-accent-info/10 text-accent-info`:e.status===`published`?`border-accent-success/40 bg-accent-success/10 text-accent-success`:`border-border/60 bg-surface/60 text-foreground/60`),children:[e.locked&&(0,g.jsx)(d,{className:`h-2.5 w-2.5`}),e.locked?a(`preview.builtin`):a(`status.${e.status??`draft`}`,{defaultValue:e.status??``})]})]}),e.description&&(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description})]}),(0,g.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:a(`preview.limits`,{iterations:e.graph.config.maxIterations,timeout:e.graph.config.timeoutMinutes})}),(0,g.jsxs)(`div`,{className:`min-h-0 space-y-1.5 overflow-y-auto pr-1`,children:[(0,g.jsx)(`span`,{className:`block text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:a(`preview.steps`)}),e.graph.nodes.map((e,t)=>{let n=p[e.type]??r,i=f(e);return(0,g.jsxs)(`div`,{className:`rounded border border-border bg-surface/30 p-2`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,g.jsxs)(`span`,{className:`text-[10px] tabular-nums text-muted-foreground`,children:[t+1,`.`]}),(0,g.jsx)(n,{className:`h-3.5 w-3.5 text-accent-primary`}),a(`builder.nodes.${e.type}`)]}),i&&(0,g.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words font-mono text-[11px] text-muted-foreground`,children:i})]},e.id)})]}),(0,g.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2`,children:[(0,g.jsx)(u,{variant:`ghost`,onClick:i,children:a(`common:actions.close`)}),!e.locked&&(0,g.jsxs)(u,{"data-testid":`loop-preview-open-builder`,onClick:()=>{i(),s(`/loops/${encodeURIComponent(e.id)}/edit`)},children:[(0,g.jsx)(o,{className:`mr-1.5 h-3.5 w-3.5`}),a(`preview.openInBuilder`)]})]})]})]}),document.body)}export{_ as LoopPreviewModal};
1
+ import{a as e}from"./chunk-BNv3lrIs.js";import{t}from"./brain-C92rjjYP.js";import{$n as n,$t as r,Ft as i,Qn as a,Wn as o,Yn as s,at as c,ot as l,pt as u,rn as d}from"./index-DyY1QyIn.js";import{r as f,t as p}from"./TemplatePreviewModal-CeMx2Red.js";var m=e(n(),1),h=e(a(),1),g=u();function _({loop:e,onClose:n}){let{t:a}=o(`loops`),u=s();return(0,m.useEffect)(()=>{let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]),(0,h.createPortal)((0,g.jsxs)(`div`,{"data-testid":`loop-preview-modal`,className:`fixed inset-0 z-[65] flex items-center justify-center p-4`,children:[(0,g.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-sm`,onClick:n,"aria-hidden":!0}),(0,g.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":e.name,className:`relative flex max-h-[80vh] w-full max-w-lg flex-col gap-4 overflow-hidden rounded-xl border border-border/30 bg-popover p-6 shadow-xl backdrop-blur-md`,children:[(0,g.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2 pr-6`,children:[(0,g.jsx)(t,{className:`h-4 w-4 shrink-0 text-accent-highlight`}),(0,g.jsx)(`span`,{className:`min-w-0 truncate text-base font-semibold text-foreground`,children:e.name}),(0,g.jsxs)(`span`,{className:l(`inline-flex shrink-0 items-center gap-1 rounded-full border px-1.5 py-px text-[10px] font-medium uppercase tracking-wide`,e.locked?`border-accent-info/40 bg-accent-info/10 text-accent-info`:e.status===`published`?`border-accent-success/40 bg-accent-success/10 text-accent-success`:`border-border/60 bg-surface/60 text-foreground/60`),children:[e.locked&&(0,g.jsx)(d,{className:`h-2.5 w-2.5`}),e.locked?a(`preview.builtin`):a(`status.${e.status??`draft`}`,{defaultValue:e.status??``})]})]}),e.description&&(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description})]}),(0,g.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:a(`preview.limits`,{iterations:e.graph.config.maxIterations,timeout:e.graph.config.timeoutMinutes})}),(0,g.jsxs)(`div`,{className:`min-h-0 space-y-1.5 overflow-y-auto pr-1`,children:[(0,g.jsx)(`span`,{className:`block text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:a(`preview.steps`)}),e.graph.nodes.map((e,t)=>{let n=p[e.type]??i,r=f(e);return(0,g.jsxs)(`div`,{className:`rounded border border-border bg-surface/30 p-2`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,g.jsxs)(`span`,{className:`text-[10px] tabular-nums text-muted-foreground`,children:[t+1,`.`]}),(0,g.jsx)(n,{className:`h-3.5 w-3.5 text-accent-primary`}),a(`builder.nodes.${e.type}`)]}),r&&(0,g.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words font-mono text-[11px] text-muted-foreground`,children:r})]},e.id)})]}),(0,g.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2`,children:[(0,g.jsx)(c,{variant:`ghost`,onClick:n,children:a(`common:actions.close`)}),!e.locked&&(0,g.jsxs)(c,{"data-testid":`loop-preview-open-builder`,onClick:()=>{n(),u(`/loops/${encodeURIComponent(e.id)}/edit`)},children:[(0,g.jsx)(r,{className:`mr-1.5 h-3.5 w-3.5`}),a(`preview.openInBuilder`)]})]})]})]}),document.body)}export{_ as LoopPreviewModal};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-BNv3lrIs.js";import{t}from"./upload-CmR4h9H1.js";import{$ as n,$n as r,$t as i,A as a,H as o,Hn as s,J as c,Lt as l,M as u,Mt as d,O as f,Q as p,Sn as m,Un as h,Wn as g,X as ee,Xt as _,Y as te,Yn as v,Z as ne,Zt as y,at as b,ct as re,j as x,k as S,kt as C,ot as w,pt as T,st as E,xn as D,yn as O}from"./index-DyY1QyIn.js";import{n as ie}from"./TemplatePreviewModal-CeMx2Red.js";var k=s(`file-down`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`m9 15 3 3 3-3`,key:`1npd3o`}]]),ae=s(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),A=e(r(),1);function oe(e){return{specrailsLoops:1,loops:e.map(e=>({name:e.name,description:e.description,graph:e.graph}))}}function j(e){let t=e;return!!t&&typeof t.name==`string`&&!!t.graph&&typeof t.graph==`object`}function se(e){let t;try{t=JSON.parse(e)}catch{throw Error(`invalid-json`)}let n=(Array.isArray(t)?t:Array.isArray(t?.loops)?t.loops:j(t)?[t]:[]).filter(j);if(n.length===0)throw Error(`no-loops`);return n.map(e=>({name:e.name,description:e.description??null,graph:e.graph}))}function ce(e){return e.length===1?`${e[0].name.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`loop`}.loop.json`:`specrails-loops-${e.length}.json`}var M=[`API`,`Automation`,`CI`,`Database`,`Debugging`,`DevOps`,`Docs`,`Git`,`Maintenance`,`Performance`,`Planning`,`Quality`,`Review`,`Security`,`Testing`];function le(e,t){let n=t.query.trim().toLowerCase(),r=t.categories;return e.filter(e=>r.length>0&&!(e.category&&r.includes(e.category))?!1:n?`${e.name} ${e.description} ${e.tags.join(` `)} ${e.category??``} ${e.searchTerms??``}`.toLowerCase().includes(n):!0)}function ue(e){let t=new Map;for(let n of e)n.category&&t.set(n.category,(t.get(n.category)??0)+1);let n=[];for(let e of M){let r=t.get(e);r&&(n.push({category:e,count:r}),t.delete(e))}for(let e of[...t.keys()].sort())n.push({category:e,count:t.get(e)});return n}var N=T();function de({loop:e,projects:t,onClose:r,onExecute:i}){let{t:a}=g(`loops`),s=e!==null,[l,u]=(0,A.useState)(``),[d,m]=(0,A.useState)(``),[h,_]=(0,A.useState)(``),[v,re]=(0,A.useState)(`medium`),x=t.find(e=>e.id===(l||t[0]?.id)),C=(0,A.useMemo)(()=>x?.providers??(x?.provider?[x.provider]:[]),[x]),w=d||C[0]||``,T=(0,A.useMemo)(()=>S(w),[w]),E=h||f(w),D=w?o(w):!1;return(0,N.jsx)(c,{open:s,onOpenChange:e=>{e||r()},children:(0,N.jsx)(te,{movableResizable:!0,className:`max-w-sm`,children:e&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(p,{children:[(0,N.jsx)(n,{children:a(`run.title`,{name:e.name})}),(0,N.jsx)(ee,{children:a(`run.subtitle`)})]}),(0,N.jsx)(`label`,{className:`block text-[11px] font-medium text-muted-foreground`,children:a(`run.project`)}),t.length===0?(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a(`run.noProjects`)}):(0,N.jsx)(`select`,{"aria-label":a(`run.project`),"data-testid":`run-project-select`,value:l||t[0]?.id,onChange:e=>{u(e.target.value),m(``),_(``)},className:`w-full text-xs rounded border border-border bg-transparent px-2 py-1 text-foreground focus:outline-none focus:ring-1 focus:ring-accent-primary/40`,children:t.map(e=>(0,N.jsx)(`option`,{value:e.id,children:e.name},e.id))}),C.length>1&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`label`,{className:`block text-[11px] font-medium text-muted-foreground`,children:a(`run.provider`)}),(0,N.jsx)(`select`,{"aria-label":a(`run.provider`),value:w,onChange:e=>{m(e.target.value),_(``)},className:`w-full text-xs rounded border border-border bg-transparent px-2 py-1 text-foreground focus:outline-none focus:ring-1 focus:ring-accent-primary/40`,children:C.map(e=>(0,N.jsx)(`option`,{value:e,children:e},e))})]}),T.length>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`label`,{className:`block text-[11px] font-medium text-muted-foreground`,children:a(`run.model`)}),(0,N.jsx)(`select`,{"aria-label":a(`run.model`),"data-testid":`run-model-select`,value:E,onChange:e=>_(e.target.value),className:`w-full text-xs rounded border border-border bg-transparent px-2 py-1 text-foreground focus:outline-none focus:ring-1 focus:ring-accent-primary/40`,children:T.map(e=>(0,N.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),D&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`label`,{className:`block text-[11px] font-medium text-muted-foreground`,children:a(`run.effort`)}),(0,N.jsxs)(`select`,{"aria-label":a(`run.effort`),value:v,onChange:e=>re(e.target.value),className:`w-full text-xs rounded border border-border bg-transparent px-2 py-1 text-foreground focus:outline-none focus:ring-1 focus:ring-accent-primary/40`,children:[(0,N.jsx)(`option`,{value:`low`,children:`low`}),(0,N.jsx)(`option`,{value:`medium`,children:`medium`}),(0,N.jsx)(`option`,{value:`high`,children:`high`})]})]}),(0,N.jsxs)(ne,{children:[(0,N.jsx)(b,{variant:`ghost`,onClick:r,children:a(`common:actions.cancel`)}),(0,N.jsxs)(b,{onClick:()=>{let e=l||t[0]?.id;e&&i({projectId:e,provider:C.length>1?w:void 0,model:T.length>0?E:void 0,effort:D?v:void 0})},disabled:t.length===0,children:[(0,N.jsx)(y,{className:`w-3.5 h-3.5 mr-1.5`}),a(`run.execute`)]})]})]})})})}var fe={draft:`bg-accent-secondary/15 text-accent-secondary ring-accent-secondary/40`,published:`bg-accent-success/15 text-accent-success ring-accent-success/40`};function P({status:e}){let{t}=g(`loops`);return(0,N.jsx)(`span`,{className:w(`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium ring-1 ring-inset`,fe[e]),children:t(`status.${e}`)})}function F(){let{t:e}=g(`loops`),t=v(),r=(0,A.useCallback)(e=>e.replace(/:/g,`_`),[]),i=(0,A.useCallback)((t,n)=>e(`catalog.${r(t)}.name`,{defaultValue:n}),[e,r]),o=(0,A.useCallback)((t,n)=>e(`catalog.${r(t)}.description`,{defaultValue:n}),[e,r]),[s,f]=(0,A.useState)([]),[y,S]=(0,A.useState)([]),[T,j]=(0,A.useState)([]),[M,fe]=(0,A.useState)(!0),[P,F]=(0,A.useState)(null),[L,R]=(0,A.useState)(null),[z,B]=(0,A.useState)(`use`),[V,H]=(0,A.useState)(null),[U,me]=(0,A.useState)(new Set),W=`specrails-desktop:loop-template-filter`,G=(()=>{try{let e=localStorage.getItem(W),t=e?JSON.parse(e):null;return{query:typeof t?.query==`string`?t.query:``,categories:Array.isArray(t?.categories)?t.categories:[]}}catch{return{query:``,categories:[]}}})(),[K,q]=(0,A.useState)(G.query),[J,he]=(0,A.useState)(G.categories);(0,A.useEffect)(()=>{try{localStorage.setItem(W,JSON.stringify({query:K,categories:J}))}catch{}},[K,J]);let ge=(0,A.useCallback)(e=>{he(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),_e=(0,A.useCallback)(()=>{q(``),he([])},[]),ve=(0,A.useRef)(null),{projects:ye,setActiveProjectId:be}=re(),xe=(0,A.useCallback)(e=>{me(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Y=(0,A.useCallback)(e=>{if(e.length===0)return;let t=new Blob([JSON.stringify(oe(e),null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=ce(e),r.click(),URL.revokeObjectURL(n)},[]),X=(0,A.useCallback)(async()=>{try{let[e,t]=await Promise.all([u.list(),u.templates()]);f(e),S(t)}catch{h.error(e(`errors.load`))}finally{fe(!1)}try{j(await u.factoryLoops())}catch{j([])}},[e]);(0,A.useEffect)(()=>{X()},[X]);let Se=(0,A.useCallback)(async t=>{try{let n=se(await t.text()),{imported:r,skipped:i}=await u.importLoops(n);await X(),r.length&&h.success(e(`import.done`,{count:r.length})),i.length&&h.warning(e(`import.skipped`,{count:i.length,names:i.join(`, `)})),!r.length&&!i.length&&h.warning(e(`import.invalid`))}catch(t){let n=t instanceof Error?t.message:``;h.error(e(n===`invalid-json`||n===`no-loops`?`import.invalid`:`errors.save`))}},[X,e]),Z=(0,A.useCallback)(e=>t(`/loops/${e}/edit`),[t]),Ce=(0,A.useCallback)(async()=>{try{Z((await u.create({name:e(`newLoopName`)})).id)}catch{h.error(e(`errors.save`))}},[e,Z]),we=(0,A.useCallback)(async t=>{try{Z((await u.fromTemplate(t)).id)}catch{h.error(e(`errors.save`))}},[e,Z]),Te=(0,A.useCallback)(async t=>{try{Z((await u.forkFactory(t)).id)}catch{h.error(e(`errors.save`))}},[e,Z]),Ee=(0,A.useCallback)(async({projectId:n,provider:r,model:i,effort:a})=>{let o=V;if(o){H(null);try{let{loopRunId:s}=await u.runStandalone(n,o.id,{aiEngine:r,model:i,reasoning_effort:a});be(n),t(`/jobs/${s}`),h.success(e(`run.launched`,{name:o.name}))}catch{h.error(e(`errors.save`))}}},[V,t,be,e]),De=(0,A.useCallback)(e=>{B(`fork`),R({id:e.id,name:i(e.id,e.name),description:o(e.id,e.description),tags:e.claudeOnly?[`claude-only`]:[],graph:e.graph})},[i,o]),Oe=(0,A.useCallback)(async t=>{try{await u.publish(t),await X()}catch(t){t instanceof x?h.error(e(`errors.publishInvalid`)):h.error(e(`errors.save`))}},[e,X]),ke=(0,A.useCallback)(async t=>{try{await u.unpublish(t),await X()}catch{h.error(e(`errors.save`))}},[e,X]),Ae=(0,A.useCallback)(async t=>{try{await u.duplicate(t),await X()}catch{h.error(e(`errors.save`))}},[e,X]),je=(0,A.useCallback)(e=>F(e),[]),Me=(0,A.useCallback)(async()=>{let t=P;if(t){F(null);try{await u.remove(t),await X()}catch{h.error(e(`errors.save`))}}},[P,e,X]),Q=s.filter(e=>e.status===`draft`),$=s.filter(e=>e.status===`published`),Ne=ue(y),Pe=le(y.map(t=>({...t,searchTerms:`${i(t.id,t.name)} ${o(t.id,t.description)} ${t.category?e(`categories.${t.category}`,{defaultValue:t.category}):``}`})),{query:K,categories:J}),Fe=K.trim()!==``||J.length>0;return(0,N.jsxs)(`div`,{className:`h-full overflow-y-auto`,children:[(0,N.jsxs)(`div`,{className:`max-w-5xl mx-auto px-6 py-6`,children:[(0,N.jsxs)(`div`,{className:`flex items-start justify-between mb-6`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,N.jsx)(C,{className:`w-5 h-5 text-accent-primary`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h1`,{className:`text-lg font-semibold text-foreground`,children:e(`title`)}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e(`subtitle`)})]})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[U.size>0&&(0,N.jsxs)(`button`,{type:`button`,onClick:()=>Y(s.filter(e=>U.has(e.id))),className:`inline-flex items-center gap-1.5 h-8 px-3 rounded-md text-xs font-medium border border-border text-foreground hover:bg-muted`,children:[(0,N.jsx)(k,{className:`w-3.5 h-3.5`}),e(`actions.export`),` (`,U.size,`)`]}),(0,N.jsxs)(`button`,{type:`button`,onClick:()=>ve.current?.click(),className:`inline-flex items-center gap-1.5 h-8 px-3 rounded-md text-xs font-medium border border-border text-foreground hover:bg-muted`,children:[(0,N.jsx)(ae,{className:`w-3.5 h-3.5`}),e(`actions.import`)]}),(0,N.jsx)(`input`,{ref:ve,type:`file`,accept:`application/json,.json`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];t&&Se(t),e.target.value=``}}),(0,N.jsxs)(`button`,{type:`button`,onClick:Ce,className:`inline-flex items-center gap-1.5 h-8 px-3 rounded-md text-xs font-medium bg-accent-primary text-white hover:bg-accent-primary/90`,children:[(0,N.jsx)(_,{className:`w-3.5 h-3.5`}),e(`newLoop`)]})]})]}),M?(0,N.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`…`}):(0,N.jsxs)(`div`,{className:`space-y-8`,children:[Q.length===0&&$.length===0&&(0,N.jsxs)(`div`,{className:`rounded-lg border border-dashed border-border p-8 text-center`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:e(`empty.title`)}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:e(`empty.body`)})]}),$.length>0&&(0,N.jsx)(I,{title:e(`sections.published`),children:$.map(e=>(0,N.jsx)(pe,{loop:e,selected:U.has(e.id),onToggleSelect:()=>xe(e.id),onEdit:()=>Z(e.id),onUnpublish:()=>ke(e.id),onDuplicate:()=>Ae(e.id),onExport:()=>Y([e]),onDelete:()=>je(e.id),onRun:a(e.graph)?void 0:()=>H(e)},e.id))}),Q.length>0&&(0,N.jsx)(I,{title:e(`sections.drafts`),children:Q.map(e=>(0,N.jsx)(pe,{loop:e,selected:U.has(e.id),onToggleSelect:()=>xe(e.id),onEdit:()=>Z(e.id),onPublish:()=>Oe(e.id),onDuplicate:()=>Ae(e.id),onExport:()=>Y([e]),onDelete:()=>je(e.id)},e.id))}),T.length>0&&(0,N.jsx)(I,{title:e(`sections.builtIn`),children:T.map(t=>(0,N.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-3 flex flex-col gap-2`,"data-testid":`factory-loop-card`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(C,{className:`w-3.5 h-3.5 text-accent-primary`}),(0,N.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:i(t.id,t.name)}),(0,N.jsx)(`span`,{className:`ml-auto px-1.5 py-0.5 rounded text-[10px] bg-muted text-muted-foreground`,children:e(`builtInBadge`)})]}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground flex-1`,children:o(t.id,t.description)}),(0,N.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,N.jsxs)(`button`,{type:`button`,onClick:()=>De(t),className:`inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md text-xs border border-border hover:bg-muted text-foreground`,children:[(0,N.jsx)(O,{className:`w-3 h-3`}),e(`actions.preview`)]}),(0,N.jsxs)(`button`,{type:`button`,onClick:()=>void Te(t.id),className:`inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md text-xs border border-border hover:bg-muted text-foreground`,children:[(0,N.jsx)(m,{className:`w-3 h-3`}),e(`actions.fork`)]})]})]},t.id))}),y.length>0&&(0,N.jsxs)(`section`,{children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-2 flex-wrap`,children:[(0,N.jsx)(`h2`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:e(`sections.templates`)}),(0,N.jsx)(`input`,{type:`search`,value:K,onChange:e=>q(e.target.value),placeholder:e(`gallery.search`),"aria-label":e(`gallery.search`),"data-testid":`template-search`,className:`h-7 w-48 max-w-full rounded-md border border-border bg-surface/40 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/70 focus:outline-none focus:ring-1 focus:ring-accent-primary`})]}),(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mb-3`,"data-testid":`category-chips`,children:[Ne.map(({category:t,count:n})=>{let r=J.includes(t);return(0,N.jsxs)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>ge(t),className:w(`inline-flex items-center gap-1 h-6 px-2 rounded-full text-[11px] border transition-colors`,r?`border-accent-primary bg-accent-primary/15 text-accent-primary`:`border-border bg-surface/40 text-muted-foreground hover:text-foreground hover:bg-muted`),children:[e(`categories.${t}`,{defaultValue:t}),(0,N.jsx)(`span`,{className:`opacity-60 tabular-nums`,children:n})]},t)}),Fe&&(0,N.jsx)(`button`,{type:`button`,onClick:_e,className:`inline-flex items-center h-6 px-2 rounded-full text-[11px] text-accent-primary hover:underline`,children:e(`gallery.clearFilter`)})]}),Pe.length===0?(0,N.jsxs)(`div`,{className:`rounded-lg border border-dashed border-border p-6 text-center`,"data-testid":`template-empty`,children:[(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`gallery.noResults`)}),(0,N.jsx)(`button`,{type:`button`,onClick:_e,className:`mt-2 text-xs text-accent-primary hover:underline`,children:e(`gallery.clearFilter`)})]}):(0,N.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:Pe.map(t=>(0,N.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-3 flex flex-col gap-2`,"data-testid":`template-card`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(l,{className:`w-3.5 h-3.5 text-accent-highlight flex-shrink-0`}),(0,N.jsx)(`span`,{className:`text-sm font-medium text-foreground truncate`,children:i(t.id,t.name)}),t.category&&(0,N.jsx)(`span`,{className:`ml-auto px-1.5 py-0.5 rounded text-[10px] bg-accent-info/15 text-accent-info flex-shrink-0`,children:e(`categories.${t.category}`,{defaultValue:t.category})})]}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground flex-1`,children:o(t.id,t.description)}),(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[a(t.graph)?(0,N.jsx)(`span`,{title:e(`gallery.needsSpecHint`),className:`px-1.5 py-0.5 rounded text-[10px] bg-accent-secondary/15 text-accent-secondary`,children:e(`gallery.needsSpec`)}):(0,N.jsx)(`span`,{title:e(`gallery.standaloneHint`),className:`px-1.5 py-0.5 rounded text-[10px] bg-accent-success/15 text-accent-success`,children:e(`gallery.standalone`)}),t.tags.map(e=>(0,N.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-muted text-muted-foreground`,children:e},e))]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,N.jsxs)(`button`,{type:`button`,onClick:()=>{B(`use`),R({...t,name:i(t.id,t.name),description:o(t.id,t.description)})},className:`inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md text-xs border border-border hover:bg-muted text-foreground`,children:[(0,N.jsx)(O,{className:`w-3 h-3`}),e(`actions.preview`)]}),(0,N.jsxs)(`button`,{type:`button`,onClick:()=>we(t.id),className:`inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md text-xs border border-border hover:bg-muted text-foreground`,children:[(0,N.jsx)(D,{className:`w-3 h-3`}),e(`actions.use`)]})]})]},t.id))})]})]})]}),(0,N.jsx)(c,{open:P!==null,onOpenChange:e=>{e||F(null)},children:(0,N.jsxs)(te,{className:`max-w-sm`,children:[(0,N.jsxs)(p,{children:[(0,N.jsxs)(n,{className:`flex items-center gap-2`,children:[(0,N.jsx)(d,{className:`w-4 h-4 text-destructive`}),s.find(e=>e.id===P)?.name??e(`actions.delete`)]}),(0,N.jsx)(ee,{children:e(`confirmDelete`)})]}),(0,N.jsxs)(ne,{children:[(0,N.jsx)(b,{variant:`ghost`,onClick:()=>F(null),children:e(`common:actions.cancel`)}),(0,N.jsx)(b,{variant:`destructive`,onClick:()=>void Me(),children:e(`common:actions.delete`)})]})]})}),(0,N.jsx)(ie,{template:L,mode:z,onClose:()=>R(null),onUse:e=>{R(null),z===`fork`?Te(e):we(e)}}),(0,N.jsx)(de,{loop:V?{id:V.id,name:V.name}:null,projects:ye.map(e=>({id:e.id,name:e.name,providers:E(e)})),onClose:()=>H(null),onExecute:Ee})]})}function I({title:e,children:t}){return(0,N.jsxs)(`section`,{children:[(0,N.jsx)(`h2`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground mb-2`,children:e}),(0,N.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:t})]})}function pe({loop:e,selected:n,onToggleSelect:r,onEdit:a,onPublish:o,onUnpublish:s,onDuplicate:c,onExport:l,onDelete:u,onRun:f}){let{t:p}=g(`loops`),h=e.graph?.nodes?.length??0;return(0,N.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-3 flex flex-col gap-2`,"data-testid":`loop-card`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,N.jsx)(`input`,{type:`checkbox`,checked:n,onChange:r,"aria-label":p(`actions.select`,{name:e.name}),className:`accent-accent-primary flex-shrink-0`}),(0,N.jsx)(`span`,{className:`text-sm font-medium text-foreground truncate`,children:e.name})]}),(0,N.jsx)(P,{status:e.status})]}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`card.nodes`,{count:h})}),(0,N.jsxs)(`div`,{className:`flex items-center gap-1 flex-wrap`,children:[f&&(0,N.jsx)(L,{icon:y,label:p(`actions.run`),onClick:f}),(0,N.jsx)(L,{icon:i,label:p(`actions.edit`),onClick:a}),o&&(0,N.jsx)(L,{icon:t,label:p(`actions.publish`),onClick:o}),s&&(0,N.jsx)(L,{icon:D,label:p(`actions.unpublish`),onClick:s}),(0,N.jsx)(L,{icon:m,label:p(`actions.duplicate`),onClick:c}),(0,N.jsx)(L,{icon:k,label:p(`actions.export`),onClick:l}),(0,N.jsx)(L,{icon:d,label:p(`actions.delete`),onClick:u,danger:!0})]})]})}function L({icon:e,label:t,onClick:n,danger:r}){return(0,N.jsx)(`button`,{type:`button`,onClick:n,title:t,"aria-label":t,className:w(`inline-flex items-center justify-center w-7 h-7 rounded-md transition-colors`,r?`text-muted-foreground hover:text-destructive hover:bg-destructive/10`:`text-muted-foreground hover:text-foreground hover:bg-muted`),children:(0,N.jsx)(e,{className:`w-3.5 h-3.5`})})}export{F as default};
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./chunk-BNv3lrIs.js";import{a as t}from"./auth-DpZq5p1e.js";import{$ as n,$n as r,Dn as i,Hn as a,It as o,J as s,Mt as c,Nn as l,Q as u,Rt as d,Un as f,Ut as p,Vt as m,Wn as h,X as g,Y as _,Yt as v,at as y,ct as b,ft as x,in as S,jt as C,ot as w,pt as T,q as E,st as D,u as O,xn as k,zt as ee}from"./index-DyY1QyIn.js";var A=a(`earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),te=a(`folder-kanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),ne=a(`plug-zap`,[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]]),re=a(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),ie=a(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),j=e(r(),1),M=T(),N=[`todo`,`in_progress`,`on_review`,`done`,`cancelled`],ae={todo:`todo`,in_progress:`inProgress`,on_review:`onReview`,done:`done`,cancelled:`cancelled`};function P({state:e,onChanged:t,apiBase:n}){let{t:r}=h(`jira`),i=e.connection,[a,o]=(0,j.useState)(i.enabled),[s,c]=(0,j.useState)(!1),[l,u]=(0,j.useState)(!1),[d,p]=(0,j.useState)([]),[m,g]=(0,j.useState)([]),[_,v]=(0,j.useState)(i.discardStatus??``),[b,x]=(0,j.useState)(i.statusMap??{}),S=e.outbox??{pending:0,inflight:0,done:0,dead:0},C=(0,j.useCallback)(async()=>{try{let{ops:e}=n?await E.listOutbox(`dead`,n):await E.listOutbox(`dead`);p(e)}catch{p([])}},[n]);(0,j.useEffect)(()=>{C()},[C]),(0,j.useEffect)(()=>{let e=!1;return E.listStatuses(n).then(({statuses:t})=>{e||g(t)}).catch(()=>{e||g([])}),()=>{e=!0}},[n]);async function w(e){let i=_;v(e);try{n?await E.patchConnection({discardStatus:e||null},n):await E.patchConnection({discardStatus:e||null}),t()}catch(e){v(i),f.error(I(e,r))}}async function T(e,i){let a=b,o={...b,[e]:i||void 0};x(o);let s=Object.fromEntries(Object.entries(o).filter(([,e])=>e));try{n?await E.patchConnection({statusMap:Object.keys(s).length?s:null},n):await E.patchConnection({statusMap:Object.keys(s).length?s:null}),t()}catch(e){x(a),f.error(I(e,r))}}async function D(){let e=!a;o(e),u(!0);try{n?await E.setEnabled(e,n):await E.setEnabled(e)}catch(t){o(!e),f.error(I(t,r))}finally{u(!1)}}async function O(){c(!0);try{let e=n?await E.syncNow(n):await E.syncNow();f.success(r(`status.syncedToast`,{count:e.upserted}))}catch(e){f.error(I(e,r))}finally{c(!1)}}async function k(){if(window.confirm(r(`status.disconnectConfirm`))){u(!0);try{n?await E.disconnect(n):await E.disconnect(),f.success(r(`status.disconnectedToast`)),t()}catch(e){f.error(I(e,r))}finally{u(!1)}}}async function ee(e){try{n?await E.retryOutbox(e,n):await E.retryOutbox(e),await C()}catch(e){f.error(I(e,r))}}let A=S.pending+S.inflight;return(0,M.jsxs)(`div`,{className:`space-y-4`,"data-testid":`jira-connected`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:r(`status.connected`,{key:i.jiraProjectKey})}),(0,M.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[i.baseUrl,` · `,i.deployment===`cloud`?r(`review.cloud`):r(`review.dc`)]})]}),(0,M.jsx)(`a`,{href:`${i.baseUrl}/browse/${i.jiraProjectKey}`,target:`_blank`,rel:`noreferrer`,className:`text-xs text-accent-primary hover:underline`,children:r(`badge.openInJira`)})]}),(0,M.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-border p-3`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`p`,{className:`text-sm font-medium`,children:r(`status.enabledLabel`)}),(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(a?`status.enabledHelp`:`status.pausedHelp`)})]}),(0,M.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":a,"aria-label":r(`status.enabledLabel`),disabled:l,onClick:D,className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${a?`bg-accent-success`:`bg-input`}`,children:(0,M.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-background shadow-sm transition-transform ${a?`translate-x-4`:`translate-x-0.5`}`})})]}),(0,M.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`jira-status-map`,children:[(0,M.jsx)(`p`,{className:`text-sm font-medium`,children:r(`wizard.step3Title`)}),(0,M.jsx)(`p`,{className:`mt-0.5 mb-2 text-xs text-muted-foreground`,children:r(`mapping.intro`)}),(0,M.jsx)(`div`,{className:`space-y-2`,children:N.map(e=>(0,M.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r(`mapping.${ae[e]}`)}),(0,M.jsxs)(`select`,{value:b[e]??``,onChange:t=>void T(e,t.target.value),className:`w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-statusmap-${e}`,children:[(0,M.jsx)(`option`,{value:``,children:r(`mapping.auto`)}),m.map(e=>(0,M.jsx)(`option`,{value:e.name,children:e.name},e.id)),b[e]&&!m.some(t=>t.name===b[e])&&(0,M.jsx)(`option`,{value:b[e],children:b[e]})]})]},e))})]}),(0,M.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,M.jsx)(`p`,{className:`text-sm font-medium`,children:r(`discard.configLabel`)}),(0,M.jsx)(`p`,{className:`mt-0.5 mb-2 text-xs text-muted-foreground`,children:r(`discard.configHelp`)}),(0,M.jsxs)(`select`,{value:_,onChange:e=>void w(e.target.value),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-discard-status-select`,children:[(0,M.jsx)(`option`,{value:``,children:r(`discard.configNone`)}),m.map(e=>(0,M.jsx)(`option`,{value:e.name,children:e.name},e.id)),_&&!m.some(e=>e.name===_)&&(0,M.jsx)(`option`,{value:_,children:_})]})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(y,{variant:`outline`,size:`sm`,onClick:O,disabled:s,children:r(s?`status.syncing`:`status.syncNow`)}),(0,M.jsx)(y,{variant:`ghost`,size:`sm`,onClick:k,disabled:l,className:`text-destructive`,children:r(`status.disconnect`)})]}),(0,M.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`jira-outbox`,children:[(0,M.jsx)(`p`,{className:`text-sm font-medium`,children:r(`outbox.title`)}),S.dead>0?(0,M.jsx)(`p`,{className:`mt-1 text-xs text-accent-warning`,children:r(`outbox.dead`,{count:S.dead})}):A>0?(0,M.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:r(`outbox.pending`,{count:A})}):(0,M.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:r(`outbox.allSynced`)}),d.length>0&&(0,M.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`outbox.deadHelp`)}),d.map(e=>(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded border border-border/60 px-2 py-1`,children:[(0,M.jsxs)(`span`,{className:`truncate text-xs`,children:[F(e,r),` · `,e.deadReason??e.lastError??``]}),(0,M.jsx)(y,{variant:`outline`,size:`sm`,onClick:()=>ee(e.id),children:r(`outbox.retry`)})]},e.id))]})]})]})}function F(e,t){return e.opType===`transition`?t(`outbox.opTransition`):e.opType===`comment`?t(`outbox.opComment`):t(`outbox.opCreate`)}function I(e,t){return e instanceof Error?e.message:t(`errors.generic`)}function L(e){return{provider:e,label:e===`codex`?`Codex`:`Claude`,active:!1,available:!1,detectedRoute:!1,requests:0,inputTokens:0,inputTokensSaved:0,outputTokens:0,outputTokensSaved:0,outputSavingsPercent:0,outputSavingsMethod:`none`,outputSavingsAllocated:!1}}function R(){return{updatedAt:null,proxyStatsAvailable:!1,durableSavingsAvailable:!1,outputSavingsAvailable:!1,outputSavingsMethod:null,outputConfidence:null,providers:{codex:L(`codex`),claude:L(`claude`)},lastIssue:null}}var z={installed:!1,installSource:null,version:null,executablePath:null,uvPath:null,port:8787,phase:`idle`,activeProviders:{codex:!1,claude:!1},availableProviders:{codex:!1,claude:!1},detectedRoutes:{codex:!1,claude:!1},proxyRunning:!1,proxyPid:null,learning:{enabled:!1,baselineReady:!1,baselineSamples:0,updatedAt:null,lastIssue:null},metrics:R(),lastIssue:null,updatedAt:null};function B(e){let t=e?.metrics??R();return{...z,...e,activeProviders:{...z.activeProviders,...e?.activeProviders},availableProviders:{...z.availableProviders,...e?.availableProviders},detectedRoutes:{...z.detectedRoutes,...e?.detectedRoutes},learning:{...z.learning,...e?.learning},metrics:{...R(),...t,providers:{codex:{...L(`codex`),...t.providers?.codex},claude:{...L(`claude`),...t.providers?.claude}}}}}async function V(e){let t=await e.text(),n=t?JSON.parse(t):{};if(!e.ok){let t=n.issue;throw Object.assign(Error(t?.title??n.error??`HTTP ${e.status}`),{payload:n})}return n}function H(e){return`${t}/api/projects/${e}`}function U(e,t=`en`){if(!Number.isFinite(e))return`0`;try{return Intl.NumberFormat(t,{notation:`compact`,maximumFractionDigits:1}).format(Math.max(0,e))}catch{return Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}).format(Math.max(0,e))}}function W(e,t,n){return`${U(e,t)} ${n}`}function G(){let{t:e}=h(`integrations`),{projects:r}=b(),{registerHandler:i,unregisterHandler:a}=x(),[c,l]=(0,j.useState)(``),[f,m]=(0,j.useState)(`all`),[y,S]=(0,j.useState)(z),[C,T]=(0,j.useState)(!0),[E,D]=(0,j.useState)(null),[O,k]=(0,j.useState)([]),[A,re]=(0,j.useState)(!1),[ie,N]=(0,j.useState)(!1),[ae,P]=(0,j.useState)(null),[F,I]=(0,j.useState)({jira:0,serena:0,projects:0}),L=(0,j.useCallback)(async()=>{try{S(B((await fetch(`${t}/api/global-plugins/headroom`).then(e=>V(e))).state))}finally{T(!1)}},[]);(0,j.useEffect)(()=>{L()},[L]),(0,j.useEffect)(()=>(i(`plugins-page`,e=>{let t=e;t.type===`plugin.headroom_progress`&&(t.line&&k(e=>[...e.slice(-80),t.line]),L())}),()=>a(`plugins-page`)),[i,a,L]),(0,j.useEffect)(()=>{let e=!1;async function t(){let t=await Promise.all(r.map(async e=>{let[t,n]=await Promise.all([fetch(`${H(e.id)}/jira/connection`).then(e=>V(e)).catch(()=>({connected:!1})),fetch(`${H(e.id)}/plugins`).then(e=>V(e)).catch(()=>({plugins:[]}))]),r=n.plugins.find(e=>e.name===`serena`);return{jira:+!!t.connected,serena:r&&r.status!==`not-installed`&&r.status!==`orphan`?1:0}}));e||I({jira:t.reduce((e,t)=>e+t.jira,0),serena:t.reduce((e,t)=>e+t.serena,0),projects:r.length})}return t(),()=>{e=!0}},[r]);async function R(e,t){D(e),k([]);try{let e=(await t()).state;e&&S(B(e))}catch(e){let t=e.payload;t?.state&&S(B(t.state))}finally{D(null),L()}}let U=(0,j.useMemo)(()=>[{id:`headroom-ai`,title:`Headroom AI`,scope:`global`,icon:ne,description:e(`plugins.catalog.headroom.description`),installed:y.installed,status:y.lastIssue?`attention`:y.installed?y.activeProviders.codex||y.activeProviders.claude?y.installSource===`system`?`external-active`:`active`:y.installSource===`system`?`external`:`installed`:`available`,statusLabel:y.lastIssue?e(`plugins.status.attention`):y.installed?y.activeProviders.codex||y.activeProviders.claude?y.installSource===`system`?e(`plugins.status.externalActive`):e(`plugins.status.active`):y.installSource===`system`?e(`plugins.status.external`):e(`plugins.status.installed`):e(`plugins.status.available`),actionKind:y.lastIssue?`review`:y.installed?`manage`:`install`,actionLabel:y.lastIssue?e(`plugins.actions.review`):y.installed?e(`plugins.actions.manage`):e(`plugins.actions.install`),busy:E===`install`,action:()=>{if(y.lastIssue||y.installed){re(!0);return}R(`install`,()=>fetch(`${t}/api/global-plugins/headroom/install`,{method:`POST`}).then(e=>V(e)))}}],[y,E,e]),W=(0,j.useMemo)(()=>[{id:`jira`,title:`Jira`,scope:`project`,icon:te,description:e(`plugins.catalog.jira.description`),installed:F.jira>0,status:F.jira>0?`configured`:`available`,statusLabel:F.jira>0?e(`plugins.status.configuredCount`,{count:F.jira}):e(`plugins.status.available`),actionKind:F.jira>0?`manage`:`install`,actionLabel:F.jira>0?e(`plugins.actions.manage`):e(`plugins.actions.install`),action:()=>P(`jira`)},{id:`serena`,title:`Serena`,scope:`project`,icon:o,description:e(`plugins.catalog.serena.description`),installed:F.serena>0,status:F.serena>0?`installed`:`available`,statusLabel:F.serena>0?e(`plugins.status.installedCount`,{count:F.serena}):e(`plugins.status.available`),actionKind:F.serena>0?`manage`:`install`,actionLabel:F.serena>0?e(`plugins.actions.manage`):e(`plugins.actions.install`),action:()=>P(`serena`)}],[F,e]),G=c.trim().toLowerCase(),K=t=>`${t.title} ${t.description} ${t.statusLabel} ${e(`plugins.scope.${t.scope}`)}`.toLowerCase().includes(G),q=[...U,...W].filter(e=>f!==`all`&&e.scope!==f?!1:K(e)),J=q.filter(e=>e.scope===`global`&&e.installed),Y=q.filter(e=>e.scope===`project`&&e.installed),X=q.filter(e=>e.scope===`global`&&!e.installed),Z=q.filter(e=>e.scope===`project`&&!e.installed),Q=J.length>0||Y.length>0,le=X.length>0||Z.length>0,$=[y.installed,F.jira>0,F.serena>0].filter(Boolean).length;return(0,M.jsxs)(`div`,{className:`flex h-full flex-col bg-background`,children:[(0,M.jsxs)(`div`,{className:`border-b border-border px-6 py-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,M.jsx)(`div`,{className:`grid h-9 w-9 place-items-center rounded-lg border border-accent-primary/25 bg-accent-primary/10 text-accent-primary`,children:(0,M.jsx)(v,{className:`h-4 w-4`})}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(`h1`,{className:`text-lg font-semibold tracking-normal`,children:e(`plugins.page.title`)}),(0,M.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:e(`plugins.page.subtitle`)})]}),(0,M.jsxs)(`div`,{className:`mr-12 flex items-center gap-2 rounded-lg border border-border bg-card/60 px-3 py-2 text-xs`,children:[(0,M.jsx)(ee,{className:`h-3.5 w-3.5 text-accent-success`}),(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:e(`plugins.page.readyCount`,{count:$})})]})]}),(0,M.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3 md:flex-row md:items-center`,children:[(0,M.jsxs)(`label`,{className:`relative flex-1`,children:[(0,M.jsx)(p,{className:`pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,M.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:e(`plugins.search.placeholder`),className:`h-9 w-full rounded-lg border border-border bg-background pl-9 pr-3 text-sm outline-none transition-colors focus:border-accent-primary/60`})]}),(0,M.jsx)(`div`,{className:`inline-flex h-9 rounded-lg border border-border bg-card p-1`,children:[`all`,`global`,`project`].map(t=>(0,M.jsx)(`button`,{type:`button`,onClick:()=>m(t),className:w(`rounded-md px-3 text-xs capitalize transition-colors`,f===t?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:e(`plugins.filters.${t}`)},t))})]})]}),(0,M.jsxs)(`div`,{className:`flex-1 overflow-auto px-6 py-5`,children:[(0,M.jsxs)(`section`,{className:`mb-6`,children:[(0,M.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,M.jsx)(d,{className:`h-3.5 w-3.5`}),e(`plugins.sections.installed`)]}),Q?(0,M.jsx)(oe,{globalPlugins:J,projectPlugins:Y}):(0,M.jsx)(se,{text:e(G?`plugins.empty.installedSearch`:`plugins.empty.installed`)})]}),(0,M.jsxs)(`section`,{children:[(0,M.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,M.jsx)(v,{className:`h-3.5 w-3.5`}),e(`plugins.sections.available`)]}),le?(0,M.jsx)(oe,{globalPlugins:X,projectPlugins:Z}):(0,M.jsx)(se,{text:e(G?`plugins.empty.availableSearch`:`plugins.empty.allInstalled`)})]})]}),(0,M.jsx)(s,{open:A,onOpenChange:re,children:(0,M.jsxs)(_,{className:`w-[calc(100vw-2rem)] max-w-xl overflow-x-hidden p-4 sm:p-6`,children:[(0,M.jsxs)(u,{children:[(0,M.jsx)(n,{children:e(`plugins.headroom.title`)}),(0,M.jsx)(g,{children:e(`plugins.headroom.dialogDescription`)})]}),(0,M.jsx)(ce,{state:y,loading:C,busy:E,logs:O,onInstall:()=>R(`install`,()=>fetch(`${t}/api/global-plugins/headroom/install`,{method:`POST`}).then(e=>V(e))),onToggleProvider:(e,n)=>R(`${n?`deactivate`:`activate`}-${e}`,()=>fetch(`${t}/api/global-plugins/headroom/${n?`deactivate`:`activate`}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e})}).then(e=>V(e))),onDeactivateAll:()=>R(`deactivate-all`,async()=>{let e={state:y};for(let n of[`codex`,`claude`])y.activeProviders[n]&&(e=await fetch(`${t}/api/global-plugins/headroom/deactivate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:n})}).then(e=>V(e)));return e}),onUninstall:()=>R(`uninstall`,()=>fetch(`${t}/api/global-plugins/headroom/uninstall`,{method:`POST`}).then(e=>V(e))),onSetPort:e=>R(`port`,()=>fetch(`${t}/api/global-plugins/headroom/port`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({port:e})}).then(e=>V(e))),onOpenDiagnostics:()=>N(!0)})]})}),(0,M.jsx)(ue,{plugin:ae,projects:r,onClose:()=>P(null)}),(0,M.jsx)(pe,{open:ie,onClose:()=>N(!1)})]})}function oe({globalPlugins:e,projectPlugins:t}){let{t:n}=h(`integrations`);return(0,M.jsxs)(`div`,{className:w(`grid grid-cols-1 gap-4`,e.length>0&&t.length>0&&`xl:grid-cols-2`),children:[e.length>0&&(0,M.jsxs)(`section`,{children:[(0,M.jsx)(q,{title:n(`plugins.groups.global.title`),detail:n(`plugins.groups.global.detail`),scope:`global`}),(0,M.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(260px,320px))] justify-start gap-3`,children:e.map(e=>(0,M.jsx)(J,{plugin:e},e.id))})]}),t.length>0&&(0,M.jsxs)(`section`,{children:[(0,M.jsx)(q,{title:n(`plugins.groups.project.title`),detail:n(`plugins.groups.project.detail`),scope:`project`}),(0,M.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(260px,320px))] justify-start gap-3`,children:t.map(e=>(0,M.jsx)(J,{plugin:e},e.id))})]})]})}function se({text:e}){return(0,M.jsx)(`div`,{className:`flex h-[74px] max-w-[320px] items-center rounded-lg border border-dashed border-border bg-card/35 px-3 text-xs text-muted-foreground`,children:e})}function K({scope:e}){let{t}=h(`integrations`);return(0,M.jsx)(`span`,{className:w(`rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wide`,e===`global`?`bg-accent-primary/10 text-accent-primary`:`bg-accent-info/10 text-accent-info`),children:t(`plugins.scope.${e}`)})}function q({title:e,detail:t,scope:n}){return(0,M.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,M.jsx)(`div`,{className:w(`h-px flex-1`,n===`global`?`bg-accent-primary/30`:`bg-accent-info/30`)}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border bg-card/70 px-2 py-1`,children:[(0,M.jsx)(K,{scope:n}),(0,M.jsx)(`span`,{className:`text-xs font-medium`,children:e}),(0,M.jsx)(`span`,{className:`hidden text-[11px] text-muted-foreground sm:inline`,children:t})]}),(0,M.jsx)(`div`,{className:w(`h-px flex-1`,n===`global`?`bg-accent-primary/30`:`bg-accent-info/30`)})]})}function J({plugin:e}){let{t}=h(`integrations`),n=e.icon,r=e.scope===`global`,i=e.status===`attention`,a=e.busy?S:e.actionKind===`install`?k:e.actionKind===`review`?C:m,o=w(`shrink-0 rounded border px-1.5 py-0.5 text-[10px] leading-none`,i?`border-accent-warning/30 bg-accent-warning/10 text-accent-warning`:e.installed?`border-accent-success/25 bg-accent-success/10 text-accent-success`:`border-border bg-muted text-muted-foreground`);return(0,M.jsxs)(`article`,{className:`grid h-[88px] w-full grid-cols-[38px_minmax(0,1fr)_auto] items-center gap-3 rounded-lg border border-border bg-card/70 px-3 transition-colors hover:border-accent-primary/35 hover:bg-card`,children:[(0,M.jsx)(`div`,{className:w(`grid h-[38px] w-[38px] shrink-0 place-items-center rounded-lg border`,r?`border-accent-primary/25 bg-accent-primary/10 text-accent-primary`:`border-accent-info/25 bg-accent-info/10 text-accent-info`),children:(0,M.jsx)(n,{className:`h-4 w-4`})}),(0,M.jsxs)(`div`,{className:`min-w-0`,children:[(0,M.jsx)(`h2`,{className:`truncate text-sm font-semibold leading-5`,children:e.title}),(0,M.jsx)(`p`,{className:`mt-1 truncate text-[11px] leading-4 text-muted-foreground`,children:e.description}),(0,M.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,M.jsx)(K,{scope:e.scope}),(0,M.jsx)(`span`,{className:o,children:e.statusLabel})]})]}),(0,M.jsxs)(`button`,{type:`button`,disabled:e.busy,onClick:e.action,className:`flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-border bg-background px-2.5 text-xs font-medium transition-colors hover:bg-muted disabled:opacity-50`,children:[(0,M.jsx)(a,{className:w(`h-3.5 w-3.5`,e.busy&&`animate-spin`)}),e.busy?t(`plugins.actions.installing`):e.actionLabel]})]})}function ce({state:e,loading:t,busy:n,logs:r,onInstall:i,onToggleProvider:a,onDeactivateAll:o,onUninstall:s,onSetPort:l,onOpenDiagnostics:u}){let{t:d}=h(`integrations`),[f,p]=(0,j.useState)(String(e.port)),[m,g]=(0,j.useState)(!1);(0,j.useEffect)(()=>p(String(e.port)),[e.port]),(0,j.useEffect)(()=>{e.installed||g(!1)},[e.installed]);let _=e.activeProviders.codex||e.activeProviders.claude,v=e.installSource===`system`;return(0,M.jsxs)(`aside`,{className:`w-full min-w-0 overflow-hidden rounded-lg border border-border bg-card/80 p-4`,children:[(0,M.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,M.jsx)(`div`,{className:`grid h-10 w-10 place-items-center rounded-lg border border-accent-primary/25 bg-accent-primary/10 text-accent-primary`,children:(0,M.jsx)(ne,{className:`h-4 w-4`})}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(`h2`,{className:`text-sm font-semibold`,children:d(`plugins.headroom.title`)}),(0,M.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:d(`plugins.headroom.panelDescription`)})]})]}),(0,M.jsxs)(`div`,{className:`mb-4 grid grid-cols-3 gap-2 text-xs`,children:[(0,M.jsx)(Y,{label:d(`plugins.headroom.metrics.install`),value:t?d(`plugins.headroom.metrics.checking`):e.installed?d(`plugins.headroom.metrics.ready`):d(`plugins.headroom.metrics.missing`),good:e.installed}),(0,M.jsx)(Y,{label:d(`plugins.headroom.metrics.source`),value:e.installSource===`system`?d(`plugins.headroom.metrics.system`):e.installSource===`managed`?d(`plugins.headroom.metrics.specrails`):d(`plugins.headroom.metrics.none`),good:e.installed}),(0,M.jsx)(Y,{label:d(`plugins.headroom.metrics.proxy`),value:e.proxyRunning?`:${e.port}`:d(_?`plugins.headroom.metrics.starting`:`plugins.headroom.metrics.off`),good:e.proxyRunning||!_})]}),e.lastIssue&&(0,M.jsx)(X,{issue:e.lastIssue}),e.installed?(0,M.jsxs)(`div`,{className:`mb-4 space-y-2`,children:[(0,M.jsx)($,{provider:`codex`,active:e.activeProviders.codex,available:e.availableProviders.codex,detectedRoute:e.detectedRoutes.codex,busy:n===`activate-codex`||n===`deactivate-codex`,onClick:()=>a(`codex`,e.activeProviders.codex)}),(0,M.jsx)($,{provider:`claude`,active:e.activeProviders.claude,available:e.availableProviders.claude,detectedRoute:e.detectedRoutes.claude,busy:n===`activate-claude`||n===`deactivate-claude`,onClick:()=>a(`claude`,e.activeProviders.claude)}),_&&(0,M.jsxs)(`button`,{type:`button`,disabled:!!n,onClick:o,className:`flex h-8 w-full items-center justify-center gap-2 rounded-lg border border-border bg-background/45 text-xs hover:bg-muted/50 disabled:opacity-50`,children:[n===`deactivate-all`?(0,M.jsx)(S,{className:`h-3.5 w-3.5 animate-spin`}):(0,M.jsx)(re,{className:`h-3.5 w-3.5`}),d(`plugins.headroom.actions.disableAllRoutes`)]})]}):(0,M.jsxs)(`button`,{type:`button`,disabled:!!n,onClick:i,className:`mb-3 flex h-9 w-full items-center justify-center gap-2 rounded-lg bg-accent-primary px-3 text-xs font-medium text-white disabled:opacity-50`,children:[n===`install`?(0,M.jsx)(S,{className:`h-3.5 w-3.5 animate-spin`}):(0,M.jsx)(k,{className:`h-3.5 w-3.5`}),d(`plugins.headroom.actions.installWithUv`)]}),e.installed&&(0,M.jsx)(Z,{state:e}),(0,M.jsxs)(`div`,{className:`mb-4 rounded-lg border border-border bg-background/45 p-3`,children:[(0,M.jsx)(`label`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:d(`plugins.headroom.port.label`)}),(0,M.jsxs)(`div`,{className:`flex gap-2`,children:[(0,M.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),className:`h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 text-sm`}),(0,M.jsx)(`button`,{type:`button`,disabled:!!n||Number(f)===e.port,onClick:()=>l(Number(f)),className:`rounded-md border border-border px-2 text-xs hover:bg-muted disabled:opacity-50`,children:d(`plugins.headroom.port.apply`)})]})]}),r.length>0&&(0,M.jsx)(`pre`,{className:`mb-3 max-h-32 overflow-y-auto overflow-x-hidden whitespace-pre-wrap break-words rounded-lg border border-border bg-background/60 p-2 text-[10px] text-muted-foreground`,children:r.join(`
2
+ `)}),(0,M.jsxs)(`button`,{type:`button`,onClick:u,className:`mb-2 flex h-8 w-full items-center justify-center gap-2 rounded-lg border border-border text-xs hover:bg-muted/50`,children:[(0,M.jsx)(ie,{className:`h-3.5 w-3.5`}),d(`plugins.headroom.actions.viewDiagnostics`)]}),e.installed&&(0,M.jsx)(`div`,{className:`rounded-lg border border-destructive/25 bg-destructive/5 p-3`,children:m?(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:d(v?`plugins.headroom.confirmDetach`:`plugins.headroom.confirmUninstall`)}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,M.jsx)(`button`,{type:`button`,disabled:!!n,onClick:()=>g(!1),className:`h-8 rounded-md border border-border text-xs hover:bg-muted/50 disabled:opacity-50`,children:d(`plugins.actions.cancel`)}),(0,M.jsxs)(`button`,{type:`button`,disabled:!!n,onClick:s,className:`flex h-8 items-center justify-center gap-2 rounded-md bg-destructive px-2 text-xs font-medium text-destructive-foreground disabled:opacity-50`,children:[n===`uninstall`?(0,M.jsx)(S,{className:`h-3.5 w-3.5 animate-spin`}):(0,M.jsx)(c,{className:`h-3.5 w-3.5`}),d(v?`plugins.headroom.actions.detach`:`plugins.headroom.actions.uninstall`)]})]})]}):(0,M.jsxs)(`button`,{type:`button`,disabled:!!n,onClick:()=>g(!0),className:`flex h-8 w-full items-center justify-center gap-2 rounded-md text-xs font-medium text-destructive hover:bg-destructive/10 disabled:opacity-50`,children:[(0,M.jsx)(c,{className:`h-3.5 w-3.5`}),d(v?`plugins.headroom.actions.detachHeadroom`:`plugins.headroom.actions.uninstallHeadroom`)]})})]})}function Y({label:e,value:t,good:n}){return(0,M.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/45 p-2`,children:[(0,M.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:e}),(0,M.jsx)(`div`,{className:w(`mt-0.5 font-medium`,n?`text-foreground`:`text-accent-warning`),children:t})]})}function X({issue:e}){let{t}=h(`integrations`),n=`plugins.headroom.issues.${e.code}`,r=t(`${n}.title`,{defaultValue:e.title}),i=t(`${n}.guidance`,{defaultValue:e.guidance});return(0,M.jsx)(`div`,{className:`mb-3 rounded-lg border border-accent-warning/35 bg-accent-warning/10 p-3`,children:(0,M.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,M.jsx)(C,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-accent-warning`}),(0,M.jsxs)(`div`,{className:`min-w-0`,children:[(0,M.jsx)(`div`,{className:`text-xs font-medium`,children:r}),(0,M.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-muted-foreground`,children:i}),(0,M.jsx)(`div`,{className:`mt-1 text-[10px] text-muted-foreground`,children:t(`plugins.headroom.issueCode`,{code:e.code})})]})]})})}function Z({state:e}){let{t,i18n:n}=h(`integrations`),r=e.metrics,i=r.outputSavingsAvailable,a=[`codex`,`claude`].map(e=>({provider:e,metric:r.providers[e]})),o=t(`plugins.headroom.savings.tokens`),s=a.reduce((e,{metric:t})=>({inputTokens:e.inputTokens+t.inputTokens,inputTokensSaved:e.inputTokensSaved+t.inputTokensSaved,outputTokens:e.outputTokens+t.outputTokens,outputTokensSaved:e.outputTokensSaved+t.outputTokensSaved}),{inputTokens:0,inputTokensSaved:0,outputTokens:0,outputTokensSaved:0}),c=a.some(({metric:e})=>e.inputTokensSaved>0),u=a.some(({metric:e})=>e.active),d=t(i?`plugins.headroom.savings.statusInputOutput`:c?`plugins.headroom.savings.statusInputOnly`:u?`plugins.headroom.savings.statusRouting`:`plugins.headroom.savings.statusInactive`),f=i||c;return(0,M.jsxs)(`div`,{className:`mb-4 rounded-lg border border-border bg-background/45 p-3`,children:[(0,M.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,M.jsx)(l,{className:`h-3.5 w-3.5 text-accent-primary`}),(0,M.jsx)(`div`,{className:`truncate text-xs font-medium`,children:t(`plugins.headroom.savings.title`)})]}),(0,M.jsx)(`span`,{className:w(`shrink-0 rounded border px-1.5 py-0.5 text-[10px]`,f?`border-accent-success/25 bg-accent-success/10 text-accent-success`:u?`border-accent-primary/25 bg-accent-primary/10 text-accent-primary`:`border-border bg-muted text-muted-foreground`),children:d})]}),(0,M.jsxs)(`div`,{className:`mb-2 rounded-md bg-muted/35 px-2.5 py-2`,children:[(0,M.jsx)(`div`,{className:`mb-1.5 text-[10px] font-medium uppercase text-muted-foreground`,children:t(`plugins.headroom.savings.totals`)}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,M.jsx)(Q,{label:t(`plugins.headroom.savings.input`),processed:s.inputTokens>0?W(s.inputTokens,n.language,o):t(`plugins.headroom.savings.noData`),saved:W(s.inputTokensSaved,n.language,o)}),(0,M.jsx)(Q,{align:`right`,label:t(`plugins.headroom.savings.output`),processed:s.outputTokens>0?W(s.outputTokens,n.language,o):t(`plugins.headroom.savings.noData`),saved:i?W(s.outputTokensSaved,n.language,o):t(`plugins.headroom.savings.noData`)})]})]}),(0,M.jsx)(`div`,{className:`grid gap-2`,children:a.map(({provider:e,metric:t})=>(0,M.jsx)(le,{metric:t,outputAvailable:r.outputSavingsAvailable},e))}),(0,M.jsx)(`div`,{className:`mt-2 flex items-center justify-end gap-2 text-[10px] text-muted-foreground`,children:r.updatedAt?t(`plugins.headroom.savings.updatedLive`):t(`plugins.headroom.savings.baselineSamples`,{count:e.learning.baselineSamples})})]})}function Q({label:e,processed:t,saved:n,detail:r,align:i=`left`}){let{t:a}=h(`integrations`);return(0,M.jsxs)(`div`,{className:w(`min-w-0`,i===`right`&&`text-right`),children:[(0,M.jsx)(`div`,{className:`text-[10px] font-medium uppercase text-muted-foreground`,children:e}),(0,M.jsxs)(`div`,{className:`mt-1 space-y-0.5 text-[11px]`,children:[(0,M.jsxs)(`div`,{className:`flex min-w-0 items-baseline justify-between gap-2`,children:[(0,M.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:a(`plugins.headroom.savings.processed`)}),(0,M.jsx)(`span`,{className:`truncate font-semibold tabular-nums text-foreground`,children:t})]}),(0,M.jsxs)(`div`,{className:`flex min-w-0 items-baseline justify-between gap-2`,children:[(0,M.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:a(`plugins.headroom.savings.saved`)}),(0,M.jsx)(`span`,{className:`truncate font-semibold tabular-nums text-foreground`,children:n})]})]}),r&&(0,M.jsx)(`div`,{className:`mt-1 truncate text-[10px] text-muted-foreground`,children:r})]})}function le({metric:e,outputAvailable:t}){let{t:n,i18n:r}=h(`integrations`),i=!e.available,a=i||!e.active,o=n(`plugins.headroom.savings.tokens`),s=e.inputTokens>0?W(e.inputTokens,r.language,o):n(`plugins.headroom.savings.noData`),c=W(e.inputTokensSaved,r.language,o),l=e.outputTokens>0?W(e.outputTokens,r.language,o):n(`plugins.headroom.savings.noData`),u=t?W(e.outputTokensSaved,r.language,o):e.active?n(`plugins.headroom.savings.noData`):n(`plugins.headroom.savings.off`),d=e.requests>0?n(`plugins.headroom.savings.requestCount`,{count:U(e.requests,r.language)}):i?n(`plugins.headroom.provider.noProjectUsesProvider`):e.active?n(`plugins.headroom.savings.inputSavingsActive`):n(`plugins.headroom.savings.routeDisabled`);return(0,M.jsxs)(`div`,{className:w(`rounded-md border border-border bg-card/45 px-2.5 py-2`,a&&`opacity-70`),children:[(0,M.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,M.jsx)(`span`,{className:`text-xs font-medium`,children:e.label}),e.detectedRoute&&(0,M.jsx)(`span`,{className:`rounded bg-accent-primary/10 px-1.5 py-0.5 text-[9px] uppercase text-accent-primary`,children:n(`plugins.headroom.savings.detected`)})]}),(0,M.jsx)(`div`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground`,children:d}),(0,M.jsxs)(`div`,{className:`mt-2 grid grid-cols-2 gap-3`,children:[(0,M.jsx)(Q,{label:n(`plugins.headroom.savings.input`),processed:s,saved:c}),(0,M.jsx)(Q,{align:`right`,label:n(`plugins.headroom.savings.output`),processed:l,saved:u})]})]})}function $({provider:e,active:t,available:n,detectedRoute:r,busy:i,onClick:a}){let{t:o}=h(`integrations`),s=o(n?t?`plugins.headroom.provider.routedThroughHeadroom`:r?`plugins.headroom.provider.detectedExternalRoute`:`plugins.headroom.provider.notRouted`:`plugins.headroom.provider.noProjectUsesProvider`);return(0,M.jsxs)(`button`,{type:`button`,onClick:a,disabled:i||!n,className:`flex w-full items-center gap-3 rounded-lg border border-border bg-background/45 p-3 text-left hover:bg-muted/35 disabled:opacity-50`,children:[(0,M.jsx)(`div`,{className:w(`grid h-8 w-8 place-items-center rounded-md`,t?`bg-accent-success/15 text-accent-success`:`bg-muted text-muted-foreground`),children:i?(0,M.jsx)(S,{className:`h-3.5 w-3.5 animate-spin`}):(0,M.jsx)(A,{className:`h-3.5 w-3.5`})}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(`div`,{className:`text-xs font-medium capitalize`,children:e}),(0,M.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:s})]}),(0,M.jsx)(`span`,{className:w(`h-5 w-9 rounded-full p-0.5 transition-colors`,t?`bg-accent-success`:`bg-muted`),children:(0,M.jsx)(`span`,{className:w(`block h-4 w-4 rounded-full bg-white shadow transition-transform`,t&&`translate-x-4`)})})]})}function ue({plugin:e,projects:t,onClose:r}){let{t:i}=h(`integrations`),[a,o]=(0,j.useState)(``);(0,j.useEffect)(()=>o(``),[e]);let c=t.find(e=>e.id===a)??null;return(0,M.jsx)(s,{open:!!e,onOpenChange:e=>{e||r()},children:(0,M.jsxs)(_,{className:`w-[calc(100vw-2rem)] max-w-3xl overflow-x-hidden p-4 sm:p-6`,children:[(0,M.jsxs)(u,{children:[(0,M.jsx)(n,{children:i(e===`jira`?`plugins.projectWizard.configureJira`:`plugins.projectWizard.installSerena`)}),(0,M.jsx)(g,{children:i(`plugins.projectWizard.description`)})]}),(0,M.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-[260px_minmax(0,1fr)]`,children:[(0,M.jsxs)(`div`,{className:`rounded-lg border border-border bg-card/70 p-3`,children:[(0,M.jsx)(`div`,{className:`mb-2 text-xs font-medium text-muted-foreground`,children:i(`plugins.projectWizard.chooseProject`)}),(0,M.jsx)(`div`,{className:`max-h-[52vh] space-y-1 overflow-auto`,children:t.map(t=>{let n=e===`serena`&&!D(t).includes(`claude`);return(0,M.jsxs)(`button`,{type:`button`,disabled:n,onClick:()=>o(t.id),className:w(`w-full rounded-md px-2 py-2 text-left transition-colors`,t.id===a?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/45 hover:text-foreground`,n&&`cursor-not-allowed opacity-45`),children:[(0,M.jsx)(`div`,{className:`truncate text-xs font-medium`,children:t.name}),(0,M.jsx)(`div`,{className:`truncate text-[10px]`,children:n?i(`plugins.projectWizard.requiresClaudeProvider`):t.path})]},t.id)})})]}),(0,M.jsx)(`div`,{className:`min-h-[360px] rounded-lg border border-border bg-card/70 p-4`,children:c?e===`jira`?(0,M.jsx)(de,{project:c,onDone:r}):(0,M.jsx)(fe,{project:c,onDone:r}):(0,M.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:i(`plugins.projectWizard.selectProjectToContinue`)})})]})]})})}function de({project:e,onDone:t}){let{t:n}=h(`integrations`),r=H(e.id),[i,a]=(0,j.useState)(null),[o,s]=(0,j.useState)(!0),[c,l]=(0,j.useState)(null),u=(0,j.useCallback)(async()=>{s(!0),l(null);try{a(await fetch(`${r}/jira/connection`).then(e=>V(e)))}catch(e){a({connected:!1}),l(e.message)}finally{s(!1)}},[r]);return(0,j.useEffect)(()=>{u()},[u]),o?(0,M.jsxs)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:[(0,M.jsx)(S,{className:`mr-2 h-4 w-4 animate-spin`}),n(`plugins.jira.loading`,{defaultValue:`Loading Jira...`})]}):i?.connected&&i.connection?(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h3`,{className:`text-sm font-semibold`,children:n(`plugins.jira.titleForProject`,{name:e.name,defaultValue:`Jira for ${e.name}`})}),(0,M.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:n(`plugins.jira.configuredDescription`,{defaultValue:`Manage the Jira project, status mapping, discard status, sync, and connection state.`})})]}),(0,M.jsx)(P,{state:i,apiBase:r,onChanged:()=>{u()}})]}):(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h3`,{className:`text-sm font-semibold`,children:n(`plugins.jira.titleForProject`,{name:e.name,defaultValue:`Jira for ${e.name}`})}),(0,M.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:c?n(`plugins.jira.loadFailed`,{message:c,defaultValue:`Could not load the current Jira configuration: ${c}`}):n(`plugins.jira.notConfiguredDescription`,{defaultValue:`Connect this project to Jira.`})})]}),(0,M.jsx)(O,{apiBase:r,onConnected:()=>{u()},onSkip:t})]})}function fe({project:e,onDone:t}){let{t:n}=h(`integrations`),[r,a]=(0,j.useState)(null),[o,s]=(0,j.useState)(null),[c,l]=(0,j.useState)(!1),[u,d]=(0,j.useState)(null),f=(0,j.useCallback)(async()=>{d(null);let t=(await fetch(`${H(e.id)}/plugins`).then(e=>V(e))).plugins.find(e=>e.name===`serena`)??null;a(t),t?.status===`not-installed`&&s(await fetch(`${H(e.id)}/plugins/serena/preview-install`).then(e=>V(e)))},[e.id]);(0,j.useEffect)(()=>{f().catch(e=>d(e.message))},[f]);async function p(){l(!0),d(null);try{await fetch(`${H(e.id)}/plugins/serena/install`,{method:`POST`}).then(e=>V(e)),await f(),t()}catch(e){d(e.message)}finally{l(!1)}}let m=(o?.requirements??[]).every(e=>e.installed&&e.executable&&e.meetsMinimum),g=r?n(`plugins.projectStatus.${r.status}`,{defaultValue:r.status}):``,_=r?.name===`serena`?n(`plugins.catalog.serena.description`):r?.description;return!r&&!u?(0,M.jsxs)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:[(0,M.jsx)(S,{className:`mr-2 h-4 w-4 animate-spin`}),` `,n(`plugins.serena.loading`)]}):(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h3`,{className:`text-sm font-semibold`,children:n(`plugins.serena.titleForProject`,{name:e.name})}),(0,M.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:n(`plugins.serena.description`)})]}),r&&(0,M.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/45 p-3`,children:[(0,M.jsx)(`div`,{className:`text-xs font-medium`,children:n(`plugins.serena.status`,{status:g})}),_&&(0,M.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:_})]}),o&&(0,M.jsxs)(`div`,{className:`space-y-3`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:n(`plugins.serena.files`)}),(0,M.jsx)(`ul`,{className:`space-y-1 text-xs font-mono`,children:o.files.map(e=>(0,M.jsxs)(`li`,{className:e.op===`create`?`text-accent-success`:`text-accent-info`,children:[e.op===`create`?`+ `:`~ `,e.path]},e.path))})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:n(`plugins.serena.prerequisites`)}),(0,M.jsx)(`ul`,{className:`space-y-1 text-xs`,children:o.requirements.map(e=>(0,M.jsxs)(`li`,{className:`flex items-center gap-2`,children:[e.installed&&e.executable&&e.meetsMinimum?(0,M.jsx)(i,{className:`h-3 w-3 text-accent-success`}):(0,M.jsx)(C,{className:`h-3 w-3 text-accent-warning`}),(0,M.jsxs)(`span`,{children:[e.name,e.minVersion?` >= ${e.minVersion}`:``]}),e.version&&(0,M.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.version,`)`]})]},e.name))})]})]}),u&&(0,M.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/10 p-3 text-xs text-destructive`,children:u}),(0,M.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,M.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-md border border-border px-3 py-1.5 text-xs`,children:n(`plugins.actions.cancel`)}),(0,M.jsxs)(`button`,{type:`button`,disabled:c||r?.status!==`not-installed`||!m,onClick:p,className:`flex items-center gap-2 rounded-md bg-accent-primary px-3 py-1.5 text-xs text-white disabled:opacity-50`,children:[c?(0,M.jsx)(S,{className:`h-3.5 w-3.5 animate-spin`}):(0,M.jsx)(k,{className:`h-3.5 w-3.5`}),n(`plugins.actions.install`)]})]})]})}function pe({open:e,onClose:r}){let{t:i}=h(`integrations`),[a,o]=(0,j.useState)(null);return(0,j.useEffect)(()=>{e&&fetch(`${t}/api/global-plugins/headroom/diagnostics`).then(e=>V(e)).then(o).catch(e=>o({error:e.message}))},[e]),(0,M.jsx)(s,{open:e,onOpenChange:e=>{e||r()},children:(0,M.jsxs)(_,{className:`max-w-3xl`,children:[(0,M.jsxs)(u,{children:[(0,M.jsxs)(n,{className:`flex items-center gap-2`,children:[(0,M.jsx)(m,{className:`h-4 w-4`}),` `,i(`plugins.diagnostics.title`)]}),(0,M.jsx)(g,{children:i(`plugins.diagnostics.description`)})]}),(0,M.jsx)(`pre`,{className:`max-h-[62vh] overflow-y-auto overflow-x-hidden whitespace-pre-wrap break-words rounded-lg border border-border bg-background p-3 text-xs`,children:JSON.stringify(a,null,2)})]})})}export{G as default};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-BNv3lrIs.js";import{$ as t,$n as n,At as r,Bt as i,Hn as a,It as o,J as s,Q as c,Rt as l,Vn as u,Wn as d,X as f,Y as p,_ as m,ct as h,dn as g,g as _,h as v,m as y,ot as b,p as x,pt as S,v as C}from"./index-DyY1QyIn.js";var w=a(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),T=e(n(),1),E=S(),D=[{id:`general`,icon:l,labelKey:`projectDialog.nav.general`},{id:`branch`,icon:g,labelKey:`projectDialog.nav.branch`},{id:`environment`,icon:w,labelKey:`projectDialog.nav.environment`},{id:`budget`,icon:r,labelKey:`projectDialog.nav.budget`},{id:`telemetry`,icon:u,labelKey:`projectDialog.nav.telemetry`},{id:`terminal`,icon:o,labelKey:`projectDialog.nav.terminal`}];function O({open:e,onClose:n}){let{t:r}=d(`settings`),{activeProjectId:a,projects:o}=h(),l=o.find(e=>e.id===a),[u,g]=(0,T.useState)(`general`),S=e=>b(`space-y-5`,u===e?``:`hidden`);return(0,E.jsx)(s,{open:e,onOpenChange:e=>{e||n()},children:(0,E.jsxs)(p,{movableResizable:!0,className:`flex max-w-5xl w-[92vw] h-[82vh] flex-col overflow-hidden`,children:[(0,E.jsxs)(c,{children:[(0,E.jsxs)(t,{className:`flex items-center gap-2`,children:[(0,E.jsx)(i,{className:`w-4 h-4`}),l?r(`projectDialog.title`,{name:l.name}):r(`page.title`)]}),(0,E.jsx)(f,{children:r(`projectDialog.description`)})]}),(0,E.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-5 py-2`,children:[(0,E.jsx)(`nav`,{className:`w-40 shrink-0 space-y-0.5 overflow-y-auto border-r border-border pr-2`,children:D.map(e=>{let t=e.icon;return(0,E.jsxs)(`button`,{type:`button`,onClick:()=>g(e.id),className:b(`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs transition-colors`,u===e.id?`bg-accent-primary/15 font-medium text-foreground`:`text-muted-foreground hover:bg-muted/40 hover:text-foreground`),children:[(0,E.jsx)(t,{className:`w-3.5 h-3.5 shrink-0`}),(0,E.jsx)(`span`,{className:`truncate`,children:r(e.labelKey)})]},e.id)})}),(0,E.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-y-auto pr-1`,children:[(0,E.jsx)(`div`,{className:S(`general`),children:(0,E.jsx)(v,{})}),(0,E.jsx)(`div`,{className:S(`branch`),children:(0,E.jsx)(y,{})}),(0,E.jsx)(`div`,{className:S(`environment`),children:(0,E.jsx)(m,{})}),(0,E.jsx)(`div`,{className:S(`budget`),children:(0,E.jsx)(x,{})}),(0,E.jsx)(`div`,{className:S(`telemetry`),children:(0,E.jsx)(_,{})}),(0,E.jsx)(`div`,{className:S(`terminal`),children:(0,E.jsx)(C,{mode:`project`})})]})]})]})})}export{O as ProjectSettingsDialog};
@@ -0,0 +1 @@
1
+ import{t as e}from"./brain-C92rjjYP.js";import{$ as t,A as n,Ft as r,J as i,Nt as a,Q as o,Sn as s,Wn as c,X as l,Y as u,Z as d,Zt as f,at as p,dn as m,pt as h,xn as g}from"./index-DyY1QyIn.js";var _=h(),v={start:f,"ai-step":e,shell:a,decider:m,condition:m,end:r};function y(e){return e.type===`ai-step`?typeof e.data?.prompt==`string`?e.data.prompt:null:e.type===`shell`?typeof e.data?.command==`string`?e.data.command:null:e.type===`decider`?typeof e.data?.goal==`string`?e.data.goal:null:e.type===`end`?e.data?.outcome===`failure`?`failure`:`success`:null}function b({template:a,onClose:f,onUse:m,mode:h=`use`}){let{t:b}=c(`loops`);return(0,_.jsx)(i,{open:a!==null,onOpenChange:e=>{e||f()},children:(0,_.jsx)(u,{movableResizable:!0,className:`max-w-lg`,children:a&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(o,{children:[(0,_.jsxs)(t,{className:`flex items-center gap-2`,children:[(0,_.jsx)(e,{className:`w-4 h-4 text-accent-highlight`}),a.name]}),(0,_.jsx)(l,{children:a.description})]}),(0,_.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[n(a.graph)?(0,_.jsx)(`span`,{title:b(`gallery.needsSpecHint`),className:`px-1.5 py-0.5 rounded text-[10px] bg-accent-secondary/15 text-accent-secondary`,children:b(`gallery.needsSpec`)}):(0,_.jsx)(`span`,{title:b(`gallery.standaloneHint`),className:`px-1.5 py-0.5 rounded text-[10px] bg-accent-success/15 text-accent-success`,children:b(`gallery.standalone`)}),a.category&&(0,_.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-accent-info/15 text-accent-info`,children:b(`categories.${a.category}`,{defaultValue:a.category})}),a.tags.map(e=>(0,_.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-muted text-muted-foreground`,children:e},e))]}),(0,_.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:b(`preview.limits`,{iterations:a.graph.config.maxIterations,timeout:a.graph.config.timeoutMinutes})}),(0,_.jsxs)(`div`,{className:`max-h-[50vh] overflow-y-auto space-y-1.5 pr-1`,children:[(0,_.jsx)(`span`,{className:`block text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:b(`preview.steps`)}),a.graph.nodes.map((e,t)=>{let n=v[e.type]??r,i=y(e);return(0,_.jsxs)(`div`,{className:`rounded border border-border bg-surface/30 p-2`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,_.jsxs)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,_.jsx)(n,{className:`w-3.5 h-3.5 text-accent-primary`}),b(`builder.nodes.${e.type}`)]}),i&&(0,_.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words text-[11px] text-muted-foreground font-mono`,children:i})]},e.id)})]}),(0,_.jsxs)(d,{children:[(0,_.jsx)(p,{variant:`ghost`,onClick:f,children:b(`common:actions.cancel`)}),(0,_.jsxs)(p,{onClick:()=>m(a.id),children:[h===`fork`?(0,_.jsx)(s,{className:`w-3.5 h-3.5 mr-1.5`}):(0,_.jsx)(g,{className:`w-3.5 h-3.5 mr-1.5`}),b(h===`fork`?`actions.fork`:`actions.use`)]})]})]})})})}export{b as n,y as r,v as t};
@@ -1 +1 @@
1
- import{Bn as e}from"./index-OBDI7bHm.js";var t=e(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]);export{t};
1
+ import{Hn as e}from"./index-DyY1QyIn.js";var t=e(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]);export{t};
@@ -1 +1 @@
1
- import{d as e,f as t}from"./index-OBDI7bHm.js";var n=class{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){let n=r=>{this.removeListener(e,n),t(r)};return this.addListener(e,n)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter(e=>e!==t)),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,t){if(e in this.eventListeners){let n=this.eventListeners[e];for(let e of n)e(t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){let n=r=>{this.removeListener(e,n),t(r)};return this.prependListener(e,n)}},r=class{constructor(e){this.pid=e}async write(e){await t(`plugin:shell|stdin_write`,{pid:this.pid,buffer:e})}async kill(){await t(`plugin:shell|kill`,{cmd:`killChild`,pid:this.pid})}},i=class i extends n{constructor(e,t=[],r){super(),this.stdout=new n,this.stderr=new n,this.program=e,this.args=typeof t==`string`?[t]:t,this.options=r??{}}static create(e,t=[],n){return new i(e,t,n)}static sidecar(e,t=[],n){let r=new i(e,t,n);return r.options.sidecar=!0,r}async spawn(){let n=this.program,i=this.args,a=this.options;typeof i==`object`&&Object.freeze(i);let o=new e;return o.onmessage=e=>{switch(e.event){case`Error`:this.emit(`error`,e.payload);break;case`Terminated`:this.emit(`close`,e.payload);break;case`Stdout`:this.stdout.emit(`data`,e.payload);break;case`Stderr`:this.stderr.emit(`data`,e.payload);break}},await t(`plugin:shell|spawn`,{program:n,args:i,options:a,onEvent:o}).then(e=>new r(e))}async execute(){let e=this.program,n=this.args,r=this.options;return typeof n==`object`&&Object.freeze(n),await t(`plugin:shell|execute`,{program:e,args:n,options:r})}};async function a(e,n){await t(`plugin:shell|open`,{path:e,with:n})}export{r as Child,i as Command,n as EventEmitter,a as open};
1
+ import{d as e,f as t}from"./index-DyY1QyIn.js";var n=class{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){let n=r=>{this.removeListener(e,n),t(r)};return this.addListener(e,n)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter(e=>e!==t)),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,t){if(e in this.eventListeners){let n=this.eventListeners[e];for(let e of n)e(t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){let n=r=>{this.removeListener(e,n),t(r)};return this.prependListener(e,n)}},r=class{constructor(e){this.pid=e}async write(e){await t(`plugin:shell|stdin_write`,{pid:this.pid,buffer:e})}async kill(){await t(`plugin:shell|kill`,{cmd:`killChild`,pid:this.pid})}},i=class i extends n{constructor(e,t=[],r){super(),this.stdout=new n,this.stderr=new n,this.program=e,this.args=typeof t==`string`?[t]:t,this.options=r??{}}static create(e,t=[],n){return new i(e,t,n)}static sidecar(e,t=[],n){let r=new i(e,t,n);return r.options.sidecar=!0,r}async spawn(){let n=this.program,i=this.args,a=this.options;typeof i==`object`&&Object.freeze(i);let o=new e;return o.onmessage=e=>{switch(e.event){case`Error`:this.emit(`error`,e.payload);break;case`Terminated`:this.emit(`close`,e.payload);break;case`Stdout`:this.stdout.emit(`data`,e.payload);break;case`Stderr`:this.stderr.emit(`data`,e.payload);break}},await t(`plugin:shell|spawn`,{program:n,args:i,options:a,onEvent:o}).then(e=>new r(e))}async execute(){let e=this.program,n=this.args,r=this.options;return typeof n==`object`&&Object.freeze(n),await t(`plugin:shell|execute`,{program:e,args:n,options:r})}};async function a(e,n){await t(`plugin:shell|open`,{path:e,with:n})}export{r as Child,i as Command,n as EventEmitter,a as open};
@@ -1 +1 @@
1
- import{f as e}from"./index-OBDI7bHm.js";function t(e){if(e!==void 0){if(typeof e==`string`)return e;if(`ok`in e&&`cancel`in e)return{OkCancelCustom:[e.ok,e.cancel]};if(`yes`in e&&`no`in e&&`cancel`in e)return{YesNoCancelCustom:[e.yes,e.no,e.cancel]};if(`ok`in e)return{OkCustom:e.ok}}}async function n(t={}){return typeof t==`object`&&Object.freeze(t),await e(`plugin:dialog|open`,{options:t})}async function r(t={}){return typeof t==`object`&&Object.freeze(t),await e(`plugin:dialog|save`,{options:t})}async function i(n,r){return await e(`plugin:dialog|message`,{message:n,title:r?.title,kind:r?.kind,buttons:t(r?.buttons)})}async function a(e,t){let n=typeof t==`string`?{title:t}:t;return n&&!n.buttons&&n.okLabel&&(n.buttons={ok:n.okLabel}),i(e,n)}async function o(e,t){let n=typeof t==`string`?{title:t}:t,r=n?.okLabel||n?.cancelLabel,a=n?.okLabel??`Yes`;return await i(e,{title:n?.title,kind:n?.kind,buttons:r?{ok:a,cancel:n.cancelLabel??`No`}:`YesNo`})===a}async function s(e,t){let n=typeof t==`string`?{title:t}:t,r=n?.okLabel||n?.cancelLabel,a=n?.okLabel??`Ok`;return await i(e,{title:n?.title,kind:n?.kind,buttons:r?{ok:a,cancel:n.cancelLabel??`Cancel`}:`OkCancel`})===a}export{o as ask,s as confirm,a as message,n as open,r as save};
1
+ import{f as e}from"./index-DyY1QyIn.js";function t(e){if(e!==void 0){if(typeof e==`string`)return e;if(`ok`in e&&`cancel`in e)return{OkCancelCustom:[e.ok,e.cancel]};if(`yes`in e&&`no`in e&&`cancel`in e)return{YesNoCancelCustom:[e.yes,e.no,e.cancel]};if(`ok`in e)return{OkCustom:e.ok}}}async function n(t={}){return typeof t==`object`&&Object.freeze(t),await e(`plugin:dialog|open`,{options:t})}async function r(t={}){return typeof t==`object`&&Object.freeze(t),await e(`plugin:dialog|save`,{options:t})}async function i(n,r){return await e(`plugin:dialog|message`,{message:n,title:r?.title,kind:r?.kind,buttons:t(r?.buttons)})}async function a(e,t){let n=typeof t==`string`?{title:t}:t;return n&&!n.buttons&&n.okLabel&&(n.buttons={ok:n.okLabel}),i(e,n)}async function o(e,t){let n=typeof t==`string`?{title:t}:t,r=n?.okLabel||n?.cancelLabel,a=n?.okLabel??`Yes`;return await i(e,{title:n?.title,kind:n?.kind,buttons:r?{ok:a,cancel:n.cancelLabel??`No`}:`YesNo`})===a}async function s(e,t){let n=typeof t==`string`?{title:t}:t,r=n?.okLabel||n?.cancelLabel,a=n?.okLabel??`Ok`;return await i(e,{title:n?.title,kind:n?.kind,buttons:r?{ok:a,cancel:n.cancelLabel??`Cancel`}:`OkCancel`})===a}export{o as ask,s as confirm,a as message,n as open,r as save};