@xopcai/xopc 0.0.313 → 0.0.315

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 (696) hide show
  1. package/dist/browser-ext/dist/assets/{auth-C3yV1y_l.js → auth-DKo-NMUY.js} +18 -1
  2. package/dist/browser-ext/dist/background.js +68 -2
  3. package/dist/browser-ext/dist/sidepanel.html +1 -1
  4. package/dist/browser-ext/dist/sidepanel.js +1 -1
  5. package/dist/browser-ext/manifest.json +1 -1
  6. package/dist/extensions/feishu/src/adapters/cli-login.js +3 -3
  7. package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
  8. package/dist/extensions/telegram/src/inbound-processor.js +1 -1
  9. package/dist/extensions/telegram/src/outbound-sender.js +1 -1
  10. package/dist/extensions/telegram/src/plugin.js +2 -2
  11. package/dist/extensions/telegram/xopc.extension.json +1 -1
  12. package/dist/extensions/weixin/src/api/api.js +2 -2
  13. package/dist/extensions/weixin/src/auth/accounts.js +12 -12
  14. package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
  15. package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
  16. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-C73s_EYF.js → agent-avatar-dicebear-BbFOF2SH.js} +1 -1
  17. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-D9T-QGmd.js +1 -0
  18. package/dist/gateway/static/root/assets/agents-Ds5sQcPd.js +1 -0
  19. package/dist/gateway/static/root/assets/{api-Com7kQuw.js → api-BzloAiIG.js} +1 -1
  20. package/dist/gateway/static/root/assets/{app-link-CKueEVbT.js → app-link-nL8iPwEr.js} +1 -1
  21. package/dist/gateway/static/root/assets/{app-management-settings-panel-DSo_SV6G.js → app-management-settings-panel-BpUHskXq.js} +1 -1
  22. package/dist/gateway/static/root/assets/appearance-settings-CQd5Vo6f.js +1 -0
  23. package/dist/gateway/static/root/assets/apps-page-B7VIsfye.js +1 -0
  24. package/dist/gateway/static/root/assets/{archive-plugin-BWueu3Qt.js → archive-plugin-BM4O6WfL.js} +1 -1
  25. package/dist/gateway/static/root/assets/{attachment-load-DYV25sAC.js → attachment-load-Cdn9MYmI.js} +1 -1
  26. package/dist/gateway/static/root/assets/{automations-page-Du8AkHrH.js → automations-page-DnRx-Ra4.js} +1 -1
  27. package/dist/gateway/static/root/assets/automations-workspace-B5s10G5F.js +7 -0
  28. package/dist/gateway/static/root/assets/{binary-plugins-rahoUE_-.js → binary-plugins-dkhUf4bm.js} +1 -1
  29. package/dist/gateway/static/root/assets/{block-editor-CVbiuQ90.js → block-editor-BTzqEuAy.js} +29 -29
  30. package/dist/gateway/static/root/assets/{browser-automation-inputs-CAC4w9KM.js → browser-automation-inputs-Bowij-nJ.js} +1 -1
  31. package/dist/gateway/static/root/assets/{browser-automations-page-B3-fdrAr.js → browser-automations-page-CQ7SYTQj.js} +2 -2
  32. package/dist/gateway/static/root/assets/browser-settings-page-vqLoPOOg.js +3 -0
  33. package/dist/gateway/static/root/assets/capabilities-D0S3DuAD.js +1 -0
  34. package/dist/gateway/static/root/assets/capabilities-settings-panel-DI68WGYd.js +8 -0
  35. package/dist/gateway/static/root/assets/channels-settings-Cimssy-S.js +1 -0
  36. package/dist/gateway/static/root/assets/{chat-terminal-dock-98GzKJ0K.js → chat-terminal-dock-DzgFHd6l.js} +2 -2
  37. package/dist/gateway/static/root/assets/{computer-settings-page-CB3mySQb.js → computer-settings-page-380_vIqO.js} +1 -1
  38. package/dist/gateway/static/root/assets/{connector-service-page-ZlbIXdey.js → connector-service-page-DILFakXb.js} +1 -1
  39. package/dist/gateway/static/root/assets/connectors-page-COmFp9HC.js +2 -0
  40. package/dist/gateway/static/root/assets/conversation-identity-Cw0n9uzK.js +1 -0
  41. package/dist/gateway/static/root/assets/{date-picker-WW3fY-ng.js → date-picker-CRVun-T5.js} +1 -1
  42. package/dist/gateway/static/root/assets/{dependency-picker-D1QgzM_s.js → dependency-picker-BoWqt5yU.js} +1 -1
  43. package/dist/gateway/static/root/assets/{desktop-pet-D0MtbTwu.js → desktop-pet-DPlkBjft.js} +1 -1
  44. package/dist/gateway/static/root/assets/desktop-pet-settings-D7FgfX_K.js +1 -0
  45. package/dist/gateway/static/root/assets/device-pairing-wizard-BP6yxut8.js +1 -0
  46. package/dist/gateway/static/root/assets/{extension-debug-page-BOtWAAGM.js → extension-debug-page-CT_QkSN_.js} +1 -1
  47. package/dist/gateway/static/root/assets/{extension-page-FULvawj8.js → extension-page-BF1NdcKP.js} +1 -1
  48. package/dist/gateway/static/root/assets/{extension-settings-page-Dzh6lE26.js → extension-settings-page-CKQVZ3Xc.js} +1 -1
  49. package/dist/gateway/static/root/assets/files-BK6enEvD.js +1 -0
  50. package/dist/gateway/static/root/assets/{gateway-config-swr-D7SG_ECs.js → gateway-config-swr-BPsZPoAT.js} +1 -1
  51. package/dist/gateway/static/root/assets/gateway-settings-3bIy7XMr.js +1 -0
  52. package/dist/gateway/static/root/assets/{gateway-startup-retry-CrHz00-9.js → gateway-startup-retry-cG6EqUJw.js} +1 -1
  53. package/dist/gateway/static/root/assets/home-page-DFNDLFgv.js +1 -0
  54. package/dist/gateway/static/root/assets/{image-generation-api-DGiHzeLb.js → image-generation-api-DI_QutIx.js} +1 -1
  55. package/dist/gateway/static/root/assets/{imports-page-DiJrgu9D.js → imports-page-BUG6G72F.js} +1 -1
  56. package/dist/gateway/static/root/assets/index-BCi8nfxs.js +89 -0
  57. package/dist/gateway/static/root/assets/index-DWgd1VK2.css +1 -0
  58. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DZ60sucF.js → keyboard-shortcuts-settings-qnG-4FJs.js} +1 -1
  59. package/dist/gateway/static/root/assets/local-app-workbench-page-B3iJWhjN.js +2 -0
  60. package/dist/gateway/static/root/assets/{local-apps-page-Cx2YuI8E.js → local-apps-page-BpEGeURS.js} +1 -1
  61. package/dist/gateway/static/root/assets/{locale-store-vZTDIqJB.js → locale-store-BlgpZORR.js} +1 -1
  62. package/dist/gateway/static/root/assets/logs-page-0QPGj-5c.js +2 -0
  63. package/dist/gateway/static/root/assets/management-settings-Sl0wwidS.js +1 -0
  64. package/dist/gateway/static/root/assets/{markdown-view-DJfzcZCW.js → markdown-view-BzjjpL2H.js} +1 -1
  65. package/dist/gateway/static/root/assets/{media-plugins-COpQGcN3.js → media-plugins-Bzkdhotn.js} +1 -1
  66. package/dist/gateway/static/root/assets/messages-2GhUD7SC.js +3 -0
  67. package/dist/gateway/static/root/assets/note-detail-panel-BXtD71j1.js +5 -0
  68. package/dist/gateway/static/root/assets/notes-page-DNY4vW-u.js +8 -0
  69. package/dist/gateway/static/root/assets/page-context-capture-button-CFt4hXQ6.js +1 -0
  70. package/dist/gateway/static/root/assets/{page-tabs-nARdLZcP.js → page-tabs-Dz_x22MQ.js} +1 -1
  71. package/dist/gateway/static/root/assets/{preview-open-alternatives-BEJg3fTq.js → preview-open-alternatives-C1mkgFAl.js} +1 -1
  72. package/dist/gateway/static/root/assets/product-delivery-chCjIpvu.js +1 -0
  73. package/dist/gateway/static/root/assets/{product-open-page-CR4Lehku.js → product-open-page-DHZgzSDV.js} +1 -1
  74. package/dist/gateway/static/root/assets/project-detail-page-D3NhZ7ZZ.js +1 -0
  75. package/dist/gateway/static/root/assets/projects-page-CEr8DX9I.js +1 -0
  76. package/dist/gateway/static/root/assets/{registry-api-CF-nJ5MG.js → registry-api-DMW2apOO.js} +1 -1
  77. package/dist/gateway/static/root/assets/remote-access-hub-Db-B-Mf3.js +1 -0
  78. package/dist/gateway/static/root/assets/runtime-tools-settings-panel-DEJi0BLL.js +5 -0
  79. package/dist/gateway/static/root/assets/scenes-page-BUUX-PnI.js +2 -0
  80. package/dist/gateway/static/root/assets/{schema-form-DOsDKbWU.js → schema-form-RVltVpuG.js} +1 -1
  81. package/dist/gateway/static/root/assets/schemas-88fK3zzl.js +64 -0
  82. package/dist/gateway/static/root/assets/sessions-page-Rm4H2okS.js +1 -0
  83. package/dist/gateway/static/root/assets/settings-advanced-gate-VxPItcOG.js +1 -0
  84. package/dist/gateway/static/root/assets/{settings-form-section-kIV5M-9G.js → settings-form-section-BkBO7woF.js} +1 -1
  85. package/dist/gateway/static/root/assets/{settings-page-layout-B39PogyD.js → settings-page-layout-lLvHc-zF.js} +1 -1
  86. package/dist/gateway/static/root/assets/{settings-page-C2TS9mvq.js → settings-page-zl0XY203.js} +1 -1
  87. package/dist/gateway/static/root/assets/setup-status-panel-Difrpr4T.js +1 -0
  88. package/dist/gateway/static/root/assets/{share-preview-page-CMbgRZ7w.js → share-preview-page-NC4Gj867.js} +1 -1
  89. package/dist/gateway/static/root/assets/shares-settings-DPLvEcB-.js +1 -0
  90. package/dist/gateway/static/root/assets/skill-reload-api-CKdLCf_-.js +1 -0
  91. package/dist/gateway/static/root/assets/{skills-page-DV4FX1ev.js → skills-page-CzekvBNQ.js} +1 -1
  92. package/dist/gateway/static/root/assets/{skills-page.utils-C-2lmZHk.js → skills-page.utils-BLeiN245.js} +1 -1
  93. package/dist/gateway/static/root/assets/{system-settings-panel-CQ1Z6i28.js → system-settings-panel-Bp75s9nl.js} +1 -1
  94. package/dist/gateway/static/root/assets/task-detail-page-Bh8H4FYR.js +1 -0
  95. package/dist/gateway/static/root/assets/tasks-CDR_RVbQ.js +1 -0
  96. package/dist/gateway/static/root/assets/{tunnel-api-tn6H0D44.js → tunnel-api-BDiaC6an.js} +1 -1
  97. package/dist/gateway/static/root/assets/turn-outcome-D0SnyZ3Z.js +1 -0
  98. package/dist/gateway/static/root/assets/{use-autosave-CkEM9tXu.js → use-autosave-C_ntK_Zu.js} +1 -1
  99. package/dist/gateway/static/root/assets/user-model-page-C7gFCGAV.js +2 -0
  100. package/dist/gateway/static/root/assets/{voice-api-key-field-d0Fawetf.js → voice-api-key-field-D4cfuMp1.js} +1 -1
  101. package/dist/gateway/static/root/assets/{voice-config-api-D_8zU7Li.js → voice-config-api-Cjvd6maH.js} +1 -1
  102. package/dist/gateway/static/root/assets/{work-discovery-overlay-C5FFSieF.js → work-discovery-overlay-Ce6ToB0O.js} +1 -1
  103. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-q5ammR4k.js → workflow-run-setup-panel-C80nrmKi.js} +2 -2
  104. package/dist/gateway/static/root/assets/workflows-page-CVQjo3RI.js +6 -0
  105. package/dist/gateway/static/root/index.html +16 -16
  106. package/dist/package.js +1 -1
  107. package/dist/packages/computer-control-contract/src/index.js +10 -1
  108. package/dist/packages/gateway-contract/src/app-context.js +55 -0
  109. package/dist/packages/gateway-contract/src/automations.js +16 -17
  110. package/dist/packages/gateway-contract/src/capabilities.js +1078 -0
  111. package/dist/packages/gateway-contract/src/extension-capabilities.js +26 -0
  112. package/dist/packages/gateway-contract/src/home.js +3 -3
  113. package/dist/packages/gateway-contract/src/index.js +8 -0
  114. package/dist/packages/gateway-contract/src/product-delivery.js +19 -4
  115. package/dist/packages/gateway-contract/src/scenes.js +199 -0
  116. package/dist/packages/gateway-contract/src/task-runs.js +8 -4
  117. package/dist/packages/gateway-contract/src/tasks.js +5 -4
  118. package/dist/packages/realtime-client/src/index.js +17 -4
  119. package/dist/src/agent/agent-manager.d.ts +1 -0
  120. package/dist/src/agent/agent-manager.js +19 -18
  121. package/dist/src/agent/agent-scope.js +2 -2
  122. package/dist/src/agent/background-review/run-background-review.js +4 -4
  123. package/dist/src/agent/child-agent-factory.d.ts +2 -0
  124. package/dist/src/agent/child-agent-factory.js +5 -0
  125. package/dist/src/agent/coding/repository-instructions.js +1 -1
  126. package/dist/src/agent/commands/approved-verification.d.ts +14 -0
  127. package/dist/src/agent/commands/approved-verification.js +48 -0
  128. package/dist/src/agent/context/coordinator.js +2 -2
  129. package/dist/src/agent/context/execution-context.js +4 -4
  130. package/dist/src/agent/context/execution-scope.js +4 -3
  131. package/dist/src/agent/context/project-context.js +5 -4
  132. package/dist/src/agent/data-acquisition/service.js +1 -1
  133. package/dist/src/agent/embedded/index.js +2 -2
  134. package/dist/src/agent/embedded/model-runtime.js +1 -1
  135. package/dist/src/agent/embedded/run-for-session.js +4 -4
  136. package/dist/src/agent/embedded/run-turn.js +4 -4
  137. package/dist/src/agent/embedded/session-tool-result-guard.js +3 -3
  138. package/dist/src/agent/embedded/tool-result-truncation.js +1 -1
  139. package/dist/src/agent/external-tools/cliProvider.js +126 -78
  140. package/dist/src/agent/external-tools/composio-provider.d.ts +1 -1
  141. package/dist/src/agent/external-tools/composio-provider.js +73 -15
  142. package/dist/src/agent/external-tools/endpoint-provider.js +14 -1
  143. package/dist/src/agent/external-tools/gateway-tools.js +1 -1
  144. package/dist/src/agent/external-tools/mcp-provider.js +2 -2
  145. package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
  146. package/dist/src/agent/image/generation/providers/dashscope.js +1 -1
  147. package/dist/src/agent/image/generation/providers/fal.js +1 -1
  148. package/dist/src/agent/image/generation/providers/google.js +1 -1
  149. package/dist/src/agent/image/generation/runtime.js +1 -1
  150. package/dist/src/agent/image/index.js +1 -1
  151. package/dist/src/agent/image/load-image-media.js +1 -1
  152. package/dist/src/agent/image/tool-model-config.js +1 -1
  153. package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
  154. package/dist/src/agent/inbound/inbound-loop.js +2 -2
  155. package/dist/src/agent/inbound/turn-dispatcher.d.ts +2 -0
  156. package/dist/src/agent/inbound/turn-dispatcher.js +2 -1
  157. package/dist/src/agent/index.js +1 -1
  158. package/dist/src/agent/mcp/bundle-mcp-gateway.d.ts +39 -0
  159. package/dist/src/agent/mcp/bundle-mcp-gateway.js +33 -2
  160. package/dist/src/agent/mcp/bundle-mcp-runtime.js +12 -1
  161. package/dist/src/agent/mcp/bundle-mcp-types.d.ts +2 -1
  162. package/dist/src/agent/mcp/index.js +2 -2
  163. package/dist/src/agent/mcp/mcp-resource-id.d.ts +6 -0
  164. package/dist/src/agent/mcp/mcp-resource-id.js +19 -0
  165. package/dist/src/agent/mcp/mcp-transport.js +1 -1
  166. package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
  167. package/dist/src/agent/memory/compaction-chunks.d.ts +6 -1
  168. package/dist/src/agent/memory/compaction-chunks.js +16 -3
  169. package/dist/src/agent/memory/compaction-ledger.d.ts +3 -1
  170. package/dist/src/agent/memory/compaction-ledger.js +31 -18
  171. package/dist/src/agent/memory/compaction-request.d.ts +2 -0
  172. package/dist/src/agent/memory/compaction-request.js +6 -1
  173. package/dist/src/agent/memory/compaction.d.ts +19 -1
  174. package/dist/src/agent/memory/compaction.js +112 -30
  175. package/dist/src/agent/memory/context-recovery.js +1 -1
  176. package/dist/src/agent/memory/index.js +2 -2
  177. package/dist/src/agent/orchestration/agent-orchestrator.js +5 -5
  178. package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
  179. package/dist/src/agent/sandbox/exec-policy.js +1 -1
  180. package/dist/src/agent/service/direct-turn-helpers.js +5 -5
  181. package/dist/src/agent/service/process-direct-one-shot.js +1 -1
  182. package/dist/src/agent/service/process-direct-streaming.d.ts +3 -0
  183. package/dist/src/agent/service/process-direct-streaming.js +21 -12
  184. package/dist/src/agent/service/webchat-tts.js +1 -1
  185. package/dist/src/agent/service.js +22 -21
  186. package/dist/src/agent/service.types.d.ts +1 -0
  187. package/dist/src/agent/session/session-inspector.js +1 -1
  188. package/dist/src/agent/skills/config.js +2 -0
  189. package/dist/src/agent/skills/filesystem-watcher.js +1 -1
  190. package/dist/src/agent/skills/format-skills-prompt.js +14 -1
  191. package/dist/src/agent/skills/hub-lock.js +1 -1
  192. package/dist/src/agent/skills/hub-pull.js +3 -3
  193. package/dist/src/agent/skills/index.js +16 -8
  194. package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
  195. package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
  196. package/dist/src/agent/skills/types.d.ts +1 -1
  197. package/dist/src/agent/source-context/app-context.d.ts +4 -0
  198. package/dist/src/agent/source-context/app-context.js +36 -0
  199. package/dist/src/agent/source-context/browser-tab.d.ts +3 -0
  200. package/dist/src/agent/source-context/browser-tab.js +29 -0
  201. package/dist/src/agent/source-context/file-context.d.ts +3 -0
  202. package/dist/src/agent/source-context/file-context.js +64 -0
  203. package/dist/src/agent/source-context/index.d.ts +4 -0
  204. package/dist/src/agent/source-context/index.js +5 -1
  205. package/dist/src/agent/source-context/injector.js +2 -1
  206. package/dist/src/agent/source-context/mcp-resource-context.d.ts +8 -0
  207. package/dist/src/agent/source-context/mcp-resource-context.js +30 -0
  208. package/dist/src/agent/source-context/session-context.d.ts +8 -0
  209. package/dist/src/agent/source-context/session-context.js +33 -0
  210. package/dist/src/agent/source-context/types.d.ts +12 -2
  211. package/dist/src/agent/source-context/types.js +3 -2
  212. package/dist/src/agent/tasks/task-judge-service.js +6 -5
  213. package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
  214. package/dist/src/agent/tool-manuals/computer.js +1 -1
  215. package/dist/src/agent/tools/automation-tool.d.ts +12 -1
  216. package/dist/src/agent/tools/automation-tool.js +106 -32
  217. package/dist/src/agent/tools/create-share-tool.js +4 -4
  218. package/dist/src/agent/tools/dataBatch.js +1 -1
  219. package/dist/src/agent/tools/delegate-tool.js +3 -3
  220. package/dist/src/agent/tools/delegation-parent-policy.js +1 -1
  221. package/dist/src/agent/tools/executor.js +1 -1
  222. package/dist/src/agent/tools/factory.d.ts +1 -0
  223. package/dist/src/agent/tools/factory.js +22 -17
  224. package/dist/src/agent/tools/fetch-text.js +1 -1
  225. package/dist/src/agent/tools/image-generate-tool.js +3 -3
  226. package/dist/src/agent/tools/index.js +6 -6
  227. package/dist/src/agent/tools/list-dir.js +1 -1
  228. package/dist/src/agent/tools/publish-artifacts.js +2 -2
  229. package/dist/src/agent/tools/read.js +2 -2
  230. package/dist/src/agent/tools/review-workspace.js +1 -1
  231. package/dist/src/agent/tools/scoped-workspace-tools.d.ts +8 -0
  232. package/dist/src/agent/tools/scoped-workspace-tools.js +81 -0
  233. package/dist/src/agent/tools/send-media.js +2 -2
  234. package/dist/src/agent/tools/skills-tools.js +1 -1
  235. package/dist/src/agent/tools/user-context-tool.js +1 -1
  236. package/dist/src/agent/tools/write.js +2 -2
  237. package/dist/src/agent/tools/xopc-use-tool.d.ts +6 -3
  238. package/dist/src/agent/tools/xopc-use-tool.js +997 -908
  239. package/dist/src/agent/workflow/subagent-runner.js +2 -1
  240. package/dist/src/agent-config/index.js +2 -2
  241. package/dist/src/agent-config/schema.d.ts +5 -0
  242. package/dist/src/agent-config/schema.js +14 -10
  243. package/dist/src/ai-assist/text-assist.js +1 -1
  244. package/dist/src/auth/credentials.js +2 -2
  245. package/dist/src/auth/oauth/xopc-cloud.js +1 -1
  246. package/dist/src/auth/profiles/store.js +1 -1
  247. package/dist/src/auth/sync-provider-auth.js +2 -2
  248. package/dist/src/automations/api/routes.js +244 -164
  249. package/dist/src/automations/capabilities/drafts.d.ts +4 -0
  250. package/dist/src/automations/capabilities/drafts.js +95 -0
  251. package/dist/src/automations/capabilities/read.d.ts +4 -0
  252. package/dist/src/automations/capabilities/read.js +119 -0
  253. package/dist/src/automations/capabilities/write.d.ts +349 -0
  254. package/dist/src/automations/capabilities/write.js +172 -0
  255. package/dist/src/automations/domain/index.js +2 -2
  256. package/dist/src/automations/domain/validation.d.ts +77 -77
  257. package/dist/src/automations/domain/validation.js +9 -6
  258. package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -2
  259. package/dist/src/automations/index.js +6 -6
  260. package/dist/src/automations/service/automation-service.d.ts +31 -0
  261. package/dist/src/automations/service/automation-service.js +213 -75
  262. package/dist/src/automations/service/index.js +2 -2
  263. package/dist/src/automations/storage/automation-repository.d.ts +2 -0
  264. package/dist/src/automations/storage/automation-repository.js +9 -1
  265. package/dist/src/automations/storage/automation-run-repository.d.ts +4 -1
  266. package/dist/src/automations/storage/automation-run-repository.js +16 -3
  267. package/dist/src/automations/storage/index.js +3 -3
  268. package/dist/src/browser/automations/schema.d.ts +1 -1
  269. package/dist/src/browser/automations/service.d.ts +1 -1
  270. package/dist/src/browser/observation/format.js +4 -0
  271. package/dist/src/browser/providers/browser-ext-install.js +1 -1
  272. package/dist/src/capabilities/adapters/http.d.ts +4 -0
  273. package/dist/src/capabilities/adapters/http.js +44 -0
  274. package/dist/src/capabilities/readiness/from-config.js +11 -7
  275. package/dist/src/capabilities/runtime/app-context.d.ts +3 -0
  276. package/dist/src/capabilities/runtime/app-context.js +72 -0
  277. package/dist/src/capabilities/runtime/atomic-operations.d.ts +11 -0
  278. package/dist/src/capabilities/runtime/atomic-operations.js +34 -0
  279. package/dist/src/capabilities/runtime/dispatcher.d.ts +67 -0
  280. package/dist/src/capabilities/runtime/dispatcher.js +170 -0
  281. package/dist/src/capabilities/runtime/errors.d.ts +6 -0
  282. package/dist/src/capabilities/runtime/errors.js +11 -0
  283. package/dist/src/capabilities/runtime/external-operations.d.ts +16 -0
  284. package/dist/src/capabilities/runtime/external-operations.js +92 -0
  285. package/dist/src/capabilities/runtime/product.d.ts +12 -0
  286. package/dist/src/capabilities/runtime/product.js +69 -0
  287. package/dist/src/capabilities/runtime/settings.d.ts +3 -0
  288. package/dist/src/capabilities/runtime/settings.js +27 -0
  289. package/dist/src/capabilities/store-connector.js +1 -1
  290. package/dist/src/channels/attachments/voice-stt-webchat.js +2 -2
  291. package/dist/src/channels/index.js +2 -2
  292. package/dist/src/channels/pairing/allow-from-file.js +9 -9
  293. package/dist/src/channels/pairing/pairing-store.js +6 -6
  294. package/dist/src/chat-commands/agent-edit.js +1 -1
  295. package/dist/src/chat-commands/builtins/config.js +1 -1
  296. package/dist/src/chat-commands/builtins/review.js +1 -1
  297. package/dist/src/chat-commands/builtins/thinking.js +1 -1
  298. package/dist/src/chat-commands/builtins/tts.js +1 -1
  299. package/dist/src/chat-commands/builtins/understanding.js +1 -1
  300. package/dist/src/chat-commands/builtins/workflow.js +2 -2
  301. package/dist/src/chat-commands/context.js +2 -2
  302. package/dist/src/chat-commands/index.js +2 -2
  303. package/dist/src/cli/cli-log-level-preset.d.ts +2 -0
  304. package/dist/src/cli/cli-log-level-preset.js +4 -0
  305. package/dist/src/cli/command-catalog.js +4 -0
  306. package/dist/src/cli/command-loaders.js +1 -0
  307. package/dist/src/cli/command-manifest.js +4 -0
  308. package/dist/src/cli/commands/agent.js +7 -7
  309. package/dist/src/cli/commands/agents.js +1 -1
  310. package/dist/src/cli/commands/config.js +1 -1
  311. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  312. package/dist/src/cli/commands/doctor/checks/provider-auth.js +3 -3
  313. package/dist/src/cli/commands/extension-dev.js +1 -1
  314. package/dist/src/cli/commands/extension.js +1 -1
  315. package/dist/src/cli/commands/gateway/shared.js +1 -1
  316. package/dist/src/cli/commands/gateway/token.js +1 -1
  317. package/dist/src/cli/commands/image.js +1 -1
  318. package/dist/src/cli/commands/init.js +1 -1
  319. package/dist/src/cli/commands/mcp.d.ts +1 -0
  320. package/dist/src/cli/commands/mcp.js +51 -0
  321. package/dist/src/cli/commands/models.js +1 -1
  322. package/dist/src/cli/commands/onboard.js +1 -1
  323. package/dist/src/cli/commands/project.js +2 -2
  324. package/dist/src/cli/commands/runtime.js +1 -1
  325. package/dist/src/cli/commands/skills.js +2 -2
  326. package/dist/src/cli/commands/tunnel.js +3 -3
  327. package/dist/src/cli/extension-cli-register.js +4 -4
  328. package/dist/src/cli/utils/gateway-client.js +1 -1
  329. package/dist/src/computer/broker.d.ts +0 -1
  330. package/dist/src/computer/broker.js +4 -6
  331. package/dist/src/computer/evaluation-harness.d.ts +45 -0
  332. package/dist/src/computer/evaluation-harness.js +108 -0
  333. package/dist/src/computer/model-adapter.d.ts +37 -2
  334. package/dist/src/computer/model-adapter.js +333 -42
  335. package/dist/src/computer/model-policy.d.ts +4 -1
  336. package/dist/src/computer/model-policy.js +11 -3
  337. package/dist/src/computer/release-gate.d.ts +22 -0
  338. package/dist/src/computer/release-gate.js +19 -0
  339. package/dist/src/computer/runtime.js +16 -12
  340. package/dist/src/computer/task-state.d.ts +1 -0
  341. package/dist/src/computer/task-state.js +1 -0
  342. package/dist/src/config/index.js +5 -5
  343. package/dist/src/config/loader.js +2 -2
  344. package/dist/src/config/models-json.d.ts +6 -0
  345. package/dist/src/config/models-json.js +3 -3
  346. package/dist/src/config/schema.d.ts +4 -0
  347. package/dist/src/config/schema.js +4 -10
  348. package/dist/src/connectors/cli/authorization.js +1 -1
  349. package/dist/src/connectors/cli/runtime.js +1 -1
  350. package/dist/src/connectors/composio-sessions.d.ts +4 -2
  351. package/dist/src/connectors/composio-sessions.js +11 -10
  352. package/dist/src/connectors/composio.js +11 -9
  353. package/dist/src/connectors/connected-source-understanding.js +2 -2
  354. package/dist/src/connectors/connection-recovery-service.js +5 -5
  355. package/dist/src/connectors/health.js +1 -1
  356. package/dist/src/discussions/action-tasks.js +2 -1
  357. package/dist/src/discussions/live-worker.js +1 -1
  358. package/dist/src/discussions/recording.js +1 -1
  359. package/dist/src/discussions/sealer.js +1 -1
  360. package/dist/src/execution-environments/local-worktree-manager.d.ts +1 -0
  361. package/dist/src/execution-environments/local-worktree-manager.js +13 -2
  362. package/dist/src/extensions/activation-context.js +3 -3
  363. package/dist/src/extensions/api.js +3 -3
  364. package/dist/src/extensions/bundled-extension-activation.js +1 -1
  365. package/dist/src/extensions/index.js +1 -1
  366. package/dist/src/extensions/loader.js +1 -1
  367. package/dist/src/extensions/lockfile.js +1 -1
  368. package/dist/src/extensions/normalize-manifest.js +6 -1
  369. package/dist/src/extensions/sdk/index.js +1 -1
  370. package/dist/src/extensions/sdk/media.js +1 -1
  371. package/dist/src/extensions/types/manifest.d.ts +3 -0
  372. package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
  373. package/dist/src/gateway/agents-admin.js +4 -4
  374. package/dist/src/gateway/chat-stream/mapper.js +3 -2
  375. package/dist/src/gateway/device-routes.js +2 -2
  376. package/dist/src/gateway/file-path-classifier.js +2 -2
  377. package/dist/src/gateway/global-defaults-admin.js +1 -1
  378. package/dist/src/gateway/hono/app.js +3 -3
  379. package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
  380. package/dist/src/gateway/hono/lib/config-payload.js +3 -3
  381. package/dist/src/gateway/hono/middleware/scopes.js +1 -1
  382. package/dist/src/gateway/hono/routes/agent-stream.js +2 -2
  383. package/dist/src/gateway/hono/routes/agents.js +1 -1
  384. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +6 -3
  385. package/dist/src/gateway/hono/routes/browser.js +33 -1
  386. package/dist/src/gateway/hono/routes/capability-operations.d.ts +3 -0
  387. package/dist/src/gateway/hono/routes/capability-operations.js +52 -0
  388. package/dist/src/gateway/hono/routes/commands-skills.js +3 -3
  389. package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
  390. package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
  391. package/dist/src/gateway/hono/routes/devices.js +0 -16
  392. package/dist/src/gateway/hono/routes/endpoint-tools.js +86 -30
  393. package/dist/src/gateway/hono/routes/home.js +1 -1
  394. package/dist/src/gateway/hono/routes/imports.js +1 -1
  395. package/dist/src/gateway/hono/routes/lazy-bundles.js +16 -0
  396. package/dist/src/gateway/hono/routes/local-app-capabilities.d.ts +4 -0
  397. package/dist/src/gateway/hono/routes/local-app-capabilities.js +41 -0
  398. package/dist/src/gateway/hono/routes/local-apps.js +41 -9
  399. package/dist/src/gateway/hono/routes/mcp.js +33 -2
  400. package/dist/src/gateway/hono/routes/media.js +1 -1
  401. package/dist/src/gateway/hono/routes/models.js +7 -7
  402. package/dist/src/gateway/hono/routes/notes.js +216 -147
  403. package/dist/src/gateway/hono/routes/projects.js +219 -376
  404. package/dist/src/gateway/hono/routes/scenes.js +188 -75
  405. package/dist/src/gateway/hono/routes/session-input-handler.d.ts +64 -16
  406. package/dist/src/gateway/hono/routes/session-input-handler.js +49 -7
  407. package/dist/src/gateway/hono/routes/sessions.js +18 -1
  408. package/dist/src/gateway/hono/routes/shares.js +3 -3
  409. package/dist/src/gateway/hono/routes/site-shares.js +1 -1
  410. package/dist/src/gateway/hono/routes/tasks.js +182 -326
  411. package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
  412. package/dist/src/gateway/hono/routes/user-model.js +4 -4
  413. package/dist/src/gateway/hono/routes/voice.js +7 -7
  414. package/dist/src/gateway/hono/routes/workflows.js +3 -3
  415. package/dist/src/gateway/lock.js +11 -11
  416. package/dist/src/gateway/media-access.js +3 -2
  417. package/dist/src/gateway/mobile-privacy.js +2 -2
  418. package/dist/src/gateway/ports.js +6 -6
  419. package/dist/src/gateway/scenes/host.js +14 -3
  420. package/dist/src/gateway/scenes/mailContext.js +1 -1
  421. package/dist/src/gateway/scenes/slackThreadSource.d.ts +41 -0
  422. package/dist/src/gateway/scenes/slackThreadSource.js +168 -0
  423. package/dist/src/gateway/security/gateway-scopes.d.ts +1 -1
  424. package/dist/src/gateway/security/gateway-scopes.js +5 -0
  425. package/dist/src/gateway/server.js +1 -1
  426. package/dist/src/gateway/service/agent-runner.d.ts +1 -1
  427. package/dist/src/gateway/service/agent-runner.js +2 -2
  428. package/dist/src/gateway/service/app-context-access.d.ts +7 -0
  429. package/dist/src/gateway/service/app-context-access.js +70 -0
  430. package/dist/src/gateway/service/config-coordinator.js +4 -4
  431. package/dist/src/gateway/service/marketplace-service.js +3 -3
  432. package/dist/src/gateway/service/run-gateway-agent.js +13 -4
  433. package/dist/src/gateway/service/session-input-coordinator.d.ts +1 -1
  434. package/dist/src/gateway/service/session-input-coordinator.js +56 -17
  435. package/dist/src/gateway/service/sessions-api.d.ts +1 -0
  436. package/dist/src/gateway/service/sessions-api.js +4 -1
  437. package/dist/src/gateway/service/task-conversation-query-service.d.ts +3 -1
  438. package/dist/src/gateway/service/task-conversation-query-service.js +32 -3
  439. package/dist/src/gateway/service.d.ts +3 -0
  440. package/dist/src/gateway/service.js +130 -39
  441. package/dist/src/gateway/session-context-summary.js +3 -2
  442. package/dist/src/gateway/workspace-editor-path.js +2 -2
  443. package/dist/src/gateway/workspace-file-search.js +25 -12
  444. package/dist/src/heartbeat/index.js +1 -1
  445. package/dist/src/i18n/share-tool-bundle.js +2 -2
  446. package/dist/src/imports/runtime.js +1 -1
  447. package/dist/src/{tasks/task-outbox-dispatcher.d.ts → infra/domain-outbox-dispatcher.d.ts} +2 -2
  448. package/dist/src/{tasks/task-outbox-dispatcher.js → infra/domain-outbox-dispatcher.js} +10 -9
  449. package/dist/src/infra/gateway-processes.js +2 -2
  450. package/dist/src/infra/operation-context.d.ts +2 -0
  451. package/dist/src/infra/operation-context.js +16 -0
  452. package/dist/src/infra/path-env.js +3 -3
  453. package/dist/src/infra/update-global.js +10 -10
  454. package/dist/src/local-apps/capabilities/contracts.d.ts +2 -0
  455. package/dist/src/local-apps/capabilities/contracts.js +32 -0
  456. package/dist/src/local-apps/capabilities/read.d.ts +3 -0
  457. package/dist/src/local-apps/capabilities/read.js +48 -0
  458. package/dist/src/local-apps/capabilities/runtime.d.ts +16 -0
  459. package/dist/src/local-apps/capabilities/runtime.js +66 -0
  460. package/dist/src/local-apps/capabilities/write.d.ts +3 -0
  461. package/dist/src/local-apps/capabilities/write.js +35 -0
  462. package/dist/src/local-apps/release-lock.d.ts +2 -0
  463. package/dist/src/local-apps/release-lock.js +20 -0
  464. package/dist/src/local-apps/runtime-entry.d.ts +0 -2
  465. package/dist/src/local-apps/runtime-entry.js +1 -14
  466. package/dist/src/local-apps/scaffold.js +4 -1
  467. package/dist/src/local-apps/service.d.ts +24 -1
  468. package/dist/src/local-apps/service.js +187 -44
  469. package/dist/src/local-apps/store.js +0 -2
  470. package/dist/src/mcp/capability-server.d.ts +4 -0
  471. package/dist/src/mcp/capability-server.js +96 -0
  472. package/dist/src/mcp/channel-bridge.js +1 -1
  473. package/dist/src/mcp/gateway-http-client.d.ts +7 -0
  474. package/dist/src/mcp/gateway-http-client.js +27 -5
  475. package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
  476. package/dist/src/notes/agent-context.js +4 -4
  477. package/dist/src/notes/capabilities/read.d.ts +3 -0
  478. package/dist/src/notes/capabilities/read.js +96 -0
  479. package/dist/src/notes/capabilities/write.d.ts +7 -0
  480. package/dist/src/notes/capabilities/write.js +152 -0
  481. package/dist/src/notes/index.js +1 -1
  482. package/dist/src/notes/service.d.ts +12 -4
  483. package/dist/src/notes/service.js +188 -175
  484. package/dist/src/notes/store.d.ts +14 -9
  485. package/dist/src/notes/store.js +81 -21
  486. package/dist/src/notifications/service.d.ts +1 -0
  487. package/dist/src/notifications/service.js +5 -0
  488. package/dist/src/projects/capabilities/read.d.ts +3 -0
  489. package/dist/src/projects/capabilities/read.js +81 -0
  490. package/dist/src/projects/capabilities/write.d.ts +9 -0
  491. package/dist/src/projects/capabilities/write.js +260 -0
  492. package/dist/src/projects/index.js +2 -2
  493. package/dist/src/projects/project-change-events.d.ts +2 -0
  494. package/dist/src/projects/project-change-events.js +18 -0
  495. package/dist/src/projects/project-service.d.ts +11 -0
  496. package/dist/src/projects/project-service.js +121 -42
  497. package/dist/src/projects/project-skill-service.js +2 -2
  498. package/dist/src/projects/project-store.js +12 -2
  499. package/dist/src/projects/project-workspace-creation.d.ts +3 -0
  500. package/dist/src/projects/project-workspace-creation.js +45 -0
  501. package/dist/src/projects/workspace-project.js +6 -0
  502. package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
  503. package/dist/src/providers/index.js +2 -2
  504. package/dist/src/providers/model-catalog-persistence.js +1 -1
  505. package/dist/src/providers/model-catalog-types.d.ts +2 -1
  506. package/dist/src/providers/model-reference-auditor.js +5 -5
  507. package/dist/src/providers/model-registry.js +1 -1
  508. package/dist/src/providers/model-supplements.js +13 -3
  509. package/dist/src/providers/presentation.js +3 -3
  510. package/dist/src/providers/register-runtime-providers.js +1 -1
  511. package/dist/src/providers/xopc-cloud-model-source.js +4 -2
  512. package/dist/src/realtime/runtime.js +4 -0
  513. package/dist/src/remote-access/exposure-manager.js +1 -1
  514. package/dist/src/scenes/capabilities/read.d.ts +3 -0
  515. package/dist/src/scenes/capabilities/read.js +187 -0
  516. package/dist/src/scenes/capabilities/write.d.ts +3 -0
  517. package/dist/src/scenes/capabilities/write.js +151 -0
  518. package/dist/src/scenes/contracts.d.ts +2 -105
  519. package/dist/src/scenes/contracts.js +3 -88
  520. package/dist/src/scenes/execution.d.ts +1 -1
  521. package/dist/src/scenes/httpServices.d.ts +2 -0
  522. package/dist/src/scenes/inbox.d.ts +1 -0
  523. package/dist/src/scenes/inbox.js +7 -7
  524. package/dist/src/scenes/preferences.d.ts +3 -24
  525. package/dist/src/scenes/preferences.js +8 -30
  526. package/dist/src/scenes/repository.d.ts +1 -0
  527. package/dist/src/scenes/repository.js +7 -3
  528. package/dist/src/scenes/resultNotifications.js +2 -2
  529. package/dist/src/scenes/schedule.d.ts +1 -8
  530. package/dist/src/scenes/schedule.js +3 -15
  531. package/dist/src/scenes/service.d.ts +6 -0
  532. package/dist/src/scenes/service.js +29 -25
  533. package/dist/src/scenes/taskFollowUp/agentExecutor.d.ts +36 -0
  534. package/dist/src/scenes/taskFollowUp/agentExecutor.js +149 -0
  535. package/dist/src/scenes/taskFollowUp/branchInventory.d.ts +38 -0
  536. package/dist/src/scenes/taskFollowUp/branchInventory.js +70 -0
  537. package/dist/src/scenes/taskFollowUp/contracts.d.ts +91 -0
  538. package/dist/src/scenes/taskFollowUp/contracts.js +100 -0
  539. package/dist/src/scenes/taskFollowUp/resources.d.ts +19 -0
  540. package/dist/src/scenes/taskFollowUp/resources.js +97 -0
  541. package/dist/src/scenes/taskFollowUp/service.d.ts +810 -0
  542. package/dist/src/scenes/taskFollowUp/service.js +710 -0
  543. package/dist/src/scenes/taskFollowUp/workspaceFingerprint.d.ts +2 -0
  544. package/dist/src/scenes/taskFollowUp/workspaceFingerprint.js +46 -0
  545. package/dist/src/scenes/templates.d.ts +2 -2
  546. package/dist/src/scenes/templates.js +1 -1
  547. package/dist/src/session/client-history.d.ts +2 -1
  548. package/dist/src/session/client-history.js +3 -2
  549. package/dist/src/session/index.js +2 -2
  550. package/dist/src/session/session-find.d.ts +17 -0
  551. package/dist/src/session/session-find.js +56 -0
  552. package/dist/src/session/session-title.js +1 -1
  553. package/dist/src/session/store.d.ts +4 -0
  554. package/dist/src/session/store.js +46 -10
  555. package/dist/src/session/thinking-resolve.js +1 -1
  556. package/dist/src/share/note-share-revocation.d.ts +3 -0
  557. package/dist/src/share/note-share-revocation.js +26 -0
  558. package/dist/src/share/share-store.js +1 -1
  559. package/dist/src/share/share-thumbnail.js +1 -1
  560. package/dist/src/share/site-proxy.js +1 -1
  561. package/dist/src/share/site-share-store.js +1 -1
  562. package/dist/src/storage/sqlite/connection.js +9 -9
  563. package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.d.ts +15 -1
  564. package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.js +39 -6
  565. package/dist/src/storage/sqlite/index.d.ts +1 -1
  566. package/dist/src/storage/sqlite/index.js +2 -2
  567. package/dist/src/storage/sqlite/migrations/190_scene_development.sql +37 -0
  568. package/dist/src/storage/sqlite/migrations/191_scene_task_follow_up.sql +27 -0
  569. package/dist/src/storage/sqlite/migrations/192_capability_operations.sql +20 -0
  570. package/dist/src/storage/sqlite/migrations/193_note_file_cleanup.sql +8 -0
  571. package/dist/src/storage/sqlite/migrations/194_capability_external_outcomes.sql +11 -0
  572. package/dist/src/storage/sqlite/migrations/195_automation_deleted_revisions.sql +4 -0
  573. package/dist/src/storage/sqlite/migrations/196_automation_run_requests.sql +23 -0
  574. package/dist/src/storage/sqlite/migrations/197_note_deletion_cleanup.sql +8 -0
  575. package/dist/src/storage/sqlite/migrations/198_project_workspace_creation.sql +7 -0
  576. package/dist/src/storage/sqlite/migrations/199_scene_resource_events.sql +488 -0
  577. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  578. package/dist/src/storage/sqlite/migrations/runner.js +6 -3
  579. package/dist/src/storage/sqlite/schema.js +1 -1
  580. package/dist/src/storage/sqlite/transaction.d.ts +5 -0
  581. package/dist/src/storage/sqlite/transaction.js +34 -3
  582. package/dist/src/tasks/capabilities/management.d.ts +195 -0
  583. package/dist/src/tasks/capabilities/management.js +111 -0
  584. package/dist/src/tasks/capabilities/read.d.ts +2 -0
  585. package/dist/src/tasks/capabilities/read.js +141 -0
  586. package/dist/src/tasks/capabilities/relations.d.ts +204 -0
  587. package/dist/src/tasks/capabilities/relations.js +140 -0
  588. package/dist/src/tasks/capabilities/runs.d.ts +2 -0
  589. package/dist/src/tasks/capabilities/runs.js +89 -0
  590. package/dist/src/tasks/capabilities/write.d.ts +207 -0
  591. package/dist/src/tasks/capabilities/write.js +107 -0
  592. package/dist/src/tasks/execution-context.js +1 -1
  593. package/dist/src/tasks/home-query-service.js +5 -4
  594. package/dist/src/tasks/index.d.ts +0 -1
  595. package/dist/src/tasks/index.js +9 -9
  596. package/dist/src/tasks/project-operating-view-service.js +2 -1
  597. package/dist/src/tasks/task-application-service.d.ts +1 -0
  598. package/dist/src/tasks/task-application-service.js +4 -3
  599. package/dist/src/tasks/task-change-events.js +5 -3
  600. package/dist/src/tasks/task-context-assembler.js +3 -2
  601. package/dist/src/tasks/task-deletion-service.js +2 -1
  602. package/dist/src/tasks/task-dependency-service.js +2 -1
  603. package/dist/src/tasks/task-handoff-service.js +3 -2
  604. package/dist/src/tasks/task-read-model-projector.js +2 -1
  605. package/dist/src/tasks/task-repository.d.ts +12 -7
  606. package/dist/src/tasks/task-repository.js +175 -154
  607. package/dist/src/tasks/task-run-coordinator.js +2 -1
  608. package/dist/src/tasks/task-run-dispatcher.js +2 -1
  609. package/dist/src/tasks/task-run-repository.d.ts +1 -0
  610. package/dist/src/tasks/task-run-repository.js +29 -14
  611. package/dist/src/tasks/task-signal-service.js +2 -1
  612. package/dist/src/tui/backends/embedded-backend.js +10 -10
  613. package/dist/src/tui/backends/gateway-realtime-backend.js +2 -2
  614. package/dist/src/tui/extension-host/load-extensions.js +1 -1
  615. package/dist/src/tui/tui-command-formatters.js +1 -1
  616. package/dist/src/tui/tui-commands.js +6 -6
  617. package/dist/src/tui/tui-picker-overlay.js +1 -1
  618. package/dist/src/tui/tui-skills-autocomplete.js +1 -1
  619. package/dist/src/tui/tui-startup-resources.js +4 -4
  620. package/dist/src/tui/tui.js +3 -3
  621. package/dist/src/tunnel/gateway-lifecycle.js +1 -1
  622. package/dist/src/user-context/config.d.ts +13 -0
  623. package/dist/src/user-context/config.js +2 -0
  624. package/dist/src/voice/local/runtime-worker.js +1 -1
  625. package/dist/src/voice/platform-catalog.d.ts +1 -1
  626. package/dist/src/voice/realtime/memory-context.js +3 -3
  627. package/dist/src/voice/realtime/runtime.js +3 -3
  628. package/dist/src/voice/stt/index.js +2 -2
  629. package/dist/src/voice/stt/preflight.js +1 -1
  630. package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
  631. package/dist/src/voice/stt/providers/local-transcription.js +1 -1
  632. package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
  633. package/dist/src/voice/stt/transcribe-core.js +1 -1
  634. package/dist/src/voice/tts/audio.js +1 -1
  635. package/dist/src/voice/tts/factory.js +1 -1
  636. package/dist/src/voice/tts/index.js +1 -1
  637. package/dist/src/voice/tts/payload.js +1 -1
  638. package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
  639. package/dist/src/work-discovery/incremental-repository.js +1 -1
  640. package/dist/src/work-discovery/index.js +1 -1
  641. package/dist/src/work-discovery/repository.d.ts +1 -1
  642. package/dist/src/work-discovery/repository.js +3 -2
  643. package/dist/src/work-discovery/service.d.ts +4 -0
  644. package/dist/src/work-discovery/service.js +40 -15
  645. package/dist/src/workflows/context/workflow-context.js +3 -2
  646. package/dist/src/workflows/service/workflow-run-service.js +7 -6
  647. package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
  648. package/package.json +8 -4
  649. package/skills/THIRD_PARTY_NOTICES.md +2 -2
  650. package/skills/documents/xlsx/SKILL.md +5 -0
  651. package/skills/engineering/build-xopc-local-app/SKILL.md +2 -0
  652. package/skills/tools/find-skills/SKILL.md +3 -0
  653. package/dist/gateway/static/root/assets/activity-store-CS_SAPwP.js +0 -1
  654. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-9w_YVThL.js +0 -1
  655. package/dist/gateway/static/root/assets/agents-Bspu1pT2.js +0 -1
  656. package/dist/gateway/static/root/assets/appearance-settings-Jgvx-RKL.js +0 -1
  657. package/dist/gateway/static/root/assets/apps-page-403o57-3.js +0 -1
  658. package/dist/gateway/static/root/assets/automations-workspace-Dpju5KT_.js +0 -7
  659. package/dist/gateway/static/root/assets/browser-settings-page-C0HJrpr1.js +0 -3
  660. package/dist/gateway/static/root/assets/capabilities-settings-panel-BanM86OX.js +0 -8
  661. package/dist/gateway/static/root/assets/channels-settings-Bhh0F9pO.js +0 -1
  662. package/dist/gateway/static/root/assets/connectors-page-BTqjm6eD.js +0 -2
  663. package/dist/gateway/static/root/assets/desktop-pet-settings-BI_sQTR_.js +0 -1
  664. package/dist/gateway/static/root/assets/device-pairing-wizard-BoPCEIm5.js +0 -1
  665. package/dist/gateway/static/root/assets/files-Be5viEFY.js +0 -1
  666. package/dist/gateway/static/root/assets/gateway-realtime-mpOw3R4d.js +0 -1
  667. package/dist/gateway/static/root/assets/gateway-realtime-store-Z-ErSgkD.js +0 -1
  668. package/dist/gateway/static/root/assets/gateway-settings-Bq82yXVh.js +0 -1
  669. package/dist/gateway/static/root/assets/home-page-BD1v6Uee.js +0 -1
  670. package/dist/gateway/static/root/assets/index-Ah5XDhOL.js +0 -79
  671. package/dist/gateway/static/root/assets/index-CV5b1pD1.css +0 -1
  672. package/dist/gateway/static/root/assets/local-app-workbench-page-BF8x3bgh.js +0 -2
  673. package/dist/gateway/static/root/assets/logs-page-B4vMUM7D.js +0 -2
  674. package/dist/gateway/static/root/assets/management-settings-Cg0UjJpy.js +0 -1
  675. package/dist/gateway/static/root/assets/messages-CRH2my19.js +0 -3
  676. package/dist/gateway/static/root/assets/note-detail-panel-CWVIGctd.js +0 -5
  677. package/dist/gateway/static/root/assets/notes-page-CcTzMI1K.js +0 -8
  678. package/dist/gateway/static/root/assets/product-delivery-CrAI8ZEa.js +0 -1
  679. package/dist/gateway/static/root/assets/project-detail-page-BNYoV9Ac.js +0 -1
  680. package/dist/gateway/static/root/assets/projects-page-CcKnYQqm.js +0 -1
  681. package/dist/gateway/static/root/assets/remote-access-hub-HIvwD5Xn.js +0 -1
  682. package/dist/gateway/static/root/assets/runtime-tools-settings-panel-CFE2oX_l.js +0 -5
  683. package/dist/gateway/static/root/assets/scenes-page-BGKdg4uS.js +0 -1
  684. package/dist/gateway/static/root/assets/schemas-BaskVM5g.js +0 -64
  685. package/dist/gateway/static/root/assets/sessions-page-tn99saMj.js +0 -1
  686. package/dist/gateway/static/root/assets/settings-advanced-gate-Cx_uvwqz.js +0 -1
  687. package/dist/gateway/static/root/assets/setup-status-panel-1kYYg3BH.js +0 -1
  688. package/dist/gateway/static/root/assets/shares-settings-Du7BfwId.js +0 -1
  689. package/dist/gateway/static/root/assets/skill-reload-api-BMhhXxRZ.js +0 -1
  690. package/dist/gateway/static/root/assets/task-detail-page-vFn3xdlZ.js +0 -1
  691. package/dist/gateway/static/root/assets/theme-store-DdURyZ1M.js +0 -1
  692. package/dist/gateway/static/root/assets/user-model-page-uK9sxPUH.js +0 -2
  693. package/dist/gateway/static/root/assets/workflows-page-DIyd5AC9.js +0 -6
  694. package/skills/creative/algorithmic-art/SKILL.md +0 -44
  695. package/skills/creative/algorithmic-art/templates/generator-template.js +0 -27
  696. package/skills/creative/algorithmic-art/templates/viewer.html +0 -27
