@xopcai/xopc 0.0.321 → 0.0.324

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 (709) hide show
  1. package/dist/browser-ext/dist/assets/{auth-DKo-NMUY.js → auth-DocRzRlS.js} +95 -21
  2. package/dist/browser-ext/dist/background.js +1 -1
  3. package/dist/browser-ext/dist/sidepanel.html +1 -1
  4. package/dist/browser-ext/dist/sidepanel.js +18 -2
  5. package/dist/browser-ext/manifest.json +1 -1
  6. package/dist/extensions/telegram/xopc.extension.json +1 -1
  7. package/dist/extensions/weixin/src/plugin.js +1 -9
  8. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-C69p1Gbr.js → agent-avatar-dicebear-B-Gczr_A.js} +1 -1
  9. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CxcIHW_Z.js +1 -0
  10. package/dist/gateway/static/root/assets/agent-plugin-dialog-CNuqJcHQ.js +1 -0
  11. package/dist/gateway/static/root/assets/{agents-CWR3p3t3.js → agents-CPpmkx7O.js} +1 -1
  12. package/dist/gateway/static/root/assets/{app-link-nL8iPwEr.js → app-link-C6gA5Nck.js} +1 -1
  13. package/dist/gateway/static/root/assets/{app-management-settings-panel-D98bt40S.js → app-management-settings-panel-BwWdVRlb.js} +1 -1
  14. package/dist/gateway/static/root/assets/{appearance-settings-ChMUELAZ.js → appearance-settings-EoXNDO1j.js} +1 -1
  15. package/dist/gateway/static/root/assets/apps-page-6xEgLDv8.js +1 -0
  16. package/dist/gateway/static/root/assets/{archive-plugin-BIIiu6uP.js → archive-plugin-B_T0uMvL.js} +1 -1
  17. package/dist/gateway/static/root/assets/{attachment-load-CDJpcsCp.js → attachment-load-D9DDwxd2.js} +1 -1
  18. package/dist/gateway/static/root/assets/{automations-page-Cb5a_WOk.js → automations-page-jI9vNr2r.js} +1 -1
  19. package/dist/gateway/static/root/assets/automations-workspace-rztQnZDk.js +7 -0
  20. package/dist/gateway/static/root/assets/{binary-plugins-zp55zQPu.js → binary-plugins-Dzsxh9OL.js} +1 -1
  21. package/dist/gateway/static/root/assets/{block-editor-B0CTIZb-.js → block-editor-CWUUgWWk.js} +3 -3
  22. package/dist/gateway/static/root/assets/{browser-automation-inputs-Bx3W4J4H.js → browser-automation-inputs-DSWXq9lI.js} +1 -1
  23. package/dist/gateway/static/root/assets/{browser-automations-page-D5Lr9b8a.js → browser-automations-page-D96o3bDY.js} +2 -2
  24. package/dist/gateway/static/root/assets/browser-settings-page-DUQzQ3ic.js +3 -0
  25. package/dist/gateway/static/root/assets/capabilities-sAZT4brT.js +1 -0
  26. package/dist/gateway/static/root/assets/capabilities-settings-panel-CKWtXof8.js +8 -0
  27. package/dist/gateway/static/root/assets/channels-settings-C8ducWB7.js +1 -0
  28. package/dist/gateway/static/root/assets/{chat-terminal-dock-1I1PdIq0.js → chat-terminal-dock-WXZrEB3K.js} +2 -2
  29. package/dist/gateway/static/root/assets/{computer-settings-page-BT-EfoI6.js → computer-settings-page-uy9YDwxJ.js} +1 -1
  30. package/dist/gateway/static/root/assets/{connector-service-page-mhQ-19tj.js → connector-service-page-BpF0SjB9.js} +1 -1
  31. package/dist/gateway/static/root/assets/connectors-page-eZTfIMWI.js +2 -0
  32. package/dist/gateway/static/root/assets/date-picker-Do1dl0La.js +1 -0
  33. package/dist/gateway/static/root/assets/{dependency-picker-DLDLJx3D.js → dependency-picker-BhS8s080.js} +1 -1
  34. package/dist/gateway/static/root/assets/{desktop-pet-kSFeHyrt.js → desktop-pet-DPVPqFlh.js} +1 -1
  35. package/dist/gateway/static/root/assets/{desktop-pet-settings-BjY7DqD7.js → desktop-pet-settings-Dv3vG9HZ.js} +1 -1
  36. package/dist/gateway/static/root/assets/device-pairing-wizard-DdvO1O6W.js +1 -0
  37. package/dist/gateway/static/root/assets/dist-3h6cXXhT.js +1 -0
  38. package/dist/gateway/static/root/assets/{extension-debug-page-DbWJDT4X.js → extension-debug-page-cuG5Lnwf.js} +1 -1
  39. package/dist/gateway/static/root/assets/{extension-page-lAC_2xWA.js → extension-page-BCTAXdyE.js} +1 -1
  40. package/dist/gateway/static/root/assets/{extension-settings-page-jFy1NJg9.js → extension-settings-page-kadW_icu.js} +1 -1
  41. package/dist/gateway/static/root/assets/{gateway-config-swr-B7WpH3VW.js → gateway-config-swr-CoQVulMd.js} +1 -1
  42. package/dist/gateway/static/root/assets/gateway-settings-CLZyN-u9.js +1 -0
  43. package/dist/gateway/static/root/assets/{gateway-startup-retry-C8F_z865.js → gateway-startup-retry-B5GJ-CQV.js} +1 -1
  44. package/dist/gateway/static/root/assets/home-page-BSqg-JE9.js +1 -0
  45. package/dist/gateway/static/root/assets/{image-generation-api-Dc7d0_7q.js → image-generation-api-DvWDkbk1.js} +1 -1
  46. package/dist/gateway/static/root/assets/{imports-page-_fMvJvzM.js → imports-page-_pddpuej.js} +1 -1
  47. package/dist/gateway/static/root/assets/index-BKL5tg2f.css +1 -0
  48. package/dist/gateway/static/root/assets/index-CJuypaNt.js +121 -0
  49. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CHnZYx1U.js → keyboard-shortcuts-settings-C1fKIjz4.js} +1 -1
  50. package/dist/gateway/static/root/assets/local-app-workbench-page-DXFnYiA0.js +1 -0
  51. package/dist/gateway/static/root/assets/local-apps-Bpja8nC6.js +1 -0
  52. package/dist/gateway/static/root/assets/local-apps-page-CkXKS5xe.js +1 -0
  53. package/dist/gateway/static/root/assets/{locale-store-D9krC43K.js → locale-store-BPZR8x9b.js} +1 -1
  54. package/dist/gateway/static/root/assets/logs-page-C33z-ife.js +2 -0
  55. package/dist/gateway/static/root/assets/management-settings-8eDZb0uS.js +1 -0
  56. package/dist/gateway/static/root/assets/{markdown-view-CurpvCbB.js → markdown-view-Dft8ASFD.js} +1 -1
  57. package/dist/gateway/static/root/assets/{media-plugins-CYldyH6K.js → media-plugins-Cjj-fidX.js} +1 -1
  58. package/dist/gateway/static/root/assets/messages-kFWhF6_t.js +3 -0
  59. package/dist/gateway/static/root/assets/note-detail-panel-C95RtLuL.js +5 -0
  60. package/dist/gateway/static/root/assets/notes-page-kFxknjMR.js +8 -0
  61. package/dist/gateway/static/root/assets/{page-context-capture-button-DZOiI84c.js → page-context-capture-button-OUL3fEYh.js} +1 -1
  62. package/dist/gateway/static/root/assets/{page-tabs-C-XCf9cR.js → page-tabs-CVbY7_N5.js} +1 -1
  63. package/dist/gateway/static/root/assets/popover-select-DcsFzD_i.js +1 -0
  64. package/dist/gateway/static/root/assets/{preview-open-alternatives-CvgeoEU8.js → preview-open-alternatives-CKiIby0r.js} +1 -1
  65. package/dist/gateway/static/root/assets/product-delivery-bv3z8Xkh.js +1 -0
  66. package/dist/gateway/static/root/assets/product-open-page-DlpCi5zT.js +1 -0
  67. package/dist/gateway/static/root/assets/project-detail-page-LPAxUszX.js +1 -0
  68. package/dist/gateway/static/root/assets/projects-page-Cbyb4hyy.js +1 -0
  69. package/dist/gateway/static/root/assets/{registry-api-cK-g8BDq.js → registry-api-DWWO6ajd.js} +1 -1
  70. package/dist/gateway/static/root/assets/remote-access-hub-BtDFZc6g.js +1 -0
  71. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DlUodTo-.js → runtime-tools-settings-panel-BT_ANpaT.js} +2 -2
  72. package/dist/gateway/static/root/assets/scenes-page-CJlc-mg1.js +2 -0
  73. package/dist/gateway/static/root/assets/{schema-form-BfboLCeN.js → schema-form-BcqsqSsV.js} +1 -1
  74. package/dist/gateway/static/root/assets/sessions-page-CUo6-iV2.js +1 -0
  75. package/dist/gateway/static/root/assets/settings-advanced-gate-XeSxPjP7.js +1 -0
  76. package/dist/gateway/static/root/assets/{settings-form-section-BytEfCGo.js → settings-form-section-Dol9j_pF.js} +1 -1
  77. package/dist/gateway/static/root/assets/{settings-page-Da2ql9KX.js → settings-page-B65vii9U.js} +1 -1
  78. package/dist/gateway/static/root/assets/{settings-page-layout-CBfB_7yz.js → settings-page-layout-eqTUTW2L.js} +1 -1
  79. package/dist/gateway/static/root/assets/setup-status-panel-BCt__prc.js +1 -0
  80. package/dist/gateway/static/root/assets/{share-preview-page-B8J0Saj5.js → share-preview-page-BS8o58NJ.js} +1 -1
  81. package/dist/gateway/static/root/assets/shares-settings-BsjSqEnw.js +1 -0
  82. package/dist/gateway/static/root/assets/skill-reload-api-evN7gs0S.js +1 -0
  83. package/dist/gateway/static/root/assets/skills-page-BifYwEhe.js +2 -0
  84. package/dist/gateway/static/root/assets/{skills-page.utils-B53tyGx5.js → skills-page.utils-DOk-iOvN.js} +1 -1
  85. package/dist/gateway/static/root/assets/{system-settings-panel-0HAvlVtR.js → system-settings-panel-CcSvoHfY.js} +1 -1
  86. package/dist/gateway/static/root/assets/task-detail-page-pCRG7Jb3.js +1 -0
  87. package/dist/gateway/static/root/assets/{tunnel-api-DJsxU6q_.js → tunnel-api-DDGMf44u.js} +1 -1
  88. package/dist/gateway/static/root/assets/{use-autosave-eIELzAOD.js → use-autosave-DiIkxIq7.js} +1 -1
  89. package/dist/gateway/static/root/assets/user-model-page-CvYeM0Ml.js +2 -0
  90. package/dist/gateway/static/root/assets/{voice-api-key-field-BJ59ZCAn.js → voice-api-key-field-DJV-qERt.js} +1 -1
  91. package/dist/gateway/static/root/assets/{voice-config-api-DBXZJWLS.js → voice-config-api-BaxITrwZ.js} +1 -1
  92. package/dist/gateway/static/root/assets/{work-discovery-overlay-BpSxdIgB.js → work-discovery-overlay-DcHhy54L.js} +1 -1
  93. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Bhlv3VUX.js → workflow-run-setup-panel-DbVtLh0R.js} +2 -2
  94. package/dist/gateway/static/root/assets/workflows-page-CT8ouKcB.js +6 -0
  95. package/dist/gateway/static/root/index.html +14 -12
  96. package/dist/package.js +1 -1
  97. package/dist/packages/gateway-contract/src/capabilities.js +4 -110
  98. package/dist/packages/gateway-contract/src/chat-previews.js +73 -0
  99. package/dist/packages/gateway-contract/src/home.js +284 -55
  100. package/dist/packages/gateway-contract/src/index.js +6 -2
  101. package/dist/packages/gateway-contract/src/local-apps.js +215 -0
  102. package/dist/packages/gateway-contract/src/notifications.js +3 -10
  103. package/dist/packages/gateway-contract/src/product-delivery.js +62 -17
  104. package/dist/packages/gateway-contract/src/user-turn-document.js +60 -0
  105. package/dist/src/activity/emitter.js +2 -1
  106. package/dist/src/activity/service.js +2 -1
  107. package/dist/src/agent/agent-manager.d.ts +4 -2
  108. package/dist/src/agent/agent-manager.js +37 -44
  109. package/dist/src/agent/agent-scope.d.ts +19 -48
  110. package/dist/src/agent/agent-scope.js +47 -169
  111. package/dist/src/agent/background-review/run-background-review.js +5 -4
  112. package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
  113. package/dist/src/agent/commands/command-registry.js +7 -3
  114. package/dist/src/agent/context/coordinator.js +1 -1
  115. package/dist/src/agent/context/execution-context.js +2 -1
  116. package/dist/src/agent/context/execution-scope.js +2 -1
  117. package/dist/src/agent/context/workspace-seed.d.ts +1 -2
  118. package/dist/src/agent/context/workspace-seed.js +3 -3
  119. package/dist/src/agent/context/workspace-state.js +1 -1
  120. package/dist/src/agent/embedded/run-for-session.js +2 -2
  121. package/dist/src/agent/embedded/run-turn.js +2 -1
  122. package/dist/src/agent/embedded/sqlite-hydrating-session-manager.js +2 -1
  123. package/dist/src/agent/embedded/transcript-runtime.d.ts +3 -0
  124. package/dist/src/agent/embedded/transcript-runtime.js +6 -0
  125. package/dist/src/agent/external-tools/cliProvider.js +6 -2
  126. package/dist/src/agent/external-tools/composio-provider.js +11 -4
  127. package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
  128. package/dist/src/agent/external-tools/gateway-tools.js +17 -10
  129. package/dist/src/agent/external-tools/index.js +2 -3
  130. package/dist/src/agent/external-tools/mcp-provider.d.ts +3 -1
  131. package/dist/src/agent/external-tools/mcp-provider.js +93 -8
  132. package/dist/src/agent/external-tools/service.d.ts +2 -1
  133. package/dist/src/agent/external-tools/service.js +8 -3
  134. package/dist/src/agent/external-tools/types.d.ts +9 -0
  135. package/dist/src/agent/image/tool-model-config.js +4 -5
  136. package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
  137. package/dist/src/agent/ipc/bus.js +1 -1
  138. package/dist/src/agent/ipc/socket.js +3 -3
  139. package/dist/src/agent/mcp/bundle-mcp-config.js +37 -5
  140. package/dist/src/agent/mcp/bundle-mcp-gateway.d.ts +1 -0
  141. package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -0
  142. package/dist/src/agent/mcp/bundle-mcp-names.js +2 -1
  143. package/dist/src/agent/mcp/bundle-mcp-runtime.js +33 -1
  144. package/dist/src/agent/mcp/bundle-mcp-types.d.ts +4 -0
  145. package/dist/src/agent/mcp/index.js +1 -1
  146. package/dist/src/agent/mcp/mcp-stdio-transport.d.ts +1 -0
  147. package/dist/src/agent/mcp/mcp-stdio-transport.js +10 -0
  148. package/dist/src/agent/mcp/mcp-transport.js +12 -8
  149. package/dist/src/agent/mcp/oauth/index.js +1 -1
  150. package/dist/src/agent/mcp/oauth/mcp-oauth-manager.d.ts +6 -1
  151. package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +70 -14
  152. package/dist/src/agent/mcp/oauth/mcp-oauth-provider.js +1 -1
  153. package/dist/src/agent/mcp/oauth/mcp-oauth-session.d.ts +2 -0
  154. package/dist/src/agent/mcp/oauth/mcp-oauth-session.js +12 -0
  155. package/dist/src/agent/mcp/oauth/mcp-oauth-store.d.ts +3 -0
  156. package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +13 -1
  157. package/dist/src/agent/mcp/plugin-http-fetch.d.ts +2 -0
  158. package/dist/src/agent/mcp/plugin-http-fetch.js +56 -0
  159. package/dist/src/agent/media-generation/runtime-shared.d.ts +1 -1
  160. package/dist/src/agent/media-generation/runtime-shared.js +1 -1
  161. package/dist/src/agent/memory/plugin-discovery.js +1 -2
  162. package/dist/src/agent/models/manager.d.ts +1 -1
  163. package/dist/src/agent/models/manager.js +2 -2
  164. package/dist/src/agent/orchestration/run-agent-turn-with-timeout.js +1 -1
  165. package/dist/src/agent/prompt/response-language.js +2 -1
  166. package/dist/src/agent/prompt/service-prompt-builder.js +6 -3
  167. package/dist/src/agent/prompt/system-prompt.js +2 -1
  168. package/dist/src/agent/reply/post-compaction-context.js +2 -2
  169. package/dist/src/agent/service/build-direct-message-content.js +1 -1
  170. package/dist/src/agent/service/direct-turn-helpers.js +2 -1
  171. package/dist/src/agent/service/parse-outbound-session-key.js +2 -1
  172. package/dist/src/agent/service/process-direct-streaming.js +30 -14
  173. package/dist/src/agent/service/webchat-tts.js +2 -1
  174. package/dist/src/agent/service.d.ts +1 -1
  175. package/dist/src/agent/service.js +13 -11
  176. package/dist/src/agent/service.types.d.ts +4 -0
  177. package/dist/src/agent/session/session-inspector.js +4 -5
  178. package/dist/src/agent/skills/hub-pull.js +1 -1
  179. package/dist/src/agent/skills/index.js +8 -1
  180. package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.d.ts +5 -0
  181. package/dist/src/agent/skills/skill-manager.d.ts +2 -0
  182. package/dist/src/agent/skills/skill-manager.js +8 -0
  183. package/dist/src/agent/skills/skill-sources.js +17 -0
  184. package/dist/src/agent/skills/types.d.ts +3 -1
  185. package/dist/src/agent/source-context/injector.js +10 -5
  186. package/dist/src/agent/source-context/types.d.ts +3 -0
  187. package/dist/src/agent/source-context/types.js +8 -2
  188. package/dist/src/agent/starter-agents.d.ts +4 -5
  189. package/dist/src/agent/starter-agents.js +21 -20
  190. package/dist/src/agent/tasks/task-judge-service.js +2 -2
  191. package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
  192. package/dist/src/agent/tool-manuals/xopc-use.js +42 -2
  193. package/dist/src/agent/tools/automation-tool.js +1 -1
  194. package/dist/src/agent/tools/delegation-parent-policy.js +2 -3
  195. package/dist/src/agent/tools/factory.d.ts +3 -0
  196. package/dist/src/agent/tools/factory.js +12 -10
  197. package/dist/src/agent/tools/image-generate-tool.js +1 -1
  198. package/dist/src/agent/tools/workflow-tool.js +3 -4
  199. package/dist/src/agent/tools/write.js +1 -1
  200. package/dist/src/agent/tools/xopc-use-tool.d.ts +5 -2
  201. package/dist/src/agent/tools/xopc-use-tool.js +171 -15
  202. package/dist/src/agent/workflow/workflow-child-tools.js +1 -2
  203. package/dist/src/agent/workspace-runtime/registry.d.ts +1 -1
  204. package/dist/src/agent/workspace-runtime/registry.js +2 -2
  205. package/dist/src/agent-catalog/capabilities.d.ts +3 -0
  206. package/dist/src/agent-catalog/capabilities.js +238 -0
  207. package/dist/src/agent-catalog/id.d.ts +15 -0
  208. package/dist/src/agent-catalog/id.js +101 -0
  209. package/dist/src/agent-catalog/index.d.ts +6 -0
  210. package/dist/src/agent-catalog/index.js +10 -0
  211. package/dist/src/agent-catalog/migrations/legacy-config-cutover.d.ts +11 -0
  212. package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +195 -0
  213. package/dist/src/agent-catalog/repository.d.ts +39 -0
  214. package/dist/src/agent-catalog/repository.js +319 -0
  215. package/dist/src/agent-catalog/service.d.ts +33 -0
  216. package/dist/src/agent-catalog/service.js +202 -0
  217. package/dist/src/agent-catalog/test-support.d.ts +14 -0
  218. package/dist/src/agent-catalog/test-support.js +34 -0
  219. package/dist/src/agent-catalog/types.d.ts +26 -0
  220. package/dist/src/agent-catalog/types.js +1 -0
  221. package/dist/src/agent-config/index.js +2 -2
  222. package/dist/src/agent-config/schema.d.ts +1 -172
  223. package/dist/src/agent-config/schema.js +2 -41
  224. package/dist/src/auth/credentials.js +3 -3
  225. package/dist/src/auth/oauth/xopc-cloud.js +1 -1
  226. package/dist/src/auth/sync-provider-auth.d.ts +1 -1
  227. package/dist/src/auth/sync-provider-auth.js +5 -9
  228. package/dist/src/automations/capabilities/drafts.js +8 -7
  229. package/dist/src/automations/service/action-executor.js +2 -1
  230. package/dist/src/bootstrap/application-state.d.ts +10 -0
  231. package/dist/src/bootstrap/application-state.js +26 -0
  232. package/dist/src/browser/automations/repository.js +2 -1
  233. package/dist/src/browser/automations/schema.d.ts +1 -1
  234. package/dist/src/browser/automations/service.d.ts +1 -1
  235. package/dist/src/browser/native-messaging-host.js +5 -4
  236. package/dist/src/browser/providers/extension.js +4 -2
  237. package/dist/src/browser/providers/realtime-extension.js +2 -1
  238. package/dist/src/capabilities/readiness/from-config.js +7 -4
  239. package/dist/src/capabilities/runtime/dispatcher.d.ts +1 -0
  240. package/dist/src/capabilities/runtime/dispatcher.js +10 -4
  241. package/dist/src/capabilities/runtime/product.js +2 -0
  242. package/dist/src/channels/catalog/channel-catalog-service.js +7 -13
  243. package/dist/src/chat-commands/agent-edit.js +4 -3
  244. package/dist/src/chat-commands/builtins/config.js +6 -8
  245. package/dist/src/chat-commands/builtins/review.js +1 -1
  246. package/dist/src/chat-commands/builtins/workflow.js +1 -1
  247. package/dist/src/chat-commands/config-paths.js +1 -1
  248. package/dist/src/chat-commands/context.js +2 -3
  249. package/dist/src/chat-previews/index.d.ts +2 -0
  250. package/dist/src/chat-previews/index.js +3 -0
  251. package/dist/src/chat-previews/service.d.ts +27 -0
  252. package/dist/src/chat-previews/service.js +106 -0
  253. package/dist/src/chat-previews/store.d.ts +28 -0
  254. package/dist/src/chat-previews/store.js +78 -0
  255. package/dist/src/cli/command-manifest.js +1 -1
  256. package/dist/src/cli/commands/agent.js +4 -4
  257. package/dist/src/cli/commands/agents.d.ts +1 -1
  258. package/dist/src/cli/commands/agents.js +36 -48
  259. package/dist/src/cli/commands/auth.js +1 -0
  260. package/dist/src/cli/commands/browser-cli-helpers.js +1 -2
  261. package/dist/src/cli/commands/channels.js +2 -4
  262. package/dist/src/cli/commands/config.js +4 -5
  263. package/dist/src/cli/commands/connectors.js +1 -2
  264. package/dist/src/cli/commands/doctor/checks/channel-config.js +2 -4
  265. package/dist/src/cli/commands/doctor/checks/channel-pairing-pending.js +1 -2
  266. package/dist/src/cli/commands/doctor/checks/channel-plugins.js +1 -2
  267. package/dist/src/cli/commands/doctor/checks/config-health.js +1 -2
  268. package/dist/src/cli/commands/doctor/checks/database-schema.js +4 -4
  269. package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -2
  270. package/dist/src/cli/commands/doctor/checks/gateway-service.js +1 -2
  271. package/dist/src/cli/commands/doctor/checks/provider-auth.js +13 -11
  272. package/dist/src/cli/commands/doctor/checks/security-audit.js +1 -2
  273. package/dist/src/cli/commands/doctor/checks/session-integrity.js +3 -3
  274. package/dist/src/cli/commands/doctor/checks/tool-runtimes.js +1 -2
  275. package/dist/src/cli/commands/doctor/checks/workspace-status.js +5 -7
  276. package/dist/src/cli/commands/extension-agent-plugin.d.ts +8 -0
  277. package/dist/src/cli/commands/extension-agent-plugin.js +81 -0
  278. package/dist/src/cli/commands/extension-dev.js +2 -4
  279. package/dist/src/cli/commands/extension-marketplace.js +45 -6
  280. package/dist/src/cli/commands/extension-pack.js +1 -2
  281. package/dist/src/cli/commands/extension.js +36 -5
  282. package/dist/src/cli/commands/gateway/run-foreground.js +3 -3
  283. package/dist/src/cli/commands/gateway/shared.js +1 -1
  284. package/dist/src/cli/commands/history.js +2 -1
  285. package/dist/src/cli/commands/image.js +2 -2
  286. package/dist/src/cli/commands/init.js +11 -30
  287. package/dist/src/cli/commands/mcp.js +1 -2
  288. package/dist/src/cli/commands/models.js +13 -11
  289. package/dist/src/cli/commands/onboard/channels/registry.js +1 -2
  290. package/dist/src/cli/commands/onboard/gateway.js +1 -2
  291. package/dist/src/cli/commands/onboard/model.d.ts +1 -1
  292. package/dist/src/cli/commands/onboard/model.js +17 -25
  293. package/dist/src/cli/commands/onboard.js +4 -2
  294. package/dist/src/cli/commands/platform.js +1 -0
  295. package/dist/src/cli/commands/project.js +3 -3
  296. package/dist/src/cli/commands/providers.js +1 -0
  297. package/dist/src/cli/commands/runtime.js +1 -2
  298. package/dist/src/cli/commands/search.js +1 -2
  299. package/dist/src/cli/commands/skills.js +1 -2
  300. package/dist/src/cli/commands/tui-runner.js +3 -2
  301. package/dist/src/cli/commands/tui.js +6 -8
  302. package/dist/src/cli/commands/tunnel.js +1 -1
  303. package/dist/src/cli/commands/voice.js +1 -2
  304. package/dist/src/cli/extension-cli-register.js +1 -1
  305. package/dist/src/cli/index.js +4 -2
  306. package/dist/src/cli/utils/gateway-client.js +1 -1
  307. package/dist/src/cli/utils/init-workspace-core.js +15 -16
  308. package/dist/src/cli/utils/session.js +1 -2
  309. package/dist/src/computer/model-config.d.ts +3 -3
  310. package/dist/src/computer/model-config.js +10 -20
  311. package/dist/src/computer/runtime.js +1 -1
  312. package/dist/src/config/agent-model-intents.js +2 -2
  313. package/dist/src/config/agent-profile.d.ts +5 -6
  314. package/dist/src/config/agent-profile.js +19 -19
  315. package/dist/src/config/config-surface.d.ts +0 -3
  316. package/dist/src/config/default-model.js +2 -6
  317. package/dist/src/config/index.js +7 -8
  318. package/dist/src/config/loader.js +12 -18
  319. package/dist/src/config/models-json.d.ts +6 -6
  320. package/dist/src/config/paths.d.ts +18 -19
  321. package/dist/src/config/paths.js +35 -35
  322. package/dist/src/config/reload.d.ts +0 -1
  323. package/dist/src/config/reload.js +1 -6
  324. package/dist/src/config/rules.js +0 -15
  325. package/dist/src/config/schema.d.ts +3 -406
  326. package/dist/src/config/schema.js +24 -86
  327. package/dist/src/config/validate-channel-configs.js +8 -14
  328. package/dist/src/config/workspace-dirs.d.ts +3 -4
  329. package/dist/src/config/workspace-dirs.js +9 -8
  330. package/dist/src/config/workspace-path-helpers.d.ts +1 -1
  331. package/dist/src/config/workspace-path-helpers.js +2 -2
  332. package/dist/src/connectors/account-selection.js +1 -1
  333. package/dist/src/connectors/cli/lifecycle.js +2 -1
  334. package/dist/src/connectors/composio-managed-events.js +2 -1
  335. package/dist/src/connectors/connected-source-ingestion.js +2 -1
  336. package/dist/src/connectors/connected-source-understanding.js +4 -2
  337. package/dist/src/connectors/connection-candidates.d.ts +4 -1
  338. package/dist/src/connectors/connection-candidates.js +8 -2
  339. package/dist/src/connectors/connection-capabilities.d.ts +2 -2
  340. package/dist/src/connectors/connection-capabilities.js +3 -1
  341. package/dist/src/connectors/connection-recovery-service.d.ts +6 -1
  342. package/dist/src/connectors/connection-recovery-service.js +138 -26
  343. package/dist/src/connectors/content-enrichment.js +2 -1
  344. package/dist/src/connectors/learning-coordinator.js +2 -1
  345. package/dist/src/connectors/plugin-mcp-recovery.d.ts +28 -0
  346. package/dist/src/connectors/plugin-mcp-recovery.js +90 -0
  347. package/dist/src/connectors/runtime-adapter-registry.js +2 -1
  348. package/dist/src/connectors/workflow-preflight.d.ts +8 -1
  349. package/dist/src/connectors/workflow-preflight.js +11 -3
  350. package/dist/src/discussions/analyzer.js +2 -2
  351. package/dist/src/endpoint-tools/runtime.js +2 -1
  352. package/dist/src/execution-environments/subject.js +2 -1
  353. package/dist/src/extensions/activation-context.js +3 -16
  354. package/dist/src/extensions/agent-plugins/auth.d.ts +39 -0
  355. package/dist/src/extensions/agent-plugins/auth.js +156 -0
  356. package/dist/src/extensions/agent-plugins/connection.d.ts +8 -0
  357. package/dist/src/extensions/agent-plugins/connection.js +41 -0
  358. package/dist/src/extensions/agent-plugins/health.d.ts +4 -0
  359. package/dist/src/extensions/agent-plugins/health.js +48 -0
  360. package/dist/src/extensions/agent-plugins/inventory.d.ts +53 -0
  361. package/dist/src/extensions/agent-plugins/inventory.js +34 -0
  362. package/dist/src/extensions/agent-plugins/mcp-adapter.d.ts +3 -0
  363. package/dist/src/extensions/agent-plugins/mcp-adapter.js +47 -0
  364. package/dist/src/extensions/agent-plugins/sources.d.ts +5 -0
  365. package/dist/src/extensions/agent-plugins/sources.js +72 -0
  366. package/dist/src/extensions/agent-plugins/store.d.ts +61 -0
  367. package/dist/src/extensions/agent-plugins/store.js +305 -0
  368. package/dist/src/extensions/agent-plugins/validation.d.ts +59 -0
  369. package/dist/src/extensions/agent-plugins/validation.js +211 -0
  370. package/dist/src/extensions/discover-extensions.js +9 -15
  371. package/dist/src/extensions/extension-metadata-snapshot.d.ts +1 -1
  372. package/dist/src/extensions/extension-metadata-snapshot.js +9 -16
  373. package/dist/src/extensions/index.js +4 -10
  374. package/dist/src/extensions/install.js +1 -1
  375. package/dist/src/extensions/loader.js +7 -14
  376. package/dist/src/extensions/manifest-registry.js +93 -98
  377. package/dist/src/extensions/marketplace.js +5 -2
  378. package/dist/src/extensions/normalize-manifest.js +12 -17
  379. package/dist/src/extensions/update.js +2 -3
  380. package/dist/src/files/file-service.js +7 -8
  381. package/dist/src/gateway/agents-admin.d.ts +23 -27
  382. package/dist/src/gateway/agents-admin.js +109 -130
  383. package/dist/src/gateway/chat-stream/mapper.js +10 -3
  384. package/dist/src/gateway/file-path-classifier.js +3 -3
  385. package/dist/src/gateway/file-space-service.js +2 -1
  386. package/dist/src/gateway/global-defaults-admin.d.ts +6 -4
  387. package/dist/src/gateway/global-defaults-admin.js +21 -20
  388. package/dist/src/gateway/hono/app.js +2 -1
  389. package/dist/src/gateway/hono/lib/config-payload.js +12 -9
  390. package/dist/src/gateway/hono/middleware/auth.js +2 -1
  391. package/dist/src/gateway/hono/middleware/scopes.js +2 -1
  392. package/dist/src/gateway/hono/routes/agent-plugins.d.ts +3 -0
  393. package/dist/src/gateway/hono/routes/agent-plugins.js +166 -0
  394. package/dist/src/gateway/hono/routes/agent-stream.js +14 -0
  395. package/dist/src/gateway/hono/routes/agents.js +22 -49
  396. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +4 -2
  397. package/dist/src/gateway/hono/routes/browser.js +4 -2
  398. package/dist/src/gateway/hono/routes/channels.js +1 -2
  399. package/dist/src/gateway/hono/routes/chat-previews.d.ts +3 -0
  400. package/dist/src/gateway/hono/routes/chat-previews.js +41 -0
  401. package/dist/src/gateway/hono/routes/cli-connectors.js +2 -1
  402. package/dist/src/gateway/hono/routes/commands-skills.js +3 -1
  403. package/dist/src/gateway/hono/routes/composer-history.js +2 -1
  404. package/dist/src/gateway/hono/routes/config-patch/index.d.ts +1 -3
  405. package/dist/src/gateway/hono/routes/config-patch/index.js +1 -2
  406. package/dist/src/gateway/hono/routes/config-patch/misc.js +18 -11
  407. package/dist/src/gateway/hono/routes/config.js +0 -2
  408. package/dist/src/gateway/hono/routes/connection-waits.js +4 -2
  409. package/dist/src/gateway/hono/routes/connectors.js +8 -4
  410. package/dist/src/gateway/hono/routes/context-sources.js +4 -3
  411. package/dist/src/gateway/hono/routes/device-pairing-approval.js +2 -1
  412. package/dist/src/gateway/hono/routes/device-push.js +3 -2
  413. package/dist/src/gateway/hono/routes/devices.js +6 -3
  414. package/dist/src/gateway/hono/routes/discussions.js +2 -1
  415. package/dist/src/gateway/hono/routes/endpoint-tools.js +2 -1
  416. package/dist/src/gateway/hono/routes/global-defaults.js +8 -16
  417. package/dist/src/gateway/hono/routes/home.js +93 -4
  418. package/dist/src/gateway/hono/routes/index.js +2 -0
  419. package/dist/src/gateway/hono/routes/interaction-state.js +2 -1
  420. package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
  421. package/dist/src/gateway/hono/routes/local-apps.js +71 -39
  422. package/dist/src/gateway/hono/routes/mcp.js +48 -21
  423. package/dist/src/gateway/hono/routes/models.js +8 -7
  424. package/dist/src/gateway/hono/routes/notes.js +4 -5
  425. package/dist/src/gateway/hono/routes/projects.js +6 -6
  426. package/dist/src/gateway/hono/routes/public-gateway.js +2 -1
  427. package/dist/src/gateway/hono/routes/session-input-handler.d.ts +4 -0
  428. package/dist/src/gateway/hono/routes/session-input-handler.js +23 -1
  429. package/dist/src/gateway/hono/routes/sessions.js +4 -2
  430. package/dist/src/gateway/hono/routes/shares.js +4 -3
  431. package/dist/src/gateway/hono/routes/side-chats.js +11 -0
  432. package/dist/src/gateway/hono/routes/site-shares.js +2 -2
  433. package/dist/src/gateway/hono/routes/status.js +2 -3
  434. package/dist/src/gateway/hono/routes/tasks.js +1 -2
  435. package/dist/src/gateway/hono/routes/user-model-refresh.js +2 -1
  436. package/dist/src/gateway/hono/routes/user-model.js +3 -2
  437. package/dist/src/gateway/hono/routes/work-discovery.js +1 -1
  438. package/dist/src/gateway/hono/routes/workflows.js +2 -2
  439. package/dist/src/gateway/image-generation-setup.d.ts +19 -10
  440. package/dist/src/gateway/image-generation-setup.js +59 -23
  441. package/dist/src/gateway/index.js +1 -4
  442. package/dist/src/gateway/lock.js +13 -18
  443. package/dist/src/gateway/memory-maintenance-automation-reconciler.js +4 -3
  444. package/dist/src/gateway/run-loop.js +2 -3
  445. package/dist/src/gateway/security/gateway-scopes.js +6 -2
  446. package/dist/src/gateway/security/index.js +4 -1
  447. package/dist/src/gateway/service/agent-runner.js +11 -3
  448. package/dist/src/gateway/service/app-context-access.js +2 -1
  449. package/dist/src/gateway/service/config-coordinator.d.ts +0 -1
  450. package/dist/src/gateway/service/config-coordinator.js +4 -22
  451. package/dist/src/gateway/service/marketplace-service.d.ts +1 -0
  452. package/dist/src/gateway/service/marketplace-service.js +18 -2
  453. package/dist/src/gateway/service/run-gateway-agent.js +4 -2
  454. package/dist/src/gateway/service/session-input-coordinator.js +7 -5
  455. package/dist/src/gateway/service.d.ts +10 -1
  456. package/dist/src/gateway/service.js +123 -33
  457. package/dist/src/gateway/session-context-summary.js +4 -2
  458. package/dist/src/gateway/side-chat/index.d.ts +3 -1
  459. package/dist/src/gateway/side-chat/index.js +2 -1
  460. package/dist/src/gateway/side-chat/manager.d.ts +16 -0
  461. package/dist/src/gateway/side-chat/manager.js +40 -6
  462. package/dist/src/gateway/side-chat/promotion-service.d.ts +19 -0
  463. package/dist/src/gateway/side-chat/promotion-service.js +111 -0
  464. package/dist/src/gateway/side-chat/run-service.js +1 -0
  465. package/dist/src/gateway/side-chat/types.d.ts +1 -1
  466. package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +2 -0
  467. package/dist/src/gateway/xopc-cloud-capability-setup.js +15 -10
  468. package/dist/src/home-intelligence/application-service.d.ts +31 -0
  469. package/dist/src/home-intelligence/application-service.js +134 -0
  470. package/dist/src/home-intelligence/capability-preflight.d.ts +32 -0
  471. package/dist/src/home-intelligence/capability-preflight.js +118 -0
  472. package/dist/src/home-intelligence/evaluation.d.ts +34 -0
  473. package/dist/src/home-intelligence/evaluation.js +49 -0
  474. package/dist/src/home-intelligence/generator.d.ts +125 -0
  475. package/dist/src/home-intelligence/generator.js +227 -0
  476. package/dist/src/home-intelligence/host.d.ts +53 -0
  477. package/dist/src/home-intelligence/host.js +257 -0
  478. package/dist/src/home-intelligence/notification.d.ts +8 -0
  479. package/dist/src/home-intelligence/notification.js +20 -0
  480. package/dist/src/home-intelligence/policy.d.ts +16 -0
  481. package/dist/src/home-intelligence/policy.js +152 -0
  482. package/dist/src/home-intelligence/repository.d.ts +81 -0
  483. package/dist/src/home-intelligence/repository.js +495 -0
  484. package/dist/src/home-intelligence/snapshot.d.ts +43 -0
  485. package/dist/src/home-intelligence/snapshot.js +133 -0
  486. package/dist/src/home-intelligence/strategy.d.ts +14 -0
  487. package/dist/src/home-intelligence/strategy.js +10 -0
  488. package/dist/src/home-intelligence/types.d.ts +13 -0
  489. package/dist/src/home-intelligence/types.js +1 -0
  490. package/dist/src/infra/update-restart.js +4 -2
  491. package/dist/src/knowledge/connected-knowledge-pipeline.js +2 -1
  492. package/dist/src/knowledge/ingestion-service.js +2 -1
  493. package/dist/src/knowledge-memory/repository.js +2 -1
  494. package/dist/src/local-apps/artifact-files.d.ts +3 -0
  495. package/dist/src/local-apps/artifact-files.js +45 -0
  496. package/dist/src/local-apps/capabilities/write.js +1 -1
  497. package/dist/src/local-apps/fix-guidance.d.ts +3 -0
  498. package/dist/src/local-apps/fix-guidance.js +75 -0
  499. package/dist/src/local-apps/index.d.ts +2 -1
  500. package/dist/src/local-apps/scaffold.d.ts +5 -0
  501. package/dist/src/local-apps/scaffold.js +18 -5
  502. package/dist/src/local-apps/service.d.ts +18 -3
  503. package/dist/src/local-apps/service.js +107 -65
  504. package/dist/src/local-apps/snapshot-store.d.ts +8 -0
  505. package/dist/src/local-apps/snapshot-store.js +68 -0
  506. package/dist/src/local-apps/store.js +2 -1
  507. package/dist/src/local-apps/types.d.ts +4 -87
  508. package/dist/src/mcp/channel-bridge.js +1 -2
  509. package/dist/src/mcp/channel-server.js +1 -2
  510. package/dist/src/mcp/gateway-http-client.js +1 -2
  511. package/dist/src/media/session-references.js +2 -1
  512. package/dist/src/memory-maintenance/service.js +2 -1
  513. package/dist/src/migrations/memory-config.js +1 -2
  514. package/dist/src/notes/agent-context.js +2 -1
  515. package/dist/src/notes/attachment-ref.js +8 -4
  516. package/dist/src/notes/note-attachment-sync.js +2 -1
  517. package/dist/src/notes/note-index-meta.js +14 -7
  518. package/dist/src/notes/note-markdown.js +13 -7
  519. package/dist/src/notes/service.js +6 -3
  520. package/dist/src/notes/store.js +4 -2
  521. package/dist/src/notifications/device-store.js +1 -1
  522. package/dist/src/notifications/planner.js +24 -0
  523. package/dist/src/notifications/service.d.ts +7 -14
  524. package/dist/src/notifications/service.js +13 -3
  525. package/dist/src/notifications/store.js +1 -1
  526. package/dist/src/notifications/types.d.ts +1 -1
  527. package/dist/src/notifications/types.js +1 -1
  528. package/dist/src/projects/capabilities/write.js +2 -1
  529. package/dist/src/projects/project-agent-suggestion.js +1 -1
  530. package/dist/src/projects/project-agent.js +4 -4
  531. package/dist/src/projects/project-service.js +2 -1
  532. package/dist/src/projects/workspace.js +3 -2
  533. package/dist/src/providers/index.js +3 -3
  534. package/dist/src/providers/model-reference-auditor.d.ts +1 -2
  535. package/dist/src/providers/model-reference-auditor.js +8 -5
  536. package/dist/src/realtime/runtime.js +2 -1
  537. package/dist/src/routing/binding-schema.d.ts +41 -0
  538. package/dist/src/routing/binding-schema.js +26 -0
  539. package/dist/src/routing/bindings.d.ts +4 -2
  540. package/dist/src/routing/bindings.js +4 -4
  541. package/dist/src/routing/index.d.ts +1 -1
  542. package/dist/src/routing/resolve-route.d.ts +7 -24
  543. package/dist/src/routing/resolve-route.js +17 -18
  544. package/dist/src/routing/resolve-tui-session-key.d.ts +1 -4
  545. package/dist/src/routing/resolve-tui-session-key.js +10 -9
  546. package/dist/src/scenes/execution.d.ts +1 -1
  547. package/dist/src/scenes/model.js +1 -1
  548. package/dist/src/scenes/taskFollowUp/contracts.d.ts +1 -1
  549. package/dist/src/scenes/taskFollowUp/service.js +6 -4
  550. package/dist/src/scenes/templates.d.ts +2 -2
  551. package/dist/src/session/client-history.d.ts +3 -1
  552. package/dist/src/session/client-history.js +10 -3
  553. package/dist/src/session/config-store.js +2 -1
  554. package/dist/src/session/index.d.ts +1 -1
  555. package/dist/src/session/init-session-turn.js +2 -1
  556. package/dist/src/session/manager.d.ts +4 -0
  557. package/dist/src/session/manager.js +6 -0
  558. package/dist/src/session/resolve-session.js +2 -1
  559. package/dist/src/session/session-context-for-llm.d.ts +12 -1
  560. package/dist/src/session/session-context-for-llm.js +16 -2
  561. package/dist/src/session/session-workspace.js +1 -1
  562. package/dist/src/session/store.d.ts +14 -0
  563. package/dist/src/session/store.js +20 -2
  564. package/dist/src/session/stored-rows-to-file-entries.js +10 -1
  565. package/dist/src/session/transcript-outline.js +10 -3
  566. package/dist/src/storage/sqlite/activity-repository.js +6 -2
  567. package/dist/src/storage/sqlite/browser-tab-binding-repository.js +6 -2
  568. package/dist/src/storage/sqlite/clarification-wait-repository.js +13 -8
  569. package/dist/src/storage/sqlite/collaboration-rule-repository.d.ts +1 -1
  570. package/dist/src/storage/sqlite/collaboration-rule-repository.js +8 -3
  571. package/dist/src/storage/sqlite/composer-input-history-repository.js +8 -3
  572. package/dist/src/storage/sqlite/config-repository.js +9 -5
  573. package/dist/src/storage/sqlite/connection-wait-repository.js +9 -3
  574. package/dist/src/storage/sqlite/connector-learning-repository.js +6 -2
  575. package/dist/src/storage/sqlite/connector-sync-policy-repository.js +6 -2
  576. package/dist/src/storage/sqlite/context-evidence-repository.js +8 -3
  577. package/dist/src/storage/sqlite/context-extraction-repository.js +8 -3
  578. package/dist/src/storage/sqlite/device-access-repository.js +15 -9
  579. package/dist/src/storage/sqlite/device-pairing-approval.js +6 -2
  580. package/dist/src/storage/sqlite/device-pairing-repository.js +10 -5
  581. package/dist/src/storage/sqlite/endpoint-principal-repository.js +6 -2
  582. package/dist/src/storage/sqlite/endpoint-session-binding-repository.js +6 -2
  583. package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.js +6 -2
  584. package/dist/src/storage/sqlite/gateway-identity-repository.js +6 -2
  585. package/dist/src/storage/sqlite/home-attention-repository.js +6 -2
  586. package/dist/src/storage/sqlite/index.d.ts +0 -1
  587. package/dist/src/storage/sqlite/index.js +72 -42
  588. package/dist/src/storage/sqlite/interaction-state-repository.js +10 -4
  589. package/dist/src/storage/sqlite/knowledge-repository.js +6 -2
  590. package/dist/src/storage/sqlite/migrations/202_chat_previews.sql +26 -0
  591. package/dist/src/storage/sqlite/migrations/203_remove_retired_proactive_contracts.sql +70 -0
  592. package/dist/src/storage/sqlite/migrations/204_home_intelligence.sql +78 -0
  593. package/dist/src/storage/sqlite/migrations/205_agent_catalog.sql +66 -0
  594. package/dist/src/storage/sqlite/migrations/206_home_advice_strategy_version.sql +3 -0
  595. package/dist/src/storage/sqlite/migrations/conversation-backup.d.ts +2 -0
  596. package/dist/src/storage/sqlite/migrations/conversation-backup.js +8 -4
  597. package/dist/src/storage/sqlite/migrations/conversation-windows-owners.d.ts +7 -1
  598. package/dist/src/storage/sqlite/migrations/conversation-windows-owners.js +2 -2
  599. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  600. package/dist/src/storage/sqlite/migrations/runner.js +4 -4
  601. package/dist/src/storage/sqlite/note-agent-context-repository.js +6 -2
  602. package/dist/src/storage/sqlite/notes-repository.js +9 -4
  603. package/dist/src/storage/sqlite/row-mappers.js +6 -1
  604. package/dist/src/storage/sqlite/schema.js +1 -1
  605. package/dist/src/storage/sqlite/session-task-plan-repository.js +14 -9
  606. package/dist/src/storage/sqlite/session-turn-replace-repository.js +9 -5
  607. package/dist/src/storage/sqlite/sidebar-layout-repository.js +14 -9
  608. package/dist/src/storage/sqlite/transcript-repository.js +10 -6
  609. package/dist/src/storage/sqlite/user-people-repository.js +8 -3
  610. package/dist/src/storage/sqlite/user-trust-repository.js +8 -3
  611. package/dist/src/tasks/attention-governor.d.ts +0 -1
  612. package/dist/src/tasks/attention-governor.js +1 -7
  613. package/dist/src/tasks/capabilities/read.js +2 -2
  614. package/dist/src/tasks/capabilities/write.d.ts +1 -1
  615. package/dist/src/tasks/execution-context.d.ts +2 -2
  616. package/dist/src/tasks/execution-context.js +6 -5
  617. package/dist/src/tasks/home-query-service.d.ts +3 -2
  618. package/dist/src/tasks/home-query-service.js +23 -44
  619. package/dist/src/tasks/task-context-assembler.js +2 -1
  620. package/dist/src/tasks/task-context-repository.d.ts +1 -1
  621. package/dist/src/tasks/task-contract-planner.d.ts +0 -3
  622. package/dist/src/tasks/task-contract-planner.js +1 -4
  623. package/dist/src/tasks/task-handoff-service.d.ts +0 -2
  624. package/dist/src/tasks/task-handoff-service.js +3 -3
  625. package/dist/src/tasks/task-value-metrics-service.js +2 -1
  626. package/dist/src/tui/backends/embedded-backend.js +12 -14
  627. package/dist/src/tui/extension-host/load-extensions.js +1 -1
  628. package/dist/src/tui/tui-commands.js +5 -3
  629. package/dist/src/tui/tui-skills-autocomplete.js +1 -1
  630. package/dist/src/tui/tui-startup-resources.js +3 -3
  631. package/dist/src/tui/tui.js +5 -5
  632. package/dist/src/tunnel/registration-proof.js +2 -1
  633. package/dist/src/user-context/access-policy.js +2 -1
  634. package/dist/src/user-context/domain.d.ts +1 -1
  635. package/dist/src/user-context/domain.js +18 -13
  636. package/dist/src/user-context/extraction/registry.js +2 -1
  637. package/dist/src/user-context/interaction-state.js +4 -1
  638. package/dist/src/user-context/relationship-continuity.js +2 -1
  639. package/dist/src/user-context/trust-policy.js +13 -8
  640. package/dist/src/user-model/bootstrap.js +2 -1
  641. package/dist/src/user-model/capture/executor.js +4 -2
  642. package/dist/src/user-model/capture/semantic.d.ts +1 -1
  643. package/dist/src/user-model/capture/semantic.js +1 -1
  644. package/dist/src/user-model/domain.js +7 -2
  645. package/dist/src/user-model/goals.js +2 -1
  646. package/dist/src/user-model/index.js +4 -1
  647. package/dist/src/user-model/repository.js +2 -1
  648. package/dist/src/utils/helpers.js +1 -4
  649. package/dist/src/utils/index.js +2 -2
  650. package/dist/src/utils/logger/index.d.ts +1 -1
  651. package/dist/src/utils/logger/index.js +2 -2
  652. package/dist/src/utils/logger/redact.d.ts +2 -0
  653. package/dist/src/utils/logger/redact.js +11 -3
  654. package/dist/src/utils/logger.js +2 -2
  655. package/dist/src/voice/realtime/memory-context.js +2 -1
  656. package/dist/src/voice/realtime/persona-context.js +6 -6
  657. package/dist/src/voice/tts/audio.js +1 -1
  658. package/dist/src/work-discovery/analyzer.js +3 -3
  659. package/dist/src/work-discovery/investigator.js +1 -1
  660. package/dist/src/work-discovery/service.js +12 -11
  661. package/dist/src/workflows/draft/workflow-draft-service.js +1 -1
  662. package/dist/src/workflows/service/workflow-run-service.js +4 -5
  663. package/dist/src/workflows/store/paths.js +1 -1
  664. package/package.json +2 -2
  665. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DWLXHWXg.js +0 -1
  666. package/dist/gateway/static/root/assets/api-Df2D6d3C.js +0 -1
  667. package/dist/gateway/static/root/assets/apps-page-BzytHIn1.js +0 -1
  668. package/dist/gateway/static/root/assets/automations-workspace-CtSV8tp-.js +0 -7
  669. package/dist/gateway/static/root/assets/browser-settings-page-DrvNA-G2.js +0 -3
  670. package/dist/gateway/static/root/assets/capabilities-D0S3DuAD.js +0 -1
  671. package/dist/gateway/static/root/assets/capabilities-settings-panel-c0k2virA.js +0 -8
  672. package/dist/gateway/static/root/assets/channels-settings-Bkl9fDHc.js +0 -1
  673. package/dist/gateway/static/root/assets/connectors-page-Dw_h-5Qh.js +0 -2
  674. package/dist/gateway/static/root/assets/date-picker-BqcldZoN.js +0 -1
  675. package/dist/gateway/static/root/assets/device-pairing-wizard-C5f4FRpE.js +0 -1
  676. package/dist/gateway/static/root/assets/gateway-settings-D7XbH6Hk.js +0 -1
  677. package/dist/gateway/static/root/assets/home-page-CFJypY6Y.js +0 -1
  678. package/dist/gateway/static/root/assets/index-B4Vwh0H-.css +0 -1
  679. package/dist/gateway/static/root/assets/index-BNubE2Zi.js +0 -89
  680. package/dist/gateway/static/root/assets/local-app-workbench-page-BLKCFXvr.js +0 -2
  681. package/dist/gateway/static/root/assets/local-apps-page-BNFmOkxs.js +0 -1
  682. package/dist/gateway/static/root/assets/logs-page-COxOJsgX.js +0 -2
  683. package/dist/gateway/static/root/assets/management-settings-BX5NtnQ2.js +0 -1
  684. package/dist/gateway/static/root/assets/messages-B1sTgIrE.js +0 -3
  685. package/dist/gateway/static/root/assets/note-detail-panel-DZ0IWx1R.js +0 -5
  686. package/dist/gateway/static/root/assets/notes-page-B9F1uue_.js +0 -8
  687. package/dist/gateway/static/root/assets/popover-select-B-GDnZO9.js +0 -1
  688. package/dist/gateway/static/root/assets/product-delivery-chCjIpvu.js +0 -1
  689. package/dist/gateway/static/root/assets/product-open-page-DEYWx__w.js +0 -1
  690. package/dist/gateway/static/root/assets/project-detail-page-9qMDEKVd.js +0 -1
  691. package/dist/gateway/static/root/assets/projects-page-D4UTOpEm.js +0 -1
  692. package/dist/gateway/static/root/assets/remote-access-hub-CPmOucUB.js +0 -1
  693. package/dist/gateway/static/root/assets/scenes-page-DO8vGorm.js +0 -2
  694. package/dist/gateway/static/root/assets/sessions-page-zu5P0dk5.js +0 -1
  695. package/dist/gateway/static/root/assets/settings-advanced-gate-ClEw-i1l.js +0 -1
  696. package/dist/gateway/static/root/assets/setup-status-panel-DElF2sgq.js +0 -1
  697. package/dist/gateway/static/root/assets/shares-settings-MLolJfoV.js +0 -1
  698. package/dist/gateway/static/root/assets/skill-reload-api-DTPsW9TY.js +0 -1
  699. package/dist/gateway/static/root/assets/skills-page-CNQHhsiv.js +0 -2
  700. package/dist/gateway/static/root/assets/task-detail-page-Dc30oS9J.js +0 -1
  701. package/dist/gateway/static/root/assets/user-model-page-Bq6ab5WJ.js +0 -2
  702. package/dist/gateway/static/root/assets/workflows-page-Ci-4HAYm.js +0 -6
  703. package/dist/packages/gateway-contract/src/proactive.js +0 -136
  704. package/dist/src/commands/agents.config.d.ts +0 -31
  705. package/dist/src/commands/agents.config.js +0 -129
  706. package/dist/src/gateway/hono/routes/config-patch/agents.d.ts +0 -2
  707. package/dist/src/gateway/hono/routes/config-patch/agents.js +0 -6
  708. package/dist/src/storage/sqlite/relationship-settings-repository.d.ts +0 -17
  709. package/dist/src/storage/sqlite/relationship-settings-repository.js +0 -65
