@xopcai/xopc 0.0.188 → 0.0.190

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 (490) hide show
  1. package/README.md +1 -4
  2. package/README.zh-CN.md +0 -3
  3. package/dist/browser-ext/manifest.json +1 -1
  4. package/dist/extensions/telegram/xopc.extension.json +1 -1
  5. package/dist/gateway/static/root/assets/{activity-store--QoUGhiS.js → activity-store-DstnJCS5.js} +1 -1
  6. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-B0yweLNQ.js → agent-avatar-dicebear-9vAbkroX.js} +1 -1
  7. package/dist/gateway/static/root/assets/agents-D1t4SfMQ.js +68 -0
  8. package/dist/gateway/static/root/assets/{api-5laWqfiE.js → api-BTL9kayv.js} +1 -1
  9. package/dist/gateway/static/root/assets/{app-management-settings-panel-BXJ8Jiv_.js → app-management-settings-panel-DkFeIdBf.js} +1 -1
  10. package/dist/gateway/static/root/assets/{appearance-settings-DG9n9D1M.js → appearance-settings-Bxs8Fpaj.js} +1 -1
  11. package/dist/gateway/static/root/assets/apps-page-Cgrgu5OW.js +1 -0
  12. package/dist/gateway/static/root/assets/{archive-plugin-Ceh5qrZf.js → archive-plugin-Ch2RmLCC.js} +1 -1
  13. package/dist/gateway/static/root/assets/{attachment-load-jFW7uYf7.js → attachment-load-BhMQM_Ky.js} +1 -1
  14. package/dist/gateway/static/root/assets/automations-page-CtJxstKh.js +6 -0
  15. package/dist/gateway/static/root/assets/{binary-plugins-XDlkI1r4.js → binary-plugins-D6CqlymH.js} +1 -1
  16. package/dist/gateway/static/root/assets/{block-editor-kyKc2IhE.js → block-editor-ClL6HEg9.js} +56 -56
  17. package/dist/gateway/static/root/assets/browser-settings-page-DW99iDmD.js +8 -0
  18. package/dist/gateway/static/root/assets/{browser-workflow-inputs-BJa5Iz_v.js → browser-workflow-inputs-BYy48VhN.js} +1 -1
  19. package/dist/gateway/static/root/assets/{browser-workflows-page-CTQQOsn5.js → browser-workflows-page-zgLibuMH.js} +2 -2
  20. package/dist/gateway/static/root/assets/capabilities-settings-panel-CHUrT9EB.js +7 -0
  21. package/dist/gateway/static/root/assets/capability-presets-api-BB8t4Ja7.js +1 -0
  22. package/dist/gateway/static/root/assets/capability-presets-settings-panel-Cycrv0YV.js +1 -0
  23. package/dist/gateway/static/root/assets/{channel-recipient-api-BgIkWq01.js → channel-recipient-api-BThDGiO3.js} +1 -1
  24. package/dist/gateway/static/root/assets/channels-settings-V96gPUAU.js +1 -0
  25. package/dist/gateway/static/root/assets/channels-status-swr-Cz7SAAkm.js +1 -0
  26. package/dist/gateway/static/root/assets/connectors-api-DS9ED-EL.js +1 -0
  27. package/dist/gateway/static/root/assets/connectors-page-BhlyQoQI.js +2 -0
  28. package/dist/gateway/static/root/assets/cron-expression-CkgsvhtW.js +2 -0
  29. package/dist/gateway/static/root/assets/{desktop-pet-CSwd00CV.js → desktop-pet-Cv8rGhYW.js} +1 -1
  30. package/dist/gateway/static/root/assets/{desktop-pet-settings-CuNQvHGu.js → desktop-pet-settings-CIeJdwfV.js} +1 -1
  31. package/dist/gateway/static/root/assets/{directory-picker-path-field-ct0n5Rje.js → directory-picker-path-field-D8jXEiAY.js} +1 -1
  32. package/dist/gateway/static/root/assets/{extension-debug-page-BeRBuMUU.js → extension-debug-page-CCZ9u6TZ.js} +1 -1
  33. package/dist/gateway/static/root/assets/{extension-page-DbK-Cwao.js → extension-page-CV36ILRG.js} +1 -1
  34. package/dist/gateway/static/root/assets/extension-settings-page-IyQrSILY.js +1 -0
  35. package/dist/gateway/static/root/assets/{gateway-config-api-CC7EvEFp.js → gateway-config-api-D4_r5iJM.js} +1 -1
  36. package/dist/gateway/static/root/assets/gateway-settings-CYlntpBH.js +1 -0
  37. package/dist/gateway/static/root/assets/{gateway-startup-retry-B2DmdlwO.js → gateway-startup-retry-EO9mKvzE.js} +1 -1
  38. package/dist/gateway/static/root/assets/heartbeat-settings-D4SyWob8.js +1 -0
  39. package/dist/gateway/static/root/assets/home-page-B2Kagoh8.js +3 -0
  40. package/dist/gateway/static/root/assets/{image-generation-api-GMTaS6eI.js → image-generation-api-Bu7PyVSh.js} +1 -1
  41. package/dist/gateway/static/root/assets/index-CYT5DOzr.js +150 -0
  42. package/dist/gateway/static/root/assets/index-D6e3tPL-.css +1 -0
  43. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DhGYddbI.js → keyboard-shortcuts-settings-BMhCuVBZ.js} +1 -1
  44. package/dist/gateway/static/root/assets/local-app-workbench-page-BHYbFjqy.js +2 -0
  45. package/dist/gateway/static/root/assets/{local-apps-page-CmnrBmWi.js → local-apps-page-ijIe7_y2.js} +1 -1
  46. package/dist/gateway/static/root/assets/locale-store-deR2zRaE.js +1 -0
  47. package/dist/gateway/static/root/assets/logs-page-IIn8Tess.js +2 -0
  48. package/dist/gateway/static/root/assets/management-settings--V_fovKD.js +1 -0
  49. package/dist/gateway/static/root/assets/{markdown-split-CZaBPOVn.js → markdown-split-Dt9-in6W.js} +1 -1
  50. package/dist/gateway/static/root/assets/{media-plugins-CiKvSgCv.js → media-plugins-B3pj_iO0.js} +1 -1
  51. package/dist/gateway/static/root/assets/messages-B4XqB8I6.js +3 -0
  52. package/dist/gateway/static/root/assets/{notes-page-Bisbzqlz.js → notes-page-DZ366lIT.js} +1 -1
  53. package/dist/gateway/static/root/assets/notes-workbench-S2sBVOLw.js +4 -0
  54. package/dist/gateway/static/root/assets/{page-tabs-BxlwhAbH.js → page-tabs-C5ge434C.js} +1 -1
  55. package/dist/gateway/static/root/assets/{preview-open-alternatives-RM8wXxfT.js → preview-open-alternatives-BFa9DgSV.js} +1 -1
  56. package/dist/gateway/static/root/assets/product-delivery-tRr-7IxY.js +1 -0
  57. package/dist/gateway/static/root/assets/{product-open-page-DdBlibek.js → product-open-page-Dc9CcWdu.js} +1 -1
  58. package/dist/gateway/static/root/assets/project-detail-page-BilzoCJ7.js +1 -0
  59. package/dist/gateway/static/root/assets/projects-page-BoQUyacP.js +1 -0
  60. package/dist/gateway/static/root/assets/remote-access-hub-DUyUaCRF.js +1 -0
  61. package/dist/gateway/static/root/assets/{schema-form-BDKbpmXv.js → schema-form-B84DckWe.js} +1 -1
  62. package/dist/gateway/static/root/assets/{schemas-C6onAggk.js → schemas-zIBW3wiV.js} +1 -1
  63. package/dist/gateway/static/root/assets/sessions-page-Dzxlq1F0.js +1 -0
  64. package/dist/gateway/static/root/assets/settings-advanced-gate-TzwlZxU6.js +1 -0
  65. package/dist/gateway/static/root/assets/settings-form-section-Dp9itvdy.js +1 -0
  66. package/dist/gateway/static/root/assets/{settings-loading-skeleton-DgIp8_S6.js → settings-loading-skeleton-CCtlhoy7.js} +1 -1
  67. package/dist/gateway/static/root/assets/settings-page-DQmMKf8r.js +1 -0
  68. package/dist/gateway/static/root/assets/{settings-page-layout-97LmwrzC.js → settings-page-layout-EQIOJa_L.js} +1 -1
  69. package/dist/gateway/static/root/assets/setup-status-panel-Cwi-SPja.js +1 -0
  70. package/dist/gateway/static/root/assets/{share-preview-page-BH7i3g1S.js → share-preview-page-C4_B2jvf.js} +1 -1
  71. package/dist/gateway/static/root/assets/shares-settings-CkyuGlZK.js +1 -0
  72. package/dist/gateway/static/root/assets/skill-reload-api-BJCePQK5.js +1 -0
  73. package/dist/gateway/static/root/assets/skills-page-BYWLfmJi.js +2 -0
  74. package/dist/gateway/static/root/assets/{skills-page.utils-s-a5WV9j.js → skills-page.utils-Jhm24i4h.js} +1 -1
  75. package/dist/gateway/static/root/assets/{system-settings-panel-BxjeMT5k.js → system-settings-panel-Dpx2ags2.js} +1 -1
  76. package/dist/gateway/static/root/assets/{task-detail-page-BahycnfW.js → task-detail-page-DLAdxI6e.js} +1 -1
  77. package/dist/gateway/static/root/assets/{theme-store-BRxdsmic.js → theme-store-DnBOcGXi.js} +1 -1
  78. package/dist/gateway/static/root/assets/{typed-models-lib-39MjwPSq.js → typed-models-lib-DULmTHUB.js} +1 -1
  79. package/dist/gateway/static/root/assets/use-autosave-BrjVk5VH.js +1 -0
  80. package/dist/gateway/static/root/assets/user-context-page-9AAFpGAL.js +1 -0
  81. package/dist/gateway/static/root/assets/{voice-api-key-field-XU-7sBSg.js → voice-api-key-field-BISTPfq_.js} +1 -1
  82. package/dist/gateway/static/root/assets/{work-discovery-overlay-CJqu8UHq.js → work-discovery-overlay-Wr-uF7VA.js} +1 -1
  83. package/dist/gateway/static/root/assets/work-discovery-page-BWds95sL.js +1 -0
  84. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DXtg8Qxl.js → workflow-run-setup-panel-DHqHP8_6.js} +2 -2
  85. package/dist/gateway/static/root/assets/workflows-page-0b4_DFHr.js +11 -0
  86. package/dist/gateway/static/root/index.html +9 -9
  87. package/dist/package.js +1 -1
  88. package/dist/packages/endpoint-tools-protocol/src/index.js +184 -0
  89. package/dist/packages/gateway-contract/src/tool-activity.js +0 -36
  90. package/dist/packages/realtime-client/src/index.js +256 -0
  91. package/dist/packages/realtime-protocol/src/index.js +88 -0
  92. package/dist/src/agent/agent-manager.d.ts +1 -1
  93. package/dist/src/agent/agent-manager.js +7 -13
  94. package/dist/src/agent/background-review/coordinator.js +1 -1
  95. package/dist/src/agent/background-review/prompts.d.ts +1 -1
  96. package/dist/src/agent/background-review/prompts.js +3 -1
  97. package/dist/src/agent/background-review/run-background-review.d.ts +2 -0
  98. package/dist/src/agent/background-review/run-background-review.js +10 -9
  99. package/dist/src/agent/bootstrap/bootstrap-cache.d.ts +0 -1
  100. package/dist/src/agent/bootstrap/bootstrap-cache.js +3 -4
  101. package/dist/src/agent/bootstrap/bootstrap-files.d.ts +0 -4
  102. package/dist/src/agent/bootstrap/bootstrap-files.js +3 -4
  103. package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -4
  104. package/dist/src/agent/bootstrap/load-bootstrap-files.d.ts +0 -1
  105. package/dist/src/agent/bootstrap/load-bootstrap-files.js +1 -14
  106. package/dist/src/agent/bootstrap/types.d.ts +1 -1
  107. package/dist/src/agent/client-error-format.d.ts +1 -1
  108. package/dist/src/agent/client-error-format.js +1 -1
  109. package/dist/src/agent/context/workspace-templates/SOUL.md +1 -1
  110. package/dist/src/agent/external-tools/endpoint-provider.d.ts +17 -0
  111. package/dist/src/agent/external-tools/endpoint-provider.js +93 -0
  112. package/dist/src/agent/external-tools/gateway-tools.js +1 -1
  113. package/dist/src/agent/external-tools/index.d.ts +4 -5
  114. package/dist/src/agent/external-tools/index.js +8 -2
  115. package/dist/src/agent/external-tools/types.d.ts +8 -1
  116. package/dist/src/agent/external-tools/types.js +2 -1
  117. package/dist/src/agent/inbound/inbound-loop.js +4 -0
  118. package/dist/src/agent/inbound/turn-dispatcher.d.ts +9 -8
  119. package/dist/src/agent/inbound/turn-dispatcher.js +13 -11
  120. package/dist/src/agent/memory/builtin-provider.d.ts +2 -4
  121. package/dist/src/agent/memory/builtin-provider.js +35 -15
  122. package/dist/src/agent/memory/context/types.d.ts +3 -1
  123. package/dist/src/agent/memory/create-memory-manager.js +2 -0
  124. package/dist/src/agent/memory/index.d.ts +1 -1
  125. package/dist/src/agent/memory/index.js +1 -1
  126. package/dist/src/agent/memory/manager.d.ts +9 -1
  127. package/dist/src/agent/memory/manager.js +39 -9
  128. package/dist/src/agent/memory/memory-config.d.ts +1 -1
  129. package/dist/src/agent/memory/memory-config.js +1 -1
  130. package/dist/src/agent/memory/source-origin.js +0 -2
  131. package/dist/src/agent/memory/types.d.ts +5 -1
  132. package/dist/src/agent/memory/understanding/service.d.ts +10 -10
  133. package/dist/src/agent/memory/understanding/service.js +108 -176
  134. package/dist/src/agent/memory/understanding/types.d.ts +7 -8
  135. package/dist/src/agent/memory/user-context-coordinator.d.ts +2 -1
  136. package/dist/src/agent/memory/user-context-coordinator.js +27 -41
  137. package/dist/src/agent/messaging/command-handler.d.ts +2 -2
  138. package/dist/src/agent/messaging/command-handler.js +3 -3
  139. package/dist/src/agent/orchestration/agent-orchestrator.js +4 -7
  140. package/dist/src/agent/prompt/sections/memory-skills.js +4 -4
  141. package/dist/src/agent/prompt/sections/tooling.js +0 -10
  142. package/dist/src/agent/prompt/service-prompt-builder.d.ts +0 -1
  143. package/dist/src/agent/prompt/service-prompt-builder.js +4 -33
  144. package/dist/src/agent/prompt/system-prompt.js +1 -2
  145. package/dist/src/agent/service/async-queue.d.ts +1 -1
  146. package/dist/src/agent/service/async-queue.js +1 -1
  147. package/dist/src/agent/service/direct-turn-helpers.d.ts +1 -1
  148. package/dist/src/agent/service/direct-turn-helpers.js +2 -2
  149. package/dist/src/agent/service/process-direct-one-shot.d.ts +3 -1
  150. package/dist/src/agent/service/process-direct-one-shot.js +1 -1
  151. package/dist/src/agent/service/process-direct-streaming.d.ts +7 -5
  152. package/dist/src/agent/service/process-direct-streaming.js +5 -5
  153. package/dist/src/agent/service.d.ts +2 -3
  154. package/dist/src/agent/service.js +10 -21
  155. package/dist/src/agent/service.types.d.ts +2 -0
  156. package/dist/src/agent/session/index.d.ts +1 -1
  157. package/dist/src/agent/session/session-context.d.ts +2 -0
  158. package/dist/src/agent/session/session-context.js +4 -0
  159. package/dist/src/agent/session/session-state-bag.d.ts +4 -4
  160. package/dist/src/agent/session/session-state-bag.js +1 -1
  161. package/dist/src/agent/skills/marketplace/adapters/clawhub/adapter.js +1 -1
  162. package/dist/src/agent/streaming/reasoning-visibility.d.ts +6 -0
  163. package/dist/src/agent/streaming/{reasoning-visibility-sse.js → reasoning-visibility.js} +3 -6
  164. package/dist/src/agent/tools/dreaming-tool.d.ts +0 -2
  165. package/dist/src/agent/tools/dreaming-tool.js +13 -38
  166. package/dist/src/agent/tools/factory.d.ts +4 -3
  167. package/dist/src/agent/tools/factory.js +2 -10
  168. package/dist/src/agent/tools/index.d.ts +0 -1
  169. package/dist/src/agent/tools/index.js +1 -2
  170. package/dist/src/agent/tools/memory-tool.js +1 -1
  171. package/dist/src/agent/workspace-runtime/registry.d.ts +3 -5
  172. package/dist/src/agent/workspace-runtime/registry.js +2 -15
  173. package/dist/src/agent-manifest/schema.d.ts +17 -17
  174. package/dist/src/agent-runtime/index.js +1 -1
  175. package/dist/src/agent-runtime/memory-runtime.d.ts +2 -2
  176. package/dist/src/agent-runtime/runtime-profile.js +1 -1
  177. package/dist/src/automations/domain/types.d.ts +2 -1
  178. package/dist/src/automations/domain/validation.d.ts +29 -29
  179. package/dist/src/automations/draft/automation-draft-validator.d.ts +3 -3
  180. package/dist/src/automations/service/action-executor.js +4 -1
  181. package/dist/src/channels/pairing/pairing-challenge.d.ts +1 -1
  182. package/dist/src/channels/pairing/pairing-challenge.js +1 -1
  183. package/dist/src/chat-commands/builtins/understanding.js +2 -5
  184. package/dist/src/cli/commands/agent/stream-renderer.js +4 -1
  185. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  186. package/dist/src/cli/commands/extension-marketplace.js +1 -1
  187. package/dist/src/cli/commands/init.js +3 -22
  188. package/dist/src/cli/templates.js +1 -1
  189. package/dist/src/config/index.js +3 -3
  190. package/dist/src/config/paths.d.ts +0 -5
  191. package/dist/src/config/paths.js +2 -11
  192. package/dist/src/config/rules.js +0 -5
  193. package/dist/src/config/schema.d.ts +27 -122
  194. package/dist/src/config/schema.js +9 -42
  195. package/dist/src/config/web-patch.js +0 -1
  196. package/dist/src/connectors/learning-coordinator.js +75 -3
  197. package/dist/src/endpoint-tools/auth.d.ts +20 -0
  198. package/dist/src/endpoint-tools/auth.js +51 -0
  199. package/dist/src/endpoint-tools/index.d.ts +5 -0
  200. package/dist/src/endpoint-tools/index.js +6 -0
  201. package/dist/src/endpoint-tools/invocation-service.d.ts +68 -0
  202. package/dist/src/endpoint-tools/invocation-service.js +190 -0
  203. package/dist/src/endpoint-tools/policy.d.ts +10 -0
  204. package/dist/src/endpoint-tools/policy.js +18 -0
  205. package/dist/src/endpoint-tools/registry.d.ts +45 -0
  206. package/dist/src/endpoint-tools/registry.js +121 -0
  207. package/dist/src/endpoint-tools/runtime.d.ts +23 -0
  208. package/dist/src/endpoint-tools/runtime.js +86 -0
  209. package/dist/src/endpoint-tools/upload-service.d.ts +41 -0
  210. package/dist/src/endpoint-tools/upload-service.js +103 -0
  211. package/dist/src/extensions/types/hooks.d.ts +1 -1
  212. package/dist/src/extensions/update.js +1 -1
  213. package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
  214. package/dist/src/gateway/agent-builtin-tools.js +0 -5
  215. package/dist/src/gateway/agents-admin.d.ts +0 -7
  216. package/dist/src/gateway/agents-admin.js +3 -32
  217. package/dist/src/gateway/chat-stream/protocol.d.ts +0 -1
  218. package/dist/src/gateway/clarify-bridge.d.ts +5 -4
  219. package/dist/src/gateway/clarify-bridge.js +3 -4
  220. package/dist/src/gateway/dreaming-automation-reconciler.d.ts +3 -3
  221. package/dist/src/gateway/dreaming-automation-reconciler.js +48 -88
  222. package/dist/src/gateway/heartbeat/service.js +4 -1
  223. package/dist/src/gateway/hono/app.js +1 -5
  224. package/dist/src/gateway/hono/index.d.ts +0 -1
  225. package/dist/src/gateway/hono/index.js +1 -2
  226. package/dist/src/gateway/hono/lib/config-payload.d.ts +20 -9
  227. package/dist/src/gateway/hono/lib/config-payload.js +3 -2
  228. package/dist/src/gateway/hono/middleware/auth.js +3 -5
  229. package/dist/src/gateway/hono/oauth-async.d.ts +1 -0
  230. package/dist/src/gateway/hono/oauth-async.js +17 -2
  231. package/dist/src/gateway/hono/routes/agent-stream.js +49 -6
  232. package/dist/src/gateway/hono/routes/agents.js +1 -33
  233. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
  234. package/dist/src/gateway/hono/routes/config-patch/gateway.d.ts +2 -2
  235. package/dist/src/gateway/hono/routes/config-patch/gateway.js +0 -19
  236. package/dist/src/gateway/hono/routes/config-patch/misc.js +17 -1
  237. package/dist/src/gateway/hono/routes/connectors.js +13 -12
  238. package/dist/src/gateway/hono/routes/deps.d.ts +0 -2
  239. package/dist/src/gateway/hono/routes/endpoint-tools.d.ts +3 -0
  240. package/dist/src/gateway/hono/routes/endpoint-tools.js +196 -0
  241. package/dist/src/gateway/hono/routes/index.js +6 -2
  242. package/dist/src/gateway/hono/routes/lazy-bundles.js +1 -5
  243. package/dist/src/gateway/hono/routes/logs.js +0 -4
  244. package/dist/src/gateway/hono/routes/public-gateway.js +2 -2
  245. package/dist/src/gateway/hono/routes/realtime.d.ts +3 -0
  246. package/dist/src/gateway/hono/routes/realtime.js +35 -0
  247. package/dist/src/gateway/hono/routes/status.js +0 -7
  248. package/dist/src/gateway/hono/routes/understanding-sources.d.ts +3 -0
  249. package/dist/src/gateway/hono/routes/understanding-sources.js +203 -0
  250. package/dist/src/gateway/hono/routes/work-discovery.d.ts +2 -0
  251. package/dist/src/gateway/hono/routes/work-discovery.js +3 -134
  252. package/dist/src/gateway/hono/routes/workflows.js +1 -1
  253. package/dist/src/gateway/hono/routes/you.d.ts +0 -31
  254. package/dist/src/gateway/hono/routes/you.js +230 -1161
  255. package/dist/src/gateway/index.d.ts +1 -1
  256. package/dist/src/gateway/index.js +1 -2
  257. package/dist/src/gateway/protocol.d.ts +1 -7
  258. package/dist/src/gateway/security/index.js +1 -1
  259. package/dist/src/gateway/security/operator-scopes.js +1 -1
  260. package/dist/src/gateway/server.js +4 -4
  261. package/dist/src/gateway/service/agent-runner.d.ts +11 -9
  262. package/dist/src/gateway/service/agent-runner.js +18 -18
  263. package/dist/src/gateway/service/config-coordinator.d.ts +3 -3
  264. package/dist/src/gateway/service/run-gateway-agent.d.ts +4 -3
  265. package/dist/src/gateway/service/run-gateway-agent.js +15 -17
  266. package/dist/src/gateway/service/session-input-coordinator.d.ts +3 -0
  267. package/dist/src/gateway/service/session-input-coordinator.js +4 -2
  268. package/dist/src/gateway/service/types.d.ts +0 -5
  269. package/dist/src/gateway/service.d.ts +7 -6
  270. package/dist/src/gateway/service.js +43 -26
  271. package/dist/src/infra/update-runner.js +1 -1
  272. package/dist/src/knowledge/connected-knowledge-pipeline.js +1 -1
  273. package/dist/src/knowledge/connected-understanding-pipeline.d.ts +2 -4
  274. package/dist/src/knowledge/connected-understanding-pipeline.js +31 -81
  275. package/dist/src/knowledge/index.js +2 -2
  276. package/dist/src/knowledge/people-graph.d.ts +22 -25
  277. package/dist/src/knowledge/people-graph.js +76 -43
  278. package/dist/src/mcp/channel-bridge.d.ts +6 -9
  279. package/dist/src/mcp/channel-bridge.js +48 -76
  280. package/dist/src/mcp/channel-server.js +2 -6
  281. package/dist/src/proactive/execution/context.js +8 -13
  282. package/dist/src/realtime/broker.d.ts +31 -0
  283. package/dist/src/realtime/broker.js +114 -0
  284. package/dist/src/realtime/runtime.d.ts +20 -0
  285. package/dist/src/realtime/runtime.js +263 -0
  286. package/dist/src/realtime/tickets.d.ts +15 -0
  287. package/dist/src/realtime/tickets.js +38 -0
  288. package/dist/src/realtime/writer.d.ts +15 -0
  289. package/dist/src/realtime/writer.js +78 -0
  290. package/dist/src/share/share-config.js +0 -1
  291. package/dist/src/share/site-share-config.js +0 -1
  292. package/dist/src/storage/sqlite/connector-account-repository.js +0 -1
  293. package/dist/src/storage/sqlite/context-consolidation-repository.d.ts +37 -0
  294. package/dist/src/storage/sqlite/context-consolidation-repository.js +64 -0
  295. package/dist/src/storage/sqlite/endpoint-principal-repository.d.ts +17 -0
  296. package/dist/src/storage/sqlite/endpoint-principal-repository.js +54 -0
  297. package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.d.ts +25 -0
  298. package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.js +42 -0
  299. package/dist/src/storage/sqlite/fts.d.ts +2 -0
  300. package/dist/src/storage/sqlite/fts.js +29 -1
  301. package/dist/src/storage/sqlite/index.d.ts +6 -6
  302. package/dist/src/storage/sqlite/index.js +7 -7
  303. package/dist/src/storage/sqlite/knowledge-repository.d.ts +9 -2
  304. package/dist/src/storage/sqlite/knowledge-repository.js +58 -10
  305. package/dist/src/storage/sqlite/memory-records-repository.d.ts +7 -56
  306. package/dist/src/storage/sqlite/memory-records-repository.js +68 -218
  307. package/dist/src/storage/sqlite/migrations/109_endpoint_principals.sql +14 -0
  308. package/dist/src/storage/sqlite/migrations/110_session_input_origin.sql +43 -0
  309. package/dist/src/storage/sqlite/migrations/111_endpoint_tool_invocations.sql +18 -0
  310. package/dist/src/storage/sqlite/migrations/112_endpoint_instance_bindings.sql +8 -0
  311. package/dist/src/storage/sqlite/migrations/113_memory_evidence_single_source.sql +54 -0
  312. package/dist/src/storage/sqlite/migrations/114_user_context_domain.sql +193 -0
  313. package/dist/src/storage/sqlite/migrations/115_remove_legacy_user_context.sql +6 -0
  314. package/dist/src/storage/sqlite/migrations/116_structured_context_consolidation.sql +38 -0
  315. package/dist/src/storage/sqlite/migrations/117_unified_understanding_sources.sql +110 -0
  316. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  317. package/dist/src/storage/sqlite/migrations/runner.js +3 -3
  318. package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
  319. package/dist/src/storage/sqlite/schema.js +1 -1
  320. package/dist/src/storage/sqlite/schema.sql +0 -20
  321. package/dist/src/storage/sqlite/session-input-repository.d.ts +3 -0
  322. package/dist/src/storage/sqlite/session-input-repository.js +5 -3
  323. package/dist/src/storage/sqlite/user-context-quality-repository.d.ts +34 -0
  324. package/dist/src/storage/sqlite/user-context-quality-repository.js +74 -0
  325. package/dist/src/storage/sqlite/user-context-repository.d.ts +64 -0
  326. package/dist/src/storage/sqlite/user-context-repository.js +383 -0
  327. package/dist/src/tasks/home-query-service.d.ts +1 -1
  328. package/dist/src/tui/backends/embedded-backend.js +5 -2
  329. package/dist/src/tui/backends/{gateway-sse-backend.d.ts → gateway-realtime-backend.d.ts} +13 -10
  330. package/dist/src/tui/backends/{gateway-sse-backend.js → gateway-realtime-backend.js} +114 -151
  331. package/dist/src/tui/tool-summary.js +1 -7
  332. package/dist/src/tui/tui-agent-events.d.ts +0 -1
  333. package/dist/src/tui/tui-agent-events.js +2 -15
  334. package/dist/src/tui/tui-backend.d.ts +4 -4
  335. package/dist/src/tui/tui-run-state.js +0 -4
  336. package/dist/src/tui/tui-startup-resources.js +1 -2
  337. package/dist/src/tui/tui-types.d.ts +2 -9
  338. package/dist/src/tui/tui-types.js +0 -1
  339. package/dist/src/tui/tui.js +5 -5
  340. package/dist/src/tunnel/gateway-lifecycle.d.ts +1 -1
  341. package/dist/src/tunnel/gateway-lifecycle.js +1 -1
  342. package/dist/src/user-context/config.d.ts +17 -210
  343. package/dist/src/user-context/config.js +19 -85
  344. package/dist/src/user-context/consolidation.d.ts +26 -0
  345. package/dist/src/user-context/consolidation.js +115 -0
  346. package/dist/src/user-context/domain.d.ts +75 -0
  347. package/dist/src/user-context/domain.js +4 -0
  348. package/dist/src/user-context/manual-understanding.d.ts +7 -14
  349. package/dist/src/user-context/manual-understanding.js +19 -49
  350. package/dist/src/{agent/memory/context → user-context}/planner.d.ts +5 -6
  351. package/dist/src/user-context/planner.js +311 -0
  352. package/dist/src/user-context/relationship-continuity.d.ts +3 -6
  353. package/dist/src/user-context/relationship-continuity.js +39 -32
  354. package/dist/src/user-context/sources/catalog.d.ts +2 -0
  355. package/dist/src/user-context/sources/catalog.js +149 -0
  356. package/dist/src/user-context/sources/index.d.ts +3 -0
  357. package/dist/src/user-context/sources/index.js +3 -0
  358. package/dist/src/user-context/sources/repository.d.ts +40 -0
  359. package/dist/src/user-context/sources/repository.js +164 -0
  360. package/dist/src/user-context/sources/types.d.ts +83 -0
  361. package/dist/src/user-context/understandingQuality.d.ts +5 -0
  362. package/dist/src/user-context/understandingQuality.js +44 -0
  363. package/dist/src/utils/logger/log-stream.d.ts +3 -10
  364. package/dist/src/utils/logger/log-stream.js +2 -73
  365. package/dist/src/utils/logger/pino-record.d.ts +1 -1
  366. package/dist/src/utils/logger/streams.js +1 -1
  367. package/dist/src/work-discovery/analyzer.d.ts +4 -3
  368. package/dist/src/work-discovery/analyzer.js +21 -16
  369. package/dist/src/work-discovery/incremental-repository.js +42 -40
  370. package/dist/src/work-discovery/index.js +3 -3
  371. package/dist/src/work-discovery/service.d.ts +7 -7
  372. package/dist/src/work-discovery/service.js +241 -190
  373. package/dist/src/work-discovery/source-repository.js +42 -53
  374. package/dist/src/work-discovery/types.d.ts +2 -14
  375. package/package.json +5 -7
  376. package/dist/gateway/static/root/assets/agents-C6OV-gMm.js +0 -2
  377. package/dist/gateway/static/root/assets/apps-page-Ci14lDeO.js +0 -1
  378. package/dist/gateway/static/root/assets/automations-page-Q1xmb4Rh.js +0 -6
  379. package/dist/gateway/static/root/assets/browser-settings-page-DbowrHXD.js +0 -8
  380. package/dist/gateway/static/root/assets/capabilities-settings-panel-DoZPFdKF.js +0 -7
  381. package/dist/gateway/static/root/assets/capability-presets-api-Dn-7MMEo.js +0 -1
  382. package/dist/gateway/static/root/assets/capability-presets-settings-panel-Bt8Hnx0h.js +0 -1
  383. package/dist/gateway/static/root/assets/channels-settings-Bpsebsru.js +0 -1
  384. package/dist/gateway/static/root/assets/channels-status-swr-DFmdYRE5.js +0 -1
  385. package/dist/gateway/static/root/assets/connector-logo-TRr9ybf6.js +0 -1
  386. package/dist/gateway/static/root/assets/connectors-page-Tg5kl22i.js +0 -2
  387. package/dist/gateway/static/root/assets/cron-expression-B3B1eqnr.js +0 -2
  388. package/dist/gateway/static/root/assets/extension-settings-page-C9ag5tb5.js +0 -1
  389. package/dist/gateway/static/root/assets/gateway-settings-9g8uIry9.js +0 -1
  390. package/dist/gateway/static/root/assets/heartbeat-settings-fl1oC_-5.js +0 -1
  391. package/dist/gateway/static/root/assets/home-page-Bao9jq_z.js +0 -3
  392. package/dist/gateway/static/root/assets/index-Cl5n1f_U.css +0 -1
  393. package/dist/gateway/static/root/assets/index-OJgiMh07.js +0 -223
  394. package/dist/gateway/static/root/assets/local-app-workbench-page-B69NvtvH.js +0 -2
  395. package/dist/gateway/static/root/assets/locale-store-D6hs74o5.js +0 -1
  396. package/dist/gateway/static/root/assets/logs-page-Cq3cABqg.js +0 -7
  397. package/dist/gateway/static/root/assets/messages-D02NNLCZ.js +0 -3
  398. package/dist/gateway/static/root/assets/notes-workbench-BOZfJFhE.js +0 -4
  399. package/dist/gateway/static/root/assets/product-delivery-C8JbSj5Y.js +0 -1
  400. package/dist/gateway/static/root/assets/project-detail-page-TSKFb2tN.js +0 -1
  401. package/dist/gateway/static/root/assets/projects-page-BokeBrTT.js +0 -1
  402. package/dist/gateway/static/root/assets/remote-access-hub-C56anxCX.js +0 -1
  403. package/dist/gateway/static/root/assets/segmented-styles-BL8oLBEp.js +0 -1
  404. package/dist/gateway/static/root/assets/sessions-page-C7TQADrD.js +0 -1
  405. package/dist/gateway/static/root/assets/settings-advanced-gate-BDOPKeAX.js +0 -1
  406. package/dist/gateway/static/root/assets/settings-form-section-zxo5ZGOu.js +0 -1
  407. package/dist/gateway/static/root/assets/settings-page-BUPSIa9P.js +0 -1
  408. package/dist/gateway/static/root/assets/setup-status-panel-BRg766eW.js +0 -1
  409. package/dist/gateway/static/root/assets/shares-settings-DhEAviQ_.js +0 -1
  410. package/dist/gateway/static/root/assets/skill-reload-api-Ct7AV8ls.js +0 -1
  411. package/dist/gateway/static/root/assets/skills-page-DoVuprZm.js +0 -2
  412. package/dist/gateway/static/root/assets/time-picker-BGk_Tbsj.js +0 -1
  413. package/dist/gateway/static/root/assets/use-save-bar-registration-5aVSjTjO.js +0 -1
  414. package/dist/gateway/static/root/assets/user-context-page-B9K41qmy.js +0 -1
  415. package/dist/gateway/static/root/assets/work-discovery-page-BBVnRHju.js +0 -1
  416. package/dist/gateway/static/root/assets/workflows-page-Bs_tYfst.js +0 -11
  417. package/dist/src/agent/code-intelligence/binary.d.ts +0 -15
  418. package/dist/src/agent/code-intelligence/binary.js +0 -372
  419. package/dist/src/agent/code-intelligence/index.d.ts +0 -4
  420. package/dist/src/agent/code-intelligence/index.js +0 -4
  421. package/dist/src/agent/code-intelligence/runtime.d.ts +0 -34
  422. package/dist/src/agent/code-intelligence/runtime.js +0 -280
  423. package/dist/src/agent/code-intelligence/tool-gating.d.ts +0 -5
  424. package/dist/src/agent/code-intelligence/tool-gating.js +0 -6
  425. package/dist/src/agent/code-intelligence/tools.d.ts +0 -6
  426. package/dist/src/agent/code-intelligence/tools.js +0 -266
  427. package/dist/src/agent/code-intelligence/types.d.ts +0 -22
  428. package/dist/src/agent/memory/context/planner.js +0 -286
  429. package/dist/src/agent/memory/dreaming/config.d.ts +0 -48
  430. package/dist/src/agent/memory/dreaming/config.js +0 -98
  431. package/dist/src/agent/memory/dreaming/constants.d.ts +0 -12
  432. package/dist/src/agent/memory/dreaming/constants.js +0 -18
  433. package/dist/src/agent/memory/dreaming/deep-promotion.d.ts +0 -19
  434. package/dist/src/agent/memory/dreaming/deep-promotion.js +0 -152
  435. package/dist/src/agent/memory/dreaming/light-sweep.d.ts +0 -16
  436. package/dist/src/agent/memory/dreaming/light-sweep.js +0 -115
  437. package/dist/src/agent/memory/dreaming/preview.d.ts +0 -23
  438. package/dist/src/agent/memory/dreaming/preview.js +0 -52
  439. package/dist/src/agent/memory/dreaming/promotion-lifecycle.d.ts +0 -16
  440. package/dist/src/agent/memory/dreaming/promotion-lifecycle.js +0 -44
  441. package/dist/src/agent/memory/dreaming/rem-patterns.d.ts +0 -19
  442. package/dist/src/agent/memory/dreaming/rem-patterns.js +0 -150
  443. package/dist/src/agent/memory/dreaming/runner.d.ts +0 -10
  444. package/dist/src/agent/memory/dreaming/runner.js +0 -78
  445. package/dist/src/agent/memory/dreaming/schedule.d.ts +0 -23
  446. package/dist/src/agent/memory/dreaming/schedule.js +0 -38
  447. package/dist/src/agent/memory/dreaming/scope.d.ts +0 -11
  448. package/dist/src/agent/memory/dreaming/scope.js +0 -33
  449. package/dist/src/agent/memory/dreaming/utils.d.ts +0 -3
  450. package/dist/src/agent/memory/dreaming/utils.js +0 -31
  451. package/dist/src/agent/streaming/reasoning-visibility-sse.d.ts +0 -15
  452. package/dist/src/gateway/agent-run-relay.d.ts +0 -19
  453. package/dist/src/gateway/agent-run-relay.js +0 -169
  454. package/dist/src/gateway/hono/routes/memory.d.ts +0 -3
  455. package/dist/src/gateway/hono/routes/memory.js +0 -460
  456. package/dist/src/gateway/hono/sse.d.ts +0 -53
  457. package/dist/src/gateway/hono/sse.js +0 -207
  458. package/dist/src/gateway/service/sse-hub.d.ts +0 -10
  459. package/dist/src/gateway/service/sse-hub.js +0 -53
  460. package/dist/src/storage/sqlite/dreaming-repository.d.ts +0 -61
  461. package/dist/src/storage/sqlite/dreaming-repository.js +0 -88
  462. package/dist/src/storage/sqlite/memory-readiness-repository.d.ts +0 -7
  463. package/dist/src/storage/sqlite/memory-readiness-repository.js +0 -30
  464. package/dist/src/storage/sqlite/memory-reference-consent-repository.d.ts +0 -27
  465. package/dist/src/storage/sqlite/memory-reference-consent-repository.js +0 -107
  466. package/dist/src/storage/sqlite/user-claims-repository.d.ts +0 -101
  467. package/dist/src/storage/sqlite/user-claims-repository.js +0 -241
  468. package/dist/src/storage/sqlite/user-profile-setup-repository.d.ts +0 -3
  469. package/dist/src/storage/sqlite/user-profile-setup-repository.js +0 -32
  470. package/dist/src/tui/sse-consumer.d.ts +0 -15
  471. package/dist/src/tui/sse-consumer.js +0 -73
  472. package/dist/src/user-context/context-compiler.d.ts +0 -27
  473. package/dist/src/user-context/context-compiler.js +0 -48
  474. package/dist/src/user-context/import.d.ts +0 -12
  475. package/dist/src/user-context/import.js +0 -51
  476. package/dist/src/user-context/memory-episode-evaluator.d.ts +0 -32
  477. package/dist/src/user-context/memory-episode-evaluator.js +0 -35
  478. package/dist/src/user-context/memory-readiness.d.ts +0 -33
  479. package/dist/src/user-context/memory-readiness.js +0 -41
  480. package/dist/src/user-context/memory-use-audit.d.ts +0 -10
  481. package/dist/src/user-context/memory-use-audit.js +0 -26
  482. package/dist/src/user-context/personal-playbook.d.ts +0 -11
  483. package/dist/src/user-context/personal-playbook.js +0 -41
  484. package/dist/src/user-context/profile.d.ts +0 -37
  485. package/dist/src/user-context/profile.js +0 -163
  486. package/dist/src/user-context/projection.d.ts +0 -120
  487. package/dist/src/user-context/projection.js +0 -262
  488. package/dist/src/user-context/source-recommendations.d.ts +0 -13
  489. package/dist/src/user-context/source-recommendations.js +0 -85
  490. /package/dist/src/{agent/code-intelligence → user-context/sources}/types.js +0 -0