@@ -7,7 +7,10 @@ import { createLogger } from "../utils/logger/index.js";
7
7
  import { init_logger } from "../utils/logger.js";
8
8
  import { closeXopcDatabase, openXopcDatabase } from "../storage/sqlite/connection.js";
9
9
  import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
10
+ import { getBrowserTabBindingById } from "../storage/sqlite/browser-tab-binding-repository.js";
10
11
  import { findSessionInput, init_session_input_repository, insertSessionInput } from "../storage/sqlite/session-input-repository.js";
12
+ import { TaskRepository } from "../tasks/task-repository.js";
13
+ import { TaskRunRepository, init_task_run_repository } from "../tasks/task-run-repository.js";
11
14
  import { init_changes, notifyUserContextChange } from "../user-context/changes.js";
12
15
  import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
13
16
  import { init_session_repository, patchSessionMetadata } from "../storage/sqlite/session-repository.js";
@@ -15,39 +18,60 @@ import { getSessionConfig } from "../storage/sqlite/config-repository.js";
15
18
  import "../storage/sqlite/index.js";
16
19
  import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
17
20
  import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
21
+ import { init_agent_session_key, resolveAgentMainConversationId } from "../routing/agent-session-key.js";
22
+ import { init_session_key, resolveConversationId, sanitizeSegment } from "../routing/session-key.js";
23
+ import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
24
+ import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
18
25
  import { init_paths, resolveConfigPath, resolveExtensionsDir } from "../config/paths.js";