@@ -5,31 +5,31 @@ import { init_log_stream, subscribeToLogs } from "../utils/logger/log-stream.js"
5
5
  import { getRuntimeLogStats } from "../utils/logger/stats.js";
6
6
  import { createLogger } from "../utils/logger/index.js";
7
7
  import { init_logger } from "../utils/logger.js";
8
- import { closeXopcDatabase, openXopcDatabase } from "../storage/sqlite/connection.js";
8
+ import { closeXopcDatabase } 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
+ import { getBrowserTabBindingById, init_browser_tab_binding_repository } from "../storage/sqlite/browser-tab-binding-repository.js";
11
11
  import { findSessionInput, init_session_input_repository, insertSessionInput } from "../storage/sqlite/session-input-repository.js";
12
12
  import { TaskRepository } from "../tasks/task-repository.js";
13
13
  import { TaskRunRepository, init_task_run_repository } from "../tasks/task-run-repository.js";
14
14
  import { init_changes, notifyUserContextChange } from "../user-context/changes.js";
15
15
  import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
16
- import { init_session_repository, patchSessionMetadata } from "../storage/sqlite/session-repository.js";
17
- import { getSessionConfig } from "../storage/sqlite/config-repository.js";
18
- import "../storage/sqlite/index.js";
16
+ import { init_session_repository, listSessionMetadata, patchSessionMetadata } from "../storage/sqlite/session-repository.js";
17
+ import { getSessionConfig, init_config_repository } from "../storage/sqlite/config-repository.js";
18
+ import { init_sqlite } from "../storage/sqlite/index.js";
19
+ import { normalizeAgentId } from "../agent-catalog/id.js";
20
+ import { init_agent_scope, listAgentEntries, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
21
+ import { init_paths, resolveConfigPath, resolveExtensionsDir } from "../config/paths.js";
22
+ import { init_config, resolveKnowledgeReadPolicy } from "../user-context/config.js";
19
23
  import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
20
- import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
21
24
  import { init_agent_session_key, resolveAgentMainConversationId } from "../routing/agent-session-key.js";
22
25
  import { init_session_key, resolveConversationId, sanitizeSegment } from "../routing/session-key.js";
23
26
  import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
24
27
  import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
25
- import { init_paths, resolveConfigPath, resolveExtensionsDir } from "../config/paths.js";
26
- import { areExtensionsGloballyDisabled } from "../extensions/discover-extensions.js";
27
- import { buildExtensionMetadataSnapshot } from "../extensions/extension-metadata-snapshot.js";
28
- import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, init_channel_catalog_service } from "../channels/catalog/channel-catalog-service.js";
29
- import { loadConfig, saveConfig } from "../config/loader.js";
30
28
  import { prewarmModelRegistry } from "../providers/model-registry.js";
