@xopcai/xopc 0.0.321 → 0.0.323

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 (281) hide show
  1. package/dist/browser-ext/dist/assets/{auth-DKo-NMUY.js → auth-DocRzRlS.js} +95 -21
  2. package/dist/browser-ext/dist/background.js +1 -1
  3. package/dist/browser-ext/dist/sidepanel.html +1 -1
  4. package/dist/browser-ext/dist/sidepanel.js +18 -2
  5. package/dist/browser-ext/manifest.json +1 -1
  6. package/dist/extensions/telegram/xopc.extension.json +1 -1
  7. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-C69p1Gbr.js → agent-avatar-dicebear-DFzmThVi.js} +1 -1
  8. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CAFHadiy.js +1 -0
  9. package/dist/gateway/static/root/assets/agent-plugin-dialog-DYFYiuig.js +1 -0
  10. package/dist/gateway/static/root/assets/{agents-CWR3p3t3.js → agents-BqIlB5Co.js} +1 -1
  11. package/dist/gateway/static/root/assets/{app-link-nL8iPwEr.js → app-link-C6gA5Nck.js} +1 -1
  12. package/dist/gateway/static/root/assets/{app-management-settings-panel-D98bt40S.js → app-management-settings-panel-BgvMRGWe.js} +1 -1
  13. package/dist/gateway/static/root/assets/{appearance-settings-ChMUELAZ.js → appearance-settings-CliHU03A.js} +1 -1
  14. package/dist/gateway/static/root/assets/apps-page-Drt3Foi9.js +1 -0
  15. package/dist/gateway/static/root/assets/{archive-plugin-BIIiu6uP.js → archive-plugin-DnuPpm0u.js} +1 -1
  16. package/dist/gateway/static/root/assets/{attachment-load-CDJpcsCp.js → attachment-load-BiwaK0ie.js} +1 -1
  17. package/dist/gateway/static/root/assets/{automations-page-Cb5a_WOk.js → automations-page-CJSISGQH.js} +1 -1
  18. package/dist/gateway/static/root/assets/automations-workspace-B-Eduqwz.js +7 -0
  19. package/dist/gateway/static/root/assets/{binary-plugins-zp55zQPu.js → binary-plugins-KDjduQZO.js} +1 -1
  20. package/dist/gateway/static/root/assets/{block-editor-B0CTIZb-.js → block-editor-bclvgove.js} +3 -3
  21. package/dist/gateway/static/root/assets/{browser-automation-inputs-Bx3W4J4H.js → browser-automation-inputs-CfQ2T9t6.js} +1 -1
  22. package/dist/gateway/static/root/assets/{browser-automations-page-D5Lr9b8a.js → browser-automations-page-Cxq38Nnp.js} +2 -2
  23. package/dist/gateway/static/root/assets/browser-settings-page-Dwgir6mu.js +3 -0
  24. package/dist/gateway/static/root/assets/capabilities-settings-panel-H5L5vynP.js +8 -0
  25. package/dist/gateway/static/root/assets/capabilities-uFKh3Hd0.js +1 -0
  26. package/dist/gateway/static/root/assets/channels-settings-RFBRYe5S.js +1 -0
  27. package/dist/gateway/static/root/assets/{chat-terminal-dock-1I1PdIq0.js → chat-terminal-dock-DKQC62nQ.js} +2 -2
  28. package/dist/gateway/static/root/assets/{computer-settings-page-BT-EfoI6.js → computer-settings-page-D1whpIqL.js} +1 -1
  29. package/dist/gateway/static/root/assets/{connector-service-page-mhQ-19tj.js → connector-service-page-BAuYTgf5.js} +1 -1
  30. package/dist/gateway/static/root/assets/connectors-page-Px-v3Q6Q.js +2 -0
  31. package/dist/gateway/static/root/assets/{date-picker-BqcldZoN.js → date-picker-CfCo3lqh.js} +1 -1
  32. package/dist/gateway/static/root/assets/{dependency-picker-DLDLJx3D.js → dependency-picker-DOuVO2M1.js} +1 -1
  33. package/dist/gateway/static/root/assets/{desktop-pet-kSFeHyrt.js → desktop-pet-D9tu6Bhu.js} +1 -1
  34. package/dist/gateway/static/root/assets/{desktop-pet-settings-BjY7DqD7.js → desktop-pet-settings-CQPXub2f.js} +1 -1
  35. package/dist/gateway/static/root/assets/device-pairing-wizard-DxkOYSut.js +1 -0
  36. package/dist/gateway/static/root/assets/{extension-debug-page-DbWJDT4X.js → extension-debug-page-CtWClPz-.js} +1 -1
  37. package/dist/gateway/static/root/assets/{extension-page-lAC_2xWA.js → extension-page-BHh9HLCz.js} +1 -1
  38. package/dist/gateway/static/root/assets/{extension-settings-page-jFy1NJg9.js → extension-settings-page-BdT3v5Uh.js} +1 -1
  39. package/dist/gateway/static/root/assets/{gateway-config-swr-B7WpH3VW.js → gateway-config-swr-1eqyz9vZ.js} +1 -1
  40. package/dist/gateway/static/root/assets/gateway-settings-CZas_Ekx.js +1 -0
  41. package/dist/gateway/static/root/assets/{gateway-startup-retry-C8F_z865.js → gateway-startup-retry-C4rsW6vJ.js} +1 -1
  42. package/dist/gateway/static/root/assets/home-page-w3_aWeNt.js +1 -0
  43. package/dist/gateway/static/root/assets/{image-generation-api-Dc7d0_7q.js → image-generation-api-B5DXMylk.js} +1 -1
  44. package/dist/gateway/static/root/assets/{imports-page-_fMvJvzM.js → imports-page-B1JH0G5j.js} +1 -1
  45. package/dist/gateway/static/root/assets/index--3c0awkr.js +121 -0
  46. package/dist/gateway/static/root/assets/index-CNc4N4TX.css +1 -0
  47. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CHnZYx1U.js → keyboard-shortcuts-settings-DGrLJ8Yh.js} +1 -1
  48. package/dist/gateway/static/root/assets/local-app-workbench-page-BYKrJpFF.js +1 -0
  49. package/dist/gateway/static/root/assets/local-apps-Bpja8nC6.js +1 -0
  50. package/dist/gateway/static/root/assets/local-apps-page-DqjStqbL.js +1 -0
  51. package/dist/gateway/static/root/assets/{locale-store-D9krC43K.js → locale-store-BIkcRr3t.js} +1 -1
  52. package/dist/gateway/static/root/assets/{logs-page-COxOJsgX.js → logs-page-Dl4kM4Na.js} +2 -2
  53. package/dist/gateway/static/root/assets/management-settings-gCfH4cwH.js +1 -0
  54. package/dist/gateway/static/root/assets/{markdown-view-CurpvCbB.js → markdown-view-Ck_5MADq.js} +1 -1
  55. package/dist/gateway/static/root/assets/{media-plugins-CYldyH6K.js → media-plugins-DTsZqgo6.js} +1 -1
  56. package/dist/gateway/static/root/assets/messages-7VAhscYe.js +3 -0
  57. package/dist/gateway/static/root/assets/note-detail-panel-j6sioeL1.js +5 -0
  58. package/dist/gateway/static/root/assets/notes-page-CMvvHv0f.js +8 -0
  59. package/dist/gateway/static/root/assets/{page-context-capture-button-DZOiI84c.js → page-context-capture-button-DTI_g4tz.js} +1 -1
  60. package/dist/gateway/static/root/assets/{page-tabs-C-XCf9cR.js → page-tabs-CfW_Q-K5.js} +1 -1
  61. package/dist/gateway/static/root/assets/{preview-open-alternatives-CvgeoEU8.js → preview-open-alternatives-CuPN-vAn.js} +1 -1
  62. package/dist/gateway/static/root/assets/product-delivery-bv3z8Xkh.js +1 -0
  63. package/dist/gateway/static/root/assets/product-open-page-BHjxRz1E.js +1 -0
  64. package/dist/gateway/static/root/assets/project-detail-page-C9K_e-EV.js +1 -0
  65. package/dist/gateway/static/root/assets/projects-page-Bk-es4i9.js +1 -0
  66. package/dist/gateway/static/root/assets/{registry-api-cK-g8BDq.js → registry-api-BAAZUGnU.js} +1 -1
  67. package/dist/gateway/static/root/assets/remote-access-hub-CLGJNA42.js +1 -0
  68. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DlUodTo-.js → runtime-tools-settings-panel-CHJBJKL1.js} +2 -2
  69. package/dist/gateway/static/root/assets/{scenes-page-DO8vGorm.js → scenes-page-ClLAD1pz.js} +2 -2
  70. package/dist/gateway/static/root/assets/{schema-form-BfboLCeN.js → schema-form-FQAit5HL.js} +1 -1
  71. package/dist/gateway/static/root/assets/sessions-page-Xj8MkXN1.js +1 -0
  72. package/dist/gateway/static/root/assets/settings-advanced-gate-DwALV8mi.js +1 -0
  73. package/dist/gateway/static/root/assets/{settings-form-section-BytEfCGo.js → settings-form-section-BDc6bw1q.js} +1 -1
  74. package/dist/gateway/static/root/assets/{settings-page-Da2ql9KX.js → settings-page-DnhxBJjV.js} +1 -1
  75. package/dist/gateway/static/root/assets/{settings-page-layout-CBfB_7yz.js → settings-page-layout-D3KNSQ5g.js} +1 -1
  76. package/dist/gateway/static/root/assets/{setup-status-panel-DElF2sgq.js → setup-status-panel-F0rCQ-2a.js} +1 -1
  77. package/dist/gateway/static/root/assets/{share-preview-page-B8J0Saj5.js → share-preview-page-DVQCRxwK.js} +1 -1
  78. package/dist/gateway/static/root/assets/shares-settings-C7hf6Cov.js +1 -0
  79. package/dist/gateway/static/root/assets/skill-reload-api-xPrFejRE.js +1 -0
  80. package/dist/gateway/static/root/assets/{skills-page-CNQHhsiv.js → skills-page-RdDYu7Yj.js} +1 -1
  81. package/dist/gateway/static/root/assets/{skills-page.utils-B53tyGx5.js → skills-page.utils-mDwC9UJ-.js} +1 -1
  82. package/dist/gateway/static/root/assets/{system-settings-panel-0HAvlVtR.js → system-settings-panel-Bk7GrMij.js} +1 -1
  83. package/dist/gateway/static/root/assets/task-detail-page-2A966jFY.js +1 -0
  84. package/dist/gateway/static/root/assets/{tunnel-api-DJsxU6q_.js → tunnel-api-D3Aquraj.js} +1 -1
  85. package/dist/gateway/static/root/assets/{use-autosave-eIELzAOD.js → use-autosave-C1xQ-sHn.js} +1 -1
  86. package/dist/gateway/static/root/assets/user-model-page-CnBxPBVe.js +2 -0
  87. package/dist/gateway/static/root/assets/{voice-api-key-field-BJ59ZCAn.js → voice-api-key-field-DCNECvcp.js} +1 -1
  88. package/dist/gateway/static/root/assets/{voice-config-api-DBXZJWLS.js → voice-config-api-B-_niUTU.js} +1 -1
  89. package/dist/gateway/static/root/assets/{work-discovery-overlay-BpSxdIgB.js → work-discovery-overlay-BrGx_JS_.js} +1 -1
  90. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Bhlv3VUX.js → workflow-run-setup-panel-CmmC2Pdr.js} +2 -2
  91. package/dist/gateway/static/root/assets/workflows-page-BZVpqw4T.js +6 -0
  92. package/dist/gateway/static/root/index.html +12 -11
  93. package/dist/package.js +1 -1
  94. package/dist/packages/gateway-contract/src/capabilities.js +4 -110
  95. package/dist/packages/gateway-contract/src/chat-previews.js +73 -0
  96. package/dist/packages/gateway-contract/src/index.js +6 -0
  97. package/dist/packages/gateway-contract/src/local-apps.js +215 -0
  98. package/dist/packages/gateway-contract/src/product-delivery.js +62 -17
  99. package/dist/packages/gateway-contract/src/user-turn-document.js +60 -0
  100. package/dist/src/agent/agent-manager.d.ts +1 -0
  101. package/dist/src/agent/agent-manager.js +1 -0
  102. package/dist/src/agent/embedded/transcript-runtime.d.ts +3 -0
  103. package/dist/src/agent/embedded/transcript-runtime.js +6 -0
  104. package/dist/src/agent/external-tools/cliProvider.js +4 -1
  105. package/dist/src/agent/external-tools/composio-provider.js +9 -3
  106. package/dist/src/agent/external-tools/gateway-tools.js +17 -10
  107. package/dist/src/agent/external-tools/mcp-provider.d.ts +3 -1
  108. package/dist/src/agent/external-tools/mcp-provider.js +91 -6
  109. package/dist/src/agent/external-tools/service.d.ts +2 -1
  110. package/dist/src/agent/external-tools/service.js +8 -3
  111. package/dist/src/agent/external-tools/types.d.ts +9 -0
  112. package/dist/src/agent/mcp/bundle-mcp-config.js +37 -5
  113. package/dist/src/agent/mcp/bundle-mcp-gateway.d.ts +1 -0
  114. package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -0
  115. package/dist/src/agent/mcp/bundle-mcp-names.js +2 -1
  116. package/dist/src/agent/mcp/bundle-mcp-runtime.js +33 -1
  117. package/dist/src/agent/mcp/bundle-mcp-types.d.ts +4 -0
  118. package/dist/src/agent/mcp/index.js +1 -1
  119. package/dist/src/agent/mcp/mcp-stdio-transport.d.ts +1 -0
  120. package/dist/src/agent/mcp/mcp-stdio-transport.js +10 -0
  121. package/dist/src/agent/mcp/mcp-transport.js +12 -8
  122. package/dist/src/agent/mcp/oauth/index.js +1 -1
  123. package/dist/src/agent/mcp/oauth/mcp-oauth-manager.d.ts +6 -1
  124. package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +70 -14
  125. package/dist/src/agent/mcp/oauth/mcp-oauth-provider.js +1 -1
  126. package/dist/src/agent/mcp/oauth/mcp-oauth-session.d.ts +2 -0
  127. package/dist/src/agent/mcp/oauth/mcp-oauth-session.js +12 -0
  128. package/dist/src/agent/mcp/oauth/mcp-oauth-store.d.ts +3 -0
  129. package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +13 -1
  130. package/dist/src/agent/mcp/plugin-http-fetch.d.ts +2 -0
  131. package/dist/src/agent/mcp/plugin-http-fetch.js +56 -0
  132. package/dist/src/agent/service/process-direct-streaming.js +27 -12
  133. package/dist/src/agent/service.js +1 -0
  134. package/dist/src/agent/service.types.d.ts +2 -0
  135. package/dist/src/agent/skills/hub-pull.js +1 -1
  136. package/dist/src/agent/skills/index.js +8 -1
  137. package/dist/src/agent/skills/skill-manager.d.ts +2 -0
  138. package/dist/src/agent/skills/skill-manager.js +8 -0
  139. package/dist/src/agent/skills/skill-sources.js +17 -0
  140. package/dist/src/agent/skills/types.d.ts +3 -1
  141. package/dist/src/agent/source-context/injector.js +10 -5
  142. package/dist/src/agent/source-context/types.d.ts +3 -0
  143. package/dist/src/agent/source-context/types.js +8 -2
  144. package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
  145. package/dist/src/agent/tool-manuals/xopc-use.js +12 -2
  146. package/dist/src/agent/tools/automation-tool.js +1 -1
  147. package/dist/src/agent/tools/factory.d.ts +1 -0
  148. package/dist/src/agent/tools/factory.js +2 -1
  149. package/dist/src/agent/tools/workflow-tool.js +1 -1
  150. package/dist/src/agent/tools/write.js +1 -1
  151. package/dist/src/agent/tools/xopc-use-tool.d.ts +4 -2
  152. package/dist/src/agent/tools/xopc-use-tool.js +120 -12
  153. package/dist/src/chat-previews/index.d.ts +2 -0
  154. package/dist/src/chat-previews/index.js +3 -0
  155. package/dist/src/chat-previews/service.d.ts +27 -0
  156. package/dist/src/chat-previews/service.js +106 -0
  157. package/dist/src/chat-previews/store.d.ts +28 -0
  158. package/dist/src/chat-previews/store.js +77 -0
  159. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  160. package/dist/src/cli/commands/extension-agent-plugin.d.ts +8 -0
  161. package/dist/src/cli/commands/extension-agent-plugin.js +82 -0
  162. package/dist/src/cli/commands/extension-marketplace.js +44 -4
  163. package/dist/src/cli/commands/extension.js +35 -3
  164. package/dist/src/connectors/account-selection.js +1 -1
  165. package/dist/src/connectors/connection-candidates.d.ts +4 -1
  166. package/dist/src/connectors/connection-candidates.js +8 -2
  167. package/dist/src/connectors/connection-capabilities.d.ts +2 -2
  168. package/dist/src/connectors/connection-capabilities.js +3 -1
  169. package/dist/src/connectors/connection-recovery-service.d.ts +6 -1
  170. package/dist/src/connectors/connection-recovery-service.js +138 -26
  171. package/dist/src/connectors/plugin-mcp-recovery.d.ts +28 -0
  172. package/dist/src/connectors/plugin-mcp-recovery.js +90 -0
  173. package/dist/src/extensions/agent-plugins/auth.d.ts +39 -0
  174. package/dist/src/extensions/agent-plugins/auth.js +156 -0
  175. package/dist/src/extensions/agent-plugins/connection.d.ts +8 -0
  176. package/dist/src/extensions/agent-plugins/connection.js +41 -0
  177. package/dist/src/extensions/agent-plugins/health.d.ts +4 -0
  178. package/dist/src/extensions/agent-plugins/health.js +48 -0
  179. package/dist/src/extensions/agent-plugins/inventory.d.ts +53 -0
  180. package/dist/src/extensions/agent-plugins/inventory.js +34 -0
  181. package/dist/src/extensions/agent-plugins/mcp-adapter.d.ts +3 -0
  182. package/dist/src/extensions/agent-plugins/mcp-adapter.js +47 -0
  183. package/dist/src/extensions/agent-plugins/sources.d.ts +5 -0
  184. package/dist/src/extensions/agent-plugins/sources.js +72 -0
  185. package/dist/src/extensions/agent-plugins/store.d.ts +61 -0
  186. package/dist/src/extensions/agent-plugins/store.js +305 -0
  187. package/dist/src/extensions/agent-plugins/validation.d.ts +59 -0
  188. package/dist/src/extensions/agent-plugins/validation.js +211 -0
  189. package/dist/src/extensions/update.js +1 -1
  190. package/dist/src/gateway/chat-stream/mapper.js +10 -3
  191. package/dist/src/gateway/hono/routes/agent-plugins.d.ts +3 -0
  192. package/dist/src/gateway/hono/routes/agent-plugins.js +166 -0
  193. package/dist/src/gateway/hono/routes/agent-stream.js +14 -0
  194. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +4 -2
  195. package/dist/src/gateway/hono/routes/chat-previews.d.ts +3 -0
  196. package/dist/src/gateway/hono/routes/chat-previews.js +41 -0
  197. package/dist/src/gateway/hono/routes/connection-waits.js +4 -2
  198. package/dist/src/gateway/hono/routes/index.js +2 -0
  199. package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
  200. package/dist/src/gateway/hono/routes/local-apps.js +71 -39
  201. package/dist/src/gateway/hono/routes/mcp.js +48 -21
  202. package/dist/src/gateway/hono/routes/session-input-handler.d.ts +4 -0
  203. package/dist/src/gateway/hono/routes/session-input-handler.js +22 -0
  204. package/dist/src/gateway/hono/routes/side-chats.js +11 -0
  205. package/dist/src/gateway/service/agent-runner.js +7 -1
  206. package/dist/src/gateway/service/marketplace-service.d.ts +1 -0
  207. package/dist/src/gateway/service/marketplace-service.js +15 -1
  208. package/dist/src/gateway/service/session-input-coordinator.js +3 -3
  209. package/dist/src/gateway/service.d.ts +5 -1
  210. package/dist/src/gateway/service.js +14 -0
  211. package/dist/src/gateway/side-chat/index.d.ts +3 -1
  212. package/dist/src/gateway/side-chat/index.js +2 -1
  213. package/dist/src/gateway/side-chat/manager.d.ts +16 -0
  214. package/dist/src/gateway/side-chat/manager.js +40 -6
  215. package/dist/src/gateway/side-chat/promotion-service.d.ts +19 -0
  216. package/dist/src/gateway/side-chat/promotion-service.js +111 -0
  217. package/dist/src/gateway/side-chat/run-service.js +1 -0
  218. package/dist/src/gateway/side-chat/types.d.ts +1 -1
  219. package/dist/src/local-apps/artifact-files.d.ts +3 -0
  220. package/dist/src/local-apps/artifact-files.js +45 -0
  221. package/dist/src/local-apps/capabilities/write.js +1 -1
  222. package/dist/src/local-apps/fix-guidance.d.ts +3 -0
  223. package/dist/src/local-apps/fix-guidance.js +75 -0
  224. package/dist/src/local-apps/index.d.ts +2 -1
  225. package/dist/src/local-apps/scaffold.d.ts +5 -0
  226. package/dist/src/local-apps/scaffold.js +18 -5
  227. package/dist/src/local-apps/service.d.ts +18 -3
  228. package/dist/src/local-apps/service.js +106 -64
  229. package/dist/src/local-apps/snapshot-store.d.ts +8 -0
  230. package/dist/src/local-apps/snapshot-store.js +68 -0
  231. package/dist/src/local-apps/types.d.ts +4 -87
  232. package/dist/src/session/client-history.d.ts +3 -1
  233. package/dist/src/session/client-history.js +10 -3
  234. package/dist/src/session/index.d.ts +1 -1
  235. package/dist/src/session/manager.d.ts +4 -0
  236. package/dist/src/session/manager.js +6 -0
  237. package/dist/src/session/session-context-for-llm.d.ts +12 -1
  238. package/dist/src/session/session-context-for-llm.js +16 -2
  239. package/dist/src/session/store.d.ts +14 -0
  240. package/dist/src/session/store.js +17 -0
  241. package/dist/src/session/stored-rows-to-file-entries.js +10 -1
  242. package/dist/src/session/transcript-outline.js +10 -3
  243. package/dist/src/storage/sqlite/connection-wait-repository.js +9 -3
  244. package/dist/src/storage/sqlite/migrations/202_chat_previews.sql +26 -0
  245. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  246. package/dist/src/storage/sqlite/migrations/runner.js +3 -3
  247. package/dist/src/storage/sqlite/row-mappers.js +6 -1
  248. package/dist/src/storage/sqlite/schema.js +1 -1
  249. package/package.json +3 -3
  250. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DWLXHWXg.js +0 -1
  251. package/dist/gateway/static/root/assets/api-Df2D6d3C.js +0 -1
  252. package/dist/gateway/static/root/assets/apps-page-BzytHIn1.js +0 -1
  253. package/dist/gateway/static/root/assets/automations-workspace-CtSV8tp-.js +0 -7
  254. package/dist/gateway/static/root/assets/browser-settings-page-DrvNA-G2.js +0 -3
  255. package/dist/gateway/static/root/assets/capabilities-D0S3DuAD.js +0 -1
  256. package/dist/gateway/static/root/assets/capabilities-settings-panel-c0k2virA.js +0 -8
  257. package/dist/gateway/static/root/assets/channels-settings-Bkl9fDHc.js +0 -1
  258. package/dist/gateway/static/root/assets/connectors-page-Dw_h-5Qh.js +0 -2
  259. package/dist/gateway/static/root/assets/device-pairing-wizard-C5f4FRpE.js +0 -1
  260. package/dist/gateway/static/root/assets/gateway-settings-D7XbH6Hk.js +0 -1
  261. package/dist/gateway/static/root/assets/home-page-CFJypY6Y.js +0 -1
  262. package/dist/gateway/static/root/assets/index-B4Vwh0H-.css +0 -1
  263. package/dist/gateway/static/root/assets/index-BNubE2Zi.js +0 -89
  264. package/dist/gateway/static/root/assets/local-app-workbench-page-BLKCFXvr.js +0 -2
  265. package/dist/gateway/static/root/assets/local-apps-page-BNFmOkxs.js +0 -1
  266. package/dist/gateway/static/root/assets/management-settings-BX5NtnQ2.js +0 -1
  267. package/dist/gateway/static/root/assets/messages-B1sTgIrE.js +0 -3
  268. package/dist/gateway/static/root/assets/note-detail-panel-DZ0IWx1R.js +0 -5
  269. package/dist/gateway/static/root/assets/notes-page-B9F1uue_.js +0 -8
  270. package/dist/gateway/static/root/assets/product-delivery-chCjIpvu.js +0 -1
  271. package/dist/gateway/static/root/assets/product-open-page-DEYWx__w.js +0 -1
  272. package/dist/gateway/static/root/assets/project-detail-page-9qMDEKVd.js +0 -1
  273. package/dist/gateway/static/root/assets/projects-page-D4UTOpEm.js +0 -1
  274. package/dist/gateway/static/root/assets/remote-access-hub-CPmOucUB.js +0 -1
  275. package/dist/gateway/static/root/assets/sessions-page-zu5P0dk5.js +0 -1
  276. package/dist/gateway/static/root/assets/settings-advanced-gate-ClEw-i1l.js +0 -1
  277. package/dist/gateway/static/root/assets/shares-settings-MLolJfoV.js +0 -1
  278. package/dist/gateway/static/root/assets/skill-reload-api-DTPsW9TY.js +0 -1
  279. package/dist/gateway/static/root/assets/task-detail-page-Dc30oS9J.js +0 -1
  280. package/dist/gateway/static/root/assets/user-model-page-Bq6ab5WJ.js +0 -2
  281. package/dist/gateway/static/root/assets/workflows-page-Ci-4HAYm.js +0 -6
