@xopcai/xopc 0.0.313 → 0.0.314

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 (672) 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 +2 -2
  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 +3 -3
  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-BFkjfurL.js} +1 -1
  17. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BdOZ6q8Z.js +1 -0
  18. package/dist/gateway/static/root/assets/{agents-Bspu1pT2.js → agents-CCcavsHq.js} +1 -1
  19. package/dist/gateway/static/root/assets/{api-Com7kQuw.js → api-BYhRsTAc.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-B4kihr-A.js} +1 -1
  22. package/dist/gateway/static/root/assets/appearance-settings-N9sYmNOx.js +1 -0
  23. package/dist/gateway/static/root/assets/apps-page-BMcy10_s.js +1 -0
  24. package/dist/gateway/static/root/assets/{archive-plugin-BWueu3Qt.js → archive-plugin-k_SuYWyV.js} +1 -1
  25. package/dist/gateway/static/root/assets/{attachment-load-DYV25sAC.js → attachment-load-DRv5QWUK.js} +1 -1
  26. package/dist/gateway/static/root/assets/{automations-page-Du8AkHrH.js → automations-page-CkJV3DN0.js} +1 -1
  27. package/dist/gateway/static/root/assets/automations-workspace-BEa2doeR.js +7 -0
  28. package/dist/gateway/static/root/assets/{binary-plugins-rahoUE_-.js → binary-plugins-Dg3h3TA7.js} +1 -1
  29. package/dist/gateway/static/root/assets/{block-editor-CVbiuQ90.js → block-editor-DVhdHntT.js} +29 -29
  30. package/dist/gateway/static/root/assets/{browser-automation-inputs-CAC4w9KM.js → browser-automation-inputs-BMRYUW8_.js} +1 -1
  31. package/dist/gateway/static/root/assets/{browser-automations-page-B3-fdrAr.js → browser-automations-page-Byv6-FY2.js} +2 -2
  32. package/dist/gateway/static/root/assets/browser-settings-page-DRCHGFpO.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-mxRP0gl0.js +8 -0
  35. package/dist/gateway/static/root/assets/channels-settings-DBt_6GsB.js +1 -0
  36. package/dist/gateway/static/root/assets/{chat-terminal-dock-98GzKJ0K.js → chat-terminal-dock-D4AHa51o.js} +2 -2
  37. package/dist/gateway/static/root/assets/{computer-settings-page-CB3mySQb.js → computer-settings-page-eXPe500D.js} +1 -1
  38. package/dist/gateway/static/root/assets/{connector-service-page-ZlbIXdey.js → connector-service-page-BQTFlq_k.js} +1 -1
  39. package/dist/gateway/static/root/assets/connectors-page-BKeBWwcI.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-7MtovynY.js} +1 -1
  42. package/dist/gateway/static/root/assets/{dependency-picker-D1QgzM_s.js → dependency-picker-Bj_xkXID.js} +1 -1
  43. package/dist/gateway/static/root/assets/{desktop-pet-D0MtbTwu.js → desktop-pet-CTmba9zH.js} +1 -1
  44. package/dist/gateway/static/root/assets/desktop-pet-settings-DNM_BlWN.js +1 -0
  45. package/dist/gateway/static/root/assets/device-pairing-wizard-C2XE0QhT.js +1 -0
  46. package/dist/gateway/static/root/assets/{extension-debug-page-BOtWAAGM.js → extension-debug-page-J_olaL7e.js} +1 -1
  47. package/dist/gateway/static/root/assets/{extension-page-FULvawj8.js → extension-page-pK5RvqN8.js} +1 -1
  48. package/dist/gateway/static/root/assets/{extension-settings-page-Dzh6lE26.js → extension-settings-page-BwroEN08.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-FuJTIg_a.js} +1 -1
  51. package/dist/gateway/static/root/assets/gateway-settings-CLLDp23J.js +1 -0
  52. package/dist/gateway/static/root/assets/{gateway-startup-retry-CrHz00-9.js → gateway-startup-retry-CKg_gu8_.js} +1 -1
  53. package/dist/gateway/static/root/assets/home-page-B5Epb1PH.js +1 -0
  54. package/dist/gateway/static/root/assets/{image-generation-api-DGiHzeLb.js → image-generation-api-Bo6NZ7zb.js} +1 -1
  55. package/dist/gateway/static/root/assets/{imports-page-DiJrgu9D.js → imports-page-C8-hX8gS.js} +1 -1
  56. package/dist/gateway/static/root/assets/index-14F1yGJI.js +89 -0
  57. package/dist/gateway/static/root/assets/index-cB7rWIDY.css +1 -0
  58. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DZ60sucF.js → keyboard-shortcuts-settings-BkBEjUZD.js} +1 -1
  59. package/dist/gateway/static/root/assets/local-app-workbench-page-6jC3vQpY.js +2 -0
  60. package/dist/gateway/static/root/assets/{local-apps-page-Cx2YuI8E.js → local-apps-page-CrbKIixo.js} +1 -1
  61. package/dist/gateway/static/root/assets/{locale-store-vZTDIqJB.js → locale-store-CvGwNbml.js} +1 -1
  62. package/dist/gateway/static/root/assets/logs-page-DBHlZts9.js +2 -0
  63. package/dist/gateway/static/root/assets/management-settings-DsUWLu5m.js +1 -0
  64. package/dist/gateway/static/root/assets/{markdown-view-DJfzcZCW.js → markdown-view-nXo5nrsv.js} +1 -1
  65. package/dist/gateway/static/root/assets/{media-plugins-COpQGcN3.js → media-plugins-upxXJ-4l.js} +1 -1
  66. package/dist/gateway/static/root/assets/messages-B_AwRroN.js +3 -0
  67. package/dist/gateway/static/root/assets/note-detail-panel-0Q9TOtJG.js +5 -0
  68. package/dist/gateway/static/root/assets/notes-page-D0NmcwNw.js +8 -0
  69. package/dist/gateway/static/root/assets/page-context-capture-button-DUyA-K4L.js +1 -0
  70. package/dist/gateway/static/root/assets/{page-tabs-nARdLZcP.js → page-tabs-Cl-NFPNr.js} +1 -1
  71. package/dist/gateway/static/root/assets/{preview-open-alternatives-BEJg3fTq.js → preview-open-alternatives-DX81PwJ3.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-CrfIGwm8.js} +1 -1
  74. package/dist/gateway/static/root/assets/project-detail-page-BVfVrYmn.js +1 -0
  75. package/dist/gateway/static/root/assets/projects-page-nM9a9XNS.js +1 -0
  76. package/dist/gateway/static/root/assets/{registry-api-CF-nJ5MG.js → registry-api-CHxgohY0.js} +1 -1
  77. package/dist/gateway/static/root/assets/remote-access-hub-C8b_k88G.js +1 -0
  78. package/dist/gateway/static/root/assets/runtime-tools-settings-panel-D3dLOW04.js +5 -0
  79. package/dist/gateway/static/root/assets/scenes-page-DEowreZV.js +2 -0
  80. package/dist/gateway/static/root/assets/{schema-form-DOsDKbWU.js → schema-form-ZxuIvD2_.js} +1 -1
  81. package/dist/gateway/static/root/assets/schemas-88fK3zzl.js +64 -0
  82. package/dist/gateway/static/root/assets/sessions-page-B_nPhera.js +1 -0
  83. package/dist/gateway/static/root/assets/settings-advanced-gate-BqhIOuus.js +1 -0
  84. package/dist/gateway/static/root/assets/{settings-form-section-kIV5M-9G.js → settings-form-section-TZRfg4yo.js} +1 -1
  85. package/dist/gateway/static/root/assets/{settings-page-C2TS9mvq.js → settings-page-a8qcJpdZ.js} +1 -1
  86. package/dist/gateway/static/root/assets/{settings-page-layout-B39PogyD.js → settings-page-layout-BfvlRT9q.js} +1 -1
  87. package/dist/gateway/static/root/assets/setup-status-panel-CRj5Ruqn.js +1 -0
  88. package/dist/gateway/static/root/assets/{share-preview-page-CMbgRZ7w.js → share-preview-page-DCt1pTWB.js} +1 -1
  89. package/dist/gateway/static/root/assets/shares-settings-BNbXPk--.js +1 -0
  90. package/dist/gateway/static/root/assets/skill-reload-api-CNMCLbav.js +1 -0
  91. package/dist/gateway/static/root/assets/{skills-page-DV4FX1ev.js → skills-page-BIOcg44X.js} +1 -1
  92. package/dist/gateway/static/root/assets/{skills-page.utils-C-2lmZHk.js → skills-page.utils-CgZdzT4I.js} +1 -1
  93. package/dist/gateway/static/root/assets/{system-settings-panel-CQ1Z6i28.js → system-settings-panel-_YaRncA6.js} +1 -1
  94. package/dist/gateway/static/root/assets/task-detail-page-CAcfAG-c.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-uOupJOoS.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-BezzHBLE.js} +1 -1
  99. package/dist/gateway/static/root/assets/user-model-page-BFFeneDq.js +2 -0
  100. package/dist/gateway/static/root/assets/{voice-api-key-field-d0Fawetf.js → voice-api-key-field-BmYifdwL.js} +1 -1
  101. package/dist/gateway/static/root/assets/{voice-config-api-D_8zU7Li.js → voice-config-api-D_5Q2_A3.js} +1 -1
  102. package/dist/gateway/static/root/assets/{work-discovery-overlay-C5FFSieF.js → work-discovery-overlay-4DmyEckJ.js} +1 -1
  103. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-q5ammR4k.js → workflow-run-setup-panel-DeZe8bTZ.js} +2 -2
  104. package/dist/gateway/static/root/assets/workflows-page-Sv4hEc6W.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.js +1 -1
  159. package/dist/src/agent/mcp/bundle-mcp-runtime.js +1 -1
  160. package/dist/src/agent/mcp/index.js +2 -2
  161. package/dist/src/agent/mcp/mcp-transport.js +1 -1
  162. package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
  163. package/dist/src/agent/memory/compaction-chunks.d.ts +6 -1
  164. package/dist/src/agent/memory/compaction-chunks.js +16 -3
  165. package/dist/src/agent/memory/compaction-ledger.d.ts +3 -1
  166. package/dist/src/agent/memory/compaction-ledger.js +31 -18
  167. package/dist/src/agent/memory/compaction-request.d.ts +2 -0
  168. package/dist/src/agent/memory/compaction-request.js +6 -1
  169. package/dist/src/agent/memory/compaction.d.ts +19 -1
  170. package/dist/src/agent/memory/compaction.js +112 -30
  171. package/dist/src/agent/memory/context-recovery.js +1 -1
  172. package/dist/src/agent/memory/index.js +2 -2
  173. package/dist/src/agent/orchestration/agent-orchestrator.js +5 -5
  174. package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
  175. package/dist/src/agent/sandbox/exec-policy.js +1 -1
  176. package/dist/src/agent/service/direct-turn-helpers.js +5 -5
  177. package/dist/src/agent/service/process-direct-one-shot.js +1 -1
  178. package/dist/src/agent/service/process-direct-streaming.d.ts +3 -0
  179. package/dist/src/agent/service/process-direct-streaming.js +21 -12
  180. package/dist/src/agent/service/webchat-tts.js +1 -1
  181. package/dist/src/agent/service.js +22 -21
  182. package/dist/src/agent/service.types.d.ts +1 -0
  183. package/dist/src/agent/session/session-inspector.js +1 -1
  184. package/dist/src/agent/skills/config.js +2 -0
  185. package/dist/src/agent/skills/filesystem-watcher.js +1 -1
  186. package/dist/src/agent/skills/format-skills-prompt.js +14 -1
  187. package/dist/src/agent/skills/hub-lock.js +1 -1
  188. package/dist/src/agent/skills/hub-pull.js +3 -3
  189. package/dist/src/agent/skills/index.js +16 -8
  190. package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
  191. package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
  192. package/dist/src/agent/skills/types.d.ts +1 -1
  193. package/dist/src/agent/source-context/app-context.d.ts +4 -0
  194. package/dist/src/agent/source-context/app-context.js +36 -0
  195. package/dist/src/agent/source-context/injector.js +1 -0
  196. package/dist/src/agent/source-context/types.d.ts +5 -1
  197. package/dist/src/agent/tasks/task-judge-service.js +6 -5
  198. package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
  199. package/dist/src/agent/tool-manuals/computer.js +1 -1
  200. package/dist/src/agent/tools/automation-tool.d.ts +12 -1
  201. package/dist/src/agent/tools/automation-tool.js +106 -32
  202. package/dist/src/agent/tools/create-share-tool.js +4 -4
  203. package/dist/src/agent/tools/dataBatch.js +1 -1
  204. package/dist/src/agent/tools/delegate-tool.js +3 -3
  205. package/dist/src/agent/tools/delegation-parent-policy.js +1 -1
  206. package/dist/src/agent/tools/executor.js +1 -1
  207. package/dist/src/agent/tools/factory.d.ts +1 -0
  208. package/dist/src/agent/tools/factory.js +22 -17
  209. package/dist/src/agent/tools/fetch-text.js +1 -1
  210. package/dist/src/agent/tools/image-generate-tool.js +3 -3
  211. package/dist/src/agent/tools/index.js +6 -6
  212. package/dist/src/agent/tools/list-dir.js +1 -1
  213. package/dist/src/agent/tools/publish-artifacts.js +2 -2
  214. package/dist/src/agent/tools/read.js +2 -2
  215. package/dist/src/agent/tools/review-workspace.js +1 -1
  216. package/dist/src/agent/tools/scoped-workspace-tools.d.ts +8 -0
  217. package/dist/src/agent/tools/scoped-workspace-tools.js +81 -0
  218. package/dist/src/agent/tools/send-media.js +2 -2
  219. package/dist/src/agent/tools/skills-tools.js +1 -1
  220. package/dist/src/agent/tools/user-context-tool.js +1 -1
  221. package/dist/src/agent/tools/write.js +2 -2
  222. package/dist/src/agent/tools/xopc-use-tool.d.ts +6 -3
  223. package/dist/src/agent/tools/xopc-use-tool.js +997 -908
  224. package/dist/src/agent/workflow/subagent-runner.js +2 -1
  225. package/dist/src/agent-config/index.js +2 -2
  226. package/dist/src/agent-config/schema.d.ts +5 -0
  227. package/dist/src/agent-config/schema.js +14 -10
  228. package/dist/src/ai-assist/text-assist.js +1 -1
  229. package/dist/src/auth/credentials.js +2 -2
  230. package/dist/src/auth/oauth/xopc-cloud.js +1 -1
  231. package/dist/src/auth/profiles/store.js +1 -1
  232. package/dist/src/auth/sync-provider-auth.js +2 -2
  233. package/dist/src/automations/api/routes.js +244 -164
  234. package/dist/src/automations/capabilities/drafts.d.ts +4 -0
  235. package/dist/src/automations/capabilities/drafts.js +95 -0
  236. package/dist/src/automations/capabilities/read.d.ts +4 -0
  237. package/dist/src/automations/capabilities/read.js +119 -0
  238. package/dist/src/automations/capabilities/write.d.ts +349 -0
  239. package/dist/src/automations/capabilities/write.js +172 -0
  240. package/dist/src/automations/domain/index.js +2 -2
  241. package/dist/src/automations/domain/validation.d.ts +77 -77
  242. package/dist/src/automations/domain/validation.js +9 -6
  243. package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -2
  244. package/dist/src/automations/index.js +6 -6
  245. package/dist/src/automations/service/automation-service.d.ts +31 -0
  246. package/dist/src/automations/service/automation-service.js +213 -75
  247. package/dist/src/automations/service/index.js +2 -2
  248. package/dist/src/automations/storage/automation-repository.d.ts +2 -0
  249. package/dist/src/automations/storage/automation-repository.js +9 -1
  250. package/dist/src/automations/storage/automation-run-repository.d.ts +4 -1
  251. package/dist/src/automations/storage/automation-run-repository.js +16 -3
  252. package/dist/src/automations/storage/index.js +3 -3
  253. package/dist/src/browser/automations/schema.d.ts +1 -1
  254. package/dist/src/browser/automations/service.d.ts +1 -1
  255. package/dist/src/browser/observation/format.js +4 -0
  256. package/dist/src/browser/providers/browser-ext-install.js +1 -1
  257. package/dist/src/capabilities/adapters/http.d.ts +4 -0
  258. package/dist/src/capabilities/adapters/http.js +44 -0
  259. package/dist/src/capabilities/readiness/from-config.js +11 -7
  260. package/dist/src/capabilities/runtime/app-context.d.ts +3 -0
  261. package/dist/src/capabilities/runtime/app-context.js +72 -0
  262. package/dist/src/capabilities/runtime/atomic-operations.d.ts +11 -0
  263. package/dist/src/capabilities/runtime/atomic-operations.js +34 -0
  264. package/dist/src/capabilities/runtime/dispatcher.d.ts +67 -0
  265. package/dist/src/capabilities/runtime/dispatcher.js +170 -0
  266. package/dist/src/capabilities/runtime/errors.d.ts +6 -0
  267. package/dist/src/capabilities/runtime/errors.js +11 -0
  268. package/dist/src/capabilities/runtime/external-operations.d.ts +16 -0
  269. package/dist/src/capabilities/runtime/external-operations.js +92 -0
  270. package/dist/src/capabilities/runtime/product.d.ts +12 -0
  271. package/dist/src/capabilities/runtime/product.js +69 -0
  272. package/dist/src/capabilities/runtime/settings.d.ts +3 -0
  273. package/dist/src/capabilities/runtime/settings.js +27 -0
  274. package/dist/src/capabilities/store-connector.js +1 -1
  275. package/dist/src/channels/attachments/voice-stt-webchat.js +2 -2
  276. package/dist/src/channels/index.js +3 -3
  277. package/dist/src/channels/manager.js +1 -1
  278. package/dist/src/channels/pairing/allow-from-file.js +9 -9
  279. package/dist/src/channels/pairing/pairing-store.js +6 -6
  280. package/dist/src/chat-commands/agent-edit.js +1 -1
  281. package/dist/src/chat-commands/builtins/config.js +1 -1
  282. package/dist/src/chat-commands/builtins/review.js +1 -1
  283. package/dist/src/chat-commands/builtins/thinking.js +1 -1
  284. package/dist/src/chat-commands/builtins/tts.js +1 -1
  285. package/dist/src/chat-commands/builtins/understanding.js +1 -1
  286. package/dist/src/chat-commands/builtins/workflow.js +2 -2
  287. package/dist/src/chat-commands/context.js +2 -2
  288. package/dist/src/chat-commands/index.js +2 -2
  289. package/dist/src/cli/cli-log-level-preset.d.ts +2 -0
  290. package/dist/src/cli/cli-log-level-preset.js +4 -0
  291. package/dist/src/cli/command-catalog.js +4 -0
  292. package/dist/src/cli/command-loaders.js +1 -0
  293. package/dist/src/cli/command-manifest.js +4 -0
  294. package/dist/src/cli/commands/agent.js +7 -7
  295. package/dist/src/cli/commands/agents.js +1 -1
  296. package/dist/src/cli/commands/channels.js +1 -1
  297. package/dist/src/cli/commands/config.js +1 -1
  298. package/dist/src/cli/commands/connectors.js +1 -1
  299. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  300. package/dist/src/cli/commands/doctor/checks/provider-auth.js +3 -3
  301. package/dist/src/cli/commands/extension-dev.js +1 -1
  302. package/dist/src/cli/commands/extension-marketplace.js +1 -1
  303. package/dist/src/cli/commands/extension.js +1 -1
  304. package/dist/src/cli/commands/gateway/shared.js +1 -1
  305. package/dist/src/cli/commands/gateway/token.js +1 -1
  306. package/dist/src/cli/commands/image.js +1 -1
  307. package/dist/src/cli/commands/init.js +1 -1
  308. package/dist/src/cli/commands/mcp.d.ts +1 -0
  309. package/dist/src/cli/commands/mcp.js +51 -0
  310. package/dist/src/cli/commands/models.js +2 -2
  311. package/dist/src/cli/commands/onboard.js +2 -2
  312. package/dist/src/cli/commands/project.js +2 -2
  313. package/dist/src/cli/commands/runtime.js +1 -1
  314. package/dist/src/cli/commands/skills.js +2 -2
  315. package/dist/src/cli/commands/tunnel.js +3 -3
  316. package/dist/src/cli/extension-cli-register.js +4 -4
  317. package/dist/src/cli/utils/gateway-client.js +1 -1
  318. package/dist/src/computer/broker.d.ts +0 -1
  319. package/dist/src/computer/broker.js +4 -6
  320. package/dist/src/computer/evaluation-harness.d.ts +45 -0
  321. package/dist/src/computer/evaluation-harness.js +108 -0
  322. package/dist/src/computer/model-adapter.d.ts +37 -2
  323. package/dist/src/computer/model-adapter.js +333 -42
  324. package/dist/src/computer/model-policy.d.ts +4 -1
  325. package/dist/src/computer/model-policy.js +11 -3
  326. package/dist/src/computer/release-gate.d.ts +22 -0
  327. package/dist/src/computer/release-gate.js +19 -0
  328. package/dist/src/computer/runtime.js +16 -12
  329. package/dist/src/computer/task-state.d.ts +1 -0
  330. package/dist/src/computer/task-state.js +1 -0
  331. package/dist/src/config/index.js +5 -5
  332. package/dist/src/config/loader.js +2 -2
  333. package/dist/src/config/models-json.d.ts +14 -8
  334. package/dist/src/config/models-json.js +3 -3
  335. package/dist/src/config/schema.d.ts +4 -0
  336. package/dist/src/config/schema.js +4 -10
  337. package/dist/src/connectors/cli/authorization.js +1 -1
  338. package/dist/src/connectors/cli/runtime.js +1 -1
  339. package/dist/src/connectors/composio-sessions.d.ts +4 -2
  340. package/dist/src/connectors/composio-sessions.js +11 -10
  341. package/dist/src/connectors/composio.js +11 -9
  342. package/dist/src/connectors/connected-source-understanding.js +2 -2
  343. package/dist/src/connectors/connection-recovery-service.js +5 -5
  344. package/dist/src/connectors/health.js +1 -1
  345. package/dist/src/discussions/action-tasks.js +2 -1
  346. package/dist/src/discussions/live-worker.js +1 -1
  347. package/dist/src/discussions/recording.js +1 -1
  348. package/dist/src/discussions/sealer.js +1 -1
  349. package/dist/src/execution-environments/local-worktree-manager.d.ts +1 -0
  350. package/dist/src/execution-environments/local-worktree-manager.js +13 -2
  351. package/dist/src/extensions/activation-context.js +3 -3
  352. package/dist/src/extensions/api.js +3 -3
  353. package/dist/src/extensions/bundled-extension-activation.js +1 -1
  354. package/dist/src/extensions/index.js +1 -1
  355. package/dist/src/extensions/loader.js +1 -1
  356. package/dist/src/extensions/lockfile.js +1 -1
  357. package/dist/src/extensions/normalize-manifest.js +6 -1
  358. package/dist/src/extensions/sdk/index.js +1 -1
  359. package/dist/src/extensions/sdk/media.js +1 -1
  360. package/dist/src/extensions/types/manifest.d.ts +3 -0
  361. package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
  362. package/dist/src/gateway/agents-admin.js +4 -4
  363. package/dist/src/gateway/device-routes.js +2 -2
  364. package/dist/src/gateway/file-path-classifier.js +2 -2
  365. package/dist/src/gateway/global-defaults-admin.js +1 -1
  366. package/dist/src/gateway/hono/app.js +3 -3
  367. package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
  368. package/dist/src/gateway/hono/lib/config-payload.js +3 -3
  369. package/dist/src/gateway/hono/middleware/scopes.js +1 -1
  370. package/dist/src/gateway/hono/routes/agents.js +1 -1
  371. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +6 -3
  372. package/dist/src/gateway/hono/routes/browser.js +1 -1
  373. package/dist/src/gateway/hono/routes/capability-operations.d.ts +3 -0
  374. package/dist/src/gateway/hono/routes/capability-operations.js +52 -0
  375. package/dist/src/gateway/hono/routes/commands-skills.js +3 -3
  376. package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
  377. package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
  378. package/dist/src/gateway/hono/routes/home.js +1 -1
  379. package/dist/src/gateway/hono/routes/imports.js +1 -1
  380. package/dist/src/gateway/hono/routes/lazy-bundles.js +16 -0
  381. package/dist/src/gateway/hono/routes/local-app-capabilities.d.ts +4 -0
  382. package/dist/src/gateway/hono/routes/local-app-capabilities.js +41 -0
  383. package/dist/src/gateway/hono/routes/local-apps.js +41 -9
  384. package/dist/src/gateway/hono/routes/mcp.js +1 -1
  385. package/dist/src/gateway/hono/routes/media.js +1 -1
  386. package/dist/src/gateway/hono/routes/models.js +7 -7
  387. package/dist/src/gateway/hono/routes/notes.js +216 -147
  388. package/dist/src/gateway/hono/routes/projects.js +219 -376
  389. package/dist/src/gateway/hono/routes/scenes.js +188 -75
  390. package/dist/src/gateway/hono/routes/session-input-handler.d.ts +60 -16
  391. package/dist/src/gateway/hono/routes/session-input-handler.js +45 -3
  392. package/dist/src/gateway/hono/routes/sessions.js +18 -1
  393. package/dist/src/gateway/hono/routes/shares.js +3 -3
  394. package/dist/src/gateway/hono/routes/site-shares.js +1 -1
  395. package/dist/src/gateway/hono/routes/tasks.js +182 -326
  396. package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
  397. package/dist/src/gateway/hono/routes/user-model.js +4 -4
  398. package/dist/src/gateway/hono/routes/voice.js +6 -6
  399. package/dist/src/gateway/hono/routes/workflows.js +3 -3
  400. package/dist/src/gateway/lock.js +11 -11
  401. package/dist/src/gateway/media-access.js +3 -2
  402. package/dist/src/gateway/mobile-privacy.js +2 -2
  403. package/dist/src/gateway/ports.js +6 -6
  404. package/dist/src/gateway/scenes/host.js +14 -3
  405. package/dist/src/gateway/scenes/mailContext.js +1 -1
  406. package/dist/src/gateway/scenes/slackThreadSource.d.ts +41 -0
  407. package/dist/src/gateway/scenes/slackThreadSource.js +168 -0
  408. package/dist/src/gateway/security/gateway-scopes.d.ts +1 -1
  409. package/dist/src/gateway/security/gateway-scopes.js +5 -0
  410. package/dist/src/gateway/server.js +1 -1
  411. package/dist/src/gateway/service/app-context-access.d.ts +11 -0
  412. package/dist/src/gateway/service/app-context-access.js +70 -0
  413. package/dist/src/gateway/service/config-coordinator.js +4 -4
  414. package/dist/src/gateway/service/marketplace-service.js +3 -3
  415. package/dist/src/gateway/service/run-gateway-agent.js +13 -4
  416. package/dist/src/gateway/service/session-input-coordinator.js +54 -15
  417. package/dist/src/gateway/service/sessions-api.d.ts +1 -0
  418. package/dist/src/gateway/service/sessions-api.js +4 -1
  419. package/dist/src/gateway/service/task-conversation-query-service.d.ts +3 -1
  420. package/dist/src/gateway/service/task-conversation-query-service.js +32 -3
  421. package/dist/src/gateway/service.d.ts +3 -0
  422. package/dist/src/gateway/service.js +92 -38
  423. package/dist/src/gateway/session-context-summary.js +3 -2
  424. package/dist/src/gateway/workspace-editor-path.js +2 -2
  425. package/dist/src/heartbeat/index.js +1 -1
  426. package/dist/src/i18n/share-tool-bundle.js +2 -2
  427. package/dist/src/imports/runtime.js +1 -1
  428. package/dist/src/{tasks/task-outbox-dispatcher.d.ts → infra/domain-outbox-dispatcher.d.ts} +2 -2
  429. package/dist/src/{tasks/task-outbox-dispatcher.js → infra/domain-outbox-dispatcher.js} +10 -9
  430. package/dist/src/infra/gateway-processes.js +2 -2
  431. package/dist/src/infra/operation-context.d.ts +2 -0
  432. package/dist/src/infra/operation-context.js +16 -0
  433. package/dist/src/infra/path-env.js +3 -3
  434. package/dist/src/infra/update-global.js +10 -10
  435. package/dist/src/local-apps/capabilities/contracts.d.ts +2 -0
  436. package/dist/src/local-apps/capabilities/contracts.js +32 -0
  437. package/dist/src/local-apps/capabilities/read.d.ts +3 -0
  438. package/dist/src/local-apps/capabilities/read.js +48 -0
  439. package/dist/src/local-apps/capabilities/runtime.d.ts +16 -0
  440. package/dist/src/local-apps/capabilities/runtime.js +66 -0
  441. package/dist/src/local-apps/capabilities/write.d.ts +3 -0
  442. package/dist/src/local-apps/capabilities/write.js +35 -0
  443. package/dist/src/local-apps/release-lock.d.ts +2 -0
  444. package/dist/src/local-apps/release-lock.js +20 -0
  445. package/dist/src/local-apps/runtime-entry.d.ts +0 -2
  446. package/dist/src/local-apps/runtime-entry.js +1 -14
  447. package/dist/src/local-apps/scaffold.js +4 -1
  448. package/dist/src/local-apps/service.d.ts +24 -1
  449. package/dist/src/local-apps/service.js +187 -44
  450. package/dist/src/local-apps/store.js +0 -2
  451. package/dist/src/mcp/capability-server.d.ts +4 -0
  452. package/dist/src/mcp/capability-server.js +96 -0
  453. package/dist/src/mcp/channel-bridge.js +1 -1
  454. package/dist/src/mcp/gateway-http-client.d.ts +7 -0
  455. package/dist/src/mcp/gateway-http-client.js +27 -5
  456. package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
  457. package/dist/src/notes/agent-context.js +4 -4
  458. package/dist/src/notes/capabilities/read.d.ts +3 -0
  459. package/dist/src/notes/capabilities/read.js +96 -0
  460. package/dist/src/notes/capabilities/write.d.ts +7 -0
  461. package/dist/src/notes/capabilities/write.js +152 -0
  462. package/dist/src/notes/index.js +1 -1
  463. package/dist/src/notes/service.d.ts +12 -4
  464. package/dist/src/notes/service.js +188 -175
  465. package/dist/src/notes/store.d.ts +14 -9
  466. package/dist/src/notes/store.js +81 -21
  467. package/dist/src/notifications/service.d.ts +1 -0
  468. package/dist/src/notifications/service.js +5 -0
  469. package/dist/src/platform/client.d.ts +1 -1
  470. package/dist/src/platform/contracts.d.ts +1 -1
  471. package/dist/src/projects/capabilities/read.d.ts +3 -0
  472. package/dist/src/projects/capabilities/read.js +81 -0
  473. package/dist/src/projects/capabilities/write.d.ts +9 -0
  474. package/dist/src/projects/capabilities/write.js +260 -0
  475. package/dist/src/projects/index.js +2 -2
  476. package/dist/src/projects/project-change-events.d.ts +2 -0
  477. package/dist/src/projects/project-change-events.js +18 -0
  478. package/dist/src/projects/project-service.d.ts +11 -0
  479. package/dist/src/projects/project-service.js +121 -42
  480. package/dist/src/projects/project-skill-service.js +2 -2
  481. package/dist/src/projects/project-store.js +12 -2
  482. package/dist/src/projects/project-workspace-creation.d.ts +3 -0
  483. package/dist/src/projects/project-workspace-creation.js +45 -0
  484. package/dist/src/projects/workspace-project.js +6 -0
  485. package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
  486. package/dist/src/providers/index.js +2 -2
  487. package/dist/src/providers/model-catalog-persistence.js +1 -1
  488. package/dist/src/providers/model-catalog-types.d.ts +2 -1
  489. package/dist/src/providers/model-reference-auditor.js +5 -5
  490. package/dist/src/providers/model-registry.js +1 -1
  491. package/dist/src/providers/model-supplements.js +13 -3
  492. package/dist/src/providers/presentation.js +3 -3
  493. package/dist/src/providers/register-runtime-providers.js +1 -1
  494. package/dist/src/providers/xopc-cloud-model-source.js +4 -2
  495. package/dist/src/realtime/runtime.js +4 -0
  496. package/dist/src/remote-access/exposure-manager.js +1 -1
  497. package/dist/src/scenes/capabilities/read.d.ts +3 -0
  498. package/dist/src/scenes/capabilities/read.js +187 -0
  499. package/dist/src/scenes/capabilities/write.d.ts +3 -0
  500. package/dist/src/scenes/capabilities/write.js +151 -0
  501. package/dist/src/scenes/contracts.d.ts +2 -105
  502. package/dist/src/scenes/contracts.js +3 -88
  503. package/dist/src/scenes/execution.d.ts +1 -1
  504. package/dist/src/scenes/httpServices.d.ts +2 -0
  505. package/dist/src/scenes/inbox.d.ts +1 -0
  506. package/dist/src/scenes/inbox.js +7 -7
  507. package/dist/src/scenes/preferences.d.ts +3 -24
  508. package/dist/src/scenes/preferences.js +8 -30
  509. package/dist/src/scenes/repository.d.ts +1 -0
  510. package/dist/src/scenes/repository.js +7 -3
  511. package/dist/src/scenes/resultNotifications.js +2 -2
  512. package/dist/src/scenes/schedule.d.ts +1 -8
  513. package/dist/src/scenes/schedule.js +3 -15
  514. package/dist/src/scenes/service.d.ts +6 -0
  515. package/dist/src/scenes/service.js +29 -25
  516. package/dist/src/scenes/taskFollowUp/agentExecutor.d.ts +36 -0
  517. package/dist/src/scenes/taskFollowUp/agentExecutor.js +149 -0
  518. package/dist/src/scenes/taskFollowUp/branchInventory.d.ts +38 -0
  519. package/dist/src/scenes/taskFollowUp/branchInventory.js +70 -0
  520. package/dist/src/scenes/taskFollowUp/contracts.d.ts +91 -0
  521. package/dist/src/scenes/taskFollowUp/contracts.js +100 -0
  522. package/dist/src/scenes/taskFollowUp/resources.d.ts +19 -0
  523. package/dist/src/scenes/taskFollowUp/resources.js +97 -0
  524. package/dist/src/scenes/taskFollowUp/service.d.ts +810 -0
  525. package/dist/src/scenes/taskFollowUp/service.js +710 -0
  526. package/dist/src/scenes/taskFollowUp/workspaceFingerprint.d.ts +2 -0
  527. package/dist/src/scenes/taskFollowUp/workspaceFingerprint.js +46 -0
  528. package/dist/src/scenes/templates.d.ts +2 -2
  529. package/dist/src/scenes/templates.js +1 -1
  530. package/dist/src/session/index.js +2 -2
  531. package/dist/src/session/session-find.d.ts +17 -0
  532. package/dist/src/session/session-find.js +56 -0
  533. package/dist/src/session/session-title.js +1 -1
  534. package/dist/src/session/store.d.ts +4 -0
  535. package/dist/src/session/store.js +46 -10
  536. package/dist/src/session/thinking-resolve.js +1 -1
  537. package/dist/src/share/note-share-revocation.d.ts +3 -0
  538. package/dist/src/share/note-share-revocation.js +26 -0
  539. package/dist/src/share/share-store.js +1 -1
  540. package/dist/src/share/share-thumbnail.js +1 -1
  541. package/dist/src/share/site-proxy.js +1 -1
  542. package/dist/src/share/site-share-store.js +1 -1
  543. package/dist/src/storage/sqlite/connection.js +9 -9
  544. package/dist/src/storage/sqlite/migrations/190_scene_development.sql +37 -0
  545. package/dist/src/storage/sqlite/migrations/191_scene_task_follow_up.sql +27 -0
  546. package/dist/src/storage/sqlite/migrations/192_capability_operations.sql +20 -0
  547. package/dist/src/storage/sqlite/migrations/193_note_file_cleanup.sql +8 -0
  548. package/dist/src/storage/sqlite/migrations/194_capability_external_outcomes.sql +11 -0
  549. package/dist/src/storage/sqlite/migrations/195_automation_deleted_revisions.sql +4 -0
  550. package/dist/src/storage/sqlite/migrations/196_automation_run_requests.sql +23 -0
  551. package/dist/src/storage/sqlite/migrations/197_note_deletion_cleanup.sql +8 -0
  552. package/dist/src/storage/sqlite/migrations/198_project_workspace_creation.sql +7 -0
  553. package/dist/src/storage/sqlite/migrations/199_scene_resource_events.sql +488 -0
  554. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  555. package/dist/src/storage/sqlite/migrations/runner.js +6 -3
  556. package/dist/src/storage/sqlite/schema.js +1 -1
  557. package/dist/src/storage/sqlite/transaction.d.ts +5 -0
  558. package/dist/src/storage/sqlite/transaction.js +34 -3
  559. package/dist/src/tasks/capabilities/management.d.ts +195 -0
  560. package/dist/src/tasks/capabilities/management.js +111 -0
  561. package/dist/src/tasks/capabilities/read.d.ts +2 -0
  562. package/dist/src/tasks/capabilities/read.js +141 -0
  563. package/dist/src/tasks/capabilities/relations.d.ts +204 -0
  564. package/dist/src/tasks/capabilities/relations.js +140 -0
  565. package/dist/src/tasks/capabilities/runs.d.ts +2 -0
  566. package/dist/src/tasks/capabilities/runs.js +89 -0
  567. package/dist/src/tasks/capabilities/write.d.ts +207 -0
  568. package/dist/src/tasks/capabilities/write.js +107 -0
  569. package/dist/src/tasks/execution-context.js +1 -1
  570. package/dist/src/tasks/home-query-service.js +5 -4
  571. package/dist/src/tasks/index.d.ts +0 -1
  572. package/dist/src/tasks/index.js +9 -9
  573. package/dist/src/tasks/project-operating-view-service.js +2 -1
  574. package/dist/src/tasks/task-application-service.d.ts +1 -0
  575. package/dist/src/tasks/task-application-service.js +4 -3
  576. package/dist/src/tasks/task-change-events.js +5 -3
  577. package/dist/src/tasks/task-context-assembler.js +3 -2
  578. package/dist/src/tasks/task-deletion-service.js +2 -1
  579. package/dist/src/tasks/task-dependency-service.js +2 -1
  580. package/dist/src/tasks/task-handoff-service.js +3 -2
  581. package/dist/src/tasks/task-read-model-projector.js +2 -1
  582. package/dist/src/tasks/task-repository.d.ts +12 -7
  583. package/dist/src/tasks/task-repository.js +175 -154
  584. package/dist/src/tasks/task-run-coordinator.js +2 -1
  585. package/dist/src/tasks/task-run-dispatcher.js +2 -1
  586. package/dist/src/tasks/task-run-repository.d.ts +1 -0
  587. package/dist/src/tasks/task-run-repository.js +29 -14
  588. package/dist/src/tasks/task-signal-service.js +2 -1
  589. package/dist/src/tui/backends/embedded-backend.js +10 -10
  590. package/dist/src/tui/backends/gateway-realtime-backend.js +2 -2
  591. package/dist/src/tui/extension-host/load-extensions.js +1 -1
  592. package/dist/src/tui/tui-command-formatters.js +1 -1
  593. package/dist/src/tui/tui-commands.js +6 -6
  594. package/dist/src/tui/tui-picker-overlay.js +1 -1
  595. package/dist/src/tui/tui-skills-autocomplete.js +1 -1
  596. package/dist/src/tui/tui-startup-resources.js +4 -4
  597. package/dist/src/tui/tui.js +3 -3
  598. package/dist/src/tunnel/gateway-lifecycle.js +1 -1
  599. package/dist/src/user-context/config.d.ts +13 -0
  600. package/dist/src/user-context/config.js +2 -0
  601. package/dist/src/voice/local/runtime-worker.js +1 -1
  602. package/dist/src/voice/platform-catalog.d.ts +1 -1
  603. package/dist/src/voice/realtime/memory-context.js +3 -3
  604. package/dist/src/voice/realtime/runtime.js +3 -3
  605. package/dist/src/voice/stt/index.js +2 -2
  606. package/dist/src/voice/stt/preflight.js +1 -1
  607. package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
  608. package/dist/src/voice/stt/providers/local-transcription.js +1 -1
  609. package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
  610. package/dist/src/voice/stt/transcribe-core.js +1 -1
  611. package/dist/src/voice/tts/audio.js +1 -1
  612. package/dist/src/voice/tts/factory.js +1 -1
  613. package/dist/src/voice/tts/index.js +1 -1
  614. package/dist/src/voice/tts/payload.js +1 -1
  615. package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
  616. package/dist/src/work-discovery/incremental-repository.js +1 -1
  617. package/dist/src/work-discovery/index.js +1 -1
  618. package/dist/src/work-discovery/repository.d.ts +1 -1
  619. package/dist/src/work-discovery/repository.js +3 -2
  620. package/dist/src/work-discovery/service.d.ts +4 -0
  621. package/dist/src/work-discovery/service.js +40 -15
  622. package/dist/src/workflows/context/workflow-context.js +3 -2
  623. package/dist/src/workflows/service/workflow-run-service.js +7 -6
  624. package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
  625. package/package.json +7 -3
  626. package/skills/THIRD_PARTY_NOTICES.md +2 -2
  627. package/skills/documents/xlsx/SKILL.md +5 -0
  628. package/skills/engineering/build-xopc-local-app/SKILL.md +2 -0
  629. package/skills/tools/find-skills/SKILL.md +3 -0
  630. package/dist/gateway/static/root/assets/activity-store-CS_SAPwP.js +0 -1
  631. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-9w_YVThL.js +0 -1
  632. package/dist/gateway/static/root/assets/appearance-settings-Jgvx-RKL.js +0 -1
  633. package/dist/gateway/static/root/assets/apps-page-403o57-3.js +0 -1
  634. package/dist/gateway/static/root/assets/automations-workspace-Dpju5KT_.js +0 -7
  635. package/dist/gateway/static/root/assets/browser-settings-page-C0HJrpr1.js +0 -3
  636. package/dist/gateway/static/root/assets/capabilities-settings-panel-BanM86OX.js +0 -8
  637. package/dist/gateway/static/root/assets/channels-settings-Bhh0F9pO.js +0 -1
  638. package/dist/gateway/static/root/assets/connectors-page-BTqjm6eD.js +0 -2
  639. package/dist/gateway/static/root/assets/desktop-pet-settings-BI_sQTR_.js +0 -1
  640. package/dist/gateway/static/root/assets/device-pairing-wizard-BoPCEIm5.js +0 -1
  641. package/dist/gateway/static/root/assets/files-Be5viEFY.js +0 -1
  642. package/dist/gateway/static/root/assets/gateway-realtime-mpOw3R4d.js +0 -1
  643. package/dist/gateway/static/root/assets/gateway-realtime-store-Z-ErSgkD.js +0 -1
  644. package/dist/gateway/static/root/assets/gateway-settings-Bq82yXVh.js +0 -1
  645. package/dist/gateway/static/root/assets/home-page-BD1v6Uee.js +0 -1
  646. package/dist/gateway/static/root/assets/index-Ah5XDhOL.js +0 -79
  647. package/dist/gateway/static/root/assets/index-CV5b1pD1.css +0 -1
  648. package/dist/gateway/static/root/assets/local-app-workbench-page-BF8x3bgh.js +0 -2
  649. package/dist/gateway/static/root/assets/logs-page-B4vMUM7D.js +0 -2
  650. package/dist/gateway/static/root/assets/management-settings-Cg0UjJpy.js +0 -1
  651. package/dist/gateway/static/root/assets/messages-CRH2my19.js +0 -3
  652. package/dist/gateway/static/root/assets/note-detail-panel-CWVIGctd.js +0 -5
  653. package/dist/gateway/static/root/assets/notes-page-CcTzMI1K.js +0 -8
  654. package/dist/gateway/static/root/assets/product-delivery-CrAI8ZEa.js +0 -1
  655. package/dist/gateway/static/root/assets/project-detail-page-BNYoV9Ac.js +0 -1
  656. package/dist/gateway/static/root/assets/projects-page-CcKnYQqm.js +0 -1
  657. package/dist/gateway/static/root/assets/remote-access-hub-HIvwD5Xn.js +0 -1
  658. package/dist/gateway/static/root/assets/runtime-tools-settings-panel-CFE2oX_l.js +0 -5
  659. package/dist/gateway/static/root/assets/scenes-page-BGKdg4uS.js +0 -1
  660. package/dist/gateway/static/root/assets/schemas-BaskVM5g.js +0 -64
  661. package/dist/gateway/static/root/assets/sessions-page-tn99saMj.js +0 -1
  662. package/dist/gateway/static/root/assets/settings-advanced-gate-Cx_uvwqz.js +0 -1
  663. package/dist/gateway/static/root/assets/setup-status-panel-1kYYg3BH.js +0 -1
  664. package/dist/gateway/static/root/assets/shares-settings-Du7BfwId.js +0 -1
  665. package/dist/gateway/static/root/assets/skill-reload-api-BMhhXxRZ.js +0 -1
  666. package/dist/gateway/static/root/assets/task-detail-page-vFn3xdlZ.js +0 -1
  667. package/dist/gateway/static/root/assets/theme-store-DdURyZ1M.js +0 -1
  668. package/dist/gateway/static/root/assets/user-model-page-uK9sxPUH.js +0 -2
  669. package/dist/gateway/static/root/assets/workflows-page-DIyd5AC9.js +0 -6
  670. package/skills/creative/algorithmic-art/SKILL.md +0 -44
  671. package/skills/creative/algorithmic-art/templates/generator-template.js +0 -27
  672. package/skills/creative/algorithmic-art/templates/viewer.html +0 -27