31
29
  import { init_providers, providers_exports } from "../providers/index.js";
32
30
  import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
31
+ import { listKnowledgeItems } from "../knowledge-memory/repository.js";
32
+ import "../knowledge-memory/index.js";
33
33
  import { getEmbeddedExecutionSession } from "../agent/embedded/execution-context.js";
34
34
  import { disposeAllSessionMcpRuntimes } from "../agent/mcp/bundle-mcp-runtime.js";
35
35
  import { DomainOutboxDispatcher } from "../infra/domain-outbox-dispatcher.js";
@@ -52,18 +52,24 @@ import "../automations/index.js";
52
52
  import { TaskRunDispatcher } from "../tasks/task-run-dispatcher.js";
53
53
  import "../tasks/index.js";
54
54
  import "../agent/mcp/bundle-mcp-tools.js";
55
+ import { areExtensionsGloballyDisabled } from "../extensions/discover-extensions.js";
55
56
  import { SessionIndex } from "../session/manager.js";
56
57
  import "../session/index.js";
57
58
  import { ExtensionLoader } from "../extensions/loader.js";
59
+ import { buildExtensionMetadataSnapshot } from "../extensions/extension-metadata-snapshot.js";
58
60
  import "../extensions/index.js";
61
+ import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot } from "../channels/catalog/channel-catalog-service.js";
62
+ import { loadConfig, saveConfig } from "../config/loader.js";
59
63
  import { MessageBus, MessageBusShutdownError } from "../infra/bus/queue.js";