@@ -2,13 +2,14 @@ import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
2
2
  import { TaskPhaseSchema, TaskWaitSchema, init_task_lifecycle } from "./task-lifecycle.js";
3
3
  import { TaskRunEventSchema, TaskRunSchema, init_task_runs } from "./task-runs.js";
4
4
  import { TaskDetailResponseSchema, TaskListResponseSchema, TaskPrioritySchema, TaskRunReceiptSchema, init_tasks } from "./tasks.js";
5
+ import { LocalAppDetailSchema, LocalAppRecordSchema, LocalAppValidationSchema, init_local_apps } from "./local-apps.js";
5
6
  import { TaskValueMetricsSchema, init_home } from "./home.js";
6
7
  import { AutomationMetricsSchema, AutomationRunEventSchema, AutomationRunSchema, AutomationSchema, init_automations } from "./automations.js";
7
8
  import { AppContextEnvelopeSchema, ResolvedAppContextSchema, init_app_context } from "./app-context.js";
8
9
  import { SceneActivationSchema, SceneConfigureSchema, SceneFeedbackSchema, ScenePreferencePatchSchema, SceneTransitionSchema, SceneWorkItemCreateSchema, SceneWorkItemSchema, SceneWorkItemUpdateSchema, activationInputSchema, init_scenes, sceneNotesSchema, scenePreferencesSchema, sceneScheduleSchema, sceneTemplateSchema } from "./scenes.js";