@@ -9,6 +9,8 @@
9
9
  import type { AgentTool } from '@earendil-works/pi-agent-core';
10
10
  import type { Model, Api } from '@earendil-works/pi-ai';
11
11
  import type { Config } from '../../config/schema.js';
12
+ import type { EndpointToolRuntime } from '../../endpoint-tools/index.js';
13
+ import type { TurnOrigin } from '@xopcai/endpoint-tools-protocol';
12
14
  import type { ExtensionRegistry } from '../../extensions/types/index.js';
13
15
  import type { MessageBus } from '../../infra/bus/index.js';
14
16
  import { type SkillInstallToolOptions, type SkillInstallToolResult, type MarketplaceSkillInstallToolOptions, type MarketplaceSkillInstallToolResult } from './index.js';
@@ -23,7 +25,6 @@ import type { LocalAppService } from '../../local-apps/index.js';
23
25
  import type { WorkflowRunServiceLike } from '../../workflows/service/workflow-run-service.types.js';
24
26
  import type { SkillManager } from '../skills/skill-manager.js';
25
27
  import { type ToolExecutorConfig } from './executor.js';
26
- import type { CodeIntelligenceRuntimeLike } from '../code-intelligence/index.js';
27
28
  export interface ToolFactoryDeps {
28
29
  workspace: string;
29
30
  extensionRegistry?: ExtensionRegistry;
@@ -31,7 +32,9 @@ export interface ToolFactoryDeps {
31
32
  channel: string;
32
33
  chatId: string;
33
34
  sessionKey: string;
35
+ origin: TurnOrigin;
34
36
  } | null;
37
+ endpointTools?: EndpointToolRuntime;
35
38
  hookRunner?: import('../../extensions/index.js').ExtensionHookRunner;
36
39
  bus: MessageBus;
37
40
  toolExecutorConfig?: Partial<ToolExecutorConfig>;
@@ -73,8 +76,6 @@ export interface ToolFactoryDeps {
73
76
  installSkillFromSource?: (opts: SkillInstallToolOptions) => Promise<SkillInstallToolResult>;
74
77
  /** Install a managed skill from a built-in marketplace provider. */
75
78
  installSkillFromMarketplace?: (opts: MarketplaceSkillInstallToolOptions) => Promise<MarketplaceSkillInstallToolResult>;
76
- /** Workspace-scoped structural code intelligence runtime. */
77
- getCodeIntelligenceRuntime?: (workspace: string) => CodeIntelligenceRuntimeLike;
78
79
  }
79
80
  export interface CreateCoreToolsOptions {
80
81
  /** Workspace root for file/command tools (defaults to factory workspace). */
@@ -43,7 +43,6 @@ import { createSkillsMarketplaceSearchTool } from "./skills-marketplace-search-t
43
43
  import { createSkillInstallTool } from "./skill-install-tool.js";
44
44
  import { createToolManualTool } from "./tool-manual-tool.js";
45
45
  import { createDesktopPetTool } from "./desktop-pet-tool.js";
46
- import { createCodeIntelligenceTools } from "../code-intelligence/tools.js";
47
46
  import { createManagedJobTool } from "./managed-job-tool.js";
48
47
  import { createImageTool } from "./image-tool.js";
49
48
  import { createImageGenerateTool } from "./image-generate-tool.js";
@@ -54,7 +53,6 @@ import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
54
53
  import { createTextToSpeechTool } from "./tts-tool.js";
55
54
  import { getAgentCapabilityToolNames } from "../capabilities/registry.js";
56
55
  import "../capabilities/index.js";
57
- import { isCodeIntelligenceEnabledForAgent } from "../code-intelligence/tool-gating.js";
58
56
  //#region src/agent/tools/factory.ts
59
57
  init_agent_scope();
60
58
  init_logger();
@@ -175,13 +173,12 @@ var AgentToolsFactory = class {
175
173
  workspace,
176
174
  agentId: options?.agentId ?? (cfg ? resolveDefaultAgentId(cfg) : "main")
177
175
  });
178
- const codeIntelligenceConfig = cfg?.codeIntelligence;
179
176
  const agentId = options?.agentId;
180
- const codeIntelligenceTools = isCodeIntelligenceEnabledForAgent(codeIntelligenceConfig, agentId) && this.deps.getCodeIntelligenceRuntime ? createCodeIntelligenceTools({ getRuntime: () => this.deps.getCodeIntelligenceRuntime(workspace) }) : [];
181
177
  const externalTools = createDefaultExternalToolGatewayTools({
182
178
  workspace,
183
179
  getConfig: () => this.deps.getConfig?.(),
184
180
  getCurrentContext: this.deps.getCurrentContext,
181
+ endpointTools: this.deps.endpointTools,
185
182
  agentId,
186
183
  extensionRegistry: this.deps.extensionRegistry,
187
184
  disabledTools: disabled,
@@ -198,11 +195,7 @@ var AgentToolsFactory = class {
198
195
  const find = createFindTool(workspace);
199
196
  return filterToolsByDisabledSet([
200
197
  createSessionStatusTool(),
201
- createDreamingTool({
202
- getWorkspace: () => workspace,
203
- getConfig: () => this.deps.getConfig?.(),
204
- getAgentId: () => options?.agentId
205
- }),
198
+ createDreamingTool({ getConfig: () => this.deps.getConfig?.() }),
206
199
  createToolManualTool(),
207
200
  createClarifyTool({ resolveAskUser: () => {
208
201
  const req = this.deps.gatewayClarify?.requestClarification;
@@ -253,7 +246,6 @@ var AgentToolsFactory = class {
253
246
  getSessionKey: () => this.deps.getCurrentContext()?.sessionKey
254
247
  })] : [],
255
248
  readTool,
256
- ...codeIntelligenceTools,
257
249
  writeTool,
258
250
  applyPatchTool,
259
251
  listDir,
@@ -33,7 +33,6 @@ export { createSkillsMarketplaceSearchTool, type SkillsMarketplaceSearchToolDeps
33
33
  export { createSkillInstallTool, type SkillInstallToolDeps, type SkillInstallToolOptions, type SkillInstallToolResult, type MarketplaceSkillInstallToolOptions, type MarketplaceSkillInstallToolResult, } from './skill-install-tool.js';
34
34
  export { createToolManualTool } from './tool-manual-tool.js';
35
35
  export { createDesktopPetTool, type DesktopPetCreateDetails } from './desktop-pet-tool.js';
36
- export { createCodeIntelligenceTools } from '../code-intelligence/tools.js';
37
36
  export { createManagedJobTool } from './managed-job-tool.js';
38
37
  export { createImageTool, resolveImageModelConfigForTool } from './image-tool.js';
39
38
  export { createImageGenerateTool, resolveImageGenerationModelConfigForTool } from './image-generate-tool.js';
@@ -37,9 +37,8 @@ import { createSkillsMarketplaceSearchTool } from "./skills-marketplace-search-t
37
37
  import { createSkillInstallTool } from "./skill-install-tool.js";
38
38
  import { createToolManualTool } from "./tool-manual-tool.js";
39
39
  import { createDesktopPetTool } from "./desktop-pet-tool.js";
40
- import { createCodeIntelligenceTools } from "../code-intelligence/tools.js";
41
40
  import { createManagedJobTool } from "./managed-job-tool.js";
42
41
  import { resolveImageModelConfigForTool } from "../image/tool-model-config.js";
43
42
  import { createImageTool } from "./image-tool.js";
44
43
  import { createImageGenerateTool, resolveImageGenerationModelConfigForTool } from "./image-generate-tool.js";
45
- export { BrowserManager, DEFAULT_DELEGATE_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_TOOL_METADATA, DEFAULT_WEB_EXTRACT_MAX_LENGTH, DELEGATE_BLOCKED_TOOLS, GREP_MAX_LINE_LENGTH, MAX_RAW_HTML_CHARS_FOR_WEB_EXTRACT, SANDBOX_ALLOWED_TOOLS, TodoStore, ToolConcurrencyController, assertBrowserUrlAllowed, buildSandboxToolMap, createApplyPatchTool, createAutomationTool, createBrowserRecipeTool, createClarifyTool, createCodeIntelligenceTools, createCreateShareTool, createDelegateTool, createDesktopPetTool, createDreamingTool, createExecCommandTool, createExecuteCodeTool, createFindTool, createGrepTool, createImageGenerateTool, createImageTool, createListDirTool, createManagedJobTool, createMemoryGetTool, createMemorySearchTool, createMessageTool, createReadFileTool, createReadMediaTool, createSendMediaTool, createSessionSearchTool, createSessionStatusTool, createSkillInstallTool, createSkillManageTool, createSkillViewTool, createSkillsListTool, createSkillsMarketplaceSearchTool, createTodoTool, createToolManualTool, createUpdatePlanTool, createWebExtractTool, createWebFetchTool, createWebSearchTool, createWorkflowTool, createWriteFileTool, createXopcUseTool, findTool, formatSize, fuzzyFindText, generateDiffString, getToolMetadata, grepTool, isShareToolAvailable, listDirTool, normalizeForFuzzyMatch, normalizeToLF, resolveImageGenerationModelConfigForTool, resolveImageModelConfigForTool, resolveToolLockMode, restoreLineEndings, stripBom, stripHtmlBoilerplate, truncateHead, truncateLine, truncateTail, writeFileTool };
44
+ export { BrowserManager, DEFAULT_DELEGATE_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_TOOL_METADATA, DEFAULT_WEB_EXTRACT_MAX_LENGTH, DELEGATE_BLOCKED_TOOLS, GREP_MAX_LINE_LENGTH, MAX_RAW_HTML_CHARS_FOR_WEB_EXTRACT, SANDBOX_ALLOWED_TOOLS, TodoStore, ToolConcurrencyController, assertBrowserUrlAllowed, buildSandboxToolMap, createApplyPatchTool, createAutomationTool, createBrowserRecipeTool, createClarifyTool, createCreateShareTool, createDelegateTool, createDesktopPetTool, createDreamingTool, createExecCommandTool, createExecuteCodeTool, createFindTool, createGrepTool, createImageGenerateTool, createImageTool, createListDirTool, createManagedJobTool, createMemoryGetTool, createMemorySearchTool, createMessageTool, createReadFileTool, createReadMediaTool, createSendMediaTool, createSessionSearchTool, createSessionStatusTool, createSkillInstallTool, createSkillManageTool, createSkillViewTool, createSkillsListTool, createSkillsMarketplaceSearchTool, createTodoTool, createToolManualTool, createUpdatePlanTool, createWebExtractTool, createWebFetchTool, createWebSearchTool, createWorkflowTool, createWriteFileTool, createXopcUseTool, findTool, formatSize, fuzzyFindText, generateDiffString, getToolMetadata, grepTool, isShareToolAvailable, listDirTool, normalizeForFuzzyMatch, normalizeToLF, resolveImageGenerationModelConfigForTool, resolveImageModelConfigForTool, resolveToolLockMode, restoreLineEndings, stripBom, stripHtmlBoilerplate, truncateHead, truncateLine, truncateTail, writeFileTool };
@@ -10,7 +10,7 @@ function createMemorySearchTool(options) {
10
10
  return {
11
11
  name: "memory_search",
12
12
  label: "🔍 Memory Search",
13
- description: "Search structured user-understanding records before answering questions about prior work, decisions, dates, people, preferences, or todos; returns ranked snippets with stable record ids.",
13
+ description: "Search workspace and connected-source memory records for prior work, decisions, dates, people, or todos; returns ranked snippets with stable record ids.",
14
14
  parameters: MemorySearchSchema,
15
15
  async execute(_toolCallId, params, _signal) {
16
16
  const { query, maxResults, minScore } = params;
@@ -5,11 +5,11 @@
5
5
  * `MemoryManager`) were created inline inside
6
6
  * `AgentManager.getWorkspaceRuntime` and cached in a private Map. They live
7
7
  * outside `AgentInstance` because multiple session keys for the same agent may
8
- * share a workspace. Skill, prompt, and code-intelligence state stays keyed by
9
- * agent and workspace, while memory comes from one process-wide user context.
8
+ * share a workspace. Skill and prompt state stays keyed by agent and workspace,
9
+ * while memory comes from one process-wide user context.
10
10
  *
11
11
  * Extracted so:
12
- * - `AgentManager` no longer juggles four sibling caches.
12
+ * - `AgentManager` no longer owns workspace-scoped runtime caches.
13
13
  * - Hot-reload teardown (`clearAll`) shuts down the shared user context once.
14
14
  * - Future per-workspace runtimes (e.g. embedding store, vector cache) plug in
15
15
  * through `getOrCreate` without touching `AgentManager`.
@@ -18,12 +18,10 @@ import type { Config } from '../../config/schema.js';
18
18
  import type { MemoryManager } from '../memory/manager.js';
19
19
  import { SkillManager } from '../skills/skill-manager.js';
20
20
  import { SystemPromptBuilder } from '../prompt/service-prompt-builder.js';
21
- import { CodeIntelligenceRuntime } from '../code-intelligence/index.js';
22
21
  export interface WorkspaceRuntime {
23
22
  skillManager: SkillManager;
24
23
  systemPromptBuilder: SystemPromptBuilder;
25
24
  memoryManager: MemoryManager;
26
- codeIntelligence: CodeIntelligenceRuntime;
27
25
  }
28
26
  export interface WorkspaceRuntimeRegistryOptions {
29
27
  /** Effective config snapshot accessor (must always return a value when called). */
@@ -1,17 +1,11 @@
1
- import { createLogger } from "../../utils/logger/index.js";
2
- import { init_logger } from "../../utils/logger.js";
3
1
  import { init_agent_session_key, normalizeAgentId } from "../../routing/agent-session-key.js";
4
2
  import { init_agent_scope, resolveAgentIdForWorkspacePath } from "../agent-scope.js";
5
3
  import { SkillManager } from "../skills/skill-manager.js";
6
4
  import { SystemPromptBuilder } from "../prompt/service-prompt-builder.js";
7
- import { CodeIntelligenceRuntime } from "../code-intelligence/runtime.js";
8
- import "../code-intelligence/index.js";
9
5
  import { UserContextRuntimeRegistry } from "../../user-context/runtime.js";
10
6
  //#region src/agent/workspace-runtime/registry.ts
11
7
  init_agent_session_key();
12
8
  init_agent_scope();
13
- init_logger();
14
- const log = createLogger("WorkspaceRuntimeRegistry");
15
9
  var WorkspaceRuntimeRegistry = class {
16
10
  runtimes = /* @__PURE__ */ new Map();
17
11
  notifiedWorkspacePaths = /* @__PURE__ */ new Set();
@@ -41,11 +35,7 @@ var WorkspaceRuntimeRegistry = class {
41
35
  config: cfg,
42
36
  skillManager
43
37
  }),
44
- memoryManager,
45
- codeIntelligence: new CodeIntelligenceRuntime({
46
- workspace: resolvedPath,
47
- getConfig: this.getConfig
48
- })
38
+ memoryManager
49
39
  };
50
40
  this.runtimes.set(runtimeKey, rt);
51
41
  if (!this.notifiedWorkspacePaths.has(resolvedPath)) {
@@ -63,12 +53,9 @@ var WorkspaceRuntimeRegistry = class {
63
53
  * Used by `AgentManager.updateAgentDefaults` and `AgentManager.dispose`.
64
54
  */
65
55
  async clearAll() {
66
- const toShutdown = [...this.runtimes.values()];
67
56
  this.runtimes.clear();
68
57
  this.notifiedWorkspacePaths.clear();
69
- await Promise.allSettled([this.userContextRuntimes.clear(), ...toShutdown.map((rt) => rt.codeIntelligence.dispose().catch((err) => {
70
- log.warn({ err }, "codeIntelligence.dispose failed");
71
- }))]);
58
+ await this.userContextRuntimes.clear();
72
59
  }
73
60
  };
74
61
  //#endregion
@@ -69,8 +69,8 @@ export declare const ModelPolicyPatchSchema: z.ZodObject<{
69
69
  }, z.core.$strict>;
70
70
  export declare const ToolModeSchema: z.ZodEnum<{
71
71
  allow: "allow";
72
- confirm: "confirm";
73
72
  deny: "deny";
73
+ confirm: "confirm";
74
74
  }>;
75
75
  export declare const ToolScopeSchema: z.ZodEnum<{
76
76
  workspace: "workspace";
@@ -80,8 +80,8 @@ export declare const ToolScopeSchema: z.ZodEnum<{
80
80
  export declare const ToolPolicySchema: z.ZodObject<{
81
81
  mode: z.ZodEnum<{
82
82
  allow: "allow";
83
- confirm: "confirm";
84
83
  deny: "deny";
84
+ confirm: "confirm";
85
85
  }>;
86
86
  scope: z.ZodOptional<z.ZodEnum<{
87
87
  workspace: "workspace";
@@ -97,8 +97,8 @@ export declare const ToolPolicySetSchema: z.ZodDefault<z.ZodObject<{
97
97
  builtin: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
98
98
  mode: z.ZodEnum<{
99
99
  allow: "allow";
100
- confirm: "confirm";
101
100
  deny: "deny";
101
+ confirm: "confirm";
102
102
  }>;
103
103
  scope: z.ZodOptional<z.ZodEnum<{
104
104
  workspace: "workspace";
@@ -114,8 +114,8 @@ export declare const ToolPolicySetSchema: z.ZodDefault<z.ZodObject<{
114
114
  servers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
115
115
  mode: z.ZodEnum<{
116
116
  allow: "allow";
117
- confirm: "confirm";
118
117
  deny: "deny";
118
+ confirm: "confirm";
119
119
  }>;
120
120
  scope: z.ZodOptional<z.ZodEnum<{
121
121
  workspace: "workspace";
@@ -130,8 +130,8 @@ export declare const ToolPolicySetSchema: z.ZodDefault<z.ZodObject<{
130
130
  tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
131
131
  mode: z.ZodEnum<{
132
132
  allow: "allow";
133
- confirm: "confirm";
134
133
  deny: "deny";
134
+ confirm: "confirm";
135
135
  }>;
136
136
  scope: z.ZodOptional<z.ZodEnum<{
137
137
  workspace: "workspace";
@@ -149,8 +149,8 @@ export declare const ToolPolicySetPatchSchema: z.ZodObject<{
149
149
  builtin: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
150
150
  mode: z.ZodEnum<{
151
151
  allow: "allow";
152
- confirm: "confirm";
153
152
  deny: "deny";
153
+ confirm: "confirm";
154
154
  }>;
155
155
  scope: z.ZodOptional<z.ZodEnum<{
156
156
  workspace: "workspace";
@@ -166,8 +166,8 @@ export declare const ToolPolicySetPatchSchema: z.ZodObject<{
166
166
  servers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
167
167
  mode: z.ZodEnum<{
168
168
  allow: "allow";
169
- confirm: "confirm";
170
169
  deny: "deny";
170
+ confirm: "confirm";
171
171
  }>;
172
172
  scope: z.ZodOptional<z.ZodEnum<{
173
173
  workspace: "workspace";
@@ -182,8 +182,8 @@ export declare const ToolPolicySetPatchSchema: z.ZodObject<{
182
182
  tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
183
183
  mode: z.ZodEnum<{
184
184
  allow: "allow";
185
- confirm: "confirm";
186
185
  deny: "deny";
186
+ confirm: "confirm";
187
187
  }>;
188
188
  scope: z.ZodOptional<z.ZodEnum<{
189
189
  workspace: "workspace";
@@ -319,8 +319,8 @@ export declare const AgentManifestSchema: z.ZodObject<{
319
319
  builtin: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
320
320
  mode: z.ZodEnum<{
321
321
  allow: "allow";
322
- confirm: "confirm";
323
322
  deny: "deny";
323
+ confirm: "confirm";
324
324
  }>;
325
325
  scope: z.ZodOptional<z.ZodEnum<{
326
326
  workspace: "workspace";
@@ -336,8 +336,8 @@ export declare const AgentManifestSchema: z.ZodObject<{
336
336
  servers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
337
337
  mode: z.ZodEnum<{
338
338
  allow: "allow";
339
- confirm: "confirm";
340
339
  deny: "deny";
340
+ confirm: "confirm";
341
341
  }>;
342
342
  scope: z.ZodOptional<z.ZodEnum<{
343
343
  workspace: "workspace";
@@ -352,8 +352,8 @@ export declare const AgentManifestSchema: z.ZodObject<{
352
352
  tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
353
353
  mode: z.ZodEnum<{
354
354
  allow: "allow";
355
- confirm: "confirm";
356
355
  deny: "deny";
356
+ confirm: "confirm";
357
357
  }>;
358
358
  scope: z.ZodOptional<z.ZodEnum<{
359
359
  workspace: "workspace";
@@ -451,8 +451,8 @@ export declare const AgentConfigEntrySchema: z.ZodObject<{
451
451
  builtin: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
452
452
  mode: z.ZodEnum<{
453
453
  allow: "allow";
454
- confirm: "confirm";
455
454
  deny: "deny";
455
+ confirm: "confirm";
456
456
  }>;
457
457
  scope: z.ZodOptional<z.ZodEnum<{
458
458
  workspace: "workspace";
@@ -468,8 +468,8 @@ export declare const AgentConfigEntrySchema: z.ZodObject<{
468
468
  servers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
469
469
  mode: z.ZodEnum<{
470
470
  allow: "allow";
471
- confirm: "confirm";
472
471
  deny: "deny";
472
+ confirm: "confirm";
473
473
  }>;
474
474
  scope: z.ZodOptional<z.ZodEnum<{
475
475
  workspace: "workspace";
@@ -484,8 +484,8 @@ export declare const AgentConfigEntrySchema: z.ZodObject<{
484
484
  tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
485
485
  mode: z.ZodEnum<{
486
486
  allow: "allow";
487
- confirm: "confirm";
488
487
  deny: "deny";
488
+ confirm: "confirm";
489
489
  }>;
490
490
  scope: z.ZodOptional<z.ZodEnum<{
491
491
  workspace: "workspace";
@@ -569,8 +569,8 @@ export declare const CapabilityPresetSchema: z.ZodObject<{
569
569
  builtin: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
570
570
  mode: z.ZodEnum<{
571
571
  allow: "allow";
572
- confirm: "confirm";
573
572
  deny: "deny";
573
+ confirm: "confirm";
574
574
  }>;
575
575
  scope: z.ZodOptional<z.ZodEnum<{
576
576
  workspace: "workspace";
@@ -586,8 +586,8 @@ export declare const CapabilityPresetSchema: z.ZodObject<{
586
586
  servers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
587
587
  mode: z.ZodEnum<{
588
588
  allow: "allow";
589
- confirm: "confirm";
590
589
  deny: "deny";
590
+ confirm: "confirm";
591
591
  }>;
592
592
  scope: z.ZodOptional<z.ZodEnum<{
593
593
  workspace: "workspace";
@@ -602,8 +602,8 @@ export declare const CapabilityPresetSchema: z.ZodObject<{
602
602
  tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
603
603
  mode: z.ZodEnum<{
604
604
  allow: "allow";
605
- confirm: "confirm";
606
605
  deny: "deny";
606
+ confirm: "confirm";
607
607
  }>;
608
608
  scope: z.ZodOptional<z.ZodEnum<{
609
609
  workspace: "workspace";
@@ -1,7 +1,7 @@
1
+ import { buildMemoryRuntime } from "./memory-runtime.js";
1
2
  import { checkBoundary } from "./boundary-guard.js";
2
3
  import { resolveModelRole } from "./model-router.js";
3
4
  import { buildRuntimeToolRegistry } from "./tool-registry.js";
4
- import { buildMemoryRuntime } from "./memory-runtime.js";
5
5
  import { resolveWorkflow, validateWorkflowForRuntime } from "./workflow-runtime.js";
6
6
  import { buildAgentRuntimeProfile } from "./runtime-profile.js";
7
7
  import { appendAgentRunEvent, createAgentRunTrace, finishAgentRunTrace, hashEffectiveManifest } from "./run-trace.js";
@@ -1,6 +1,6 @@
1
1
  import type { UserContextConfig } from '../user-context/config.js';
2
- export type MemorySource = 'session' | 'userProfile' | 'agentProfile' | 'understanding' | 'workspace' | 'connectedSources';
3
- export type MemoryWriteTarget = 'userProfile' | 'agentProfile' | 'understanding' | 'workspace';
2
+ export type MemorySource = 'session' | 'agentProfile' | 'understanding' | 'workspace';
3
+ export type MemoryWriteTarget = 'agentProfile' | 'understanding' | 'workspace';
4
4
  export type MemoryWriteDecision = 'allow' | 'confirm' | 'deny';
5
5
  export interface MemoryCandidate {
6
6
  target: MemoryWriteTarget;
@@ -1,9 +1,9 @@
1
1
  import { buildAgentManifestPromptSection } from "../agent-manifest/prompt.js";
2
2
  import "../agent-manifest/index.js";
3
+ import { buildMemoryRuntime } from "./memory-runtime.js";
3
4
  import { checkBoundary } from "./boundary-guard.js";
4
5
  import { resolveModelRole } from "./model-router.js";
5
6
  import { buildRuntimeToolRegistry } from "./tool-registry.js";
6
- import { buildMemoryRuntime } from "./memory-runtime.js";
7
7
  import { resolveWorkflow, validateWorkflowForRuntime } from "./workflow-runtime.js";
8
8
  //#region src/agent-runtime/runtime-profile.ts
9
9
  function buildAgentRuntimeProfile(params) {
@@ -1,5 +1,6 @@
1
1
  import type { WorkflowRunInputEnvelope } from '../../workflows/domain/index.js';
2
2
  import type { TaskCommand } from '@xopcai/gateway-contract';
3
+ import type { TurnOrigin } from '@xopcai/endpoint-tools-protocol';
3
4
  import type { WorkflowRunServiceLike } from '../../workflows/service/workflow-run-service.types.js';
4
5
  export type AutomationSchedule = {
5
6
  kind: 'once';
@@ -171,7 +172,7 @@ export interface AutomationDeps {
171
172
  applyAutomationModelOverride?: (sessionKey: string, model: string | undefined) => Promise<boolean>;
172
173
  };
173
174
  turnDispatcher?: {
174
- processDirect: (message: string, sessionKey: string, attachments?: unknown[], thinking?: string, options?: {
175
+ processDirect: (message: string, sessionKey: string, origin: TurnOrigin, attachments?: unknown[], thinking?: string, options?: {
175
176
  signal?: AbortSignal;
176
177
  runId?: string;
177
178
  deadlineAtMs?: number;
@@ -477,6 +477,13 @@ export declare const CreateAutomationSchema: z.ZodObject<{
477
477
  }, z.core.$strip>], "type">;
478
478
  }, z.core.$strict>], "kind">;
479
479
  description: z.ZodOptional<z.ZodString>;
480
+ safety: z.ZodOptional<z.ZodObject<{
481
+ mode: z.ZodEnum<{
482
+ suggest_only: "suggest_only";
483
+ ask_before_apply: "ask_before_apply";
484
+ auto_apply: "auto_apply";
485
+ }>;
486
+ }, z.core.$strict>>;
480
487
  trigger: z.ZodDiscriminatedUnion<[z.ZodObject<{
481
488
  kind: z.ZodLiteral<"manual">;
482
489
  }, z.core.$strict>, z.ZodObject<{
@@ -502,13 +509,6 @@ export declare const CreateAutomationSchema: z.ZodObject<{
502
509
  source: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
503
510
  payloadMatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
504
511
  }, z.core.$strict>], "kind">;
505
- safety: z.ZodOptional<z.ZodObject<{
506
- mode: z.ZodEnum<{
507
- suggest_only: "suggest_only";
508
- ask_before_apply: "ask_before_apply";
509
- auto_apply: "auto_apply";
510
- }>;
511
- }, z.core.$strict>>;
512
512
  afterRun: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
513
513
  kind: z.ZodLiteral<"none">;
514
514
  }, z.core.$strict>, z.ZodObject<{
@@ -656,23 +656,14 @@ export declare const UpdateAutomationSchema: z.ZodObject<{
656
656
  }, z.core.$strip>;
657
657
  }, z.core.$strip>], "type">;
658
658
  }, z.core.$strict>], "kind">>;
659
- state: z.ZodOptional<z.ZodDefault<z.ZodObject<{
660
- nextRunAtMs: z.ZodOptional<z.ZodNumber>;
661
- runningRunId: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
662
- lastRunAtMs: z.ZodOptional<z.ZodNumber>;
663
- lastRunStatus: z.ZodOptional<z.ZodEnum<{
664
- failed: "failed";
665
- succeeded: "succeeded";
666
- running: "running";
667
- queued: "queued";
668
- cancelled: "cancelled";
669
- timeout: "timeout";
670
- cancelling: "cancelling";
671
- }>>;
672
- lastError: z.ZodOptional<z.ZodString>;
673
- consecutiveFailures: z.ZodOptional<z.ZodNumber>;
674
- }, z.core.$strict>>>;
675
659
  description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
660
+ safety: z.ZodOptional<z.ZodOptional<z.ZodObject<{
661
+ mode: z.ZodEnum<{
662
+ suggest_only: "suggest_only";
663
+ ask_before_apply: "ask_before_apply";
664
+ auto_apply: "auto_apply";
665
+ }>;
666
+ }, z.core.$strict>>>;
676
667
  trigger: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
677
668
  kind: z.ZodLiteral<"manual">;
678
669
  }, z.core.$strict>, z.ZodObject<{
@@ -698,12 +689,21 @@ export declare const UpdateAutomationSchema: z.ZodObject<{
698
689
  source: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
699
690
  payloadMatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
700
691
  }, z.core.$strict>], "kind">>;
701
- safety: z.ZodOptional<z.ZodOptional<z.ZodObject<{
702
- mode: z.ZodEnum<{
703
- suggest_only: "suggest_only";
704
- ask_before_apply: "ask_before_apply";
705
- auto_apply: "auto_apply";
706
- }>;
692
+ state: z.ZodOptional<z.ZodDefault<z.ZodObject<{
693
+ nextRunAtMs: z.ZodOptional<z.ZodNumber>;
694
+ runningRunId: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
695
+ lastRunAtMs: z.ZodOptional<z.ZodNumber>;
696
+ lastRunStatus: z.ZodOptional<z.ZodEnum<{
697
+ failed: "failed";
698
+ succeeded: "succeeded";
699
+ running: "running";
700
+ queued: "queued";
701
+ cancelled: "cancelled";
702
+ timeout: "timeout";
703
+ cancelling: "cancelling";
704
+ }>>;
705
+ lastError: z.ZodOptional<z.ZodString>;
706
+ consecutiveFailures: z.ZodOptional<z.ZodNumber>;
707
707
  }, z.core.$strict>>>;
708
708
  afterRun: z.ZodOptional<z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
709
709
  kind: z.ZodLiteral<"none">;
@@ -102,6 +102,9 @@ export declare function buildAutomationDraftResponse(draft: GeneratedAutomationD
102
102
  };
103
103
  };
104
104
  description?: string;
105
+ safety?: {
106
+ mode: "suggest_only" | "ask_before_apply" | "auto_apply";
107
+ };
105
108
  trigger?: {
106
109
  kind: "manual";
107
110
  } | {
@@ -127,9 +130,6 @@ export declare function buildAutomationDraftResponse(draft: GeneratedAutomationD
127
130
  source?: string;
128
131
  payloadMatch?: Record<string, string | number | boolean>;
129
132
  };
130
- safety?: {
131
- mode: "suggest_only" | "ask_before_apply" | "auto_apply";
132
- };
133
133
  afterRun?: {
134
134
  kind: "none";
135
135
  } | {
@@ -177,7 +177,10 @@ var AutomationActionExecutor = class {
177
177
  model: action.model
178
178
  }, "Automation model override invalid; using agent default");
179
179
  }
180
- const response = await agentService.turnDispatcher.processDirect(buildSafetyInstruction(automation, action.instruction), sessionKey, void 0, void 0, {
180
+ const response = await agentService.turnDispatcher.processDirect(buildSafetyInstruction(automation, action.instruction), sessionKey, {
181
+ type: "system",
182
+ source: "automation"
183
+ }, void 0, void 0, {
181
184
  signal,
182
185
  runId: run.id,
183
186
  deadlineAtMs
@@ -18,7 +18,7 @@ export type IssuePairingChallengeParams = {
18
18
  };
19
19
  /**
20
20
  * OpenClaw-style pairing: mint or refresh a pending code; notify the user only on new codes.
21
- * Repeat DMs refresh lastSeenAt and broadcast SSE without re-sending the bot message.
21
+ * Repeat DMs refresh lastSeenAt and publish realtime status without re-sending the bot message.
22
22
  */
23
23
  export declare function issuePairingChallenge(params: IssuePairingChallengeParams): Promise<{
24
24
  created: boolean;
@@ -4,7 +4,7 @@ import { broadcastPairingEvent } from "./pairing-events.js";
4
4
  //#region src/channels/pairing/pairing-challenge.ts
5
5
  /**
6
6
  * OpenClaw-style pairing: mint or refresh a pending code; notify the user only on new codes.
7
- * Repeat DMs refresh lastSeenAt and broadcast SSE without re-sending the bot message.
7
+ * Repeat DMs refresh lastSeenAt and publish realtime status without re-sending the bot message.
8
8
  */
9
9
  async function issuePairingChallenge(params) {
10
10
  const normalizedAccountId = params.accountId.trim().toLowerCase() || "default";
@@ -1,8 +1,6 @@
1
- import { init_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope.js";
2
1
  import { commandRegistry } from "../registry.js";
3
2
  import { createManualUnderstanding } from "../../user-context/manual-understanding.js";
4
3
  //#region src/chat-commands/builtins/understanding.ts
5
- init_agent_scope();
6
4
  function parseRememberArgs(args) {
7
5
  const trimmed = args.trim();
8
6
  if (trimmed !== "--session" && !trimmed.startsWith("--session ")) return {
@@ -29,12 +27,11 @@ const rememberCommand = {
29
27
  success: false
30
28
  };
31
29
  const result = createManualUnderstanding({
32
- agentId: resolveDefaultAgentId(ctx.config),
33
30
  content,
34
31
  kind: "derived_insight",
35
32
  scope: sessionOnly ? {
36
33
  type: "session",
37
- sessionKey: ctx.sessionKey
34
+ id: ctx.sessionKey
38
35
  } : { type: "global" },
39
36
  sensitivity: "normal",
40
37
  durability: sessionOnly ? "ephemeral" : "durable",
@@ -76,7 +73,7 @@ const learningCommand = {
76
73
  success: false
77
74
  };
78
75
  if (action !== "status") await store.update(ctx.sessionKey, { userContextMode: action === "off" ? "off" : "enabled" });
79
- const globallyEnabled = ctx.config.userContext.enabled && ctx.config.userContext.memory.mode !== "off";
76
+ const globallyEnabled = ctx.config.userContext.enabled;
80
77
  return {
81
78
  content: globallyEnabled && (await store.get(ctx.sessionKey))?.userContextMode !== "off" ? "User understanding is enabled for this conversation." : globallyEnabled ? "User understanding is off for this conversation. Existing chat history is still stored; use /remember for anything you explicitly want saved." : "User understanding is disabled globally. Existing chat history is still stored.",
82
79
  success: true
@@ -28,7 +28,10 @@ function formatToolArgs(args) {
28
28
  */
29
29
  async function renderStreamToTerminal(agent, message, sessionKey) {
30
30
  const stamped = message.trimStart().startsWith("/") ? message : prependEnvelopeTimestamp(message);
31
- const stream = agent.turnDispatcher.processDirectStreaming(stamped, sessionKey);
31
+ const stream = agent.turnDispatcher.processDirectStreaming(stamped, sessionKey, {
32
+ type: "system",
33
+ source: "cli"
34
+ });
32
35
  let responseText = "";
33
36
  let isFirstToken = true;
34
37
  let isInThinking = false;
@@ -52,7 +52,7 @@ async function checkDatabaseSchema(ctx) {
52
52
  id: "database-schema",
53
53
  label: "Database schema",
54
54
  status: "pass",
55
- message: `SQLite schema v${status.dbVersion} (current release v108).`,
55
+ message: `SQLite schema v${status.dbVersion} (current release v117).`,
56
56
  hints: []
57
57
  };
58
58
  }
@@ -3,9 +3,9 @@ import { init_loader, loadConfig } from "../../config/loader.js";
3
3
  import { downloadExtensionStoreZipBuffer, resolveExtensionZipDownloadUrl, resolveExtensionsStoreBaseUrl, verifyStoreArtifactSha256 } from "../../agent/skills/marketplace/adapters/store/store-api-client.js";
4
4
  import { getContextWithOpts } from "../context.js";
5
5
  import { getExtensionLockfileManager } from "../../extensions/lockfile.js";
6
- import { fetchRegistry, findExtension, getExtensionMarketplaceStoreBaseUrl, listExtensions, searchExtensions } from "../../extensions/marketplace.js";
7
6
  import { installFromLocal, installFromNpm, peekExtensionManifestFromStoreZip } from "../../extensions/install.js";
8
7
  import { commitStagedExtensionInstall, finalizeStagedExtensionInstall, rollbackStagedExtensionInstall, stageExtensionStoreZip } from "../../extensions/install-transaction.js";
8
+ import { fetchRegistry, findExtension, getExtensionMarketplaceStoreBaseUrl, listExtensions, searchExtensions } from "../../extensions/marketplace.js";
9
9
  import { colors } from "../utils/colors.js";
10
10
  import { validateExtensionPackageDirectory } from "./extension-pack.js";
11
11
  import { join, resolve } from "node:path";