60
64
  import "../infra/bus/index.js";
61
65
  import { collectMediaUrisFromMessages, deleteMediaUris } from "../media/session-references.js";
62
66
  import { AgentService } from "../agent/service.js";
63
- import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
67
+ import { bootstrapApplicationStateSync } from "../bootstrap/application-state.js";
64
68
  import { setPairingBroadcastSink } from "../channels/pairing/pairing-events.js";
65
69
  import { registerClarificationChannelRuntime } from "./clarify-runtime.js";
66
70
  import { ChannelManager } from "../channels/manager.js";
71
+ import { ChatPreviewService } from "../chat-previews/service.js";
72
+ import "../chat-previews/index.js";
67
73
  import { getWorkspacePath } from "../config/workspace-path-helpers.js";
68
74
  import "../config/index.js";
69
75
  import { ManagedComposioEventPoller } from "../connectors/composio-managed-events.js";
@@ -100,6 +106,7 @@ import { WorkflowRunService } from "../workflows/service/workflow-run-service.js
100
106
  import { WorkflowSessionBridge } from "../workflows/service/workflow-session-bridge.js";
101
107
  import { EphemeralSideChatManager } from "./side-chat/manager.js";
102
108
  import { SideChatRunService } from "./side-chat/run-service.js";
109
+ import { SideChatPromotionService } from "./side-chat/promotion-service.js";
103
110
  import "./side-chat/index.js";