19
- import { prewarmModelRegistry } from "../providers/model-registry.js";
20
26
  import { areExtensionsGloballyDisabled } from "../extensions/discover-extensions.js";
21
27
  import { buildExtensionMetadataSnapshot } from "../extensions/extension-metadata-snapshot.js";
22
28
  import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, init_channel_catalog_service } from "../channels/catalog/channel-catalog-service.js";
23
29
  import { loadConfig, saveConfig } from "../config/loader.js";
24
- import { init_agent_session_key, resolveAgentMainConversationId } from "../routing/agent-session-key.js";
25
- import { init_session_key, resolveConversationId, sanitizeSegment } from "../routing/session-key.js";
26
- import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
30
+ import { prewarmModelRegistry } from "../providers/model-registry.js";
27
31
  import { init_providers, providers_exports } from "../providers/index.js";
28
- import { AutomationService } from "../automations/service/automation-service.js";
32
+ import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
33
+ import { getEmbeddedExecutionSession } from "../agent/embedded/execution-context.js";
34
+ import { disposeAllSessionMcpRuntimes } from "../agent/mcp/bundle-mcp-runtime.js";
35
+ import { DomainOutboxDispatcher } from "../infra/domain-outbox-dispatcher.js";
29
36
  import { onAutomationProductEvent, publishAutomationProductEvent } from "../automations/product-events.js";