9
10
  import { z } from "zod";
10
11
  //#region packages/gateway-contract/src/capabilities.ts
11
- var CapabilityErrorCodeSchema, CapabilityCallSchema, AutomationSimulationSchema, AutomationDraftRequestSchema, AutomationDraftOutputSchema, AutomationRepairDraftOutputSchema, CapabilityResourceInputSchema, LocalAppAcceptanceInputSchema, LocalAppAcceptanceOutputSchema, ScenePageInputSchema, SceneWriteContracts, SceneOutcomeReadSchema, TaskRunCancelInputSchema, TaskRunFeedbackInputSchema, TaskRunFeedbackOutputSchema, TaskRunCancelOutputSchema, AutomationSetEnabledInputSchema, AutomationMutationOutputSchema, AutomationRunMutationOutputSchema, AutomationCancelOutputSchema, AutomationReadOutputSchema, AutomationReadAllInputSchema, AutomationReadAllOutputSchema, AutomationDeleteInputSchema, AutomationDeleteOutputSchema, NoteListInputSchema, NoteRecordSchema, NoteGetOutputSchema, NoteDeleteInputSchema, NoteDeleteOutputSchema, NoteCreateInputSchema, NoteUpdateInputSchema, NoteCaptureInputSchema, NoteAppendInputSchema, NoteRestoreInputSchema, NoteListOutputSchema, TaskListInputSchema, ProjectRecordSchema, ProjectSetPinnedInputSchema, ProjectMutationOutputSchema, ProjectResolveWorkspaceInputSchema, ProjectResolveWorkspaceOutputSchema, ProjectDeleteInputSchema, ProjectDeleteOutputSchema, ProjectFields, ProjectCreateInputSchema, ProjectEditInputSchema, ProjectListInputSchema, LocalAppRecordSchema, LocalAppDetailSchema, ProjectMilestoneSchema, LocalAppValidationSchema, ProjectUpdateSchema, MilestoneFields, ProjectMilestoneCreateInputSchema, ProjectMilestoneUpdateInputSchema, ProjectMilestoneDeleteInputSchema, ProjectMilestoneOutputSchema, ProjectMilestoneDeleteOutputSchema, ProjectUpdateCreateInputSchema, ProjectUpdateOutputSchema, ProductReadContracts;
12
+ var CapabilityErrorCodeSchema, CapabilityCallSchema, AutomationSimulationSchema, AutomationDraftRequestSchema, AutomationDraftOutputSchema, AutomationRepairDraftOutputSchema, CapabilityResourceInputSchema, ScenePageInputSchema, SceneWriteContracts, SceneOutcomeReadSchema, TaskRunCancelInputSchema, TaskRunFeedbackInputSchema, TaskRunFeedbackOutputSchema, TaskRunCancelOutputSchema, AutomationSetEnabledInputSchema, AutomationMutationOutputSchema, AutomationRunMutationOutputSchema, AutomationCancelOutputSchema, AutomationReadOutputSchema, AutomationReadAllInputSchema, AutomationReadAllOutputSchema, AutomationDeleteInputSchema, AutomationDeleteOutputSchema, NoteListInputSchema, NoteRecordSchema, NoteGetOutputSchema, NoteDeleteInputSchema, NoteDeleteOutputSchema, NoteCreateInputSchema, NoteUpdateInputSchema, NoteCaptureInputSchema, NoteAppendInputSchema, NoteRestoreInputSchema, NoteListOutputSchema, TaskListInputSchema, ProjectRecordSchema, ProjectSetPinnedInputSchema, ProjectMutationOutputSchema, ProjectResolveWorkspaceInputSchema, ProjectResolveWorkspaceOutputSchema, ProjectDeleteInputSchema, ProjectDeleteOutputSchema, ProjectFields, ProjectCreateInputSchema, ProjectEditInputSchema, ProjectListInputSchema, ProjectMilestoneSchema, ProjectUpdateSchema, MilestoneFields, ProjectMilestoneCreateInputSchema, ProjectMilestoneUpdateInputSchema, ProjectMilestoneDeleteInputSchema, ProjectMilestoneOutputSchema, ProjectMilestoneDeleteOutputSchema, ProjectUpdateCreateInputSchema, ProjectUpdateOutputSchema, ProductReadContracts;
12
13
  var init_capabilities = __esmMin((() => {
13
14
  init_app_context();
14
15
  init_task_lifecycle();
@@ -17,6 +18,7 @@ var init_capabilities = __esmMin((() => {
17
18
  init_automations();
18
19
  init_home();
19
20
  init_scenes();
21
+ init_local_apps();
20
22
  z.enum([
21
23
  "http",
22
24
  "agent",
@@ -98,30 +100,6 @@ var init_capabilities = __esmMin((() => {
98
100
  operationId: z.string().optional()
99
101
  });
100
102
  CapabilityResourceInputSchema = z.strictObject({ id: z.string().trim().min(1).max(512) });
101
- LocalAppAcceptanceInputSchema = z.strictObject({
102
- sourceHash: z.string().regex(/^[a-f0-9]{64}$/),
103
- status: z.enum(["passed", "failed"]),
104
- interactiveCount: z.number().int().min(0).max(1e4),
105
- checks: z.array(z.strictObject({
106
- id: z.enum([
107
- "document",
108
- "content",
109
- "interaction",
110
- "criteria"
111
- ]),
112
- status: z.enum([
113
- "passed",
114
- "failed",
115
- "skipped"
116
- ]),
117
- message: z.string().trim().min(1).max(500)
118
- })).min(3).max(4)
119
- });
120
- LocalAppAcceptanceOutputSchema = LocalAppAcceptanceInputSchema.extend({
121
- id: z.string(),
122
- appId: z.string(),
123
- createdAt: z.number().int().nonnegative()
124
- });
125
103
  ScenePageInputSchema = z.strictObject({
126
104
  limit: z.number().int().min(1).max(100).default(50),
127
105
  afterId: z.string().max(200).default("")
@@ -512,59 +490,6 @@ var init_capabilities = __esmMin((() => {
512
490
  limit: z.number().int().min(1).max(500).default(50),
513
491
  offset: z.number().int().nonnegative().default(0)
514
492
  });
515
- LocalAppRecordSchema = z.looseObject({
516
- id: z.string(),
517
- extensionId: z.string(),
518
- projectId: z.string(),
519
- name: z.string(),
520
- idea: z.string(),
521
- status: z.enum([
522
- "preview_ready",
523
- "installed",
524
- "degraded"
525
- ]),
526
- workspaceRoot: z.string(),
527
- draftVersion: z.number().int(),
528
- installationState: z.enum(["not_installed", "installed"]),
529
- enabled: z.boolean(),
530
- createdAt: z.number(),
531
- updatedAt: z.number()
532
- });
533
- LocalAppDetailSchema = LocalAppRecordSchema.extend({
534
- previewUrl: z.string(),
535
- permissions: z.array(z.string()),
536
- releases: z.array(z.looseObject({
537
- id: z.string(),
538
- appId: z.string(),
539
- version: z.number().int(),
540
- sourceHash: z.string(),
541
- healthStatus: z.enum(["healthy", "failed"]),
542
- createdAt: z.number(),
543
- isActive: z.boolean()
544
- })),
545
- acceptanceRuns: z.array(z.looseObject({
546
- id: z.string(),
547
- appId: z.string(),
548
- sourceHash: z.string(),
549
- status: z.enum(["passed", "failed"]),
550
- createdAt: z.number(),
551
- interactiveCount: z.number().int().nonnegative(),
552
- checks: z.array(z.object({
553
- id: z.enum([
554
- "document",
555
- "content",
556
- "interaction",
557
- "criteria"
558
- ]),
559
- status: z.enum([
560
- "passed",
561
- "failed",
562
- "skipped"
563
- ]),
564
- message: z.string()
565
- }))
566
- }))
567
- });
568
493
  ProjectMilestoneSchema = z.looseObject({
569
494
  id: z.string(),
570
495
  projectId: z.string(),
@@ -579,37 +504,6 @@ var init_capabilities = __esmMin((() => {
579
504
  createdAt: z.number(),
580
505
  updatedAt: z.number()
581
506
  });
582
- LocalAppValidationSchema = z.object({
583
- status: z.enum(["healthy", "failed"]),
584
- checkedAt: z.number(),
585
- sourceHash: z.string().optional(),
586
- hasDraftChanges: z.boolean(),
587
- changedFiles: z.array(z.object({
588
- path: z.string(),
589
- status: z.enum([
590
- "added",
591
- "modified",
592
- "deleted"
593
- ])
594
- })),
595
- changedFileCount: z.number().int().nonnegative(),
596
- permissions: z.array(z.string()),
597
- permissionDelta: z.object({
598
- added: z.array(z.string()),
599
- removed: z.array(z.string())
600
- }),
601
- acceptanceScenarioCount: z.number().int().nonnegative(),
602
- acceptanceScenarios: z.array(z.object({
603
- id: z.string(),
604
- name: z.string(),
605
- stepCount: z.number().int().nonnegative()
606
- })),
607
- issues: z.array(z.object({
608
- code: z.string(),
609
- severity: z.enum(["error", "warning"]),
610
- message: z.string()
611
- }))
612
- });
613
507
  ProjectUpdateSchema = z.looseObject({
614
508
  id: z.string(),
615
509
  projectId: z.string(),
@@ -1075,4 +969,4 @@ var init_capabilities = __esmMin((() => {
1075
969
  }));
1076
970
  //#endregion
1077
971
  init_capabilities();
1078
- export { AutomationCancelOutputSchema, AutomationDeleteInputSchema, AutomationDeleteOutputSchema, AutomationDraftOutputSchema, AutomationDraftRequestSchema, AutomationMutationOutputSchema, AutomationReadAllInputSchema, AutomationReadAllOutputSchema, AutomationReadOutputSchema, AutomationRepairDraftOutputSchema, AutomationRunMutationOutputSchema, AutomationSetEnabledInputSchema, AutomationSimulationSchema, CapabilityCallSchema, CapabilityErrorCodeSchema, CapabilityResourceInputSchema, LocalAppAcceptanceInputSchema, LocalAppAcceptanceOutputSchema, LocalAppDetailSchema, LocalAppRecordSchema, LocalAppValidationSchema, NoteAppendInputSchema, NoteCaptureInputSchema, NoteCreateInputSchema, NoteDeleteInputSchema, NoteDeleteOutputSchema, NoteGetOutputSchema, NoteListInputSchema, NoteListOutputSchema, NoteRecordSchema, NoteRestoreInputSchema, NoteUpdateInputSchema, ProductReadContracts, ProjectCreateInputSchema, ProjectDeleteInputSchema, ProjectDeleteOutputSchema, ProjectEditInputSchema, ProjectListInputSchema, ProjectMilestoneCreateInputSchema, ProjectMilestoneDeleteInputSchema, ProjectMilestoneDeleteOutputSchema, ProjectMilestoneOutputSchema, ProjectMilestoneSchema, ProjectMilestoneUpdateInputSchema, ProjectMutationOutputSchema, ProjectRecordSchema, ProjectResolveWorkspaceInputSchema, ProjectResolveWorkspaceOutputSchema, ProjectSetPinnedInputSchema, ProjectUpdateCreateInputSchema, ProjectUpdateOutputSchema, ProjectUpdateSchema, ScenePageInputSchema, SceneWriteContracts, TaskListInputSchema, TaskRunCancelInputSchema, TaskRunCancelOutputSchema, TaskRunFeedbackInputSchema, TaskRunFeedbackOutputSchema, init_capabilities };
972
+ export { AutomationCancelOutputSchema, AutomationDeleteInputSchema, AutomationDeleteOutputSchema, AutomationDraftOutputSchema, AutomationDraftRequestSchema, AutomationMutationOutputSchema, AutomationReadAllInputSchema, AutomationReadAllOutputSchema, AutomationReadOutputSchema, AutomationRepairDraftOutputSchema, AutomationRunMutationOutputSchema, AutomationSetEnabledInputSchema, AutomationSimulationSchema, CapabilityCallSchema, CapabilityErrorCodeSchema, CapabilityResourceInputSchema, NoteAppendInputSchema, NoteCaptureInputSchema, NoteCreateInputSchema, NoteDeleteInputSchema, NoteDeleteOutputSchema, NoteGetOutputSchema, NoteListInputSchema, NoteListOutputSchema, NoteRecordSchema, NoteRestoreInputSchema, NoteUpdateInputSchema, ProductReadContracts, ProjectCreateInputSchema, ProjectDeleteInputSchema, ProjectDeleteOutputSchema, ProjectEditInputSchema, ProjectListInputSchema, ProjectMilestoneCreateInputSchema, ProjectMilestoneDeleteInputSchema, ProjectMilestoneDeleteOutputSchema, ProjectMilestoneOutputSchema, ProjectMilestoneSchema, ProjectMilestoneUpdateInputSchema, ProjectMutationOutputSchema, ProjectRecordSchema, ProjectResolveWorkspaceInputSchema, ProjectResolveWorkspaceOutputSchema, ProjectSetPinnedInputSchema, ProjectUpdateCreateInputSchema, ProjectUpdateOutputSchema, ProjectUpdateSchema, ScenePageInputSchema, SceneWriteContracts, TaskListInputSchema, TaskRunCancelInputSchema, TaskRunCancelOutputSchema, TaskRunFeedbackInputSchema, TaskRunFeedbackOutputSchema, init_capabilities };
@@ -0,0 +1,73 @@
1
+ import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
2
+ import { z } from "zod";
3
+ //#region packages/gateway-contract/src/chat-previews.ts
4
+ var CHAT_PREVIEW_MAX_SOURCE_SIZE, CHAT_PREVIEW_RUNTIME_SOURCE, ChatPreviewSourceHashSchema, ChatPreviewSourceSchema, ChatPreviewCreateInputSchema, ChatPreviewReviseInputSchema, ChatPreviewDiagnosticSchema, ChatPreviewFixGuidanceInputSchema, chatPreviewRuntimeEnvelope;
5
+ var init_chat_previews = __esmMin((() => {
6
+ CHAT_PREVIEW_MAX_SOURCE_SIZE = 256 * 1024;
7
+ CHAT_PREVIEW_RUNTIME_SOURCE = "xopc-chat-preview";
8
+ ChatPreviewSourceHashSchema = z.string().regex(/^[a-f0-9]{64}$/);
9
+ ChatPreviewSourceSchema = z.strictObject({
10
+ markup: z.string().max(128 * 1024),
11
+ styles: z.string().max(128 * 1024).default(""),
12
+ script: z.string().max(128 * 1024).default("")
13
+ }).refine((source) => source.markup.length + source.styles.length + source.script.length <= CHAT_PREVIEW_MAX_SOURCE_SIZE, "Preview source exceeds the 256 KiB limit").refine((source) => !/<\/?(?:html|head|body|script|style)\b/i.test(source.markup), "Preview markup must be an HTML fragment; put CSS and JavaScript in their dedicated fields");
14
+ z.strictObject({
15
+ id: z.string().uuid(),
16
+ conversationId: z.string().uuid(),
17
+ title: z.string().trim().min(1).max(120),
18
+ preferredHeight: z.number().int().min(240).max(720),
19
+ latestRevision: ChatPreviewSourceHashSchema,
20
+ createdAt: z.number().int().nonnegative(),
21
+ updatedAt: z.number().int().nonnegative()
22
+ });
23
+ ChatPreviewSourceSchema.extend({
24
+ previewId: z.string().uuid(),
25
+ sourceHash: ChatPreviewSourceHashSchema,
26
+ createdAt: z.number().int().nonnegative()
27
+ });
28
+ ChatPreviewCreateInputSchema = ChatPreviewSourceSchema.extend({
29
+ title: z.string().trim().min(1).max(120),
30
+ preferredHeight: z.number().int().min(240).max(720).default(480)
31
+ });
32
+ ChatPreviewReviseInputSchema = ChatPreviewSourceSchema.extend({
33
+ baseRevision: ChatPreviewSourceHashSchema,
34
+ title: z.string().trim().min(1).max(120).optional(),
35
+ preferredHeight: z.number().int().min(240).max(720).optional()
36
+ });
37
+ ChatPreviewDiagnosticSchema = z.strictObject({
38
+ kind: z.enum(["script_error", "unhandled_rejection"]),
39
+ message: z.string().trim().min(1).max(500),
40
+ filename: z.string().max(500).optional(),
41
+ line: z.number().int().nonnegative().optional(),
42
+ column: z.number().int().nonnegative().optional()
43
+ });
44
+ ChatPreviewFixGuidanceInputSchema = z.strictObject({
45
+ sourceHash: ChatPreviewSourceHashSchema,
46
+ diagnostics: z.array(ChatPreviewDiagnosticSchema).min(1).max(20),
47
+ locale: z.enum(["en", "zh"]).default("en")
48
+ });
49
+ z.strictObject({
50
+ previewId: z.string().uuid(),
51
+ sourceHash: ChatPreviewSourceHashSchema,
52
+ prompt: z.string().min(1)
53
+ });
54
+ chatPreviewRuntimeEnvelope = z.strictObject({
55
+ source: z.literal(CHAT_PREVIEW_RUNTIME_SOURCE),
56
+ version: z.literal(1),
57
+ channel: z.string().uuid()
58
+ });
59
+ z.discriminatedUnion("type", [
60
+ chatPreviewRuntimeEnvelope.extend({ type: z.literal("ready") }),
61
+ chatPreviewRuntimeEnvelope.extend({
62
+ type: z.literal("resize"),
63
+ height: z.number().finite().min(120).max(2e3)
64
+ }),
65
+ chatPreviewRuntimeEnvelope.extend({
66
+ type: z.literal("error"),
67
+ diagnostic: ChatPreviewDiagnosticSchema
68
+ })
69
+ ]);
70
+ }));
71
+ //#endregion
72
+ init_chat_previews();
73
+ export { CHAT_PREVIEW_MAX_SOURCE_SIZE, CHAT_PREVIEW_RUNTIME_SOURCE, ChatPreviewCreateInputSchema, ChatPreviewDiagnosticSchema, ChatPreviewFixGuidanceInputSchema, ChatPreviewReviseInputSchema, ChatPreviewSourceHashSchema, ChatPreviewSourceSchema, init_chat_previews };
@@ -4,6 +4,8 @@ import { init_turn_outcome } from "./turn-outcome.js";
4
4
  import { init_task_lifecycle } from "./task-lifecycle.js";
5
5
  import { init_task_runs } from "./task-runs.js";
6
6
  import { init_tasks } from "./tasks.js";
7
+ import { init_chat_previews } from "./chat-previews.js";
8
+ import { init_local_apps } from "./local-apps.js";
7
9
  import { init_product_delivery } from "./product-delivery.js";
8
10
  import { init_project_monitoring } from "./project-monitoring.js";
9
11
  import { init_project_operating } from "./project-operating.js";
@@ -16,6 +18,7 @@ import { init_home } from "./home.js";
16
18
  import { init_tool_activity } from "./tool-activity.js";
17
19
  import { init_automations } from "./automations.js";
18
20
  import { init_user_message_display } from "./user-message-display.js";
21
+ import { init_user_turn_document } from "./user-turn-document.js";
19
22
  import { init_new_session } from "./new-session.js";
20
23
  import { init_notifications } from "./notifications.js";
21
24
  import { init_files } from "./files.js";
@@ -52,6 +55,7 @@ var init_src = __esmMin((() => {
52
55
  init_tool_activity();
53
56
  init_automations();
54
57
  init_user_message_display();
58
+ init_user_turn_document();
55
59
  init_new_session();
56
60
  init_notifications();
57
61
  init_files();
@@ -69,6 +73,8 @@ var init_src = __esmMin((() => {
69
73
  init_scenes();
70
74
  init_app_context();
71
75
  init_extension_capabilities();
76
+ init_local_apps();
77
+ init_chat_previews();
72
78
  }));
73
79
  //#endregion
74
80
  init_src();
@@ -0,0 +1,215 @@
1
+ import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
2
+ import { z } from "zod";
3
+ //#region packages/gateway-contract/src/local-apps.ts
4
+ var LocalAppSourceHashSchema, LocalAppStatusSchema, LocalAppInstallationStateSchema, LocalAppReleaseHealthSchema, LocalAppAcceptanceCheckSchema, LocalAppAcceptanceResultSchema, LocalAppAcceptanceInputSchema, LocalAppAcceptanceOutputSchema, LocalAppReleaseSchema, LocalAppRecordSchema, LocalAppAcceptanceRunSchema, LocalAppDetailSchema, LocalAppValidationIssueSchema, LocalAppChangedFileSchema, LocalAppAcceptanceScenarioSummarySchema, LocalAppValidationSchema, LocalAppPreviewSnapshotSchema, LocalAppDiagnosticPhaseSchema, LocalAppDiagnosticSchema, LocalAppFixGuidanceInputSchema, LocalAppRuntimeIssueSchema, LocalAppCriteriaScenarioResultSchema, LocalAppCriteriaResultSchema, runtimeEnvelope;
5
+ var init_local_apps = __esmMin((() => {
6
+ LocalAppSourceHashSchema = z.string().regex(/^[a-f0-9]{64}$/);
7
+ LocalAppStatusSchema = z.enum([
8
+ "preview_ready",
9
+ "installed",
10
+ "degraded"
11
+ ]);
12
+ LocalAppInstallationStateSchema = z.enum(["not_installed", "installed"]);
13
+ LocalAppReleaseHealthSchema = z.enum(["healthy", "failed"]);
14
+ LocalAppAcceptanceCheckSchema = z.strictObject({
15
+ id: z.enum([
16
+ "document",
17
+ "content",
18
+ "interaction",
19
+ "criteria"
20
+ ]),
21
+ status: z.enum([
22
+ "passed",
23
+ "failed",
24
+ "skipped"
25
+ ]),
26
+ message: z.string().trim().min(1).max(500)
27
+ });
28
+ LocalAppAcceptanceResultSchema = z.strictObject({
29
+ status: z.enum(["passed", "failed"]),
30
+ checks: z.array(LocalAppAcceptanceCheckSchema).min(1).max(10),
31
+ interactiveCount: z.number().int().min(0).max(1e4)
32
+ });
33
+ LocalAppAcceptanceInputSchema = LocalAppAcceptanceResultSchema.extend({ sourceHash: LocalAppSourceHashSchema }).refine((value) => value.checks.length >= 3 && value.checks.length <= 4, {
34
+ message: "Acceptance input must contain three or four checks",
35
+ path: ["checks"]
36
+ });
37
+ LocalAppAcceptanceOutputSchema = LocalAppAcceptanceInputSchema.safeExtend({
38
+ id: z.string().min(1),
39
+ appId: z.string().min(1),
40
+ createdAt: z.number().int().nonnegative()
41
+ });
42
+ LocalAppReleaseSchema = z.strictObject({
43
+ id: z.string().min(1),
44
+ appId: z.string().min(1),
45
+ version: z.number().int().positive(),
46
+ sourceHash: LocalAppSourceHashSchema,
47
+ healthStatus: LocalAppReleaseHealthSchema,
48
+ createdAt: z.number().int().nonnegative(),
49
+ activatedAt: z.number().int().nonnegative().optional(),
50
+ isActive: z.boolean()
51
+ });
52
+ LocalAppRecordSchema = z.strictObject({
53
+ id: z.string().min(1),
54
+ extensionId: z.string().min(1),
55
+ projectId: z.string().min(1),
56
+ name: z.string().min(1),
57
+ description: z.string().optional(),
58
+ idea: z.string().min(1),
59
+ status: LocalAppStatusSchema,
60
+ workspaceRoot: z.string().min(1),
61
+ draftVersion: z.number().int().positive(),
62
+ activeVersion: z.number().int().positive().optional(),
63
+ activeReleaseId: z.string().min(1).optional(),
64
+ installationState: LocalAppInstallationStateSchema,
65
+ enabled: z.boolean(),
66
+ createdAt: z.number().int().nonnegative(),
67
+ updatedAt: z.number().int().nonnegative(),
68
+ installedAt: z.number().int().nonnegative().optional()
69
+ });
70
+ LocalAppAcceptanceRunSchema = LocalAppAcceptanceOutputSchema;
71
+ LocalAppDetailSchema = LocalAppRecordSchema.extend({
72
+ draftPreviewUrl: z.string().startsWith("/api/local-apps/preview/"),
73
+ permissions: z.array(z.string()),
74
+ releases: z.array(LocalAppReleaseSchema),
75
+ acceptanceRuns: z.array(LocalAppAcceptanceRunSchema)
76
+ });
77
+ LocalAppValidationIssueSchema = z.strictObject({
78
+ code: z.string().trim().min(1).max(80),
79
+ severity: z.enum(["error", "warning"]),
80
+ message: z.string().trim().min(1).max(500)
81
+ });
82
+ LocalAppChangedFileSchema = z.strictObject({
83
+ path: z.string().min(1).max(4096),
84
+ status: z.enum([
85
+ "added",
86
+ "modified",
87
+ "deleted"
88
+ ])
89
+ });
90
+ LocalAppAcceptanceScenarioSummarySchema = z.strictObject({
91
+ id: z.string().trim().min(1).max(80),
92
+ name: z.string().trim().min(1).max(120),
93
+ stepCount: z.number().int().nonnegative()
94
+ });
95
+ LocalAppValidationSchema = z.strictObject({
96
+ status: z.enum(["healthy", "failed"]),
97
+ checkedAt: z.number().int().nonnegative(),
98
+ sourceHash: LocalAppSourceHashSchema.optional(),
99
+ hasDraftChanges: z.boolean(),
100
+ changedFiles: z.array(LocalAppChangedFileSchema).max(50),
101
+ changedFileCount: z.number().int().nonnegative(),
102
+ permissions: z.array(z.string()),
103
+ permissionDelta: z.strictObject({
104
+ added: z.array(z.string()),
105
+ removed: z.array(z.string())
106
+ }),
107
+ acceptanceScenarioCount: z.number().int().nonnegative(),
108
+ acceptanceScenarios: z.array(LocalAppAcceptanceScenarioSummarySchema),
109
+ issues: z.array(LocalAppValidationIssueSchema).max(100)
110
+ });
111
+ LocalAppPreviewSnapshotSchema = z.strictObject({
112
+ appId: z.string().min(1),
113
+ sourceHash: LocalAppSourceHashSchema,
114
+ status: z.enum(["ready", "invalid"]),
115
+ createdAt: z.number().int().nonnegative(),
116
+ entryPath: z.string().min(1).max(4096).optional(),
117
+ previewUrl: z.string().startsWith("/api/local-apps/preview/").optional(),
118
+ validation: LocalAppValidationSchema
119
+ }).superRefine((snapshot, context) => {
120
+ const runnable = snapshot.status === "ready";
121
+ if (runnable !== Boolean(snapshot.entryPath)) context.addIssue({
122
+ code: "custom",
123
+ path: ["entryPath"],
124
+ message: "Ready snapshots require an entry path"
125
+ });
126
+ if (snapshot.previewUrl && !runnable) context.addIssue({
127
+ code: "custom",
128
+ path: ["previewUrl"],
129
+ message: "Invalid snapshots cannot have a preview URL"
130
+ });
131
+ if (snapshot.validation.sourceHash !== snapshot.sourceHash) context.addIssue({
132
+ code: "custom",
133
+ path: ["validation", "sourceHash"],
134
+ message: "Snapshot validation hash must match the snapshot"
135
+ });
136
+ });
137
+ LocalAppDiagnosticPhaseSchema = z.enum([
138
+ "build",
139
+ "boot",
140
+ "runtime",
141
+ "acceptance",
142
+ "runner",
143
+ "capability"
144
+ ]);
145
+ LocalAppDiagnosticSchema = z.strictObject({
146
+ phase: LocalAppDiagnosticPhaseSchema,
147
+ message: z.string().trim().min(1).max(500),
148
+ code: z.string().trim().min(1).max(80).optional()
149
+ });
150
+ LocalAppFixGuidanceInputSchema = z.strictObject({
151
+ sourceHash: LocalAppSourceHashSchema.optional(),
152
+ locale: z.enum(["en", "zh"]).default("en"),
153
+ diagnostics: z.array(LocalAppDiagnosticSchema).min(1).max(20)
154
+ });
155
+ z.strictObject({
156
+ appId: z.string().min(1),
157
+ sourceHash: LocalAppSourceHashSchema.optional(),
158
+ owner: z.enum([
159
+ "generated_code",
160
+ "platform",
161
+ "configuration"
162
+ ]),
163
+ action: z.enum([
164
+ "fix_code",
165
+ "retry",
166
+ "fix_config"
167
+ ]),
168
+ diagnostics: z.array(LocalAppDiagnosticSchema).max(20),
169
+ prompt: z.string().min(1)
170
+ });
171
+ LocalAppRuntimeIssueSchema = z.strictObject({
172
+ kind: z.enum(["script_error", "unhandled_rejection"]),
173
+ message: z.string().trim().min(1).max(500),
174
+ filename: z.string().max(500).optional(),
175
+ line: z.number().nonnegative().optional(),
176
+ column: z.number().nonnegative().optional()
177
+ });
178
+ LocalAppCriteriaScenarioResultSchema = z.strictObject({
179
+ id: z.string().trim().min(1).max(80),
180
+ name: z.string().trim().min(1).max(120),
181
+ status: z.enum(["passed", "failed"]),
182
+ message: z.string().trim().min(1).max(500),
183
+ failureKind: z.enum(["scenario", "runner"]).default("scenario")
184
+ });
185
+ LocalAppCriteriaResultSchema = z.strictObject({
186
+ status: z.enum(["passed", "failed"]),
187
+ scenarioCount: z.number().int().min(0).max(10),
188
+ scenarios: z.array(LocalAppCriteriaScenarioResultSchema).max(10)
189
+ });
190
+ runtimeEnvelope = z.strictObject({
191
+ source: z.literal("xopc-local-app-preview"),
192
+ version: z.literal(1)
193
+ });
194
+ z.discriminatedUnion("type", [
195
+ runtimeEnvelope.extend({
196
+ type: z.literal("ready"),
197
+ detail: z.strictObject({ readyState: z.string().max(100).optional() })
198
+ }),
199
+ runtimeEnvelope.extend({
200
+ type: z.literal("error"),
201
+ detail: LocalAppRuntimeIssueSchema
202
+ }),
203
+ runtimeEnvelope.extend({
204
+ type: z.literal("acceptance"),
205
+ detail: LocalAppAcceptanceResultSchema
206
+ }),
207
+ runtimeEnvelope.extend({
208
+ type: z.literal("criteria"),
209
+ detail: LocalAppCriteriaResultSchema
210
+ })
211
+ ]);
212
+ }));
213
+ //#endregion
214
+ init_local_apps();
215
+ export { LocalAppAcceptanceCheckSchema, LocalAppAcceptanceInputSchema, LocalAppAcceptanceOutputSchema, LocalAppAcceptanceResultSchema, LocalAppAcceptanceRunSchema, LocalAppAcceptanceScenarioSummarySchema, LocalAppChangedFileSchema, LocalAppCriteriaResultSchema, LocalAppCriteriaScenarioResultSchema, LocalAppDetailSchema, LocalAppDiagnosticPhaseSchema, LocalAppDiagnosticSchema, LocalAppFixGuidanceInputSchema, LocalAppInstallationStateSchema, LocalAppPreviewSnapshotSchema, LocalAppRecordSchema, LocalAppReleaseHealthSchema, LocalAppReleaseSchema, LocalAppRuntimeIssueSchema, LocalAppSourceHashSchema, LocalAppStatusSchema, LocalAppValidationIssueSchema, LocalAppValidationSchema, init_local_apps };
@@ -1,4 +1,6 @@
1
1
  import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
2
+ import { ChatPreviewSourceHashSchema, init_chat_previews } from "./chat-previews.js";
3
+ import { LocalAppSourceHashSchema, init_local_apps } from "./local-apps.js";
2
4
  import { z } from "zod";
3
5
  //#region packages/gateway-contract/src/product-delivery.ts
4
6
  function parseProductDeliveryEnvelope(value) {
@@ -7,7 +9,25 @@ function parseProductDeliveryEnvelope(value) {
7
9
  }
8
10
  function appendProductDeliveryText(text, delivery) {
9
11
  if (!delivery) return text;
10
- return `${text}${delivery.primary ? `\nOpen in xopc: [Open](${productReferenceDeepLink(delivery.primary)})` : delivery.presentation?.kind === "table" && delivery.presentation.items.length ? `\nOpen in xopc: ${delivery.presentation.items.map((item, index) => `[${index + 1}](${productReferenceDeepLink(item)})`).join(" · ")}` : ""}\n${PRODUCT_DELIVERY_TEXT_PREFIX}${encodeURIComponent(JSON.stringify(delivery))}`;
12
+ const openableItems = delivery.presentation?.kind === "table" ? delivery.presentation.items.filter((item) => productReferenceRoute(item) !== null) : [];
13
+ return `${text}${delivery.primary && productReferenceRoute(delivery.primary) !== null ? `\nOpen in xopc: [Open](${productReferenceDeepLink(delivery.primary)})` : openableItems.length ? `\nOpen in xopc: ${openableItems.map((item, index) => `[${index + 1}](${productReferenceDeepLink(item)})`).join(" · ")}` : ""}\n${PRODUCT_DELIVERY_TEXT_PREFIX}${encodeURIComponent(JSON.stringify(delivery))}`;
14
+ }
15
+ function productReferenceRoute(reference) {
16
+ const id = encodeURIComponent(reference.id);
17
+ switch (reference.kind) {
18
+ case "task": return `/tasks/${id}`;
19
+ case "project": return `/projects/${id}`;
20
+ case "note": return `/notes/${id}`;
21
+ case "workflow_definition": return `/workflows/${id}`;
22
+ case "workflow_run": return `/workflows/runs/${id}`;
23
+ case "automation": return `/automations?automation=${id}`;
24
+ case "scene": return `/scenes/${id}`;
25
+ case "local_app": return `/local-apps/${id}`;
26
+ case "chat_preview": return null;
27
+ case "session": return `/chat/${id}`;
28
+ case "settings": return `/settings/${reference.id.replace(/^\/+/, "").split("/").map(encodeURIComponent).join("/")}`;
29
+ case "file": return null;
30
+ }
11
31
  }
12
32
  function productReferenceDeepLink(reference) {
13
33
  return `xopc://open?${new URLSearchParams({
@@ -17,6 +37,8 @@ function productReferenceDeepLink(reference) {
17
37
  }
18
38
  var ProductReferenceKindSchema, ProductCapabilitySchema, ProductReferenceSchema, ProductDeliveryOperationSchema, ProductDeliveryPresentationSchema, ProductDeliveryEnvelopeSchema, PRODUCT_DELIVERY_TEXT_PREFIX;
19
39
  var init_product_delivery = __esmMin((() => {
40
+ init_chat_previews();
41
+ init_local_apps();
20
42
  ProductReferenceKindSchema = z.enum([
21
43
  "task",
22
44
  "project",
@@ -26,6 +48,7 @@ var init_product_delivery = __esmMin((() => {
26
48
  "automation",
27
49
  "scene",
28
50
  "local_app",
51
+ "chat_preview",
29
52
  "file",
30
53
  "session",
31
54
  "settings"
@@ -35,6 +58,7 @@ var init_product_delivery = __esmMin((() => {
35
58
  "preview",
36
59
  "edit",
37
60
  "continue_in_chat",
61
+ "fix",
38
62
  "run",
39
63
  "pause",
40
64
  "resume",
@@ -60,22 +84,43 @@ var init_product_delivery = __esmMin((() => {
60
84
  "completed",
61
85
  "failed"
62
86
  ]);
63
- ProductDeliveryPresentationSchema = z.discriminatedUnion("kind", [z.object({
64
- kind: z.literal("table"),
65
- items: z.array(ProductReferenceSchema).max(50),
66
- truncated: z.boolean()
67
- }), z.object({
68
- kind: z.literal("diff"),
69
- title: z.string().max(2e3),
70
- truncated: z.boolean(),
71
- edits: z.array(z.object({
72
- from: z.number().int().nonnegative(),
73
- to: z.number().int().nonnegative(),
74
- text: z.string().max(16e3)
75
- }).refine((edit) => edit.to >= edit.from, "Invalid replacement range")).max(20).refine((edits) => edits.reduce((total, edit) => total + edit.text.length, 0) <= 16e3, "Replacement text exceeds preview limit")
76
- })]);
87
+ ProductDeliveryPresentationSchema = z.discriminatedUnion("kind", [
88
+ z.object({
89
+ kind: z.literal("table"),
90
+ items: z.array(ProductReferenceSchema).max(50),
91
+ truncated: z.boolean()
92
+ }),
93
+ z.object({
94
+ kind: z.literal("diff"),
95
+ title: z.string().max(2e3),
96
+ truncated: z.boolean(),
97
+ edits: z.array(z.object({
98
+ from: z.number().int().nonnegative(),
99
+ to: z.number().int().nonnegative(),
100
+ text: z.string().max(16e3)
101
+ }).refine((edit) => edit.to >= edit.from, "Invalid replacement range")).max(20).refine((edits) => edits.reduce((total, edit) => total + edit.text.length, 0) <= 16e3, "Replacement text exceeds preview limit")
102
+ }),
103
+ z.object({
104
+ kind: z.literal("inline_app"),
105
+ reference: ProductReferenceSchema.refine((reference) => reference.kind === "local_app", "Inline app must reference a local app"),
106
+ snapshot: z.strictObject({ sourceHash: LocalAppSourceHashSchema }),
107
+ preferredHeight: z.number().int().min(240).max(720).default(480)
108
+ }).refine((presentation) => !presentation.reference.revision || presentation.reference.revision === presentation.snapshot.sourceHash, {
109
+ message: "Inline app reference revision must match its snapshot",
110
+ path: ["reference", "revision"]
111
+ }),
112
+ z.object({
113
+ kind: z.literal("inline_preview"),
114
+ reference: ProductReferenceSchema.refine((reference) => reference.kind === "chat_preview", "Inline preview must reference a chat preview"),
115
+ sourceHash: ChatPreviewSourceHashSchema,
116
+ preferredHeight: z.number().int().min(240).max(720).default(480)
117
+ }).refine((presentation) => !presentation.reference.revision || presentation.reference.revision === presentation.sourceHash, {
118
+ message: "Inline preview reference revision must match its source",
119
+ path: ["reference", "revision"]
120
+ })
121
+ ]);
77
122
  ProductDeliveryEnvelopeSchema = z.object({
78
- version: z.literal(1),
123
+ version: z.literal(2),
79
124
  operation: ProductDeliveryOperationSchema,
80
125
  primary: ProductReferenceSchema.optional(),
81
126
  related: z.array(ProductReferenceSchema).optional(),
@@ -85,4 +130,4 @@ var init_product_delivery = __esmMin((() => {
85
130
  }));
86
131
  //#endregion
87
132
  init_product_delivery();
88
- export { ProductCapabilitySchema, ProductDeliveryEnvelopeSchema, ProductDeliveryOperationSchema, ProductDeliveryPresentationSchema, ProductReferenceKindSchema, ProductReferenceSchema, appendProductDeliveryText, init_product_delivery, parseProductDeliveryEnvelope, productReferenceDeepLink };
133
+ export { ProductCapabilitySchema, ProductDeliveryEnvelopeSchema, ProductDeliveryOperationSchema, ProductDeliveryPresentationSchema, ProductReferenceKindSchema, ProductReferenceSchema, appendProductDeliveryText, init_product_delivery, parseProductDeliveryEnvelope, productReferenceDeepLink, productReferenceRoute };
@@ -0,0 +1,60 @@
1
+ import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
2
+ //#region packages/gateway-contract/src/user-turn-document.ts
3
+ function contextRefWireTokenRe() {
4
+ return new RegExp(CONTEXT_REF_TOKEN_RE.source, "g");
5
+ }
6
+ function parseUserTurnDocument(wire) {
7
+ const parts = [];
8
+ const re = contextRefWireTokenRe();
9
+ let last = 0;
10
+ let match;
11
+ while ((match = re.exec(wire)) !== null) {
12
+ if (match.index > last) parts.push({
13
+ type: "text",
14
+ text: wire.slice(last, match.index)
15
+ });
16
+ parts.push({
17
+ type: "context_ref",
18
+ refId: match[1] ?? ""
19
+ });
20
+ last = match.index + match[0].length;
21
+ }
22
+ if (parts.length === 0) return null;
23
+ if (last < wire.length) parts.push({
24
+ type: "text",
25
+ text: wire.slice(last)
26
+ });
27
+ return {
28
+ version: 1,
29
+ parts
30
+ };
31
+ }
32
+ function userTurnDocumentRefIds(document) {
33
+ return document.parts.flatMap((part) => part.type === "context_ref" ? [part.refId] : []);
34
+ }
35
+ function renderUserTurnDocument(document, resolveLabel) {
36
+ return document.parts.map((part) => {
37
+ if (part.type === "text") return part.text;
38
+ const title = resolveLabel(part.refId)?.trim();
39
+ return title ? `@${title}` : "";
40
+ }).join("");
41
+ }
42
+ function isUserTurnDocument(value) {
43
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
44
+ const row = value;
45
+ if (row.version !== 1 || !Array.isArray(row.parts)) return false;
46
+ return row.parts.every((part) => {
47
+ if (!part || typeof part !== "object" || Array.isArray(part)) return false;
48
+ const candidate = part;
49
+ return candidate.type === "text" ? typeof candidate.text === "string" : candidate.type === "context_ref" && typeof candidate.refId === "string" && new RegExp(`^${CONTEXT_REF_ID_PATTERN}$`).test(candidate.refId);
50
+ });
51
+ }
52
+ var CONTEXT_REF_TOKEN_PREFIX, CONTEXT_REF_ID_PATTERN, CONTEXT_REF_TOKEN_RE;
53
+ var init_user_turn_document = __esmMin((() => {
54
+ CONTEXT_REF_TOKEN_PREFIX = "@xopc-ref:";
55
+ CONTEXT_REF_ID_PATTERN = "[A-Za-z0-9_-]{1,64}";
56
+ CONTEXT_REF_TOKEN_RE = new RegExp(`${CONTEXT_REF_TOKEN_PREFIX}(${CONTEXT_REF_ID_PATTERN})`, "g");
57
+ }));
58
+ //#endregion
59
+ init_user_turn_document();
60
+ export { contextRefWireTokenRe, init_user_turn_document, isUserTurnDocument, parseUserTurnDocument, renderUserTurnDocument, userTurnDocumentRefIds };