104
111
  import { wireTunnelEventsToGateway } from "../tunnel/gateway-lifecycle.js";
105
112
  import { getExposureManager } from "../remote-access/exposure-manager.js";
@@ -112,7 +119,6 @@ import { assertGatewayRuntimeConfig } from "./runtime-config.js";
112
119
  import { auditGatewayConfig } from "./security/audit.js";
113
120
  import { getXopcCloudCatalogCoordinator } from "../providers/xopc-cloud-catalog-coordinator.js";
114
121
  import { ModelCatalogSyncService } from "../providers/model-catalog-sync-service.js";
115
- import { runBootstrapMigrationsSync } from "../migrations/runner.js";
116
122
  import { NotificationService } from "../notifications/service.js";
117
123
  import "../local-apps/index.js";
118
124
  import { createRuntimeBrowserAutomationService } from "../browser/automations/runtime-service.js";
@@ -134,14 +140,19 @@ import { createGatewayStartupTrace } from "./startup-trace.js";
134
140
  import { GatewaySceneHost } from "./scenes/host.js";
135
141
  import { checkAppContextAccess, prepareAppContext } from "./service/app-context-access.js";
136
142
  import { applyAutomaticVoiceLanguage, inferProductLanguageFromEnvironment, initializeVoiceDefaults } from "../voice/language-profile.js";