@@ -2,19 +2,19 @@ import { voiceSelectionSchema } from "../../../../packages/realtime-protocol/src
2
2
  import { createVoiceSessionRequestSchema, init_voice } from "../../../../packages/realtime-protocol/src/voice.js";
3
3
  import { getDefaultModelSync, init_providers, resolveModel } from "../../../providers/index.js";
4
4
  import { completeWithResolvedCredentials } from "../../../providers/model-call.js";
5
- import { resolveTtsProviderConfigSlice } from "../../../voice/tts/config-slice.js";
6
- import { isTTSAvailable, resolveSpeechProvider } from "../../../voice/tts/factory.js";
7
- import { speak, speakStream } from "../../../voice/tts/speak-core.js";
8
- import { mergeTtsConfigFromAppConfig } from "../../../voice/tts/merge-config.js";
9
- import "../../../voice/tts/index.js";
10
5
  import { getLocalVoiceRuntimeClient } from "../../../voice/local/runtime-client.js";
11
6
  import { getAudioDecoderStatus } from "../../../voice/audio/normalize.js";
12
7
  import { resolveSttProviderConfigSlice } from "../../../voice/stt/config-slice.js";
13
- import { isSTTAvailable } from "../../../voice/stt/availability.js";
14
8
  import { STTTranscriptionError, transcribe } from "../../../voice/stt/transcribe-core.js";
