@shawnstack/quickforge 1.7.4 → 1.7.6

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 (258) hide show
  1. package/dist/assets/AgentProfilesPage-Dl5Peqov.js +1 -0
  2. package/dist/assets/ChatPanelHost-D3987TUJ.js +307 -0
  3. package/dist/assets/CloudAccountSettingsPage-BG5Nn3bq.js +1 -0
  4. package/dist/assets/PluginsPage-BDKYfLna.js +1 -0
  5. package/dist/assets/ScheduledTasksPage--GAki3lB.js +2 -0
  6. package/dist/assets/SettingsWorkspacePage-DSy66Tuw.js +1696 -0
  7. package/dist/assets/ShareLinksSettingsPage-BQQMsvJo.js +1 -0
  8. package/dist/assets/SharedConversationPage-B9BUVCri.js +1 -0
  9. package/dist/assets/TerminalDock-CT1nYo7P.js +2 -0
  10. package/dist/assets/WorkspaceInspector-BnfDLf9a.js +36 -0
  11. package/dist/assets/{abnfDiagram-VRR7QNED-Dy7veffk.js → abnfDiagram-VRR7QNED-CMhVoYUh.js} +1 -1
  12. package/dist/assets/{arc-Bo3p2lGy.js → arc-w21O0TLn.js} +1 -1
  13. package/dist/assets/architecture-TIHT7OUA-DMwFMHxq.js +1 -0
  14. package/dist/assets/{architectureDiagram-ZJ3FMSHR-Cwx8qOvu.js → architectureDiagram-ZJ3FMSHR-C52qL6Hg.js} +1 -1
  15. package/dist/assets/{blockDiagram-677ZJIJ3-BiuaAOFa.js → blockDiagram-677ZJIJ3-CM3XbLol.js} +1 -1
  16. package/dist/assets/{c4Diagram-LMCZKHZV-BTcGfhK2.js → c4Diagram-LMCZKHZV-D7Bh1ui1.js} +1 -1
  17. package/dist/assets/channel-Duu1CuH9.js +1 -0
  18. package/dist/assets/chunk-2Q5K7J3B-B6rHWc4S.js +1 -0
  19. package/dist/assets/{chunk-32BRIVSS-B9PuF_RF.js → chunk-32BRIVSS-xgrtbT8e.js} +1 -1
  20. package/dist/assets/{chunk-52WLFC77-3zGItfIM.js → chunk-52WLFC77-CDbaHw80.js} +1 -1
  21. package/dist/assets/{chunk-5FCAYU7R-DQ66qlmt.js → chunk-5FCAYU7R-CcSvVbPc.js} +1 -1
  22. package/dist/assets/{chunk-5HE753X5-CLqTO-VF.js → chunk-5HE753X5-erFpzzgx.js} +1 -1
  23. package/dist/assets/{chunk-5JV3BV7I-Csxv1jr6.js → chunk-5JV3BV7I-rEhN9F6G.js} +1 -1
  24. package/dist/assets/{chunk-5TONJI2A-BCQttpBr.js → chunk-5TONJI2A-D8L-QTwD.js} +1 -1
  25. package/dist/assets/{chunk-5VM5RSS4-DEWJGSTb.js → chunk-5VM5RSS4-CjlfMBbM.js} +1 -1
  26. package/dist/assets/{chunk-7BUUIJ7U-DNorm9MM.js → chunk-7BUUIJ7U-CCcsI9XE.js} +1 -1
  27. package/dist/assets/{chunk-BIQX33UG-DgvY_BOT.js → chunk-BIQX33UG-FSqFbmb3.js} +1 -1
  28. package/dist/assets/{chunk-C7G6YPKG-DMvn9IPs.js → chunk-C7G6YPKG-ZMLUvfLy.js} +1 -1
  29. package/dist/assets/{chunk-CQNSW5MT-Dq2duUgr.js → chunk-CQNSW5MT-DZuBpk25.js} +1 -1
  30. package/dist/assets/{chunk-CYSBUYHQ-BovYyc4Y.js → chunk-CYSBUYHQ-CB26wsG0.js} +1 -1
  31. package/dist/assets/{chunk-EMLP6XTP-BMDOpuYN.js → chunk-EMLP6XTP-BbsM8oRw.js} +1 -1
  32. package/dist/assets/{chunk-EX3LRPZG-6eP2UPOf.js → chunk-EX3LRPZG-BcQhaqt7.js} +1 -1
  33. package/dist/assets/{chunk-FWX5IMBZ-D4q-wTSy.js → chunk-FWX5IMBZ-DrnrdrSu.js} +2 -2
  34. package/dist/assets/{chunk-HOUHSVGY-XjIcuzH7.js → chunk-HOUHSVGY-tdc-Z9eW.js} +1 -1
  35. package/dist/assets/{chunk-ICXQ74PX-YBXbanq9.js → chunk-ICXQ74PX-Cd7igVGt.js} +1 -1
  36. package/dist/assets/{chunk-JG7HCLWE-CcN3uNXF.js → chunk-JG7HCLWE-iXXGW8nf.js} +1 -1
  37. package/dist/assets/{chunk-JWPE2WC7-Cwg6AUAt.js → chunk-JWPE2WC7-BZ87mXEv.js} +1 -1
  38. package/dist/assets/{chunk-MOJQB5TN-NNspcGIU.js → chunk-MOJQB5TN-CLTjV5ov.js} +1 -1
  39. package/dist/assets/{chunk-MOZMSUNE-pMJ_jMos.js → chunk-MOZMSUNE-B3SCBrRH.js} +1 -1
  40. package/dist/assets/{chunk-OGEWGWER-CJy-3Ldv.js → chunk-OGEWGWER-TgvkXkFX.js} +1 -1
  41. package/dist/assets/{chunk-OSBZ3O6U-D7cLHHOA.js → chunk-OSBZ3O6U-B9E2E5v1.js} +1 -1
  42. package/dist/assets/{chunk-PUDLZKDR-D5YBi1Pi.js → chunk-PUDLZKDR-C5GMVYup.js} +1 -1
  43. package/dist/assets/{chunk-Q4XR5HBZ-DYmqQdIf.js → chunk-Q4XR5HBZ-fo5-HsqY.js} +1 -1
  44. package/dist/assets/{chunk-QBLGF6JB-Bfcx00X0.js → chunk-QBLGF6JB-Dwfg8sKc.js} +1 -1
  45. package/dist/assets/{chunk-R7FJI6CG-oXzadpZY.js → chunk-R7FJI6CG-DpBrv4ni.js} +1 -1
  46. package/dist/assets/{chunk-RYQCIY6F-Dt3-8yUh.js → chunk-RYQCIY6F-DzzmTl11.js} +1 -1
  47. package/dist/assets/{chunk-U6XO7XAA-B55eSvpx.js → chunk-U6XO7XAA-Dw6aviKa.js} +1 -1
  48. package/dist/assets/{chunk-V7JOEXUC-Btk4JwCt.js → chunk-V7JOEXUC-CEDazV6w.js} +1 -1
  49. package/dist/assets/chunk-VAUOI2AC-CWYjg8zE.js +1 -0
  50. package/dist/assets/{chunk-VR4S4FIN-DgaSiVOY.js → chunk-VR4S4FIN-C_-eEj-9.js} +1 -1
  51. package/dist/assets/{chunk-WYO6CB5R-rRDZ_Tta.js → chunk-WYO6CB5R-NF-MsJJR.js} +3 -3
  52. package/dist/assets/chunk-XXDRQBXY-DzTwx8ZH.js +1 -0
  53. package/dist/assets/{chunk-YOTPTUD7-BnFxj5o4.js → chunk-YOTPTUD7-DqzqtdII.js} +1 -1
  54. package/dist/assets/{chunk-ZGVPDNZ5-CrnlPlmJ.js → chunk-ZGVPDNZ5-CRrAYi4g.js} +1 -1
  55. package/dist/assets/{chunk-ZIRB5QZD-BYTiATIH.js → chunk-ZIRB5QZD-Dc1s5bLM.js} +1 -1
  56. package/dist/assets/classDiagram-OUVF2IWQ-Cc63fLWP.js +1 -0
  57. package/dist/assets/classDiagram-v2-EOCWNBFH-CoXU0qT6.js +1 -0
  58. package/dist/assets/{cose-bilkent-JH36ORCC-BORKJRwF.js → cose-bilkent-JH36ORCC-cL247pHg.js} +1 -1
  59. package/dist/assets/cynefin-VYW2F7L2-C8yCvH_o.js +1 -0
  60. package/dist/assets/{cynefinDiagram-TSTJHNR4-BXKeaSl8.js → cynefinDiagram-TSTJHNR4-D4sZ7LYI.js} +1 -1
  61. package/dist/assets/{dagre-CrA0XVwJ.js → dagre-DmHb3Ctt.js} +1 -1
  62. package/dist/assets/{dagre-VKFMJZFB-ouq_lA1a.js → dagre-VKFMJZFB-BlsnSh-Q.js} +1 -1
  63. package/dist/assets/{diagram-FQU43EPY-BxR5kUiQ.js → diagram-FQU43EPY-DW1yQiRO.js} +1 -1
  64. package/dist/assets/{diagram-G47NLZAW-DWonk1sL.js → diagram-G47NLZAW-BTUAsFjb.js} +1 -1
  65. package/dist/assets/{diagram-NH7WQ7WH-fmV_wV5e.js → diagram-NH7WQ7WH-BcaomqSd.js} +1 -1
  66. package/dist/assets/{diagram-OA4YK3LP-DvOSRRiV.js → diagram-OA4YK3LP-DDLX7Xwr.js} +1 -1
  67. package/dist/assets/{diagram-WEI45ONY-Bp-xb3uS.js → diagram-WEI45ONY-CIave0An.js} +1 -1
  68. package/dist/assets/{dist-DLKC_odd.js → dist-yDHbi5ux.js} +1 -1
  69. package/dist/assets/{ebnfDiagram-CCIWWBDH-BTlnwneA.js → ebnfDiagram-CCIWWBDH-Cr1Y6lPu.js} +1 -1
  70. package/dist/assets/{erDiagram-Q63AITRT-C3fFWGCm.js → erDiagram-Q63AITRT-D3EgiVVH.js} +1 -1
  71. package/dist/assets/{esm-oa69b5u4.js → esm-sdsK6gaB.js} +2 -2
  72. package/dist/assets/eventmodeling-45OFAUF4-DO1vRTM0.js +1 -0
  73. package/dist/assets/flowDiagram-23GEKE2U-BS7KXcqn.js +1 -0
  74. package/dist/assets/{ganttDiagram-NO4QXBWP-DzAiojNi.js → ganttDiagram-NO4QXBWP-B0oyDIqK.js} +1 -1
  75. package/dist/assets/gitGraph-TEB2WS4Q-m5F5ef09.js +1 -0
  76. package/dist/assets/{gitGraphDiagram-IHSO6WYX-Cv57oNEA.js → gitGraphDiagram-IHSO6WYX-uQtr6IqK.js} +1 -1
  77. package/dist/assets/icons-2D18YbSI.js +1 -0
  78. package/dist/assets/index-1ei6nhs-.css +3 -0
  79. package/dist/assets/index-BivLuZvX.js +65 -0
  80. package/dist/assets/info-DKCQHKI2-CZxPlQJ0.js +1 -0
  81. package/dist/assets/{infoDiagram-FWYZ7A6U-B5Z_O3Ro.js → infoDiagram-FWYZ7A6U-B_GzlLIM.js} +1 -1
  82. package/dist/assets/{ishikawaDiagram-FXEZZL3T-CKTK_TKV.js → ishikawaDiagram-FXEZZL3T-CKQIsSdU.js} +1 -1
  83. package/dist/assets/{journeyDiagram-5HDEW3XC-Cm9k4ywW.js → journeyDiagram-5HDEW3XC-DrrvzZL1.js} +1 -1
  84. package/dist/assets/{kanban-definition-HUTT4EX6-DzNteLwx.js → kanban-definition-HUTT4EX6-CJQRTdXz.js} +1 -1
  85. package/dist/assets/{line-BG78c_WJ.js → line-B4DxX7tC.js} +1 -1
  86. package/dist/assets/{linear-1X20_EGu.js → linear-U-nKUhyW.js} +1 -1
  87. package/dist/assets/{map-CCI8WZkS.js → map-BneTM-ri.js} +1 -1
  88. package/dist/assets/{mcp-servers-dialog-GXXD9K0U.js → mcp-servers-dialog-BEV4_TXC.js} +2 -2
  89. package/dist/assets/{mermaid-parser.core-Bb8HI_OS.js → mermaid-parser.core-BlKWrEdZ.js} +2 -2
  90. package/dist/assets/{mermaid-renderer-PIaNiXAz.js → mermaid-renderer-jEbqFaTe.js} +2 -2
  91. package/dist/assets/{mermaid.core-DUHOIwL5.js → mermaid.core-DWpShXCs.js} +3 -3
  92. package/dist/assets/{mindmap-definition-LN4V7U3C-Tnbszo7b.js → mindmap-definition-LN4V7U3C-CEVwZD78.js} +1 -1
  93. package/dist/assets/{logger-8REuLPGK.js → model-display-label-C6-0eDxF.js} +1 -1
  94. package/dist/assets/model-identity-CgA6_Pbm.js +1 -0
  95. package/dist/assets/model-reference-o41fJ6jQ.js +1 -0
  96. package/dist/assets/{monaco-BVtCspYZ.js → monaco-DvXErxp2.js} +1 -1
  97. package/dist/assets/{ordinal-v4prQcuq.js → ordinal-B2r5L1v4.js} +1 -1
  98. package/dist/assets/{otel-D1LswXpM.js → otel-BFnphzjt.js} +1 -1
  99. package/dist/assets/packet-7NZHBO7P-zIioIZVN.js +1 -0
  100. package/dist/assets/{pegDiagram-2B236MQR-CX824Kd0.js → pegDiagram-2B236MQR-CBLkBdnQ.js} +1 -1
  101. package/dist/assets/{pi-ai-DAJlO9ZB.js → pi-ai-Cr2ee4a0.js} +2 -2
  102. package/dist/assets/{pi-web-ui-B-RJSxjR.js → pi-web-ui-DV5jKjSg.js} +1 -1
  103. package/dist/assets/pie-RZYD4A2V-GGWijBvB.js +1 -0
  104. package/dist/assets/{pieDiagram-ENE6RG2P-BT04VWPQ.js → pieDiagram-ENE6RG2P-8tCnwtWS.js} +1 -1
  105. package/dist/assets/{quadrantDiagram-ABIIQ3AL-BvOZxkBr.js → quadrantDiagram-ABIIQ3AL-CWd28cHF.js} +1 -1
  106. package/dist/assets/radar-I7S5WNFK-yvwFH3RV.js +1 -0
  107. package/dist/assets/railroad-3IZDKUUU-BVadlswB.js +1 -0
  108. package/dist/assets/railroad-abnf-AHOZXSZD-B7R-p_2-.js +1 -0
  109. package/dist/assets/railroad-ebnf-EBAXGLYW-BnbJxPug.js +1 -0
  110. package/dist/assets/railroad-peg-LSFZ7HO6-Ci3DcEuQ.js +1 -0
  111. package/dist/assets/{railroadDiagram-RFXS5EU6-DnTU--BV.js → railroadDiagram-RFXS5EU6-CI4ouOBs.js} +1 -1
  112. package/dist/assets/{react-vendor-eWH0QhNU.js → react-vendor-3UaA-C9W.js} +1 -1
  113. package/dist/assets/{requirementDiagram-TGXJPOKE--MZX_yEv.js → requirementDiagram-TGXJPOKE-DtFz7sw4.js} +1 -1
  114. package/dist/assets/{sankeyDiagram-HTMAVEWB-SEZkHhYn.js → sankeyDiagram-HTMAVEWB--VeOwwk9.js} +1 -1
  115. package/dist/assets/{sequenceDiagram-DBY2YBRQ-BhC2OHiz.js → sequenceDiagram-DBY2YBRQ-B8AHk5Oe.js} +1 -1
  116. package/dist/assets/{sizeCapture-X5ZJPWSS-Ci5LeToV.js → sizeCapture-X5ZJPWSS-vV_ArM8D.js} +1 -1
  117. package/dist/assets/{skills-dialog-DDh1h8eH.js → skills-dialog-BTJ7mzk_.js} +3 -3
  118. package/dist/assets/{src-CovulcRC.js → src-PYsDme0X.js} +1 -1
  119. package/dist/assets/{stateDiagram-2N3HPSRC-DKK5tFT4.js → stateDiagram-2N3HPSRC-etXnJ8X8.js} +1 -1
  120. package/dist/assets/stateDiagram-v2-6OUMAXLB-Dms3pICj.js +1 -0
  121. package/dist/assets/{swimlanes-5IMT3BWC-DxxGCk67.js → swimlanes-5IMT3BWC-pabIKAmn.js} +2 -2
  122. package/dist/assets/swimlanesDiagram-G3AALYLV-B14aWjv6.js +8 -0
  123. package/dist/assets/{timeline-definition-FHXFAJF6-BPXB3Sue.js → timeline-definition-FHXFAJF6-C55MKm3L.js} +1 -1
  124. package/dist/assets/treeView-QDETBFTQ-Cru9B2zv.js +1 -0
  125. package/dist/assets/treemap-6X3UGDF4-DNOVHFaJ.js +1 -0
  126. package/dist/assets/{vennDiagram-L72KCM5P-CxcBCKye.js → vennDiagram-L72KCM5P-CgNf1Q9W.js} +1 -1
  127. package/dist/assets/wardley-OPB4EBWU-E3m1BOJQ.js +1 -0
  128. package/dist/assets/{wardleyDiagram-EHGQE667-DEL6Yes5.js → wardleyDiagram-EHGQE667-Drt5ytec.js} +1 -1
  129. package/dist/assets/{web-RgX7H-OH.js → web-B5qgZJRv.js} +1 -1
  130. package/dist/assets/{xychartDiagram-FW5EYKEG-N8cPbcjC.js → xychartDiagram-FW5EYKEG-hhoEo_Ar.js} +1 -1
  131. package/dist/index.html +11 -10
  132. package/dist/sw.js +17 -0
  133. package/package.json +4 -1
  134. package/plugins/{openai-documents → documents}/plugin.json +2 -2
  135. package/plugins/{openai-presentations → presentations}/plugin.json +2 -2
  136. package/plugins/{openai-spreadsheets → spreadsheets}/plugin.json +2 -2
  137. package/runtime-assets/agent/darwin-arm64/qf-agent +0 -0
  138. package/runtime-assets/agent/darwin-x64/qf-agent +0 -0
  139. package/runtime-assets/agent/linux-arm64/qf-agent +0 -0
  140. package/runtime-assets/agent/linux-x64/qf-agent +0 -0
  141. package/runtime-assets/agent/win32-x64/qf-agent.exe +0 -0
  142. package/server/access-policy.mjs +11 -0
  143. package/server/acp/server.mjs +36 -26
  144. package/server/agent-manager.mjs +474 -71
  145. package/server/agent-profile-files.mjs +8 -4
  146. package/server/agent-profile-schema.mjs +47 -23
  147. package/server/agent-profiles.mjs +28 -9
  148. package/server/ai-http-logger.mjs +98 -12
  149. package/server/auto-compaction.mjs +35 -8
  150. package/server/cloud/chat-idempotency-store.mjs +96 -0
  151. package/server/cloud/client.mjs +99 -0
  152. package/server/cloud/config.mjs +54 -0
  153. package/server/cloud/credential-store.mjs +200 -0
  154. package/server/cloud/identity.mjs +312 -0
  155. package/server/cloud/index.mjs +7 -0
  156. package/server/cloud/models.mjs +80 -0
  157. package/server/cloud/qf-agent-process.mjs +571 -0
  158. package/server/cloud/runtime.mjs +135 -0
  159. package/server/cloud/service-config.mjs +81 -0
  160. package/server/index.mjs +124 -48
  161. package/server/mcp/registry.mjs +8 -7
  162. package/server/message-converters.mjs +40 -19
  163. package/server/model-catalog.mjs +269 -0
  164. package/server/opencode-acp-agent.mjs +1151 -0
  165. package/server/plugins/registry.mjs +29 -5
  166. package/server/public-api.mjs +11 -5
  167. package/server/routes/agent-profiles.mjs +46 -9
  168. package/server/routes/agent.mjs +60 -11
  169. package/server/routes/backup.mjs +8 -1
  170. package/server/routes/cloud.mjs +246 -0
  171. package/server/routes/models.mjs +7 -1
  172. package/server/routes/scheduled-tasks.mjs +38 -8
  173. package/server/routes/shared-conversation.mjs +62 -58
  174. package/server/routes/shares.mjs +75 -1
  175. package/server/routes/storage.mjs +9 -1
  176. package/server/routes/system.mjs +7 -4
  177. package/server/routes/workspace.mjs +6 -4
  178. package/server/share-store.mjs +168 -13
  179. package/server/skills.mjs +30 -3
  180. package/server/storage.mjs +7 -1
  181. package/server/subagents.mjs +3 -3
  182. package/server/tools/definitions.mjs +1 -1
  183. package/server/tools/index.mjs +2 -2
  184. package/server/utils/network.mjs +9 -0
  185. package/server/utils/process-tree.mjs +78 -0
  186. package/server/utils/response.mjs +8 -1
  187. package/skills/skill-creator/LICENSE.txt +202 -0
  188. package/skills/skill-creator/SKILL.md +485 -0
  189. package/skills/skill-creator/UPSTREAM.md +6 -0
  190. package/skills/skill-creator/agents/analyzer.md +274 -0
  191. package/skills/skill-creator/agents/comparator.md +202 -0
  192. package/skills/skill-creator/agents/grader.md +223 -0
  193. package/skills/skill-creator/assets/eval_review.html +146 -0
  194. package/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  195. package/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  196. package/skills/skill-creator/references/schemas.md +430 -0
  197. package/skills/skill-creator/scripts/__init__.py +0 -0
  198. package/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  199. package/skills/skill-creator/scripts/generate_report.py +326 -0
  200. package/skills/skill-creator/scripts/improve_description.py +247 -0
  201. package/skills/skill-creator/scripts/package_skill.py +136 -0
  202. package/skills/skill-creator/scripts/quick_validate.py +103 -0
  203. package/skills/skill-creator/scripts/run_eval.py +310 -0
  204. package/skills/skill-creator/scripts/run_loop.py +328 -0
  205. package/skills/skill-creator/scripts/utils.py +47 -0
  206. package/dist/assets/AgentProfilesPage-B84w-r9S.js +0 -1
  207. package/dist/assets/ChatPanelHost-CyO8fEoj.js +0 -288
  208. package/dist/assets/PluginsPage-D2862wul.js +0 -1
  209. package/dist/assets/ScheduledTasksPage-GqbiJDPX.js +0 -2
  210. package/dist/assets/SettingsWorkspacePage-B53_eDf2.js +0 -1628
  211. package/dist/assets/SharedConversationPage-Cw2QFnbC.js +0 -1
  212. package/dist/assets/TerminalDock-Dgg-_ZmU.js +0 -2
  213. package/dist/assets/WorkspaceInspector-3uLiu6Bv.js +0 -13
  214. package/dist/assets/architecture-TIHT7OUA-7FQo5GbP.js +0 -1
  215. package/dist/assets/channel-DToA8d-4.js +0 -1
  216. package/dist/assets/chunk-2Q5K7J3B-D_Wxpk-T.js +0 -1
  217. package/dist/assets/chunk-VAUOI2AC-CIZseNLi.js +0 -1
  218. package/dist/assets/chunk-XXDRQBXY-Do-XYxat.js +0 -1
  219. package/dist/assets/classDiagram-OUVF2IWQ-Bu24Sy-k.js +0 -1
  220. package/dist/assets/classDiagram-v2-EOCWNBFH-DKhh5HSW.js +0 -1
  221. package/dist/assets/cynefin-VYW2F7L2-oyiAgYC4.js +0 -1
  222. package/dist/assets/eventmodeling-45OFAUF4-YB_0MefX.js +0 -1
  223. package/dist/assets/flowDiagram-23GEKE2U-Bc73xdBd.js +0 -1
  224. package/dist/assets/gitGraph-TEB2WS4Q-Bvp27L0n.js +0 -1
  225. package/dist/assets/icons-cTkqD_Gi.js +0 -1
  226. package/dist/assets/index-B48prgLL.js +0 -65
  227. package/dist/assets/index-DQhwHHer.css +0 -3
  228. package/dist/assets/info-DKCQHKI2-BsLOivgq.js +0 -1
  229. package/dist/assets/packet-7NZHBO7P-BKQkXRtk.js +0 -1
  230. package/dist/assets/pie-RZYD4A2V-BTiTN5Ge.js +0 -1
  231. package/dist/assets/radar-I7S5WNFK-BU-oVjKM.js +0 -1
  232. package/dist/assets/railroad-3IZDKUUU-7H2hxNbL.js +0 -1
  233. package/dist/assets/railroad-abnf-AHOZXSZD-Mx6wf6XQ.js +0 -1
  234. package/dist/assets/railroad-ebnf-EBAXGLYW-BgXSKhYy.js +0 -1
  235. package/dist/assets/railroad-peg-LSFZ7HO6-DTEl2rAC.js +0 -1
  236. package/dist/assets/stateDiagram-v2-6OUMAXLB-D8x3mkni.js +0 -1
  237. package/dist/assets/swimlanesDiagram-G3AALYLV-C4nOBNp8.js +0 -8
  238. package/dist/assets/treeView-QDETBFTQ-DOE6NSdf.js +0 -1
  239. package/dist/assets/treemap-6X3UGDF4-Ca7QD_b4.js +0 -1
  240. package/dist/assets/wardley-OPB4EBWU-D9O4RKRm.js +0 -1
  241. /package/dist/assets/{array-DqLCdDFv.js → array-B9UHiPd-.js} +0 -0
  242. /package/dist/assets/{chunk-KEIR6QF5-s7Qq-R3i.js → chunk-KEIR6QF5-jrz1pRUS.js} +0 -0
  243. /package/dist/assets/{chunk-Y2CYZVJY-BgISNSiw.js → chunk-Y2CYZVJY-D6N-CrJv.js} +0 -0
  244. /package/dist/assets/{cytoscape.esm-iekjSZ2n.js → cytoscape.esm-DyfqweF2.js} +0 -0
  245. /package/dist/assets/{defaultLocale-CrJzLgRD.js → defaultLocale-5eAKkKJC.js} +0 -0
  246. /package/dist/assets/{dist-zzfqk5hx.js → dist-CLg13NtV.js} +0 -0
  247. /package/dist/assets/{graphlib-CIz_CfxW.js → graphlib-DJkmx0Cq.js} +0 -0
  248. /package/dist/assets/{init-C0r9Gk5G.js → init-DlZdxViB.js} +0 -0
  249. /package/dist/assets/{path-DIKpVbHL.js → path-6uRLdFF7.js} +0 -0
  250. /package/dist/assets/{plugin-api-C8hMT5W6.js → plugin-api-Uu2xAB4d.js} +0 -0
  251. /package/dist/assets/{rough.esm-BMOtDaaS.js → rough.esm-Bud4g4fh.js} +0 -0
  252. /package/dist/assets/{xterm-BFzZ1FH4.js → xterm-Bm_IbozX.js} +0 -0
  253. /package/plugins/{openai-documents → documents}/commands/document.md +0 -0
  254. /package/plugins/{openai-documents → documents}/skills/documents/SKILL.md +0 -0
  255. /package/plugins/{openai-presentations → presentations}/commands/presentation.md +0 -0
  256. /package/plugins/{openai-presentations → presentations}/skills/presentations/SKILL.md +0 -0
  257. /package/plugins/{openai-spreadsheets → spreadsheets}/commands/spreadsheet.md +0 -0
  258. /package/plugins/{openai-spreadsheets → spreadsheets}/skills/spreadsheets/SKILL.md +0 -0
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{C as t,G as n,K as r,S as i,X as ee,_ as te,_t as ne,a as re,b as ie,c as ae,p as oe,pt as se,qt as a,xt as ce,yt as le}from"./icons-2D18YbSI.js";import{n as o}from"./react-vendor-3UaA-C9W.js";import{$ as ue,B as de,G as fe,H as s,J as pe,K as me,Q as he,Tt as c,U as ge,V as _e,W as ve,X as ye,Y as be,Z as xe,_n as Se,et as Ce,hn as we,mn as l,nt as u,q as Te,tt as Ee,vn as d,yn as f}from"./index-BivLuZvX.js";var p=e(a(),1);function m(e,t=`cloudRequestFailed`){return e instanceof s?e.code===`cloud_session_active`?f(`cloudSessionActiveGuidance`):e.code===`cloud_disabled`?f(`cloudDisabledError`):e.code===`cloud_local_only`?f(`cloudLocalOnlyError`):e.code===`cloud_configuration_error`||e.code===`cloud_not_configured`?f(`cloudConfigurationError`):e.code===`cloud_session_service_mismatch`?f(`cloudSessionServiceMismatch`):[`expired_token`,`device_code_expired`,`expired`].includes(e.code)?f(`cloudDeviceFlowExpiredError`):[`access_denied`,`authorization_declined`,`denied`].includes(e.code)?f(`cloudDeviceFlowDeniedError`):[`refresh_token_reused`,`installation_revoked`,`invalid_refresh_token`,`cloud_not_connected`].includes(e.code)?f(`cloudSessionExpired`):Se()===`en`&&e.message.trim()?e.message:e.status>0?f(`cloudRequestFailedWithStatus`,{status:e.status}):f(t):f(t)}var De={usage:void 0,installations:[],models:[],errors:{},loading:!1};function Oe(e,t){return t.type===`replace`?t.state:{...De,loading:t.type===`begin`}}async function ke(e,t){let[n,r,i]=await Promise.allSettled([e.usage(),e.installations(),e.models()]);return{usage:n.status===`fulfilled`?n.value:void 0,installations:r.status===`fulfilled`?r.value:[],models:i.status===`fulfilled`?i.value:[],errors:{...n.status===`rejected`?{usage:t(`usage`,n.reason)}:{},...r.status===`rejected`?{installations:t(`installations`,r.reason)}:{},...i.status===`rejected`?{models:t(`models`,i.reason)}:{}},loading:!1}}function Ae({loading:e,loadError:t,status:n,details:r}){if(e&&!n)return`loading`;if(t)return`load-error`;if(!n?.configured)return`unconfigured`;if(n.sessionServiceMismatch)return`session-mismatch`;if(n.pendingDeviceFlow)return n.hasSession?`connected`:`no-session`;if(!n.hasSession)return`no-session`;let i=Object.values(r.errors);return n.cloudAvailable===!1||i.length===3&&i.every(e=>e?.unavailable)?`cloud-unavailable`:i.length>0?`partial-details`:`connected`}function je(e){let t=e?.configured===!0,n=t&&e.hasSession===!0,r=n&&e.sessionServiceMismatch!==!0;return{showDeviceFlow:t&&!!e.pendingDeviceFlow,showDisconnectedActions:t&&!e.pendingDeviceFlow&&!n,showDetails:r}}function Me(e){return e===`starting`||e===`authorizing`}function Ne(e,t){return!!(e?.hasSession&&(t||e.sessionServiceMismatch))}async function Pe(e,t){await t.reset(),t.onIdentityReset?.();try{return{status:`success`,config:await t.save(e)}}catch(e){return{status:`url-save-failed`,error:e}}}var h=o();function g(e){if(!e)return f(`cloudNotAvailable`);let t=new Date(e);return Number.isNaN(t.getTime())?f(`cloudNotAvailable`):t.toLocaleString(d())}function _(e){let t=e.id||e.installationId;return typeof t==`string`?t:``}function v(e){let t=e.name||e.installationName;return typeof t==`string`&&t?t:f(`cloudUnnamedDevice`)}function Fe(e){return typeof e==`number`&&Number.isFinite(e)?e.toLocaleString(d()):f(`cloudNotAvailable`)}function Ie(e){return f(e===`saved`?`cloudConfigSourceSaved`:e===`env`?`cloudConfigSourceEnv`:`cloudConfigSourceDefault`)}function y(e){let t=String(e||``).toLowerCase();return t===`localhost`||t.endsWith(`.localhost`)||t.startsWith(`127.`)?!0:t===`::1`}function b(e){let t=e.trim();if(!t)return``;let n;try{n=new URL(t)}catch{return f(`cloudUrlInvalid`)}return n.protocol!==`https:`&&n.protocol!==`http:`?f(`cloudUrlInvalidProtocol`):y(n.hostname)&&n.port===`8081`?f(`cloudUrlAdminPort`):``}function x(e){if(!e||typeof e!=`object`)return f(`cloudConnectionUnknown`);let t=e;return t.ok===!0||t.status===`ok`||t.ready===!0?f(`cloudConnectionOk`):f(`cloudConnectionError`)}function S(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.ok===!0||t.status===`ok`||t.ready===!0}function Le(e,t){let n=x(t);return(0,h.jsxs)(`span`,{className:we(`quickforge-settings-badge`,n===f(`cloudConnectionUnknown`)?`quickforge-settings-badge-muted`:S(t)?`quickforge-settings-badge-success`:`quickforge-settings-badge-danger`),children:[e,`: `,n]})}function Re(e){let t=e.quickforgeCapabilities;return[t?.tools?f(`cloudCapabilityTools`):void 0,t?.vision?f(`cloudCapabilityVision`):void 0,t?.reasoning?f(`cloudCapabilityReasoning`):void 0].filter(Boolean).join(` · `)||f(`cloudCapabilityText`)}function ze(e){return f(e?e===`disabled`?`cloudRemoteStatusDisabled`:e===`unavailable`?`cloudRemoteStatusUnavailable`:e===`stopped`?`cloudRemoteStatusStopped`:e===`starting`?`cloudRemoteStatusStarting`:e===`authorizing`?`cloudRemoteStatusAuthorizing`:e===`running`?`cloudRemoteStatusRunning`:e===`conflict`?`cloudRemoteStatusConflict`:`cloudRemoteStatusError`:`cloudRemoteStatusLoading`)}function Be(e,t){let n=e===`usage`?`cloudUsageLoadFailed`:e===`installations`?`cloudDevicesLoadFailed`:`cloudModelsLoadFailed`,r=m(t);return{message:r===f(`cloudRequestFailed`)?f(n):r,unavailable:!(`code`in Object(t))||[`cloud_request_failed`,`cloud_unavailable`].includes(String(t?.code||``))}}function C({error:e,onRetry:n,disabled:r}){return(0,h.jsxs)(`div`,{className:`p-4 text-sm`,children:[(0,h.jsx)(`div`,{className:`quickforge-settings-error`,children:e.message}),(0,h.jsxs)(l,{type:`button`,variant:`outline`,size:`sm`,className:`mt-3`,onClick:n,disabled:r,children:[(0,h.jsx)(t,{className:`mr-2 size-4`}),f(`retry`)]})]})}function w(){let[e,a]=(0,p.useState)(),[o,s]=(0,p.useState)(``),[Se,d]=(0,p.useState)(!1),[y,x]=(0,p.useState)(),[S,w]=(0,p.useState)(),[T,Ve]=(0,p.useState)(),[E,D]=(0,p.useReducer)(Oe,De),[O,He]=(0,p.useState)(!0),[k,A]=(0,p.useState)(``),[Ue,j]=(0,p.useState)(``),[M,N]=(0,p.useState)(``),[We,P]=(0,p.useState)(``),[Ge,Ke]=(0,p.useState)(0),F=(0,p.useRef)(0),I=(0,p.useRef)(0),L=S?.pendingDeviceFlow,R=L?Math.max(0,Math.ceil((L.expiresAt-Ge)/1e3)):0,z=(0,p.useCallback)(()=>D({type:`clear`}),[]),B=(0,p.useCallback)(async()=>{let e=++I.current;try{let t=await Te();e===I.current&&Ve(t)}catch{}},[]),V=(0,p.useCallback)(async(e=!0,t=!1,n=!0)=>{let r=++F.current;e&&He(!0),N(``),D({type:`begin`}),n&&B();try{let[e,n]=await Promise.all([ve(),pe()]);if(r!==F.current)return;if(a(e),t||s(e.cloudUrl),w(n),!e.enabled||!n.configured||!n.hasSession||n.sessionServiceMismatch){z();return}let i=await ke({usage:be,installations:fe,models:me},Be);if(r!==F.current)return;D({type:`replace`,state:i})}catch(e){if(r!==F.current)return;a(void 0),w(void 0),z(),N(m(e,`cloudLoadFailed`))}finally{r===F.current&&He(!1)}},[z,B]);(0,p.useEffect)(()=>{let e=window.setTimeout(()=>{V()},0);return()=>{window.clearTimeout(e),F.current+=1,I.current+=1}},[V]),(0,p.useEffect)(()=>{if(!e?.enabled||!Me(T?.status))return;let t=window.setInterval(()=>{B()},1750);return()=>window.clearInterval(t)},[e?.enabled,B,T?.status]),(0,p.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&B()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[B]),(0,p.useEffect)(()=>{if(!e?.enabled||!S?.pendingDeviceFlow)return;let t=()=>Ke(Date.now()),n=window.setTimeout(t,0),r=window.setInterval(t,1e3);return()=>{window.clearTimeout(n),window.clearInterval(r)}},[e?.enabled,S?.pendingDeviceFlow]),(0,p.useEffect)(()=>{let t=S?.pendingDeviceFlow;if(!e?.enabled||!t||R>0)return;let n=window.setTimeout(()=>{V(!1)},0);return()=>window.clearTimeout(n)},[e?.enabled,R,V,S?.pendingDeviceFlow]),(0,p.useEffect)(()=>{let t=S?.pendingDeviceFlow;if(!e?.enabled||!t||k===`device-start`||k===`device-cancel`)return;let n=Math.max(1,Number(t.interval)||5)*1e3,r=window.setTimeout(async()=>{try{let e=await xe();w(e),e.deviceFlowResult===`success`?(window.dispatchEvent(new Event(_e)),N(``),j(f(`cloudDeviceFlowSucceeded`)),await Promise.all([V(!1,!1,!1),B()])):e.deviceFlowResult===`denied`?N(f(`cloudDeviceFlowDenied`)):e.deviceFlowResult===`expired`?N(f(`cloudDeviceFlowExpired`)):e.deviceFlowResult===`network`&&N(f(`cloudDeviceFlowNetwork`))}catch(e){N(m(e))}},n);return()=>window.clearTimeout(r)},[k,e?.enabled,V,B,S?.pendingDeviceFlow]);let H=()=>window.dispatchEvent(new Event(_e)),qe=async()=>{if(!k){if(b(o)){d(!0);return}A(`test`),j(``),N(``),x(void 0);try{let e=await Ee(o);s(e.cloudUrl),x(e),j(f(`cloudConnectionTestSucceeded`))}catch(e){N(m(e,`cloudConnectionFailed`))}finally{A(``)}}},Je=async()=>{if(!k){if(b(o)){d(!0);return}A(`save`),j(``),N(``);try{let e=await u({cloudUrl:o});a(e),s(e.cloudUrl),x(void 0),P(``),H(),j(f(`cloudConnectionSaved`)),await V(!1)}catch(e){N(m(e))}finally{A(``)}}},Ye=async t=>{if(!(k||!e||e.enabled===t)){A(`cloud-toggle`),j(``),N(``),P(``);try{let e=await u({enabled:t});a(e),s(e.cloudUrl),x(void 0),e.enabled||z(),H(),j(f(e.enabled?`cloudServiceEnabledSaved`:`cloudServiceDisabledSaved`)),await V(!1)}catch(e){N(m(e))}finally{A(``)}}},Xe=async()=>{let t=o.trim()||e?.cloudUrl||``;if(b(t)){d(!0);return}if(!(!await c({title:f(`cloudForceSwitchTitle`),description:f(`cloudForceSwitchDescription`),confirmLabel:f(`cloudForceSwitchConfirm`),cancelLabel:f(`cancel`),variant:`destructive`})||k||!t)){A(`force-switch`),j(``),N(``),P(``);try{let e=await Pe(t,{reset:he,save:e=>u({cloudUrl:e}),onIdentityReset:()=>{F.current+=1,w(e=>e&&{...e,mode:`local`,hasSession:!1,sessionServiceMismatch:!1}),z(),H()}});if(e.status===`url-save-failed`){let t=m(e.error);P(f(`cloudIdentityRebuiltUrlSaveFailed`)),await V(!1,!0),N(t);return}a(e.config),s(e.config.cloudUrl),x(void 0),H(),j(f(`cloudForceSwitchSucceeded`)),await V(!1)}catch(e){N(m(e))}finally{A(``)}}},Ze=async()=>{if(!k){A(`device-start`),j(``),N(``),P(``);try{w(await Ce()),H()}catch(e){N(m(e))}finally{A(``)}}},Qe=async()=>{if(!k){A(`device-cancel`),j(``),N(``);try{w(await ge()),j(f(`cloudDeviceFlowCancelled`))}catch(e){N(m(e))}finally{A(``)}}},$e=async()=>{let e=S?.pendingDeviceFlow?.userCode;if(e)try{await navigator.clipboard.writeText(e),j(f(`cloudDeviceCodeCopied`))}catch{N(f(`copyFailed`))}},et=async()=>{if(!(!await c({title:f(`cloudLogoutTitle`),description:f(`cloudLogoutDescription`),confirmLabel:f(`cloudLogout`),cancelLabel:f(`cancel`),variant:`destructive`})||k)){A(`logout`),j(``),N(``),P(``);try{await ye(),F.current+=1,z(),w(e=>e&&{...e,mode:`local`,hasSession:!1,sessionServiceMismatch:!1}),H(),j(f(`cloudLoggedOut`)),await V(!1)}catch(e){N(m(e))}finally{A(``)}}},tt=async e=>{let t=_(e);if(!(!t||t===S?.installationId||k)&&await c({description:f(`cloudRevokeDeviceConfirm`,{name:v(e)}),confirmLabel:f(`cloudRevokeDevice`),cancelLabel:f(`cancel`),variant:`destructive`})){A(t),j(``),N(``);try{await ue(t),D({type:`replace`,state:{...E,installations:E.installations.filter(e=>_(e)!==t)}}),j(f(`cloudDeviceRevoked`))}catch(e){N(m(e))}finally{A(``)}}},U=e?.enabled===!0,nt=!!(S?.configured&&S.hasSession),W=S?.sessionServiceMismatch===!0,G=nt&&!W,K=!!(e?.cloudUrl&&o.trim()&&e.cloudUrl!==o.trim()),q=b(o),J=!!(q&&Se),rt=Ae({loading:O,loadError:M,status:S,details:E}),Y=je(S),X=rt===`cloud-unavailable`,it=W?f(`cloudSessionMismatchLabel`):S?.mode===`account`?f(`cloudFormalAccount`):f(`cloudNotConnected`),at=ze(T?.status),ot=T?.status===`running`?`quickforge-settings-badge-success`:T?.status===`authorizing`||T?.status===`starting`?`quickforge-settings-badge-info`:T?.status===`error`||T?.status===`conflict`?`quickforge-settings-badge-warning`:`quickforge-settings-badge-muted`,st=U?S?.configured?f(W?`cloudSessionServiceMismatch`:G?X?`cloudUnavailableDescription`:`cloudConnectedDescription`:`cloudLocalOnlyDescription`):f(`cloudNotConfiguredDescription`):f(`cloudServiceDisabledDescription`),Z=()=>{V()},Q=O||E.loading,$=new Map;for(let e of E.installations){let t=v(e);$.set(t,($.get(t)??0)+1)}let ct=[...$.entries()].filter(([,e])=>e>1),lt=ct.reduce((e,[,t])=>e+t,0);return(0,h.jsxs)(`div`,{className:`quickforge-settings-stack`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-heading`,children:[(0,h.jsx)(`div`,{children:(0,h.jsxs)(`h2`,{className:`quickforge-settings-title`,children:[(0,h.jsx)(ce,{className:`size-5`}),f(`cloudAccount`)]})}),(0,h.jsxs)(l,{variant:`outline`,size:`sm`,onClick:()=>void V(),disabled:O||!!k,className:`quickforge-settings-heading-action`,children:[(0,h.jsx)(t,{className:`mr-2 size-4 ${O?`animate-spin`:``}`}),f(`refresh`)]})]}),Ue?(0,h.jsx)(`div`,{className:`quickforge-settings-message`,children:Ue}):null,We?(0,h.jsx)(`div`,{className:`quickforge-settings-warning`,children:We}):null,M?(0,h.jsx)(`div`,{className:`quickforge-settings-error`,children:M}):null,(0,h.jsxs)(`div`,{className:`quickforge-settings-section`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-list-header`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row-title`,children:[(0,h.jsx)(te,{className:`size-4`}),f(`cloudServiceConnection`)]}),(0,h.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-info shrink-0`,children:`QuickForge Cloud`})]}),(0,h.jsxs)(`div`,{className:`quickforge-settings-row`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row-main`,children:[(0,h.jsx)(`div`,{className:`quickforge-settings-row-title`,children:f(`cloudServiceEnabled`)}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-description`,children:f(`cloudServiceEnabledDescription`)})]}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-control`,children:(0,h.jsxs)(`label`,{className:`quickforge-settings-switch`,"aria-label":f(`cloudServiceEnabled`),children:[(0,h.jsx)(`input`,{type:`checkbox`,checked:U,disabled:!e||!!k,onChange:e=>{Ye(e.target.checked)}}),(0,h.jsx)(`span`,{"aria-hidden":`true`})]})})]}),(0,h.jsxs)(`div`,{className:`quickforge-settings-row items-start`,children:[(0,h.jsx)(`div`,{className:`quickforge-settings-row-main`,children:(0,h.jsx)(`label`,{className:`quickforge-settings-row-title h-9 whitespace-nowrap`,htmlFor:`quickforge-cloud-url`,children:f(`cloudUrl`)})}),(0,h.jsxs)(`div`,{className:`quickforge-settings-row-control w-full max-w-xl flex-col items-stretch gap-2`,children:[(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,h.jsx)(de,{id:`quickforge-cloud-url`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&o.trim()&&K&&!k&&(e.preventDefault(),Je())},placeholder:f(`cloudUrlPlaceholder`),inputMode:`url`,autoCapitalize:`none`,autoCorrect:`off`,spellCheck:!1,onBlur:()=>d(!0),"aria-invalid":J,className:we(`min-w-0 flex-1`,J?`border-destructive`:void 0),disabled:!!k}),(0,h.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,h.jsxs)(l,{variant:`outline`,size:`sm`,onClick:()=>void qe(),disabled:!o.trim()||!!q||!!k,children:[k===`test`?(0,h.jsx)(t,{className:`mr-2 size-4 animate-spin`}):(0,h.jsx)(ae,{className:`mr-2 size-4`}),f(`cloudTestConnection`)]}),(0,h.jsxs)(l,{size:`sm`,onClick:()=>void Je(),disabled:!o.trim()||!K||!!q||!!k,children:[k===`save`?(0,h.jsx)(t,{className:`mr-2 size-4 animate-spin`}):(0,h.jsx)(ie,{className:`mr-2 size-4`}),f(`saveChanges`)]})]})]}),J?(0,h.jsx)(`div`,{className:`text-xs text-destructive`,children:q}):null,(0,h.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[f(`cloudConfigSource`),`: `,Ie(e?.source)]}),Ne(S,K)&&!q?(0,h.jsx)(`div`,{className:`quickforge-settings-cloud-force-switch flex justify-end`,children:(0,h.jsxs)(l,{variant:`destructive`,size:`sm`,onClick:()=>void Xe(),disabled:!!k,title:f(`cloudForceSwitchDescription`),children:[(0,h.jsx)(i,{className:`mr-2 size-4`}),f(`cloudForceSwitch`)]})}):null]})]}),e?.configurationError?(0,h.jsx)(`div`,{className:`quickforge-settings-error m-3`,children:f(`cloudConfigurationError`)}):null,y?(0,h.jsxs)(`div`,{className:`quickforge-settings-row`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row-main`,children:[(0,h.jsx)(`div`,{className:`quickforge-settings-row-title`,children:f(`cloudConnectionTestResult`)}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-description break-all`,children:y.cloudUrl})]}),(0,h.jsxs)(`div`,{className:`quickforge-settings-row-control flex-wrap justify-end gap-1.5`,children:[Le(f(`cloudHealth`),y.health),Le(f(`cloudReady`),y.ready)]})]}):null]}),U?(0,h.jsxs)(`div`,{className:`quickforge-settings-section`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row-main`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row-title`,children:[(0,h.jsx)(ee,{className:`size-4`}),f(`cloudRemoteAccess`)]}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-description`,children:f(`cloudRemoteAccessDescription`)})]}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-control`,children:(0,h.jsx)(`span`,{className:`quickforge-settings-badge ${ot}`,children:at})})]}),T?.serverUrl?(0,h.jsxs)(`div`,{className:`quickforge-settings-row`,children:[(0,h.jsx)(`div`,{className:`quickforge-settings-row-main`,children:(0,h.jsx)(`div`,{className:`quickforge-settings-row-title`,children:f(`cloudRemoteServerUrl`)})}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-control break-all text-sm text-muted-foreground`,children:T.serverUrl})]}):null,T?.pid?(0,h.jsxs)(`div`,{className:`quickforge-settings-row`,children:[(0,h.jsx)(`div`,{className:`quickforge-settings-row-main`,children:(0,h.jsx)(`div`,{className:`quickforge-settings-row-title`,children:f(`cloudRemotePid`)})}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-control text-sm font-medium`,children:T.pid})]}):null,T?.status===`authorizing`&&T.verificationUriComplete?(0,h.jsxs)(`div`,{className:`quickforge-settings-row`,children:[(0,h.jsx)(`div`,{className:`quickforge-settings-row-main`,children:(0,h.jsx)(`div`,{className:`quickforge-settings-row-title`,children:f(`cloudRemoteAuthorization`)})}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-control`,children:(0,h.jsxs)(`a`,{className:`inline-flex items-center gap-1 text-sm text-primary hover:underline`,href:T.verificationUriComplete,target:`_blank`,rel:`noreferrer`,children:[f(`cloudRemoteOpenAuthorization`),(0,h.jsx)(se,{className:`size-3.5`})]})})]}):null,T?.error?(0,h.jsx)(`div`,{className:`quickforge-settings-warning quickforge-settings-warning-attached`,children:T.error}):null]}):null,(0,h.jsxs)(`div`,{className:`quickforge-settings-section`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row-main`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row-title`,children:[(0,h.jsx)(oe,{className:`size-4`}),f(`cloudIdentityStatus`)]}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-description`,children:st})]}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-control`,children:(0,h.jsx)(`span`,{className:`quickforge-settings-badge ${G&&!X?`quickforge-settings-badge-success`:W||X?`quickforge-settings-badge-warning`:`quickforge-settings-badge-muted`}`,children:it})})]}),X?(0,h.jsx)(`div`,{className:`quickforge-settings-warning quickforge-settings-warning-attached`,children:f(`cloudUnavailableDescription`)}):null,W?(0,h.jsx)(`div`,{className:`quickforge-settings-warning quickforge-settings-warning-attached`,children:f(`cloudSessionServiceMismatch`)}):null,G?(0,h.jsxs)(h.Fragment,{children:[S?.mode===`account`?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row`,children:[(0,h.jsx)(`div`,{className:`quickforge-settings-row-main`,children:(0,h.jsx)(`div`,{className:`quickforge-settings-row-title`,children:f(`cloudAccountEmail`)})}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-control text-sm font-medium`,children:S.account?.email||f(`cloudNotAvailable`)})]}),(0,h.jsxs)(`div`,{className:`quickforge-settings-row`,children:[(0,h.jsx)(`div`,{className:`quickforge-settings-row-main`,children:(0,h.jsx)(`div`,{className:`quickforge-settings-row-title`,children:f(`cloudAccountPlan`)})}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-control text-sm font-medium`,children:S.account?.plan||f(`cloudNotAvailable`)})]})]}):null,U?E.errors.usage?(0,h.jsx)(C,{error:E.errors.usage,onRetry:Z,disabled:Q||!!k}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row`,children:[(0,h.jsx)(`div`,{className:`quickforge-settings-row-main`,children:(0,h.jsx)(`div`,{className:`quickforge-settings-row-title`,children:f(`cloudRemainingQuota`)})}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-control text-sm font-medium`,children:Fe(E.usage?.remaining)})]}),(0,h.jsxs)(`div`,{className:`quickforge-settings-row`,children:[(0,h.jsx)(`div`,{className:`quickforge-settings-row-main`,children:(0,h.jsx)(`div`,{className:`quickforge-settings-row-title`,children:f(`cloudQuotaExpiresAt`)})}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-control text-sm text-muted-foreground`,children:g(E.usage?.resetsAt||E.usage?.expiresAt)})]})]}):null,(0,h.jsxs)(`div`,{className:`quickforge-settings-row`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row-main`,children:[(0,h.jsx)(`div`,{className:`quickforge-settings-row-title`,children:f(`cloudLogout`)}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-description`,children:f(`cloudLogoutRowDescription`)})]}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-control`,children:(0,h.jsxs)(l,{variant:`destructive`,className:`quickforge-settings-cloud-logout`,onClick:()=>void et(),disabled:!!k,children:[(0,h.jsx)(n,{className:`mr-2 size-4`}),f(`cloudLogout`)]})})]})]}):null]}),!U||!S?.configured?null:Y.showDeviceFlow&&L?(0,h.jsxs)(`div`,{className:`quickforge-settings-section`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-list-header`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row-main`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row-title`,children:[(0,h.jsx)(re,{className:`size-4`}),f(`cloudDeviceFlowTitle`)]}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-description`,children:f(`cloudDeviceFlowDescription`)})]}),(0,h.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-info`,children:f(`cloudDeviceFlowCountdown`,{seconds:R})})]}),(0,h.jsxs)(`div`,{className:`quickforge-settings-row items-start`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row-main`,children:[(0,h.jsx)(`div`,{className:`quickforge-settings-row-description`,children:f(`cloudDeviceCode`)}),(0,h.jsx)(`div`,{className:`mt-1 font-mono text-2xl font-semibold tracking-[0.18em] text-foreground`,children:L.userCode})]}),(0,h.jsxs)(`div`,{className:`quickforge-settings-row-control flex-wrap gap-2`,children:[(0,h.jsxs)(l,{variant:`outline`,size:`sm`,onClick:()=>void $e(),children:[(0,h.jsx)(le,{className:`mr-2 size-4`}),f(`copy`)]}),(0,h.jsxs)(l,{size:`sm`,onClick:()=>window.open(L.verificationUriComplete||L.verificationUri,`_blank`,`noopener,noreferrer`),children:[(0,h.jsx)(se,{className:`mr-2 size-4`}),f(`cloudOpenVerificationPage`)]}),(0,h.jsx)(l,{variant:`outline`,size:`sm`,onClick:()=>void Qe(),disabled:!!k,children:f(`cancel`)})]})]}),S.deviceFlowResult===`slow_down`?(0,h.jsx)(`div`,{className:`quickforge-settings-warning quickforge-settings-warning-attached`,children:f(`cloudDeviceFlowSlowDown`)}):null]}):Y.showDisconnectedActions?(0,h.jsx)(`div`,{className:`quickforge-settings-section`,children:(0,h.jsxs)(`div`,{className:`quickforge-settings-row`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row-main`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-row-title`,children:[(0,h.jsx)(re,{className:`size-4`}),f(`cloudLoginOrRegister`)]}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-description`,children:f(`cloudLoginOrRegisterDescription`)})]}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-control`,children:(0,h.jsxs)(l,{onClick:()=>void Ze(),disabled:O||!!k,children:[(0,h.jsx)(r,{className:`mr-2 size-4`}),f(`cloudLoginOrRegister`)]})})]})}):Y.showDetails?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-section`,children:[(0,h.jsx)(`div`,{className:`quickforge-settings-list-header`,children:(0,h.jsxs)(`div`,{className:`quickforge-settings-row-title`,children:[(0,h.jsx)(ne,{className:`size-4`}),f(`cloudModels`)]})}),E.errors.models?(0,h.jsx)(C,{error:E.errors.models,onRetry:Z,disabled:Q||!!k}):E.models.length===0?(0,h.jsx)(`div`,{className:`p-6 text-center text-sm text-muted-foreground`,children:f(Q?`loading`:`cloudNoModels`)}):E.models.map(e=>(0,h.jsx)(`div`,{className:`quickforge-settings-list-item`,children:(0,h.jsxs)(`div`,{className:`quickforge-settings-list-item-main`,children:[(0,h.jsx)(`div`,{className:`text-sm font-medium`,children:e.name||e.id}),(0,h.jsxs)(`div`,{className:`quickforge-settings-row-description`,children:[e.id,` · `,Re(e)]})]})},`${e.provider}:${e.id}`))]}),(0,h.jsxs)(`div`,{className:`quickforge-settings-section`,children:[(0,h.jsx)(`div`,{className:`quickforge-settings-list-header`,children:(0,h.jsxs)(`div`,{className:`quickforge-settings-row-title`,children:[(0,h.jsx)(ee,{className:`size-4`}),f(`cloudDevices`)]})}),lt>1?(0,h.jsx)(`div`,{className:`quickforge-settings-warning quickforge-settings-warning-attached`,children:f(`cloudDuplicateDevicesHint`,{count:lt,name:ct[0][0]})}):null,E.errors.installations?(0,h.jsx)(C,{error:E.errors.installations,onRetry:Z,disabled:Q||!!k}):E.installations.length===0?(0,h.jsx)(`div`,{className:`p-6 text-center text-sm text-muted-foreground`,children:f(Q?`loading`:`cloudNoDevices`)}):E.installations.map(e=>{let t=_(e),n=e.current===!0||t===S?.installationId;return(0,h.jsxs)(`div`,{className:`quickforge-settings-list-item`,children:[(0,h.jsxs)(`div`,{className:`quickforge-settings-list-item-main`,children:[(0,h.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,h.jsx)(`div`,{className:`truncate text-sm font-medium`,children:v(e)}),n?(0,h.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-info`,children:f(`cloudCurrentDevice`)}):null]}),(0,h.jsx)(`div`,{className:`quickforge-settings-row-description`,children:[e.platform,e.createdAt?`${f(`cloudRegisteredAt`)} ${g(e.createdAt)}`:void 0,e.lastSeenAt?`${f(`cloudLastSeenAt`)} ${g(e.lastSeenAt)}`:void 0,t?`#${t.slice(0,8)}`:void 0].filter(Boolean).join(` · `)||f(`cloudNotAvailable`)})]}),(0,h.jsx)(`div`,{className:`quickforge-settings-list-item-actions`,children:(0,h.jsx)(l,{variant:`outline`,size:`sm`,onClick:()=>void tt(e),disabled:n||!!k,children:f(`cloudRevokeDevice`)})})]},t||v(e))})]})]}):null]})}export{w as CloudAccountSettingsPage};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{C as t,o as n,q as r,qt as i,w as a}from"./icons-2D18YbSI.js";import{n as o}from"./react-vendor-3UaA-C9W.js";import{yn as s}from"./index-BivLuZvX.js";import{n as c,r as l,t as u}from"./plugin-api-Uu2xAB4d.js";var d=e(i(),1),f=o();function p(e){switch(e){case`documents`:return{label:s(`pluginDocumentsName`),description:s(`pluginDocumentsDescription`)};case`spreadsheets`:return{label:s(`pluginSpreadsheetsName`),description:s(`pluginSpreadsheetsDescription`)};case`presentations`:return{label:s(`pluginPresentationsName`),description:s(`pluginPresentationsDescription`)};default:return null}}function m(e){return p(e.name)?.label||(e.displayName||e.name).replace(/^OpenAI\s+/i,``)}function h(e){return p(e.name)?.description||e.description||s(`noDescription`)}function g({onChanged:e}){let[i,o]=(0,d.useState)(null),[p,g]=(0,d.useState)(!0),[_,v]=(0,d.useState)(null),[y,b]=(0,d.useState)(null),x=(0,d.useCallback)(async(t=`load`)=>{b(null),g(!0);try{o(t===`reload`?await c():await u()),t===`reload`&&e?.()}catch(e){b(e instanceof Error?e.message:s(`pluginsLoadFailed`))}finally{g(!1)}},[e]);(0,d.useEffect)(()=>{let e=!1;return u().then(t=>{e||o(t)}).catch(t=>{e||b(t instanceof Error?t.message:s(`pluginsLoadFailed`))}).finally(()=>{e||g(!1)}),()=>{e=!0}},[]);let S=(0,d.useMemo)(()=>{let e=i?.plugins||[];return{total:e.length,enabled:e.filter(e=>e.enabled).length}},[i]),C=(0,d.useMemo)(()=>i?.plugins||[],[i]),w=async(t,n)=>{v(t),b(null);try{o(await l(t,n)),e?.()}catch(e){b(e instanceof Error?e.message:s(`pluginsSaveFailed`))}finally{v(null)}};return(0,f.jsx)(`div`,{className:`quickforge-settings-stack`,children:(0,f.jsxs)(`section`,{className:`quickforge-settings-section`,"aria-label":s(`plugins`),children:[(0,f.jsxs)(`div`,{className:`quickforge-settings-toolbar`,children:[(0,f.jsxs)(`div`,{className:`quickforge-settings-row-main`,children:[(0,f.jsxs)(`div`,{className:`quickforge-settings-row-title`,children:[(0,f.jsx)(a,{className:`size-4 text-primary`}),s(`plugins`)]}),(0,f.jsx)(`div`,{className:`quickforge-settings-row-description`,children:s(`pluginsDescription`)}),(0,f.jsx)(`div`,{className:`quickforge-settings-meta`,children:(0,f.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:s(`pluginsCount`,S)})})]}),(0,f.jsxs)(`button`,{className:`quickforge-settings-button quickforge-settings-button-secondary`,type:`button`,onClick:()=>void x(`reload`),disabled:p,children:[p?(0,f.jsx)(r,{className:`mr-2 size-4 animate-spin`}):(0,f.jsx)(t,{className:`mr-2 size-4`}),s(`pluginsReload`)]})]}),y?(0,f.jsx)(`div`,{className:`quickforge-settings-alert quickforge-settings-warning-attached`,children:y}):null,i?.errors?.length?(0,f.jsxs)(`div`,{className:`quickforge-settings-warning quickforge-settings-warning-attached`,children:[(0,f.jsxs)(`div`,{className:`mb-2 inline-flex items-center gap-2 font-medium`,children:[(0,f.jsx)(n,{className:`size-4`}),s(`pluginDiscoveryErrors`)]}),i.errors.map((e,t)=>(0,f.jsxs)(`div`,{className:`break-all text-sm`,children:[(0,f.jsx)(`code`,{className:`quickforge-settings-command-name`,children:e.dir}),`: `,e.error]},`${e.dir}-${t}`))]}):null,p&&!i?(0,f.jsxs)(`div`,{className:`quickforge-settings-empty-row inline-flex items-center gap-2`,children:[(0,f.jsx)(r,{className:`size-4 animate-spin`}),s(`loadingPlugins`)]}):null,!p&&i&&i.plugins.length===0?(0,f.jsxs)(`div`,{className:`quickforge-settings-empty-row`,children:[(0,f.jsx)(`div`,{className:`quickforge-settings-row-title`,children:s(`noPlugins`)}),(0,f.jsx)(`div`,{className:`quickforge-settings-row-description`,children:s(`noPluginsDescription`)}),(0,f.jsx)(`div`,{className:`quickforge-settings-meta`,children:(i.searchPaths||[]).map(e=>(0,f.jsx)(`code`,{className:`quickforge-settings-command-name`,children:e},e))})]}):null,C.map(e=>(0,f.jsx)(`article`,{className:`quickforge-settings-list-item quickforge-settings-list-item--column`,children:(0,f.jsxs)(`div`,{className:`quickforge-settings-list-item-header`,children:[(0,f.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,f.jsx)(`span`,{className:`quickforge-settings-row-title`,children:m(e)}),(0,f.jsx)(`span`,{className:`quickforge-settings-row-description`,children:h(e)}),e.error?(0,f.jsx)(`span`,{className:`quickforge-settings-alert mt-3 block`,children:e.error}):null]}),(0,f.jsx)(`div`,{className:`quickforge-settings-list-item-actions`,children:(0,f.jsxs)(`label`,{className:`quickforge-settings-switch`,"aria-disabled":_===e.name?`true`:`false`,children:[(0,f.jsx)(`input`,{type:`checkbox`,checked:e.enabled,disabled:_===e.name,onChange:t=>void w(e.name,t.target.checked)}),(0,f.jsx)(`span`,{"aria-hidden":`true`})]})})]})},e.name))]})})}export{g as PluginsPage};
@@ -0,0 +1,2 @@
1
+ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Dt as n,Lt as r,Rt as i,Tt as a,Wt as o,at as ee,d as te,ft as ne,mt as re,qt as s,s as ie,t as ae,y as oe}from"./icons-2D18YbSI.js";import{n as c}from"./react-vendor-3UaA-C9W.js";import{t as se}from"./model-display-label-C6-0eDxF.js";import{n as ce,r as le,t as ue}from"./model-reference-o41fJ6jQ.js";import{$t as de,Qt as l,Tt as fe,fn as pe,hn as u,ln as d,mn as f,nn as me,tn as he,yn as p}from"./index-BivLuZvX.js";import{i as m,n as h,t as ge}from"./model-identity-CgA6_Pbm.js";var g=e(s(),1),_=c(),_e=[{value:`off`,label:()=>p(`thinkingOff`)},{value:`low`,label:()=>p(`thinkingLow`)},{value:`medium`,label:()=>p(`thinkingMedium`)},{value:`high`,label:()=>p(`thinkingHigh`)},{value:`xhigh`,label:()=>p(`thinkingXHigh`)}];function ve(e,t){return m(e,t)}function v(e){return String(e).padStart(2,`0`)}function y(e){if(!e)return`-`;let t=new Date(e);return Number.isNaN(t.getTime())?`-`:`${t.getFullYear()}-${v(t.getMonth()+1)}-${v(t.getDate())} ${v(t.getHours())}:${v(t.getMinutes())}`}function ye(e,t=20){let n=String(e||``).trim();return n.length>t?`${n.slice(0,t)}...`:n}function be(){return{scheduleText:``,title:``,instruction:``,cronExpression:``,scheduleRule:``,nextRunAt:``,enabled:!0,agentId:``,executionMode:`serial`}}function b(){return{taskId:``,status:``,trigger:``,keyword:``,startedFrom:``,startedTo:``,page:1,pageSize:10}}function xe(e){return{scheduleText:[e.scheduleRule,e.instruction].filter(Boolean).join(`
2
+ `),title:e.title,instruction:e.instruction,cronExpression:e.cronExpression??``,scheduleRule:e.scheduleRule,nextRunAt:e.nextRunAt,enabled:e.status!==`paused`,agentId:e.agentId??``,executionMode:e.executionMode??`serial`}}function Se(e,t){return{...t,title:e.title,instruction:e.instruction,cronExpression:e.cronExpression??``,scheduleRule:e.scheduleRule,nextRunAt:e.nextRunAt,enabled:t.enabled}}function Ce(e){return{title:e.title.trim(),instruction:e.instruction.trim(),scheduleType:`cron`,scheduleRule:e.scheduleRule.trim()||e.cronExpression.trim(),cronExpression:e.cronExpression.trim(),nextRunAt:e.nextRunAt,enabled:e.enabled,agentId:e.agentId||null,executionMode:e.executionMode}}function x(e){return!!(e.currentRunId||e.currentRunIds?.length)}function we(e){return(e.executionMode??`serial`)===`parallel`||!x(e)}function Te(e){return p(e===`parallel`?`taskExecutionModeParallel`:`taskExecutionModeSerial`)}function Ee(e){return!!(e.title.trim()&&e.instruction.trim()&&e.cronExpression.trim())}function De(e){return p(e===`enabled`?`taskEnabled`:e===`running`?`taskRunning`:e===`paused`?`taskPaused`:e===`completed`?`taskFinished`:e===`success`?`executionSuccess`:`taskFailed`)}function Oe(e){return e===`enabled`||e===`success`?`bg-emerald-500/10 text-emerald-700`:e===`running`?`bg-blue-500/10 text-blue-700`:e===`paused`?`bg-amber-500/10 text-amber-700`:`bg-muted text-muted-foreground`}async function S(e,t){let n=await fetch(e,{...t,headers:{"content-type":`application/json`,...t?.headers}}),r=await n.json().catch(()=>null);if(!n.ok)throw Error(r?.error||`请求失败`);return r}function C({onOpenSession:e}){let[s,c]=(0,g.useState)([]),[m,v]=(0,g.useState)(`tasks`),[C,w]=(0,g.useState)(()=>be()),[T,ke]=(0,g.useState)(null),[E,D]=(0,g.useState)(null),[O,k]=(0,g.useState)(null),[A,j]=(0,g.useState)(!1),[M,N]=(0,g.useState)(null),[Ae,P]=(0,g.useState)(``),[F,I]=(0,g.useState)(!1),[L,R]=(0,g.useState)(``),[z,je]=(0,g.useState)([]),[B,V]=(0,g.useState)(),[Me,H]=(0,g.useState)(`off`),[Ne,Pe]=(0,g.useState)([]),[Fe,Ie]=(0,g.useState)(``),[U,W]=(0,g.useState)(()=>b()),[G,K]=(0,g.useState)(()=>b()),[q,Le]=(0,g.useState)({runs:[],total:0,page:1,pageSize:10}),[Re,ze]=(0,g.useState)(!1),[Be,Ve]=(0,g.useState)(null),[He,Ue]=(0,g.useState)([]),We=Ne[0]?.id??``;(0,g.useEffect)(()=>{if(!O)return;let e=()=>k(null);return window.addEventListener(`click`,e),window.addEventListener(`blur`,e),()=>{window.removeEventListener(`click`,e),window.removeEventListener(`blur`,e)}},[O]);async function Ge(){c((await S(`/api/scheduled-tasks`)).tasks)}async function J(e=G){ze(!0),R(``);try{let t=new URLSearchParams;t.set(`page`,String(e.page)),t.set(`pageSize`,String(e.pageSize)),e.taskId&&t.set(`taskId`,e.taskId),e.status&&t.set(`status`,e.status),e.trigger&&t.set(`trigger`,e.trigger),e.keyword.trim()&&t.set(`keyword`,e.keyword.trim()),e.startedFrom&&t.set(`startedFrom`,e.startedFrom),e.startedTo&&t.set(`startedTo`,e.startedTo),Le(await S(`/api/scheduled-tasks/runs?${t.toString()}`))}catch(e){R(e instanceof Error?e.message:p(`requestFailed`))}finally{ze(!1)}}(0,g.useEffect)(()=>{let e=!1;async function t(){try{let t=await S(`/api/project`);if(e)return;Pe(t.projects??[])}catch{}}return t(),()=>{e=!0}},[]),(0,g.useEffect)(()=>{let e=!1;async function t(){try{let t=await he(),[n,r]=await Promise.all([de(t),ue().catch(()=>[])]),i=r.length?r:n,a=i.filter(d),o=await me(t),ee=(o.model&&d(o.model)?a.find(e=>ve(e,o.model))||(le(o.model)?a.find(e=>e.quickforgeCatalogId===o.model.quickforgeCatalogId):void 0):void 0)??a[0];if(e)return;je(i),V(ee),H(o.thinkingLevel??l(ee))}catch(t){e||R(t instanceof Error?t.message:p(`requestFailed`))}}return t(),()=>{e=!0}},[]),(0,g.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await S(`/api/scheduled-tasks`);e||c(t.tasks)}catch(t){e||R(t instanceof Error?t.message:p(`requestFailed`))}};t();let n=window.setInterval(t,10*1e3);return()=>{e=!0,window.clearInterval(n)}},[]),(0,g.useEffect)(()=>{let e=!1;async function t(){try{let t=await S(`/api/agent-profiles`);if(e)return;Ue(t.agents)}catch(t){e||R(t instanceof Error?t.message:p(`requestFailed`))}}return t(),()=>{e=!0}},[]);let Ke=(0,g.useMemo)(()=>s.find(e=>e.id===T),[T,s]),qe=(0,g.useMemo)(()=>z.filter(d),[z]),Je=(0,g.useMemo)(()=>ge(qe,B),[qe,B]),Y=(0,g.useMemo)(()=>s.find(e=>e.id===E)??null,[E,s]),Ye=(0,g.useMemo)(()=>s.filter(e=>e.status===`enabled`).length,[s]),Xe=Math.max(1,Math.ceil(q.total/q.pageSize));function Ze(e){return e?He.find(t=>t.id===e||t.name===e)?.label??e:p(`defaultAgent`)}function X(e,t){w(n=>({...n,[e]:t}))}function Z(e,t){W(n=>({...n,[e]:t}))}function Qe(){let e=z.find(d);ke(null),Ie(We),V(e),H(l(e)),w(be()),N(null),P(``),R(``)}function $e(){Qe(),j(!0)}function Q(){F||(j(!1),Qe())}function et(){let e={...U,page:1};W(e),K(e),J(e)}function tt(){let e=b();W(e),K(e),J(e)}function nt(e){let t=Math.min(Math.max(1,e),Xe),n={...G,page:t};W(n),K(n),J(n)}function rt(e){let t={...G,page:1,pageSize:e};W(t),K(t),J(t)}async function it(){let e=C.scheduleText.trim();if(e){I(!0),R(``);try{let t=await S(`/api/scheduled-tasks/parse`,{method:`POST`,body:JSON.stringify({instruction:e,modelRef:B?ce(B):void 0,model:B,thinkingLevel:Me})});if(t.needMoreInfo||!t.task){P(t.question||`请补充任务信息。`),N(null);return}let n=t.task;P(``),N(n),w(e=>Se(n,e))}catch(e){R(e instanceof Error?e.message:p(`requestFailed`))}finally{I(!1)}}}async function at(){if(Ee(C)){I(!0),R(``);try{let e=Ne.find(e=>e.id===Fe),t={task:Ce(C),modelRef:B?ce(B):void 0,model:B,thinkingLevel:Me,projectId:e?.id,projectName:e?.name};T?await S(`/api/scheduled-tasks/${encodeURIComponent(T)}`,{method:`PUT`,body:JSON.stringify(t)}):await S(`/api/scheduled-tasks`,{method:`POST`,body:JSON.stringify(t)}),Q(),await Ge(),m===`history`&&await J(G)}catch(e){R(e instanceof Error?e.message:p(`requestFailed`))}finally{I(!1)}}}function ot(e){k(null),ke(e.id),w(xe(e)),N(null),P(``),R(``),Ie(e.projectId??``),e.model&&V(e.model),e.thinkingLevel&&H(e.thinkingLevel),j(!0)}async function $(e,t){if(R(``),k(null),!(t===`delete`&&!await fe({description:p(`confirmDeleteTask`),confirmLabel:p(`confirmDelete`),cancelLabel:p(`cancel`),variant:`destructive`})))try{t===`delete`?(await S(`/api/scheduled-tasks/${encodeURIComponent(e)}`,{method:`DELETE`}),T===e&&Q(),E===e&&D(null)):await S(`/api/scheduled-tasks/${encodeURIComponent(e)}/${t}`,{method:`POST`}),await Ge(),m===`history`&&await J(G)}catch(e){R(e instanceof Error?e.message:p(`requestFailed`))}}function st(t){return(0,_.jsxs)(`div`,{className:`mt-2 space-y-2 text-xs text-muted-foreground`,children:[t.sessionId?(0,_.jsx)(f,{variant:`outline`,size:`sm`,onClick:()=>e?.(t.sessionId),children:p(`viewConversation`)}):null,(0,_.jsxs)(`div`,{children:[p(`executionAgent`),t.agentLabel||Ze(t.agentId)]}),t.warning?(0,_.jsx)(`div`,{className:`text-amber-600`,children:t.warning}):null,t.inputContent?(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`div`,{className:`font-medium text-foreground`,children:p(`runInputContent`)}),(0,_.jsx)(`pre`,{className:`mt-1 max-h-32 overflow-auto whitespace-pre-wrap`,children:t.inputContent})]}):null,t.aiResult||t.result?(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`div`,{className:`font-medium text-foreground`,children:p(`runAiResult`)}),(0,_.jsx)(`pre`,{className:`mt-1 max-h-48 overflow-auto whitespace-pre-wrap`,children:t.aiResult||t.result})]}):null,t.errorMessage?(0,_.jsx)(`div`,{className:`text-destructive`,children:t.errorMessage}):null,t.durationMs?(0,_.jsxs)(`div`,{children:[p(`runDuration`),t.durationMs,`ms`]}):null]})}return(0,_.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:[(0,_.jsxs)(`div`,{className:`border-b border-border px-6 py-5`,children:[(0,_.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-3`,children:A||Y?(0,_.jsxs)(f,{variant:`outline`,onClick:()=>{A?Q():D(null)},children:[(0,_.jsx)(o,{className:`mr-1 size-4`}),p(`back`)]}):(0,_.jsx)(f,{onClick:$e,children:p(`createTask`)})}),!A&&!Y?(0,_.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,_.jsxs)(`button`,{type:`button`,className:u(`rounded-full px-4 py-2 text-sm font-medium transition-colors`,m===`tasks`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:text-foreground`),onClick:()=>v(`tasks`),children:[p(`taskListTab`),` `,(0,_.jsx)(`span`,{className:`opacity-80`,children:s.length})]}),(0,_.jsx)(`button`,{type:`button`,className:u(`rounded-full px-4 py-2 text-sm font-medium transition-colors`,m===`history`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:text-foreground`),onClick:()=>{v(`history`),J(G)},children:p(`executionHistoryTab`)})]}):null]}),(0,_.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:(0,_.jsx)(`div`,{className:`mx-auto max-w-5xl space-y-5`,children:A?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{className:`rounded-xl border border-border bg-card p-5 space-y-4`,children:[(0,_.jsxs)(`h2`,{className:`inline-flex items-center gap-1.5 text-base font-semibold text-foreground`,children:[p(Ke?`editTask`:`createTask`),(0,_.jsx)(pe,{label:p(`quickAiParseTask`)})]}),(0,_.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[p(`taskScheduleDescriptionLabel`),(0,_.jsx)(`textarea`,{className:`mt-1 min-h-24 w-full resize-y rounded-xl border border-input bg-background px-3 py-2 text-sm outline-none transition-colors placeholder:text-muted-foreground/65 focus:border-ring`,value:C.scheduleText,onChange:e=>X(`scheduleText`,e.target.value),placeholder:p(`taskScheduleDescriptionPlaceholder`)})]}),(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,_.jsxs)(f,{onClick:it,disabled:F||!B||!C.scheduleText.trim(),children:[(0,_.jsx)(te,{className:`mr-1 size-3.5`}),p(`aiParseTask`)]}),Ae?(0,_.jsx)(`span`,{className:`text-sm text-amber-600`,children:Ae}):null]}),(0,_.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,_.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[p(`taskTitleLabel`),(0,_.jsx)(`input`,{className:`mt-1 h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:border-ring`,value:C.title,onChange:e=>X(`title`,e.target.value),placeholder:p(`taskTitlePlaceholder`)})]}),(0,_.jsxs)(`div`,{className:`block text-sm font-medium text-foreground`,children:[p(`executionRule`),(0,_.jsx)(`div`,{className:`mt-1 flex h-10 items-center rounded-md border border-input bg-muted/20 px-3 text-sm text-muted-foreground`,children:C.scheduleRule||`-`})]}),(0,_.jsxs)(`div`,{className:`block text-sm font-medium text-foreground`,children:[`cron`,(0,_.jsx)(`div`,{className:`mt-1 flex h-10 items-center rounded-md border border-input bg-muted/20 px-3 font-mono text-sm text-muted-foreground`,children:C.cronExpression||`-`})]}),(0,_.jsxs)(`div`,{className:`block text-sm font-medium text-foreground`,children:[p(`nextExecutionTime`),(0,_.jsx)(`div`,{className:`mt-1 flex h-10 items-center rounded-md border border-input bg-muted/20 px-3 text-sm text-muted-foreground`,children:y(C.nextRunAt)})]}),(0,_.jsxs)(`label`,{className:`block text-sm font-medium text-foreground sm:col-span-2`,children:[(0,_.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[p(`taskExecutionMode`),(0,_.jsx)(pe,{label:p(`taskExecutionModeHelp`)})]}),(0,_.jsxs)(`select`,{className:`mt-1 h-10 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:border-ring`,value:C.executionMode,onChange:e=>X(`executionMode`,e.target.value),children:[(0,_.jsx)(`option`,{value:`serial`,children:p(`taskExecutionModeSerial`)}),(0,_.jsx)(`option`,{value:`parallel`,children:p(`taskExecutionModeParallel`)})]})]}),(0,_.jsxs)(`label`,{className:`block text-sm font-medium text-foreground sm:col-span-2`,children:[p(`promptContentLabel`),(0,_.jsx)(`textarea`,{className:`mt-1 min-h-28 w-full resize-y rounded-xl border border-input bg-background px-3 py-2 text-sm text-foreground outline-none transition-colors placeholder:text-muted-foreground/65 focus:border-ring`,value:C.instruction,onChange:e=>X(`instruction`,e.target.value),placeholder:p(`promptContentPlaceholder`)})]})]}),(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground`,children:[(0,_.jsx)(`input`,{type:`checkbox`,checked:C.enabled,onChange:e=>X(`enabled`,e.target.checked)}),p(`taskEnabledSwitch`)]}),(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-xl border border-border bg-muted/20 px-2 py-2`,children:[(0,_.jsxs)(`span`,{className:`relative inline-flex items-center`,children:[(0,_.jsx)(te,{className:`pointer-events-none absolute left-2 size-3.5 text-muted-foreground/70`}),(0,_.jsxs)(`select`,{className:`h-8 max-w-[240px] rounded-md border border-transparent bg-transparent pl-7 pr-2 text-xs text-muted-foreground outline-none hover:bg-background focus:border-ring`,value:B?h(B):``,onChange:e=>{let t=Je.find(t=>h(t)===e.target.value);V(t),H(l(t))},title:p(`taskModel`),children:[Je.length===0?(0,_.jsx)(`option`,{value:``,children:p(`noModelAvailable`)}):null,Je.map(e=>(0,_.jsxs)(`option`,{value:h(e),children:[se(e),ve(e,B)?` ✓`:``]},h(e)))]})]}),(0,_.jsxs)(`span`,{className:`relative inline-flex items-center`,children:[(0,_.jsx)(r,{className:`pointer-events-none absolute left-2 size-3.5 text-muted-foreground/70`}),(0,_.jsx)(`select`,{className:`h-8 rounded-md border border-transparent bg-transparent pl-7 pr-2 text-xs text-muted-foreground outline-none hover:bg-background focus:border-ring`,value:Me,onChange:e=>H(e.target.value),title:p(`taskThinking`),children:_e.map(e=>(0,_.jsx)(`option`,{value:e.value,children:e.label()},e.value))})]}),(0,_.jsxs)(`span`,{className:`relative inline-flex items-center`,children:[(0,_.jsx)(ee,{className:`pointer-events-none absolute left-2 size-3.5 text-muted-foreground/70`}),(0,_.jsxs)(`select`,{className:`h-8 max-w-[220px] rounded-md border border-transparent bg-transparent pl-7 pr-2 text-xs text-muted-foreground outline-none hover:bg-background focus:border-ring`,value:Fe,onChange:e=>Ie(e.target.value),title:p(`taskProjectLabel`),children:[(0,_.jsx)(`option`,{value:``,children:p(`noProjectBound`)}),Ne.map(e=>(0,_.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,_.jsxs)(`span`,{className:`relative inline-flex items-center`,children:[(0,_.jsx)(i,{className:`pointer-events-none absolute left-2 size-3.5 text-muted-foreground/70`}),(0,_.jsxs)(`select`,{className:`h-8 max-w-[220px] rounded-md border border-transparent bg-transparent pl-7 pr-2 text-xs text-muted-foreground outline-none hover:bg-background focus:border-ring`,value:C.agentId,onChange:e=>X(`agentId`,e.target.value),title:p(`executionAgent`),children:[(0,_.jsx)(`option`,{value:``,children:p(`defaultAgent`)}),He.map(e=>(0,_.jsx)(`option`,{value:e.id,children:e.label},e.id))]})]})]}),M?(0,_.jsxs)(`div`,{className:`rounded-xl border border-border bg-muted/30 p-3 text-sm`,children:[(0,_.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 font-medium text-foreground`,children:[(0,_.jsx)(n,{className:`size-4 text-emerald-600`}),p(`aiParsed`)]}),(0,_.jsxs)(`div`,{className:`grid gap-2 text-muted-foreground sm:grid-cols-2`,children:[(0,_.jsxs)(`div`,{children:[p(`taskName`),(0,_.jsx)(`span`,{className:`text-foreground`,children:M.title})]}),(0,_.jsxs)(`div`,{children:[p(`executionRule`),(0,_.jsx)(`span`,{className:`text-foreground`,children:M.scheduleRule})]}),(0,_.jsxs)(`div`,{children:[`cron:`,(0,_.jsx)(`span`,{className:`font-mono text-foreground`,children:M.cronExpression??`-`})]}),(0,_.jsxs)(`div`,{children:[p(`nextExecutionTime`),(0,_.jsx)(`span`,{className:`text-foreground`,children:y(M.nextRunAt)})]}),(0,_.jsxs)(`div`,{className:`sm:col-span-2`,children:[p(`aiInstruction`),(0,_.jsx)(`span`,{className:`text-foreground`,children:M.instruction})]})]})]}):null,L?(0,_.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:L}):null]}),(0,_.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,_.jsx)(f,{variant:`outline`,onClick:Q,disabled:F,children:p(`cancel`)}),(0,_.jsx)(f,{onClick:at,disabled:F||!B||!Ee(C),children:p(Ke?`saveTask`:`confirmCreate`)})]})]}):Y?(0,_.jsxs)(`div`,{className:`rounded-xl border border-border bg-card`,children:[(0,_.jsx)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 border-b border-border px-5 py-4`,children:(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:Y.title}),(0,_.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:Y.scheduleRule})]})}),(0,_.jsx)(`div`,{className:`px-5 py-4`,children:(0,_.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`div`,{className:`mb-1 font-medium text-foreground`,children:p(`taskContent`)}),(0,_.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap rounded-xl border border-border bg-muted/20 p-3 text-muted-foreground`,children:Y.instruction})]}),(0,_.jsxs)(`div`,{className:`grid gap-3 text-muted-foreground sm:grid-cols-2`,children:[(0,_.jsxs)(`div`,{children:[p(`executionRule`),(0,_.jsx)(`span`,{className:`text-foreground`,children:Y.scheduleRule})]}),(0,_.jsxs)(`div`,{children:[p(`taskExecutionMode`),`:`,(0,_.jsx)(`span`,{className:`text-foreground`,children:Te(Y.executionMode)})]}),(0,_.jsxs)(`div`,{children:[`cron:`,(0,_.jsx)(`span`,{className:`font-mono text-foreground`,children:Y.cronExpression??`-`})]}),(0,_.jsxs)(`div`,{children:[p(`lastExecution`),(0,_.jsx)(`span`,{className:`text-foreground`,children:y(Y.lastRunAt)})]}),(0,_.jsxs)(`div`,{children:[p(`nextExecution`),(0,_.jsx)(`span`,{className:`text-foreground`,children:y(Y.nextRunAt)})]}),(0,_.jsxs)(`div`,{children:[p(`executionAgent`),(0,_.jsx)(`span`,{className:`text-foreground`,children:Ze(Y.agentId)})]}),Y.projectName?(0,_.jsxs)(`div`,{children:[p(`taskProject`),(0,_.jsx)(`span`,{className:`text-foreground`,children:Y.projectName})]}):null,Y.model?(0,_.jsxs)(`div`,{children:[p(`taskModel`),`:`,(0,_.jsx)(`span`,{className:`text-foreground`,children:se(Y.model)})]}):null,Y.thinkingLevel?(0,_.jsxs)(`div`,{children:[p(`taskThinkingLevel`),(0,_.jsx)(`span`,{className:`text-foreground`,children:_e.find(e=>e.value===Y.thinkingLevel)?.label()??Y.thinkingLevel})]}):null,(0,_.jsxs)(`div`,{children:[p(`createdAt`),`:`,(0,_.jsx)(`span`,{className:`text-foreground`,children:y(Y.createdAt)})]})]}),Y.runs?.length>0?(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`div`,{className:`mb-2 font-medium text-foreground`,children:p(`recentExecutions`)}),(0,_.jsx)(`div`,{className:`space-y-2`,children:Y.runs.slice(0,5).map(e=>(0,_.jsxs)(`details`,{className:`rounded-lg border border-border bg-muted/20 p-2 text-xs text-muted-foreground`,children:[(0,_.jsxs)(`summary`,{className:`cursor-pointer text-foreground`,children:[y(e.startedAt),` · `,e.trigger===`manual`?p(`manualRun`):p(`autoRun`),` · `,De(e.status)]}),st(e)]},e.id))})]}):null]})}),(0,_.jsx)(`div`,{className:`border-t border-border px-5 py-4`,children:(0,_.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[Y.lastSessionId?(0,_.jsx)(f,{variant:`outline`,onClick:()=>e?.(Y.lastSessionId),children:p(`viewConversation`)}):null,(0,_.jsxs)(f,{variant:`outline`,disabled:!we(Y),onClick:()=>void $(Y.id,`run`),children:[(0,_.jsx)(ae,{className:`mr-1 size-3.5`}),p(`executeNow`)]}),(0,_.jsxs)(f,{variant:`outline`,disabled:x(Y),onClick:()=>ot(Y),children:[(0,_.jsx)(t,{className:`mr-1 size-3.5`}),p(`editTask`)]}),(0,_.jsxs)(f,{variant:`destructive`,disabled:x(Y),onClick:()=>void $(Y.id,`delete`),children:[(0,_.jsx)(ie,{className:`mr-1 size-3.5`}),p(`deleteTask`)]})]})})]}):(0,_.jsxs)(_.Fragment,{children:[L?(0,_.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:L}):null,m===`tasks`?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`div`,{className:`rounded-xl border border-border bg-card p-4`,children:(0,_.jsx)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:p(`taskList`)}),(0,_.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:p(`tasksCount`,{total:s.length,enabled:Ye})})]})})}),(0,_.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:s.length===0?(0,_.jsx)(`div`,{className:`rounded-lg px-3 py-3 text-center text-xs text-muted-foreground/55 md:col-span-2`,children:p(`noScheduledTasks`)}):s.map(e=>{let n=e.status===`enabled`,r=e.status===`completed`,o=x(e);return(0,_.jsxs)(`div`,{className:`relative cursor-pointer rounded-xl border border-border bg-card p-4 transition-colors hover:bg-muted/15`,onClick:()=>D(e.id),children:[(0,_.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,_.jsx)(`h3`,{className:`truncate text-sm font-medium text-foreground/90`,children:e.title})}),(0,_.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:ye(e.instruction,20)})]}),(0,_.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,onClick:e=>e.stopPropagation(),children:[(0,_.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":n,disabled:r,className:u(`relative h-6 w-11 rounded-full transition-colors disabled:cursor-not-allowed disabled:opacity-60`,n?`bg-emerald-500`:`bg-muted-foreground/30`),onClick:()=>void $(e.id,e.status===`paused`?`resume`:`pause`),title:e.status===`paused`?p(`enable`):p(`pauseTask`),children:(0,_.jsx)(`span`,{className:u(`absolute left-0.5 top-0.5 size-5 rounded-full bg-white shadow transition-transform`,n?`translate-x-5`:`translate-x-0`)})}),(0,_.jsxs)(`div`,{className:`relative`,children:[(0,_.jsx)(f,{variant:`ghost`,size:`icon`,onClick:()=>k(O===e.id?null:e.id),title:p(`moreActions`),children:(0,_.jsx)(re,{className:`size-4`})}),O===e.id?(0,_.jsxs)(`div`,{className:`absolute right-0 z-20 mt-1 w-36 overflow-hidden rounded-xl border border-border bg-popover py-1 text-sm shadow-quickforge`,children:[(0,_.jsxs)(`button`,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50`,disabled:!we(e),onClick:()=>void $(e.id,`run`),children:[(0,_.jsx)(ae,{className:`size-3.5`}),p(`executeNow`)]}),(0,_.jsxs)(`button`,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50`,disabled:o,onClick:()=>ot(e),children:[(0,_.jsx)(t,{className:`size-3.5`}),p(`editTask`)]}),(0,_.jsxs)(`button`,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted`,onClick:()=>{k(null),D(e.id)},children:[(0,_.jsx)(ne,{className:`size-3.5`}),p(`viewDetails`)]}),(0,_.jsxs)(`button`,{className:`flex w-full items-center gap-2 px-3 py-2 text-left text-destructive hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50`,disabled:o,onClick:()=>void $(e.id,`delete`),children:[(0,_.jsx)(ie,{className:`size-3.5`}),p(`deleteTask`)]})]}):null]})]})]}),(0,_.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,_.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,_.jsx)(a,{className:`size-3`}),e.scheduleRule]}),(0,_.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,_.jsx)(i,{className:`size-3`}),Ze(e.agentId)]}),(0,_.jsxs)(`span`,{children:[p(`taskExecutionMode`),`:`,Te(e.executionMode)]}),e.projectName?(0,_.jsxs)(`span`,{children:[p(`taskProject`),e.projectName]}):null]}),(0,_.jsxs)(`div`,{className:`mt-4 grid gap-2 border-t border-border pt-3 text-xs text-muted-foreground sm:grid-cols-2`,children:[(0,_.jsxs)(`span`,{children:[p(`lastExecution`),y(e.lastRunAt)]}),(0,_.jsxs)(`span`,{children:[p(`nextExecution`),y(e.nextRunAt)]})]})]},e.id)})})]}):(0,_.jsxs)(`div`,{className:`space-y-4`,children:[(0,_.jsxs)(`div`,{className:`rounded-xl border border-border bg-card p-4`,children:[(0,_.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,_.jsx)(oe,{className:`size-4`}),p(`historyFilters`)]}),(0,_.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,_.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[p(`taskName`),(0,_.jsxs)(`select`,{className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:U.taskId,onChange:e=>Z(`taskId`,e.target.value),children:[(0,_.jsx)(`option`,{value:``,children:p(`allTasks`)}),s.map(e=>(0,_.jsx)(`option`,{value:e.id,children:e.title},e.id))]})]}),(0,_.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[p(`status`),(0,_.jsxs)(`select`,{className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:U.status,onChange:e=>Z(`status`,e.target.value),children:[(0,_.jsx)(`option`,{value:``,children:p(`allStatuses`)}),(0,_.jsx)(`option`,{value:`running`,children:p(`executionRunning`)}),(0,_.jsx)(`option`,{value:`success`,children:p(`executionSuccess`)}),(0,_.jsx)(`option`,{value:`failed`,children:p(`taskFailed`)})]})]}),(0,_.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[p(`triggerType`),(0,_.jsxs)(`select`,{className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:U.trigger,onChange:e=>Z(`trigger`,e.target.value),children:[(0,_.jsx)(`option`,{value:``,children:p(`allTriggers`)}),(0,_.jsx)(`option`,{value:`schedule`,children:p(`autoRun`)}),(0,_.jsx)(`option`,{value:`manual`,children:p(`manualRun`)})]})]}),(0,_.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[p(`startTime`),(0,_.jsx)(`input`,{type:`datetime-local`,className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:U.startedFrom,onChange:e=>Z(`startedFrom`,e.target.value)})]}),(0,_.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[p(`endTime`),(0,_.jsx)(`input`,{type:`datetime-local`,className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:U.startedTo,onChange:e=>Z(`startedTo`,e.target.value)})]}),(0,_.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[p(`keyword`),(0,_.jsx)(`input`,{className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:U.keyword,onChange:e=>Z(`keyword`,e.target.value),placeholder:p(`keywordPlaceholder`)})]})]}),(0,_.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2`,children:[(0,_.jsx)(f,{variant:`outline`,onClick:tt,children:p(`reset`)}),(0,_.jsx)(f,{onClick:et,children:p(`query`)})]})]}),(0,_.jsxs)(`div`,{className:`overflow-x-auto rounded-xl border border-border bg-card`,children:[(0,_.jsxs)(`div`,{className:`grid min-w-[600px] grid-cols-[1.3fr_0.7fr_0.7fr_1fr_0.7fr] gap-3 border-b border-border px-4 py-3 text-xs font-medium text-muted-foreground`,children:[(0,_.jsx)(`span`,{children:p(`taskName`)}),(0,_.jsx)(`span`,{children:p(`status`)}),(0,_.jsx)(`span`,{children:p(`triggerType`)}),(0,_.jsx)(`span`,{children:p(`startTime`)}),(0,_.jsx)(`span`,{children:p(`runDuration`)})]}),Re?(0,_.jsx)(`div`,{className:`p-8 text-center text-sm text-muted-foreground`,children:p(`loading`)}):q.runs.length===0?(0,_.jsx)(`div`,{className:`p-8 text-center text-sm text-muted-foreground`,children:p(`noExecutionHistory`)}):q.runs.map(e=>(0,_.jsxs)(`div`,{className:`border-b border-border last:border-b-0`,children:[(0,_.jsxs)(`button`,{type:`button`,className:`grid w-full min-w-[600px] grid-cols-[1.3fr_0.7fr_0.7fr_1fr_0.7fr] gap-3 px-4 py-3 text-left text-sm hover:bg-muted/40`,onClick:()=>Ve(Be===e.id?null:e.id),children:[(0,_.jsx)(`span`,{className:`min-w-0 truncate text-foreground`,children:e.taskTitle}),(0,_.jsx)(`span`,{children:(0,_.jsx)(`span`,{className:u(`rounded-full px-2 py-0.5 text-xs`,Oe(e.status)),children:De(e.status)})}),(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e.trigger===`manual`?p(`manualRun`):p(`autoRun`)}),(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:y(e.startedAt)}),(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e.durationMs?`${e.durationMs}ms`:`-`})]}),Be===e.id?(0,_.jsx)(`div`,{className:`border-t border-border bg-muted/20 px-4 py-3`,children:st(e)}):null]},`${e.taskId}:${e.id}`)),(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 py-3 text-sm text-muted-foreground`,children:[(0,_.jsx)(`span`,{children:p(`paginationSummary`,{page:q.page,pages:Xe,total:q.total})}),(0,_.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`select`,{className:`h-8 rounded-md border border-input bg-background px-2 text-sm`,value:q.pageSize,onChange:e=>rt(Number(e.target.value)),children:[10,20,50,100].map(e=>(0,_.jsx)(`option`,{value:e,children:p(`pageSize`,{size:e})},e))}),(0,_.jsx)(f,{variant:`outline`,size:`sm`,disabled:q.page<=1,onClick:()=>nt(q.page-1),children:p(`previousPage`)}),(0,_.jsx)(f,{variant:`outline`,size:`sm`,disabled:q.page>=Xe,onClick:()=>nt(q.page+1),children:p(`nextPage`)})]})]})]})]})]})})})]})}export{C as ScheduledTasksPage};