143
+ import { HomeIntelligenceHost } from "../home-intelligence/host.js";
144
+ import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
145
+ import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
146
+ import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
137
147
  import crypto from "node:crypto";
138
148
  //#region src/gateway/service.ts
139
149
  init_session_repository();
140
150
  init_agent_session_key();
151
+ init_browser_tab_binding_repository();
141
152
  init_session_input_repository();
153
+ init_config_repository();
142
154
  init_changes();
143
155
  init_agent_scope();
144
- init_channel_catalog_service();
145
156
  init_schema();
146
157
  init_providers();
147
158
  init_logger();
@@ -150,8 +161,10 @@ init_paths();
150
161
  init_package_version();
151
162
  init_resolve_route();
152
163
  init_session_key();
164
+ init_sqlite();
153
165
  init_task_run_repository();
154
166
  init_transaction();
167
+ init_config();
155
168
  const log = createLogger("Gateway:Service");
156
169
  var GatewayService = class {
157
170
  bus;
@@ -165,6 +178,7 @@ var GatewayService = class {
165
178
  extensionLoader = null;
166
179
  extensionMetadataSnapshot = null;
167
180
  sceneHost = null;
181
+ homeIntelligenceHost = null;
168
182
  sessionIndex;
169
183
  running = false;
170
184
  startTime = Date.now();
@@ -192,7 +206,7 @@ var GatewayService = class {
192
206
  const messages = await this.sessionIndex.loadMessages(conversationId);
193
207
  const after = await this.sessionIndex.getSessionMetadata(conversationId);
194
208
  if (after?.transcriptId !== expectedTranscriptId) throw new Error("Conversation changed while loading voice context");
195
- const profile = resolveEffectiveAgentProfileForSession(this.config, conversationId);
209
+ const profile = resolveEffectiveAgentProfileForSession(conversationId);
196
210
  const persona = buildVoicePersonaContext({
197
211
  getConfig: () => this.config,
198
212
  conversationId,
@@ -301,6 +315,7 @@ var GatewayService = class {
301
315
  /** Process-local, non-persistent side conversations forked from durable sessions. */
302
316
  sideChats;
303
317
  sideChatRuns;
318
+ sideChatPromotions;
304
319
  /**
305
320
  * Session CRUD / search / compaction / tag-archive-pin / stats — the gateway
306
321
  * REST surface for sessions. Routes should depend on this narrow service
@@ -329,6 +344,8 @@ var GatewayService = class {
329
344
  discussionSealer;
330
345
  /** Local user-created apps, their coder projects, previews, and installs. */
331
346
  localApps;
347
+ /** Immutable, conversation-scoped UI previews that do not create projects. */
348
+ chatPreviews;
332
349
  get sceneAccess() {
333
350
  return this.sceneHost ? {
334
351
  services: this.sceneHost.http,
@@ -342,14 +359,9 @@ var GatewayService = class {
342
359
  this.serviceConfig = serviceConfig;
343
360
  this.bus = new MessageBus();
344
361
  this.configPath = serviceConfig.configPath || resolveConfigPath();
345
- runBootstrapMigrationsSync(this.configPath);
362
+ bootstrapApplicationStateSync(this.configPath);
346
363
  this.config = loadConfig(this.configPath);
347
364
  let bootstrapConfigChanged = initializeVoiceDefaults(this.config, inferProductLanguageFromEnvironment());
348
- const starterResult = ensureStarterAgentsInitialized(this.config);
349
- if (starterResult.changed) {
350
- this.config = starterResult.config;
351
- bootstrapConfigChanged = true;
352
- }
353
365
  if (sanitizeTunnelConfig(this.config)) bootstrapConfigChanged = true;
354
366
  if (bootstrapConfigChanged) saveConfig(this.config, this.configPath).catch((err) => {
355
367
  const em = err instanceof Error ? err.message : String(err);
@@ -467,6 +479,7 @@ var GatewayService = class {
467
479
  getExtensionLoader: () => this.extensionLoader,
468
480
  emit: (type, payload) => this.emit(type, payload)
469
481
  });
482
+ this.chatPreviews = new ChatPreviewService({ localApps: this.localApps });
470
483
  this.agentRunner = new GatewayAgentRunner({
471
484
  validateConnectionResume: async (input) => {
472
485
  for (const source of input.contextSnapshots ?? []) if (source.kind === "app_context") await checkAppContextAccess(source, this.appContextDispatcher(), this.auth);
@@ -529,6 +542,7 @@ var GatewayService = class {
529
542
  let sideChatRuns;
530
543
  this.sideChats = new EphemeralSideChatManager({
531
544
  getParentMetadata: (conversationId) => this.sessionIndex.getSessionMetadata(conversationId),
545
+ getParentConfig: async (conversationId) => getSessionConfig(conversationId),
532
546
  loadParentMessages: (conversationId) => this.sessionIndex.getStore().load(conversationId),
533
547
  getDefaultModelRef: (conversationId) => this.ensureAgentService().getModelForSession(conversationId),
534
548
  getDefaultThinkingLevel: (conversationId) => this.ensureAgentService().getThinkingLevelForSession(conversationId),
@@ -550,6 +564,11 @@ var GatewayService = class {
550
564
  publishRealtime: (topic, event, data) => this.realtime.broker.publish(topic, event, data),
551
565
  completeRealtimeTopic: (topic) => this.realtime.completeTopic(topic)
552
566
  });
567
+ this.sideChatPromotions = new SideChatPromotionService({
568
+ manager: this.sideChats,
569
+ sessionIndex: this.sessionIndex,
570
+ getAgentService: () => this.ensureAgentService()
571
+ });
553
572
  this.sessions = new GatewaySessionsApi({
554
573
  sessionIndex: this.sessionIndex,
555
574
  getAgentService: () => this.ensureAgentService(),
@@ -591,11 +610,23 @@ var GatewayService = class {
591
610
  refreshUserProfileContext() {
592
611
  this._agentService?.refreshUserProfileContext();
593
612
  }
613
+ /** Refresh long-lived runtime caches after an Agent catalog mutation. */
614
+ refreshAgentCatalog() {
615
+ this._agentService?.applyRuntimeConfiguration(this.config);
616
+ this.reconcileMemoryMaintenanceAutomations().catch((error) => {
617
+ const errorMessage = error instanceof Error ? error.message : String(error);
618
+ log.warn({
619
+ err: error,
620
+ errorMessage
621
+ }, `Agent catalog refresh failed: ${errorMessage}`);
622
+ });
623
+ this.emit("agent.catalog", {});
624
+ }
594
625
  ensureAgentService() {
595
626
  if (this._agentService) return this._agentService;
596
627
  this._agentService = new AgentService(this.bus, {
597
628
  workspace: this.workspacePath,
598
- model: getAgentDefaultModelRef(this.config),
629
+ model: getAgentDefaultModelRef(),
599
630
  config: this.config,
600
631
  sessionStore: this.sessionIndex.getStore(),
601
632
  onSessionMetadataUpdated: (conversationId, patch) => {
@@ -627,8 +658,10 @@ var GatewayService = class {
627
658
  getProjectService: () => this.projects,
628
659
  getWorkDiscovery: () => this._workDiscovery ?? void 0,
629
660
  getLocalAppService: () => this.localApps,
661
+ getChatPreviewService: () => this.chatPreviews,
630
662
  dispatchTaskEvents: () => this.dispatchTaskEvents(),
631
663
  dispatchTaskRuns: () => this.dispatchTaskRuns(),
664
+ onAgentCatalogMutate: () => this.refreshAgentCatalog(),
632
665
  getWorkflowRunService: () => this.createWorkflowRunService(),
633
666
  sourceContextResolver: async (binding) => {
634
667
  if (binding.kind === "note") {
@@ -662,7 +695,7 @@ var GatewayService = class {
662
695
  });
663
696
  this.automationService.setDeps({
664
697
  agentService: this._agentService,
665
- getDefaultAgentId: () => getDefaultAgentId(this.config),
698
+ getDefaultAgentId: () => getDefaultAgentId(),
666
699
  prepareAgentSession: (input) => prepareAutomationAgentSession(this.sessionIndex.getStore(), this.projects, input),
667
700
  workflowRunService: this.createWorkflowRunService(),
668
701
  browserAutomationService: this.browserAutomations,
@@ -1005,6 +1038,8 @@ var GatewayService = class {
1005
1038
  await this.stop().catch((cleanupError) => log.error({ err: cleanupError }, "Gateway startup cleanup failed"));
1006
1039
  await this.sceneHost?.stop();
1007
1040
  this.sceneHost = null;
1041
+ this.homeIntelligenceHost?.stop();
1042
+ this.homeIntelligenceHost = null;
1008
1043
  this.stopRealtimeLogBridge?.();
1009
1044
  this.stopRealtimeLogBridge = null;
1010
1045
  setPairingBroadcastSink(null);
@@ -1020,7 +1055,42 @@ var GatewayService = class {
1020
1055
  this.emit(type, payload);
1021
1056
  });
1022
1057
  log.debug("Starting gateway service...");
1023
- openXopcDatabase();
1058
+ const homeCapabilities = new HomeCapabilityPreflightService({
1059
+ config: () => this.config,
1060
+ agentId: () => resolveDefaultAgentId(),
1061
+ skills: (agentId) => this.agentService.getAgentSkillAvailability(agentId).skills,
1062
+ principalId: "local-owner"
1063
+ });
1064
+ this.homeIntelligenceHost = new HomeIntelligenceHost(getSqliteDatabase(), {
1065
+ principal: {
1066
+ ownerId: "local-owner",
1067
+ workspaceId: this.workspacePath
1068
+ },
1069
+ snapshot: new HomeSnapshotBuilder({
1070
+ projects: () => this.projects.list({ limit: 500 }).items,
1071
+ tasks: () => new TaskRepository().list({ limit: 200 }),
1072
+ knowledge: () => listKnowledgeItems({
1073
+ statuses: ["active"],
1074
+ limit: 200
1075
+ }),
1076
+ knowledgePolicy: () => this.config.userContext.knowledgeMemory.enabled ? resolveKnowledgeReadPolicy(this.config.userContext.knowledgeMemory) : {
1077
+ scopes: [],
1078
+ contentSources: []
1079
+ },
1080
+ sessions: () => listSessionMetadata({
1081
+ limit: 50,
1082
+ excludeArchived: true
1083
+ }).items
1084
+ }),
1085
+ generator: new HomeAdviceGenerator(() => this.config),
1086
+ capabilities: () => homeCapabilities.inventory(),
1087
+ resolveCapabilities: (requirements, options) => homeCapabilities.resolve(requirements, options),
1088
+ publish: (type, payload) => this.realtime.broker.publish("gateway", type, payload),
1089
+ notifyOpportunity: (payload) => this.emit("home.opportunity.ready", payload),
1090
+ locale: () => "en",
1091
+ enabled: () => this.config.userContext.enabled,
1092
+ dispatchTaskRuns: () => this.dispatchTaskRuns()
1093
+ });
1024
1094
  await this.localApps.recoverPendingReleases();
1025
1095
  const { recoverCapabilityImports } = await import("../imports/runtime.js");
1026
1096
  await recoverCapabilityImports();
@@ -1042,7 +1112,7 @@ var GatewayService = class {
1042
1112
  const trace = this.startupTrace;
1043
1113
  const catalogCoordinator = getXopcCloudCatalogCoordinator();
1044
1114
  const catalog = await trace.measure("model-catalog.hydrate", () => catalogCoordinator.hydrate());
1045
- if (getAgentDefaultModelRef(this.config)?.startsWith("xopc-cloud/") && catalog.source === "none") {
1115
+ if (getAgentDefaultModelRef()?.startsWith("xopc-cloud/") && catalog.source === "none") {
1046
1116
  const readiness = await trace.measure("model-catalog.initial-refresh", () => catalogCoordinator.ensure({
1047
1117
  reason: "startup",
1048
1118
  network: "if-empty",
@@ -1065,7 +1135,7 @@ var GatewayService = class {
1065
1135
  runMessageSending: (to, content, channel) => this.agentService.outboundCoordinator.invokeOutboundMessageSending(to, content, channel),
1066
1136
  runMessageSent: (to, content, success, error, channel) => this.agentService.outboundCoordinator.invokeOutboundMessageSent(to, content, success, error, channel)
1067
1137
  });
1068
- this.channelManager.enableOutboundPersistence(getDefaultAgentId(this.config));
1138
+ this.channelManager.enableOutboundPersistence(getDefaultAgentId());
1069
1139
  if (this.extensionLoader) this.extensionLoader.setRuntimeContext({
1070
1140
  bus: this.bus,
1071
1141
  sessionManager: this.sessionIndex,
@@ -1132,7 +1202,7 @@ var GatewayService = class {
1132
1202
  log.debug("Session manager initialized");
1133
1203
  this.automationService.setDeps({
1134
1204
  agentService: this.agentService,
1135
- getDefaultAgentId: () => getDefaultAgentId(this.config),
1205
+ getDefaultAgentId: () => getDefaultAgentId(),
1136
1206
  prepareAgentSession: (input) => prepareAutomationAgentSession(this.sessionIndex.getStore(), this.projects, input),
1137
1207
  workflowRunService: this.createWorkflowRunService(),
1138
1208
  browserAutomationService: this.browserAutomations,
@@ -1185,7 +1255,7 @@ var GatewayService = class {
1185
1255
  });
1186
1256
  this.connectorLearningCoordinator = startConnectorLearningCoordinator({
1187
1257
  getConfig: () => this.config,
1188
- resolveAgentId: () => resolveDefaultAgentId(this.config),
1258
+ resolveAgentId: () => resolveDefaultAgentId(),
1189
1259
  emit: (type, payload) => this.emit(type, payload)
1190
1260
  });
1191
1261
  this.managedComposioEventPoller = new ManagedComposioEventPoller({
@@ -1200,7 +1270,7 @@ var GatewayService = class {
1200
1270
  });
1201
1271
  this.managedComposioEventPoller.start();
1202
1272
  this.connectedKnowledgeCoordinator = startConnectedKnowledgeCoordinator({ resolvePipelineOptions: () => ({
1203
- agentId: resolveDefaultAgentId(this.config),
1273
+ agentId: resolveDefaultAgentId(),
1204
1274
  workspaceId: this.currentWorkspacePath
1205
1275
  }) });
1206
1276
  import("../browser/providers/browser-ext-install.js").then(({ ensureBrowserExtensionOnStartup }) => ensureBrowserExtensionOnStartup(this.config)).catch((err) => log.warn({ err }, "Browser extension artifact ensure failed"));
@@ -1219,10 +1289,11 @@ var GatewayService = class {
1219
1289
  triggerInProcessRestart: () => this.triggerGatewayProcessRestart()
1220
1290
  });
1221
1291
  wireTunnelEventsToGateway(this);
1222
- import("../share/share-auto.js").then(({ runStagingSweep }) => runStagingSweep([...new Set([getDefaultAgentId(this.config), ...listAgentEntries(this.config).map((entry) => entry.id)])].map((agentId) => resolveAgentWorkspaceDir(this.config, agentId)))).catch((err) => log.warn({ err }, "Share staging sweep failed"));
1292
+ import("../share/share-auto.js").then(({ runStagingSweep }) => runStagingSweep([...new Set([getDefaultAgentId(), ...listAgentEntries().map((entry) => entry.id)])].map((agentId) => resolveAgentWorkspaceDir(agentId)))).catch((err) => log.warn({ err }, "Share staging sweep failed"));
1223
1293
  if (this.serviceConfig.deferChannelConnectUntilAfterHttp !== true) this.markGatewayReady();
1224
1294
  else trace.mark("service.started-awaiting-http");
1225
1295
  this.sceneHost?.start();
1296
+ this.homeIntelligenceHost.start();
1226
1297
  log.debug("Gateway service started");
1227
1298
  }
1228
1299
  /** Called when the HTTP listener is bound (before deferred channel work). */
@@ -1318,6 +1389,8 @@ var GatewayService = class {
1318
1389
  await this.sideChats.disposeAll();
1319
1390
  await this.sceneHost?.stop();
1320
1391
  this.sceneHost = null;
1392
+ this.homeIntelligenceHost?.stop();
1393
+ this.homeIntelligenceHost = null;
1321
1394
  this.realtime.close();
1322
1395
  this.voiceRealtime.close();
1323
1396
  await this.discussionWorker.stop();
@@ -1605,6 +1678,10 @@ var GatewayService = class {
1605
1678
  get currentWorkspacePath() {
1606
1679
  return this.workspacePath;
1607
1680
  }
1681
+ get homeIntelligence() {
1682
+ if (!this.homeIntelligenceHost) throw new Error("Home intelligence is not running");
1683
+ return this.homeIntelligenceHost;
1684
+ }
1608
1685
  get messageBusInstance() {
1609
1686
  return this.bus;
1610
1687
  }
@@ -1660,15 +1737,15 @@ var GatewayService = class {
1660
1737
  }
1661
1738
  collectWorkflowAgentIds() {
1662
1739
  const ids = /* @__PURE__ */ new Set();
1663
- ids.add(resolveDefaultAgentId(this.config));
1664
- for (const entry of listAgentEntries(this.config)) {
1740
+ ids.add(resolveDefaultAgentId());
1741
+ for (const entry of listAgentEntries()) {
1665
1742
  if (entry.enabled === false) continue;
1666
1743
  ids.add(normalizeAgentId(entry.id));
1667
1744
  }
1668
1745
  return [...ids];
1669
1746
  }
1670
1747
  /** Process a message directly through the agent (for CLI mode). */
1671
- async processDirect(content, conversationId = resolveAgentMainConversationId({ agentId: getDefaultAgentId(this.config) })) {
1748
+ async processDirect(content, conversationId = resolveAgentMainConversationId({ agentId: getDefaultAgentId() })) {
1672
1749
  return this.agentService.turnDispatcher.processDirect(content, conversationId, {
1673
1750
  type: "system",
1674
1751
  source: "internal"
@@ -1676,6 +1753,13 @@ var GatewayService = class {
1676
1753
  }
1677
1754
  emit(type, payload) {
1678
1755
  if (type === "config.reload") notifyUserContextChange({ kind: "policy" });
1756
+ if (type === "connector.learning.updated" && payload && typeof payload === "object") {
1757
+ const job = payload;
1758
+ if (job.status === "completed" && typeof job.sourceInstanceId === "string" && typeof job.updatedAt === "string") this.homeIntelligenceHost?.sourceChanged({
1759
+ sourceInstanceId: job.sourceInstanceId,
1760
+ revision: job.updatedAt
1761
+ });
1762
+ }
1679
1763
  this.realtime.broker.publish("gateway", type, payload);
1680
1764
  this.createNotificationService().handleGatewayEvent(type, payload);
1681
1765
  }
@@ -1720,6 +1804,12 @@ var GatewayService = class {
1720
1804
  });
1721
1805
  }
1722
1806
  if (event.type.startsWith("task.")) this.emit(event.type, event.payload);
1807
+ if (event.type.startsWith("task.") || event.type.startsWith("project.")) {
1808
+ const payload = event.payload;
1809
+ const objectId = event.type.startsWith("task.") ? payload.taskId : payload.projectId;
1810
+ const revision = payload.version ?? payload.revision ?? "unknown";
1811
+ this.homeIntelligenceHost?.requestRefresh(event.type.startsWith("task.") ? "task_changed" : "project_changed", `domain:${event.type}:${String(objectId)}:${String(revision)}`);
1812
+ }
1723
1813
  this.automationService.triggerEvent(event).catch((err) => {
1724
1814
  const em = err instanceof Error ? err.message : String(err);
1725
1815
  log.warn({
@@ -1,11 +1,11 @@
1
1
  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
- import { hasGatewayScope } from "./security/gateway-scopes.js";
4
+ import { hasGatewayScope, init_gateway_scopes } from "./security/gateway-scopes.js";
5
5
  import { TaskRepository, init_task_repository } from "../tasks/task-repository.js";
6
6
  import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
7
7
  import { init_session_repository } from "../storage/sqlite/session-repository.js";
8
- import { getSessionConfig } from "../storage/sqlite/config-repository.js";
8
+ import { getSessionConfig, init_config_repository } from "../storage/sqlite/config-repository.js";
9
9
  import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
10
10
  import { getExecutionEnvironmentForSession } from "../execution-environments/subject.js";
11
11
  import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
@@ -14,10 +14,12 @@ import { runExec } from "../infra/exec.js";
14
14
  import { isSessionSourceBinding } from "../agent/source-context/types.js";
15
15
  import { realpath, stat } from "node:fs/promises";
16
16
  //#region src/gateway/session-context-summary.ts
17
+ init_config_repository();
17
18
  init_session_repository();
18
19
  init_transaction();
19
20
  init_task_repository();
20
21
  init_logger();
22
+ init_gateway_scopes();
21
23
  const log = createLogger("SessionContextSummary");
22
24
  const SOURCE_LIMIT = 20;
23
25
  async function readEnvironment(config, conversationId, projectId) {
@@ -1,5 +1,7 @@
1
1
  export { EphemeralSideChatManager, SideChatError, parseThinkingLevel } from './manager.js';
2
- export type { EphemeralSideChatManagerOptions } from './manager.js';
2
+ export type { EphemeralSideChatManagerOptions, SideChatPromotionSnapshot } from './manager.js';
3
3
  export { validateSideChatSelections } from './context-snapshot.js';
4
4
  export { SideChatRunService } from './run-service.js';
5
+ export { SideChatPromotionService } from './promotion-service.js';
6
+ export type { SideChatPromotionResult, SideChatPromotionServiceOptions } from './promotion-service.js';
5
7
  export type { CreateSideChatInput, SideChatConfig, SideChatContextSnapshot, SideChatSelection, SideChatStatus, SideChatView, } from './types.js';
@@ -1,4 +1,5 @@
1
1
  import { validateSideChatSelections } from "./context-snapshot.js";
2
2
  import { EphemeralSideChatManager, SideChatError, parseThinkingLevel } from "./manager.js";
3
3
  import { SideChatRunService } from "./run-service.js";
4
- export { EphemeralSideChatManager, SideChatError, SideChatRunService, parseThinkingLevel, validateSideChatSelections };
4
+ import { SideChatPromotionService } from "./promotion-service.js";
5
+ export { EphemeralSideChatManager, SideChatError, SideChatPromotionService, SideChatRunService, parseThinkingLevel, validateSideChatSelections };
@@ -1,7 +1,18 @@
1
1
  import type { AgentMessage, ThinkingLevel } from '@earendil-works/pi-agent-core';
2
2
  import { InMemoryTranscriptRuntime } from '../../agent/embedded/transcript-runtime.js';
3
+ import type { SessionAgentConfig } from '../../session/config-types.js';
4
+ import type { TranscriptStoredRow } from '../../session/session-context-for-llm.js';
3
5
  import type { SessionMetadata } from '../../session/types.js';
4
6
  import type { CreateSideChatInput, SideChatConfig, SideChatStatus, SideChatView } from './types.js';
7
+ export interface SideChatPromotionSnapshot {
8
+ id: string;
9
+ parentMetadata: SessionMetadata;
10
+ parentConfig: SessionAgentConfig | null;
11
+ context: SideChatView['context'];
12
+ config: SideChatConfig;
13
+ contextMessages: AgentMessage[];
14
+ conversationRows: TranscriptStoredRow[];
15
+ }
5
16
  export declare class SideChatError extends Error {
6
17
  readonly code: 'INVALID_REQUEST' | 'NOT_FOUND' | 'PARENT_NOT_FOUND' | 'LIMIT_REACHED' | 'CAPACITY_REACHED' | 'CONFLICT' | 'EXPIRED';
7
18
  readonly reason?: 'idle' | 'waiting';
@@ -9,6 +20,7 @@ export declare class SideChatError extends Error {
9
20
  }
10
21
  export interface EphemeralSideChatManagerOptions {
11
22
  getParentMetadata: (conversationId: string) => Promise<SessionMetadata | null>;
23
+ getParentConfig?: (conversationId: string) => Promise<SessionAgentConfig | null>;
12
24
  loadParentMessages: (conversationId: string) => Promise<AgentMessage[]>;
13
25
  getDefaultModelRef: (conversationId: string) => string;
14
26
  getDefaultThinkingLevel?: (conversationId: string) => ThinkingLevel;
@@ -39,12 +51,16 @@ export declare class EphemeralSideChatManager {
39
51
  get(id: string, clientInstanceId: string): SideChatView;
40
52
  getRuntime(id: string, clientInstanceId: string): InMemoryTranscriptRuntime;
41
53
  getMessages(id: string, clientInstanceId: string): AgentMessage[];
54
+ beginPromotion(id: string, clientInstanceId: string): SideChatPromotionSnapshot;
55
+ cancelPromotion(id: string, clientInstanceId: string): void;
42
56
  updateConfig(id: string, clientInstanceId: string, patch: Partial<SideChatConfig>): SideChatView;
43
57
  heartbeat(id: string, clientInstanceId: string): SideChatView;
44
58
  extend(id: string, clientInstanceId: string): SideChatView;
45
59
  setStatus(id: string, clientInstanceId: string, status: SideChatStatus, runId?: string): SideChatView;
46
60
  waitForInput(id: string, clientInstanceId: string, clarification: NonNullable<SideChatView['clarification']>, status?: 'waiting-input' | 'waiting-approval'): void;
47
61
  dispose(id: string, clientInstanceId: string): Promise<boolean>;
62
+ disposePromoted(id: string, clientInstanceId: string): Promise<boolean>;
63
+ private disposeEntry;
48
64
  disposeClient(clientInstanceId: string): Promise<number>;
49
65
  sweepExpired(at?: number): Promise<number>;
50
66
  disposeAll(): Promise<void>;
@@ -70,6 +70,7 @@ var EphemeralSideChatManager = class {
70
70
  const metadata = await this.options.getParentMetadata(parentConversationId);
71
71
  if (!metadata || !metadata.transcriptId) throw new SideChatError("Parent session not found", "PARENT_NOT_FOUND");
72
72
  const parentMessages = await this.options.loadParentMessages(parentConversationId);
73
+ const parentConfig = await this.options.getParentConfig?.(parentConversationId) ?? null;
73
74
  if (this.stopped) throw new SideChatError("Gateway is stopping", "CAPACITY_REACHED");
74
75
  let selections;
75
76
  try {
@@ -110,7 +111,9 @@ var EphemeralSideChatManager = class {
110
111
  createdAt
111
112
  }),
112
113
  config,
113
- runtime
114
+ runtime,
115
+ parentMetadata: structuredClone(metadata),
116
+ parentConfig: structuredClone(parentConfig)
114
117
  };
115
118
  this.entries.set(id, entry);
116
119
  return this.toView(entry);
@@ -127,6 +130,29 @@ var EphemeralSideChatManager = class {
127
130
  entry.messageCount = messages.length;
128
131
  return structuredClone(messages);
129
132
  }
133
+ beginPromotion(id, clientInstanceId) {
134
+ const entry = this.requireEntry(id, clientInstanceId);
135
+ if (entry.status !== "idle") throw new SideChatError("Side chat is busy", "CONFLICT");
136
+ const conversationRows = entry.runtime.loadConversationRows();
137
+ if (entry.runtime.loadConversationMessages().length === 0) throw new SideChatError("Side chat has no messages to save", "INVALID_REQUEST");
138
+ entry.status = "promoting";
139
+ entry.expiresAt = null;
140
+ return structuredClone({
141
+ id: entry.id,
142
+ parentMetadata: entry.parentMetadata,
143
+ parentConfig: entry.parentConfig,
144
+ context: entry.context,
145
+ config: entry.config,
146
+ contextMessages: entry.runtime.loadBaselineMessages(),
147
+ conversationRows
148
+ });
149
+ }
150
+ cancelPromotion(id, clientInstanceId) {
151
+ const entry = this.requireEntry(id, clientInstanceId);
152
+ if (entry.status !== "promoting") return;
153
+ entry.status = "idle";
154
+ this.touchEntry(entry);
155
+ }
130
156
  updateConfig(id, clientInstanceId, patch) {
131
157
  const entry = this.requireEntry(id, clientInstanceId);
132
158
  if (entry.status !== "idle") throw new SideChatError("Cannot change config while a run is active", "CONFLICT");
@@ -162,6 +188,14 @@ var EphemeralSideChatManager = class {
162
188
  this.requireEntry(id, clientInstanceId).clarification = clarification;
163
189
  }
164
190
  async dispose(id, clientInstanceId) {
191
+ const entry = this.entries.get(id);
192
+ if (entry?.clientInstanceId === clientInstanceId && entry.status === "promoting") throw new SideChatError("Side chat is being saved", "CONFLICT");
193
+ return this.disposeEntry(id, clientInstanceId);
194
+ }
195
+ disposePromoted(id, clientInstanceId) {
196
+ return this.disposeEntry(id, clientInstanceId);
197
+ }
198
+ async disposeEntry(id, clientInstanceId) {
165
199
  const entry = this.entries.get(id);
166
200
  if (!entry) {
167
201
  const pending = this.disposals.get(id);
@@ -187,8 +221,8 @@ var EphemeralSideChatManager = class {
187
221
  return cleanup;
188
222
  }
189
223
  async disposeClient(clientInstanceId) {
190
- const ids = [...this.entries.values()].filter((entry) => entry.clientInstanceId === clientInstanceId).map((entry) => entry.id);
191
- await Promise.all(ids.map((id) => this.dispose(id, clientInstanceId)));
224
+ const ids = [...this.entries.values()].filter((entry) => entry.clientInstanceId === clientInstanceId && entry.status !== "promoting").map((entry) => entry.id);
225
+ await Promise.all(ids.map((id) => this.disposeEntry(id, clientInstanceId)));
192
226
  return ids.length;
193
227
  }
194
228
  async sweepExpired(at = this.now()) {
@@ -201,7 +235,7 @@ var EphemeralSideChatManager = class {
201
235
  if (this.sweepTimer) clearInterval(this.sweepTimer);
202
236
  this.stopped = true;
203
237
  const entries = [...this.entries.values()];
204
- await Promise.all(entries.map((entry) => this.dispose(entry.id, entry.clientInstanceId)));
238
+ await Promise.all(entries.map((entry) => this.disposeEntry(entry.id, entry.clientInstanceId)));
205
239
  await Promise.all([...this.disposals.values()].map((entry) => entry.promise));
206
240
  this.expired.clear();
207
241
  }
@@ -229,7 +263,7 @@ var EphemeralSideChatManager = class {
229
263
  removeAt: this.now() + DEFAULT_IDLE_TTL_MS
230
264
  });
231
265
  this.pruneExpiredRecords(this.now());
232
- const cleanup = this.dispose(entry.id, entry.clientInstanceId);
266
+ const cleanup = this.disposeEntry(entry.id, entry.clientInstanceId);
233
267
  try {
234
268
  this.options.onExpired?.(entry.id, entry.clientInstanceId, reason);
235
269
  } catch (err) {
@@ -245,7 +279,7 @@ var EphemeralSideChatManager = class {
245
279
  while (this.expired.size > MAX_EXPIRED_RECORDS) this.expired.delete(this.expired.keys().next().value);
246
280
  }
247
281
  toView(entry) {
248
- const { runtime: _runtime, ...view } = entry;
282
+ const { runtime: _runtime, parentMetadata: _parentMetadata, parentConfig: _parentConfig, ...view } = entry;
249
283
  return structuredClone({
250
284
  ...view,
251
285
  serverNow: new Date(this.now()).toISOString()
@@ -0,0 +1,19 @@
1
+ import type { AgentService } from '../../agent/service.js';
2
+ import type { SessionIndex } from '../../session/manager.js';
3
+ import type { SessionMetadata } from '../../session/types.js';
4
+ import { EphemeralSideChatManager } from './manager.js';
5
+ export interface SideChatPromotionResult {
6
+ conversationId: string;
7
+ created: boolean;
8
+ session: SessionMetadata;
9
+ }
10
+ export interface SideChatPromotionServiceOptions {
11
+ manager: EphemeralSideChatManager;
12
+ sessionIndex: SessionIndex;
13
+ getAgentService: () => AgentService;
14
+ }
15
+ export declare class SideChatPromotionService {
16
+ private readonly options;
17
+ constructor(options: SideChatPromotionServiceOptions);
18
+ promote(sideChatId: string, clientInstanceId: string): Promise<SideChatPromotionResult>;
19
+ }