9
+ import { isSTTAvailable } from "../../../voice/stt/availability.js";
15
10
  import { mergeSttConfigFromAppConfig } from "../../../voice/stt/config.js";
16
11
  import "../../../voice/stt/index.js";
12
+ import { resolveTtsProviderConfigSlice } from "../../../voice/tts/config-slice.js";
13
+ import { isTTSAvailable, resolveSpeechProvider } from "../../../voice/tts/factory.js";
14
+ import { speak, speakStream } from "../../../voice/tts/speak-core.js";
15
+ import { mergeTtsConfigFromAppConfig } from "../../../voice/tts/merge-config.js";
17
16
  import { listSttProvidersForApi } from "../../../voice/stt/list-providers.js";
17
+ import "../../../voice/tts/index.js";
18
18
  import { withModelConfigLock } from "../../../session/model-config-lock.js";
19
19
  import { resolveOmniRoute } from "../../../voice/realtime/omniRoute.js";
20
20
  import { VoiceSessionCreationError, resolveStreamingStt, resolveStreamingTts } from "../../../voice/realtime/runtime.js";
@@ -1,12 +1,12 @@
1
1
  import { init_agent_scope, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
2
- import { validateWorkflowDefinitionInput } from "../../../workflows/domain/validation.js";
3
- import { WorkflowNameConflictError, WorkflowRevisionConflictError, createWorkflowCatalog } from "../../../agent/workflow/catalog.js";
4
2
  import { resolveProjectAgentId } from "../../../projects/project-agent.js";
5
3
  import "../../../projects/index.js";
6
4
  import { messagesToClientHistory } from "../../../session/client-history.js";
5
+ import { validateWorkflowDefinitionInput } from "../../../workflows/domain/validation.js";
6
+ import { WorkflowDraftService } from "../../../workflows/draft/workflow-draft-service.js";
7
+ import { WorkflowNameConflictError, WorkflowRevisionConflictError, createWorkflowCatalog } from "../../../agent/workflow/catalog.js";
7
8
  import "../../../workflows/domain/index.js";
8
9
  import { resolveWorkflowRunArtifactsDir } from "../../../workflows/store/paths.js";
9
- import { WorkflowDraftService } from "../../../workflows/draft/workflow-draft-service.js";
10
10
  import { WorkflowDraftConflictError, WorkflowDraftStore } from "../../../workflows/authoring/workflow-draft-store.js";
11
11
  import "../../../workflows/authoring/index.js";
12
12
  import "../../../workflows/draft/index.js";
@@ -1,9 +1,9 @@
1
1
  import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
2
2
  import path from "node:path";
3
- import fsSync from "node:fs";
3
+ import fs from "node:fs";
4
4
  import { createHash } from "node:crypto";
5
5
  import net from "node:net";
6
- import fs from "node:fs/promises";
6
+ import fs$1 from "node:fs/promises";
7
7
  import { homedir } from "os";
8
8
  //#region src/gateway/lock.ts
9
9
  /**
@@ -19,7 +19,7 @@ function resolveGatewayLockPath(configPath) {
19
19
  function isGatewayConfigLockedByAnotherProcessSync(configPath, currentPid = process.pid) {
20
20
  const lockPath = resolveGatewayLockPath(configPath);
21
21
  try {
22
- const parsed = JSON.parse(fsSync.readFileSync(lockPath, "utf8"));
22
+ const parsed = JSON.parse(fs.readFileSync(lockPath, "utf8"));
23
23
  if (typeof parsed.pid !== "number" || parsed.pid === currentPid || parsed.configPath !== configPath) return false;
24
24
  if (!isPidAlive(parsed.pid)) return false;
25
25
  if (process.platform !== "linux" || !Number.isFinite(parsed.startTime)) return true;
@@ -59,7 +59,7 @@ function isPidAlive(pid) {
59
59
  function readLinuxStartTime(pid) {
60
60
  if (process.platform !== "linux") return null;
61
61
  try {
62
- const raw = fsSync.readFileSync(`/proc/${pid}/stat`, "utf8").trim();
62
+ const raw = fs.readFileSync(`/proc/${pid}/stat`, "utf8").trim();
63
63
  const closeParen = raw.lastIndexOf(")");
64
64
  if (closeParen < 0) return null;
65
65
  const fields = raw.slice(closeParen + 1).trim().split(/\s+/);
@@ -71,7 +71,7 @@ function readLinuxStartTime(pid) {
71
71
  }
72
72
  async function readLockPayload(lockPath) {
73
73
  try {
74
- const raw = await fs.readFile(lockPath, "utf8");
74
+ const raw = await fs$1.readFile(lockPath, "utf8");
75
75
  const parsed = JSON.parse(raw);
76
76
  if (typeof parsed.pid !== "number") return null;
77
77
  if (typeof parsed.createdAt !== "string") return null;
@@ -107,11 +107,11 @@ async function acquireGatewayLock(configPath, opts = {}) {
107
107
  const staleMs = opts.staleMs ?? DEFAULT_STALE_MS;
108
108
  const port = opts.port;
109
109
  const lockPath = resolveGatewayLockPath(configPath);
110
- await fs.mkdir(path.dirname(lockPath), { recursive: true });
110
+ await fs$1.mkdir(path.dirname(lockPath), { recursive: true });
111
111
  const startedAt = Date.now();
112
112
  let lastPayload = null;
113
113
  while (Date.now() - startedAt < timeoutMs) try {
114
- const handle = await fs.open(lockPath, "wx");
114
+ const handle = await fs$1.open(lockPath, "wx");
115
115
  const startTime = process.platform === "linux" ? readLinuxStartTime(process.pid) : null;
116
116
  const payload = {
117
117
  pid: process.pid,
@@ -126,7 +126,7 @@ async function acquireGatewayLock(configPath, opts = {}) {
126
126
  configPath,
127
127
  release: async () => {
128
128
  await handle.close().catch(() => void 0);
129
- await fs.rm(lockPath, { force: true });
129
+ await fs$1.rm(lockPath, { force: true });
130
130
  console.log(`[GatewayLock] Lock released: lockPath=${lockPath}`);
131
131
  }
132
132
  };
@@ -137,7 +137,7 @@ async function acquireGatewayLock(configPath, opts = {}) {
137
137
  const ownerStatus = ownerPid ? await resolveOwnerStatus(ownerPid, lastPayload, port) : "unknown";
138
138
  if (ownerStatus === "dead" && ownerPid) {
139
139
  console.warn(`[GatewayLock] Cleaning up stale gateway lock: pid=${ownerPid}`);
140
- await fs.rm(lockPath, { force: true });
140
+ await fs$1.rm(lockPath, { force: true });
141
141
  continue;
142
142
  }
143
143
  if (ownerStatus !== "alive") {
@@ -147,14 +147,14 @@ async function acquireGatewayLock(configPath, opts = {}) {
147
147
  stale = Number.isFinite(createdAt) ? Date.now() - createdAt > staleMs : false;
148
148
  }
149
149
  if (!stale) try {
150
- const st = await fs.stat(lockPath);
150
+ const st = await fs$1.stat(lockPath);
151
151
  stale = Date.now() - st.mtimeMs > staleMs;
152
152
  } catch {
153
153
  stale = false;
154
154
  }
155
155
  if (stale) {
156
156
  console.warn(`[GatewayLock] Removing stale lock file: lockPath=${lockPath}`);
157
- await fs.rm(lockPath, { force: true });
157
+ await fs$1.rm(lockPath, { force: true });
158
158
  continue;
159
159
  }
160
160
  }
@@ -1,10 +1,11 @@
1
- import { TaskContextRepository } from "../tasks/task-context-repository.js";
2
- import { TaskRepository } from "../tasks/task-repository.js";
1
+ import { TaskRepository, init_task_repository } from "../tasks/task-repository.js";
3
2
  import { FileServiceError } from "../files/file-service.js";
4
3
  import { resolveMediaReference } from "../media/media-reference.js";
5
4
  import { pendingTranscriptReferencesMediaUri } from "../agent/inbound/attachment-pipeline.js";
5
+ import { TaskContextRepository } from "../tasks/task-context-repository.js";
6
6
  import { messagesReferenceMediaUri } from "../media/session-references.js";
7
7
  //#region src/gateway/media-access.ts
8
+ init_task_repository();
8
9
  /** Resolve media only when the supplied session or task references it. */
9
10
  async function resolveScopedMediaReference(service, uri, scope) {
10
11
  const { conversationId, taskId } = scope;
@@ -1,9 +1,9 @@
1
1
  import { getProviderRegistry, init_plugin_registry } from "../providers/plugin-registry.js";
2
2
  import { PROVIDER_META, getAvailableModels, init_providers } from "../providers/index.js";
3
- import { resolveSpeechProviderChain } from "../voice/tts/factory.js";
4
- import { mergeTtsConfigFromAppConfig } from "../voice/tts/merge-config.js";
5
3
  import { resolveSTTProviderChain } from "../voice/stt/factory.js";
6
4
  import { mergeSttConfigFromAppConfig } from "../voice/stt/config.js";
5
+ import { resolveSpeechProviderChain } from "../voice/tts/factory.js";
6
+ import { mergeTtsConfigFromAppConfig } from "../voice/tts/merge-config.js";
7
7
  import { getVoiceProviderMetadata } from "../voice/metadata/registry.js";
8
8
  import "../voice/metadata/index.js";
9
9
  import { getImageGenerationCatalog } from "./image-generation-setup.js";
@@ -1,6 +1,6 @@
1
1
  import { createLogger } from "../utils/logger/index.js";
2
2
  import { init_logger } from "../utils/logger.js";
3
- import fsSync from "node:fs";
3
+ import fs from "node:fs";
4
4
  import { execFileSync } from "node:child_process";
5
5
  import net from "node:net";
6
6
  //#region src/gateway/ports.ts
@@ -54,7 +54,7 @@ function listPortListenersViaProc(port) {
54
54
  for (const procFile of ["/proc/net/tcp", "/proc/net/tcp6"]) {
55
55
  let content;
56
56
  try {
57
- content = fsSync.readFileSync(procFile, "utf-8");
57
+ content = fs.readFileSync(procFile, "utf-8");
58
58
  } catch {
59
59
  continue;
60
60
  }
@@ -68,7 +68,7 @@ function listPortListenersViaProc(port) {
68
68
  if (inodeSet.size === 0) return results;
69
69
  let pidDirs;
70
70
  try {
71
- pidDirs = fsSync.readdirSync("/proc").filter((name) => /^\d+$/.test(name));
71
+ pidDirs = fs.readdirSync("/proc").filter((name) => /^\d+$/.test(name));
72
72
  } catch {
73
73
  return results;
74
74
  }
@@ -76,14 +76,14 @@ function listPortListenersViaProc(port) {
76
76
  const fdDir = `/proc/${pidStr}/fd`;
77
77
  let fds;
78
78
  try {
79
- fds = fsSync.readdirSync(fdDir);
79
+ fds = fs.readdirSync(fdDir);
80
80
  } catch {
81
81
  continue;
82
82
  }
83
83
  for (const fd of fds) {
84
84
  let target;
85
85
  try {
86
- target = fsSync.readlinkSync(`${fdDir}/${fd}`);
86
+ target = fs.readlinkSync(`${fdDir}/${fd}`);
87
87
  } catch {
88
88
  continue;
89
89
  }
@@ -93,7 +93,7 @@ function listPortListenersViaProc(port) {
93
93
  if (!results.some((p) => p.pid === pid)) {
94
94
  let command;
95
95
  try {
96
- command = fsSync.readFileSync(`/proc/${pidStr}/comm`, "utf-8").trim();
96
+ command = fs.readFileSync(`/proc/${pidStr}/comm`, "utf-8").trim();
97
97
  } catch {}
98
98
  results.push({
99
99
  pid,
@@ -2,8 +2,9 @@ import { createLogger } from "../../utils/logger/index.js";
2
2
  import { init_logger } from "../../utils/logger.js";
3
3
  import { assertSceneStorageReady, init_scenes_schema } from "../../storage/sqlite/scenes-schema.js";
4
4
  import { init_providers, isProviderConfiguredSync, resolveModel } from "../../providers/index.js";
5
- import { BrowserSubscriptionService } from "../../notifications/browserSubscriptions.js";
6
5
  import { SceneRepository } from "../../scenes/repository.js";
6
+ import { SceneApplicationService } from "../../scenes/service.js";
7
+ import { BrowserSubscriptionService } from "../../notifications/browserSubscriptions.js";
7
8
  import { ScenePreferenceService } from "../../scenes/preferences.js";
8
9
  import { SceneExecutionService } from "../../scenes/execution.js";
9
10
  import { SceneAgentExecutor } from "../../scenes/agentExecutor.js";
@@ -14,11 +15,13 @@ import { SceneMetrics } from "../../scenes/metrics.js";
14
15
  import { resolveSceneModelRef } from "../../scenes/model.js";
15
16
  import { SceneResultNotifications } from "../../scenes/resultNotifications.js";
16
17
  import { SceneRuntime } from "../../scenes/runtime.js";
17
- import { SceneApplicationService } from "../../scenes/service.js";
18
18
  import { familyPlanTemplate, mailFollowUpTemplate } from "../../scenes/templates.js";
19
19
  import { SceneUserNotesProvider } from "../../scenes/userNotes.js";
20
20
  import { createSceneBrowserDispatcher } from "./browserNotifications.js";
21
21
  import { GatewaySceneMailContext } from "./mailContext.js";
22
+ import { SlackThreadSource } from "./slackThreadSource.js";
23
+ import { TaskSourceRegistry } from "../../scenes/taskFollowUp/contracts.js";
24
+ import { TaskFollowUpService } from "../../scenes/taskFollowUp/service.js";
22
25
  //#region src/gateway/scenes/host.ts
23
26
  init_providers();
24
27
  init_scenes_schema();
@@ -61,7 +64,13 @@ var GatewaySceneHost = class {
61
64
  };
62
65
  const grant = async (activation) => authorize(activation);
63
66
  const executor = input.executor ?? new SceneAgentExecutor(() => resolveModel(resolveSceneModelRef(input.config())));
67
+ const slackThread = new SlackThreadSource(db);
68
+ const followUps = new TaskFollowUpService(db, {
69
+ config: input.config,
70
+ sources: new TaskSourceRegistry([slackThread])
71
+ });
64
72
  this.http = {
73
+ followUps,
65
74
  repository,
66
75
  mail,
67
76
  mailDiscovery: mail instanceof GatewaySceneMailContext ? mail : void 0,
@@ -90,6 +99,7 @@ var GatewaySceneHost = class {
90
99
  assertSceneStorageReady(this.db);
91
100
  this.runtime.start();
92
101
  const poll = () => {
102
+ this.http.followUps?.tick().catch((err) => log.error({ err }, "Task follow-up check failed"));
93
103
  try {
94
104
  if (this.clock() >= this.nextMaintenanceAt) {
95
105
  maintainSceneStorage(this.db, this.clock());
@@ -108,7 +118,7 @@ var GatewaySceneHost = class {
108
118
  tick() {
109
119
  if (this.stopped) return Promise.reject(/* @__PURE__ */ new Error("Scene host stopped"));
110
120
  if (this.active) return this.active;
111
- const work = this.runtime.tick().then(() => {
121
+ const work = Promise.all([this.runtime.tick(), this.http.followUps?.tick()]).then(() => {
112
122
  if (!this.stopped) this.notifications.drain();
113
123
  });
114
124
  this.active = work.finally(() => {
@@ -121,6 +131,7 @@ var GatewaySceneHost = class {
121
131
  this.stopped = true;
122
132
  if (this.timer) clearInterval(this.timer);
123
133
  this.timer = void 0;
134
+ await this.http.followUps?.stop();
124
135
  await this.runtime.stop();
125
136
  await this.browserDispatcher.stop();
126
137
  await this.active?.catch(() => void 0);
@@ -1,9 +1,9 @@
1
1
  import { getConnectorConnection, getConnectorInstallation, init_connector_repository } from "../../storage/sqlite/connector-repository.js";
2
2
  import { ComposioSessionsAdapter } from "../../connectors/composio-sessions.js";
3
3
  import { getConnectorDefinition } from "../../connectors/catalog.js";
4
+ import { sceneContentHash } from "../../scenes/contracts.js";
4
5
  import { normalizeConnectedSourceResult } from "../../connectors/connected-source-normalizers.js";
5
6
  import { sanitizeConnectedSourceValue } from "../../connectors/connected-source-sanitization.js";
6
- import { sceneContentHash } from "../../scenes/contracts.js";
7
7
  import { SceneSourceNotReady, sceneSourceFailureReason } from "../../scenes/readiness.js";
8
8
  import { SceneMailContextProvider } from "../../scenes/mailContext.js";
9
9
  import { createHash } from "node:crypto";
@@ -0,0 +1,41 @@
1
+ import type { DatabaseSync } from 'node:sqlite';
2
+ import { z } from 'zod';
3
+ import { ComposioSessionsAdapter } from '../../connectors/composio-sessions.js';
4
+ import { type ScenePrincipal } from '../../scenes/contracts.js';
5
+ import type { TaskSourceAdapter, SourceSnapshot } from '../../scenes/taskFollowUp/contracts.js';
6
+ export declare const slackThreadSchema: z.ZodObject<{
7
+ accountId: z.ZodString;
8
+ teamId: z.ZodString;
9
+ channelId: z.ZodString;
10
+ threadTs: z.ZodString;
11
+ }, z.core.$strict>;
12
+ export type SlackThread = z.infer<typeof slackThreadSchema>;
13
+ /** Parse locally; never fetch a user-supplied URL. Reply links resolve to their root. */
14
+ export declare function parseSlackThreadUrl(value: string): {
15
+ channelId: string;
16
+ threadTs: string;
17
+ };
18
+ /** Read-only connector adapter. Account policy is rechecked before and after every page. */
19
+ export declare class SlackThreadSource implements TaskSourceAdapter {
20
+ private readonly db;
21
+ private readonly adapter;
22
+ readonly id = "slack_thread";
23
+ readonly label = "Slack thread";
24
+ normalize(reference: Record<string, string>): {
25
+ accountId: string;
26
+ teamId: string;
27
+ channelId: string;
28
+ threadTs: string;
29
+ };
30
+ accountIds(reference: Record<string, string>): string[];
31
+ authorized(principal: ScenePrincipal, reference: Record<string, string>): boolean;
32
+ constructor(db: DatabaseSync, adapter?: Pick<ComposioSessionsAdapter, 'executeWithPolicy'>);
33
+ listAccounts(principal: ScenePrincipal): Array<{
34
+ id: string;
35
+ label: string;
36
+ }>;
37
+ private connection;
38
+ private call;
39
+ resolveLink(principal: ScenePrincipal, accountId: string, url: string, signal: AbortSignal): Promise<SlackThread>;
40
+ read(principal: ScenePrincipal, reference: Record<string, string>, signal: AbortSignal): Promise<SourceSnapshot>;
41
+ }
@@ -0,0 +1,168 @@
1
+ import { getConnectorConnection, getConnectorInstallation, init_connector_repository } from "../../storage/sqlite/connector-repository.js";
2
+ import { ComposioSessionsAdapter } from "../../connectors/composio-sessions.js";
3
+ import { getConnectorDefinition } from "../../connectors/catalog.js";
4
+ import { sceneContentHash } from "../../scenes/contracts.js";
5
+ import { sanitizeConnectedSourceValue } from "../../connectors/connected-source-sanitization.js";
6
+ import { z } from "zod";
7
+ //#region src/gateway/scenes/slackThreadSource.ts
8
+ init_connector_repository();
9
+ const slackThreadSchema = z.strictObject({
10
+ accountId: z.string().min(1).max(200),
11
+ teamId: z.string().regex(/^T[A-Z0-9]+$/),
12
+ channelId: z.string().regex(/^[CDG][A-Z0-9]+$/),
13
+ threadTs: z.string().regex(/^\d{10,}\.\d{6}$/)
14
+ });
15
+ /** Parse locally; never fetch a user-supplied URL. Reply links resolve to their root. */
16
+ function parseSlackThreadUrl(value) {
17
+ const url = new URL(value);
18
+ if (url.protocol !== "https:" || !/^[a-z0-9-]+\.slack\.com$/.test(url.hostname) || url.username || url.password || url.port) throw new Error("Expected a Slack message link");
19
+ const match = /^\/archives\/([CDG][A-Z0-9]+)\/p(\d{16,})$/.exec(url.pathname);
20
+ if (!match) throw new Error("Expected a Slack message link");
21
+ const threadTs = url.searchParams.get("thread_ts") ?? `${match[2].slice(0, -6)}.${match[2].slice(-6)}`;
22
+ if (!/^\d{10,}\.\d{6}$/.test(threadTs)) throw new Error("Invalid Slack thread timestamp");
23
+ return {
24
+ channelId: match[1],
25
+ threadTs
26
+ };
27
+ }
28
+ const object = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
29
+ /** Read-only connector adapter. Account policy is rechecked before and after every page. */
30
+ var SlackThreadSource = class {
31
+ id = "slack_thread";
32
+ label = "Slack thread";
33
+ normalize(reference) {
34
+ return slackThreadSchema.parse(reference);
35
+ }
36
+ accountIds(reference) {
37
+ return [this.normalize(reference).accountId];
38
+ }
39
+ authorized(principal, reference) {
40
+ return this.listAccounts(principal).some((account) => account.id === this.normalize(reference).accountId);
41
+ }
42
+ constructor(db, adapter = new ComposioSessionsAdapter()) {
43
+ this.db = db;
44
+ this.adapter = adapter;
45
+ }
46
+ listAccounts(principal) {
47
+ return this.db.prepare(`SELECT a.id, a.label, c.connector_id FROM connector_accounts a
48
+ JOIN connector_connections c ON c.id = a.current_connection_id AND c.account_id = a.id
49
+ AND c.principal_id = a.principal_id AND c.connector_id = a.connector_id
50
+ JOIN connector_installations i ON i.id = c.installation_id AND i.principal_id = a.principal_id AND i.connector_id = a.connector_id
51
+ WHERE a.principal_id = ? AND a.enabled = 1 AND c.status = 'active' AND c.provider = 'composio'
52
+ AND i.enabled = 1 AND i.confirmation_policy <> 'always'
53
+ AND json_array_length(i.allowed_agent_ids_json) = 0 AND a.allowed_agent_ids_json IS NULL
54
+ AND (i.selected_account_ids_json = 'null' OR EXISTS (SELECT 1 FROM json_each(i.selected_account_ids_json) WHERE value = a.id))
55
+ AND (c.expires_at IS NULL OR julianday(c.expires_at) > julianday('now')) ORDER BY a.id LIMIT 100`).all(principal.ownerId).filter((row) => {
56
+ const definition = getConnectorDefinition(String(row.connector_id));
57
+ return definition?.runtime.type === "composio" && definition.runtime.toolkit === "slack";
58
+ }).map((row) => ({
59
+ id: String(row.id),
60
+ label: String(row.label || row.id).slice(0, 300)
61
+ }));
62
+ }
63
+ connection(principal, accountId) {
64
+ if (!this.listAccounts(principal).some((account) => account.id === accountId)) throw new Error("Slack account permission unavailable");
65
+ const row = this.db.prepare("SELECT current_connection_id FROM connector_accounts WHERE id = ?").get(accountId);
66
+ return getConnectorConnection(String(row.current_connection_id));
67
+ }
68
+ async call(principal, accountId, actionId, args, signal) {
69
+ signal.throwIfAborted();
70
+ const connection = this.connection(principal, accountId);
71
+ const installation = getConnectorInstallation(connection.installationId);
72
+ const day = Math.floor(Date.now() / 864e5);
73
+ const usage = this.db.prepare("SELECT request_count FROM scene_connector_usage WHERE owner_id = ? AND workspace_id = ? AND account_id = ? AND utc_day = ?").get(principal.ownerId, principal.workspaceId, accountId, day);
74
+ if (Number(usage?.request_count ?? 0) >= 3e3) throw new Error("Slack daily request budget exhausted");
75
+ this.db.prepare(`INSERT INTO scene_connector_usage VALUES (?, ?, ?, ?, 1)
76
+ ON CONFLICT(owner_id, workspace_id, account_id, utc_day) DO UPDATE SET request_count = request_count + 1`).run(principal.ownerId, principal.workspaceId, accountId, day);
77
+ const result = await this.adapter.executeWithPolicy({
78
+ context: {
79
+ principalId: principal.ownerId,
80
+ toolkits: ["slack"]
81
+ },
82
+ connection,
83
+ installation,
84
+ signal,
85
+ args,
86
+ action: {
87
+ connectorId: connection.connectorId,
88
+ toolkit: "slack",
89
+ actionId,
90
+ scope: "read",
91
+ curated: true,
92
+ cachedAt: (/* @__PURE__ */ new Date()).toISOString()
93
+ }
94
+ });
95
+ signal.throwIfAborted();
96
+ if (this.connection(principal, accountId).id !== connection.id) throw new Error("Slack connection changed");
97
+ if (result.decision !== "allowed") throw new Error("Slack read requires permission");
98
+ const envelope = object(result.result);
99
+ const data = object(envelope.data);
100
+ if (envelope.successful === false || envelope.error || data.ok === false || data.error || !Object.keys(data).length) throw new Error("Slack source unavailable; check connection permissions or rate limit");
101
+ return data;
102
+ }
103
+ async resolveLink(principal, accountId, url, signal) {
104
+ const parsed = parseSlackThreadUrl(url);
105
+ const auth = await this.call(principal, accountId, "SLACK_TEST_AUTH", {}, signal);
106
+ if (typeof auth.team_id !== "string" || !/^T[A-Z0-9]+$/.test(auth.team_id)) throw new Error("Slack workspace identity unavailable");
107
+ return {
108
+ accountId,
109
+ teamId: auth.team_id,
110
+ ...parsed
111
+ };
112
+ }
113
+ async read(principal, reference, signal) {
114
+ const thread = this.normalize(reference);
115
+ if ((await this.call(principal, thread.accountId, "SLACK_TEST_AUTH", {}, signal)).team_id !== thread.teamId) throw new Error("Slack workspace identity changed");
116
+ const messages = /* @__PURE__ */ new Map();
117
+ const cursors = /* @__PURE__ */ new Set();
118
+ let cursor;
119
+ do {
120
+ const data = await this.call(principal, thread.accountId, "SLACK_FETCH_MESSAGE_THREAD_FROM_A_CONVERSATION", {
121
+ channel: thread.channelId,
122
+ ts: thread.threadTs,
123
+ limit: 100,
124
+ ...cursor ? { cursor } : {}
125
+ }, signal);
126
+ if (!Array.isArray(data.messages) || !data.messages.length) throw new Error("Slack thread is missing or incomplete");
127
+ for (const item of data.messages) {
128
+ const message = object(item);
129
+ if (typeof message.ts !== "string" || typeof message.text !== "string" || message.ts !== thread.threadTs && message.thread_ts !== thread.threadTs) throw new Error("Unexpected Slack thread response");
130
+ messages.set(message.ts, {
131
+ ts: message.ts,
132
+ user: String(message.user ?? message.bot_id ?? "unknown"),
133
+ text: String(sanitizeConnectedSourceValue(message.text)),
134
+ ...Array.isArray(message.files) && message.files.length || Array.isArray(message.attachments) && message.attachments.length ? { unreadAttachments: sanitizeConnectedSourceValue({
135
+ files: Array.isArray(message.files) ? message.files.slice(0, 20).map((value) => {
136
+ const file = object(value);
137
+ return {
138
+ id: file.id,
139
+ name: file.name,
140
+ mimetype: file.mimetype
141
+ };
142
+ }) : [],
143
+ richMessageCount: Array.isArray(message.attachments) ? message.attachments.length : 0,
144
+ contentFetched: false
145
+ }) } : {}
146
+ });
147
+ }
148
+ if (messages.size > 200) throw new Error("Slack thread exceeds the 200-message context budget");
149
+ const next = object(data.response_metadata).next_cursor;
150
+ if (next != null && typeof next !== "string") throw new Error("Invalid Slack pagination");
151
+ cursor = typeof next === "string" && next.trim() ? next.trim() : void 0;
152
+ if (data.has_more === true && !cursor) throw new Error("Slack thread pagination is incomplete");
153
+ if (cursor && (cursors.has(cursor) || cursors.size >= 9)) throw new Error("Slack pagination budget exceeded");
154
+ if (cursor) cursors.add(cursor);
155
+ } while (cursor);
156
+ if (!messages.has(thread.threadTs)) throw new Error("Select the root of the Slack thread");
157
+ const ordered = [...messages.values()].sort((a, b) => a.ts.localeCompare(b.ts));
158
+ const text = JSON.stringify(ordered);
159
+ if (text.length > 32e3) throw new Error("Slack thread exceeds the 32,000-character context budget");
160
+ return {
161
+ revision: sceneContentHash(ordered),
162
+ text,
163
+ observedAt: Date.now()
164
+ };
165
+ }
166
+ };
167
+ //#endregion
168
+ export { SlackThreadSource, parseSlackThreadUrl, slackThreadSchema };
@@ -1,5 +1,5 @@
1
1
  import { DEFAULT_BROWSER_EXTENSION_SCOPES, DEFAULT_MOBILE_SCOPES, GATEWAY_SCOPES, isGatewayScope, type GatewayScope } from '@xopcai/gateway-contract';
2
2
  export { DEFAULT_BROWSER_EXTENSION_SCOPES, DEFAULT_MOBILE_SCOPES, GATEWAY_SCOPES, isGatewayScope, type GatewayScope, };
3
3
  export declare function parseGatewayScopes(value: string): GatewayScope[];
4
- export declare function requiredGatewayScope(method: string, path: string): GatewayScope;
4
+ export declare function requiredGatewayScope(method: string, path: string): GatewayScope | undefined;
5
5
  export declare function hasGatewayScope(granted: readonly GatewayScope[], required: GatewayScope): boolean;
@@ -11,6 +11,8 @@ function methodScope(method, read, write) {
11
11
  return method === "GET" ? read : write;
12
12
  }
13
13
  function requiredGatewayScope(method, path) {
14
+ if (/^\/api\/local-app-capabilities\/[^/]+(?:\/[^/]+\/invocations)?$/.test(path)) return void 0;
15
+ if (path === "/api/capabilities/operations" || path.startsWith("/api/capabilities/operations/")) return void 0;
14
16
  if (method === "GET" && path === "/api/mobile/privacy") return "gateway.status";
15
17
  if (path === "/api/realtime/tickets" || path.startsWith("/api/status")) return "gateway.status";
16
18
  if (path === "/api/device-auth/refresh" || path === "/api/devices/me") return "device.self";
@@ -23,7 +25,10 @@ function requiredGatewayScope(method, path) {
23
25
  if (path.startsWith("/api/agents") || path.startsWith("/api/models")) return methodScope(method, "agents.read", "gateway.admin");
24
26
  if (path.startsWith("/api/sessions") || path.startsWith("/api/side-chats")) return methodScope(method, "sessions.read", "sessions.write");
25
27
  if (path.startsWith("/api/tasks")) return methodScope(method, "tasks.read", "tasks.write");
28
+ if (path === "/api/task-runs" || path.startsWith("/api/task-runs/")) return methodScope(method, "tasks.read", "tasks.write");
26
29
  if (path.startsWith("/api/home") || path.startsWith("/api/inbox")) return methodScope(method, "tasks.read", "tasks.write");
30
+ if (method === "POST" && path === "/api/automations/simulate") return "automations.read";
31
+ if (method === "POST" && /^\/api\/notes\/[^/]+\/ai\/edit$/.test(path)) return "workspace.read";
27
32
  if (path.startsWith("/api/automations") || path.startsWith("/api/automation-runs")) return methodScope(method, "automations.read", "automations.write");
28
33
  if (path.startsWith("/api/workflows")) return methodScope(method, "automations.read", "automations.write");
29
34
  if (path === "/api/voice/selection" || path === "/api/voice/catalog/refresh") return "voice.configure";
@@ -1,5 +1,5 @@
1
- import { ensureXopcCliOnPath } from "../infra/path-env.js";
2
1
  import { resolveGatewayBindHost, resolveGatewayListenHosts } from "../config/gateway-bind.js";
2
+ import { ensureXopcCliOnPath } from "../infra/path-env.js";
3
3
  import { resolveGatewayListenPlan } from "./listen.js";
4
4
  import { GatewayService } from "./service.js";
5
5
  import { handleSiteShareUpgrade } from "../share/site-share-router.js";
@@ -0,0 +1,11 @@
1
+ import type { AgentSourceContext } from '../../agent/source-context/types.js';
2
+ import { type CapabilityDispatcher } from '../../capabilities/runtime/dispatcher.js';
3
+ import type { ResolvedGatewayAuth } from '../auth.js';
4
+ import type { GatewayPrincipal } from '../security/gateway-principal.js';
5
+ export interface AppContextGrant {
6
+ principal: GatewayPrincipal;
7
+ authRevision: string;
8
+ }
9
+ /** A queued read retains its original scope ceiling, but never a revoked identity. */
10
+ export declare function checkAppContextAccess(source: AgentSourceContext, dispatcher: CapabilityDispatcher, auth: ResolvedGatewayAuth): Promise<void>;
11
+ export declare function prepareAppContext(input: unknown, principal: GatewayPrincipal, auth: ResolvedGatewayAuth, dispatcher: CapabilityDispatcher, previous?: AgentSourceContext): Promise<AgentSourceContext>;
@@ -0,0 +1,70 @@
1
+ import { parseAppContextEnvelope } from "../../../packages/gateway-contract/src/app-context.js";
2
+ import { init_src } from "../../../packages/gateway-contract/src/index.js";
3
+ import { getDevice } from "../../storage/sqlite/device-access-repository.js";
4
+ import { CapabilityError } from "../../capabilities/runtime/errors.js";
5
+ import { canonicalCapabilityJson } from "../../capabilities/runtime/dispatcher.js";
6
+ import { isBrowserSessionActive } from "../../storage/sqlite/browser-session-repository.js";
7
+ import { appContextToAgentContext } from "../../agent/source-context/app-context.js";
8
+ import { createHmac, randomBytes } from "node:crypto";
9
+ //#region src/gateway/service/app-context-access.ts
10
+ init_src();
11
+ const authorizationEpochKey = randomBytes(32);
12
+ function authRevision(auth) {
13
+ return createHmac("sha256", authorizationEpochKey).update(canonicalCapabilityJson(JSON.parse(JSON.stringify(auth)))).digest("hex");
14
+ }
15
+ /** A queued read retains its original scope ceiling, but never a revoked identity. */
16
+ async function checkAppContextAccess(source, dispatcher, auth) {
17
+ const grant = source.appContextGrant;
18
+ if (!grant || grant.authRevision !== authRevision(auth) || !source.appContext) throw new CapabilityError("FORBIDDEN", "Application context authorization changed");
19
+ const { principal } = grant;
20
+ let scopes = principal.scopes;
21
+ if (principal.kind === "device") {
22
+ const device = principal.deviceId ? getDevice(principal.deviceId) : void 0;
23
+ if (!device || device.revokedAt !== void 0 || device.id !== principal.principalId) throw new CapabilityError("FORBIDDEN", "Application context device access was revoked");
24
+ scopes = scopes.filter((scope) => device.scopes.includes(scope));
25
+ }
26
+ if (principal.browserSessionId && !isBrowserSessionActive(principal.browserSessionId, auth)) throw new CapabilityError("FORBIDDEN", "Application context browser session ended");
27
+ for (const ref of source.appContext.resourceRefs) {
28
+ const domain = ref.kind === "local_app" ? "local_apps" : `${ref.kind}s`;
29
+ await dispatcher.call(`xopc.${domain}.get`, { id: ref.id }, {
30
+ principalId: principal.principalId,
31
+ scopes,
32
+ surface: "http",
33
+ authorize: () => true
34
+ });
35
+ }
36
+ }
37
+ async function prepareAppContext(input, principal, auth, dispatcher, previous) {
38
+ let snapshot;
39
+ try {
40
+ snapshot = parseAppContextEnvelope(input);
41
+ } catch {
42
+ throw new CapabilityError("INVALID_INPUT", "Invalid application context envelope");
43
+ }
44
+ const grant = {
45
+ principal: structuredClone(principal),
46
+ authRevision: authRevision(auth)
47
+ };
48
+ if (previous) {
49
+ if (canonicalCapabilityJson(previous.appContext) !== canonicalCapabilityJson(snapshot) || previous.appContextGrant?.principal.principalId !== principal.principalId) throw new CapabilityError("REVISION_CONFLICT", "Submission identity already belongs to another context");
50
+ await checkAppContextAccess(previous, dispatcher, auth);
51
+ await checkAppContextAccess({
52
+ ...previous,
53
+ appContextGrant: grant
54
+ }, dispatcher, auth);
55
+ return structuredClone(previous);
56
+ }
57
+ const source = {
58
+ ...appContextToAgentContext(await dispatcher.call("xopc.context.resolve", snapshot, {
59
+ principalId: principal.principalId,
60
+ scopes: principal.scopes,
61
+ surface: "http",
62
+ authorize: () => true
63
+ })),
64
+ appContextGrant: grant
65
+ };
66
+ await checkAppContextAccess(source, dispatcher, auth);
67
+ return source;
68
+ }
69
+ //#endregion
70
+ export { checkAppContextAccess, prepareAppContext };
@@ -1,15 +1,15 @@
1
1
  import { createLogger } from "../../utils/logger/index.js";
2
2
  import { init_logger } from "../../utils/logger.js";
3
- import { getModelRegistry } from "../../providers/model-registry.js";
4
3
  import { loadConfig, saveConfig } from "../../config/loader.js";
4
+ import { getModelRegistry } from "../../providers/model-registry.js";
5
5
  import { init_providers } from "../../providers/index.js";
6
+ import { disposeAllSessionMcpRuntimes } from "../../agent/mcp/bundle-mcp-runtime.js";
7
+ import { reloadImageGenerationProviders } from "../../agent/image/generation/provider-registry.js";
8
+ import "../../agent/mcp/bundle-mcp-tools.js";
6
9
  import { ConfigHotReloader } from "../../config/reload.js";
7
10
  import "../../config/index.js";
8
11
  import { validateComputerModelChanges } from "../../computer/model-config.js";
9
- import { disposeAllSessionMcpRuntimes } from "../../agent/mcp/bundle-mcp-runtime.js";
10
12
  import { computeBundledExtensionExtensionsPatch } from "../../extensions/bundled-extension-activation.js";
11
- import { reloadImageGenerationProviders } from "../../agent/image/generation/provider-registry.js";
12
- import "../../agent/mcp/bundle-mcp-tools.js";
13
13
  import { sanitizeTunnelConfig } from "../../tunnel/tunnel-config.js";
14
14
  //#region src/gateway/service/config-coordinator.ts
15
15
  init_providers();