37
+ import { ProjectService } from "../projects/project-service.js";
38
+ import { resolveProjectAgentId } from "../projects/project-agent.js";
39
+ import "../projects/index.js";
40
+ import { resolveEffectiveGatewayPort } from "./host.js";
41
+ import { RealtimeExtensionBrowserProvider } from "../browser/providers/realtime-extension.js";
42
+ import { onSessionTranscriptUpdate } from "../session/transcript-events.js";
43
+ import { buildNoteAgentContext } from "../notes/agent-context.js";
44
+ import { NotesStore } from "../notes/store.js";
45
+ import { NotesService } from "../notes/service.js";
46
+ import { LocalAppService } from "../local-apps/service.js";
47
+ import { TaskApplicationService } from "../tasks/task-application-service.js";
48
+ import { AutomationService } from "../automations/service/automation-service.js";
49
+ import { TaskSignalService } from "../tasks/task-signal-service.js";
50
+ import { createProductDispatcher } from "../capabilities/runtime/product.js";
30
51
  import "../automations/index.js";
31
- import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
52
+ import { TaskRunDispatcher } from "../tasks/task-run-dispatcher.js";
53
+ import "../tasks/index.js";
54
+ import "../agent/mcp/bundle-mcp-tools.js";
55
+ import { SessionIndex } from "../session/manager.js";
56
+ import "../session/index.js";
57
+ import { ExtensionLoader } from "../extensions/loader.js";
58
+ import "../extensions/index.js";
59
+ import { MessageBus, MessageBusShutdownError } from "../infra/bus/queue.js";
60
+ import "../infra/bus/index.js";
61
+ import { collectMediaUrisFromMessages, deleteMediaUris } from "../media/session-references.js";
62
+ import { AgentService } from "../agent/service.js";
63
+ import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
32
64
  import { setPairingBroadcastSink } from "../channels/pairing/pairing-events.js";
