@truefoundry/trueforge 0.181.0-rc.3 → 0.182.0-rc.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 (244) hide show
  1. package/dist/_frontend/assets/{AgentCodeSnippets-7YBGYKYT-COw5-jCA.js → AgentCodeSnippets-UW7QOW5B-EqgBGDzZ.js} +1 -1
  2. package/dist/_frontend/assets/AgentCodeSnippets-UW7QOW5B-EqgBGDzZ.js.br +0 -0
  3. package/dist/_frontend/assets/AgentCodeSnippets-UW7QOW5B-EqgBGDzZ.js.gz +0 -0
  4. package/dist/_frontend/assets/{AgentMetricChart-ECYBDKGM-DJTSZ671.js → AgentMetricChart-7J5H2YWO-DHIVirW7.js} +1 -1
  5. package/dist/_frontend/assets/AgentMetricChart-7J5H2YWO-DHIVirW7.js.br +0 -0
  6. package/dist/_frontend/assets/AgentMetricChart-7J5H2YWO-DHIVirW7.js.gz +0 -0
  7. package/dist/_frontend/assets/{AgentOverview-NCWC4XDZ-DqZqGo8V.js → AgentOverview-DJEQMQNN-7Xc7Rz5d.js} +1 -1
  8. package/dist/_frontend/assets/AgentOverview-DJEQMQNN-7Xc7Rz5d.js.br +0 -0
  9. package/dist/_frontend/assets/AgentOverview-DJEQMQNN-7Xc7Rz5d.js.gz +0 -0
  10. package/dist/_frontend/assets/{AgentSessionEventTimeline-GSHWZCTN-BrVSrckq.js → AgentSessionEventTimeline-BRNZGBUQ-DMl7_UIg.js} +1 -1
  11. package/dist/_frontend/assets/AgentSessionEventTimeline-BRNZGBUQ-DMl7_UIg.js.br +0 -0
  12. package/dist/_frontend/assets/AgentSessionEventTimeline-BRNZGBUQ-DMl7_UIg.js.gz +0 -0
  13. package/dist/_frontend/assets/{AgentSessionEventTimelineChart-UY4YNTFB-DAeb-1-p.js → AgentSessionEventTimelineChart-ENGQRB2V-M0x25wOo.js} +1 -1
  14. package/dist/_frontend/assets/AgentSessionEventTimelineChart-ENGQRB2V-M0x25wOo.js.br +0 -0
  15. package/dist/_frontend/assets/AgentSessionEventTimelineChart-ENGQRB2V-M0x25wOo.js.gz +0 -0
  16. package/dist/_frontend/assets/AgentSessions-24OZP5GC-GYewquvc.js +1 -0
  17. package/dist/_frontend/assets/AgentSessions-24OZP5GC-GYewquvc.js.br +0 -0
  18. package/dist/_frontend/assets/AgentSessions-24OZP5GC-GYewquvc.js.gz +0 -0
  19. package/dist/_frontend/assets/{ConnectorSettings-DYJ6Z6YL-DhF84SXP.js → ConnectorSettings-OZ3GFHXG-DfSpd_Np.js} +1 -1
  20. package/dist/_frontend/assets/ConnectorSettings-OZ3GFHXG-DfSpd_Np.js.br +0 -0
  21. package/dist/_frontend/assets/ConnectorSettings-OZ3GFHXG-DfSpd_Np.js.gz +0 -0
  22. package/dist/_frontend/assets/{DockLayout-YZPEWKJV-DyDyUCtl.js → DockLayout-PYHG42F6-DVJjU0jJ.js} +1 -1
  23. package/dist/_frontend/assets/{DrawerLayout-OWUKLUSV-DQnh_BPt.js → DrawerLayout-O72FXNZO-BkNx2uHv.js} +2 -2
  24. package/dist/_frontend/assets/DrawerLayout-O72FXNZO-BkNx2uHv.js.br +0 -0
  25. package/dist/_frontend/assets/DrawerLayout-O72FXNZO-BkNx2uHv.js.gz +0 -0
  26. package/dist/_frontend/assets/EnvironmentsPage-NAZBFBQT-SBGlSViD.js +3 -0
  27. package/dist/_frontend/assets/EnvironmentsPage-NAZBFBQT-SBGlSViD.js.br +0 -0
  28. package/dist/_frontend/assets/EnvironmentsPage-NAZBFBQT-SBGlSViD.js.gz +0 -0
  29. package/dist/_frontend/assets/{ModelSettings-Y5NTNBCL-BFS8Ev0r.js → ModelSettings-ZWT7TGFN-BBYWJ3Ta.js} +1 -1
  30. package/dist/_frontend/assets/ModelSettings-ZWT7TGFN-BBYWJ3Ta.js.br +0 -0
  31. package/dist/_frontend/assets/ModelSettings-ZWT7TGFN-BBYWJ3Ta.js.gz +0 -0
  32. package/dist/_frontend/assets/{SandboxSettings-KLDK6WZH-BB_J0XaX.js → SandboxSettings-3WIDF45O-Cxpj-eYN.js} +1 -1
  33. package/dist/_frontend/assets/SandboxSettings-3WIDF45O-Cxpj-eYN.js.br +0 -0
  34. package/dist/_frontend/assets/SandboxSettings-3WIDF45O-Cxpj-eYN.js.gz +0 -0
  35. package/dist/_frontend/assets/SchedulesPage-YEK64CQ6-i-bUCLKe.js +1 -0
  36. package/dist/_frontend/assets/SchedulesPage-YEK64CQ6-i-bUCLKe.js.br +0 -0
  37. package/dist/_frontend/assets/SchedulesPage-YEK64CQ6-i-bUCLKe.js.gz +0 -0
  38. package/dist/_frontend/assets/{SettingsBuilder-72KREKYT-Dmu76Wzi.js → SettingsBuilder-VILEXCSN-D-T9vERO.js} +2 -2
  39. package/dist/_frontend/assets/SettingsBuilder-VILEXCSN-D-T9vERO.js.br +0 -0
  40. package/dist/_frontend/assets/SettingsBuilder-VILEXCSN-D-T9vERO.js.gz +0 -0
  41. package/dist/_frontend/assets/{ShellRouteSync-G2PJ3G3L-C4RD0M9w.js → ShellRouteSync-SBVWQTZG-Bs5nBE4Z.js} +1 -1
  42. package/dist/_frontend/assets/ShellRouteSync-SBVWQTZG-Bs5nBE4Z.js.br +0 -0
  43. package/dist/_frontend/assets/ShellRouteSync-SBVWQTZG-Bs5nBE4Z.js.gz +0 -0
  44. package/dist/_frontend/assets/{SidebarLayout-BWR7N76R-B3Zm0kWX.js → SidebarLayout-JY44CYXN-p3u7KIAo.js} +2 -2
  45. package/dist/_frontend/assets/SidebarLayout-JY44CYXN-p3u7KIAo.js.br +0 -0
  46. package/dist/_frontend/assets/SidebarLayout-JY44CYXN-p3u7KIAo.js.gz +0 -0
  47. package/dist/_frontend/assets/{SkillSettings-F7X7TZII-DYRS-1zQ.js → SkillSettings-K4WJCR62-CNzx6UbS.js} +1 -1
  48. package/dist/_frontend/assets/SkillSettings-K4WJCR62-CNzx6UbS.js.br +0 -0
  49. package/dist/_frontend/assets/SkillSettings-K4WJCR62-CNzx6UbS.js.gz +0 -0
  50. package/dist/_frontend/assets/{TrueForgeUIWithRouter-KPZEEO7D-BAuDAM4m.js → TrueForgeUIWithRouter-OYA7ZHNK-u0Js8wsV.js} +1 -1
  51. package/dist/_frontend/assets/{WebSearchSettings-VNL63UFQ-BL3QLgS_.js → WebSearchSettings-ZGPDUWYH-4OwN9pdf.js} +1 -1
  52. package/dist/_frontend/assets/WebSearchSettings-ZGPDUWYH-4OwN9pdf.js.br +0 -0
  53. package/dist/_frontend/assets/WebSearchSettings-ZGPDUWYH-4OwN9pdf.js.gz +0 -0
  54. package/dist/_frontend/assets/{WidgetLayout-5E2MCZOP-BXKkzHl9.js → WidgetLayout-R4JRDNUC-87iJC6yD.js} +1 -1
  55. package/dist/_frontend/assets/WidgetLayout-R4JRDNUC-87iJC6yD.js.br +0 -0
  56. package/dist/_frontend/assets/WidgetLayout-R4JRDNUC-87iJC6yD.js.gz +0 -0
  57. package/dist/_frontend/assets/{chunk-XIE7TJW5-C05XSTa4.js → chunk-A4CJJLJF-Bw0z3xJ5.js} +1 -1
  58. package/dist/_frontend/assets/chunk-A4CJJLJF-Bw0z3xJ5.js.br +0 -0
  59. package/dist/_frontend/assets/chunk-A4CJJLJF-Bw0z3xJ5.js.gz +0 -0
  60. package/dist/_frontend/assets/{chunk-QYZB5BFZ-C1Zl8SCi.js → chunk-FYNMX2CR-D3kVOgbp.js} +2 -2
  61. package/dist/_frontend/assets/chunk-FYNMX2CR-D3kVOgbp.js.br +0 -0
  62. package/dist/_frontend/assets/chunk-FYNMX2CR-D3kVOgbp.js.gz +0 -0
  63. package/dist/_frontend/assets/{chunk-OB3PAWPO-CDXWnkeP.js → chunk-OB3PAWPO-BlPPT6Yp.js} +1 -1
  64. package/dist/_frontend/assets/chunk-OB3PAWPO-BlPPT6Yp.js.br +0 -0
  65. package/dist/_frontend/assets/chunk-OB3PAWPO-BlPPT6Yp.js.gz +0 -0
  66. package/dist/_frontend/assets/{chunk-NRMAG6HF-BKTcpJl0.js → chunk-U4N5YOLH-DtE2uffK.js} +1 -1
  67. package/dist/_frontend/assets/chunk-U4N5YOLH-DtE2uffK.js.br +0 -0
  68. package/dist/_frontend/assets/chunk-U4N5YOLH-DtE2uffK.js.gz +0 -0
  69. package/dist/_frontend/assets/{chunk-HB2ZQ4CZ-DnCTK9KS.js → chunk-YAEHWUGN-DPMKZDpC.js} +1 -1
  70. package/dist/_frontend/assets/{cssMode-XDzIuvZX.js → cssMode-DvTO9XkN.js} +1 -1
  71. package/dist/_frontend/assets/cssMode-DvTO9XkN.js.br +0 -0
  72. package/dist/_frontend/assets/cssMode-DvTO9XkN.js.gz +0 -0
  73. package/dist/_frontend/assets/{freemarker2-CMM6eRZY.js → freemarker2-aFzp34Uk.js} +1 -1
  74. package/dist/_frontend/assets/freemarker2-aFzp34Uk.js.br +0 -0
  75. package/dist/_frontend/assets/freemarker2-aFzp34Uk.js.gz +0 -0
  76. package/dist/_frontend/assets/{handlebars-zWdybys2.js → handlebars-DAOUiLWh.js} +1 -1
  77. package/dist/_frontend/assets/handlebars-DAOUiLWh.js.br +0 -0
  78. package/dist/_frontend/assets/handlebars-DAOUiLWh.js.gz +0 -0
  79. package/dist/_frontend/assets/{html-FSsE5b6P.js → html-DfXOIhRa.js} +1 -1
  80. package/dist/_frontend/assets/html-DfXOIhRa.js.br +0 -0
  81. package/dist/_frontend/assets/html-DfXOIhRa.js.gz +0 -0
  82. package/dist/_frontend/assets/{htmlMode-Ba0OQ7ke.js → htmlMode-CCOUuXx1.js} +1 -1
  83. package/dist/_frontend/assets/htmlMode-CCOUuXx1.js.br +0 -0
  84. package/dist/_frontend/assets/htmlMode-CCOUuXx1.js.gz +0 -0
  85. package/dist/_frontend/assets/{index-CHtf87eT.js → index-MgP9Dpwg.js} +267 -262
  86. package/dist/_frontend/assets/index-MgP9Dpwg.js.br +0 -0
  87. package/dist/_frontend/assets/index-MgP9Dpwg.js.gz +0 -0
  88. package/dist/_frontend/assets/{index-DJwMhvnU.js → index-c1YEABD8.js} +3 -3
  89. package/dist/_frontend/assets/index-c1YEABD8.js.br +0 -0
  90. package/dist/_frontend/assets/index-c1YEABD8.js.gz +0 -0
  91. package/dist/_frontend/assets/{javascript-Ce1crFvb.js → javascript-Cx1s-OSZ.js} +1 -1
  92. package/dist/_frontend/assets/{jsonMode-BMBeYqZi.js → jsonMode-DAQPJSYx.js} +1 -1
  93. package/dist/_frontend/assets/jsonMode-DAQPJSYx.js.br +0 -0
  94. package/dist/_frontend/assets/jsonMode-DAQPJSYx.js.gz +0 -0
  95. package/dist/_frontend/assets/{liquid-cKR-cSWX.js → liquid-X5sOGYxF.js} +1 -1
  96. package/dist/_frontend/assets/liquid-X5sOGYxF.js.br +0 -0
  97. package/dist/_frontend/assets/liquid-X5sOGYxF.js.gz +0 -0
  98. package/dist/_frontend/assets/{lspLanguageFeatures-RvCvbT7h.js → lspLanguageFeatures-DbaAIvtN.js} +1 -1
  99. package/dist/_frontend/assets/lspLanguageFeatures-DbaAIvtN.js.br +0 -0
  100. package/dist/_frontend/assets/lspLanguageFeatures-DbaAIvtN.js.gz +0 -0
  101. package/dist/_frontend/assets/{mdx-DWyx_s0A.js → mdx-zIgBqqoA.js} +1 -1
  102. package/dist/_frontend/assets/mdx-zIgBqqoA.js.br +0 -0
  103. package/dist/_frontend/assets/mdx-zIgBqqoA.js.gz +0 -0
  104. package/dist/_frontend/assets/{python-BZT89b5u.js → python-B_gBFbpk.js} +1 -1
  105. package/dist/_frontend/assets/python-B_gBFbpk.js.br +0 -0
  106. package/dist/_frontend/assets/python-B_gBFbpk.js.gz +0 -0
  107. package/dist/_frontend/assets/{razor-C4RJ85c7.js → razor-BC7GwqIo.js} +1 -1
  108. package/dist/_frontend/assets/razor-BC7GwqIo.js.br +0 -0
  109. package/dist/_frontend/assets/razor-BC7GwqIo.js.gz +0 -0
  110. package/dist/_frontend/assets/{tsMode-BFOytUIs.js → tsMode-BTgLZVy9.js} +1 -1
  111. package/dist/_frontend/assets/tsMode-BTgLZVy9.js.br +0 -0
  112. package/dist/_frontend/assets/tsMode-BTgLZVy9.js.gz +0 -0
  113. package/dist/_frontend/assets/{typescript-B_aWPfCP.js → typescript-qLW7oNqI.js} +1 -1
  114. package/dist/_frontend/assets/typescript-qLW7oNqI.js.br +0 -0
  115. package/dist/_frontend/assets/typescript-qLW7oNqI.js.gz +0 -0
  116. package/dist/_frontend/assets/{workers-DhT6ONBN.js → workers-ZErPPocS.js} +1 -1
  117. package/dist/_frontend/assets/workers-ZErPPocS.js.br +0 -0
  118. package/dist/_frontend/assets/workers-ZErPPocS.js.gz +0 -0
  119. package/dist/_frontend/assets/{xml-CIXW7ba5.js → xml-B1nIp6O9.js} +1 -1
  120. package/dist/_frontend/assets/xml-B1nIp6O9.js.br +0 -0
  121. package/dist/_frontend/assets/xml-B1nIp6O9.js.gz +0 -0
  122. package/dist/_frontend/assets/{yaml-B06RGyXK.js → yaml-B0Wyc9_Y.js} +1 -1
  123. package/dist/_frontend/assets/yaml-B0Wyc9_Y.js.br +0 -0
  124. package/dist/_frontend/assets/yaml-B0Wyc9_Y.js.gz +0 -0
  125. package/dist/_frontend/index.html +1 -1
  126. package/dist/main.js +805 -294
  127. package/dist/main.js.map +1 -1
  128. package/dist/postgres/migrations/20260831_000001_session_external_id.js.map +1 -1
  129. package/dist/postgres/migrations/20260902_000002_agent_external_id.js.map +1 -1
  130. package/dist/postgres/migrations/20260903_000002_created_by_subject.js.map +1 -1
  131. package/dist/postgres/migrations/20260904_000001_schedule_agent_id.js.map +1 -1
  132. package/dist/postgres/migrations/20260904_000002_session_source.js.map +1 -1
  133. package/dist/postgres/migrations/20260904_000003_session_metadata_gin.js.map +1 -1
  134. package/dist/postgres/migrations/20260926_000001_sandbox_environment.js.map +1 -1
  135. package/dist/postgres/migrations/20260930_000001_sandbox_environment_secret.js.map +1 -1
  136. package/dist/postgres/migrations/20261022_000001_drop_session_last_turn_id.js +16 -0
  137. package/dist/postgres/migrations/20261022_000001_drop_session_last_turn_id.js.map +1 -0
  138. package/dist/postgres/migrations/20261027_000001_access_control.js +21 -0
  139. package/dist/postgres/migrations/20261027_000001_access_control.js.map +1 -0
  140. package/dist/postgres/migrations/20261028_000001_session_tfg_source_backfill.js +21 -0
  141. package/dist/postgres/migrations/20261028_000001_session_tfg_source_backfill.js.map +1 -0
  142. package/dist/postgres/migrations/20261028_000002_session_tfg_source_list_idx.js +29 -0
  143. package/dist/postgres/migrations/20261028_000002_session_tfg_source_list_idx.js.map +1 -0
  144. package/dist/sqlite/migrations/20260831_000001_session_external_id.js.map +1 -1
  145. package/dist/sqlite/migrations/20260902_000001_session_metadata.js.map +1 -1
  146. package/dist/sqlite/migrations/20260902_000002_agent_external_id.js.map +1 -1
  147. package/dist/sqlite/migrations/20260903_000001_drop_agent_metadata.js.map +1 -1
  148. package/dist/sqlite/migrations/20260903_000002_created_by_subject.js.map +1 -1
  149. package/dist/sqlite/migrations/20260904_000001_schedule_agent_id.js.map +1 -1
  150. package/dist/sqlite/migrations/20260904_000002_session_source.js.map +1 -1
  151. package/dist/sqlite/migrations/20260926_000001_sandbox_environment.js.map +1 -1
  152. package/dist/sqlite/migrations/20260930_000001_sandbox_environment_secret.js.map +1 -1
  153. package/dist/sqlite/migrations/20261022_000001_drop_session_last_turn_id.js +22 -0
  154. package/dist/sqlite/migrations/20261022_000001_drop_session_last_turn_id.js.map +1 -0
  155. package/dist/sqlite/migrations/20261027_000001_access_control.js +27 -0
  156. package/dist/sqlite/migrations/20261027_000001_access_control.js.map +1 -0
  157. package/dist/sqlite/migrations/20261028_000001_session_tfg_source_backfill.js +22 -0
  158. package/dist/sqlite/migrations/20261028_000001_session_tfg_source_backfill.js.map +1 -0
  159. package/dist/sqlite/migrations/20261028_000002_session_tfg_source_list_idx.js +31 -0
  160. package/dist/sqlite/migrations/20261028_000002_session_tfg_source_list_idx.js.map +1 -0
  161. package/package.json +4 -4
  162. package/dist/_frontend/assets/AgentCodeSnippets-7YBGYKYT-COw5-jCA.js.br +0 -0
  163. package/dist/_frontend/assets/AgentCodeSnippets-7YBGYKYT-COw5-jCA.js.gz +0 -0
  164. package/dist/_frontend/assets/AgentMetricChart-ECYBDKGM-DJTSZ671.js.br +0 -0
  165. package/dist/_frontend/assets/AgentMetricChart-ECYBDKGM-DJTSZ671.js.gz +0 -0
  166. package/dist/_frontend/assets/AgentOverview-NCWC4XDZ-DqZqGo8V.js.br +0 -0
  167. package/dist/_frontend/assets/AgentOverview-NCWC4XDZ-DqZqGo8V.js.gz +0 -0
  168. package/dist/_frontend/assets/AgentSessionEventTimeline-GSHWZCTN-BrVSrckq.js.br +0 -0
  169. package/dist/_frontend/assets/AgentSessionEventTimeline-GSHWZCTN-BrVSrckq.js.gz +0 -0
  170. package/dist/_frontend/assets/AgentSessionEventTimelineChart-UY4YNTFB-DAeb-1-p.js.br +0 -0
  171. package/dist/_frontend/assets/AgentSessionEventTimelineChart-UY4YNTFB-DAeb-1-p.js.gz +0 -0
  172. package/dist/_frontend/assets/AgentSessions-V2V6W7CC-D1eUhvgn.js +0 -1
  173. package/dist/_frontend/assets/AgentSessions-V2V6W7CC-D1eUhvgn.js.br +0 -0
  174. package/dist/_frontend/assets/AgentSessions-V2V6W7CC-D1eUhvgn.js.gz +0 -0
  175. package/dist/_frontend/assets/ConnectorSettings-DYJ6Z6YL-DhF84SXP.js.br +0 -0
  176. package/dist/_frontend/assets/ConnectorSettings-DYJ6Z6YL-DhF84SXP.js.gz +0 -0
  177. package/dist/_frontend/assets/DrawerLayout-OWUKLUSV-DQnh_BPt.js.br +0 -0
  178. package/dist/_frontend/assets/DrawerLayout-OWUKLUSV-DQnh_BPt.js.gz +0 -0
  179. package/dist/_frontend/assets/EnvironmentsPage-KOMO4W53-DT8-DDE7.js +0 -3
  180. package/dist/_frontend/assets/EnvironmentsPage-KOMO4W53-DT8-DDE7.js.br +0 -0
  181. package/dist/_frontend/assets/EnvironmentsPage-KOMO4W53-DT8-DDE7.js.gz +0 -0
  182. package/dist/_frontend/assets/ModelSettings-Y5NTNBCL-BFS8Ev0r.js.br +0 -0
  183. package/dist/_frontend/assets/ModelSettings-Y5NTNBCL-BFS8Ev0r.js.gz +0 -0
  184. package/dist/_frontend/assets/SandboxSettings-KLDK6WZH-BB_J0XaX.js.br +0 -0
  185. package/dist/_frontend/assets/SandboxSettings-KLDK6WZH-BB_J0XaX.js.gz +0 -0
  186. package/dist/_frontend/assets/SchedulesPage-4F5FX65T-DVKEEd4R.js +0 -1
  187. package/dist/_frontend/assets/SchedulesPage-4F5FX65T-DVKEEd4R.js.br +0 -0
  188. package/dist/_frontend/assets/SchedulesPage-4F5FX65T-DVKEEd4R.js.gz +0 -0
  189. package/dist/_frontend/assets/SettingsBuilder-72KREKYT-Dmu76Wzi.js.br +0 -0
  190. package/dist/_frontend/assets/SettingsBuilder-72KREKYT-Dmu76Wzi.js.gz +0 -0
  191. package/dist/_frontend/assets/ShellRouteSync-G2PJ3G3L-C4RD0M9w.js.br +0 -0
  192. package/dist/_frontend/assets/ShellRouteSync-G2PJ3G3L-C4RD0M9w.js.gz +0 -0
  193. package/dist/_frontend/assets/SidebarLayout-BWR7N76R-B3Zm0kWX.js.br +0 -0
  194. package/dist/_frontend/assets/SidebarLayout-BWR7N76R-B3Zm0kWX.js.gz +0 -0
  195. package/dist/_frontend/assets/SkillSettings-F7X7TZII-DYRS-1zQ.js.br +0 -0
  196. package/dist/_frontend/assets/SkillSettings-F7X7TZII-DYRS-1zQ.js.gz +0 -0
  197. package/dist/_frontend/assets/WebSearchSettings-VNL63UFQ-BL3QLgS_.js.br +0 -0
  198. package/dist/_frontend/assets/WebSearchSettings-VNL63UFQ-BL3QLgS_.js.gz +0 -0
  199. package/dist/_frontend/assets/WidgetLayout-5E2MCZOP-BXKkzHl9.js.br +0 -0
  200. package/dist/_frontend/assets/WidgetLayout-5E2MCZOP-BXKkzHl9.js.gz +0 -0
  201. package/dist/_frontend/assets/chunk-NRMAG6HF-BKTcpJl0.js.br +0 -0
  202. package/dist/_frontend/assets/chunk-NRMAG6HF-BKTcpJl0.js.gz +0 -0
  203. package/dist/_frontend/assets/chunk-OB3PAWPO-CDXWnkeP.js.br +0 -0
  204. package/dist/_frontend/assets/chunk-OB3PAWPO-CDXWnkeP.js.gz +0 -0
  205. package/dist/_frontend/assets/chunk-QYZB5BFZ-C1Zl8SCi.js.br +0 -0
  206. package/dist/_frontend/assets/chunk-QYZB5BFZ-C1Zl8SCi.js.gz +0 -0
  207. package/dist/_frontend/assets/chunk-XIE7TJW5-C05XSTa4.js.br +0 -0
  208. package/dist/_frontend/assets/chunk-XIE7TJW5-C05XSTa4.js.gz +0 -0
  209. package/dist/_frontend/assets/cssMode-XDzIuvZX.js.br +0 -6
  210. package/dist/_frontend/assets/cssMode-XDzIuvZX.js.gz +0 -0
  211. package/dist/_frontend/assets/freemarker2-CMM6eRZY.js.br +0 -0
  212. package/dist/_frontend/assets/freemarker2-CMM6eRZY.js.gz +0 -0
  213. package/dist/_frontend/assets/handlebars-zWdybys2.js.br +0 -0
  214. package/dist/_frontend/assets/handlebars-zWdybys2.js.gz +0 -0
  215. package/dist/_frontend/assets/html-FSsE5b6P.js.br +0 -0
  216. package/dist/_frontend/assets/html-FSsE5b6P.js.gz +0 -0
  217. package/dist/_frontend/assets/htmlMode-Ba0OQ7ke.js.br +0 -0
  218. package/dist/_frontend/assets/htmlMode-Ba0OQ7ke.js.gz +0 -0
  219. package/dist/_frontend/assets/index-CHtf87eT.js.br +0 -0
  220. package/dist/_frontend/assets/index-CHtf87eT.js.gz +0 -0
  221. package/dist/_frontend/assets/index-DJwMhvnU.js.br +0 -0
  222. package/dist/_frontend/assets/index-DJwMhvnU.js.gz +0 -0
  223. package/dist/_frontend/assets/jsonMode-BMBeYqZi.js.br +0 -0
  224. package/dist/_frontend/assets/jsonMode-BMBeYqZi.js.gz +0 -0
  225. package/dist/_frontend/assets/liquid-cKR-cSWX.js.br +0 -0
  226. package/dist/_frontend/assets/liquid-cKR-cSWX.js.gz +0 -0
  227. package/dist/_frontend/assets/lspLanguageFeatures-RvCvbT7h.js.br +0 -0
  228. package/dist/_frontend/assets/lspLanguageFeatures-RvCvbT7h.js.gz +0 -0
  229. package/dist/_frontend/assets/mdx-DWyx_s0A.js.br +0 -0
  230. package/dist/_frontend/assets/mdx-DWyx_s0A.js.gz +0 -0
  231. package/dist/_frontend/assets/python-BZT89b5u.js.br +0 -0
  232. package/dist/_frontend/assets/python-BZT89b5u.js.gz +0 -0
  233. package/dist/_frontend/assets/razor-C4RJ85c7.js.br +0 -0
  234. package/dist/_frontend/assets/razor-C4RJ85c7.js.gz +0 -0
  235. package/dist/_frontend/assets/tsMode-BFOytUIs.js.br +0 -0
  236. package/dist/_frontend/assets/tsMode-BFOytUIs.js.gz +0 -0
  237. package/dist/_frontend/assets/typescript-B_aWPfCP.js.br +0 -0
  238. package/dist/_frontend/assets/typescript-B_aWPfCP.js.gz +0 -0
  239. package/dist/_frontend/assets/workers-DhT6ONBN.js.br +0 -0
  240. package/dist/_frontend/assets/workers-DhT6ONBN.js.gz +0 -0
  241. package/dist/_frontend/assets/xml-CIXW7ba5.js.br +0 -0
  242. package/dist/_frontend/assets/xml-CIXW7ba5.js.gz +0 -0
  243. package/dist/_frontend/assets/yaml-B06RGyXK.js.br +0 -0
  244. package/dist/_frontend/assets/yaml-B06RGyXK.js.gz +0 -0
