@xopcai/xopc 0.0.176 → 0.0.178

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 (238) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/xopc.extension.json +1 -1
  3. package/dist/gateway/static/root/assets/{activity-store-DsFM1upC.js → activity-store-BzGX__8I.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DvdMLOga.js → agent-avatar-dicebear-BzxntcaZ.js} +1 -1
  5. package/dist/gateway/static/root/assets/agents-DC9F12Kw.js +2 -0
  6. package/dist/gateway/static/root/assets/{api-BdPLCCBm.js → api-hi6f2Xtp.js} +1 -1
  7. package/dist/gateway/static/root/assets/{app-management-settings-panel-DMLDOHul.js → app-management-settings-panel-fTY1F7ac.js} +1 -1
  8. package/dist/gateway/static/root/assets/{appearance-settings-DbI9foFR.js → appearance-settings-BZ-IxQfB.js} +1 -1
  9. package/dist/gateway/static/root/assets/apps-page-5bKr05Fa.js +1 -0
  10. package/dist/gateway/static/root/assets/{archive-plugin-Dfdxuwvb.js → archive-plugin-ZSLLG8wB.js} +1 -1
  11. package/dist/gateway/static/root/assets/{attachment-load-Dn3RlnYD.js → attachment-load-D4YktqIF.js} +1 -1
  12. package/dist/gateway/static/root/assets/{automation-suggestion-card-Bc0Y7A9u.js → automation-suggestion-card-B7mxFRtf.js} +1 -1
  13. package/dist/gateway/static/root/assets/automations-page-Dg6dmt5g.js +6 -0
  14. package/dist/gateway/static/root/assets/{binary-plugins-0XtB-xC0.js → binary-plugins-BIkPxfxj.js} +1 -1
  15. package/dist/gateway/static/root/assets/{block-editor-C4fXWbEE.js → block-editor-Q3v_YQom.js} +6 -6
  16. package/dist/gateway/static/root/assets/{browser-settings-page-lC86-drr.js → browser-settings-page-BHoo6Rpq.js} +4 -4
  17. package/dist/gateway/static/root/assets/{browser-workflow-inputs-CZmzNymN.js → browser-workflow-inputs-M5lTEW1I.js} +1 -1
  18. package/dist/gateway/static/root/assets/{browser-workflows-page-CBYM9HqG.js → browser-workflows-page-B3T1KYk4.js} +2 -2
  19. package/dist/gateway/static/root/assets/capabilities-settings-panel-BlsqN8Fu.js +7 -0
  20. package/dist/gateway/static/root/assets/{capability-presets-api-BiJxmmhW.js → capability-presets-api-DE09c0VB.js} +1 -1
  21. package/dist/gateway/static/root/assets/capability-presets-settings-panel-DJeT8_B4.js +1 -0
  22. package/dist/gateway/static/root/assets/{channel-recipient-api-BKTUZDp-.js → channel-recipient-api-CFR5FBfS.js} +1 -1
  23. package/dist/gateway/static/root/assets/channels-settings-C4VVjYEm.js +1 -0
  24. package/dist/gateway/static/root/assets/channels-status-swr-vdf8kB16.js +1 -0
  25. package/dist/gateway/static/root/assets/{connector-logo-Pr4RIKjj.js → connector-logo-B1mD-3pM.js} +1 -1
  26. package/dist/gateway/static/root/assets/connectors-page-DNcrDThX.js +2 -0
  27. package/dist/gateway/static/root/assets/desktop-pet-B1urphOZ.js +1 -0
  28. package/dist/gateway/static/root/assets/{desktop-pet-settings-CEQacUDF.js → desktop-pet-settings-DTL6J3EP.js} +1 -1
  29. package/dist/gateway/static/root/assets/{directory-picker-path-field-DWnxdZtc.js → directory-picker-path-field-BYQJ2XUS.js} +1 -1
  30. package/dist/gateway/static/root/assets/{dreaming-settings-D2e2w2Ho.js → dreaming-settings-BXcb8fwx.js} +3 -3
  31. package/dist/gateway/static/root/assets/{extension-debug-page-BLjTGbv3.js → extension-debug-page-O1Xu1r4Q.js} +1 -1
  32. package/dist/gateway/static/root/assets/{extension-page-D2_UC6hy.js → extension-page-C2Jraq8l.js} +1 -1
  33. package/dist/gateway/static/root/assets/{extension-settings-page-BsH6o_PX.js → extension-settings-page-DcXQDTpG.js} +1 -1
  34. package/dist/gateway/static/root/assets/{gateway-config-api-C-DkC6UJ.js → gateway-config-api-DmPIZrvg.js} +1 -1
  35. package/dist/gateway/static/root/assets/{gateway-settings-DEOGiimF.js → gateway-settings-DmObBx9b.js} +1 -1
  36. package/dist/gateway/static/root/assets/{gateway-startup-retry-BlSLh1TF.js → gateway-startup-retry-BZEkOdPm.js} +1 -1
  37. package/dist/gateway/static/root/assets/{goal-create-dialog-CSFcRE_N.js → goal-create-dialog-BRhmmBe9.js} +1 -1
  38. package/dist/gateway/static/root/assets/goal-detail-page-C1k7_s_O.js +4 -0
  39. package/dist/gateway/static/root/assets/{goals-config-api-CcdS9qek.js → goals-config-api-Fwu1wjEP.js} +1 -1
  40. package/dist/gateway/static/root/assets/{goals-page-BAcErdch.js → goals-page-hOu9uA3q.js} +2 -2
  41. package/dist/gateway/static/root/assets/{goals-settings-BY7crl0z.js → goals-settings-DY-JjvHz.js} +1 -1
  42. package/dist/gateway/static/root/assets/{heartbeat-settings-DtTkS0gs.js → heartbeat-settings-BtKu2NWT.js} +1 -1
  43. package/dist/gateway/static/root/assets/{image-generation-api-WGgkbwDZ.js → image-generation-api-05Gg8wsU.js} +1 -1
  44. package/dist/gateway/static/root/assets/{index-2UImfRDC.js → index-C0CGebQ1.js} +65 -65
  45. package/dist/gateway/static/root/assets/index-eqq25gvV.css +1 -0
  46. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-C5lpWQ3f.js → keyboard-shortcuts-settings-CfmDR9Sc.js} +1 -1
  47. package/dist/gateway/static/root/assets/local-app-workbench-page-EjsNT7nJ.js +2 -0
  48. package/dist/gateway/static/root/assets/{local-apps-page-b05wWvXG.js → local-apps-page-Df8BW1A_.js} +1 -1
  49. package/dist/gateway/static/root/assets/{locale-store-sToMfHX_.js → locale-store-CTwSy7yW.js} +1 -1
  50. package/dist/gateway/static/root/assets/{logs-page-cDE1jLJv.js → logs-page-Dswjlraa.js} +3 -3
  51. package/dist/gateway/static/root/assets/{markdown-split-0gPVst5y.js → markdown-split-B3FvKbaP.js} +1 -1
  52. package/dist/gateway/static/root/assets/{media-plugins-Rxyq_KTm.js → media-plugins-DsjrvvB6.js} +1 -1
  53. package/dist/gateway/static/root/assets/messages-DP6tPKk-.js +3 -0
  54. package/dist/gateway/static/root/assets/{notes-page-DRhNDl_Q.js → notes-page-tuzIwy3c.js} +1 -1
  55. package/dist/gateway/static/root/assets/notes-workbench-DSh3-hMY.js +4 -0
  56. package/dist/gateway/static/root/assets/{page-tabs-cOEOQqHh.js → page-tabs-ke9s4nYi.js} +1 -1
  57. package/dist/gateway/static/root/assets/{preview-open-alternatives-BopOLFvu.js → preview-open-alternatives-Cp1eI4S9.js} +1 -1
  58. package/dist/gateway/static/root/assets/{product-open-page-DWVPmmOq.js → product-open-page-dXQCMAtH.js} +1 -1
  59. package/dist/gateway/static/root/assets/project-detail-page-D0QPRHR_.js +1 -0
  60. package/dist/gateway/static/root/assets/projects-page-CI5Vz62F.js +1 -0
  61. package/dist/gateway/static/root/assets/remote-access-hub-S1jpzBS5.js +1 -0
  62. package/dist/gateway/static/root/assets/{save-bar-controls-BfZmKe1t.js → save-bar-controls-Bl30zjHc.js} +1 -1
  63. package/dist/gateway/static/root/assets/{schedule-field-Cpi4jCRV.js → schedule-field-DqhmXQKo.js} +1 -1
  64. package/dist/gateway/static/root/assets/{schema-form-OXFkcZQe.js → schema-form-DkUCy6vf.js} +1 -1
  65. package/dist/gateway/static/root/assets/sessions-page-CTm66k7h.js +1 -0
  66. package/dist/gateway/static/root/assets/settings-advanced-gate-CU52AUVD.js +1 -0
  67. package/dist/gateway/static/root/assets/{settings-form-section-BwqkZCHJ.js → settings-form-section-C6ZbNpdy.js} +1 -1
  68. package/dist/gateway/static/root/assets/{settings-loading-skeleton-BbqH_S3Y.js → settings-loading-skeleton-Bk58_cr7.js} +1 -1
  69. package/dist/gateway/static/root/assets/{settings-page-BoxC-JSa.js → settings-page-k8iE_NdX.js} +1 -1
  70. package/dist/gateway/static/root/assets/{settings-page-layout-Ddu2iGaW.js → settings-page-layout-DgFSya2e.js} +1 -1
  71. package/dist/gateway/static/root/assets/{setup-status-panel-z1Lwv0js.js → setup-status-panel-B_KDlyZA.js} +1 -1
  72. package/dist/gateway/static/root/assets/{share-preview-page-CVazOFjy.js → share-preview-page-CV7nL_J9.js} +1 -1
  73. package/dist/gateway/static/root/assets/shares-settings-DK6XK95e.js +1 -0
  74. package/dist/gateway/static/root/assets/skill-reload-api-Bvv_u4ii.js +1 -0
  75. package/dist/gateway/static/root/assets/skills-page-BGHvVbay.js +2 -0
  76. package/dist/gateway/static/root/assets/{skills-page.utils-DgyB1tSo.js → skills-page.utils-kahBIHg0.js} +1 -1
  77. package/dist/gateway/static/root/assets/{system-settings-panel-BoLSQL65.js → system-settings-panel-JV3-MG5F.js} +1 -1
  78. package/dist/gateway/static/root/assets/{theme-store-CBNcGOfj.js → theme-store-DFLyzoLO.js} +1 -1
  79. package/dist/gateway/static/root/assets/{time-picker-gochWrny.js → time-picker-XwpxdZFr.js} +1 -1
  80. package/dist/gateway/static/root/assets/{typed-models-lib-DvRnr7YB.js → typed-models-lib-60Aqo-UJ.js} +1 -1
  81. package/dist/gateway/static/root/assets/{use-channel-catalog-CA9BFVB7.js → use-channel-catalog-CnTkHDnw.js} +1 -1
  82. package/dist/gateway/static/root/assets/user-context-page-DBCMk-Vn.js +1 -0
  83. package/dist/gateway/static/root/assets/{voice-api-key-field-v8tgylEZ.js → voice-api-key-field-CNa8qUgS.js} +1 -1
  84. package/dist/gateway/static/root/assets/work-discovery-page-C1UIdsCl.js +1 -0
  85. package/dist/gateway/static/root/assets/work-item-detail-page-DEAQepB8.js +1 -0
  86. package/dist/gateway/static/root/assets/work-page-D5qYmCTq.js +3 -0
  87. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CC3cJn5k.js → workflow-run-setup-panel-yV_x595t.js} +2 -2
  88. package/dist/gateway/static/root/assets/workflows-page-yrK17ZZ5.js +11 -0
  89. package/dist/gateway/static/root/index.html +7 -7
  90. package/dist/package.js +1 -1
  91. package/dist/src/agent/embedded/model-runtime.js +3 -0
  92. package/dist/src/agent/embedded/run-for-session.js +18 -5
  93. package/dist/src/agent/embedded/run-turn.js +6 -3
  94. package/dist/src/agent/embedded/types.d.ts +2 -0
  95. package/dist/src/automations/service/automation-service.d.ts +3 -0
  96. package/dist/src/automations/service/automation-service.js +37 -7
  97. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  98. package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
  99. package/dist/src/cli/commands/update.js +1 -1
  100. package/dist/src/connectors/composio-sessions.js +1 -1
  101. package/dist/src/gateway/hono/routes/home.d.ts +18 -2
  102. package/dist/src/gateway/hono/routes/home.js +19 -0
  103. package/dist/src/gateway/hono/routes/index.js +2 -2
  104. package/dist/src/gateway/hono/routes/local-apps.js +1 -1
  105. package/dist/src/gateway/hono/routes/proactive.d.ts +4 -0
  106. package/dist/src/gateway/hono/routes/proactive.js +157 -0
  107. package/dist/src/gateway/hono/routes/projects.js +2 -2
  108. package/dist/src/gateway/hono/routes/update.js +2 -2
  109. package/dist/src/gateway/index.js +1 -1
  110. package/dist/src/gateway/run-loop.js +1 -1
  111. package/dist/src/gateway/service.d.ts +10 -1
  112. package/dist/src/gateway/service.js +36 -36
  113. package/dist/src/infra/gateway-processes.js +1 -1
  114. package/dist/src/infra/update-restart.js +1 -1
  115. package/dist/src/infra/update-runner.js +2 -2
  116. package/dist/src/infra/update-startup.js +1 -1
  117. package/dist/src/mcp/channel-bridge.js +1 -1
  118. package/dist/src/mobile/notification-service.d.ts +1 -0
  119. package/dist/src/mobile/notification-service.js +38 -18
  120. package/dist/src/mobile/notification-types.d.ts +2 -2
  121. package/dist/src/proactive/events/envelope.d.ts +2 -0
  122. package/dist/src/proactive/events/envelope.js +54 -0
  123. package/dist/src/proactive/events/publisher.d.ts +4 -0
  124. package/dist/src/proactive/events/repository.d.ts +9 -0
  125. package/dist/src/proactive/events/repository.js +62 -0
  126. package/dist/src/proactive/events/types.d.ts +44 -0
  127. package/dist/src/proactive/events/types.js +15 -0
  128. package/dist/src/proactive/execution/agent-executor.d.ts +16 -0
  129. package/dist/src/proactive/execution/agent-executor.js +104 -0
  130. package/dist/src/proactive/execution/context.d.ts +31 -0
  131. package/dist/src/proactive/execution/context.js +72 -0
  132. package/dist/src/proactive/execution/insight.d.ts +4 -0
  133. package/dist/src/proactive/execution/insight.js +74 -0
  134. package/dist/src/proactive/execution/repository.d.ts +23 -0
  135. package/dist/src/proactive/execution/repository.js +122 -0
  136. package/dist/src/proactive/execution/types.d.ts +54 -0
  137. package/dist/src/proactive/execution/types.js +1 -0
  138. package/dist/src/proactive/execution/worker.d.ts +15 -0
  139. package/dist/src/proactive/execution/worker.js +96 -0
  140. package/dist/src/proactive/inbox/repository.d.ts +24 -0
  141. package/dist/src/proactive/inbox/repository.js +117 -0
  142. package/dist/src/proactive/inbox/service.d.ts +17 -0
  143. package/dist/src/proactive/inbox/service.js +22 -0
  144. package/dist/src/proactive/inbox/types.d.ts +38 -0
  145. package/dist/src/proactive/inbox/types.js +1 -0
  146. package/dist/src/proactive/inbox/worker.d.ts +12 -0
  147. package/dist/src/proactive/inbox/worker.js +56 -0
  148. package/dist/src/proactive/index.d.ts +17 -0
  149. package/dist/src/proactive/index.js +11 -0
  150. package/dist/src/proactive/routing/batch-repository.d.ts +27 -0
  151. package/dist/src/proactive/routing/batch-repository.js +56 -0
  152. package/dist/src/proactive/routing/matcher.d.ts +5 -0
  153. package/dist/src/proactive/routing/matcher.js +56 -0
  154. package/dist/src/proactive/routing/types.d.ts +44 -0
  155. package/dist/src/proactive/routing/types.js +1 -0
  156. package/dist/src/proactive/scenarios/prompt-composer.d.ts +14 -0
  157. package/dist/src/proactive/scenarios/prompt-composer.js +24 -0
  158. package/dist/src/proactive/scenarios/repository.d.ts +23 -0
  159. package/dist/src/proactive/scenarios/repository.js +162 -0
  160. package/dist/src/proactive/scenarios/service.d.ts +15 -0
  161. package/dist/src/proactive/scenarios/service.js +26 -0
  162. package/dist/src/proactive/scenarios/types.d.ts +36 -0
  163. package/dist/src/proactive/scenarios/types.js +1 -0
  164. package/dist/src/proactive/service.d.ts +18 -0
  165. package/dist/src/proactive/service.js +61 -0
  166. package/dist/src/projects/project-service.d.ts +3 -1
  167. package/dist/src/projects/project-service.js +62 -32
  168. package/dist/src/providers/provider-auth-service.js +3 -0
  169. package/dist/src/providers/register-bundled-oauth-flows.d.ts +2 -0
  170. package/dist/src/providers/register-bundled-oauth-flows.js +16 -0
  171. package/dist/src/session/store.d.ts +2 -0
  172. package/dist/src/session/store.js +30 -0
  173. package/dist/src/storage/sqlite/migrations/068_proactive_event_spine.sql +71 -0
  174. package/dist/src/storage/sqlite/migrations/069_proactive_scenario_control.sql +69 -0
  175. package/dist/src/storage/sqlite/migrations/070_proactive_execution.sql +55 -0
  176. package/dist/src/storage/sqlite/migrations/071_proactive_inbox.sql +45 -0
  177. package/dist/src/storage/sqlite/migrations/072_proactive_judgments.sql +14 -0
  178. package/dist/src/storage/sqlite/migrations/073_enable_default_proactive_scenarios.sql +13 -0
  179. package/dist/src/storage/sqlite/migrations/074_deduplicate_blocked_work_routing.sql +5 -0
  180. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  181. package/dist/src/storage/sqlite/migrations/runner.js +3 -3
  182. package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
  183. package/dist/src/storage/sqlite/schema.js +1 -1
  184. package/dist/src/work-discovery/thread-service.d.ts +1 -3
  185. package/dist/src/work-discovery/thread-service.js +13 -25
  186. package/dist/src/work-items/work-item-service.d.ts +3 -1
  187. package/dist/src/work-items/work-item-service.js +67 -36
  188. package/package.json +3 -11
  189. package/dist/gateway/static/root/assets/agents-BVjlpbeZ.js +0 -2
  190. package/dist/gateway/static/root/assets/api-Bop4IQRW.js +0 -1
  191. package/dist/gateway/static/root/assets/apps-page-njqxLWYD.js +0 -1
  192. package/dist/gateway/static/root/assets/automations-page-D-eweHZJ.js +0 -6
  193. package/dist/gateway/static/root/assets/capabilities-settings-panel-6tYNfHqJ.js +0 -7
  194. package/dist/gateway/static/root/assets/capability-presets-settings-panel-Co-ymbd9.js +0 -1
  195. package/dist/gateway/static/root/assets/channels-settings-D46eVjaQ.js +0 -1
  196. package/dist/gateway/static/root/assets/channels-status-swr-BMRAO4zZ.js +0 -1
  197. package/dist/gateway/static/root/assets/connectors-page-Dw1eYbRi.js +0 -2
  198. package/dist/gateway/static/root/assets/copy-VueTIC2x.js +0 -1
  199. package/dist/gateway/static/root/assets/desktop-pet-B8cZuQUt.js +0 -1
  200. package/dist/gateway/static/root/assets/focus-detail-page-BBXUtxRB.js +0 -1
  201. package/dist/gateway/static/root/assets/goal-detail-page-VjRArfAJ.js +0 -4
  202. package/dist/gateway/static/root/assets/index-CS9sVShT.css +0 -1
  203. package/dist/gateway/static/root/assets/local-app-workbench-page-Cl0fcPL4.js +0 -2
  204. package/dist/gateway/static/root/assets/messages-CarlxqXV.js +0 -3
  205. package/dist/gateway/static/root/assets/notes-workbench-BKNBk0Uf.js +0 -4
  206. package/dist/gateway/static/root/assets/project-detail-page-BhjEXNQW.js +0 -1
  207. package/dist/gateway/static/root/assets/projects-page-B80e69PH.js +0 -1
  208. package/dist/gateway/static/root/assets/remote-access-hub-CwdVob6H.js +0 -1
  209. package/dist/gateway/static/root/assets/sessions-page-BGt3Asj6.js +0 -1
  210. package/dist/gateway/static/root/assets/settings-advanced-gate-BnTdM9Nn.js +0 -1
  211. package/dist/gateway/static/root/assets/shares-settings-C4lXuyQj.js +0 -1
  212. package/dist/gateway/static/root/assets/skill-reload-api-DSuIDkeI.js +0 -1
  213. package/dist/gateway/static/root/assets/skills-page-xgZczqVe.js +0 -2
  214. package/dist/gateway/static/root/assets/user-context-page-CEfIy4WZ.js +0 -1
  215. package/dist/gateway/static/root/assets/work-discovery-page-B-3MClaf.js +0 -1
  216. package/dist/gateway/static/root/assets/work-item-detail-page-CEsFEdax.js +0 -1
  217. package/dist/gateway/static/root/assets/work-page-CT9AHnq6.js +0 -3
  218. package/dist/gateway/static/root/assets/workflows-page-C-1-_Zp1.js +0 -11
  219. package/dist/src/focuses/candidate-repository.d.ts +0 -15
  220. package/dist/src/focuses/candidate-repository.js +0 -91
  221. package/dist/src/focuses/index.d.ts +0 -7
  222. package/dist/src/focuses/index.js +0 -7
  223. package/dist/src/focuses/insight-repository.d.ts +0 -22
  224. package/dist/src/focuses/insight-repository.js +0 -77
  225. package/dist/src/focuses/prompts.d.ts +0 -2
  226. package/dist/src/focuses/prompts.js +0 -18
  227. package/dist/src/focuses/reconciler.d.ts +0 -5
  228. package/dist/src/focuses/reconciler.js +0 -26
  229. package/dist/src/focuses/repository.d.ts +0 -61
  230. package/dist/src/focuses/repository.js +0 -214
  231. package/dist/src/focuses/run-processor.d.ts +0 -18
  232. package/dist/src/focuses/run-processor.js +0 -162
  233. package/dist/src/focuses/service.d.ts +0 -42
  234. package/dist/src/focuses/service.js +0 -241
  235. package/dist/src/focuses/types.d.ts +0 -89
  236. package/dist/src/gateway/hono/routes/focuses.d.ts +0 -3
  237. package/dist/src/gateway/hono/routes/focuses.js +0 -319
  238. /package/dist/src/{focuses/types.js → proactive/events/publisher.js} +0 -0
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,l as a,t as o}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as s}from"./check-DUBLcKHA.js";import{n as c,r as l}from"./locale-store-sToMfHX_.js";import{a as u,i as d}from"./vendor-swr-BIWyz7Rc.js";import{Ac as f,As as p,Ba as m,Bo as h,Cc as ee,Co as g,Gl as te,Go as _,Gs as v,Ho as y,Il as b,Ks as x,Na as S,Ns as ne,Pu as re,Qc as C,To as ie,Uo as ae,Vc as oe,Vl as se,Vo as ce,Wo as le,bt as w,cu as T,iu as ue,kc as de,mu as fe,nl as E,oc as pe,ro as me,uc as he,wl as ge,xc as _e,zo as ve}from"./index-2UImfRDC.js";import{a as ye,c as be,l as xe,n as Se,o as Ce,r as we,s as Te,t as Ee}from"./api-BdPLCCBm.js";var D=e(t(),1),De=`build-xopc-local-app`;function Oe(e){return(e.routing?.agentId??e.agentId??``).trim().toLowerCase()}function ke(e){return e.find(e=>Oe(e)===`coder`)??null}function Ae(e,t){let n=new URLSearchParams({skill:De}),r=t?.trim();return r&&n.set(`draft`,r),`/chat/${encodeURIComponent(e)}?${n.toString()}`}var O=new Set([`document`,`content`,`interaction`,`criteria`]),je=new Set([`passed`,`failed`,`skipped`]);function Me(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.source!==`xopc-local-app-preview`||t.version!==1)return null;if(t.type===`ready`)return{type:`ready`,detail:{}};if(t.type===`criteria`&&t.detail&&typeof t.detail==`object`){let e=t.detail;if(e.status!==`passed`&&e.status!==`failed`||!Array.isArray(e.scenarios)||e.scenarios.length>10)return null;let n=e.scenarios.map(e=>{if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||!t.id.trim()||t.id.length>80||typeof t.name!=`string`||!t.name.trim()||t.name.length>120||t.status!==`passed`&&t.status!==`failed`||typeof t.message!=`string`||!t.message.trim()?null:{id:t.id,name:t.name,status:t.status,message:t.message.slice(0,500),failureKind:`scenario`}});if(n.some(e=>e===null))return null;let r=typeof e.scenarioCount==`number`&&Number.isInteger(e.scenarioCount)&&e.scenarioCount>=0&&e.scenarioCount<=10?e.scenarioCount:n.length;return{type:`criteria`,detail:{status:e.status,scenarioCount:r,scenarios:n}}}if(t.type===`acceptance`&&t.detail&&typeof t.detail==`object`){let e=t.detail;if(e.status!==`passed`&&e.status!==`failed`||!Array.isArray(e.checks))return null;let n=e.checks.slice(0,10).map(e=>{if(!e||typeof e!=`object`)return null;let t=e;return!O.has(t.id)||!je.has(t.status)||typeof t.message!=`string`||!t.message.trim()?null:{id:t.id,status:t.status,message:t.message.slice(0,500)}});if(!n.length||n.some(e=>e===null))return null;let r=typeof e.interactiveCount==`number`&&Number.isFinite(e.interactiveCount)&&e.interactiveCount>=0?Math.min(Math.floor(e.interactiveCount),1e4):0;return{type:`acceptance`,detail:{status:e.status,checks:n,interactiveCount:r}}}if(t.type!==`error`||!t.detail||typeof t.detail!=`object`)return null;let n=t.detail;return n.kind!==`script_error`&&n.kind!==`unhandled_rejection`||typeof n.message!=`string`||!n.message.trim()?null:{type:`error`,detail:{kind:n.kind,message:n.message.slice(0,500),filename:typeof n.filename==`string`?n.filename.slice(0,500):void 0,line:typeof n.line==`number`?n.line:void 0,column:typeof n.column==`number`?n.column:void 0}}}function Ne(e){return e?.checks.filter(e=>e.status===`failed`).map(e=>e.message)??[]}function Pe(e){let t=e.filename?` (${e.filename}${e.line?`:${e.line}${e.column?`:${e.column}`:``}`:``})`:``;return`${e.message}${t}`}var Fe=Object.freeze({source:`xopc-local-app-host`,version:1,type:`connect`});function Ie(e,t){let n=null,r=()=>{n?.close();let r=new MessageChannel;n=r.port1,n.onmessage=e=>t(e.data),n.start(),e.contentWindow?.postMessage(Fe,`*`,[r.port2])};return e.addEventListener(`load`,r),r(),()=>{e.removeEventListener(`load`,r),n?.close()}}var Le=n(),k=r();function Re(e){let t=(0,Le.c)(36),{scenarios:n,results:r,runningTarget:i,zh:a,onRunAll:o,onRunScenario:s,onAskCoder:c}=e;if(!n.length)return null;let l=a?`产品场景`:`Product scenarios`,u;t[0]===l?u=t[1]:(u=(0,k.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:l}),t[0]=l,t[1]=u);let d=a?`${n.length} 个关键用户路径`:`${n.length} critical user journey${n.length===1?``:`s`}`,f;t[2]===d?f=t[3]:(f=(0,k.jsx)(`p`,{className:`mt-0.5 text-[11px] text-fg-subtle`,children:d}),t[2]=d,t[3]=f);let m;t[4]!==u||t[5]!==f?(m=(0,k.jsxs)(`div`,{children:[u,f]}),t[4]=u,t[5]=f,t[6]=m):m=t[6];let h=i!==null,g;t[7]===i?g=t[8]:(g=i===`all`?(0,k.jsx)(E,{className:`size-3 animate-spin`}):(0,k.jsx)(ee,{className:`size-3`}),t[7]=i,t[8]=g);let te=a?`全部重跑`:`Run all`,_;t[9]!==o||t[10]!==h||t[11]!==g||t[12]!==te?(_=(0,k.jsxs)(p,{variant:`ghost`,className:`h-7 rounded-lg px-2 text-[11px]`,onClick:o,disabled:h,children:[g,te]}),t[9]=o,t[10]=h,t[11]=g,t[12]=te,t[13]=_):_=t[13];let v;t[14]!==m||t[15]!==_?(v=(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[m,_]}),t[14]=m,t[15]=_,t[16]=v):v=t[16];let y=a?`产品场景验收结果`:`Product scenario acceptance results`,b;if(t[17]!==c||t[18]!==s||t[19]!==r||t[20]!==i||t[21]!==n||t[22]!==a){let e;t[24]!==c||t[25]!==s||t[26]!==r||t[27]!==i||t[28]!==a?(e=e=>{let t=r[e.id],n=i===`all`||i===e.id?`running`:t?.status??`pending`;return(0,k.jsx)(`li`,{className:`py-2.5 first:pt-1`,children:(0,k.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,k.jsx)(`span`,{className:`mt-0.5 shrink-0`,"aria-hidden":!0,children:n===`running`?(0,k.jsx)(E,{className:`size-3.5 animate-spin text-accent`}):n===`passed`?(0,k.jsx)(fe,{className:`size-3.5 text-success`}):n===`failed`?(0,k.jsx)(T,{className:`size-3.5 text-danger`}):(0,k.jsx)(ue,{className:`size-3.5 text-fg-subtle`})}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`p`,{className:`truncate text-[11px] font-medium text-fg`,children:e.name}),(0,k.jsx)(`p`,{className:`mt-0.5 text-[10px] text-fg-subtle`,children:a?`${e.stepCount} 个步骤`:`${e.stepCount} step${e.stepCount===1?``:`s`}`})]}),(0,k.jsx)(p,{variant:`ghost`,className:`size-7 shrink-0 rounded-lg p-0`,onClick:()=>s(e.id),disabled:i!==null,"aria-label":a?`重跑${e.name}`:`Rerun ${e.name}`,title:a?`单独重跑`:`Rerun scenario`,children:(0,k.jsx)(ee,{className:`size-3`})})]}),n===`running`?(0,k.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`正在隔离预览中执行…`:`Running in an isolated preview…`}):t?.status===`failed`?(0,k.jsxs)(`div`,{className:`mt-1.5`,children:[(0,k.jsx)(`p`,{className:`text-[11px] leading-4 text-danger`,children:t.message}),(0,k.jsxs)(p,{variant:`ghost`,className:`mt-1 h-7 rounded-lg px-2 text-[11px] text-danger hover:text-danger`,onClick:()=>c(e,t),children:[(0,k.jsx)(C,{className:`size-3`}),a?`让 Coder 修复`:`Ask Coder to fix`]})]}):t?.status===`passed`?(0,k.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`场景已通过`:`Scenario passed`}):(0,k.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`等待运行`:`Waiting to run`})]})]})},e.id)},t[24]=c,t[25]=s,t[26]=r,t[27]=i,t[28]=a,t[29]=e):e=t[29],b=n.map(e),t[17]=c,t[18]=s,t[19]=r,t[20]=i,t[21]=n,t[22]=a,t[23]=b}else b=t[23];let x;t[30]!==y||t[31]!==b?(x=(0,k.jsx)(`ul`,{className:`mt-2 divide-y divide-edge-subtle`,"aria-label":y,children:b}),t[30]=y,t[31]=b,t[32]=x):x=t[32];let S;return t[33]!==v||t[34]!==x?(S=(0,k.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[v,x]}),t[33]=v,t[34]=x,t[35]=S):S=t[35],S}var ze=`allow-scripts allow-forms`;function Be(e,t){return w(e,t)}function Ve(e,t,n){return!!(t&&n&&e.sourceHash===t&&e.status===n.status&&e.interactiveCount===n.interactiveCount&&JSON.stringify(e.checks)===JSON.stringify(n.checks))}function A(){let{appId:e}=i(),t=e===`new`,n=c(e=>e.language)===`zh`,r=c(e=>e.language),w=a(),{mutate:T}=u(),ue=g(e=>e.moveToFront),De=ie(e=>e.setPageHeader),Oe=ie(e=>e.clearPageHeader),{data:O,isLoading:je,error:Fe,mutate:Le}=d(!t&&e?[`local-app`,e]:null,()=>Se(e)),{data:A,isLoading:He,mutate:Ue}=d(!t&&e?[`local-app-validation`,e]:null,()=>xe(e)),[We,Ge]=(0,D.useState)(``),[Ke,qe]=(0,D.useState)(``),[j,M]=(0,D.useState)(!1),[N,P]=(0,D.useState)(null),[Je,Ye]=(0,D.useState)(!1),[Xe,Ze]=(0,D.useState)(!1),[F,Qe]=(0,D.useState)(0),[$e,et]=(0,D.useState)(``),[I,tt]=(0,D.useState)(!1),[nt,rt]=(0,D.useState)(!1),[L,R]=(0,D.useState)(`booting`),[it,at]=(0,D.useState)(null),[z,ot]=(0,D.useState)(null),[B,st]=(0,D.useState)({}),[V,ct]=(0,D.useState)(`all`),[H,U]=(0,D.useState)(0),[lt,ut]=(0,D.useState)(0),[dt,ft]=(0,D.useState)(null),[W,pt]=(0,D.useState)(null),[mt,ht]=(0,D.useState)([]),[gt,_t]=(0,D.useState)(!1),vt=(0,D.useRef)(new Set),G=(0,D.useRef)(null),yt=(0,D.useRef)(null),bt=(0,D.useRef)(null),K=(0,D.useRef)(null),q=(0,D.useRef)(``),J=A?.acceptanceScenarios??[],Y=(0,D.useMemo)(()=>{if(!J.length)return null;let e=J.map(e=>B[e.id]).filter(e=>!!e);return e.length===J.length?{status:e.some(e=>e.status===`failed`)?`failed`:`passed`,scenarioCount:J.length,scenarios:e}:null},[J,B]),X=(0,D.useMemo)(()=>{if(!z)return null;if(!A?.acceptanceScenarioCount)return z;if(!Y)return null;let e=Y.scenarios.find(e=>e.status===`failed`),t={id:`criteria`,status:Y.status,message:e?`${e.name}: ${e.message}`:`${Y.scenarioCount} product scenario(s) passed`},n=[...z.checks,t];return{status:n.some(e=>e.status===`failed`)?`failed`:`passed`,checks:n,interactiveCount:z.interactiveCount}},[z,Y,A?.acceptanceScenarioCount]),xt=(0,D.useCallback)(async(e,t)=>{let n=ke(await m(e.projectId))??await S(e.projectId,`coder`);vt.current.add(n.key),w(Ae(n.key,t))},[w]),St=(0,D.useCallback)(async(e=!0)=>{if(!O)return null;rt(!0);try{let t=await xe(O.id);return await Ue(t,{revalidate:!1}),e&&(K.current=t.sourceHash??null,ct(`all`),U(0),Qe(e=>e+1)),t}catch(e){return P(e instanceof Error?e.message:String(e)),null}finally{rt(!1)}},[O,Ue]);(0,D.useEffect)(()=>{if(!O)return;let e=!1;m(O.projectId).then(t=>{e||(vt.current=new Set(t.filter(e=>(e.routing?.agentId??e.agentId)?.toLowerCase()===`coder`).map(e=>e.key)))}).catch(()=>{});let t=e=>{let t=e.detail?.key;!t||!vt.current.has(t)||(G.current!==null&&window.clearTimeout(G.current),G.current=window.setTimeout(()=>{G.current=null,St(!0)},750))};return window.addEventListener(`session-transcript-updated`,t),()=>{e=!0,window.removeEventListener(`session-transcript-updated`,t),G.current!==null&&window.clearTimeout(G.current)}},[O,St]),(0,D.useEffect)(()=>{ht(O?.acceptanceRuns??[])},[O?.acceptanceRuns]),(0,D.useEffect)(()=>{K.current=null},[O?.id]),(0,D.useEffect)(()=>{!A?.sourceHash||K.current||(K.current=A.sourceHash,ct(`all`),U(0),Qe(e=>e+1))},[A?.sourceHash]),(0,D.useLayoutEffect)(()=>{if(!O)return;R(`booting`),at(null),ot(null),pt(null),_t(!1),q.current=``;let e=window.setTimeout(()=>R(e=>e===`failed`?e:`timeout`),7e3),t=yt.current?Ie(yt.current,t=>{let n=Me(t);if(n){if(n.type===`ready`){R(e=>e===`failed`?e:`healthy`);return}if(n.type===`acceptance`){window.clearTimeout(e),ot(n.detail),pt(K.current);return}n.type!==`criteria`&&(window.clearTimeout(e),at(n.detail),R(`failed`))}}):()=>{};return()=>{window.clearTimeout(e),t()}},[O,F]),(0,D.useLayoutEffect)(()=>{if(!O||A?.status!==`healthy`||!J.length){ft(null);return}let e=V===`all`?J[H]:J.find(e=>e.id===V),t=e?[e]:[];if(!t.length)return;ft(V),st(e=>{if(V===`all`&&H===0)return{};let t={...e};return delete t[V],t});let r=!1,i=e=>{st(n=>{let r={...n};for(let n of t)r[n.id]={id:n.id,name:n.name,status:`failed`,message:e,failureKind:`runner`};return r}),ft(null)},a=window.setTimeout(()=>i(r?n?`场景在 10 秒内未完成。`:`Scenario did not finish within 10 seconds.`:n?`验收执行器未能连接,请重新验收。`:`The acceptance runner did not connect. Run acceptance again.`),1e4),o=bt.current?Ie(bt.current,e=>{let t=Me(e);t&&(t.type===`ready`?r=!0:t.type===`criteria`?(window.clearTimeout(a),st(e=>{let n={...e};for(let e of t.detail.scenarios)(n[e.id]?.status!==`failed`||e.status===`failed`)&&(n[e.id]=e);return n}),V===`all`&&H+1<J.length?(U(e=>e+1),ut(e=>e+1)):ft(null)):t.type===`error`&&(window.clearTimeout(a),i(Pe(t.detail))))}):()=>{};return()=>{window.clearTimeout(a),o()}},[J,O,lt,V,H,F,A?.status,n]),(0,D.useEffect)(()=>{if(!O||!X||!W||W!==A?.sourceHash)return;let e=`${O.id}:${W}:${JSON.stringify(X)}`;q.current!==e&&(q.current=e,_t(!0),ye(O.id,W,X).then(t=>{q.current===e&&ht(e=>[t,...e.filter(e=>e.id!==t.id)].toSorted((e,t)=>t.createdAt-e.createdAt).slice(0,20))}).catch(t=>{q.current===e&&(q.current=``,P(t instanceof Error?t.message:String(t)))}).finally(()=>{q.current===e&&_t(!1)}))},[X,W,O,A?.sourceHash]);let Z=(0,D.useCallback)(async e=>{if(O){tt(!0),P(null);try{await xt(O,e)}catch(e){P(e instanceof Error?e.message:String(e)),tt(!1)}}},[O,xt]);(0,D.useLayoutEffect)(()=>(De({startExtra:(0,k.jsx)(o,{to:`/local-apps`,className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":n?`返回本地应用`:`Back to local apps`,children:(0,k.jsx)(re,{className:`size-4`})}),main:(0,k.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:O?.name||(n?`创建本地应用`:`Create local app`)}),end:O?(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(p,{asChild:!0,variant:`ghost`,className:`h-9`,children:(0,k.jsxs)(o,{to:`/projects/${encodeURIComponent(O.projectId)}`,children:[(0,k.jsx)(b,{className:`size-4`}),`Project`]})}),(0,k.jsxs)(p,{className:`h-9`,onClick:()=>void Z(),disabled:I,children:[I?(0,k.jsx)(E,{className:`size-4 animate-spin`}):(0,k.jsx)(C,{className:`size-4`}),n?`继续开发`:`Continue building`]})]}):null}),()=>Oe()),[O,I,Oe,Z,De,n]);async function Ct(e){e.preventDefault(),M(!0),P(null);try{let e=await Ee({name:We,idea:Ke});await T(`local-apps-list`);let t=n?`请基于 APP_BRIEF.md 完成这个本地应用的首版。先检查现有草稿,再实现最小可用版本并运行校验;完成后告诉我可以如何预览。`:`Build the first usable version of this local app from APP_BRIEF.md. Inspect the existing draft, implement the smallest useful version, run validation, and tell me how to preview it.`;try{await xt(e,t)}catch{w(`/local-apps/${encodeURIComponent(e.id)}`,{replace:!0})}}catch(e){P(e instanceof Error?e.message:String(e))}finally{M(!1)}}async function wt(){if(O){M(!0),P(null);try{let e=await we(O.id);await Le(e,{revalidate:!1}),await Ue(),await Promise.all([T(`local-apps-list`),T(`gateway-extensions-list`)]),ue(`ext:${e.extensionId}:app`),Ye(!1)}catch(e){P(e instanceof Error?e.message:String(e))}finally{M(!1)}}}async function Tt(e,t=!1){M(!0),P(null);try{let n=await e();return await Le(n,{revalidate:!1}),await Ue(),await Promise.all([T(`local-apps-list`),T(`gateway-extensions-list`)]),t&&ue(`ext:${n.extensionId}:app`),!0}catch(e){return P(e instanceof Error?e.message:String(e)),!1}finally{M(!1)}}async function Et(e){O&&await Tt(()=>Te(O.id,e),e)}async function Dt(e){O&&await Tt(()=>Ce(O.id,e),!0)}async function Ot(){O&&await Tt(()=>be(O.id))&&Ze(!1)}function kt(){let e=Array.from(new Set([...A?.issues.map(e=>e.message)??[],...it?[Pe(it)]:[],...X?.checks.filter(e=>e.status===`failed`&&e.id!==`criteria`).map(e=>e.message)??[],...Object.values(B).filter(e=>e.status===`failed`).map(e=>`${e.name}: ${e.failureKind===`runner`?`[验收执行器] `:``}${e.message}`),...L===`timeout`?[n?`预览在 7 秒内未完成启动,可能存在白屏或阻塞。`:`The preview did not finish booting within 7 seconds and may be blank or blocked.`]:[]]));if(!e.length)return;let t=e.map(e=>`- ${e}`).join(`
2
- `);Z(n?`请修复当前本地应用草稿的校验问题,保持扩展 ID 和已安装版本不变。先复现并判断问题来自应用行为还是验收执行器,不要通过弱化断言绕过问题。修复后运行完整校验。\n\n${t}`:`Fix the current local-app draft validation issues without changing the extension id or installed release. Reproduce first and determine whether each issue comes from app behavior or the acceptance runner; do not weaken assertions to bypass it. Run the full validation afterward.\n\n${t}`)}function At(){ct(`all`),U(0),ut(e=>e+1)}function jt(e){ct(e),U(0),ut(e=>e+1)}function Mt(e,t){let r=t.failureKind===`runner`?n?`验收执行器`:`acceptance runner`:n?`产品场景`:`product scenario`;Z(n?`请修复本地应用的${r}问题“${e.name}”。当前失败信息:${t.message}\n\n保持扩展 ID 和场景原意不变;先复现并判断问题来自应用行为还是验收执行器,不要通过弱化断言绕过问题。修复后运行完整校验。`:`Fix the local-app ${r} issue "${e.name}". Current failure: ${t.message}\n\nPreserve the extension id and scenario intent. Reproduce first and determine whether the issue comes from app behavior or the runner; do not weaken assertions to bypass it. Run the full validation afterward.`)}let Q=mt.findIndex(e=>Ve(e,W,X)),$=Q>=0?mt[Q]:null,Nt=Q>=0?mt[Q+1]??null:mt[0]??null,Pt=Ne(X),Ft=Nt?Nt.checks.filter(e=>e.status===`failed`).map(e=>e.message):[],It=A?.status===`failed`||L===`failed`||L===`timeout`||X?.status===`failed`||Object.values(B).some(e=>e.status===`failed`),Lt=Ft.filter(e=>!Pt.includes(e)).length;async function Rt(){let e=await St(!1);if(e?.status===`healthy`&&e.sourceHash!==W){K.current=e.sourceHash??null,U(0),Qe(e=>e+1);return}e?.status===`healthy`&&L===`healthy`&&X?.status===`passed`&&$&&$.sourceHash===e.sourceHash&&Ye(!0)}return t?(0,k.jsx)(`div`,{className:`flex min-h-0 flex-1 bg-surface-panel p-3 sm:p-5 xl:p-6`,children:(0,k.jsxs)(`div`,{className:`mx-auto grid w-full max-w-6xl overflow-hidden rounded-2xl border border-edge-subtle bg-surface-base shadow-surface lg:grid-cols-[minmax(280px,0.8fr)_minmax(0,1.5fr)]`,children:[(0,k.jsxs)(`form`,{onSubmit:Ct,className:`flex flex-col border-b border-edge-subtle p-5 lg:border-b-0 lg:border-r`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.14em] text-accent`,children:[(0,k.jsx)(pe,{className:`size-4`}),n?`告诉 Coder 你的想法`:`Tell Coder your idea`]}),(0,k.jsx)(`h2`,{className:`mt-4 text-xl font-semibold tracking-tight text-fg`,children:n?`你想创建什么?`:`What do you want to create?`}),(0,k.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:n?`我们会建立一个 Coder Project,并把应用上下文和开发 Skill 带入对话。`:`We will create a Coder Project and carry the app context and development skill into chat.`}),(0,k.jsxs)(`label`,{className:`mt-6 text-xs font-medium text-fg-muted`,children:[n?`应用名称`:`App name`,(0,k.jsx)(`input`,{value:We,onChange:e=>Ge(e.target.value),required:!0,className:`mt-2 w-full rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,placeholder:n?`例如:阅读清单`:`e.g. Reading list`})]}),(0,k.jsxs)(`label`,{className:`mt-4 text-xs font-medium text-fg-muted`,children:[n?`描述你的想法`:`Describe your idea`,(0,k.jsx)(`textarea`,{value:Ke,onChange:e=>qe(e.target.value),required:!0,rows:7,className:`mt-2 w-full resize-none rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm leading-6 text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,placeholder:n?`我想要一个可以记录待读文章、标记进度并按主题筛选的小工具…`:`I want a small tool that tracks articles, reading progress, and topics…`})]}),N?(0,k.jsx)(`p`,{className:`mt-3 text-sm text-danger`,role:`alert`,children:N}):null,(0,k.jsxs)(p,{type:`submit`,variant:`primary`,className:`mt-5 h-10`,disabled:j||!We.trim()||!Ke.trim(),children:[j?(0,k.jsx)(E,{className:`size-4 animate-spin`}):(0,k.jsx)(C,{className:`size-4`}),n?`进入 Coder 对话`:`Continue with Coder`]})]}),(0,k.jsx)(`div`,{className:`hidden min-h-[620px] place-items-center bg-surface-panel p-8 lg:grid`,children:(0,k.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,k.jsx)(`div`,{className:`mx-auto flex size-16 items-center justify-center rounded-2xl border border-edge bg-surface-base text-accent shadow-surface`,children:(0,k.jsx)(oe,{className:`size-7`})}),(0,k.jsx)(`h3`,{className:`mt-5 text-base font-semibold text-fg`,children:n?`创建后,这里就是实时预览`:`Your live preview appears here`}),(0,k.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:n?`你可以先体验草稿,再决定是否把它添加到左侧导航。`:`Try the draft first, then decide whether to add it to the sidebar.`})]})})]})}):je?(0,k.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-3 bg-surface-panel p-3 lg:grid-cols-[280px_minmax(0,1fr)_260px]`,children:[(0,k.jsx)(me,{className:`rounded-xl`}),(0,k.jsx)(me,{className:`rounded-xl`}),(0,k.jsx)(me,{className:`rounded-xl`})]}):Fe||!O?(0,k.jsx)(`div`,{className:`m-6 rounded-xl border border-danger/30 bg-danger-soft p-4 text-sm text-danger`,children:Fe instanceof Error?Fe.message:n?`找不到应用`:`App not found`}):(0,k.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-3 overflow-hidden bg-surface-panel p-3 lg:grid-cols-[280px_minmax(0,1fr)_300px]`,children:[(0,k.jsxs)(`aside`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.12em] text-accent`,children:[(0,k.jsx)(pe,{className:`size-4`}),n?`创作对话`:`Build conversation`]}),(0,k.jsx)(`div`,{className:`mt-4 rounded-xl bg-surface-panel p-3 text-sm leading-6 text-fg`,children:O.idea}),(0,k.jsxs)(`div`,{className:`mt-4 rounded-xl bg-accent-soft p-3`,children:[(0,k.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium text-accent-fg`,children:[(0,k.jsx)(fe,{className:`size-4`}),n?`草稿已准备好`:`Draft is ready`]}),(0,k.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n?`继续迭代会进入对应 Project,由 Coder 读取应用上下文和专属 skill。`:`Continue in the Project where Coder has the app context and dedicated skill.`})]}),(0,k.jsxs)(`form`,{className:`mt-5`,onSubmit:e=>{e.preventDefault(),Z($e)},children:[(0,k.jsx)(`label`,{className:`text-xs font-medium text-fg-muted`,htmlFor:`local-app-change-request`,children:n?`下一步想改什么?`:`What should change next?`}),(0,k.jsx)(`textarea`,{id:`local-app-change-request`,value:$e,onChange:e=>et(e.target.value),rows:4,className:`mt-2 w-full resize-none rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm leading-6 text-fg outline-none focus-visible:ring-2 focus-visible:ring-accent`,placeholder:n?`例如:增加月视图,并支持按标签筛选`:`e.g. Add a monthly view and tag filters`}),(0,k.jsxs)(p,{type:`submit`,className:`mt-2 w-full`,disabled:I||!$e.trim(),children:[I?(0,k.jsx)(E,{className:`size-4 animate-spin`}):(0,k.jsx)(C,{className:`size-4`}),n?`让 Coder 修改`:`Ask Coder to update`]})]}),(0,k.jsxs)(p,{variant:`ghost`,className:`mt-2 w-full`,onClick:()=>void Z(),disabled:I,children:[(0,k.jsx)(b,{className:`size-4`}),n?`打开已有开发对话`:`Open development chat`]})]}),(0,k.jsxs)(`section`,{className:`flex min-h-0 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,children:[(0,k.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between border-b border-edge-subtle px-3`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-fg-muted`,children:[(0,k.jsx)(`span`,{className:`size-2 rounded-full ${A?.status===`failed`||L===`failed`||L===`timeout`||X?.status===`failed`?`bg-danger`:A?.status===`healthy`&&L===`healthy`&&X?.status===`passed`&&$?.sourceHash===A.sourceHash&&!gt?`bg-success`:`bg-fg-subtle`}`}),L===`failed`||L===`timeout`?n?`预览运行异常`:`Preview runtime issue`:A?.status===`failed`||X?.status===`failed`?n?`自动验收未通过`:`Acceptance needs attention`:L===`booting`||!X?n?`自动验收中`:`Running acceptance`:gt||$?.sourceHash!==A?.sourceHash?n?`正在保存验收快照`:`Saving acceptance snapshot`:n?`草稿已通过验收`:`Draft accepted`]}),(0,k.jsxs)(p,{variant:`ghost`,className:`h-8 px-2`,onClick:()=>void St(!0),disabled:nt,children:[nt?(0,k.jsx)(E,{className:`size-3.5 animate-spin`}):(0,k.jsx)(ee,{className:`size-3.5`}),n?`重新验收`:`Run again`]})]}),(0,k.jsx)(`iframe`,{ref:yt,title:`${O.name} preview`,src:l(O.previewUrl),sandbox:ze,className:`min-h-0 w-full flex-1 bg-white`,onError:()=>{at({kind:`script_error`,message:`Preview document failed to load`}),R(`failed`)}},F),A?.status===`healthy`&&A.acceptanceScenarioCount>0?(0,k.jsx)(`iframe`,{ref:bt,title:`${O.name} acceptance runner`,src:`${l(O.previewUrl)}?xopcAcceptance=1&xopcScenario=${encodeURIComponent(V===`all`?J[H]?.id??``:V)}`,sandbox:ze,"aria-hidden":`true`,tabIndex:-1,className:`pointer-events-none fixed left-[-200vw] top-0 h-[720px] w-[1024px] opacity-0`},`criteria-${F}-${lt}-${H}`):null]}),(0,k.jsxs)(`aside`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[(0,k.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n?`发布状态`:`Release status`}),(0,k.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:O.installationState===`not_installed`?n?`尚未安装`:`Not installed`:O.enabled?n?`版本 ${O.activeVersion} 正在使用`:`Version ${O.activeVersion} is active`:n?`已禁用,版本仍保留`:`Disabled, release retained`})]}),(0,k.jsx)(`span`,{className:`mt-1 size-2.5 rounded-full ${O.enabled?`bg-success`:`bg-fg-subtle`}`,"aria-hidden":!0})]}),(0,k.jsxs)(`dl`,{className:`mt-4 grid grid-cols-2 gap-3 text-xs`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`当前草稿`:`Draft`}),(0,k.jsxs)(`dd`,{className:`mt-1 font-medium text-fg`,children:[`v`,O.draftVersion]})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`已安装`:`Installed`}),(0,k.jsx)(`dd`,{className:`mt-1 font-medium text-fg`,children:O.activeVersion?`v${O.activeVersion}`:`—`})]})]}),(0,k.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,k.jsxs)(`h3`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,k.jsx)(se,{className:`size-4 text-accent`}),n?`草稿检查`:`Draft checks`]}),He||nt?(0,k.jsx)(E,{className:`size-3.5 animate-spin text-fg-muted`}):A?.status===`healthy`?(0,k.jsx)(fe,{className:`size-4 text-success`}):(0,k.jsx)(v,{className:`size-4 text-danger`})]}),A?(0,k.jsxs)(`div`,{className:`mt-2`,children:[(0,k.jsx)(`p`,{className:`text-xs leading-5 ${A.status===`healthy`?`text-fg-muted`:`text-danger`}`,children:A.status===`healthy`?A.hasDraftChanges?n?`${A.changedFileCount} 个文件有改动,可以安装新版本。`:`${A.changedFileCount} changed files are ready for a new release.`:n?`草稿与当前安装版本一致。`:`Draft matches the installed release.`:A.issues[0]?.message}),A.changedFiles.length?(0,k.jsx)(`ul`,{className:`mt-2 space-y-1`,children:A.changedFiles.slice(0,4).map(e=>(0,k.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-[11px] text-fg-muted`,children:[(0,k.jsx)(`span`,{className:`w-4 shrink-0 font-medium text-fg-subtle`,children:e.status===`added`?`+`:e.status===`deleted`?`−`:`•`}),(0,k.jsx)(`span`,{className:`truncate font-mono`,children:e.path})]},e.path))}):null,A.changedFileCount>4?(0,k.jsx)(`p`,{className:`mt-1 text-[10px] text-fg-subtle`,children:n?`还有 ${A.changedFileCount-4} 个文件`:`${A.changedFileCount-4} more files`}):null,(0,k.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[(0,k.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-medium text-fg`,children:[(0,k.jsx)(`span`,{className:`size-2 rounded-full ${L===`healthy`?`bg-success`:L===`booting`?`bg-fg-subtle`:`bg-danger`}`}),n?`预览运行`:`Preview runtime`]}),(0,k.jsx)(`p`,{className:`mt-1 text-xs leading-5 ${L===`failed`||L===`timeout`?`text-danger`:`text-fg-muted`}`,children:it?Pe(it):L===`healthy`?n?`已成功启动,未发现未捕获异常。`:`Started successfully with no uncaught errors.`:L===`timeout`?n?`7 秒内未完成启动,可能出现白屏或阻塞。`:`Did not finish booting within 7 seconds.`:n?`正在等待应用启动。`:`Waiting for the app to start.`})]}),(0,k.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[(0,k.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-medium text-fg`,children:[(0,k.jsx)(`span`,{className:`size-2 rounded-full ${X?.status===`passed`?`bg-success`:X?.status===`failed`?`bg-danger`:`bg-fg-subtle`}`}),n?`自动验收`:`Automatic acceptance`]}),X?(0,k.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:X.checks.map(e=>(0,k.jsxs)(`li`,{className:`flex items-start gap-2 text-[11px] leading-4 ${e.status===`failed`?`text-danger`:`text-fg-muted`}`,children:[(0,k.jsx)(`span`,{className:`mt-1 size-1.5 shrink-0 rounded-full ${e.status===`failed`?`bg-danger`:e.status===`passed`?`bg-success`:`bg-fg-subtle`}`}),(0,k.jsx)(`span`,{children:e.message})]},e.id))}):(0,k.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:A?.acceptanceScenarioCount?n?`正在检查页面基础质量和 ${A.acceptanceScenarioCount} 个产品场景。`:`Checking page quality and ${A.acceptanceScenarioCount} product scenario(s).`:n?`正在检查页面内容和基础交互。`:`Checking rendered content and basic interaction.`}),gt?(0,k.jsxs)(`p`,{className:`mt-2 flex items-center gap-2 text-[11px] text-fg-muted`,children:[(0,k.jsx)(E,{className:`size-3 animate-spin`}),n?`正在保存当前源码对应的验收快照…`:`Saving the acceptance snapshot for this source…`]}):$?(0,k.jsx)(`p`,{className:`mt-2 text-[11px] leading-4 text-fg-muted`,children:Nt?n?`相比上次:已修复 ${Lt} 项,仍有 ${Pt.length} 项。`:`Since the previous run: ${Lt} fixed, ${Pt.length} remaining.`:n?`首个验收快照已保存。`:`First acceptance snapshot saved.`}):null,(0,k.jsx)(Re,{scenarios:J,results:B,runningTarget:dt,zh:n,onRunAll:At,onRunScenario:jt,onAskCoder:Mt})]}),It?(0,k.jsxs)(p,{className:`mt-3 w-full`,onClick:kt,disabled:I,children:[(0,k.jsx)(C,{className:`size-4`}),n?`让 Coder 修复`:`Ask Coder to fix`]}):null]}):(0,k.jsx)(me,{className:`mt-2 h-12 rounded-lg`})]}),(0,k.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,k.jsx)(he,{className:`size-4 text-accent`}),n?`权限`:`Permissions`]}),(0,k.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:(A?.permissions??O.permissions).map(e=>(0,k.jsx)(`span`,{className:`rounded-md bg-surface-hover px-2 py-1 text-[11px] text-fg-muted`,children:e},e))})]}),(0,k.jsx)(p,{variant:`primary`,className:`mt-5 w-full`,onClick:()=>void Rt(),disabled:j||He||nt||gt||A?.status===`failed`||L!==`healthy`||X?.status!==`passed`||!$||$.sourceHash!==A?.sourceHash||O.installationState===`installed`&&A?.hasDraftChanges===!1,children:O.installationState===`installed`?n?`安装当前更新`:`Install current update`:n?`添加到左侧导航`:`Add to sidebar`}),O.installationState===`installed`?(0,k.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,k.jsxs)(p,{className:`min-w-0 flex-1`,onClick:()=>void Et(!O.enabled),disabled:j,children:[O.enabled?(0,k.jsx)(f,{className:`size-4`}):(0,k.jsx)(de,{className:`size-4`}),O.enabled?n?`禁用`:`Disable`:n?`启用`:`Enable`]}),(0,k.jsx)(p,{variant:`ghost`,className:`text-danger hover:text-danger`,onClick:()=>Ze(!0),disabled:j,"aria-label":n?`卸载应用`:`Uninstall app`,children:(0,k.jsx)(x,{className:`size-4`})})]}):null,(0,k.jsxs)(`div`,{className:`mt-6 border-t border-edge-subtle pt-4`,children:[(0,k.jsxs)(`h3`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,k.jsx)(ge,{className:`size-4`}),n?`版本历史`:`Release history`]}),O.releases.length?(0,k.jsx)(`ul`,{className:`mt-2 divide-y divide-edge-subtle`,children:O.releases.map(e=>(0,k.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-2.5`,children:[(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-fg`,children:[`v`,e.version,e.isActive?(0,k.jsx)(`span`,{className:`rounded-full bg-success-soft px-1.5 py-0.5 text-[10px] text-success`,children:n?`当前`:`Active`}):null]}),(0,k.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-fg-subtle`,children:Be(e.createdAt,r)})]}),e.isActive?null:(0,k.jsxs)(p,{variant:`ghost`,className:`h-7 px-2 text-xs`,onClick:()=>void Dt(e.id),disabled:j,children:[(0,k.jsx)(_e,{className:`size-3.5`}),n?`恢复`:`Restore`]})]},e.id))}):(0,k.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:n?`安装首个版本后,可以从这里恢复。`:`Install the first version to enable recovery.`})]}),N?(0,k.jsx)(`p`,{className:`mt-3 text-xs leading-5 text-danger`,role:`alert`,children:N}):null]}),(0,k.jsx)(ve,{open:Je,onOpenChange:Ye,children:(0,k.jsxs)(le,{children:[(0,k.jsx)(ae,{className:`fixed inset-0 z-50 bg-black/45`}),(0,k.jsxs)(ce,{className:`fixed left-1/2 top-1/2 z-50 flex h-[min(560px,calc(100vh-32px))] w-[min(520px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-base shadow-2xl focus:outline-none`,children:[(0,k.jsxs)(`div`,{className:`flex items-start justify-between border-b border-edge-subtle p-5`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(_,{className:`text-base font-semibold text-fg`,children:n?`确认安装到 XOPC`:`Confirm installation`}),(0,k.jsx)(y,{className:`mt-1 text-sm text-fg-muted`,children:n?`当前草稿会成为左侧导航中的可用版本。`:`The current draft will become the version available in the sidebar.`})]}),(0,k.jsx)(h,{className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover`,children:(0,k.jsx)(ne,{className:`size-4`})})]}),(0,k.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,k.jsxs)(`div`,{className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[(0,k.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:O.name}),(0,k.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:O.extensionId})]}),(0,k.jsx)(`h4`,{className:`mt-5 text-xs font-semibold text-fg`,children:n?`本次迭代`:`This iteration`}),(0,k.jsxs)(`dl`,{className:`mt-2 grid grid-cols-2 gap-3 text-xs`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`文件变化`:`Changed files`}),(0,k.jsx)(`dd`,{className:`mt-1 font-medium text-fg`,children:A?.changedFileCount??0})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`自动验收`:`Acceptance`}),(0,k.jsxs)(`dd`,{className:`mt-1 flex items-center gap-1.5 font-medium text-success`,children:[(0,k.jsx)(fe,{className:`size-3.5`}),n?`已通过并保存`:`Passed and saved`]})]})]}),A?.changedFiles.length?(0,k.jsx)(`ul`,{className:`mt-3 space-y-1`,children:A.changedFiles.slice(0,5).map(e=>(0,k.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-[11px] text-fg-muted`,children:[(0,k.jsx)(`span`,{className:`w-4 shrink-0 font-medium text-fg-subtle`,children:e.status===`added`?`+`:e.status===`deleted`?`−`:`•`}),(0,k.jsx)(`span`,{className:`truncate font-mono`,children:e.path})]},e.path))}):null,(0,k.jsx)(`h4`,{className:`mt-5 text-xs font-semibold text-fg`,children:n?`请求权限`:`Requested permissions`}),(0,k.jsx)(`ul`,{className:`mt-2 space-y-2`,children:(A?.permissions??O.permissions).map(e=>(0,k.jsxs)(`li`,{className:`flex items-center gap-2 text-sm text-fg`,children:[(0,k.jsx)(s,{className:`size-4 text-success`}),e,O.installationState===`installed`&&A?.permissionDelta.added.includes(e)?(0,k.jsx)(`span`,{className:`rounded-full bg-warning-soft px-2 py-0.5 text-[10px] text-warning`,children:n?`新增`:`New`}):null]},e))}),O.installationState===`installed`&&A?.permissionDelta.added.length?(0,k.jsx)(`p`,{className:`mt-4 rounded-xl bg-warning-soft p-3 text-xs leading-5 text-warning`,children:n?`此更新增加了权限,请确认这些能力符合你的修改意图。`:`This update adds permissions. Confirm they match the change you requested.`}):null,(0,k.jsx)(`p`,{className:`mt-5 rounded-xl bg-accent-soft p-3 text-xs leading-5 text-accent-fg`,children:n?`Phase 1 应用只能使用界面主题和本地存储,不能访问网络或运行系统命令。`:`Phase 1 apps can use theme and local storage only. They cannot access the network or run system commands.`})]}),(0,k.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-edge-subtle p-4`,children:[(0,k.jsx)(h,{asChild:!0,children:(0,k.jsx)(p,{children:n?`取消`:`Cancel`})}),(0,k.jsxs)(p,{variant:`primary`,onClick:()=>void wt(),disabled:j,children:[j?(0,k.jsx)(E,{className:`size-4 animate-spin`}):(0,k.jsx)(te,{className:`size-4`}),n?`确认安装`:`Install`]})]})]})]})}),(0,k.jsx)(ve,{open:Xe,onOpenChange:Ze,children:(0,k.jsxs)(le,{children:[(0,k.jsx)(ae,{className:`fixed inset-0 z-50 bg-black/45`}),(0,k.jsxs)(ce,{className:`fixed left-1/2 top-1/2 z-50 flex h-[min(420px,calc(100vh-32px))] w-[min(500px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-base shadow-2xl focus:outline-none`,children:[(0,k.jsxs)(`div`,{className:`flex items-start justify-between border-b border-edge-subtle p-5`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(_,{className:`text-base font-semibold text-fg`,children:n?`卸载当前应用?`:`Uninstall this app?`}),(0,k.jsx)(y,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:n?`应用会从侧栏移除,但 Project、源码、版本历史和本地数据都会保留。`:`The app leaves the sidebar, while its Project, source, release history, and local data remain.`})]}),(0,k.jsx)(h,{className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover`,children:(0,k.jsx)(ne,{className:`size-4`})})]}),(0,k.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:(0,k.jsxs)(`div`,{className:`rounded-xl bg-surface-panel p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:O.name}),(0,k.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n?`之后可从任意保留版本重新安装。`:`You can reinstall any retained release later.`})]})}),(0,k.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-edge-subtle p-4`,children:[(0,k.jsx)(h,{asChild:!0,children:(0,k.jsx)(p,{children:n?`取消`:`Cancel`})}),(0,k.jsxs)(p,{variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger`,onClick:()=>void Ot(),disabled:j,children:[j?(0,k.jsx)(E,{className:`size-4 animate-spin`}):(0,k.jsx)(x,{className:`size-4`}),n?`卸载但保留 Project`:`Uninstall and keep Project`]})]})]})]})})]})}export{A as LocalAppWorkbenchPage};