33
65
  import { registerClarificationChannelRuntime } from "./clarify-runtime.js";
34
66
  import { ChannelManager } from "../channels/manager.js";
35
- import { MessageBus, MessageBusShutdownError } from "../infra/bus/queue.js";
36
- import "../infra/bus/index.js";
37
67
  import { getWorkspacePath } from "../config/workspace-path-helpers.js";
38
68
  import "../config/index.js";
39
- import { ExtensionLoader } from "../extensions/loader.js";
40
- import "../extensions/index.js";
41
- import { resolveEffectiveGatewayPort } from "./host.js";
42
- import { disposeAllSessionMcpRuntimes } from "../agent/mcp/bundle-mcp-runtime.js";
43
69
  import { ManagedComposioEventPoller } from "../connectors/composio-managed-events.js";
44
70
  import { startConnectedKnowledgeCoordinator } from "../knowledge/coordinator.js";
45
71
  import "../knowledge/index.js";
46
72
  import { ConnectionRecoveryService } from "../connectors/connection-recovery-service.js";
47
73
  import { startConnectorLearningCoordinator } from "../connectors/learning-coordinator.js";
48
74
  import { startConnectorSupervisor } from "../connectors/supervisor.js";
49
- import { TaskRepository } from "../tasks/task-repository.js";
50
- import { TaskApplicationService } from "../tasks/task-application-service.js";
51
75
  import { DiscussionService } from "../discussions/service.js";