@@ -1,3 +0,0 @@
1
- import{B as ve}from"./chunk-XIE7TJW5-C05XSTa4.js";import{ae as oe,t as Ne,p as ce,q as me,af as be,r as m,w as je,ag as $,x as de,ah as Q,ai as se,j as e,P as ye,S as ke,E as L,I as B,G as K,F as Ee,aj as we,J as Se,K as Ce,L as ae,M as T,N as Ae,O as P,k as ue,ad as Te,a3 as Z,H as Pe,c as O,R as Be,U as De,V as Le,W as Re,X as _e,Y as Ve,a7 as ze,_ as J,ak as Oe}from"./index-CHtf87eT.js";var Fe="default";function F(t){return t.trim()===Fe}function Ie(t,o){return F(t.name)||!o}function Me(t){const o=(t==null?void 0:t.cpu)??1,n=(t==null?void 0:t.memory)??1,s=(t==null?void 0:t.disk)??3;return`${String(o)} vCPU · ${String(n)} GB RAM · ${String(s)} GB disk`}function Ge(t){var s;if((t==null?void 0:t.networkBlockAll)===!0)return"Blocked";const o=((s=t==null?void 0:t.domainAllowList)==null?void 0:s.trim())??"";if(o.length===0)return"Unrestricted";const n=o.split(",").map(i=>i.trim()).filter(i=>i.length>0).length;return n===0?"Unrestricted":`${String(n)} allowed domain${n===1?"":"s"}`}function ie(){return{name:"",description:"",image:{type:"build",buildScript:""},resources:{cpu:1,memory:1,disk:3},networking:{networkBlockAll:!1}}}function re(t){var o,n,s,i,c,r,l,d;return{name:t.name,description:t.description??"",buildScript:((o=t.image)==null?void 0:o.buildScript)??"",cpu:String(((n=t.resources)==null?void 0:n.cpu)??1),memory:String(((s=t.resources)==null?void 0:s.memory)??1),disk:String(((i=t.resources)==null?void 0:i.disk)??3),networkBlockAll:((c=t.networking)==null?void 0:c.networkBlockAll)===!0,domainAllowList:((r=t.networking)==null?void 0:r.domainAllowList)??"",secrets:((d=(l=t.networking)==null?void 0:l.secrets)==null?void 0:d.map(u=>({...u,hosts:[...u.hosts]})))??[],environmentVariables:Object.entries(t.environmentVariables??{}).map(([u,b])=>({key:u,value:b}))}}function Ue(t){const o=Number(t.cpu),n=Number(t.memory),s=Number(t.disk),i=Object.fromEntries(t.environmentVariables.map(r=>[r.key.trim(),r.value]).filter(([r,l])=>r.length>0&&l.length>0)),c=t.networkBlockAll?void 0:t.secrets.map(r=>({env:r.env.trim(),value:r.value,hosts:r.hosts.map(l=>l.trim()).filter(l=>l.length>0)})).filter(r=>r.env.length>0&&r.value.length>0);return{name:t.name.trim(),...t.description.trim().length===0?{}:{description:t.description.trim()},...t.buildScript.trim().length===0?{}:{image:{type:"build",buildScript:t.buildScript}},resources:{cpu:Number.isFinite(o)&&o>0?o:1,memory:Number.isFinite(n)&&n>0?n:1,disk:Number.isFinite(s)&&s>0?s:3},...Object.keys(i).length===0?{}:{environmentVariables:i},networking:t.networkBlockAll?{networkBlockAll:!0}:{networkBlockAll:!1,...t.domainAllowList.trim().length===0?{}:{domainAllowList:t.domainAllowList.trim()},...c==null||c.length===0?{}:{secrets:c}}}}function He(t){const o=t.name.trim();if(o.length===0)return"Name is required";if(F(o))return'Name "default" is reserved';const n=Number(t.cpu),s=Number(t.memory),i=Number(t.disk);if(!Number.isFinite(n)||n<=0)return"CPU must be a positive number";if(!Number.isFinite(s)||s<=0)return"Memory must be a positive number";if(!Number.isFinite(i)||i<=0)return"Disk must be a positive number";if(!t.networkBlockAll){for(const c of t.secrets)if(c.env.trim().length!==0&&c.value.trim().length===0)return"Secret value is required"}return null}var f="w-full rounded-md border border-border bg-input-box-bg px-2.5 py-1.5 text-sm text-text-primary placeholder:text-text-secondary/70 outline-none focus:border-primary-button-bg",le="text-sm font-medium text-text-primary",z="rounded-lg border border-border p-4 flex flex-col gap-4";function qe({values:t,onChange:o,nameDisabled:n}){const s=i=>o({...t,...i});return e.jsxs("div",{className:"flex flex-col gap-4 pb-8",children:[e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:le,children:"Name"}),e.jsx("input",{className:O(f,n&&"opacity-70"),value:t.name,disabled:n,placeholder:"my-environment",onChange:i=>s({name:i.target.value})})]}),e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:le,children:"Description"}),e.jsx("textarea",{className:O(f,"min-h-20 resize-y"),value:t.description,placeholder:"write description ...",onChange:i=>s({description:i.target.value})})]}),e.jsxs("div",{className:z,children:[e.jsx("h3",{className:"text-sm font-medium text-text-primary",children:"Image And Resources"}),e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsxs("span",{className:"text-xs font-medium text-text-secondary",children:["Build Script (",t.buildScript.length,"/5120)"]}),e.jsx("textarea",{className:O(f,"min-h-24 resize-y font-mono text-xs"),value:t.buildScript,placeholder:`set -ex
2
- pip install httpx
3
- `,onChange:i=>s({buildScript:i.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"CPU"}),e.jsx("input",{className:f,type:"number",min:.1,step:"any",value:t.cpu,placeholder:"type...",onChange:i=>s({cpu:i.target.value})})]}),e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Memory (GB)"}),e.jsx("input",{className:f,type:"number",min:.1,step:"any",value:t.memory,placeholder:"type...",onChange:i=>s({memory:i.target.value})})]}),e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Disk (GB)"}),e.jsx("input",{className:f,type:"number",min:.1,step:"any",value:t.disk,placeholder:"type...",onChange:i=>s({disk:i.target.value})})]})]})]}),e.jsxs("div",{className:z,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-sm font-medium text-text-primary",children:"Environment Variables"}),e.jsx("button",{type:"button",className:"cursor-pointer text-xs font-medium text-text-secondary transition-colors hover:text-text-primary",onClick:()=>s({environmentVariables:[...t.environmentVariables,{key:"",value:""}]}),children:"+ Add Variables"})]}),t.environmentVariables.map((i,c)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e.jsx("input",{className:f,value:i.key,placeholder:"KEY",onChange:r=>{const l=t.environmentVariables.map((d,u)=>u===c?{...d,key:r.target.value}:d);s({environmentVariables:l})}}),e.jsx("input",{className:f,value:i.value,placeholder:"value",onChange:r=>{const l=t.environmentVariables.map((d,u)=>u===c?{...d,value:r.target.value}:d);s({environmentVariables:l})}})]}),e.jsx("button",{type:"button",className:Z({variant:"ghost",size:"icon"}),"aria-label":"Remove environment variable",onClick:()=>s({environmentVariables:t.environmentVariables.filter((r,l)=>l!==c)}),children:e.jsx(B,{name:"trash",className:"size-3.5 text-failure-bg"})})]},c))]}),e.jsxs("div",{className:z,children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm font-medium text-text-primary",children:"Block All Network"}),e.jsx("span",{className:"text-xs text-text-secondary",children:"Overrides the domain allow list"})]}),e.jsx(Oe,{checked:t.networkBlockAll,onCheckedChange:i=>s({networkBlockAll:i}),"aria-label":"Block All Network"})]}),t.networkBlockAll?null:e.jsxs("label",{className:"flex flex-col gap-1.5 pt-1",children:[e.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Domain Allow List"}),e.jsx("input",{className:f,value:t.domainAllowList,placeholder:"api.github.com,api.openai.com",onChange:i=>s({domainAllowList:i.target.value})})]})]}),t.networkBlockAll?null:e.jsxs("div",{className:z,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("h3",{className:"text-sm font-medium text-text-primary",children:"Secrets"}),e.jsxs("span",{className:"text-xs text-text-secondary",children:["Synced immediately with existing sandboxes."," ",e.jsxs("a",{href:"https://trueforge.dev/sandbox#how-changes-reach-a-running-session",target:"_blank",rel:"noreferrer",className:"text-primary-button-bg inline-flex items-center gap-1 hover:underline",children:["Learn more",e.jsx(B,{name:"external-link",className:"size-3"})]})]})]}),e.jsx("button",{type:"button",className:"cursor-pointer text-xs font-medium text-text-secondary transition-colors hover:text-text-primary",onClick:()=>s({secrets:[...t.secrets,{env:"",value:"",hosts:[]}]}),children:"+ Add Secret"})]}),t.secrets.map((i,c)=>e.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-border p-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e.jsx("input",{className:f,value:i.env,placeholder:"ENV_NAME",onChange:r=>{const l=t.secrets.map((d,u)=>u===c?{...d,env:r.target.value}:d);s({secrets:l})}}),e.jsx("input",{className:f,type:"password",value:i.value,placeholder:"value",onChange:r=>{const l=t.secrets.map((d,u)=>u===c?{...d,value:r.target.value}:d);s({secrets:l})}})]}),e.jsx("button",{type:"button",className:Z({variant:"ghost",size:"icon"}),"aria-label":"Remove secret",onClick:()=>s({secrets:t.secrets.filter((r,l)=>l!==c)}),children:e.jsx(B,{name:"trash",className:"size-3.5 text-failure-bg"})})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("input",{className:f,value:i.hosts.join(","),placeholder:"api.github.com,api.openai.com",onChange:r=>{const l=r.target.value.split(",").map(u=>u.trim()),d=t.secrets.map((u,b)=>b===c?{...u,hosts:l}:u);s({secrets:d})}}),e.jsx("span",{className:"text-xs text-text-secondary",children:"Hosts allowed to resolve secret (comma-separated)."})]})]},c))]})]})}function $e({open:t,onOpenChange:o,mode:n,environment:s,onSaved:i}){const c=oe(),r=ce(),l=me(),[d,u]=m.useState(()=>re(ie())),[b,S]=m.useState(!1),[C,y]=m.useState(null);m.useEffect(()=>{if(!t){y(null),S(!1);return}const g=n==="edit"&&s!=null?s.manifest:ie();u(re(g)),y(null)},[t,n,s]);const j=async g=>{g.preventDefault(),y(null);const v=He(d);if(v!=null){y(v);return}S(!0);try{const h=Ue(d),E=n==="create"?await c.createEnvironment({manifest:h}):await c.createOrUpdateEnvironment({manifest:h});l(n==="create"?J.Environment.CREATED:J.Environment.EDITED,{environment_name:E.name,environment_id:E.id}),r==null||r.showSuccess({title:n==="create"?"Environment created":"Environment updated"}),i==null||i(),o(!1)}catch(h){y(de(h,"Failed to save environment")),r==null||r.showError(h)}finally{S(!1)}},R=n==="create"?"New environment":(s==null?void 0:s.name)??"Edit environment";return e.jsx(ze,{open:t,onOpenChange:o,title:R,description:"Configure the environment.",size:"xl",footer:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(L.Secondary,{type:"button",disabled:b,onClick:()=>o(!1),children:"Cancel"}),e.jsx(L.Primary,{type:"submit",form:"environment-form",disabled:b,children:b?"Saving…":n==="create"?"Create":"Save"})]}),children:e.jsxs("form",{id:"environment-form",className:"flex min-h-0 flex-1 flex-col gap-4 px-5 pt-4 pb-10",onSubmit:g=>void j(g),children:[C!=null?e.jsx("p",{className:"text-sm text-failure-bg",children:C}):null,e.jsx(qe,{values:d,onChange:u,nameDisabled:n==="edit"})]})})}var Qe={pending:{label:"Building",variant:"info",icon:"loader"},ready:{label:"Ready",variant:"success",icon:"check"},failed:{label:"Failed",variant:"destructive",icon:"triangle-exclamation"}};function Ke({status:t,statusReason:o}){const n=Qe[t],s=e.jsxs(ve,{variant:n.variant,shape:"rounded",size:"sm",children:[e.jsx(B,{name:n.icon,className:n.icon==="loader"?"size-3.5 shrink-0 animate-spin":"size-3.5 shrink-0"}),n.label]});return t==="failed"&&o!=null&&o.length>0?e.jsx(ue,{content:o,children:s}):s}var Ye=[10,25],Ze=1e4;function Y(t){return Math.min(Math.max(t,1),25)}function et(t){const o=oe(),n=Ne(),s=ce(),i=me(),{canCreateSandboxEnvironment:c,loading:r}=be(),[l,d]=m.useState([]),{allows:u}=je({resourceType:"sandbox_environment",resourceIds:l.map(a=>a.id)}),[b,S]=m.useState(!0),[C,y]=m.useState(null),[j,R]=m.useState(()=>$(window.location.search).q??""),[g,v]=m.useState({kind:"closed"}),[h,E]=m.useState(null),[I,W]=m.useState(!1),[w,xe]=m.useState(()=>Y(Ve)),[_,D]=m.useState(void 0),[M,X]=m.useState(void 0),[G,U]=m.useState(void 0),V=m.useRef(0),ee=m.useRef(!1),te=m.useRef((n==null?void 0:n.settingsOpen)??!1),H=(n==null?void 0:n.settingsOpen)??!1,A=m.useCallback(async({token:a,size:x,silent:k=!1})=>{const N=++V.current;k||(S(!0),y(null));try{const p=await o.listEnvironments({limit:Y(x),...a===void 0||a===""?{}:{pageToken:a}});if(N!==V.current)return;d(p.data),X(p.nextPageToken),U(p.previousPageToken)}catch(p){if(N!==V.current)return;k||(y(de(p,"Check your connection and try again.")),d([]),X(void 0),U(void 0))}finally{N===V.current&&!k&&S(!1)}},[o]);m.useEffect(()=>{Q({q:j.trim().length===0?null:j})},[j]),m.useEffect(()=>{A({token:_,size:w})},[A,w,_]),m.useEffect(()=>{te.current&&!H&&A({token:_,size:w}),te.current=H},[H,A,_,w]),m.useEffect(()=>{const a=l.filter(k=>k.status==="pending");if(a.length===0)return;const x=window.setInterval(async()=>{try{const N=(await Promise.all(a.map(p=>o.getEnvironment({name:p.name}).catch(()=>null)))).filter(p=>p!=null);if(N.length===0)return;d(p=>p.map(ne=>N.find(ge=>ge.name===ne.name)??ne)),N.some(p=>p.status!=="pending")&&(n==null||n.invalidateEnvironmentsList())}catch{}},Ze);return()=>window.clearInterval(x)},[l,o,n]),m.useEffect(()=>{if(r)return;const a=$(window.location.search);if(!ee.current&&a.isNew){ee.current=!0,Q({isNew:null}),v(c?{kind:"create"}:x=>x.kind==="create"?{kind:"closed"}:x);return}c||v(x=>x.kind==="create"?{kind:"closed"}:x)},[c,r]),m.useEffect(()=>{const a=()=>{const x=$(window.location.search);R(x.q??""),x.isNew&&(r||(Q({isNew:null}),c&&v({kind:"create"})))};return window.addEventListener(se,a),()=>window.removeEventListener(se,a)},[c,r]);const q=m.useMemo(()=>{const a=j.trim().toLowerCase();return a.length===0?l:l.filter(x=>x.name.toLowerCase().includes(a)||x.description.toLowerCase().includes(a))},[l,j]),pe=M!=null||G!=null||l.length>0,he=()=>{c&&v({kind:"create"})},fe=async()=>{if(h!=null){W(!0);try{await o.deleteEnvironment({name:h.name}),i(J.Environment.DELETED,{environment_name:h.name,environment_id:h.id}),s==null||s.showSuccess({title:"Environment deleted"}),E(null),D(void 0),n==null||n.invalidateEnvironmentsList(),A({token:void 0,size:w})}catch(a){s==null||s.showError(a)}finally{W(!1)}}};return e.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-primary-bg",children:[e.jsx(ye,{title:"Environments",end:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-64",children:e.jsx(ke,{query:j,setQuery:R,placeholder:"Search environments by name"})}),e.jsxs(L.Primary,{type:"button",onClick:he,disabled:!c,children:[e.jsx(B,{name:"plus",className:"size-3.5"}),"New Environment"]})]})}),e.jsx("div",{className:O("min-h-0 flex-1 overflow-auto px-4 py-4",C!=null?"flex flex-col":void 0),children:C!=null?e.jsx("div",{role:"alert",className:"flex flex-1 flex-col items-center justify-center",children:e.jsx(K,{title:"Couldn't load environments",description:C,className:"h-auto min-h-0 flex-none py-0"})}):b?e.jsx("div",{className:"flex flex-col gap-2",role:"status","aria-label":"Loading environments",children:Array.from({length:5},(a,x)=>e.jsx(Ee,{className:"h-12 w-full rounded-md"},x))}):l.length===0?e.jsx(K,{title:"No environments yet",description:"Create an environment to customize sandbox images, resources, and networking.",className:"min-h-full"}):q.length===0?e.jsx(K,{title:"No environments found",description:e.jsxs(e.Fragment,{children:["No environments match ",e.jsx(we,{children:j.trim()}),"."]}),className:"min-h-full"}):e.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[e.jsxs(Se,{className:"min-w-240",children:[e.jsx(Ce,{children:e.jsxs(ae,{className:"hover:bg-transparent",children:[e.jsx(T,{className:"w-96 max-w-96",children:"Name"}),e.jsx(T,{children:"Build Status"}),e.jsx(T,{children:"Resources"}),e.jsx(T,{children:"Networking"}),e.jsx(T,{children:"Updated"}),e.jsx(T,{className:"w-16"})]})}),e.jsx(Ae,{children:q.map(a=>{const x=!F(a.name)&&u(a.id,"MANAGE"),k=!F(a.name)&&u(a.id,"DELETE"),N=Ie(a,x);return e.jsxs(ae,{className:N?void 0:"cursor-pointer",onClick:()=>{x&&v({kind:"edit",environment:a})},children:[e.jsx(P,{className:"w-96 max-w-96",children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"truncate font-medium text-text-primary",children:a.name}),a.description.length>0?e.jsx(ue,{content:a.description,className:"max-w-sm whitespace-normal text-left",triggerClassName:"block min-w-0 w-full max-w-full",children:e.jsx("span",{className:"block truncate text-xs text-text-secondary",children:a.description})}):null]})}),e.jsx(P,{children:e.jsx(Ke,{status:a.status,statusReason:a.statusReason})}),e.jsx(P,{className:"text-sm text-text-secondary",children:Me(a.manifest.resources)}),e.jsx(P,{className:"text-sm text-text-secondary",children:Ge(a.manifest.networking)}),e.jsx(P,{className:"text-sm text-text-secondary",children:N?"—":Te(a.updatedAt)}),e.jsx(P,{children:k?e.jsx("button",{type:"button",className:Z({variant:"ghost",size:"icon"}),"aria-label":`Delete ${a.name}`,onClick:p=>{p.stopPropagation(),E(a)},children:e.jsx(B,{name:"trash",className:"size-3.5 text-failure-bg"})}):null})]},a.id)})})]}),pe?e.jsx(Pe,{pageSize:w,rowCount:q.length,canPrev:G!=null,canNext:M!=null,onPrev:()=>D(G),onNext:()=>D(M),pageSizeOptions:Ye,onPageSizeChange:a=>{xe(Y(a)),D(void 0),U(void 0)}}):null]})}),e.jsx($e,{open:g.kind!=="closed",mode:g.kind==="edit"?"edit":"create",...g.kind==="edit"?{environment:g.environment}:{},onOpenChange:a=>{a||v({kind:"closed"})},onSaved:()=>{D(void 0),n==null||n.invalidateEnvironmentsList(),A({token:void 0,size:w})}}),e.jsx(Be,{open:h!=null,onOpenChange:a=>!a&&E(null),children:e.jsxs(De,{children:[e.jsx(Le,{children:e.jsx(Re,{children:"Delete environment"})}),e.jsxs("p",{className:"text-sm text-text-secondary",children:["Delete ",e.jsx("span",{className:"font-medium text-text-primary",children:h==null?void 0:h.name}),"? This cannot be undone. Delete fails if any agent still references the environment."]}),e.jsxs(_e,{children:[e.jsx(L.Secondary,{type:"button",disabled:I,onClick:()=>E(null),children:"Cancel"}),e.jsx(L.Primary,{type:"button",disabled:I,onClick:()=>void fe(),children:I?"Deleting…":"Delete"})]})]})})]})}export{et as EnvironmentsPage,Ze as PENDING_ENVIRONMENTS_POLL_INTERVAL_MS};
@@ -1 +0,0 @@
1
- import{B as st}from"./chunk-XIE7TJW5-C05XSTa4.js";import{l as ye,o as Oe,p as ve,q as Me,t as $e,v as nt,r as o,w as be,x as at,y as Re,z as Se,A as rt,j as e,P as lt,S as it,B as me,C as Be,D as Ue,E as L,I as A,F as ot,G as he,H as Pe,J as ct,K as dt,L as De,M as V,N as ut,O as W,k as Ge,Q as mt,c as O,R as xt,U as ht,V as ft,W as gt,X as bt,Y as pt,Z as Nt,_ as K,$ as jt,a0 as yt,u as vt,a1 as St,a2 as fe,a3 as kt,a4 as wt,a5 as Tt,a6 as Ct,a7 as Et,a8 as zt,a9 as At,aa as ge,ab as Rt,ac as Pt,ad as Dt}from"./index-CHtf87eT.js";var Ie=[{value:"America/New_York",label:"America/New_York (ET)"},{value:"America/Chicago",label:"America/Chicago (CT)"},{value:"America/Denver",label:"America/Denver (MT)"},{value:"America/Los_Angeles",label:"America/Los_Angeles (PT)"},{value:"UTC",label:"UTC"},{value:"Europe/London",label:"Europe/London (GMT/BST)"},{value:"Europe/Berlin",label:"Europe/Berlin (CET)"},{value:"Asia/Kolkata",label:"Asia/Kolkata (IST)"},{value:"Asia/Tokyo",label:"Asia/Tokyo (JST)"}];function He(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function It(t){const n=He(),r=new Set(Ie.map(l=>l.value));return[...[n,t].flatMap(l=>l==null||l.length===0||r.has(l)?[]:(r.add(l),[{value:l,label:l===n?`${l} (Local)`:l}])),...Ie]}var qe=[{value:1,label:"Mon"},{value:2,label:"Tue"},{value:3,label:"Wed"},{value:4,label:"Thu"},{value:5,label:"Fri"},{value:6,label:"Sat"},{value:0,label:"Sun"}],Ft={"America/New_York":"ET","America/Chicago":"CT","America/Denver":"MT","America/Los_Angeles":"PT",UTC:"UTC","Europe/London":"GMT","Europe/Berlin":"CET","Asia/Kolkata":"IST","Asia/Tokyo":"JST"};function xe(){return{name:"",task:"",recurrence:"daily",hour:9,minute:0,weekdays:[1],customCron:"0 9 * * *",timezone:He()}}function _t(t){return Ft[t]??t.split("/").pop()??t}function Ve(t){return t.toString().padStart(2,"0")}function ce({hour:t,minute:n}){const r=t>=12?"PM":"AM",a=t%12===0?12:t%12;return`${String(a)}:${Ve(n)} ${r}`}function pe(t){const n=t.minute,r=t.hour;switch(t.recurrence){case"hourly":return`${String(n)} * * * *`;case"daily":return`${String(n)} ${String(r)} * * *`;case"weekly":{const a=[...t.weekdays].sort((c,v)=>c-v),l=a.length>0?a.join(","):"*";return`${String(n)} ${String(r)} * * ${l}`}case"custom":return t.customCron.trim()}}function Ne(t){return t.trim().split(/\s+/).length===5}function ae(t){const n=_t(t.timezone),r=t.cron.trim().split(/\s+/);if(r.length!==5)return t.cron;const[a,l,c,v,g]=r;if(c!=="*"||v!=="*")return t.cron;const d=Number(a),x=Number(l);if(l==="*"&&g==="*"&&a!==void 0&&!Number.isNaN(d))return`Hourly at :${Ve(d)} ${n}`;if(g==="*"&&l!==void 0&&a!==void 0&&!Number.isNaN(x)&&!Number.isNaN(d))return`Daily ${ce({hour:x,minute:d})} ${n}`;if(g==="1-5"&&l!==void 0&&a!==void 0&&!Number.isNaN(x)&&!Number.isNaN(d))return`Weekdays ${ce({hour:x,minute:d})} ${n}`;if(g!=null&&/^\d(?:,\d)*$/.test(g)&&l!==void 0&&a!==void 0&&!Number.isNaN(x)&&!Number.isNaN(d)){const N=g.split(",").map(h=>{var k;return((k=qe.find(b=>b.value===Number(h)))==null?void 0:k.label)??h});return N.length===1?`Every ${N[0]==="Mon"?"Monday":N[0]} ${ce({hour:x,minute:d})} ${n}`:`${N.join(", ")} ${ce({hour:x,minute:d})} ${n}`}return t.cron}function Fe(t){const n=xe(),r=t.cron.trim().split(/\s+/);if(r.length!==5)return{...n,name:t.name,task:t.task,timezone:t.timezone,recurrence:"custom",customCron:t.cron};const[a,l,c,v,g]=r,d=Number(a),x=Number(l);return c!=="*"||v!=="*"?{...n,name:t.name,task:t.task,timezone:t.timezone,recurrence:"custom",customCron:t.cron}:l==="*"&&g==="*"&&!Number.isNaN(d)?{...n,name:t.name,task:t.task,timezone:t.timezone,recurrence:"hourly",minute:d,customCron:t.cron}:g==="*"&&!Number.isNaN(x)&&!Number.isNaN(d)?{...n,name:t.name,task:t.task,timezone:t.timezone,recurrence:"daily",hour:x,minute:d,customCron:t.cron}:g!=null&&/^\d(?:,\d)*$/.test(g)&&!Number.isNaN(x)&&!Number.isNaN(d)?{...n,name:t.name,task:t.task,timezone:t.timezone,recurrence:"weekly",hour:x,minute:d,weekdays:g.split(",").map(Number),customCron:t.cron}:{...n,name:t.name,task:t.task,timezone:t.timezone,recurrence:"custom",customCron:t.cron,hour:Number.isNaN(x)?n.hour:x,minute:Number.isNaN(d)?n.minute:d}}function Lt(t,n=Date.now()){return Dt(t,{fallback:"Never",nowMs:n})}var Ot=[{value:"hourly",label:"Hourly"},{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"custom",label:"Custom"}],Mt=Array.from({length:24},(t,n)=>({value:String(n),label:n.toString().padStart(2,"0")})),$t=[0,15,30,45].map(t=>({value:String(t),label:`:${t.toString().padStart(2,"0")}`}));function Bt({values:t,onChange:n,agentId:r,agentLabel:a,onAgentIdChange:l,onAgentPicked:c,agentPickerDisabled:v=!1,onBuildAgent:g}){const d=pe(t),x=ae({cron:d,timezone:t.timezone}),N=It(t.timezone),h=(i,j)=>{n({...t,[i]:j})},k=i=>{const j=i==="custom"&&t.recurrence!=="custom"?d:t.customCron;n({...t,recurrence:i,customCron:j})},b=i=>{const C=t.weekdays.includes(i)?t.weekdays.filter(m=>m!==i):[...t.weekdays,i];n({...t,weekdays:C.length>0?C:[i]})};return e.jsxs("div",{className:"flex flex-col gap-4 px-5 py-4",children:[e.jsxs("div",{className:"block",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-medium",children:"Agent"}),e.jsx(Be,{"aria-label":"Agent",placeholder:"Search agent",value:r,selectedLabel:a,onValueChange:i=>l==null?void 0:l(i),onAgentPicked:c,disabled:v||l==null,onBuildAgent:g})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-medium",children:"Name"}),e.jsx("input",{value:t.name,onChange:i=>h("name",i.target.value),placeholder:"harness-daily-digest",className:ge("h-8"),required:!0})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-medium",children:"Task"}),e.jsx("textarea",{value:t.task,onChange:i=>h("task",i.target.value),rows:3,placeholder:"Summarise yesterday's harness runs and post the digest…",className:ge("resize-y py-2"),required:!0})]}),e.jsxs("fieldset",{children:[e.jsx("legend",{className:"mb-1.5 text-sm font-medium",children:"Frequency"}),e.jsx("div",{className:"rounded-t-lg border border-border p-4",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"grid grid-cols-4 gap-1 rounded-lg border border-border bg-primary-bg p-1",children:Ot.map(i=>{const j=t.recurrence===i.value;return e.jsx("button",{type:"button",className:O("rounded-md border px-2 py-2 text-sm font-medium transition-colors",j?"border-primary-button-bg/40 bg-primary-button-bg/10 font-semibold text-primary-button-bg":"border-transparent text-text-secondary hover:bg-ghost-button-hover"),"aria-pressed":j,onClick:()=>k(i.value),children:i.label},i.value)})}),t.recurrence==="custom"?e.jsxs("div",{className:"block",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-medium",children:"Cron expression"}),e.jsx("input",{"aria-label":"Cron expression",value:t.customCron,onChange:i=>h("customCron",i.target.value),placeholder:"0 */4 * * *",spellCheck:!1,"aria-invalid":!Ne(t.customCron),className:O(ge("h-8"),"font-mono")}),e.jsx("span",{className:"mt-1 block text-xs text-text-secondary",children:"minute hour day-of-month month day-of-week. Runs must be at least 1 hour apart."}),Ne(t.customCron)?null:e.jsx("span",{className:"mt-1 block text-xs text-failure-bg",children:"Enter exactly 5 space-separated fields."})]}):null,t.recurrence==="weekly"?e.jsxs("fieldset",{children:[e.jsx("legend",{className:"mb-2 text-sm font-medium",children:"Days"}),e.jsx("div",{className:"flex gap-2",children:qe.map(i=>{const j=t.weekdays.includes(i.value);return e.jsx("button",{type:"button",className:O("min-w-0 flex-1 rounded-md border px-3 py-2 text-[0.8125rem] font-medium",j?"border-primary-button-bg/40 bg-primary-button-bg/10 font-semibold text-primary-button-bg":"border-border text-text-secondary hover:bg-ghost-button-hover"),"aria-pressed":j,onClick:()=>b(i.value),children:i.label},i.value)})})]}):null,e.jsxs("div",{className:"flex gap-4",children:[t.recurrence==="daily"||t.recurrence==="weekly"?e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-medium",children:"Hour"}),e.jsx(me,{"aria-label":"Hour",value:String(t.hour),options:Mt,onValueChange:i=>h("hour",Number(i))})]}):null,t.recurrence!=="custom"?e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-medium",children:"Minute"}),e.jsx(me,{"aria-label":"Minute",value:String(t.minute),options:$t,onValueChange:i=>h("minute",Number(i))})]}):null,e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-medium",children:"Timezone"}),e.jsx(me,{"aria-label":"Timezone",value:t.timezone,options:N,onValueChange:i=>h("timezone",i),menuClassName:"w-full min-w-0"})]})]})]})}),e.jsx("div",{className:"rounded-b-lg border border-t-0 border-border bg-primary-button-bg/10 px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(A,{name:"clock",className:"size-4 shrink-0 text-primary-button-bg"}),e.jsx("span",{className:"shrink-0 text-xs font-medium text-text-secondary",children:"Schedule"}),e.jsx("p",{className:"min-w-0 flex-1 truncate text-sm text-text-primary",children:x||"—"}),e.jsx("code",{className:"shrink-0 whitespace-nowrap font-mono text-[0.8125rem] font-bold text-text-secondary",children:d||"—"})]})})]})]})}function Ut(t){return t.startsWith("manual-")}function Gt(t){return t==="failed"?"failed":"success"}function We(t){return t==="failed"?"Failed":t==="triggered"?"Triggered":"Scheduled"}function Ke(t){return Ut(t)?"Manual test":"Cron"}function Ht(t,n=5){return t.filter(a=>a.status!=="scheduled").slice(0,n).reverse()}function je(t){if(t==null)return"—";const n=new Date(t);return Number.isNaN(n.getTime())?"—":zt(n)}function qt({run:t}){return e.jsxs("div",{className:"flex flex-col gap-1 text-left text-xs",children:[e.jsx("p",{className:"text-text-primary font-medium",children:We(t.status)}),e.jsx("p",{className:"text-text-secondary",children:Ke(t.name)}),e.jsxs("p",{className:"text-text-secondary",children:["Scheduled for: ",je(t.scheduledFor)]}),t.triggeredAt!=null?e.jsxs("p",{className:"text-text-secondary",children:["Triggered at: ",je(t.triggeredAt)]}):null,e.jsxs("p",{className:"text-text-secondary",children:["Triggered by: ",t.triggeredBy]}),t.status==="failed"&&t.reason?e.jsxs("p",{className:"text-text-secondary",children:["Reason: ",t.reason]}):null]})}var Vt={success:"border-emerald-600/30 bg-emerald-500/10 text-emerald-700 dark:border-emerald-400/35 dark:bg-emerald-500/15 dark:text-emerald-300",failed:"border-red-600/30 bg-red-500/10 text-red-700 dark:border-red-400/35 dark:bg-red-500/15 dark:text-red-300"};function Qe({run:t,onOpenSession:n}){const r=Gt(t.status),a=je(t.triggeredAt??t.scheduledFor),l=`${We(t.status)} run at ${a}`,c=O("inline-flex size-6 shrink-0 items-center justify-center rounded-md border",Vt[r]),v=e.jsx(A,{name:r==="failed"?"triangle-exclamation":"check",className:"size-3.5"});return e.jsx(Ge,{content:e.jsx(qt,{run:t}),className:"max-w-sm whitespace-normal",side:"top",children:n!=null&&t.sessionId!=null&&t.sessionId!==""?e.jsx("button",{type:"button",className:O(c,"cursor-pointer hover:brightness-95"),"aria-label":`Open session for ${l}`,onClick:()=>n(t),children:v}):e.jsx("span",{className:c,"aria-label":l,children:v})})}function Ye({status:t}){const n=t==="active";return e.jsx(st,{variant:n?"success":"warning",shape:"pill",size:"md",dot:!0,children:n?"Active":"Paused"})}function Wt(t,n){return t.find(r=>r.name===n||r.id===n)??null}function Kt({connector:t,onConnected:n}){return Rt()==null?null:e.jsx(Pt,{connector:t,onConnected:n})}function ne({label:t,children:n}){return e.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-border px-3 py-2.5 last:border-b-0",children:[e.jsx("span",{className:"text-text-secondary shrink-0 text-[10px] font-semibold tracking-wide uppercase",children:t}),e.jsx("div",{className:"min-w-0 text-right text-sm text-text-primary",children:n})]})}function Qt({schedule:t,agentName:n,mcpMounts:r,onEditConfiguration:a}){const l=ye(),c=ve(),{connectors:v,ensureLoaded:g,refreshConnectors:d,loading:x,error:N}=At(),[h,k]=o.useState(!1),[b,i]=o.useState(null),j=ae({cron:t.cron,timezone:t.timezone}),C=async()=>{k(!0);try{const m=await l.createScheduleRun({scheduleId:t.id});i(m),c==null||c.showSuccess({title:"Test run started"})}catch(m){c==null||c.showError(m)}finally{k(!1)}};return o.useEffect(()=>{g()},[g]),o.useEffect(()=>{N!=null&&(c==null||c.showError(N))},[N,c]),e.jsxs("div",{className:"flex flex-col gap-4 px-5 py-4",children:[e.jsxs("section",{className:"overflow-hidden rounded-lg border border-border bg-card-bg",children:[e.jsx(ne,{label:"Agent",children:n}),e.jsx(ne,{label:"Name",children:t.name}),e.jsx(ne,{label:"Status",children:e.jsx(Ye,{status:t.status})}),e.jsx(ne,{label:"Task",children:e.jsx("span",{className:"whitespace-pre-wrap break-words",children:t.task})}),e.jsx(ne,{label:"Frequency",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-1.5",children:[e.jsx("span",{children:j}),e.jsx("code",{className:"text-text-secondary font-mono text-xs",children:t.cron})]})}),e.jsx("div",{className:"flex justify-end px-3 py-2.5",children:e.jsxs(L.Secondary,{type:"button",size:"small",onClick:a,children:[e.jsx(A,{name:"pencil",className:"size-3.5"}),"Edit Configuration"]})})]}),e.jsxs("section",{className:"overflow-hidden rounded-lg border border-border bg-card-bg",children:[e.jsx("div",{className:"border-b border-border px-3 py-2",children:e.jsx("h3",{className:"text-text-secondary text-[10px] font-semibold tracking-wide uppercase",children:"Tool Authorization"})}),r.length===0?e.jsx("p",{className:"text-text-secondary px-3 py-3 text-sm",children:"No MCP connectors configured for this agent."}):e.jsx("ul",{className:"divide-y divide-border",children:r.map(m=>{const T=Wt(v,m.name),M=(T==null?void 0:T.authenticated)===!0,B=T==null&&!x;return e.jsxs("li",{className:"flex items-center gap-2 px-3 py-2.5",children:[e.jsx("span",{className:O("inline-flex size-4 shrink-0 items-center justify-center rounded-full border",M?"border-emerald-600/40 bg-emerald-500/15 text-emerald-700 dark:text-emerald-300":"border-border text-transparent"),"aria-hidden":!0,children:M?e.jsx(A,{name:"check",className:"size-3"}):null}),e.jsx("span",{className:"text-text-primary min-w-0 flex-1 truncate text-sm",children:m.name}),M?e.jsx("span",{className:"text-success-bg text-xs font-medium",children:"Connected"}):B?e.jsx("span",{className:"text-text-secondary text-xs",children:"Unavailable"}):T!=null&&T.authenticated===!1?e.jsx(Kt,{connector:T,onConnected:d}):x?e.jsx("span",{className:"text-text-secondary text-xs",children:"Loading…"}):null]},m.name)})})]}),e.jsxs("section",{className:"overflow-hidden rounded-lg border border-border bg-card-bg",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[e.jsx("h3",{className:"text-text-secondary text-[10px] font-semibold tracking-wide uppercase",children:"Test Run"}),e.jsxs(L.Primary,{type:"button",disabled:h,size:"small",onClick:()=>void C(),children:[e.jsx(A,{name:h?"loader":"play",className:O("size-3.5",h&&"animate-spin")}),"Run Test"]})]}),b==null?e.jsx("p",{className:"text-text-secondary px-3 py-3 text-sm",children:"Run a one-off test using the schedule task. This does not change the cron pending run."}):e.jsxs("div",{className:"flex items-center gap-3 px-3 py-3",children:[e.jsx(Qe,{run:b}),e.jsxs("div",{className:"min-w-0 text-sm",children:[e.jsx("p",{className:"text-text-primary font-medium",children:Ke(b.name)}),e.jsx("p",{className:"text-text-secondary",children:Lt(b.triggeredAt??b.scheduledFor)})]})]})]})]})}function Yt({open:t,onOpenChange:n,mode:r,schedule:a,initialAgentId:l="",onSaved:c}){const v=ye(),g=Oe(),d=$e(),x=ve(),N=Me(),[h,k]=o.useState(xe),[b,i]=o.useState(l),[j,C]=o.useState(null),[m,T]=o.useState({kind:"form"}),[M,B]=o.useState(!1),[se,Q]=o.useState(!1),[P,_]=o.useState(null),D=o.useRef(b);D.current=b;const Y=m.kind==="form"?m.saved:m.schedule,p=r==="edit"&&m.kind==="form"&&m.saved==null&&a!=null,I=m.kind==="form"&&m.saved!=null,U=r==="create"&&m.kind==="form"&&m.saved==null,{allows:re}=be({resourceType:"agent",resourceIds:b.length===0?[]:[b]});o.useEffect(()=>{if(!t){k(xe()),i(l),C(null),_(null),T({kind:"form"}),Q(!1);return}if(r==="edit"&&a!=null){k(Fe({name:a.name,task:a.task,cron:a.cron,timezone:a.timezone})),i(a.agentId),C(null),T({kind:"form"});return}k(xe()),i(l),C(null),T({kind:"form"})},[t,r,a,l]),o.useEffect(()=>{if(!t||r!=="create"||l.length===0)return;let f=!1;const E=l;return Tt({server:g,agentKey:E}).then(y=>{f||y==null||D.current===E&&(C(y),i(Ue(y)))}).catch(()=>{}),()=>{f=!0}},[t,r,l,g]);const Z=(j==null?void 0:j.name)??(Y==null?void 0:Y.agentName)??(a==null?void 0:a.agentName)??(b.length>0?b:""),J=o.useMemo(()=>{var E;return(((E=j==null?void 0:j.agentSpec)==null?void 0:E.mcpServers)??[]).map(Ct).filter(y=>y!=null).map(y=>({name:y}))},[j]),G=o.useMemo(()=>{const f=pe(h);return h.name.trim().length>0&&h.task.trim().length>0&&Ne(f)&&b.length>0&&(!U||re(b,"USE"))},[b,re,h,U]),H=f=>{T({kind:"test",schedule:f}),k(Fe({name:f.name,task:f.task,cron:f.cron,timezone:f.timezone})),i(f.agentId)},X=async f=>{if(f.preventDefault(),!G)return;const E=pe(h);B(!0),_(null);try{if(p&&a!=null){await v.updateSchedule({id:a.id,name:h.name.trim(),task:h.task.trim(),cron:E,timezone:h.timezone,status:a.status}),N(K.Schedule.EDITED,{schedule_id:a.id,agent_id:a.agentId}),c==null||c(),n(!1);return}if(I&&m.kind==="form"&&m.saved!=null){const w=await v.updateSchedule({id:m.saved.id,name:h.name.trim(),task:h.task.trim(),cron:E,timezone:h.timezone,status:"paused"});N(K.Schedule.EDITED,{schedule_id:w.id,agent_id:w.agentId}),c==null||c(),H(w),x==null||x.showSuccess({title:"Schedule saved as paused",description:ae({cron:w.cron,timezone:w.timezone})});return}const y=await v.createSchedule({agentId:b,name:h.name.trim(),task:h.task.trim(),cron:E,timezone:h.timezone,status:"paused"});N(K.Schedule.CREATED,{schedule_id:y.id,agent_id:b}),c==null||c(),H(y),x==null||x.showSuccess({title:"Schedule saved as paused",description:ae({cron:y.cron,timezone:y.timezone})})}catch(y){const w=y instanceof Error?y.message:"Failed to save schedule";_(w)}finally{B(!1)}},F=async()=>{if(m.kind==="test"){Q(!0),_(null);try{await v.updateSchedule({id:m.schedule.id,name:m.schedule.name,task:m.schedule.task,cron:m.schedule.cron,timezone:m.schedule.timezone,status:"active"}),c==null||c(),x==null||x.showSuccess({title:"Schedule activated"}),n(!1)}catch(f){const E=f instanceof Error?f.message:"Failed to activate schedule";_(E),x==null||x.showError(f)}finally{Q(!1)}}},le=m.kind==="test"?"Test Schedule":p||I?"Edit Schedule":"New Schedule",ee=m.kind==="test"?`Recurring unattended runs of ${Z}.`:p||I?"Update cadence and task for this schedule.":"Create a recurring unattended run for an agent.";let R;return m.kind==="test"?R=e.jsxs("div",{className:"flex flex-col gap-2",children:[P!=null?e.jsx("p",{className:"text-failure-bg text-sm",children:P}):null,e.jsx(L.Secondary,{type:"button",className:"w-full",disabled:se,onClick:()=>void F(),children:"Activate Schedule"})]}):R=e.jsxs("div",{className:"flex flex-col gap-2",children:[P!=null?e.jsx("p",{className:"text-failure-bg text-sm",children:P}):null,e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(L.Secondary,{type:"button",onClick:()=>n(!1),disabled:M,children:"Cancel"}),e.jsx(L.Primary,{type:"submit",form:"schedule-form",disabled:!G||M,children:"Save"})]})]}),e.jsx(Et,{open:t,onOpenChange:n,title:le,description:ee,anchor:"right",size:"xl",headerIcon:e.jsx("span",{className:"text-primary-button-bg inline-flex size-8 items-center justify-center",children:e.jsx(A,{name:m.kind==="test"||p||I?"calendar":"calendar-plus",className:"size-5"})}),footer:R,children:m.kind==="test"?e.jsx(Qt,{schedule:m.schedule,agentName:Z,mcpMounts:J,onEditConfiguration:()=>{_(null),T({kind:"form",saved:m.schedule})}}):e.jsx("form",{id:"schedule-form",onSubmit:f=>void X(f),children:e.jsx(Bt,{values:h,onChange:k,agentId:b,agentLabel:Z,onAgentIdChange:p||I?void 0:f=>{i(f),f.length===0&&C(null)},onAgentPicked:C,agentPickerDisabled:p||I,onBuildAgent:r==="create"&&(d==null?void 0:d.isComposerEnabled)===!0?()=>{n(!1),d.openAgentBuilder()}:void 0})})})}function _e(t){return e.jsx(wt,{children:e.jsx(Yt,{...t})})}function Zt({runs:t,onOpenSession:n}){const r=Ht(t);return r.length===0?e.jsx("span",{className:"text-text-secondary text-sm",children:"—"}):e.jsx("div",{className:"flex items-center gap-1",children:r.map(a=>e.jsx(Qe,{run:a,...n==null?{}:{onOpenSession:n}},a.id))})}var Jt=[{value:"all",label:"All statuses"},{value:"active",label:"Active"},{value:"paused",label:"Paused"}],Le=[10,25];function de(t){return Math.min(Math.max(t,1),25)}function ue(t){const n=Se(t);return{nameQuery:n.q??"",statusFilter:n.status??"all",agentFilter:n.agent??"all"}}function Xt(t){const n=Se(window.location.search);if(!n.isNew)return{kind:"closed"};const r=t??n.agent;return{kind:"create",...r==null?{}:{agentId:r}}}function es({schedule:t,running:n,canManage:r,canDelete:a,onRunNow:l,onEdit:c,onTogglePause:v,onDelete:g}){const d=vt("PermissionGuard");return e.jsxs("div",{className:"inline-flex items-center justify-end gap-1.5",children:[e.jsx(d,{allowed:r,children:e.jsxs(L.Secondary,{type:"button",disabled:n,"aria-label":`Run now ${t.name}`,size:"large",onClick:l,children:[e.jsx(A,{name:n?"loader":"play",className:O("size-3.5",n&&"animate-spin")}),"Run now"]})}),e.jsxs(St,{align:"end",trigger:e.jsx("button",{type:"button",className:kt({variant:"ghost",size:"icon"}),"aria-label":`Actions for ${t.name}`,children:e.jsx(A,{name:"ellipsis"})}),children:[e.jsx(d,{allowed:r,children:e.jsxs(fe,{onClick:c,children:[e.jsx(A,{name:"pencil",className:"size-3.5"}),"Edit"]})}),e.jsx(d,{allowed:r,children:e.jsxs(fe,{onClick:v,children:[e.jsx(A,{name:t.status==="active"?"pause":"play",className:"size-3.5"}),t.status==="active"?"Pause":"Resume"]})}),e.jsx(d,{allowed:a,children:e.jsxs(fe,{className:"text-failure-bg focus:text-failure-bg",onClick:g,children:[e.jsx(A,{name:"trash",className:"size-3.5"}),"Delete"]})})]})]})}function ns({agentId:t}){const n=ye(),r=Oe(),a=ve(),l=Me(),c=$e(),v=nt(),g=c!=null&&Nt({sessions:v}),[d,x]=o.useState([]),{allows:N}=be({resourceType:"schedule",resourceIds:d.map(s=>s.id)}),[h,k]=o.useState({}),[b,i]=o.useState(!1),[j,C]=o.useState(()=>new Set),[m,T]=o.useState({}),[M,B]=o.useState(!0),[se,Q]=o.useState(null),[P,_]=o.useState(()=>ue(window.location.search).nameQuery),[D,Y]=o.useState(()=>ue(window.location.search).statusFilter),[p,I]=o.useState(()=>t??ue(window.location.search).agentFilter),U=t??(p==="all"?null:p),{allows:re}=be({resourceType:"agent",resourceIds:U==null?[]:[U]}),Z=r.permissions==null||U==null||re(U,"USE"),[J,G]=o.useState(()=>Xt(t)),[H,X]=o.useState(null),[F,le]=o.useState(()=>de(pt)),[ee,R]=o.useState(void 0),[f,E]=o.useState(void 0),[y,w]=o.useState(void 0),Ze=({run:s,schedule:u})=>{if(!g||c==null||s.sessionId==null)return;l(K.Schedule.RUN_SESSION_OPENED,{schedule_id:u.id,agent_id:u.agentId});const S=jt(s.triggeredAt??s.scheduledFor);yt({sessionId:s.sessionId,view:"sessions",...S==null?{}:{timeRange:S}}),c.setSessionsOpen(!0)},q=o.useRef(0),ke=o.useRef(!1),we=o.useCallback(async({rows:s,gen:u})=>{if(s.length===0){u===q.current&&k({});return}i(!0);try{const S=await Promise.allSettled(s.map(z=>n.listScheduleRuns({scheduleId:z.id})));if(u!==q.current)return;k(Object.fromEntries(s.map((z,$)=>{const oe=S[$],tt=(oe==null?void 0:oe.status)==="fulfilled"?oe.value:[];return[z.id,tt]})))}finally{u===q.current&&i(!1)}},[n]),te=o.useCallback(async({token:s,size:u,agentId:S})=>{const z=++q.current;B(!0),Q(null);try{const $=await n.listSchedules({limit:de(u),...s===void 0||s===""?{}:{pageToken:s},...S==="all"?{}:{agentIds:[S]}});if(z!==q.current)return;x($.data),E($.nextPageToken),w($.previousPageToken),we({rows:$.data,gen:z})}catch($){if(z!==q.current)return;Q(at($,"Check your connection and try again.")),x([]),k({}),E(void 0),w(void 0)}finally{z===q.current&&B(!1)}},[n,we]),Te=o.useCallback(s=>{const u=(s==null?void 0:s.size)??F,S=(s==null?void 0:s.agentId)??p;R(void 0),w(void 0),te({token:void 0,size:u,agentId:S})},[p,te,F]);o.useEffect(()=>{Re({agent:t===void 0&&p!=="all"?p:null,status:D==="all"?null:D,q:P.trim().length===0?null:P})},[p,t,D,P]),o.useEffect(()=>{t!==void 0&&I(s=>s===t?s:(R(void 0),w(void 0),t))},[t]),o.useEffect(()=>{ke.current||!Se(window.location.search).isNew||(ke.current=!0,Re({isNew:null}))},[]),o.useEffect(()=>{const s=()=>{const u=ue(window.location.search);_(u.nameQuery),Y(u.statusFilter),I(S=>{const z=t??u.agentFilter;return S===z?S:(R(void 0),w(void 0),z)})};return window.addEventListener("popstate",s),()=>{window.removeEventListener("popstate",s)}},[t]),o.useEffect(()=>{te({token:ee,size:F,agentId:p})},[p,F,ee,te]);const ie=o.useMemo(()=>{const s=P.trim().toLowerCase();return d.filter(u=>!(D!=="all"&&u.status!==D||s.length>0&&!u.name.toLowerCase().includes(s)))},[d,P,D]),Ce=rt(d),Ee=y!=null||f!=null,Je=async s=>{if(!N(s.id,"MANAGE"))return;const u=s.status==="active"?"paused":"active";try{await n.updateSchedule({...s,status:u}),l(K.Schedule.TOGGLED,{schedule_id:s.id,agent_id:s.agentId,next_status:u}),await te({token:ee,size:F,agentId:p})}catch(S){a==null||a.showError(S)}},Xe=async s=>{if(N(s.id,"MANAGE")){C(u=>new Set(u).add(s.id));try{await n.createScheduleRun({scheduleId:s.id}),l(K.Schedule.RUN_NOW,{schedule_id:s.id,agent_id:s.agentId}),a==null||a.showSuccess({title:"Run started"});const u=await n.listScheduleRuns({scheduleId:s.id});k(S=>({...S,[s.id]:u}))}catch(u){a==null||a.showError(u)}finally{C(u=>{const S=new Set(u);return S.delete(s.id),S})}}},et=async s=>{if(N(s.id,"DELETE")){X(null);try{await n.deleteSchedule({id:s.id}),l(K.Schedule.DELETED,{schedule_id:s.id,agent_id:s.agentId}),Te()}catch(u){a==null||a.showError(u)}}},ze=()=>{f!=null&&R(f)},Ae=()=>{y==null||y===""||R(y)};return e.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-primary-bg",children:[e.jsx(lt,{title:t===void 0?"Agent Schedules":void 0,end:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-full sm:w-60",children:e.jsx(it,{query:P,setQuery:_,placeholder:"Search schedules by name"})}),e.jsx(me,{value:D,onValueChange:Y,options:Jt,className:"sm:w-40","aria-label":"Filter by status"}),t===void 0?e.jsx(Be,{value:p,selectedLabel:p==="all"?"All agents":m[p]??p,onValueChange:s=>{I(s),R(void 0),w(void 0)},onAgentPicked:s=>{T(u=>({...u,[Ue(s)]:s.name}))},allOption:{value:"all",label:"All agents"},className:"sm:w-48","aria-label":"Filter by agent",placeholder:"Search agent"}):null,e.jsxs(L.Primary,{type:"button",disabled:!Z,onClick:()=>Z&&G({kind:"create",agentId:p!=="all"?p:void 0}),children:[e.jsx(A,{name:"plus",className:"size-3.5"}),"New Schedule"]})]})}),e.jsx("div",{className:O("min-h-0 flex-1 overflow-auto px-4 py-4",se!=null?"flex flex-col":void 0),children:M?e.jsx("div",{className:"flex flex-col gap-2",role:"status","aria-label":"Loading schedules",children:Array.from({length:5},(s,u)=>e.jsx(ot,{className:"h-12 w-full rounded-md"},u))}):se!=null?e.jsx("div",{role:"alert",className:"flex flex-1 flex-col items-center justify-center",children:e.jsx(he,{title:"Couldn't load schedules",description:se,className:"h-auto min-h-0 flex-none py-0"})}):d.length===0?e.jsx(he,{title:"No Schedules Found",description:"Create one to get started.",className:"min-h-full"}):ie.length===0?e.jsxs("div",{className:"flex min-h-full flex-col",children:[e.jsx(he,{title:"No Schedules Found",description:"No schedules match your filters.",className:"flex-1"}),Ee?e.jsx(Pe,{pageSize:F,rowCount:0,canPrev:y!=null,canNext:f!=null,onPrev:Ae,onNext:ze,pageSizeOptions:Le,onPageSizeChange:s=>{const u=de(s);le(u),R(void 0),w(void 0)}}):null]}):e.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[e.jsxs(ct,{className:"min-w-240",children:[e.jsx(dt,{children:e.jsxs(De,{className:"hover:bg-transparent",children:[e.jsx(V,{children:"Schedule Name"}),e.jsx(V,{children:"Task"}),Ce?e.jsx(V,{children:"Created by"}):null,e.jsx(V,{children:"Frequency"}),e.jsx(V,{children:"Status"}),e.jsx(V,{children:"Last 5 runs"}),e.jsx(V,{children:e.jsx("span",{className:"sr-only",children:"Actions"})})]})}),e.jsx(ut,{children:ie.map(s=>{const u=ae({cron:s.cron,timezone:s.timezone}),S=s.agentName??m[s.agentId]??s.agentId;return e.jsxs(De,{children:[e.jsxs(W,{className:"w-48 max-w-48",children:[e.jsx("span",{className:"text-text-primary block truncate font-medium",children:s.name}),e.jsxs("span",{className:"mt-1 flex min-w-0 items-center gap-1 text-xs",children:[e.jsx(A,{name:"agent-2",className:"size-3 shrink-0"}),e.jsx("span",{className:"truncate",children:S})]})]}),e.jsx(W,{className:"w-64 max-w-64",children:e.jsx(Ge,{content:s.task,className:"max-w-sm whitespace-normal text-left",triggerClassName:"block min-w-0 w-full max-w-full",children:e.jsx("span",{className:"block truncate",children:s.task})})}),Ce?e.jsx(W,{children:e.jsx(mt,{subject:s.createdBySubject})}):null,e.jsx(W,{children:u}),e.jsx(W,{children:e.jsx(Ye,{status:s.status})}),e.jsx(W,{children:b?e.jsx("span",{className:"text-text-secondary text-sm",children:"…"}):e.jsx(Zt,{runs:h[s.id]??[],...g?{onOpenSession:z=>Ze({run:z,schedule:s})}:{}})}),e.jsx(W,{className:"text-right",children:e.jsx(es,{schedule:s,running:j.has(s.id),canManage:N(s.id,"MANAGE"),canDelete:N(s.id,"DELETE"),onRunNow:()=>void Xe(s),onEdit:()=>{N(s.id,"MANAGE")&&G({kind:"edit",schedule:s})},onTogglePause:()=>void Je(s),onDelete:()=>{N(s.id,"DELETE")&&X(s)}})})]},s.id)})})]}),(ie.length>0||Ee)&&e.jsx(Pe,{pageSize:F,rowCount:ie.length,canPrev:y!=null,canNext:f!=null,onPrev:Ae,onNext:ze,pageSizeOptions:Le,onPageSizeChange:s=>{const u=de(s);le(u),R(void 0),w(void 0)}})]})}),J.kind==="create"?e.jsx(_e,{open:!0,mode:"create",initialAgentId:J.agentId??"",onOpenChange:s=>{s||G({kind:"closed"})},onSaved:()=>Te()}):null,J.kind==="edit"?e.jsx(_e,{open:!0,mode:"edit",schedule:J.schedule,onOpenChange:s=>{s||G({kind:"closed"})},onSaved:()=>void te({token:ee,size:F,agentId:p})}):null,H!=null?e.jsxs(xt,{open:!0,onOpenChange:s=>{s||X(null)},"aria-label":"Delete schedule",className:"max-w-md",children:[e.jsx(ht,{children:e.jsxs(ft,{children:[e.jsx(gt,{children:"Delete schedule"}),e.jsxs("p",{className:"text-text-secondary text-sm",children:["“",H.name,"” will stop running. This cannot be undone."]})]})}),e.jsxs(bt,{children:[e.jsx(L.Secondary,{type:"button",onClick:()=>X(null),children:"Cancel"}),e.jsx(L.Destructive,{type:"button",disabled:!N(H.id,"DELETE"),onClick:()=>void et(H),children:"Delete"})]})]}):null]})}export{ns as SchedulesPage};
@@ -1,6 +0,0 @@
1
-  ��.��?����dѵ��)p�Dq�$�=:�����z�'��R#�&��}'��(���w扣1�$� �Kd�u��[�1�� 5A�yW_p�0����N���a1�K��cG 6��.��|� ���v�'� ]�9xIe.6`ml�h�J��}�\oT�@�7T㜆xMg4��P�̋
2
- ��ar8=�zuCj�c�}[ln��/3��
3
- F�����ҷKic�r�bq��\1����`�T����m֛��V���5�04 ���%��s
4
- ~���8���õ\���3�/�y�z��Dڔw�y��aɍ�3�̺m�~s!�����&ʽ%�n�ыe�05�X��A�WP�������ճ9 a��h���N/J��+tci�-�O�"y''E�!��\7��UrL�p5W���({�
5
- �K�~,���C��@���_m*�������6��d[��3[����n1R3;��:��y��~�]{��$R�Wj_�+?~Hc� ���c"�C�YK��AKOl� �m�D�j�v�K��81�N3Ҭk���|i��qc�ozuK2���Ĭ �7fE��4,��G)X�qo�7ﴽ�F(����3��1�F�B.��>�����$��X?��NZ*ml��J���Ԓ���YQ��8wE�|mxs}Ċ�ikU�'�DOz��WB>q��$g��;�q����!��\Sg�T�慡�H�B��-���7��Aox9[D���?iceK��sN|��g����,1ޖ2��IȄ�r&�%G�T��l�}���:5V
6
- ������Dz�s�d ��������\�ҿ�%w