52
76
  import { DiscussionOrganizer } from "../discussions/organizer.js";
53
77
  import { DiscussionLiveWorker } from "../discussions/live-worker.js";
@@ -56,34 +80,20 @@ import { DiscussionSealer } from "../discussions/sealer.js";
56
80
  import "../discussions/index.js";
57
81
  import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
58
82
  import "../endpoint-tools/index.js";
59
- import { ProjectService } from "../projects/project-service.js";
60
- import { resolveProjectAgentId } from "../projects/project-agent.js";
61
- import "../projects/index.js";
62
83
  import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
63
84
  import { prepareAutomationAgentSession } from "./automation-agent-session.js";
64
85
  import { stopTailscaleExposure } from "./tailscale-lifecycle.js";
86
+ import { getGatewayFileSpaceService } from "./file-space-service.js";
65
87
  import { createBackgroundTask } from "../infra/background-task.js";
66
88
  import { buildTaskAgentContext } from "../agent/source-context/task-context.js";
89
+ import { buildFileAgentContext } from "../agent/source-context/file-context.js";
90
+ import { buildSessionAgentContext } from "../agent/source-context/session-context.js";
91
+ import { buildMcpResourceAgentContext } from "../agent/source-context/mcp-resource-context.js";
92
+ import { buildBrowserTabAgentContext } from "../agent/source-context/browser-tab.js";
67
93
  import { WorkDiscoveryService } from "../work-discovery/service.js";
68
94
  import { buildVoiceMemoryContext } from "../voice/realtime/memory-context.js";
69
95
  import { buildVoicePersonaContext } from "../voice/realtime/persona-context.js";
70
96
  import { voiceMemoryBudget, voicePersonaBudget } from "../voice/realtime/conversation-context.js";
71
- import { SessionIndex } from "../session/manager.js";
72
- import { onSessionTranscriptUpdate } from "../session/transcript-events.js";
73
- import "../session/index.js";
74
- import { getEmbeddedExecutionSession } from "../agent/embedded/execution-context.js";
75
- import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
76
- import { collectMediaUrisFromMessages, deleteMediaUris } from "../media/session-references.js";
77
- import { TaskOutboxDispatcher } from "../tasks/task-outbox-dispatcher.js";
78
- import { TaskRunDispatcher } from "../tasks/task-run-dispatcher.js";
79
- import { TaskSignalService } from "../tasks/task-signal-service.js";
80
- import "../tasks/index.js";
81
- import "../agent/mcp/bundle-mcp-tools.js";
82
- import { AgentService } from "../agent/service.js";
83
- import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
84
- import { NotesStore } from "../notes/store.js";
85
- import { buildNoteAgentContext } from "../notes/agent-context.js";
86
- import { NotesService } from "../notes/service.js";
87
97
  import "../notes/index.js";
88
98
  import { buildWorkflowChildTools } from "../agent/workflow/workflow-child-tools.js";
89
99
  import { WorkflowRunService } from "../workflows/service/workflow-run-service.js";
@@ -104,7 +114,6 @@ import { getXopcCloudCatalogCoordinator } from "../providers/xopc-cloud-catalog-
104
114
  import { ModelCatalogSyncService } from "../providers/model-catalog-sync-service.js";
105
115
  import { runBootstrapMigrationsSync } from "../migrations/runner.js";
106
116
  import { NotificationService } from "../notifications/service.js";
107
- import { LocalAppService } from "../local-apps/service.js";
108
117
  import "../local-apps/index.js";
109
118
  import { createRuntimeBrowserAutomationService } from "../browser/automations/runtime-service.js";
110
119
  import "../browser/automations/index.js";
@@ -123,6 +132,7 @@ import { reconcileMemoryMaintenanceAutomations } from "./memory-maintenance-auto
123
132
  import { GatewayReadiness } from "./startup-readiness.js";
124
133
  import { createGatewayStartupTrace } from "./startup-trace.js";
125
134
  import { GatewaySceneHost } from "./scenes/host.js";
135
+ import { checkAppContextAccess, prepareAppContext } from "./service/app-context-access.js";
126
136
  import { applyAutomaticVoiceLanguage, inferProductLanguageFromEnvironment, initializeVoiceDefaults } from "../voice/language-profile.js";
127
137
  import crypto from "node:crypto";
128
138
  //#region src/gateway/service.ts
@@ -140,6 +150,7 @@ init_paths();
140
150
  init_package_version();
141
151
  init_resolve_route();
142
152
  init_session_key();
153
+ init_task_run_repository();
143
154
  init_transaction();
144
155
  const log = createLogger("Gateway:Service");
145
156
  var GatewayService = class {
@@ -457,15 +468,48 @@ var GatewayService = class {
457
468
  emit: (type, payload) => this.emit(type, payload)
458
469
  });
459
470
  this.agentRunner = new GatewayAgentRunner({
460
- validateConnectionResume: (input) => this.connectionRecovery.preflight(input),
471
+ validateConnectionResume: async (input) => {
472
+ for (const source of input.contextSnapshots ?? []) if (source.kind === "app_context") await checkAppContextAccess(source, this.appContextDispatcher(), this.auth);
473
+ return this.connectionRecovery.preflight(input);
474
+ },
461
475
  bus: this.bus,
462
476
  sessionIndex: this.sessionIndex,
463
477
  getAgentService: () => this.ensureAgentService(),
464
478
  getChannelManager: () => this.channelManager,
465
479
  getConfig: () => this.config,
466
- resolveTurnContext: async (ref) => {
480
+ resolveTurnContext: async (ref, conversationId) => {
467
481
  if (ref.kind === "task") return buildTaskAgentContext(new TaskRepository().get(ref.sourceId), ref.expectedVersion);
468
- if (ref.kind !== "note") return null;
482
+ if (ref.kind === "file") {
483
+ const files = getGatewayFileSpaceService(this);
484
+ const space = await files.forContext("session", conversationId).catch(() => null);
485
+ if (!space) return null;
486
+ return buildFileAgentContext(files, ref.sourceId, ref.expectedVersion, space.id);
487
+ }
488
+ if (ref.kind === "session") {
489
+ const [metadata, messages] = await Promise.all([this.sessionIndex.getSessionMetadata(ref.sourceId), this.sessionIndex.getStore().loadMessages(ref.sourceId)]);
490
+ return buildSessionAgentContext(metadata, messages, ref.expectedVersion);
491
+ }
492
+ if (ref.kind === "mcp_resource") return buildMcpResourceAgentContext({
493
+ workspaceDir: this.currentWorkspacePath,
494
+ config: this.config,
495
+ sourceId: ref.sourceId,
496
+ expectedVersion: ref.expectedVersion
497
+ });
498
+ if (ref.kind === "browser_tab") {
499
+ const binding = getBrowserTabBindingById(ref.sourceId);
500
+ if (!binding || binding.conversationId !== conversationId || ref.expectedVersion && ref.expectedVersion !== binding.documentId) return null;
501
+ const wire = await new RealtimeExtensionBrowserProvider(this.endpointTools).send({
502
+ action: "observe",
503
+ sessionId: `context:${binding.conversationId}`,
504
+ target: {
505
+ kind: "attached_tab",
506
+ bindingId: binding.id
507
+ },
508
+ visual: "never"
509
+ }).catch(() => null);
510
+ if (!wire?.result.ok || !wire.result.receipt.observation) return null;
511
+ return buildBrowserTabAgentContext(ref.sourceId, wire.result.receipt.observation, ref.expectedVersion);
512
+ }
469
513
  const note = await this.notesService.getNote(ref.sourceId);
470
514
  if (!note || note.status === "trashed") return null;
471
515
  if (ref.expectedVersion && ref.expectedVersion !== String(note.updatedAt)) return null;
@@ -581,6 +625,7 @@ var GatewayService = class {
581
625
  emitBrowserEvent: (type, payload) => this.emit(type, payload),
582
626
  getNotesService: () => this.notesService,
583
627
  getProjectService: () => this.projects,
628
+ getWorkDiscovery: () => this._workDiscovery ?? void 0,
584
629
  getLocalAppService: () => this.localApps,
585
630
  dispatchTaskEvents: () => this.dispatchTaskEvents(),
586
631
  dispatchTaskRuns: () => this.dispatchTaskRuns(),
@@ -661,6 +706,13 @@ var GatewayService = class {
661
706
  })).conversationId;
662
707
  },
663
708
  runAgent: async (runId, conversationId, message) => {
709
+ const taskRun = new TaskRunRepository().require(runId);
710
+ if (getSqliteDatabase().prepare("SELECT 1 FROM scene_task_bindings WHERE task_id = ?").get(taskRun.taskId)) {
711
+ if (!this.sceneHost?.http.followUps) throw new Error("Task follow-up runtime is disabled");
712
+ this.ensureAgentService();
713
+ await this.sceneHost.http.followUps.executeTask(runId, conversationId);
714
+ return;
715
+ }
664
716
  const clientMessageId = `task:${runId}`;
665
717
  const session = await this.sessionIndex.getSessionMetadata(conversationId);
666
718
  if (!session) throw new Error("Task session is unavailable");
@@ -686,11 +738,17 @@ var GatewayService = class {
686
738
  return this.taskRunDispatcher;
687
739
  }
688
740
  createNotificationService() {
689
- if (!this.notificationService) this.notificationService = new NotificationService({ publish: (type, payload) => this.realtime.broker.publish("gateway", type, payload) });
741
+ if (!this.notificationService) this.notificationService = new NotificationService({
742
+ publish: (type, payload) => this.realtime.broker.publish("gateway", type, payload),
743
+ allowsNotification: (notification) => notification.target.kind !== "task" || this.sceneHost?.http.followUps?.allowsTaskNotification(notification.target.taskId) !== false
744
+ });
690
745
  return this.notificationService;
691
746
  }
692
747
  taskRunDispatch = createBackgroundTask(async () => {
693
748
  new TaskSignalService().tick();
749
+ this.notesService.flushCommittedEffects();
750
+ this.projects.flushCommittedEffects();
751
+ this._workDiscovery?.dispatchProjectUnderstanding();
694
752
  this.dispatchTaskEvents();
695
753
  this.createTaskRunDispatcher().dispatch();
696
754
  await this.createWorkflowRunService().dispatchTaskRuns();
@@ -770,7 +828,10 @@ var GatewayService = class {
770
828
  };
771
829
  }
772
830
  dispatchTaskEvents() {
773
- new TaskOutboxDispatcher(publishAutomationProductEvent).drain();
831
+ new DomainOutboxDispatcher((event) => {
832
+ if (event.source === "local_apps") this.emit(event.type, event.payload);
833
+ else publishAutomationProductEvent(event);
834
+ }).drain();
774
835
  }
775
836
  runAgent(...args) {
776
837
  return this.agentRunner.runAgent(...args);
@@ -785,6 +846,17 @@ var GatewayService = class {
785
846
  submitSessionInput(...args) {
786
847
  return this.agentRunner.submitSessionInput(...args);
787
848
  }
849
+ appContextDispatcher() {
850
+ return createProductDispatcher(() => this.notesService, {
851
+ getProjects: () => this.projects,
852
+ getLocalApps: () => this.localApps,
853
+ getSceneAccess: () => this.sceneAccess
854
+ });
855
+ }
856
+ prepareSessionAppContext(input, principal, conversationId, clientMessageId) {
857
+ const previous = findSessionInput(conversationId, clientMessageId)?.contextSnapshots?.find((source) => source.kind === "app_context");
858
+ return prepareAppContext(input, principal, this.auth, this.appContextDispatcher(), previous);
859
+ }
788
860
  replaceLatestSessionTurn(...args) {
789
861
  return this.agentRunner.replaceLatestSessionTurn(...args);
790
862
  }
@@ -949,6 +1021,7 @@ var GatewayService = class {
949
1021
  });
950
1022
  log.debug("Starting gateway service...");
951
1023
  openXopcDatabase();
1024
+ await this.localApps.recoverPendingReleases();
952
1025
  const { recoverCapabilityImports } = await import("../imports/runtime.js");
953
1026
  await recoverCapabilityImports();
954
1027
  this.createNotificationService().start();
@@ -1628,6 +1701,24 @@ var GatewayService = class {
1628
1701
  this.stopAutomationProductEventBridge?.();
1629
1702
  this.stopSessionTranscriptAutomationEvents?.();
1630
1703
  this.stopAutomationProductEventBridge = onAutomationProductEvent((event) => {
1704
+ if (event.type === "project.deleted" && typeof event.payload.projectId === "string") {
1705
+ const runIds = event.payload.deletedUnderstandingRunIds;
1706
+ if (Array.isArray(runIds) && runIds.every((id) => typeof id === "string")) this._workDiscovery?.abortDeletedProjectRuns(event.payload.projectId, runIds);
1707
+ }
1708
+ if (event.type === "note.created" || event.type === "note.updated" || event.type === "note.deleted" || event.type === "task.changed.v2" || event.type === "task.deleted.v1" || event.type === "project.changed" || event.type === "project.created" || event.type === "project.deleted" || event.type === "scene.changed" || event.type === "scene.created" || event.type === "scene.deleted") {
1709
+ const note = event.type.startsWith("note.");
1710
+ const project = event.type.startsWith("project.");
1711
+ const scene = event.type.startsWith("scene.");
1712
+ const payload = event.payload;
1713
+ if (typeof payload.sourceEventId === "string") this.realtime.broker.publish(note ? "resources:notes" : project ? "resources:projects" : scene ? "resources:scenes" : "resources:tasks", "resource.changed", {
1714
+ eventId: payload.sourceEventId,
1715
+ kind: note ? "note" : project ? "project" : scene ? "scene" : "task",
1716
+ id: note ? payload.noteId : project ? payload.projectId : scene ? payload.sceneId : payload.taskId,
1717
+ revision: note || scene ? payload.revision : payload.version,
1718
+ operation: event.type === "task.deleted.v1" || event.type.endsWith(".deleted") ? "deleted" : event.type.endsWith(".created") ? "created" : "updated",
1719
+ ...typeof payload.operationId === "string" ? { operationId: payload.operationId } : {}
1720
+ });
1721
+ }
1631
1722
  if (event.type.startsWith("task.")) this.emit(event.type, event.payload);
1632
1723
  this.automationService.triggerEvent(event).catch((err) => {
1633
1724
  const em = err instanceof Error ? err.message : String(err);
@@ -2,20 +2,21 @@ import { createLogger } from "../utils/logger/index.js";
2
2
  import { init_logger } from "../utils/logger.js";
3
3
  import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
4
4
  import { hasGatewayScope } from "./security/gateway-scopes.js";
5
+ import { TaskRepository, init_task_repository } from "../tasks/task-repository.js";
5
6
  import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
6
7
  import { init_session_repository } from "../storage/sqlite/session-repository.js";
7
8
  import { getSessionConfig } from "../storage/sqlite/config-repository.js";
9
+ import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
8
10
  import { getExecutionEnvironmentForSession } from "../execution-environments/subject.js";
9
11
  import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
10
12
  import { ProjectStore } from "../projects/project-store.js";
11
13
  import { runExec } from "../infra/exec.js";
12
- import { TaskRepository } from "../tasks/task-repository.js";
13
14
  import { isSessionSourceBinding } from "../agent/source-context/types.js";
14
- import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
15
15
  import { realpath, stat } from "node:fs/promises";
16
16
  //#region src/gateway/session-context-summary.ts
17
17
  init_session_repository();
18
18
  init_transaction();
19
+ init_task_repository();
19
20
  init_logger();
20
21
  const log = createLogger("SessionContextSummary");
21
22
  const SOURCE_LIMIT = 20;
@@ -1,5 +1,5 @@
1
1
  import path, { relative, resolve } from "node:path";
2
- import fsSync from "node:fs";
2
+ import fs from "node:fs";
3
3
  //#region src/gateway/workspace-editor-path.ts
4
4
  /** Resolve a workspace-relative POSIX path safely (no `..`, stays under root). */
5
5
  function resolveWorkspaceSafePath(workspaceRoot, rel) {
@@ -20,7 +20,7 @@ function isPathUnderWorkspace(workspaceRoot, absPath) {
20
20
  function normalizeComparablePath(input) {
21
21
  let resolved = resolve(input);
22
22
  try {
23
- resolved = fsSync.realpathSync.native(resolved);
23
+ resolved = fs.realpathSync.native(resolved);
24
24
  } catch {}
25
25
  return process.platform === "win32" ? resolved.toLowerCase() : resolved;
26
26
  }
@@ -35,13 +35,29 @@ async function fuzzySearchWorkspaceFiles(workspaceRoot, query, limit) {
35
35
  }
36
36
  const q = query.trim();
37
37
  const capped = Math.min(Math.max(limit, 1), 50);
38
+ const directories = /* @__PURE__ */ new Set();
39
+ for (const file of files) {
40
+ const parts = file.split("/");
41
+ for (let end = 1; end < parts.length; end += 1) {
42
+ const directory = parts.slice(0, end).join("/");
43
+ if (directory) directories.add(directory);
44
+ }
45
+ }
46
+ const candidates = [...directories].map((path) => ({
47
+ name: basename(path),
48
+ path,
49
+ isDirectory: true
50
+ }));
51
+ candidates.push(...files.map((path) => ({
52
+ name: basename(path),
53
+ path,
54
+ isDirectory: false
55
+ })));
38
56
  const rows = [];
39
57
  if (!q) {
40
- const sorted = [...files].sort((a, b) => a.localeCompare(b));
41
- for (const rel of sorted.slice(0, capped)) rows.push({
42
- name: basename(rel),
43
- path: rel,
44
- isDirectory: false,
58
+ const sorted = candidates.sort((a, b) => a.path.localeCompare(b.path));
59
+ for (const candidate of sorted.slice(0, capped)) rows.push({
60
+ ...candidate,
45
61
  score: 0
46
62
  });
47
63
  return rows.map(({ name, path, isDirectory }) => ({
@@ -50,16 +66,13 @@ async function fuzzySearchWorkspaceFiles(workspaceRoot, query, limit) {
50
66
  isDirectory
51
67
  }));
52
68
  }
53
- for (const rel of files) {
54
- const name = basename(rel);
55
- const scorePath = fuzzySubsequenceScore(q, rel);
56
- const scoreName = fuzzySubsequenceScore(q, name);
69
+ for (const candidate of candidates) {
70
+ const scorePath = fuzzySubsequenceScore(q, candidate.path);
71
+ const scoreName = fuzzySubsequenceScore(q, candidate.name);
57
72
  const score = Math.max(scorePath ?? -Infinity, scoreName ?? -Infinity);
58
73
  if (score === -Infinity) continue;
59
74
  rows.push({
60
- name,
61
- path: rel,
62
- isDirectory: false,
75
+ ...candidate,
63
76
  score
64
77
  });
65
78
  }
@@ -1,6 +1,6 @@
1
+ import { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, shouldSilence, stripHeartbeatToken } from "./tokens.js";
1
2
  import { isWithinActiveHours } from "./active-hours.js";
2
3
  import { isHeartbeatContentEmpty } from "./content-check.js";
3
4
  import { appendCronEventLines } from "./event-prompt.js";
4
- import { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, shouldSilence, stripHeartbeatToken } from "./tokens.js";
5
5
  import { createHeartbeatWake } from "./wake.js";
6
6
  export { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, appendCronEventLines, createHeartbeatWake, isHeartbeatContentEmpty, isWithinActiveHours, shouldSilence, stripHeartbeatToken };
@@ -1,7 +1,7 @@
1
- import { formatI18n } from "./format.js";
2
- import { normalizeServerLocale, serverLocaleOrFallback } from "./locale.js";
3
1
  import share_tool_en_default from "./locales/share-tool.en.js";
4
2
  import share_tool_zh_default from "./locales/share-tool.zh.js";
3
+ import { formatI18n } from "./format.js";
4
+ import { normalizeServerLocale, serverLocaleOrFallback } from "./locale.js";
5
5
  //#region src/i18n/share-tool-bundle.ts
6
6
  const byLocale = {
7
7
  en: share_tool_en_default,
@@ -3,12 +3,12 @@ import { init_paths, resolveBundledSkillsDir, resolveSkillsDir } from "../config
3
3
  import { ProjectService } from "../projects/project-service.js";
4
4
  import { resolveWorkspaceSkillsDir } from "../agent/skills/workspace-skills-dir.js";
5
5
  import { loadSkills } from "../agent/skills/index.js";
6
+ import { ProjectTrustStore } from "../project-trust/trust-store.js";
6
7
  import { ImportError } from "./types.js";
7
8
  import { ImportRepository } from "../storage/sqlite/import-repository.js";
8
9
  import { canonicalTarget } from "./planner.js";
9
10
  import { ImportService } from "./importService.js";
10
11
  import { ImportSelectionRepository } from "../storage/sqlite/import-selection-repository.js";
11
- import { ProjectTrustStore } from "../project-trust/trust-store.js";
12
12
  import { existsSync, realpathSync } from "node:fs";
13
13
  //#region src/imports/runtime.ts
14
14
  init_paths();
@@ -1,6 +1,6 @@
1
1
  import type { AutomationEvent } from '../automations/domain/types.js';
2
- export declare class TaskOutboxDispatcher {
2
+ export declare class DomainOutboxDispatcher {
3
3
  private readonly publish;
4
4
  constructor(publish: (event: AutomationEvent) => void);
5
- drain(limit?: number): number;
5
+ drain(limit?: number, subjectKind?: string): number;
6
6
  }
@@ -1,23 +1,24 @@
1
1
  import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
2
- //#region src/tasks/task-outbox-dispatcher.ts
2
+ //#region src/infra/domain-outbox-dispatcher.ts
3
3
  init_transaction();
4
- var TaskOutboxDispatcher = class {
4
+ var DomainOutboxDispatcher = class {
5
5
  constructor(publish) {
6
6
  this.publish = publish;
7
7
  }
8
- drain(limit = 100) {
9
- const rows = getSqliteDatabase().prepare(`SELECT event_id, event_type, payload_json, created_at
10
- FROM domain_outbox WHERE published_at IS NULL
11
- ORDER BY created_at, event_id LIMIT ?`).all(Math.max(1, Math.min(500, Math.floor(limit))));
8
+ drain(limit = 100, subjectKind) {
9
+ const rows = getSqliteDatabase().prepare(`SELECT event_id, event_type, payload_json, created_at, subject_kind, operation_id
10
+ FROM domain_outbox WHERE published_at IS NULL AND (? IS NULL OR subject_kind = ?)
11
+ ORDER BY created_at, event_id LIMIT ?`).all(subjectKind ?? null, subjectKind ?? null, Math.max(1, Math.min(500, Math.floor(limit))));
12
12
  let published = 0;
13
13
  for (const row of rows) try {
14
14
  const payload = JSON.parse(row.payload_json);
15
15
  this.publish({
16
16
  type: row.event_type,
17
- source: "tasks",
17
+ source: row.subject_kind === "note" ? "notes" : row.subject_kind === "project" ? "projects" : row.subject_kind === "scene" ? "scenes" : row.subject_kind === "local_app" ? "local_apps" : "tasks",
18
18
  payload: {
19
19
  ...payload,
20
- sourceEventId: row.event_id
20
+ sourceEventId: row.event_id,
21
+ ...row.operation_id ? { operationId: row.operation_id } : {}
21
22
  },
22
23
  occurredAtMs: row.created_at
23
24
  });
@@ -33,4 +34,4 @@ var TaskOutboxDispatcher = class {
33
34
  }
34
35
  };
35
36
  //#endregion
36
- export { TaskOutboxDispatcher };
37
+ export { DomainOutboxDispatcher };
@@ -1,11 +1,11 @@
1
1
  import { listPortListeners } from "../gateway/ports.js";
2
2
  import { isGatewayArgv, parseProcCmdline } from "./gateway-process-argv.js";
3
- import fsSync from "node:fs";
3
+ import fs from "node:fs";
4
4
  import { spawnSync } from "node:child_process";
5
5
  //#region src/infra/gateway-processes.ts
6
6
  function readGatewayProcessArgsSync(pid) {
7
7
  if (process.platform === "linux") try {
8
- return parseProcCmdline(fsSync.readFileSync(`/proc/${pid}/cmdline`, "utf8"));
8
+ return parseProcCmdline(fs.readFileSync(`/proc/${pid}/cmdline`, "utf8"));
9
9
  } catch {
10
10
  return null;
11
11
  }
@@ -0,0 +1,2 @@
1
+ export declare function currentOperationId(): string | undefined;
2
+ export declare function withOperation<T>(operationId: string, run: () => T): T;
@@ -0,0 +1,16 @@
1
+ import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
2
+ import { AsyncLocalStorage } from "node:async_hooks";
3
+ //#region src/infra/operation-context.ts
4
+ function currentOperationId() {
5
+ return operations.getStore();
6
+ }
7
+ function withOperation(operationId, run) {
8
+ return operations.run(operationId, run);
9
+ }
10
+ var operations;
11
+ var init_operation_context = __esmMin((() => {
12
+ operations = new AsyncLocalStorage();
13
+ }));
14
+ //#endregion
15
+ init_operation_context();
16
+ export { currentOperationId, init_operation_context, withOperation };
@@ -1,7 +1,7 @@
1
1
  import { resolveBrewPathDirs } from "./brew.js";
2
2
  import os from "node:os";
3
3
  import path from "node:path";
4
- import fsSync from "node:fs";
4
+ import fs from "node:fs";
5
5
  //#region src/infra/path-env.ts
6
6
  function isTruthyEnvValue(value) {
7
7
  if (!value) return false;
@@ -10,7 +10,7 @@ function isTruthyEnvValue(value) {
10
10
  }
11
11
  function isExecutable(filePath) {
12
12
  try {
13
- fsSync.accessSync(filePath, fsSync.constants.X_OK);
13
+ fs.accessSync(filePath, fs.constants.X_OK);
14
14
  return true;
15
15
  } catch {
16
16
  return false;
@@ -18,7 +18,7 @@ function isExecutable(filePath) {
18
18
  }
19
19
  function isDirectory(dirPath) {
20
20
  try {
21
- return fsSync.statSync(dirPath).isDirectory();
21
+ return fs.statSync(dirPath).isDirectory();
22
22
  } catch {
23
23
  return false;
24
24
  }
@@ -1,10 +1,10 @@
1
- import { resolveExecPathBinPrepend } from "./path-env.js";
2
1
  import { applyPathPrepend } from "./path-prepend.js";
2
+ import { resolveExecPathBinPrepend } from "./path-env.js";
3
3
  import { readPackageVersion } from "./package-json.js";
4
4
  import { createDefaultCommandRunner } from "./run-command.js";
5
5
  import path from "node:path";
6
- import fsSync from "node:fs";
7
- import fs from "node:fs/promises";
6
+ import fs from "node:fs";
7
+ import fs$1 from "node:fs/promises";
8
8
  //#region src/infra/update-global.ts
9
9
  const XOPC_PACKAGE_NAME = "@xopcai/xopc";
10
10
  const GLOBAL_RENAME_PREFIX = ".";
@@ -18,7 +18,7 @@ const NPM_GLOBAL_INSTALL_OMIT_OPTIONAL_FLAGS = ["--omit=optional", ...NPM_GLOBAL
18
18
  const GLOBAL_DETECT_TIMEOUT_MS = 15e3;
19
19
  async function pathExists(targetPath) {
20
20
  try {
21
- await fs.access(targetPath);
21
+ await fs$1.access(targetPath);
22
22
  return true;
23
23
  } catch {
24
24
  return false;
@@ -26,7 +26,7 @@ async function pathExists(targetPath) {
26
26
  }
27
27
  async function tryRealpath(targetPath) {
28
28
  try {
29
- return await fs.realpath(targetPath);
29
+ return await fs$1.realpath(targetPath);
30
30
  } catch {
31
31
  return path.resolve(targetPath);
32
32
  }
@@ -49,14 +49,14 @@ function resolvePreferredNpmCommand(pkgRoot) {
49
49
  const prefix = inferNpmPrefixFromPackageRoot(pkgRoot);
50
50
  if (!prefix) return null;
51
51
  const candidate = process.platform === "win32" ? path.join(prefix, "npm.cmd") : path.join(prefix, "bin", "npm");
52
- return fsSync.existsSync(candidate) ? candidate : null;
52
+ return fs.existsSync(candidate) ? candidate : null;
53
53
  }
54
54
  function resolveNpmFromExecPath() {
55
55
  const execPath = process.execPath?.trim();
56
56
  if (!execPath) return null;
57
57
  const binDir = path.dirname(execPath);
58
58
  const candidate = process.platform === "win32" ? path.join(binDir, "npm.cmd") : path.join(binDir, "npm");
59
- return fsSync.existsSync(candidate) ? candidate : null;
59
+ return fs.existsSync(candidate) ? candidate : null;
60
60
  }
61
61
  function resolvePreferredGlobalManagerCommand(manager, pkgRoot) {
62
62
  if (manager !== "npm") return manager;
@@ -204,7 +204,7 @@ async function cleanupGlobalRenameDirs(params) {
204
204
  const prefix = `${GLOBAL_RENAME_PREFIX}${name}-`;
205
205
  let entries = [];
206
206
  try {
207
- entries = await fs.readdir(root);
207
+ entries = await fs$1.readdir(root);
208
208
  } catch {
209
209
  return { removed };
210
210
  }
@@ -212,8 +212,8 @@ async function cleanupGlobalRenameDirs(params) {
212
212
  if (!entry.startsWith(prefix)) continue;
213
213
  const target = path.join(root, entry);
214
214
  try {
215
- if (!(await fs.lstat(target)).isDirectory()) continue;
216
- await fs.rm(target, {
215
+ if (!(await fs$1.lstat(target)).isDirectory()) continue;
216
+ await fs$1.rm(target, {
217
217
  recursive: true,
218
218
  force: true
219
219
  });
@@ -0,0 +1,2 @@
1
+ /** Validate release bindings against the same production definitions without executing a domain service. */
2
+ export declare function validateLocalAppCapabilityContracts(value: unknown): void;